From 5bda2b64f4c79998272f39ac837508813160084c Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 23 May 2026 19:31:26 +0200 Subject: [PATCH] feat(dashboard): open Player Dashboard in a new tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The πŸ‘₯ Dashboard button used to open the player table as a draggable in-app window, which competed for screen space with the map. It now opens in a separate browser tab as a fullscreen page so users can put the dashboard on a second monitor. How: - App.tsx branches on ?view=dashboard β†’ renders PlayerDashboardFullPage (new file in components/) instead of the default MapLayout. - SidebarWindowButtons.tsx: πŸ‘₯ Dashboard onClick now does window.open('/?view=dashboard', '_blank', 'noopener'). Label shows 'β†—' so users know it's an external open. - PlayerDashboardWindow.tsx refactored: extracted the sortable table body into a reusable PlayerDashboardContent component. The old window shell stays registered in WindowRenderer for backward compat β€” just no longer reachable from the default sidebar. - map-layout.css: new .ml-dashboard-page rules for fullscreen layout. Each tab gets its own useLiveData + WebSocket connection (server already handles multiple browser clients). The new tab inherits the session cookie from the original tab β€” no re-login. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/App.tsx | 20 +++ .../components/PlayerDashboardFullPage.tsx | 51 +++++++ .../sidebar/SidebarWindowButtons.tsx | 3 +- .../windows/PlayerDashboardWindow.tsx | 124 ++++++++++-------- frontend/src/styles/map-layout.css | 42 ++++++ ...y7Dpy1.js => AdminUsersWindow-DKxAPN9c.js} | 2 +- ...ow-Bk40GB4J.js => AgentWindow-Bwz75p50.js} | 2 +- ...rrpU--7.js => CharacterWindow-B7YBkp-L.js} | 2 +- ...Gplv.js => CombatPickerWindow-DO9GiqPu.js} | 2 +- ...kDKIY.js => CombatStatsWindow-D1mRyTZ9.js} | 2 +- ...VjaqxW-.js => InventoryWindow-ZxZJFETP.js} | 2 +- ...w-C_A54UOW.js => IssuesWindow-BxSy4plP.js} | 2 +- .../assets/PlayerDashboardWindow-qdSQRhha.js | 1 - ...4Ths2.js => QuestStatusWindow-DCQZBsLK.js} | 2 +- ...ow-B3i5zXC8.js => RadarWindow-DwR1V8eq.js} | 2 +- ...ow-B6zfbHhl.js => StatsWindow-DKBKOgS_.js} | 2 +- ...2yWs.js => VitalSharingWindow-Cqg_448n.js} | 2 +- static/assets/index-3SHiQu4l.js | 34 ----- ...{index-Hl9Lf_CI.css => index-C28HcMMD.css} | 2 +- static/assets/index-d7uW0_CB.js | 34 +++++ static/index.html | 4 +- 21 files changed, 233 insertions(+), 104 deletions(-) create mode 100644 frontend/src/components/PlayerDashboardFullPage.tsx rename static/assets/{AdminUsersWindow-C8y7Dpy1.js => AdminUsersWindow-DKxAPN9c.js} (98%) rename static/assets/{AgentWindow-Bk40GB4J.js => AgentWindow-Bwz75p50.js} (96%) rename static/assets/{CharacterWindow-DrrpU--7.js => CharacterWindow-B7YBkp-L.js} (99%) rename static/assets/{CombatPickerWindow-2NQUGplv.js => CombatPickerWindow-DO9GiqPu.js} (92%) rename static/assets/{CombatStatsWindow-DLWkDKIY.js => CombatStatsWindow-D1mRyTZ9.js} (99%) rename static/assets/{InventoryWindow-rVjaqxW-.js => InventoryWindow-ZxZJFETP.js} (99%) rename static/assets/{IssuesWindow-C_A54UOW.js => IssuesWindow-BxSy4plP.js} (99%) delete mode 100644 static/assets/PlayerDashboardWindow-qdSQRhha.js rename static/assets/{QuestStatusWindow-DL34Ths2.js => QuestStatusWindow-DCQZBsLK.js} (96%) rename static/assets/{RadarWindow-B3i5zXC8.js => RadarWindow-DwR1V8eq.js} (99%) rename static/assets/{StatsWindow-B6zfbHhl.js => StatsWindow-DKBKOgS_.js} (93%) rename static/assets/{VitalSharingWindow-MVVa2yWs.js => VitalSharingWindow-Cqg_448n.js} (97%) delete mode 100644 static/assets/index-3SHiQu4l.js rename static/assets/{index-Hl9Lf_CI.css => index-C28HcMMD.css} (94%) create mode 100644 static/assets/index-d7uW0_CB.js diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 927963df..5c9433a8 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,8 +1,28 @@ import { MapLayout } from './components/map/MapLayout'; +import { PlayerDashboardFullPage } from './components/PlayerDashboardFullPage'; import { useLiveData } from './hooks/useLiveData'; import './styles/map-layout.css'; +/** + * Single SPA entry. Branches on `?view=` query param: + * /?view=dashboard β†’ fullscreen PlayerDashboardFullPage (new-tab target) + * / β†’ default map + sidebar layout + * + * We don't pull in react-router for one extra view β€” when a third view + * appears, swap this for proper routing. + */ export default function App() { + const view = new URLSearchParams(window.location.search).get('view'); + if (view === 'dashboard') { + return ; + } + // Default: full app with map + sidebar. + return ; +} + +/** Default map-and-sidebar layout. Split out so the dashboard tab doesn't + * spin up useLiveData twice for the same render. */ +function DefaultApp() { const data = useLiveData(); return ; } diff --git a/frontend/src/components/PlayerDashboardFullPage.tsx b/frontend/src/components/PlayerDashboardFullPage.tsx new file mode 100644 index 00000000..a86f3958 --- /dev/null +++ b/frontend/src/components/PlayerDashboardFullPage.tsx @@ -0,0 +1,51 @@ +import React, { useEffect, useState } from 'react'; +import { useLiveData } from '../hooks/useLiveData'; +import { PlayerDashboardContent } from './windows/PlayerDashboardWindow'; + +/** + * Fullscreen "Player Dashboard" page β€” rendered when the React app loads + * with `?view=dashboard` in the URL. Designed to be opened in a new tab + * by the sidebar's πŸ‘₯ Dashboard button so users can put the dashboard on + * a second monitor / its own window without occupying the map view. + * + * Each tab is its own React app instance with its own useLiveData + * (and therefore its own WebSocket to /ws/live). Independent of the main + * tab's lifecycle. + */ +export const PlayerDashboardFullPage: React.FC = () => { + const data = useLiveData(); + const [version, setVersion] = useState(''); + + // Set tab title. + useEffect(() => { + const prev = document.title; + document.title = 'Overlord Dashboard'; + return () => { document.title = prev; }; + }, []); + + // Fetch version stamp the same way MapLayout does. /api-version returns + // {version: "..."} where "..." is the BUILD_VERSION baked into the + // tracker container at image build time. + useEffect(() => { + fetch('/api/api-version', { credentials: 'include' }) + .then(r => r.json()) + .then(d => setVersion(d.version ?? '')) + .catch(() => { /* version is cosmetic β€” ignore failures */ }); + }, []); + + const count = Array.from(data.characters.values()).filter(c => c.telemetry).length; + + return ( +
+
+ πŸ‘₯ Player Dashboard + {count} online + + {version && v{version}} +
+
+ +
+
+ ); +}; diff --git a/frontend/src/components/sidebar/SidebarWindowButtons.tsx b/frontend/src/components/sidebar/SidebarWindowButtons.tsx index ee429e4a..5344c42d 100644 --- a/frontend/src/components/sidebar/SidebarWindowButtons.tsx +++ b/frontend/src/components/sidebar/SidebarWindowButtons.tsx @@ -18,7 +18,8 @@ export const SidebarWindowButtons: React.FC = () => { openWindow('agent', 'Overlord Assistant')}>πŸ€– Assistant openWindow('playerdash', 'Player Dashboard')}>πŸ‘₯ Dashboard + title="Opens the player dashboard in a new tab" + onClick={() => window.open('/?view=dashboard', '_blank', 'noopener')}>πŸ‘₯ Dashboard β†— openWindow('queststatus', 'Quest Status')}>πŸ“œ Quests ; } +interface WindowProps { id: string; zIndex: number; characters: Map; } +interface ContentProps { characters: Map; } type SortCol = 'name' | 'kills' | 'kph' | 'rares' | 'deaths' | 'uptime' | 'state'; -export const PlayerDashboardWindow: React.FC = ({ id, zIndex, characters }) => { +/** + * The actual sortable-table view. Pure presentational β€” pass in `characters`. + * Used by both the in-app draggable window AND the new-tab fullscreen page. + * Don't add window-chrome / sidebar concerns here. + */ +export const PlayerDashboardContent: React.FC = ({ characters }) => { const [sortCol, setSortCol] = useState('kph'); const [sortAsc, setSortAsc] = useState(false); @@ -61,57 +67,67 @@ export const PlayerDashboardWindow: React.FC = ({ id, zIndex, characters const arrow = (col: SortCol) => sortCol === col ? (sortAsc ? ' β–²' : ' β–Ό') : ''; return ( - -
- - - - - - - - - - - - - - - - - - {players.map(p => { - const stateLC = p.state.toLowerCase(); - const isActive = stateLC === 'combat' || stateLC === 'hunt'; - return ( - - - - - - - - - - - - - - ); - })} - -
toggleSort('name')}>Character{arrow('name')} toggleSort('state')}>State{arrow('state')} toggleSort('kph')}>KPH{arrow('kph')} toggleSort('kills')}>Session{arrow('kills')}Total toggleSort('rares')}>Rares{arrow('rares')} toggleSort('deaths')}>Deaths{arrow('deaths')} toggleSort('uptime')}>Uptime{arrow('uptime')}HP%VitaeTapers
{p.name} - {p.state} - {p.kph.toLocaleString()}{p.kills.toLocaleString()}{p.totalKills.toLocaleString()}{p.rares}{p.sessionRares > 0 ? ` (${p.sessionRares})` : ''} 0 ? '#c66' : '#555', fontVariantNumeric: 'tabular-nums' }}>{p.totalDeaths}{p.uptime} 80 ? '#4c4' : p.hp > 40 ? '#ca0' : '#c44' }}>{p.hp.toFixed(0)}% 0 ? '#f66' : '#333' }}>{p.vitae > 0 ? `${p.vitae}%` : ''}{p.tapers.toLocaleString()}
- {players.length === 0 && ( -
No characters online
- )} -
-
+
+ + + + + + + + + + + + + + + + + + {players.map(p => { + const stateLC = p.state.toLowerCase(); + const isActive = stateLC === 'combat' || stateLC === 'hunt'; + return ( + + + + + + + + + + + + + + ); + })} + +
toggleSort('name')}>Character{arrow('name')} toggleSort('state')}>State{arrow('state')} toggleSort('kph')}>KPH{arrow('kph')} toggleSort('kills')}>Session{arrow('kills')}Total toggleSort('rares')}>Rares{arrow('rares')} toggleSort('deaths')}>Deaths{arrow('deaths')} toggleSort('uptime')}>Uptime{arrow('uptime')}HP%VitaeTapers
{p.name} + {p.state} + {p.kph.toLocaleString()}{p.kills.toLocaleString()}{p.totalKills.toLocaleString()}{p.rares}{p.sessionRares > 0 ? ` (${p.sessionRares})` : ''} 0 ? '#c66' : '#555', fontVariantNumeric: 'tabular-nums' }}>{p.totalDeaths}{p.uptime} 80 ? '#4c4' : p.hp > 40 ? '#ca0' : '#c44' }}>{p.hp.toFixed(0)}% 0 ? '#f66' : '#333' }}>{p.vitae > 0 ? `${p.vitae}%` : ''}{p.tapers.toLocaleString()}
+ {players.length === 0 && ( +
No characters online
+ )} +
); }; + +/** + * In-app draggable window wrapper. Kept for backward compatibility β€” the + * sidebar button now opens the dashboard in a new tab via + * PlayerDashboardFullPage, so this component is no longer reachable + * via the default UI but still registered in WindowRenderer. + */ +export const PlayerDashboardWindow: React.FC = ({ id, zIndex, characters }) => ( + + + +); diff --git a/frontend/src/styles/map-layout.css b/frontend/src/styles/map-layout.css index f496700d..1b29f444 100644 --- a/frontend/src/styles/map-layout.css +++ b/frontend/src/styles/map-layout.css @@ -926,6 +926,48 @@ width: 160px; } +/* ── Fullscreen Player Dashboard (new-tab variant) ───── */ +.ml-dashboard-page { + display: flex; + flex-direction: column; + height: 100vh; + width: 100vw; + background: #111; + color: #ddd; + font-family: inherit; +} +.ml-dashboard-header { + display: flex; + align-items: center; + gap: 14px; + padding: 10px 16px; + background: #1a1a1a; + border-bottom: 1px solid #333; + font-size: 0.9rem; +} +.ml-dashboard-title { + font-weight: 600; + color: #cfcfff; + font-size: 1rem; +} +.ml-dashboard-count { + color: #6af; + font-variant-numeric: tabular-nums; + font-size: 0.85rem; +} +.ml-dashboard-version { + font-family: monospace; + font-size: 0.7rem; + color: #888; +} +.ml-dashboard-main { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + padding: 8px 12px; +} + /* ── Mobile ───────────────────────────────────────────── */ @media (max-width: 768px) { .ml-layout { flex-direction: column; } diff --git a/static/assets/AdminUsersWindow-C8y7Dpy1.js b/static/assets/AdminUsersWindow-DKxAPN9c.js similarity index 98% rename from static/assets/AdminUsersWindow-C8y7Dpy1.js rename to static/assets/AdminUsersWindow-DKxAPN9c.js index 8aa3ec54..4a1bd87b 100644 --- a/static/assets/AdminUsersWindow-C8y7Dpy1.js +++ b/static/assets/AdminUsersWindow-DKxAPN9c.js @@ -1 +1 @@ -import{e as I,r as t,l as _,f as L,g as N,h as W,j as e,D as F}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";function R(c){try{return new Date(c).toISOString().slice(0,10)}catch{return c}}const q=({id:c,zIndex:x})=>{const{user:j}=I(),[g,k]=t.useState([]),[w,p]=t.useState(!0),[b,n]=t.useState(null),[l,C]=t.useState(""),[i,f]=t.useState(""),[h,y]=t.useState(!1),[d,S]=t.useState(!1),[A,u]=t.useState(null),[o,m]=t.useState(""),r=t.useCallback(async()=>{p(!0),n(null);try{const s=await _();k(s.users??[])}catch(s){n(String(s))}finally{p(!1)}},[]);t.useEffect(()=>{r()},[r]);const U=t.useCallback(async s=>{if(s.preventDefault(),!l.trim()||i.length<4){n("Username required and password must be at least 4 chars");return}S(!0),n(null);try{await L(l.trim(),i,h),C(""),f(""),y(!1),await r()}catch(a){n(String(a))}finally{S(!1)}},[l,i,h,r]),v=t.useCallback(async s=>{n(null);try{await N(s.id,{is_admin:!s.is_admin}),await r()}catch(a){n(String(a))}},[r]),D=t.useCallback(async s=>{if(o.length<4){n("Password must be at least 4 characters");return}n(null);try{await N(s,{password:o}),u(null),m("")}catch(a){n(String(a))}},[o]),P=t.useCallback(async s=>{if(confirm(`Delete user "${s.username}"? This cannot be undone.`)){n(null);try{await W(s.id),await r()}catch(a){n(String(a))}}},[r]);return e.jsx(F,{id:c,title:"πŸ›‘οΈ Admin Β· Users",zIndex:x,width:620,height:540,children:e.jsxs("div",{className:"ml-admin",children:[b&&e.jsx("div",{className:"ml-admin-error",children:b}),e.jsxs("section",{className:"ml-admin-section",children:[e.jsx("h3",{children:"Add user"}),e.jsxs("form",{onSubmit:U,className:"ml-admin-create",children:[e.jsx("input",{type:"text",placeholder:"Username",value:l,onChange:s=>C(s.target.value),disabled:d,autoComplete:"off"}),e.jsx("input",{type:"password",placeholder:"Password (min 4)",value:i,onChange:s=>f(s.target.value),disabled:d,autoComplete:"new-password"}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:h,onChange:s=>y(s.target.checked),disabled:d}),"admin"]}),e.jsx("button",{type:"submit",disabled:d||!l.trim()||i.length<4,children:d?"Adding…":"Add"})]})]}),e.jsxs("section",{className:"ml-admin-section",children:[e.jsxs("h3",{children:["Users ",w&&e.jsx("span",{className:"ml-admin-muted",children:"(loading…)"})]}),e.jsxs("table",{className:"ml-admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"Username"}),e.jsx("th",{children:"Admin"}),e.jsx("th",{children:"Created"}),e.jsx("th",{children:"Actions"})]})}),e.jsxs("tbody",{children:[g.map(s=>{const a=j!=null&&j.username.toLowerCase()===s.username.toLowerCase();return e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsxs("td",{children:[s.username,a&&e.jsx("span",{className:"ml-admin-muted",children:" (you)"})]}),e.jsx("td",{children:e.jsx("button",{className:"ml-admin-toggle",onClick:()=>v(s),title:"Click to toggle admin",children:s.is_admin?"βœ“":"–"})}),e.jsx("td",{children:R(s.created_at)}),e.jsx("td",{children:A===s.id?e.jsxs("span",{className:"ml-admin-pw-edit",children:[e.jsx("input",{type:"text",placeholder:"New password",value:o,onChange:E=>m(E.target.value),autoFocus:!0}),e.jsx("button",{onClick:()=>D(s.id),children:"Save"}),e.jsx("button",{onClick:()=>{u(null),m("")},children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{u(s.id),m("")},children:"Reset PW"}),!a&&e.jsx("button",{className:"ml-admin-danger",onClick:()=>P(s),children:"Delete"})]})})]},s.id)}),g.length===0&&!w&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"ml-admin-muted",children:"No users."})})]})]})]})]})})};export{q as AdminUsersWindow}; +import{e as I,r as t,l as _,f as L,g as N,h as W,j as e,D as F}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";function R(c){try{return new Date(c).toISOString().slice(0,10)}catch{return c}}const q=({id:c,zIndex:x})=>{const{user:j}=I(),[g,k]=t.useState([]),[w,p]=t.useState(!0),[b,n]=t.useState(null),[l,C]=t.useState(""),[i,f]=t.useState(""),[h,y]=t.useState(!1),[d,S]=t.useState(!1),[A,u]=t.useState(null),[o,m]=t.useState(""),r=t.useCallback(async()=>{p(!0),n(null);try{const s=await _();k(s.users??[])}catch(s){n(String(s))}finally{p(!1)}},[]);t.useEffect(()=>{r()},[r]);const U=t.useCallback(async s=>{if(s.preventDefault(),!l.trim()||i.length<4){n("Username required and password must be at least 4 chars");return}S(!0),n(null);try{await L(l.trim(),i,h),C(""),f(""),y(!1),await r()}catch(a){n(String(a))}finally{S(!1)}},[l,i,h,r]),v=t.useCallback(async s=>{n(null);try{await N(s.id,{is_admin:!s.is_admin}),await r()}catch(a){n(String(a))}},[r]),D=t.useCallback(async s=>{if(o.length<4){n("Password must be at least 4 characters");return}n(null);try{await N(s,{password:o}),u(null),m("")}catch(a){n(String(a))}},[o]),P=t.useCallback(async s=>{if(confirm(`Delete user "${s.username}"? This cannot be undone.`)){n(null);try{await W(s.id),await r()}catch(a){n(String(a))}}},[r]);return e.jsx(F,{id:c,title:"πŸ›‘οΈ Admin Β· Users",zIndex:x,width:620,height:540,children:e.jsxs("div",{className:"ml-admin",children:[b&&e.jsx("div",{className:"ml-admin-error",children:b}),e.jsxs("section",{className:"ml-admin-section",children:[e.jsx("h3",{children:"Add user"}),e.jsxs("form",{onSubmit:U,className:"ml-admin-create",children:[e.jsx("input",{type:"text",placeholder:"Username",value:l,onChange:s=>C(s.target.value),disabled:d,autoComplete:"off"}),e.jsx("input",{type:"password",placeholder:"Password (min 4)",value:i,onChange:s=>f(s.target.value),disabled:d,autoComplete:"new-password"}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:h,onChange:s=>y(s.target.checked),disabled:d}),"admin"]}),e.jsx("button",{type:"submit",disabled:d||!l.trim()||i.length<4,children:d?"Adding…":"Add"})]})]}),e.jsxs("section",{className:"ml-admin-section",children:[e.jsxs("h3",{children:["Users ",w&&e.jsx("span",{className:"ml-admin-muted",children:"(loading…)"})]}),e.jsxs("table",{className:"ml-admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"Username"}),e.jsx("th",{children:"Admin"}),e.jsx("th",{children:"Created"}),e.jsx("th",{children:"Actions"})]})}),e.jsxs("tbody",{children:[g.map(s=>{const a=j!=null&&j.username.toLowerCase()===s.username.toLowerCase();return e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsxs("td",{children:[s.username,a&&e.jsx("span",{className:"ml-admin-muted",children:" (you)"})]}),e.jsx("td",{children:e.jsx("button",{className:"ml-admin-toggle",onClick:()=>v(s),title:"Click to toggle admin",children:s.is_admin?"βœ“":"–"})}),e.jsx("td",{children:R(s.created_at)}),e.jsx("td",{children:A===s.id?e.jsxs("span",{className:"ml-admin-pw-edit",children:[e.jsx("input",{type:"text",placeholder:"New password",value:o,onChange:E=>m(E.target.value),autoFocus:!0}),e.jsx("button",{onClick:()=>D(s.id),children:"Save"}),e.jsx("button",{onClick:()=>{u(null),m("")},children:"Cancel"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>{u(s.id),m("")},children:"Reset PW"}),!a&&e.jsx("button",{className:"ml-admin-danger",onClick:()=>P(s),children:"Delete"})]})})]},s.id)}),g.length===0&&!w&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"ml-admin-muted",children:"No users."})})]})]})]})]})})};export{q as AdminUsersWindow}; diff --git a/static/assets/AgentWindow-Bk40GB4J.js b/static/assets/AgentWindow-Bwz75p50.js similarity index 96% rename from static/assets/AgentWindow-Bk40GB4J.js rename to static/assets/AgentWindow-Bwz75p50.js index a2b76ed7..634f6bba 100644 --- a/static/assets/AgentWindow-Bk40GB4J.js +++ b/static/assets/AgentWindow-Bwz75p50.js @@ -1 +1 @@ -import{r as n,b as w,c as k,d as E,j as t,D as I}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const h="overlord_agent_session_id";function v(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const s=l=>Math.floor(Math.random()*l);return`${s(4294967296).toString(16).padStart(8,"0")}-${s(65536).toString(16).padStart(4,"0")}-4${s(4096).toString(16).padStart(3,"0")}-${(8+s(4)).toString(16)}${s(4096).toString(16).padStart(3,"0")}-${s(281474976710656).toString(16).padStart(12,"0")}`}function $(){try{const l=localStorage.getItem(h);if(l)return l}catch{}const s=v();try{localStorage.setItem(h,s)}catch{}return s}const _=({id:s,zIndex:l})=>{const[o,j]=n.useState(()=>$()),[d,i]=n.useState([]),[g,m]=n.useState(""),[r,f]=n.useState(!1),[p,x]=n.useState(!0),S=n.useRef(null);n.useEffect(()=>{let e=!1;return x(!0),w(o).then(a=>{if(e)return;const c=(a.messages??[]).map(y=>({role:y.role,text:y.text}));i(c)}).catch(()=>{e||i([])}).finally(()=>{e||x(!1)}),()=>{e=!0}},[o]),n.useEffect(()=>{const e=S.current;e&&(e.scrollTop=e.scrollHeight)},[d.length,r]);const u=n.useCallback(async()=>{const e=g.trim();if(!(!e||r)){m(""),i(a=>[...a,{role:"user",text:e}]),f(!0);try{const a=await k(e,o);i(c=>[...c,{role:a.is_error?"error":"assistant",text:a.result||"(no response)"}])}catch(a){i(c=>[...c,{role:"error",text:`Request failed: ${String(a)}`}])}finally{f(!1)}}},[g,r,o]),N=n.useCallback(async()=>{if(r)return;let e="";try{e=(await E()).session_id}catch{e=v()}try{localStorage.setItem(h,e)}catch{}j(e),i([]),m("")},[r]),b=n.useCallback(e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),u())},[u]);return t.jsx(I,{id:s,title:"πŸ€– Overlord Assistant",zIndex:l,width:520,height:620,children:t.jsxs("div",{className:"ml-agent",children:[t.jsxs("div",{className:"ml-agent-toolbar",children:[t.jsx("button",{className:"ml-agent-btn",onClick:N,disabled:r,children:"+ New Chat"}),t.jsxs("span",{className:"ml-agent-session",title:o,children:[o.slice(0,8),"…"]})]}),t.jsxs("div",{className:"ml-agent-messages",ref:S,children:[p&&d.length===0&&t.jsx("div",{className:"ml-agent-empty",children:"Loading conversation…"}),!p&&d.length===0&&t.jsx("div",{className:"ml-agent-empty",children:"Ask anything about the live game state β€” players, kills, inventory, suitbuilder, recent rares, etc."}),d.map((e,a)=>t.jsxs("div",{className:`ml-agent-msg ml-agent-${e.role}`,children:[t.jsx("div",{className:"ml-agent-role",children:e.role==="user"?"You":e.role==="assistant"?"Overlord":"Error"}),t.jsx("div",{className:"ml-agent-text",children:e.text})]},a)),r&&t.jsxs("div",{className:"ml-agent-msg ml-agent-assistant",children:[t.jsx("div",{className:"ml-agent-role",children:"Overlord"}),t.jsx("div",{className:"ml-agent-text ml-agent-thinking",children:"Thinking…"})]})]}),t.jsxs("form",{className:"ml-agent-form",onSubmit:e=>{e.preventDefault(),u()},children:[t.jsx("textarea",{className:"ml-agent-input",value:g,onChange:e=>m(e.target.value),onKeyDown:b,placeholder:r?"Waiting for response…":"Type a message β€” Enter to send, Shift+Enter for newline",disabled:r,rows:2}),t.jsx("button",{type:"submit",className:"ml-agent-send",disabled:r||!g.trim(),children:"Send"})]})]})})};export{_ as AgentWindow}; +import{r as n,b as w,c as k,d as E,j as t,D as I}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const h="overlord_agent_session_id";function v(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const s=l=>Math.floor(Math.random()*l);return`${s(4294967296).toString(16).padStart(8,"0")}-${s(65536).toString(16).padStart(4,"0")}-4${s(4096).toString(16).padStart(3,"0")}-${(8+s(4)).toString(16)}${s(4096).toString(16).padStart(3,"0")}-${s(281474976710656).toString(16).padStart(12,"0")}`}function $(){try{const l=localStorage.getItem(h);if(l)return l}catch{}const s=v();try{localStorage.setItem(h,s)}catch{}return s}const _=({id:s,zIndex:l})=>{const[o,j]=n.useState(()=>$()),[d,i]=n.useState([]),[g,m]=n.useState(""),[r,f]=n.useState(!1),[p,x]=n.useState(!0),S=n.useRef(null);n.useEffect(()=>{let e=!1;return x(!0),w(o).then(a=>{if(e)return;const c=(a.messages??[]).map(y=>({role:y.role,text:y.text}));i(c)}).catch(()=>{e||i([])}).finally(()=>{e||x(!1)}),()=>{e=!0}},[o]),n.useEffect(()=>{const e=S.current;e&&(e.scrollTop=e.scrollHeight)},[d.length,r]);const u=n.useCallback(async()=>{const e=g.trim();if(!(!e||r)){m(""),i(a=>[...a,{role:"user",text:e}]),f(!0);try{const a=await k(e,o);i(c=>[...c,{role:a.is_error?"error":"assistant",text:a.result||"(no response)"}])}catch(a){i(c=>[...c,{role:"error",text:`Request failed: ${String(a)}`}])}finally{f(!1)}}},[g,r,o]),N=n.useCallback(async()=>{if(r)return;let e="";try{e=(await E()).session_id}catch{e=v()}try{localStorage.setItem(h,e)}catch{}j(e),i([]),m("")},[r]),b=n.useCallback(e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),u())},[u]);return t.jsx(I,{id:s,title:"πŸ€– Overlord Assistant",zIndex:l,width:520,height:620,children:t.jsxs("div",{className:"ml-agent",children:[t.jsxs("div",{className:"ml-agent-toolbar",children:[t.jsx("button",{className:"ml-agent-btn",onClick:N,disabled:r,children:"+ New Chat"}),t.jsxs("span",{className:"ml-agent-session",title:o,children:[o.slice(0,8),"…"]})]}),t.jsxs("div",{className:"ml-agent-messages",ref:S,children:[p&&d.length===0&&t.jsx("div",{className:"ml-agent-empty",children:"Loading conversation…"}),!p&&d.length===0&&t.jsx("div",{className:"ml-agent-empty",children:"Ask anything about the live game state β€” players, kills, inventory, suitbuilder, recent rares, etc."}),d.map((e,a)=>t.jsxs("div",{className:`ml-agent-msg ml-agent-${e.role}`,children:[t.jsx("div",{className:"ml-agent-role",children:e.role==="user"?"You":e.role==="assistant"?"Overlord":"Error"}),t.jsx("div",{className:"ml-agent-text",children:e.text})]},a)),r&&t.jsxs("div",{className:"ml-agent-msg ml-agent-assistant",children:[t.jsx("div",{className:"ml-agent-role",children:"Overlord"}),t.jsx("div",{className:"ml-agent-text ml-agent-thinking",children:"Thinking…"})]})]}),t.jsxs("form",{className:"ml-agent-form",onSubmit:e=>{e.preventDefault(),u()},children:[t.jsx("textarea",{className:"ml-agent-input",value:g,onChange:e=>m(e.target.value),onKeyDown:b,placeholder:r?"Waiting for response…":"Type a message β€” Enter to send, Shift+Enter for newline",disabled:r,rows:2}),t.jsx("button",{type:"submit",className:"ml-agent-send",disabled:r||!g.trim(),children:"Send"})]})]})})};export{_ as AgentWindow}; diff --git a/static/assets/CharacterWindow-DrrpU--7.js b/static/assets/CharacterWindow-B7YBkp-L.js similarity index 99% rename from static/assets/CharacterWindow-DrrpU--7.js rename to static/assets/CharacterWindow-B7YBkp-L.js index 4591442e..8575820f 100644 --- a/static/assets/CharacterWindow-DrrpU--7.js +++ b/static/assets/CharacterWindow-B7YBkp-L.js @@ -1 +1 @@ -import{r as f,a as J,j as e,D as K}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const F={218:"Reinforcement of the Lugians",219:"Bleeargh's Fortitude",220:"Oswald's Enhancement",221:"Siraluun's Blessing",222:"Enduring Calm",223:"Steadfast Will",224:"Ciandra's Essence",225:"Yoshi's Essence",226:"Jibril's Essence",227:"Celdiseth's Essence",228:"Koga's Essence",229:"Shadow of the Seventh Mule",230:"Might of the Seventh Mule",231:"Clutch of the Miser",232:"Enduring Enchantment",233:"Critical Protection",234:"Quick Learner",235:"Ciandra's Fortune",236:"Charmed Smith",237:"Innate Renewal",238:"Archmage's Endurance",239:"Enhancement of the Blade Turner",240:"Enhancement of the Arrow Turner",241:"Enhancement of the Mace Turner",242:"Caustic Enhancement",243:"Fierce Impaler",244:"Iron Skin of the Invincible",245:"Eye of the Remorseless",246:"Hand of the Remorseless",294:"Master of the Steel Circle",295:"Master of the Focused Eye",296:"Master of the Five Fold Path",297:"Frenzy of the Slayer",298:"Iron Skin of the Invincible",299:"Jack of All Trades",300:"Infused Void Magic",301:"Infused War Magic",302:"Infused Life Magic",309:"Infused Item Magic",310:"Infused Creature Magic",326:"Clutch of the Miser",328:"Enduring Enchantment"},B={333:"Valor / Destruction",334:"Protection",335:"Glory / Retribution",336:"Temperance / Hardening",338:"Aetheric Vision",339:"Mana Flow",340:"Mana Infusion",342:"Purity",343:"Craftsman",344:"Specialization",365:"World"},$={370:"Damage",371:"Damage Resistance",372:"Critical",373:"Critical Resistance",374:"Critical Damage",375:"Critical Damage Resistance",376:"Healing Boost",379:"Vitality"},W={287:"Celestial Hand",288:"Eldrytch Web",289:"Radiant Blood"},D={354:"Melee",355:"Ranged",362:"Summoning"},q={1:"Unarmed",2:"Swords",3:"Axes",4:"Maces",5:"Spears",6:"Daggers",7:"Staves",8:"Bows",9:"Crossbows",10:"Thrown",11:"Two-Handed",12:"Void",13:"War",14:"Life"},U={181:"Chess Rank",192:"Fishing Skill",199:"Total Augmentations",322:"Aetheria Slots",390:"Enlightenment"};function Q(c){return c>=1001?"Master":c>=301?"Lord":c>=151?"Knight":c>=31?"Adept":"Initiate"}const d="#af7a30",u="#000022",ee=({id:c,charName:g,zIndex:L,vitals:s,liveStats:O})=>{var _,N;const[H,P]=f.useState(null),[j,V]=f.useState(0),[m,G]=f.useState(0);f.useEffect(()=>{J(`/character-stats/${encodeURIComponent(g)}`).then(P).catch(()=>{})},[g]);const n=O||H,a=t=>t!=null?Number(t).toLocaleString():"β€”",o=(n==null?void 0:n.stats_data)||n||{},C=o.attributes||{},A=o.skills||{},Y=o.vitals||{},E=o.titles||[],h=o.properties||{},T=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Specialized").sort(([t],[l])=>t.localeCompare(l)),I=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Trained").sort(([t],[l])=>t.localeCompare(l)),S=Object.entries(h).filter(([t,l])=>F[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:F[parseInt(t)],uses:Number(l)})),w=Object.entries(h).filter(([t,l])=>B[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:B[parseInt(t)],uses:Number(l)})),z=Object.entries(h).filter(([t,l])=>$[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:$[parseInt(t)],value:Number(l)})),x=[];n!=null&&n.birth&&x.push({name:"Birth",value:n.birth}),(n==null?void 0:n.deaths)!=null&&x.push({name:"Deaths",value:a(n.deaths)}),Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);U[i]&&x.push({name:U[i],value:l})});const y=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);D[i]&&y.push({name:D[i],value:q[Number(l)]||`Unknown (${l})`})});const b=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);W[i]&&Number(l)>0&&b.push({name:W[i],rank:Q(Number(l)),value:Number(l)})});const R=t=>({padding:"5px 8px",fontSize:12,fontWeight:"bold",color:"#fff",cursor:"pointer",userSelect:"none",borderTop:`2px solid ${t?d:u}`,borderLeft:`2px solid ${t?d:u}`,borderRight:`2px solid ${t?d:u}`,background:t?"rgba(0,100,0,0.4)":"transparent"}),M={background:"#000",border:`2px solid ${d}`,maxHeight:400,overflowY:"auto",overflowX:"hidden"},r={background:"#222",fontWeight:"bold",fontSize:12,padding:"2px 6px"},k={padding:"2px 6px",background:"rgba(0,100,0,0.4)",whiteSpace:"nowrap"},p={padding:"2px 6px",background:"rgba(0,0,100,0.4)",textAlign:"right",whiteSpace:"nowrap"},X={padding:"2px 6px",color:"#ccc"};return e.jsx(K,{id:c,title:`Character: ${g}`,zIndex:L,width:740,height:600,children:e.jsxs("div",{style:{background:u,color:"#fff",font:'14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',overflowY:"auto",padding:"10px 15px 15px",flex:1},children:[e.jsxs("div",{style:{marginBottom:10},children:[e.jsxs("h1",{style:{margin:"0 0 2px",fontSize:28,fontWeight:"bold"},children:[g,e.jsx("span",{style:{fontSize:"200%",color:"#fff27f",float:"right"},children:(n==null?void 0:n.level)||""})]}),e.jsx("div",{style:{fontSize:"85%",color:"gold"},children:[n==null?void 0:n.gender,n==null?void 0:n.race].filter(Boolean).join(" ")||"Awaiting character data..."})]}),e.jsxs("div",{style:{fontSize:"85%",margin:"6px 0 10px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 20px"},children:[e.jsxs("div",{children:["Total XP: ",a(n==null?void 0:n.total_xp)]}),e.jsxs("div",{style:{textAlign:"right"},children:["Unassigned XP: ",a(n==null?void 0:n.unassigned_xp)]}),e.jsxs("div",{children:["Luminance: ",(n==null?void 0:n.luminance_earned)!=null?`${a(n.luminance_earned)} / ${a(n.luminance_total)}`:"β€”"]}),e.jsxs("div",{style:{textAlign:"right"},children:["Deaths: ",a(n==null?void 0:n.deaths)]})]}),e.jsxs("div",{style:{display:"flex",gap:13,flexWrap:"wrap"},children:[e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Attributes","Skills","Titles"].map((t,l)=>e.jsx("div",{style:R(j===l),onClick:()=>V(l),children:t},t))}),e.jsxs("div",{style:M,children:[j===0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 8px",display:"flex",flexDirection:"column",gap:8,borderBottom:`2px solid ${d}`},children:[{label:"Health",pct:(s==null?void 0:s.health_percentage)??0,cur:s==null?void 0:s.health_current,max:s==null?void 0:s.health_max,bg:"#cc3333"},{label:"Stamina",pct:(s==null?void 0:s.stamina_percentage)??0,cur:s==null?void 0:s.stamina_current,max:s==null?void 0:s.stamina_max,bg:"#ccaa33"},{label:"Mana",pct:(s==null?void 0:s.mana_percentage)??0,cur:s==null?void 0:s.mana_current,max:s==null?void 0:s.mana_max,bg:"#3366cc"}].map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:55,fontSize:12,color:"#ccc"},children:t.label}),e.jsx("div",{style:{flex:1,height:14,overflow:"hidden",position:"relative",border:`1px solid ${d}`},children:e.jsx("div",{style:{height:"100%",width:`${t.pct}%`,background:t.bg,transition:"width 0.5s ease"}})}),e.jsxs("span",{style:{width:80,textAlign:"right",fontSize:12,color:"#ccc"},children:[t.cur??"β€”"," / ",t.max??"β€”"]})]},t.label))}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Attribute"}),e.jsx("td",{style:r,children:"Creation"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["strength","endurance","coordination","quickness","focus","self"].map(t=>{var l,i;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:X,children:((l=C[t])==null?void 0:l.creation)??"β€”"}),e.jsx("td",{style:p,children:((i=C[t])==null?void 0:i.base)??"β€”"})]},t)})})]}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Vital"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["health","stamina","mana"].map(t=>{var l;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:p,children:((l=Y[t])==null?void 0:l.base)??"β€”"})]},t)})})]}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:e.jsxs("tr",{children:[e.jsx("td",{style:k,children:"Skill Credits"}),e.jsx("td",{style:p,children:a(o.skill_credits)})]})})})]}),j===1&&e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Skill"}),e.jsx("td",{style:r,children:"Level"})]})}),e.jsxs("tbody",{children:[T.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #392067, #392067, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #392067, #392067, black)"},children:l.base})]},t)),I.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:l.base})]},t)),T.length===0&&I.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:2,style:{padding:10,color:"#666",fontStyle:"italic",textAlign:"center"},children:"No skill data"})})]})]}),j===2&&e.jsx("div",{style:{padding:"6px 10px",fontSize:13},children:E.length>0?E.map((t,l)=>e.jsx("div",{style:{padding:"1px 0"},children:t},l)):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No titles"})})]})]}),e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Augmentations","Ratings","Other"].map((t,l)=>e.jsx("div",{style:R(m===l),onClick:()=>G(l),children:t},t))}),e.jsxs("div",{style:M,children:[m===0&&(S.length||w.length?e.jsxs(e.Fragment,{children:[S.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Augmentations"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:S.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]}),w.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Auras"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:w.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No augmentation data"})),m===1&&(z.length>0?e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Rating"}),e.jsx("td",{style:r,children:"Value"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No rating data"})),m===2&&e.jsxs("div",{children:[x.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"General"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:x.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Masteries"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:y.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),b.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Society"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsxs("td",{style:{padding:"2px 6px",textAlign:"right"},children:[t.rank," (",t.value,")"]})]},t.name))})})]}),x.length===0&&y.length===0&&b.length===0&&e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No additional data"})]})]})]})]}),(n==null?void 0:n.allegiance)&&e.jsxs("div",{style:{marginTop:5,border:`2px solid ${d}`,background:"#000"},children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Allegiance"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsxs("tbody",{children:[n.allegiance.name&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc",width:100},children:"Name"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.name})]}),((_=n.allegiance.monarch)==null?void 0:_.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Monarch"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.monarch.name})]}),((N=n.allegiance.patron)==null?void 0:N.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Patron"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.patron.name})]}),n.allegiance.rank!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Rank"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.rank})]}),n.allegiance.followers!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Followers"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.followers})]})]})})]})]})})};export{ee as CharacterWindow}; +import{r as f,a as J,j as e,D as K}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const F={218:"Reinforcement of the Lugians",219:"Bleeargh's Fortitude",220:"Oswald's Enhancement",221:"Siraluun's Blessing",222:"Enduring Calm",223:"Steadfast Will",224:"Ciandra's Essence",225:"Yoshi's Essence",226:"Jibril's Essence",227:"Celdiseth's Essence",228:"Koga's Essence",229:"Shadow of the Seventh Mule",230:"Might of the Seventh Mule",231:"Clutch of the Miser",232:"Enduring Enchantment",233:"Critical Protection",234:"Quick Learner",235:"Ciandra's Fortune",236:"Charmed Smith",237:"Innate Renewal",238:"Archmage's Endurance",239:"Enhancement of the Blade Turner",240:"Enhancement of the Arrow Turner",241:"Enhancement of the Mace Turner",242:"Caustic Enhancement",243:"Fierce Impaler",244:"Iron Skin of the Invincible",245:"Eye of the Remorseless",246:"Hand of the Remorseless",294:"Master of the Steel Circle",295:"Master of the Focused Eye",296:"Master of the Five Fold Path",297:"Frenzy of the Slayer",298:"Iron Skin of the Invincible",299:"Jack of All Trades",300:"Infused Void Magic",301:"Infused War Magic",302:"Infused Life Magic",309:"Infused Item Magic",310:"Infused Creature Magic",326:"Clutch of the Miser",328:"Enduring Enchantment"},B={333:"Valor / Destruction",334:"Protection",335:"Glory / Retribution",336:"Temperance / Hardening",338:"Aetheric Vision",339:"Mana Flow",340:"Mana Infusion",342:"Purity",343:"Craftsman",344:"Specialization",365:"World"},$={370:"Damage",371:"Damage Resistance",372:"Critical",373:"Critical Resistance",374:"Critical Damage",375:"Critical Damage Resistance",376:"Healing Boost",379:"Vitality"},W={287:"Celestial Hand",288:"Eldrytch Web",289:"Radiant Blood"},D={354:"Melee",355:"Ranged",362:"Summoning"},q={1:"Unarmed",2:"Swords",3:"Axes",4:"Maces",5:"Spears",6:"Daggers",7:"Staves",8:"Bows",9:"Crossbows",10:"Thrown",11:"Two-Handed",12:"Void",13:"War",14:"Life"},U={181:"Chess Rank",192:"Fishing Skill",199:"Total Augmentations",322:"Aetheria Slots",390:"Enlightenment"};function Q(c){return c>=1001?"Master":c>=301?"Lord":c>=151?"Knight":c>=31?"Adept":"Initiate"}const d="#af7a30",u="#000022",ee=({id:c,charName:g,zIndex:L,vitals:s,liveStats:O})=>{var _,N;const[H,P]=f.useState(null),[j,V]=f.useState(0),[m,G]=f.useState(0);f.useEffect(()=>{J(`/character-stats/${encodeURIComponent(g)}`).then(P).catch(()=>{})},[g]);const n=O||H,a=t=>t!=null?Number(t).toLocaleString():"β€”",o=(n==null?void 0:n.stats_data)||n||{},C=o.attributes||{},A=o.skills||{},Y=o.vitals||{},E=o.titles||[],h=o.properties||{},T=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Specialized").sort(([t],[l])=>t.localeCompare(l)),I=Object.entries(A).filter(([,t])=>(t==null?void 0:t.training)==="Trained").sort(([t],[l])=>t.localeCompare(l)),S=Object.entries(h).filter(([t,l])=>F[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:F[parseInt(t)],uses:Number(l)})),w=Object.entries(h).filter(([t,l])=>B[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:B[parseInt(t)],uses:Number(l)})),z=Object.entries(h).filter(([t,l])=>$[parseInt(t)]&&Number(l)>0).map(([t,l])=>({name:$[parseInt(t)],value:Number(l)})),x=[];n!=null&&n.birth&&x.push({name:"Birth",value:n.birth}),(n==null?void 0:n.deaths)!=null&&x.push({name:"Deaths",value:a(n.deaths)}),Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);U[i]&&x.push({name:U[i],value:l})});const y=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);D[i]&&y.push({name:D[i],value:q[Number(l)]||`Unknown (${l})`})});const b=[];Object.entries(h).forEach(([t,l])=>{const i=parseInt(t);W[i]&&Number(l)>0&&b.push({name:W[i],rank:Q(Number(l)),value:Number(l)})});const R=t=>({padding:"5px 8px",fontSize:12,fontWeight:"bold",color:"#fff",cursor:"pointer",userSelect:"none",borderTop:`2px solid ${t?d:u}`,borderLeft:`2px solid ${t?d:u}`,borderRight:`2px solid ${t?d:u}`,background:t?"rgba(0,100,0,0.4)":"transparent"}),M={background:"#000",border:`2px solid ${d}`,maxHeight:400,overflowY:"auto",overflowX:"hidden"},r={background:"#222",fontWeight:"bold",fontSize:12,padding:"2px 6px"},k={padding:"2px 6px",background:"rgba(0,100,0,0.4)",whiteSpace:"nowrap"},p={padding:"2px 6px",background:"rgba(0,0,100,0.4)",textAlign:"right",whiteSpace:"nowrap"},X={padding:"2px 6px",color:"#ccc"};return e.jsx(K,{id:c,title:`Character: ${g}`,zIndex:L,width:740,height:600,children:e.jsxs("div",{style:{background:u,color:"#fff",font:'14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',overflowY:"auto",padding:"10px 15px 15px",flex:1},children:[e.jsxs("div",{style:{marginBottom:10},children:[e.jsxs("h1",{style:{margin:"0 0 2px",fontSize:28,fontWeight:"bold"},children:[g,e.jsx("span",{style:{fontSize:"200%",color:"#fff27f",float:"right"},children:(n==null?void 0:n.level)||""})]}),e.jsx("div",{style:{fontSize:"85%",color:"gold"},children:[n==null?void 0:n.gender,n==null?void 0:n.race].filter(Boolean).join(" ")||"Awaiting character data..."})]}),e.jsxs("div",{style:{fontSize:"85%",margin:"6px 0 10px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 20px"},children:[e.jsxs("div",{children:["Total XP: ",a(n==null?void 0:n.total_xp)]}),e.jsxs("div",{style:{textAlign:"right"},children:["Unassigned XP: ",a(n==null?void 0:n.unassigned_xp)]}),e.jsxs("div",{children:["Luminance: ",(n==null?void 0:n.luminance_earned)!=null?`${a(n.luminance_earned)} / ${a(n.luminance_total)}`:"β€”"]}),e.jsxs("div",{style:{textAlign:"right"},children:["Deaths: ",a(n==null?void 0:n.deaths)]})]}),e.jsxs("div",{style:{display:"flex",gap:13,flexWrap:"wrap"},children:[e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Attributes","Skills","Titles"].map((t,l)=>e.jsx("div",{style:R(j===l),onClick:()=>V(l),children:t},t))}),e.jsxs("div",{style:M,children:[j===0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:"6px 8px",display:"flex",flexDirection:"column",gap:8,borderBottom:`2px solid ${d}`},children:[{label:"Health",pct:(s==null?void 0:s.health_percentage)??0,cur:s==null?void 0:s.health_current,max:s==null?void 0:s.health_max,bg:"#cc3333"},{label:"Stamina",pct:(s==null?void 0:s.stamina_percentage)??0,cur:s==null?void 0:s.stamina_current,max:s==null?void 0:s.stamina_max,bg:"#ccaa33"},{label:"Mana",pct:(s==null?void 0:s.mana_percentage)??0,cur:s==null?void 0:s.mana_current,max:s==null?void 0:s.mana_max,bg:"#3366cc"}].map(t=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{width:55,fontSize:12,color:"#ccc"},children:t.label}),e.jsx("div",{style:{flex:1,height:14,overflow:"hidden",position:"relative",border:`1px solid ${d}`},children:e.jsx("div",{style:{height:"100%",width:`${t.pct}%`,background:t.bg,transition:"width 0.5s ease"}})}),e.jsxs("span",{style:{width:80,textAlign:"right",fontSize:12,color:"#ccc"},children:[t.cur??"β€”"," / ",t.max??"β€”"]})]},t.label))}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Attribute"}),e.jsx("td",{style:r,children:"Creation"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["strength","endurance","coordination","quickness","focus","self"].map(t=>{var l,i;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:X,children:((l=C[t])==null?void 0:l.creation)??"β€”"}),e.jsx("td",{style:p,children:((i=C[t])==null?void 0:i.base)??"β€”"})]},t)})})]}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Vital"}),e.jsx("td",{style:r,children:"Base"})]})}),e.jsx("tbody",{children:["health","stamina","mana"].map(t=>{var l;return e.jsxs("tr",{children:[e.jsx("td",{style:k,children:t.charAt(0).toUpperCase()+t.slice(1)}),e.jsx("td",{style:p,children:((l=Y[t])==null?void 0:l.base)??"β€”"})]},t)})})]}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:e.jsxs("tr",{children:[e.jsx("td",{style:k,children:"Skill Credits"}),e.jsx("td",{style:p,children:a(o.skill_credits)})]})})})]}),j===1&&e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Skill"}),e.jsx("td",{style:r,children:"Level"})]})}),e.jsxs("tbody",{children:[T.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #392067, #392067, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #392067, #392067, black)"},children:l.base})]},t)),I.map(([t,l])=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:t.replace(/_/g," ").replace(/\b\w/g,i=>i.toUpperCase())}),e.jsx("td",{style:{...p,background:"linear-gradient(to right, #0f3c3e, #0f3c3e, black)"},children:l.base})]},t)),T.length===0&&I.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:2,style:{padding:10,color:"#666",fontStyle:"italic",textAlign:"center"},children:"No skill data"})})]})]}),j===2&&e.jsx("div",{style:{padding:"6px 10px",fontSize:13},children:E.length>0?E.map((t,l)=>e.jsx("div",{style:{padding:"1px 0"},children:t},l)):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No titles"})})]})]}),e.jsxs("div",{style:{width:320},children:[e.jsx("div",{style:{height:30,display:"flex"},children:["Augmentations","Ratings","Other"].map((t,l)=>e.jsx("div",{style:R(m===l),onClick:()=>G(l),children:t},t))}),e.jsxs("div",{style:M,children:[m===0&&(S.length||w.length?e.jsxs(e.Fragment,{children:[S.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Augmentations"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:S.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]}),w.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Auras"}),e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Name"}),e.jsx("td",{style:r,children:"Uses"})]})}),e.jsx("tbody",{children:w.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.uses})]},t.name))})]})]})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No augmentation data"})),m===1&&(z.length>0?e.jsxs("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("td",{style:r,children:"Rating"}),e.jsx("td",{style:r,children:"Value"})]})}),e.jsx("tbody",{children:z.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})]}):e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No rating data"})),m===2&&e.jsxs("div",{children:[x.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"General"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:x.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Masteries"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:y.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsx("td",{style:{padding:"2px 6px",textAlign:"right"},children:t.value})]},t.name))})})]}),b.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Society"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px"},children:t.name}),e.jsxs("td",{style:{padding:"2px 6px",textAlign:"right"},children:[t.rank," (",t.value,")"]})]},t.name))})})]}),x.length===0&&y.length===0&&b.length===0&&e.jsx("div",{style:{color:"#666",fontStyle:"italic",textAlign:"center",padding:10},children:"No additional data"})]})]})]})]}),(n==null?void 0:n.allegiance)&&e.jsxs("div",{style:{marginTop:5,border:`2px solid ${d}`,background:"#000"},children:[e.jsx("div",{style:{background:"#222",padding:"4px 8px",fontWeight:"bold",fontSize:13,borderBottom:`1px solid ${d}`},children:"Allegiance"}),e.jsx("table",{style:{width:"100%",fontSize:13,borderCollapse:"collapse"},children:e.jsxs("tbody",{children:[n.allegiance.name&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc",width:100},children:"Name"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.name})]}),((_=n.allegiance.monarch)==null?void 0:_.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Monarch"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.monarch.name})]}),((N=n.allegiance.patron)==null?void 0:N.name)&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Patron"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.patron.name})]}),n.allegiance.rank!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Rank"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.rank})]}),n.allegiance.followers!=null&&e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"2px 6px",color:"#ccc"},children:"Followers"}),e.jsx("td",{style:{padding:"2px 6px"},children:n.allegiance.followers})]})]})})]})]})})};export{ee as CharacterWindow}; diff --git a/static/assets/CombatPickerWindow-2NQUGplv.js b/static/assets/CombatPickerWindow-DO9GiqPu.js similarity index 92% rename from static/assets/CombatPickerWindow-2NQUGplv.js rename to static/assets/CombatPickerWindow-DO9GiqPu.js index ca0069db..f1f5a811 100644 --- a/static/assets/CombatPickerWindow-2NQUGplv.js +++ b/static/assets/CombatPickerWindow-DO9GiqPu.js @@ -1 +1 @@ -import{u as c,j as r,D as d}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const p=({id:n,zIndex:i,characters:a})=>{const{openWindow:s}=c(),e=Array.from(a.keys()).sort();return r.jsx(d,{id:n,title:"Combat Stats β€” Select Character",zIndex:i,width:300,height:400,children:r.jsx("div",{style:{flex:1,overflowY:"auto",padding:6},children:e.length===0?r.jsx("div",{style:{padding:12,color:"#666",textAlign:"center",fontSize:"0.8rem"},children:"No characters online"}):e.map(o=>r.jsx("div",{style:{padding:"5px 8px",cursor:"pointer",borderBottom:"1px solid #222",color:"#ccc",fontSize:"0.82rem"},onMouseEnter:t=>t.currentTarget.style.background="#2a2a2a",onMouseLeave:t=>t.currentTarget.style.background="",onClick:()=>s(`combat-${o}`,`Combat: ${o}`,o),children:o},o))})})};export{p as CombatPickerWindow}; +import{u as c,j as r,D as d}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const p=({id:n,zIndex:i,characters:a})=>{const{openWindow:s}=c(),e=Array.from(a.keys()).sort();return r.jsx(d,{id:n,title:"Combat Stats β€” Select Character",zIndex:i,width:300,height:400,children:r.jsx("div",{style:{flex:1,overflowY:"auto",padding:6},children:e.length===0?r.jsx("div",{style:{padding:12,color:"#666",textAlign:"center",fontSize:"0.8rem"},children:"No characters online"}):e.map(o=>r.jsx("div",{style:{padding:"5px 8px",cursor:"pointer",borderBottom:"1px solid #222",color:"#ccc",fontSize:"0.82rem"},onMouseEnter:t=>t.currentTarget.style.background="#2a2a2a",onMouseLeave:t=>t.currentTarget.style.background="",onClick:()=>s(`combat-${o}`,`Combat: ${o}`,o),children:o},o))})})};export{p as CombatPickerWindow}; diff --git a/static/assets/CombatStatsWindow-DLWkDKIY.js b/static/assets/CombatStatsWindow-D1mRyTZ9.js similarity index 99% rename from static/assets/CombatStatsWindow-DLWkDKIY.js rename to static/assets/CombatStatsWindow-D1mRyTZ9.js index dc64bc81..a6db34f2 100644 --- a/static/assets/CombatStatsWindow-DLWkDKIY.js +++ b/static/assets/CombatStatsWindow-D1mRyTZ9.js @@ -1 +1 @@ -import{r as A,a as B,j as t,D as L}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const w=["Typeless","Slash","Pierce","Bludgeon","Fire","Cold","Acid","Electric"];function _(c,a,x){var o,m,f,k;return(((m=(o=c==null?void 0:c[a])==null?void 0:o[x])==null?void 0:m.total_normal_damage)??0)+(((k=(f=c==null?void 0:c[a])==null?void 0:f[x])==null?void 0:k.total_crit_damage)??0)}function G(c){let a={attacks:0,failed:0,crits:0,normalDmg:0,maxNormal:0,critDmg:0,maxCrit:0};if(!c)return a;for(const x of Object.values(c))for(const o of Object.values(x))a.attacks+=o.total_attacks??0,a.failed+=o.failed_attacks??0,a.crits+=o.crits??0,a.normalDmg+=o.total_normal_damage??0,a.maxNormal=Math.max(a.maxNormal,o.max_normal_damage??0),a.critDmg+=o.total_crit_damage??0,a.maxCrit=Math.max(a.maxCrit,o.max_crit_damage??0);return a}function F(c,a){let x={attacks:0,failed:0};const o=c==null?void 0:c[a];if(!o)return x;for(const m of Object.values(o))x.attacks+=m.total_attacks??0,x.failed+=m.failed_attacks??0;return x}const Y=({id:c,charName:a,zIndex:x})=>{const[o,m]=A.useState(null),[f,k]=A.useState("session"),[h,R]=A.useState(null);A.useEffect(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{});const e=setInterval(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{})},1e4);return()=>clearInterval(e)},[a]);const p=o==null?void 0:o[f],j=(p==null?void 0:p.monsters)??{},S=Object.keys(j).filter(e=>e!=="__cloak_surges__").sort(),n=A.useMemo(()=>{let e={},l={},v=0,$=0;const T=h?[j[h]].filter(Boolean):S.map(u=>j[u]);for(const u of T)if(u){for(const[g,D]of Object.entries(u.offense??{})){e[g]||(e[g]={});for(const[y,E]of Object.entries(D)){e[g][y]||(e[g][y]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const i=e[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.crits+=d.crits??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}for(const[g,D]of Object.entries(u.defense??{})){l[g]||(l[g]={});for(const[y,E]of Object.entries(D)){l[g][y]||(l[g][y]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const i=l[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}v+=u.aetheria_surges??0,$+=u.cloak_surges??0}return j.__cloak_surges__&&!h&&($+=j.__cloak_surges__.cloak_surges??0),{offense:e,defense:l,aeth:v,cloak:$}},[j,S,h]),r=G(n.offense),b=F(n.defense,"MeleeMissile"),M=F(n.defense,"Magic");r.attacks>0&&((r.attacks-r.failed)/r.attacks*100).toFixed(0);const N=b.attacks>0?(b.failed/b.attacks*100).toFixed(0):"0",W=M.attacks>0?(M.failed/M.attacks*100).toFixed(0):"0",C=r.attacks-r.failed,O=C-r.crits,z=O>0?Math.round(r.normalDmg/O):0;r.crits>0&&Math.round(r.critDmg/r.crits);const I=C>0?(r.crits/C*100).toFixed(1):"0",s=e=>e===0?"":e.toLocaleString();return t.jsxs(L,{id:c,title:`Combat: ${a}`,zIndex:x,width:640,height:520,children:[t.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #333",alignItems:"center"},children:[t.jsx("button",{className:`ml-stats-range-btn ${f==="session"?"active":""}`,onClick:()=>k("session"),children:"Session"}),t.jsx("button",{className:`ml-stats-range-btn ${f==="lifetime"?"active":""}`,onClick:()=>k("lifetime"),children:"Lifetime"}),t.jsx("div",{style:{flex:1}}),f==="session"&&t.jsx("button",{style:{fontSize:"0.6rem",padding:"2px 8px",background:"rgba(204,68,68,0.15)",color:"#c66",border:"1px solid rgba(204,68,68,0.3)",borderRadius:3,cursor:"pointer"},onClick:()=>{confirm("Clear current session stats?")&&m(e=>e&&{...e,session:{total_damage_given:0,total_damage_received:0,total_kills:0,total_aetheria_surges:0,total_cloak_surges:0,monsters:{}}})},children:"Clear Session"})]}),t.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[t.jsxs("div",{style:{width:240,borderRight:"1px solid #333",overflowY:"auto",fontSize:"0.72rem"},children:[t.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#777",fontSize:"0.65rem",fontWeight:600},children:[t.jsx("span",{style:{width:14}}),t.jsx("span",{style:{flex:1},children:"Monster"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:"Kills"}),t.jsx("span",{style:{width:55,textAlign:"right"},children:"Dmg"})]}),t.jsxs("div",{style:{display:"flex",padding:"3px 6px",cursor:"pointer",background:h===null?"#2a3a4a":"",borderBottom:"1px solid #222",color:"#ddd"},onClick:()=>R(null),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===null?"*":""}),t.jsx("span",{style:{flex:1},children:"All"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s((p==null?void 0:p.total_kills)??0)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s((p==null?void 0:p.total_damage_given)??0)})]}),S.map(e=>{const l=j[e];return t.jsxs("div",{style:{display:"flex",padding:"2px 6px",cursor:"pointer",background:h===e?"#2a3a4a":"",borderBottom:"1px solid #1a1a1a",color:"#ccc"},onClick:()=>R(e),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===e?"*":""}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s(l.kill_count)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s(l.damage_given)})]},e)})]}),t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.72rem"},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:"#777",fontSize:"0.65rem"},children:[t.jsx("th",{style:{textAlign:"left",padding:"1px 4px"}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"left",padding:"1px 3px"},children:"Stats"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"}})]})}),t.jsxs("tbody",{children:[w.map((e,l)=>{const v=[["Evades",b.attacks>0?`${s(b.attacks)} (${N}%)`:""],["Resists",M.attacks>0?`${s(M.attacks)} (${W}%)`:""],["A.Surges",n.aeth>0?`${s(n.aeth)}`:""],["C.Surges",n.cloak>0?`${s(n.cloak)}`:""],["",""],["",""],["Av/Mx",z>0?`${s(z)} / ${s(r.maxNormal)}`:""],["Crits",r.crits>0?`${s(r.crits)} (${I}%)`:""]][l]??["",""];return t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888"},children:e}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:v[0]}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:v[1]})]},e)}),t.jsx("tr",{children:t.jsx("td",{colSpan:9,style:{height:4}})}),t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888",fontWeight:600},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(r.normalDmg+r.critDmg)})]})]})]})})]})]})};export{Y as CombatStatsWindow}; +import{r as A,a as B,j as t,D as L}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const w=["Typeless","Slash","Pierce","Bludgeon","Fire","Cold","Acid","Electric"];function _(c,a,x){var o,m,f,k;return(((m=(o=c==null?void 0:c[a])==null?void 0:o[x])==null?void 0:m.total_normal_damage)??0)+(((k=(f=c==null?void 0:c[a])==null?void 0:f[x])==null?void 0:k.total_crit_damage)??0)}function G(c){let a={attacks:0,failed:0,crits:0,normalDmg:0,maxNormal:0,critDmg:0,maxCrit:0};if(!c)return a;for(const x of Object.values(c))for(const o of Object.values(x))a.attacks+=o.total_attacks??0,a.failed+=o.failed_attacks??0,a.crits+=o.crits??0,a.normalDmg+=o.total_normal_damage??0,a.maxNormal=Math.max(a.maxNormal,o.max_normal_damage??0),a.critDmg+=o.total_crit_damage??0,a.maxCrit=Math.max(a.maxCrit,o.max_crit_damage??0);return a}function F(c,a){let x={attacks:0,failed:0};const o=c==null?void 0:c[a];if(!o)return x;for(const m of Object.values(o))x.attacks+=m.total_attacks??0,x.failed+=m.failed_attacks??0;return x}const Y=({id:c,charName:a,zIndex:x})=>{const[o,m]=A.useState(null),[f,k]=A.useState("session"),[h,R]=A.useState(null);A.useEffect(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{});const e=setInterval(()=>{B(`/combat-stats/${encodeURIComponent(a)}`).then(m).catch(()=>{})},1e4);return()=>clearInterval(e)},[a]);const p=o==null?void 0:o[f],j=(p==null?void 0:p.monsters)??{},S=Object.keys(j).filter(e=>e!=="__cloak_surges__").sort(),n=A.useMemo(()=>{let e={},l={},v=0,$=0;const T=h?[j[h]].filter(Boolean):S.map(u=>j[u]);for(const u of T)if(u){for(const[g,D]of Object.entries(u.offense??{})){e[g]||(e[g]={});for(const[y,E]of Object.entries(D)){e[g][y]||(e[g][y]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const i=e[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.crits+=d.crits??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}for(const[g,D]of Object.entries(u.defense??{})){l[g]||(l[g]={});for(const[y,E]of Object.entries(D)){l[g][y]||(l[g][y]={total_attacks:0,failed_attacks:0,crits:0,total_normal_damage:0,max_normal_damage:0,total_crit_damage:0,max_crit_damage:0});const i=l[g][y],d=E;i.total_attacks+=d.total_attacks??0,i.failed_attacks+=d.failed_attacks??0,i.total_normal_damage+=d.total_normal_damage??0,i.max_normal_damage=Math.max(i.max_normal_damage,d.max_normal_damage??0),i.total_crit_damage+=d.total_crit_damage??0,i.max_crit_damage=Math.max(i.max_crit_damage,d.max_crit_damage??0)}}v+=u.aetheria_surges??0,$+=u.cloak_surges??0}return j.__cloak_surges__&&!h&&($+=j.__cloak_surges__.cloak_surges??0),{offense:e,defense:l,aeth:v,cloak:$}},[j,S,h]),r=G(n.offense),b=F(n.defense,"MeleeMissile"),M=F(n.defense,"Magic");r.attacks>0&&((r.attacks-r.failed)/r.attacks*100).toFixed(0);const N=b.attacks>0?(b.failed/b.attacks*100).toFixed(0):"0",W=M.attacks>0?(M.failed/M.attacks*100).toFixed(0):"0",C=r.attacks-r.failed,O=C-r.crits,z=O>0?Math.round(r.normalDmg/O):0;r.crits>0&&Math.round(r.critDmg/r.crits);const I=C>0?(r.crits/C*100).toFixed(1):"0",s=e=>e===0?"":e.toLocaleString();return t.jsxs(L,{id:c,title:`Combat: ${a}`,zIndex:x,width:640,height:520,children:[t.jsxs("div",{style:{display:"flex",gap:4,padding:"4px 8px",borderBottom:"1px solid #333",alignItems:"center"},children:[t.jsx("button",{className:`ml-stats-range-btn ${f==="session"?"active":""}`,onClick:()=>k("session"),children:"Session"}),t.jsx("button",{className:`ml-stats-range-btn ${f==="lifetime"?"active":""}`,onClick:()=>k("lifetime"),children:"Lifetime"}),t.jsx("div",{style:{flex:1}}),f==="session"&&t.jsx("button",{style:{fontSize:"0.6rem",padding:"2px 8px",background:"rgba(204,68,68,0.15)",color:"#c66",border:"1px solid rgba(204,68,68,0.3)",borderRadius:3,cursor:"pointer"},onClick:()=>{confirm("Clear current session stats?")&&m(e=>e&&{...e,session:{total_damage_given:0,total_damage_received:0,total_kills:0,total_aetheria_surges:0,total_cloak_surges:0,monsters:{}}})},children:"Clear Session"})]}),t.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[t.jsxs("div",{style:{width:240,borderRight:"1px solid #333",overflowY:"auto",fontSize:"0.72rem"},children:[t.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#777",fontSize:"0.65rem",fontWeight:600},children:[t.jsx("span",{style:{width:14}}),t.jsx("span",{style:{flex:1},children:"Monster"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:"Kills"}),t.jsx("span",{style:{width:55,textAlign:"right"},children:"Dmg"})]}),t.jsxs("div",{style:{display:"flex",padding:"3px 6px",cursor:"pointer",background:h===null?"#2a3a4a":"",borderBottom:"1px solid #222",color:"#ddd"},onClick:()=>R(null),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===null?"*":""}),t.jsx("span",{style:{flex:1},children:"All"}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s((p==null?void 0:p.total_kills)??0)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s((p==null?void 0:p.total_damage_given)??0)})]}),S.map(e=>{const l=j[e];return t.jsxs("div",{style:{display:"flex",padding:"2px 6px",cursor:"pointer",background:h===e?"#2a3a4a":"",borderBottom:"1px solid #1a1a1a",color:"#ccc"},onClick:()=>R(e),children:[t.jsx("span",{style:{width:14,color:"#888"},children:h===e?"*":""}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx("span",{style:{width:40,textAlign:"right"},children:s(l.kill_count)}),t.jsx("span",{style:{width:55,textAlign:"right"},children:s(l.damage_given)})]},e)})]}),t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.72rem"},children:t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{color:"#777",fontSize:"0.65rem"},children:[t.jsx("th",{style:{textAlign:"left",padding:"1px 4px"}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Given Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv M/M"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"},children:"Recv Mag"}),t.jsx("th",{style:{width:4}}),t.jsx("th",{style:{textAlign:"left",padding:"1px 3px"},children:"Stats"}),t.jsx("th",{style:{textAlign:"right",padding:"1px 3px"}})]})}),t.jsxs("tbody",{children:[w.map((e,l)=>{const v=[["Evades",b.attacks>0?`${s(b.attacks)} (${N}%)`:""],["Resists",M.attacks>0?`${s(M.attacks)} (${W}%)`:""],["A.Surges",n.aeth>0?`${s(n.aeth)}`:""],["C.Surges",n.cloak>0?`${s(n.cloak)}`:""],["",""],["",""],["Av/Mx",z>0?`${s(z)} / ${s(r.maxNormal)}`:""],["Crits",r.crits>0?`${s(r.crits)} (${I}%)`:""]][l]??["",""];return t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888"},children:e}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.offense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"MeleeMissile",e))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(_(n.defense,"Magic",e))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:v[0]}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:v[1]})]},e)}),t.jsx("tr",{children:t.jsx("td",{colSpan:9,style:{height:4}})}),t.jsxs("tr",{children:[t.jsx("td",{style:{padding:"1px 4px",color:"#888",fontWeight:600},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.offense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"MeleeMissile",l),0))}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(w.reduce((e,l)=>e+_(n.defense,"Magic",l),0))}),t.jsx("td",{}),t.jsx("td",{style:{padding:"1px 3px",color:"#777",fontWeight:600,fontSize:"0.65rem"},children:"Total"}),t.jsx("td",{style:{textAlign:"right",padding:"1px 3px",color:"#ccc"},children:s(r.normalDmg+r.critDmg)})]})]})]})})]})]})};export{Y as CombatStatsWindow}; diff --git a/static/assets/InventoryWindow-rVjaqxW-.js b/static/assets/InventoryWindow-ZxZJFETP.js similarity index 99% rename from static/assets/InventoryWindow-rVjaqxW-.js rename to static/assets/InventoryWindow-ZxZJFETP.js index 00fa3f7d..1b43a01f 100644 --- a/static/assets/InventoryWindow-rVjaqxW-.js +++ b/static/assets/InventoryWindow-ZxZJFETP.js @@ -1 +1 @@ -import{r as _,a as T,j as n,D as Q}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";function X(e){var s,d;if(!e)return e;const o=c=>c!=null&&c!==-1&&c!==-1?c:void 0,r=e.IntValues||{};return{item_id:e.item_id??e.Id??0,name:e.name??e.Name??((s=e.StringValues)==null?void 0:s["1"])??"Unknown",icon:e.icon??e.Icon??0,object_class:e.object_class??e.ObjectClass??0,current_wielded_location:e.current_wielded_location??o(e.CurrentWieldedLocation)??o(Number(r[10]))??0,container_id:e.container_id??e.ContainerId??0,items_capacity:e.items_capacity??o(e.ItemsCapacity)??o(Number(r[6]))??((d=e.enhanced_properties)==null?void 0:d.ItemSlots_Decal)??void 0,value:e.value??o(e.Value)??o(Number(r[19]))??0,burden:e.burden??o(e.Burden)??o(Number(r[5]))??0,armor_level:e.armor_level??o(e.ArmorLevel),max_damage:e.max_damage??o(e.MaxDamage),material:e.material??e.material_name??e.Material??void 0,item_set:e.item_set??e.ItemSet??void 0,imbue:e.imbue??e.Imbue??void 0,tinks:e.tinks??o(e.Tinks),workmanship:e.workmanship??o(e.Workmanship),equip_skill:e.equip_skill??e.equip_skill_name??e.EquipSkill??void 0,wield_level:e.wield_level??o(e.WieldLevel),skill_level:e.skill_level??o(e.SkillLevel),lore_requirement:e.lore_requirement??o(e.LoreRequirement),attack_bonus:e.attack_bonus??o(e.AttackBonus),melee_defense_bonus:e.melee_defense_bonus??o(e.MeleeDefenseBonus),magic_defense_bonus:e.magic_defense_bonus??o(e.MagicDBonus),damage_bonus:e.damage_bonus??o(e.DamageBonus),damage_rating:e.damage_rating??o(e.DamRating),crit_rating:e.crit_rating??o(e.CritRating),heal_boost_rating:e.heal_boost_rating??o(e.HealBoostRating),current_mana:e.current_mana??o(Number(r[218103815]))??void 0,max_mana:e.max_mana??o(Number(r[218103814]))??void 0,spellcraft:e.spellcraft??void 0,damage_range:e.damage_range??void 0,damage_type:e.damage_type??void 0,speed_text:e.speed_text??void 0,mana_display:e.mana_display??void 0,spells:e.spells??void 0,icon_overlay_id:e.icon_overlay_id??o(Number(r[218103849]))??void 0,icon_underlay_id:e.icon_underlay_id??o(Number(r[218103850]))??void 0,_raw:e}}function D(e){return!e||e<=0?"06000133":(e+100663296).toString(16).toUpperCase().padStart(8,"0")}const M={32768:{name:"Neck",row:1,col:1},1:{name:"Head",row:1,col:3},268435456:{name:"Sigil",row:1,col:5},536870912:{name:"Sigil",row:1,col:6},1073741824:{name:"Sigil",row:1,col:7},67108864:{name:"Trinket",row:2,col:1},2048:{name:"U.Arm",row:2,col:2},512:{name:"Chest",row:2,col:3},134217728:{name:"Cloak",row:2,col:7},65536:{name:"Brace L",row:3,col:1},4096:{name:"L.Arm",row:3,col:2},1024:{name:"Abdomen",row:3,col:3},8192:{name:"U.Leg",row:3,col:4},131072:{name:"Brace R",row:3,col:5},2:{name:"Shirt",row:3,col:7},262144:{name:"Ring L",row:4,col:1},32:{name:"Hands",row:4,col:2},16384:{name:"L.Leg",row:4,col:4},524288:{name:"Ring R",row:4,col:5},4:{name:"Pants",row:4,col:7},256:{name:"Feet",row:5,col:4},2097152:{name:"Shield",row:6,col:1},1048576:{name:"Melee",row:6,col:3},4194304:{name:"Missile",row:6,col:3},16777216:{name:"Held",row:6,col:3},33554432:{name:"2H",row:6,col:3},8388608:{name:"Ammo",row:6,col:7}},I={},ne=[32768,67108864,65536,131072,262144,524288],oe=[1,512,2048,1024,4096,8192,16384,32,256],te=[2,4,134217728,268435456,536870912,1073741824],ie=[2097152,1048576,4194304,16777216,33554432,8388608];(()=>{const e=new Set;Object.entries(M).forEach(([o,r])=>{const s=`${r.row}-${r.col}`,d=parseInt(o);e.has(s)||(e.add(s),ne.includes(d)?I[s]="#3a2555":oe.includes(d)?I[s]="#1e2e55":te.includes(d)?I[s]="#1e3e3e":ie.includes(d)?I[s]="#142040":I[s]="#2a2a2a")})})();const $="#af7a30";function W({item:e,size:o=36}){const r={position:"absolute",top:0,left:0,width:o,height:o,border:"none",background:"transparent",imageRendering:"pixelated"},s=e.icon_underlay_id&&e.icon_underlay_id>100?`/icons/${D(e.icon_underlay_id)}.png`:null,d=e.icon_overlay_id&&e.icon_overlay_id>100?`/icons/${D(e.icon_overlay_id)}.png`:null;return n.jsxs("div",{style:{width:o,height:o,position:"relative"},children:[s&&n.jsx("img",{src:s,alt:"",style:{...r,zIndex:1},onError:c=>{c.target.style.display="none"}}),n.jsx("img",{src:`/icons/${D(e.icon)}.png`,alt:e.name,style:{...r,zIndex:2},onError:c=>{c.target.src="/icons/06000133.png"}}),d&&n.jsx("img",{src:d,alt:"",style:{...r,zIndex:3},onError:c=>{c.target.style.display="none"}})]})}function le({item:e,x:o,y:r}){var j,L;const s=g=>g!=null&&g!==-1&&g!==-1,d=g=>g.toLocaleString(),c=g=>`${((g-1)*100).toFixed(1)}%`;return n.jsxs("div",{style:{position:"fixed",left:o+14,top:r+14,background:"rgba(0,0,0,0.96)",border:"1px solid #555",borderRadius:4,padding:"8px 12px",zIndex:99999,minWidth:200,maxWidth:340,fontSize:13,color:"#ddd",pointerEvents:"none",lineHeight:1.6,fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif'},children:[n.jsx("div",{style:{color:"#ffcc00",fontWeight:"bold",fontSize:14,marginBottom:4},children:e.name}),n.jsxs("div",{style:{color:"#aaa"},children:["Value: ",d(e.value)," Β· Burden: ",e.burden]}),e.workmanship&&n.jsxs("div",{style:{color:"#aaa"},children:["Workmanship: ",e.workmanship]}),e.material&&n.jsxs("div",{style:{color:"#88ff88"},children:["Material: ",e.material]}),s(e.armor_level)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Armor Level: ",e.armor_level]}),s(e.max_damage)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Max Damage: ",e.max_damage]}),e.damage_range&&n.jsxs("div",{style:{color:"#88ff88"},children:["Damage: ",e.damage_range,e.damage_type?`, ${e.damage_type}`:""]}),s(e.attack_bonus)&&e.attack_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Attack: +",c(e.attack_bonus)]}),s(e.melee_defense_bonus)&&e.melee_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Melee Def: +",c(e.melee_defense_bonus)]}),s(e.magic_defense_bonus)&&e.magic_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Magic Def: +",c(e.magic_defense_bonus)]}),e.equip_skill&&n.jsxs("div",{style:{color:"#ddd"},children:["Skill: ",e.equip_skill]}),s(e.wield_level)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Wield Level: ",e.wield_level]}),s(e.lore_requirement)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Lore: ",e.lore_requirement]}),e.imbue&&n.jsxs("div",{style:{color:"#88ff88"},children:["Imbue: ",e.imbue]}),e.item_set&&n.jsxs("div",{style:{color:"#88ff88"},children:["Set: ",e.item_set]}),s(e.tinks)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Tinks: ",e.tinks]}),s(e.damage_rating)&&n.jsxs("div",{children:["Damage Rating: ",e.damage_rating]}),s(e.crit_rating)&&n.jsxs("div",{children:["Crit Rating: ",e.crit_rating]}),s(e.heal_boost_rating)&&n.jsxs("div",{children:["Heal Boost: ",e.heal_boost_rating]}),e.spellcraft&&n.jsxs("div",{style:{color:"#dda0dd"},children:["Spellcraft: ",e.spellcraft]}),s(e.current_mana)&&s(e.max_mana)&&n.jsxs("div",{style:{color:"#98d7ff"},children:["Mana: ",e.current_mana," / ",e.max_mana]}),((L=(j=e.spells)==null?void 0:j.spells)==null?void 0:L.length)>0&&n.jsxs("div",{style:{color:"#4a90e2",marginTop:4,fontSize:12},children:["Spells: ",e.spells.spells.map(g=>g.name).join(", ")]})]})}function G({iconSrc:e,isActive:o,fillPct:r,label:s,onClick:d}){const c=r>90?"#b7432c":r>70?"#d8a431":"#00ff00";return n.jsxs("div",{onClick:d,title:s,style:{display:"flex",alignItems:"flex-start",gap:2,cursor:"pointer",flexShrink:0,marginTop:3,position:"relative"},children:[o&&n.jsx("span",{style:{position:"absolute",left:-11,top:8,color:$,fontSize:10},children:"β–Ά"}),n.jsx("div",{style:{width:30,height:30,border:o?"1px solid #00ff00":"1px solid #333",boxShadow:o?"0 0 4px #00ff00":"none",background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:n.jsx("img",{src:e,alt:"",style:{width:26,height:26,objectFit:"contain",imageRendering:"pixelated"},onError:j=>{j.target.src="/icons/06001080.png"}})}),n.jsx("div",{style:{width:7,height:30,background:"#222",border:"1px solid #666",position:"relative",overflow:"hidden",borderRadius:2},title:`${Math.round(r)}% full`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${r}%`,background:c,minHeight:r>0?2:0}})})]})}const ce=({id:e,charName:o,zIndex:r,inventoryVersion:s,equipmentCantrips:d})=>{var V,q,Y;const[c,j]=_.useState([]),[L,g]=_.useState(!0),[k,H]=_.useState(null),[B,U]=_.useState(null),[f,J]=_.useState(null),C=_.useRef(0),O=_.useRef(!1);_.useEffect(()=>{g(!0),Promise.all([T(`/inventory/${encodeURIComponent(o)}?limit=1000`).catch(()=>({items:[]})),T(`/character-stats/${encodeURIComponent(o)}`).catch(()=>null)]).then(([t,i])=>{j((t.items??[]).map(X)),J(i),O.current=!0}).finally(()=>g(!1))},[o]),_.useEffect(()=>{if(!(!O.current||!s))return clearTimeout(C.current),C.current=window.setTimeout(()=>{T(`/inventory/${encodeURIComponent(o)}?limit=1000&_t=${Date.now()}`).then(t=>j((t.items??[]).map(X))).catch(()=>{})},2e3),()=>clearTimeout(C.current)},[o,s]);const y=_.useCallback((t,i)=>{U(t&&i?{item:t,x:i.clientX,y:i.clientY}:null)},[]),Z=_.useMemo(()=>{const t=new Set,i=[];return Object.entries(M).forEach(([u,m])=>{const a=`${m.row}-${m.col}`;t.has(a)||(t.add(a),i.push({key:a,...m,mask:parseInt(u)}))}),i},[]),{equippedMap:A,containers:z,packItems:w}=_.useMemo(()=>{const t=new Map,i=[],u=new Set,m=new Map;c.forEach(l=>{l.object_class===10&&(i.push(l),u.add(l.item_id))}),i.sort((l,h)=>(l.item_id>>>0)-(h.item_id>>>0));let a=null;return c.forEach(l=>{l.current_wielded_location>0&&l.container_id&&!u.has(l.container_id)&&(a=l.container_id)}),c.forEach(l=>{if(u.has(l.item_id))return;const h=l.current_wielded_location;if(h>0)if(l.object_class===2)Object.entries(M).forEach(([b,x])=>{if((h&parseInt(b))===parseInt(b)){const v=`${x.row}-${x.col}`;t.has(v)||t.set(v,l)}});else{let b=!1;if(M[h]){const x=M[h],v=`${x.row}-${x.col}`;t.has(v)||(t.set(v,l),b=!0)}if(!b){for(const[x,v]of Object.entries(M))if((h&parseInt(x))===parseInt(x)){const K=`${v.row}-${v.col}`;if(!t.has(K)){t.set(K,l),b=!0;break}}}}else{let p=l.container_id||0;a&&p===a&&(p=0),m.has(p)||m.set(p,[]),m.get(p).push(l)}}),{equippedMap:t,containers:i,packItems:m}},[c]);let S=w.get(0)??[],F=0;if(S.length===0){let t=0;for(const[i,u]of w.entries())!z.some(m=>m.item_id===i)&&u.length>t&&(t=u.length,F=i);S=w.get(F)??[]}const P=k!==null?w.get(k)??[]:S,N=(f==null?void 0:f.burden_units)??((V=f==null?void 0:f.stats_data)==null?void 0:V.burden_units)??0,R=(f==null?void 0:f.encumbrance_capacity)??((q=f==null?void 0:f.stats_data)==null?void 0:q.encumbrance_capacity)??0,E=R>0?Math.min(200,N/R*100):0,ee=E>150?"#b7432c":E>100?"#d8a431":"#2e8b57";return L?n.jsx(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:n.jsx("div",{style:{padding:20,color:"#666",fontStyle:"italic"},children:"Loading inventory..."})}):n.jsxs(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:[n.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden",background:"rgba(14,14,14,0.96)",fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',fontSize:13},children:[n.jsxs("div",{style:{width:316,display:"flex",flexDirection:"column",overflow:"hidden"},children:[n.jsx("div",{style:{position:"relative",height:270,minHeight:270,background:"#0a0a0a",borderBottom:`1px solid ${$}`},children:Z.map(t=>{const i=A.get(t.key),u=I[t.key]??"#2a2a2a";return n.jsx("div",{style:{position:"absolute",left:(t.col-1)*44+4,top:(t.row-1)*44+4,width:36,height:36,background:i?"#5a5a62":u,border:i?"2px solid #00ffff":"2px outset #6a6a72",boxShadow:i?"0 0 5px #00ffff, inset 0 0 5px rgba(0,255,255,0.2)":"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default"},onMouseEnter:m=>i&&y(i,m),onMouseMove:m=>i&&y(i,m),onMouseLeave:()=>y(null),children:i?n.jsx(W,{item:i,size:32}):n.jsx("img",{src:"/icons/06000133.png",alt:"",style:{width:28,height:28,opacity:.15,filter:"grayscale(100%)",imageRendering:"pixelated"}})},t.key)})}),n.jsxs("div",{style:{padding:"3px 6px",fontSize:11,color:"#ccc",background:"#111",borderBottom:`1px solid ${$}`},children:["Contents of ",k!==null?((Y=z.find(t=>t.item_id===k))==null?void 0:Y.name)??"Pack":"Backpack"]}),n.jsxs("div",{style:{flex:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(6, 36px)",gridAutoRows:36,gap:2,padding:4,alignContent:"start"},children:[P.map((t,i)=>n.jsx("div",{style:{width:36,height:36,background:"linear-gradient(135deg, #3d007a 0%, #1a0033 100%)",border:"1px solid #4a148c",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onMouseEnter:u=>y(t,u),onMouseMove:u=>y(t,u),onMouseLeave:()=>y(null),children:n.jsx(W,{item:t,size:32})},t.item_id??i)),Array.from({length:Math.max(0,24-P.length)}).map((t,i)=>n.jsx("div",{style:{width:36,height:36,background:"#0a0a0a",border:"1px solid #1a1a1a"}},`e${i}`))]})]}),n.jsxs("div",{style:{width:42,display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 2px",borderLeft:`1px solid ${$}`,borderRight:`1px solid ${$}`},children:[n.jsx("div",{style:{textAlign:"center",fontSize:8,color:"#ccc",marginBottom:2},children:R>0?`${Math.floor(E)}%`:"Burden"}),n.jsx("div",{style:{width:14,height:40,background:"#111",border:"1px solid #555",position:"relative",overflow:"hidden",marginBottom:6,flexShrink:0},title:R>0?`${N.toLocaleString()} / ${R.toLocaleString()}`:`Burden: ${c.reduce((t,i)=>t+(i.burden??0),0).toLocaleString()}`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${E/2}%`,background:ee,transition:"height 0.3s"}})}),n.jsx(G,{iconSrc:"/icons/0600127E.png",isActive:k===null,fillPct:S.length>0?Math.min(100,S.length/102*100):0,label:`Backpack (${S.length}/102)`,onClick:()=>H(null)}),z.map(t=>{const i=t.item_id,u=c.filter(l=>l.container_id===i&&l.item_id!==i).length,m=t.items_capacity||24,a=m>0?Math.min(100,u/m*100):0;return n.jsx(G,{iconSrc:`/icons/${D(t.icon)}.png`,isActive:k===i,fillPct:a,label:`${t.name} (${u}/${m})`,onClick:()=>H(i)},i)})]}),n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:160},children:[n.jsx("div",{style:{padding:"4px 8px",fontSize:"0.72rem",fontWeight:600,color:"#aaa",background:"#111",borderBottom:`1px solid ${$}`},children:"Mana"}),n.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"2px 0"},children:[(()=>{const t=(d==null?void 0:d.items)??[],i=new Map(t.map(a=>[a.item_id,a])),u=d!=null&&d.timestamp?new Date(d.timestamp).getTime():0,m=u>0?Math.max(0,(Date.now()-u)/1e3):0;return Array.from(A.values()).map(a=>{const l=i.get(a.item_id),h=(l==null?void 0:l.current_mana)??a.current_mana??0,p=(l==null?void 0:l.max_mana)??a.max_mana??0,b=(l==null?void 0:l.mana_time_remaining_seconds)??null,x=b!=null?Math.max(0,b-m):null,v=(l==null?void 0:l.state)??(h>0?"active":"not_active");return{...a,current_mana:h,max_mana:p,liveRemaining:x,manaState:v}}).filter(a=>a.current_mana>0||a.max_mana>0).sort((a,l)=>(a.liveRemaining??999999)-(l.liveRemaining??999999)).map((a,l)=>{const h=a.manaState==="active"?"#4c4":a.manaState==="not_active"?"#c44":"#da8";return n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #1a1a1a",cursor:"pointer"},onMouseEnter:p=>y(a,p),onMouseMove:p=>y(a,p),onMouseLeave:()=>y(null),children:[n.jsx("div",{style:{width:20,height:20,flexShrink:0},children:n.jsx(W,{item:a,size:20})}),n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:h,flexShrink:0}}),n.jsx("div",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.68rem",color:"#ccc"},children:a.name}),n.jsxs("div",{style:{fontSize:"0.65rem",color:"#88bbff",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[a.current_mana,"/",a.max_mana]}),n.jsx("div",{style:{fontSize:"0.63rem",color:"#9c9",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",minWidth:42,textAlign:"right"},children:a.liveRemaining!=null?se(a.liveRemaining):""})]},l)})})(),Array.from(A.values()).filter(t=>t.current_mana>0||t.max_mana>0).length===0&&n.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"No mana items equipped"})]})]})]}),B&&n.jsx(le,{item:B.item,x:B.x,y:B.y})]})};function se(e){if(e<=0)return"0h00m";const o=Math.floor(e),r=Math.floor(o/3600),s=Math.floor(o%3600/60);return`${r}h${String(s).padStart(2,"0")}m`}export{ce as InventoryWindow}; +import{r as _,a as T,j as n,D as Q}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";function X(e){var s,d;if(!e)return e;const o=c=>c!=null&&c!==-1&&c!==-1?c:void 0,r=e.IntValues||{};return{item_id:e.item_id??e.Id??0,name:e.name??e.Name??((s=e.StringValues)==null?void 0:s["1"])??"Unknown",icon:e.icon??e.Icon??0,object_class:e.object_class??e.ObjectClass??0,current_wielded_location:e.current_wielded_location??o(e.CurrentWieldedLocation)??o(Number(r[10]))??0,container_id:e.container_id??e.ContainerId??0,items_capacity:e.items_capacity??o(e.ItemsCapacity)??o(Number(r[6]))??((d=e.enhanced_properties)==null?void 0:d.ItemSlots_Decal)??void 0,value:e.value??o(e.Value)??o(Number(r[19]))??0,burden:e.burden??o(e.Burden)??o(Number(r[5]))??0,armor_level:e.armor_level??o(e.ArmorLevel),max_damage:e.max_damage??o(e.MaxDamage),material:e.material??e.material_name??e.Material??void 0,item_set:e.item_set??e.ItemSet??void 0,imbue:e.imbue??e.Imbue??void 0,tinks:e.tinks??o(e.Tinks),workmanship:e.workmanship??o(e.Workmanship),equip_skill:e.equip_skill??e.equip_skill_name??e.EquipSkill??void 0,wield_level:e.wield_level??o(e.WieldLevel),skill_level:e.skill_level??o(e.SkillLevel),lore_requirement:e.lore_requirement??o(e.LoreRequirement),attack_bonus:e.attack_bonus??o(e.AttackBonus),melee_defense_bonus:e.melee_defense_bonus??o(e.MeleeDefenseBonus),magic_defense_bonus:e.magic_defense_bonus??o(e.MagicDBonus),damage_bonus:e.damage_bonus??o(e.DamageBonus),damage_rating:e.damage_rating??o(e.DamRating),crit_rating:e.crit_rating??o(e.CritRating),heal_boost_rating:e.heal_boost_rating??o(e.HealBoostRating),current_mana:e.current_mana??o(Number(r[218103815]))??void 0,max_mana:e.max_mana??o(Number(r[218103814]))??void 0,spellcraft:e.spellcraft??void 0,damage_range:e.damage_range??void 0,damage_type:e.damage_type??void 0,speed_text:e.speed_text??void 0,mana_display:e.mana_display??void 0,spells:e.spells??void 0,icon_overlay_id:e.icon_overlay_id??o(Number(r[218103849]))??void 0,icon_underlay_id:e.icon_underlay_id??o(Number(r[218103850]))??void 0,_raw:e}}function D(e){return!e||e<=0?"06000133":(e+100663296).toString(16).toUpperCase().padStart(8,"0")}const M={32768:{name:"Neck",row:1,col:1},1:{name:"Head",row:1,col:3},268435456:{name:"Sigil",row:1,col:5},536870912:{name:"Sigil",row:1,col:6},1073741824:{name:"Sigil",row:1,col:7},67108864:{name:"Trinket",row:2,col:1},2048:{name:"U.Arm",row:2,col:2},512:{name:"Chest",row:2,col:3},134217728:{name:"Cloak",row:2,col:7},65536:{name:"Brace L",row:3,col:1},4096:{name:"L.Arm",row:3,col:2},1024:{name:"Abdomen",row:3,col:3},8192:{name:"U.Leg",row:3,col:4},131072:{name:"Brace R",row:3,col:5},2:{name:"Shirt",row:3,col:7},262144:{name:"Ring L",row:4,col:1},32:{name:"Hands",row:4,col:2},16384:{name:"L.Leg",row:4,col:4},524288:{name:"Ring R",row:4,col:5},4:{name:"Pants",row:4,col:7},256:{name:"Feet",row:5,col:4},2097152:{name:"Shield",row:6,col:1},1048576:{name:"Melee",row:6,col:3},4194304:{name:"Missile",row:6,col:3},16777216:{name:"Held",row:6,col:3},33554432:{name:"2H",row:6,col:3},8388608:{name:"Ammo",row:6,col:7}},I={},ne=[32768,67108864,65536,131072,262144,524288],oe=[1,512,2048,1024,4096,8192,16384,32,256],te=[2,4,134217728,268435456,536870912,1073741824],ie=[2097152,1048576,4194304,16777216,33554432,8388608];(()=>{const e=new Set;Object.entries(M).forEach(([o,r])=>{const s=`${r.row}-${r.col}`,d=parseInt(o);e.has(s)||(e.add(s),ne.includes(d)?I[s]="#3a2555":oe.includes(d)?I[s]="#1e2e55":te.includes(d)?I[s]="#1e3e3e":ie.includes(d)?I[s]="#142040":I[s]="#2a2a2a")})})();const $="#af7a30";function W({item:e,size:o=36}){const r={position:"absolute",top:0,left:0,width:o,height:o,border:"none",background:"transparent",imageRendering:"pixelated"},s=e.icon_underlay_id&&e.icon_underlay_id>100?`/icons/${D(e.icon_underlay_id)}.png`:null,d=e.icon_overlay_id&&e.icon_overlay_id>100?`/icons/${D(e.icon_overlay_id)}.png`:null;return n.jsxs("div",{style:{width:o,height:o,position:"relative"},children:[s&&n.jsx("img",{src:s,alt:"",style:{...r,zIndex:1},onError:c=>{c.target.style.display="none"}}),n.jsx("img",{src:`/icons/${D(e.icon)}.png`,alt:e.name,style:{...r,zIndex:2},onError:c=>{c.target.src="/icons/06000133.png"}}),d&&n.jsx("img",{src:d,alt:"",style:{...r,zIndex:3},onError:c=>{c.target.style.display="none"}})]})}function le({item:e,x:o,y:r}){var j,L;const s=g=>g!=null&&g!==-1&&g!==-1,d=g=>g.toLocaleString(),c=g=>`${((g-1)*100).toFixed(1)}%`;return n.jsxs("div",{style:{position:"fixed",left:o+14,top:r+14,background:"rgba(0,0,0,0.96)",border:"1px solid #555",borderRadius:4,padding:"8px 12px",zIndex:99999,minWidth:200,maxWidth:340,fontSize:13,color:"#ddd",pointerEvents:"none",lineHeight:1.6,fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif'},children:[n.jsx("div",{style:{color:"#ffcc00",fontWeight:"bold",fontSize:14,marginBottom:4},children:e.name}),n.jsxs("div",{style:{color:"#aaa"},children:["Value: ",d(e.value)," Β· Burden: ",e.burden]}),e.workmanship&&n.jsxs("div",{style:{color:"#aaa"},children:["Workmanship: ",e.workmanship]}),e.material&&n.jsxs("div",{style:{color:"#88ff88"},children:["Material: ",e.material]}),s(e.armor_level)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Armor Level: ",e.armor_level]}),s(e.max_damage)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Max Damage: ",e.max_damage]}),e.damage_range&&n.jsxs("div",{style:{color:"#88ff88"},children:["Damage: ",e.damage_range,e.damage_type?`, ${e.damage_type}`:""]}),s(e.attack_bonus)&&e.attack_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Attack: +",c(e.attack_bonus)]}),s(e.melee_defense_bonus)&&e.melee_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Melee Def: +",c(e.melee_defense_bonus)]}),s(e.magic_defense_bonus)&&e.magic_defense_bonus!==1&&n.jsxs("div",{style:{color:"#88ff88"},children:["Magic Def: +",c(e.magic_defense_bonus)]}),e.equip_skill&&n.jsxs("div",{style:{color:"#ddd"},children:["Skill: ",e.equip_skill]}),s(e.wield_level)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Wield Level: ",e.wield_level]}),s(e.lore_requirement)&&n.jsxs("div",{style:{color:"#ffaa00"},children:["Lore: ",e.lore_requirement]}),e.imbue&&n.jsxs("div",{style:{color:"#88ff88"},children:["Imbue: ",e.imbue]}),e.item_set&&n.jsxs("div",{style:{color:"#88ff88"},children:["Set: ",e.item_set]}),s(e.tinks)&&n.jsxs("div",{style:{color:"#88ff88"},children:["Tinks: ",e.tinks]}),s(e.damage_rating)&&n.jsxs("div",{children:["Damage Rating: ",e.damage_rating]}),s(e.crit_rating)&&n.jsxs("div",{children:["Crit Rating: ",e.crit_rating]}),s(e.heal_boost_rating)&&n.jsxs("div",{children:["Heal Boost: ",e.heal_boost_rating]}),e.spellcraft&&n.jsxs("div",{style:{color:"#dda0dd"},children:["Spellcraft: ",e.spellcraft]}),s(e.current_mana)&&s(e.max_mana)&&n.jsxs("div",{style:{color:"#98d7ff"},children:["Mana: ",e.current_mana," / ",e.max_mana]}),((L=(j=e.spells)==null?void 0:j.spells)==null?void 0:L.length)>0&&n.jsxs("div",{style:{color:"#4a90e2",marginTop:4,fontSize:12},children:["Spells: ",e.spells.spells.map(g=>g.name).join(", ")]})]})}function G({iconSrc:e,isActive:o,fillPct:r,label:s,onClick:d}){const c=r>90?"#b7432c":r>70?"#d8a431":"#00ff00";return n.jsxs("div",{onClick:d,title:s,style:{display:"flex",alignItems:"flex-start",gap:2,cursor:"pointer",flexShrink:0,marginTop:3,position:"relative"},children:[o&&n.jsx("span",{style:{position:"absolute",left:-11,top:8,color:$,fontSize:10},children:"β–Ά"}),n.jsx("div",{style:{width:30,height:30,border:o?"1px solid #00ff00":"1px solid #333",boxShadow:o?"0 0 4px #00ff00":"none",background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:n.jsx("img",{src:e,alt:"",style:{width:26,height:26,objectFit:"contain",imageRendering:"pixelated"},onError:j=>{j.target.src="/icons/06001080.png"}})}),n.jsx("div",{style:{width:7,height:30,background:"#222",border:"1px solid #666",position:"relative",overflow:"hidden",borderRadius:2},title:`${Math.round(r)}% full`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${r}%`,background:c,minHeight:r>0?2:0}})})]})}const ce=({id:e,charName:o,zIndex:r,inventoryVersion:s,equipmentCantrips:d})=>{var V,q,Y;const[c,j]=_.useState([]),[L,g]=_.useState(!0),[k,H]=_.useState(null),[B,U]=_.useState(null),[f,J]=_.useState(null),C=_.useRef(0),O=_.useRef(!1);_.useEffect(()=>{g(!0),Promise.all([T(`/inventory/${encodeURIComponent(o)}?limit=1000`).catch(()=>({items:[]})),T(`/character-stats/${encodeURIComponent(o)}`).catch(()=>null)]).then(([t,i])=>{j((t.items??[]).map(X)),J(i),O.current=!0}).finally(()=>g(!1))},[o]),_.useEffect(()=>{if(!(!O.current||!s))return clearTimeout(C.current),C.current=window.setTimeout(()=>{T(`/inventory/${encodeURIComponent(o)}?limit=1000&_t=${Date.now()}`).then(t=>j((t.items??[]).map(X))).catch(()=>{})},2e3),()=>clearTimeout(C.current)},[o,s]);const y=_.useCallback((t,i)=>{U(t&&i?{item:t,x:i.clientX,y:i.clientY}:null)},[]),Z=_.useMemo(()=>{const t=new Set,i=[];return Object.entries(M).forEach(([u,m])=>{const a=`${m.row}-${m.col}`;t.has(a)||(t.add(a),i.push({key:a,...m,mask:parseInt(u)}))}),i},[]),{equippedMap:A,containers:z,packItems:w}=_.useMemo(()=>{const t=new Map,i=[],u=new Set,m=new Map;c.forEach(l=>{l.object_class===10&&(i.push(l),u.add(l.item_id))}),i.sort((l,h)=>(l.item_id>>>0)-(h.item_id>>>0));let a=null;return c.forEach(l=>{l.current_wielded_location>0&&l.container_id&&!u.has(l.container_id)&&(a=l.container_id)}),c.forEach(l=>{if(u.has(l.item_id))return;const h=l.current_wielded_location;if(h>0)if(l.object_class===2)Object.entries(M).forEach(([b,x])=>{if((h&parseInt(b))===parseInt(b)){const v=`${x.row}-${x.col}`;t.has(v)||t.set(v,l)}});else{let b=!1;if(M[h]){const x=M[h],v=`${x.row}-${x.col}`;t.has(v)||(t.set(v,l),b=!0)}if(!b){for(const[x,v]of Object.entries(M))if((h&parseInt(x))===parseInt(x)){const K=`${v.row}-${v.col}`;if(!t.has(K)){t.set(K,l),b=!0;break}}}}else{let p=l.container_id||0;a&&p===a&&(p=0),m.has(p)||m.set(p,[]),m.get(p).push(l)}}),{equippedMap:t,containers:i,packItems:m}},[c]);let S=w.get(0)??[],F=0;if(S.length===0){let t=0;for(const[i,u]of w.entries())!z.some(m=>m.item_id===i)&&u.length>t&&(t=u.length,F=i);S=w.get(F)??[]}const P=k!==null?w.get(k)??[]:S,N=(f==null?void 0:f.burden_units)??((V=f==null?void 0:f.stats_data)==null?void 0:V.burden_units)??0,R=(f==null?void 0:f.encumbrance_capacity)??((q=f==null?void 0:f.stats_data)==null?void 0:q.encumbrance_capacity)??0,E=R>0?Math.min(200,N/R*100):0,ee=E>150?"#b7432c":E>100?"#d8a431":"#2e8b57";return L?n.jsx(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:n.jsx("div",{style:{padding:20,color:"#666",fontStyle:"italic"},children:"Loading inventory..."})}):n.jsxs(Q,{id:e,title:`Inventory: ${o}`,zIndex:r,width:572,height:720,children:[n.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden",background:"rgba(14,14,14,0.96)",fontFamily:'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif',fontSize:13},children:[n.jsxs("div",{style:{width:316,display:"flex",flexDirection:"column",overflow:"hidden"},children:[n.jsx("div",{style:{position:"relative",height:270,minHeight:270,background:"#0a0a0a",borderBottom:`1px solid ${$}`},children:Z.map(t=>{const i=A.get(t.key),u=I[t.key]??"#2a2a2a";return n.jsx("div",{style:{position:"absolute",left:(t.col-1)*44+4,top:(t.row-1)*44+4,width:36,height:36,background:i?"#5a5a62":u,border:i?"2px solid #00ffff":"2px outset #6a6a72",boxShadow:i?"0 0 5px #00ffff, inset 0 0 5px rgba(0,255,255,0.2)":"none",display:"flex",alignItems:"center",justifyContent:"center",cursor:i?"pointer":"default"},onMouseEnter:m=>i&&y(i,m),onMouseMove:m=>i&&y(i,m),onMouseLeave:()=>y(null),children:i?n.jsx(W,{item:i,size:32}):n.jsx("img",{src:"/icons/06000133.png",alt:"",style:{width:28,height:28,opacity:.15,filter:"grayscale(100%)",imageRendering:"pixelated"}})},t.key)})}),n.jsxs("div",{style:{padding:"3px 6px",fontSize:11,color:"#ccc",background:"#111",borderBottom:`1px solid ${$}`},children:["Contents of ",k!==null?((Y=z.find(t=>t.item_id===k))==null?void 0:Y.name)??"Pack":"Backpack"]}),n.jsxs("div",{style:{flex:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(6, 36px)",gridAutoRows:36,gap:2,padding:4,alignContent:"start"},children:[P.map((t,i)=>n.jsx("div",{style:{width:36,height:36,background:"linear-gradient(135deg, #3d007a 0%, #1a0033 100%)",border:"1px solid #4a148c",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},onMouseEnter:u=>y(t,u),onMouseMove:u=>y(t,u),onMouseLeave:()=>y(null),children:n.jsx(W,{item:t,size:32})},t.item_id??i)),Array.from({length:Math.max(0,24-P.length)}).map((t,i)=>n.jsx("div",{style:{width:36,height:36,background:"#0a0a0a",border:"1px solid #1a1a1a"}},`e${i}`))]})]}),n.jsxs("div",{style:{width:42,display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 2px",borderLeft:`1px solid ${$}`,borderRight:`1px solid ${$}`},children:[n.jsx("div",{style:{textAlign:"center",fontSize:8,color:"#ccc",marginBottom:2},children:R>0?`${Math.floor(E)}%`:"Burden"}),n.jsx("div",{style:{width:14,height:40,background:"#111",border:"1px solid #555",position:"relative",overflow:"hidden",marginBottom:6,flexShrink:0},title:R>0?`${N.toLocaleString()} / ${R.toLocaleString()}`:`Burden: ${c.reduce((t,i)=>t+(i.burden??0),0).toLocaleString()}`,children:n.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:`${E/2}%`,background:ee,transition:"height 0.3s"}})}),n.jsx(G,{iconSrc:"/icons/0600127E.png",isActive:k===null,fillPct:S.length>0?Math.min(100,S.length/102*100):0,label:`Backpack (${S.length}/102)`,onClick:()=>H(null)}),z.map(t=>{const i=t.item_id,u=c.filter(l=>l.container_id===i&&l.item_id!==i).length,m=t.items_capacity||24,a=m>0?Math.min(100,u/m*100):0;return n.jsx(G,{iconSrc:`/icons/${D(t.icon)}.png`,isActive:k===i,fillPct:a,label:`${t.name} (${u}/${m})`,onClick:()=>H(i)},i)})]}),n.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:160},children:[n.jsx("div",{style:{padding:"4px 8px",fontSize:"0.72rem",fontWeight:600,color:"#aaa",background:"#111",borderBottom:`1px solid ${$}`},children:"Mana"}),n.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"2px 0"},children:[(()=>{const t=(d==null?void 0:d.items)??[],i=new Map(t.map(a=>[a.item_id,a])),u=d!=null&&d.timestamp?new Date(d.timestamp).getTime():0,m=u>0?Math.max(0,(Date.now()-u)/1e3):0;return Array.from(A.values()).map(a=>{const l=i.get(a.item_id),h=(l==null?void 0:l.current_mana)??a.current_mana??0,p=(l==null?void 0:l.max_mana)??a.max_mana??0,b=(l==null?void 0:l.mana_time_remaining_seconds)??null,x=b!=null?Math.max(0,b-m):null,v=(l==null?void 0:l.state)??(h>0?"active":"not_active");return{...a,current_mana:h,max_mana:p,liveRemaining:x,manaState:v}}).filter(a=>a.current_mana>0||a.max_mana>0).sort((a,l)=>(a.liveRemaining??999999)-(l.liveRemaining??999999)).map((a,l)=>{const h=a.manaState==="active"?"#4c4":a.manaState==="not_active"?"#c44":"#da8";return n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #1a1a1a",cursor:"pointer"},onMouseEnter:p=>y(a,p),onMouseMove:p=>y(a,p),onMouseLeave:()=>y(null),children:[n.jsx("div",{style:{width:20,height:20,flexShrink:0},children:n.jsx(W,{item:a,size:20})}),n.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:h,flexShrink:0}}),n.jsx("div",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.68rem",color:"#ccc"},children:a.name}),n.jsxs("div",{style:{fontSize:"0.65rem",color:"#88bbff",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums"},children:[a.current_mana,"/",a.max_mana]}),n.jsx("div",{style:{fontSize:"0.63rem",color:"#9c9",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",minWidth:42,textAlign:"right"},children:a.liveRemaining!=null?se(a.liveRemaining):""})]},l)})})(),Array.from(A.values()).filter(t=>t.current_mana>0||t.max_mana>0).length===0&&n.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"No mana items equipped"})]})]})]}),B&&n.jsx(le,{item:B.item,x:B.x,y:B.y})]})};function se(e){if(e<=0)return"0h00m";const o=Math.floor(e),r=Math.floor(o/3600),s=Math.floor(o%3600/60);return`${r}h${String(s).padStart(2,"0")}m`}export{ce as InventoryWindow}; diff --git a/static/assets/IssuesWindow-C_A54UOW.js b/static/assets/IssuesWindow-BxSy4plP.js similarity index 99% rename from static/assets/IssuesWindow-C_A54UOW.js rename to static/assets/IssuesWindow-BxSy4plP.js index 734be67e..ec6ebeec 100644 --- a/static/assets/IssuesWindow-C_A54UOW.js +++ b/static/assets/IssuesWindow-BxSy4plP.js @@ -1 +1 @@ -import{r as n,a as W,j as e,D as L}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const O={plugin:{label:"Plugin",color:"#8844cc"},overlord:{label:"Overlord",color:"#4488cc"},nav:{label:"Nav",color:"#44aa44"},macro:{label:"Macro",color:"#cc8844"},other:{label:"Other",color:"#888888"}},i={padding:"3px 6px",fontSize:"0.8rem",border:"1px solid #555",background:"#2a2a2a",color:"#ddd",borderRadius:0},N={...i,fontSize:"0.75rem"},g={padding:"4px 12px",background:"#4a80c0",color:"#fff",border:"1px solid #336699",cursor:"pointer",fontSize:"0.75rem"},a={padding:"3px 8px",background:"#444",color:"#ccc",border:"1px solid #555",cursor:"pointer",fontSize:"0.7rem"},F=({id:P,zIndex:A})=>{const[h,R]=n.useState([]),[c,m]=n.useState(""),[y,u]=n.useState(""),[f,$]=n.useState("plugin"),[v,d]=n.useState(null),[p,j]=n.useState(""),[b,S]=n.useState(""),[C,z]=n.useState(""),[T,k]=n.useState({}),x=n.useCallback(async()=>{try{const t=await W("/issues");R((t.issues??[]).sort((r,s)=>(r.resolved?1:0)-(s.resolved?1:0)))}catch{}},[]);n.useEffect(()=>{x()},[x]);const l=async(t,r)=>{await fetch(`/api${t}`,{...r,credentials:"include",headers:{"Content-Type":"application/json",...r.headers}}),x()},E=async()=>{c.trim()&&(await l("/issues",{method:"POST",body:JSON.stringify({title:c.trim(),description:y.trim(),category:f})}),m(""),u(""))},B=t=>{if(v===t.id){d(null);return}d(t.id),j(t.title),S(t.description||""),z(t.category||"other")},I=async t=>{p.trim()&&(await l(`/issues/${t}`,{method:"PATCH",body:JSON.stringify({title:p.trim(),description:b.trim(),category:C})}),d(null))},w=async t=>{const r=(T[t]||"").trim();r&&(await l(`/issues/${t}/comments`,{method:"POST",body:JSON.stringify({text:r})}),k(s=>({...s,[t]:""})))};return e.jsxs(L,{id:P,title:"Issues Board",zIndex:A,width:540,height:520,children:[e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.8rem"},children:[h.length===0&&e.jsx("div",{style:{padding:10,color:"#888",textAlign:"center"},children:"No open issues"}),h.map(t=>{const r=O[t.category]||O.other,s=t.created?new Date(t.created).toLocaleDateString("sv-SE"):"",D=t.comments||[];return e.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333",opacity:t.resolved?.55:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:"0.65rem",padding:"1px 6px",borderRadius:3,background:r.color,color:"#fff",fontWeight:600},children:r.label}),e.jsx("strong",{style:{fontSize:"0.8rem",flex:1},children:t.title}),e.jsxs("span",{style:{fontSize:"0.65rem",color:"#888"},children:["by ",t.author||"User"]}),e.jsx("span",{style:{color:"#666",fontSize:"0.65rem"},children:s})]}),t.description&&e.jsx("div",{style:{color:"#999",marginTop:3,fontSize:"0.75rem"},children:t.description}),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[t.resolved?e.jsxs(e.Fragment,{children:[e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!1})}),children:"↻ Reopen"}),e.jsx("button",{style:{...a,fontSize:"0.65rem",color:"#c66"},onClick:()=>{confirm(`Delete issue "${t.title}"?`)&&l(`/issues/${t.id}`,{method:"DELETE"})},children:"πŸ—‘ Delete"})]}):e.jsx("button",{style:{...a,fontSize:"0.65rem",background:"rgba(68,204,68,0.15)",color:"#4c4",border:"1px solid rgba(68,204,68,0.3)"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!0})}),children:"βœ“ Resolve"}),e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>B(t),children:"✎ Edit"})]}),v===t.id&&e.jsxs("div",{style:{marginTop:4,padding:4,background:"#222",borderRadius:3},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:p,onChange:o=>j(o.target.value),style:{...i,flex:1}}),e.jsxs("select",{value:C,onChange:o=>z(o.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:b,onChange:o=>S(o.target.value),rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>I(t.id),children:"Save"}),e.jsx("button",{style:{...a},onClick:()=>d(null),children:"Cancel"})]})]})]}),e.jsxs("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px solid #2a2a2a"},children:[D.length===0?e.jsx("div",{style:{color:"#555",fontSize:"0.7rem",padding:"2px 0"},children:"No comments yet"}):D.map(o=>e.jsxs("div",{style:{marginBottom:3,fontSize:"0.72rem"},children:[e.jsx("span",{style:{color:"#8ac",fontWeight:500},children:o.author||"Anonymous"}),e.jsx("span",{style:{color:"#555",marginLeft:6,fontSize:"0.6rem"},children:o.created?new Date(o.created).toLocaleDateString("sv-SE"):""}),e.jsx("div",{style:{color:"#bbb",marginTop:1},children:o.text})]},o.id)),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:3},children:[e.jsx("input",{value:T[t.id]||"",onChange:o=>k(J=>({...J,[t.id]:o.target.value})),placeholder:"Add a comment...",style:{...i,flex:1,fontSize:"0.75rem"},onKeyDown:o=>{o.key==="Enter"&&w(t.id)}}),e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>w(t.id),children:"Post"})]})]})]},t.id)})]}),e.jsxs("div",{style:{padding:6,borderTop:"1px solid #333"},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:c,onChange:t=>m(t.target.value),placeholder:"Issue title...",style:{...i,flex:1},onKeyDown:t=>{t.key==="Enter"&&E()}}),e.jsxs("select",{value:f,onChange:t=>$(t.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:y,onChange:t=>u(t.target.value),placeholder:"Description (optional)...",rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsx("button",{style:{...g,alignSelf:"flex-end"},onClick:E,children:"Add"})]})]})]})};export{F as IssuesWindow}; +import{r as n,a as W,j as e,D as L}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const O={plugin:{label:"Plugin",color:"#8844cc"},overlord:{label:"Overlord",color:"#4488cc"},nav:{label:"Nav",color:"#44aa44"},macro:{label:"Macro",color:"#cc8844"},other:{label:"Other",color:"#888888"}},i={padding:"3px 6px",fontSize:"0.8rem",border:"1px solid #555",background:"#2a2a2a",color:"#ddd",borderRadius:0},N={...i,fontSize:"0.75rem"},g={padding:"4px 12px",background:"#4a80c0",color:"#fff",border:"1px solid #336699",cursor:"pointer",fontSize:"0.75rem"},a={padding:"3px 8px",background:"#444",color:"#ccc",border:"1px solid #555",cursor:"pointer",fontSize:"0.7rem"},F=({id:P,zIndex:A})=>{const[h,R]=n.useState([]),[c,m]=n.useState(""),[y,u]=n.useState(""),[f,$]=n.useState("plugin"),[v,d]=n.useState(null),[p,j]=n.useState(""),[b,S]=n.useState(""),[C,z]=n.useState(""),[T,k]=n.useState({}),x=n.useCallback(async()=>{try{const t=await W("/issues");R((t.issues??[]).sort((r,s)=>(r.resolved?1:0)-(s.resolved?1:0)))}catch{}},[]);n.useEffect(()=>{x()},[x]);const l=async(t,r)=>{await fetch(`/api${t}`,{...r,credentials:"include",headers:{"Content-Type":"application/json",...r.headers}}),x()},E=async()=>{c.trim()&&(await l("/issues",{method:"POST",body:JSON.stringify({title:c.trim(),description:y.trim(),category:f})}),m(""),u(""))},B=t=>{if(v===t.id){d(null);return}d(t.id),j(t.title),S(t.description||""),z(t.category||"other")},I=async t=>{p.trim()&&(await l(`/issues/${t}`,{method:"PATCH",body:JSON.stringify({title:p.trim(),description:b.trim(),category:C})}),d(null))},w=async t=>{const r=(T[t]||"").trim();r&&(await l(`/issues/${t}/comments`,{method:"POST",body:JSON.stringify({text:r})}),k(s=>({...s,[t]:""})))};return e.jsxs(L,{id:P,title:"Issues Board",zIndex:A,width:540,height:520,children:[e.jsxs("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.8rem"},children:[h.length===0&&e.jsx("div",{style:{padding:10,color:"#888",textAlign:"center"},children:"No open issues"}),h.map(t=>{const r=O[t.category]||O.other,s=t.created?new Date(t.created).toLocaleDateString("sv-SE"):"",D=t.comments||[];return e.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333",opacity:t.resolved?.55:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:"0.65rem",padding:"1px 6px",borderRadius:3,background:r.color,color:"#fff",fontWeight:600},children:r.label}),e.jsx("strong",{style:{fontSize:"0.8rem",flex:1},children:t.title}),e.jsxs("span",{style:{fontSize:"0.65rem",color:"#888"},children:["by ",t.author||"User"]}),e.jsx("span",{style:{color:"#666",fontSize:"0.65rem"},children:s})]}),t.description&&e.jsx("div",{style:{color:"#999",marginTop:3,fontSize:"0.75rem"},children:t.description}),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[t.resolved?e.jsxs(e.Fragment,{children:[e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!1})}),children:"↻ Reopen"}),e.jsx("button",{style:{...a,fontSize:"0.65rem",color:"#c66"},onClick:()=>{confirm(`Delete issue "${t.title}"?`)&&l(`/issues/${t.id}`,{method:"DELETE"})},children:"πŸ—‘ Delete"})]}):e.jsx("button",{style:{...a,fontSize:"0.65rem",background:"rgba(68,204,68,0.15)",color:"#4c4",border:"1px solid rgba(68,204,68,0.3)"},onClick:()=>l(`/issues/${t.id}`,{method:"PATCH",body:JSON.stringify({resolved:!0})}),children:"βœ“ Resolve"}),e.jsx("button",{style:{...a,fontSize:"0.65rem"},onClick:()=>B(t),children:"✎ Edit"})]}),v===t.id&&e.jsxs("div",{style:{marginTop:4,padding:4,background:"#222",borderRadius:3},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:p,onChange:o=>j(o.target.value),style:{...i,flex:1}}),e.jsxs("select",{value:C,onChange:o=>z(o.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:b,onChange:o=>S(o.target.value),rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>I(t.id),children:"Save"}),e.jsx("button",{style:{...a},onClick:()=>d(null),children:"Cancel"})]})]})]}),e.jsxs("div",{style:{marginTop:4,paddingTop:4,borderTop:"1px solid #2a2a2a"},children:[D.length===0?e.jsx("div",{style:{color:"#555",fontSize:"0.7rem",padding:"2px 0"},children:"No comments yet"}):D.map(o=>e.jsxs("div",{style:{marginBottom:3,fontSize:"0.72rem"},children:[e.jsx("span",{style:{color:"#8ac",fontWeight:500},children:o.author||"Anonymous"}),e.jsx("span",{style:{color:"#555",marginLeft:6,fontSize:"0.6rem"},children:o.created?new Date(o.created).toLocaleDateString("sv-SE"):""}),e.jsx("div",{style:{color:"#bbb",marginTop:1},children:o.text})]},o.id)),e.jsxs("div",{style:{display:"flex",gap:4,marginTop:3},children:[e.jsx("input",{value:T[t.id]||"",onChange:o=>k(J=>({...J,[t.id]:o.target.value})),placeholder:"Add a comment...",style:{...i,flex:1,fontSize:"0.75rem"},onKeyDown:o=>{o.key==="Enter"&&w(t.id)}}),e.jsx("button",{style:{...g,fontSize:"0.7rem",padding:"3px 8px"},onClick:()=>w(t.id),children:"Post"})]})]})]},t.id)})]}),e.jsxs("div",{style:{padding:6,borderTop:"1px solid #333"},children:[e.jsxs("div",{style:{display:"flex",gap:4,marginBottom:4},children:[e.jsx("input",{value:c,onChange:t=>m(t.target.value),placeholder:"Issue title...",style:{...i,flex:1},onKeyDown:t=>{t.key==="Enter"&&E()}}),e.jsxs("select",{value:f,onChange:t=>$(t.target.value),style:N,children:[e.jsx("option",{value:"plugin",children:"Plugin"}),e.jsx("option",{value:"overlord",children:"Overlord"}),e.jsx("option",{value:"nav",children:"Nav"}),e.jsx("option",{value:"macro",children:"Macro"}),e.jsx("option",{value:"other",children:"Other"})]})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("textarea",{value:y,onChange:t=>u(t.target.value),placeholder:"Description (optional)...",rows:2,style:{...i,flex:1,fontSize:"0.75rem",resize:"vertical"}}),e.jsx("button",{style:{...g,alignSelf:"flex-end"},onClick:E,children:"Add"})]})]})]})};export{F as IssuesWindow}; diff --git a/static/assets/PlayerDashboardWindow-qdSQRhha.js b/static/assets/PlayerDashboardWindow-qdSQRhha.js deleted file mode 100644 index 7f755121..00000000 --- a/static/assets/PlayerDashboardWindow-qdSQRhha.js +++ /dev/null @@ -1 +0,0 @@ -import{r as d,j as t,D as y}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const A=({id:u,zIndex:f,characters:h})=>{const[o,k]=d.useState("kph"),[c,x]=d.useState(!1),p=d.useMemo(()=>{const e=Array.from(h.values()).filter(r=>r.telemetry).map(r=>{var i,g,m;const s=r.telemetry;return{name:r.name,kills:s.kills??0,kph:parseInt(s.kills_per_hour)||0,totalKills:s.total_kills??0,rares:s.total_rares??0,sessionRares:s.session_rares??0,deaths:parseInt(s.deaths)||0,totalDeaths:parseInt(s.total_deaths)||0,uptime:((i=s.onlinetime)==null?void 0:i.replace(/^00\./,""))??"",state:s.vt_state??"idle",tapers:parseInt(s.prismatic_taper_count)||0,hp:((g=r.vitals)==null?void 0:g.health_percentage)??0,vitae:((m=r.vitals)==null?void 0:m.vitae)??0}});return e.sort((r,s)=>{let i=0;switch(o){case"name":i=r.name.localeCompare(s.name);break;case"kills":i=r.kills-s.kills;break;case"kph":i=r.kph-s.kph;break;case"rares":i=r.rares-s.rares;break;case"deaths":i=r.totalDeaths-s.totalDeaths;break;case"uptime":i=r.uptime.localeCompare(s.uptime);break;case"state":i=r.state.localeCompare(s.state);break}return c?i:-i}),e},[h,o,c]),l=e=>{o===e?x(!c):(k(e),x(!1))},a=e=>({padding:"4px 6px",cursor:"pointer",userSelect:"none",color:o===e?"#6af":"#888",fontSize:"0.65rem",fontWeight:600,whiteSpace:"nowrap",borderBottom:"1px solid #444"}),n=e=>o===e?c?" β–²":" β–Ό":"";return t.jsx(y,{id:u,title:"Player Dashboard",zIndex:f,width:850,height:500,children:t.jsxs("div",{style:{flex:1,overflow:"auto",fontSize:"0.73rem"},children:[t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsxs("th",{style:{...a("name"),textAlign:"left"},onClick:()=>l("name"),children:["Character",n("name")]}),t.jsxs("th",{style:{...a("state"),textAlign:"center"},onClick:()=>l("state"),children:["State",n("state")]}),t.jsxs("th",{style:{...a("kph"),textAlign:"right"},onClick:()=>l("kph"),children:["KPH",n("kph")]}),t.jsxs("th",{style:{...a("kills"),textAlign:"right"},onClick:()=>l("kills"),children:["Session",n("kills")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Total"}),t.jsxs("th",{style:{...a("rares"),textAlign:"right"},onClick:()=>l("rares"),children:["Rares",n("rares")]}),t.jsxs("th",{style:{...a("deaths"),textAlign:"right"},onClick:()=>l("deaths"),children:["Deaths",n("deaths")]}),t.jsxs("th",{style:{...a("uptime"),textAlign:"right"},onClick:()=>l("uptime"),children:["Uptime",n("uptime")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"HP%"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Vitae"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Tapers"})]})}),t.jsx("tbody",{children:p.map(e=>{const r=e.state.toLowerCase(),s=r==="combat"||r==="hunt";return t.jsxs("tr",{style:{borderBottom:"1px solid #1a1a1a"},children:[t.jsx("td",{style:{padding:"3px 6px",color:"#ccc",fontWeight:500,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsx("td",{style:{textAlign:"center",padding:"3px 6px"},children:t.jsx("span",{style:{fontSize:"0.6rem",padding:"1px 6px",borderRadius:3,background:s?"rgba(68,204,68,0.15)":r==="idle"||r==="default"?"rgba(100,100,100,0.2)":"rgba(204,68,68,0.15)",color:s?"#4c4":r==="idle"||r==="default"?"#888":"#c44"},children:e.state})}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#4c4",fontVariantNumeric:"tabular-nums"},children:e.kph.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#ccc",fontVariantNumeric:"tabular-nums"},children:e.kills.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.totalKills.toLocaleString()}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",color:"#fc0",fontVariantNumeric:"tabular-nums"},children:[e.rares,e.sessionRares>0?` (${e.sessionRares})`:""]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:e.totalDeaths>0?"#c66":"#555",fontVariantNumeric:"tabular-nums"},children:e.totalDeaths}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.uptime}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.hp>80?"#4c4":e.hp>40?"#ca0":"#c44"},children:[e.hp.toFixed(0),"%"]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.vitae>0?"#f66":"#333"},children:e.vitae>0?`${e.vitae}%`:""}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.tapers.toLocaleString()})]},e.name)})})]}),p.length===0&&t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No characters online"})]})})};export{A as PlayerDashboardWindow}; diff --git a/static/assets/QuestStatusWindow-DL34Ths2.js b/static/assets/QuestStatusWindow-DCQZBsLK.js similarity index 96% rename from static/assets/QuestStatusWindow-DL34Ths2.js rename to static/assets/QuestStatusWindow-DCQZBsLK.js index ef752ec1..e20396fb 100644 --- a/static/assets/QuestStatusWindow-DL34Ths2.js +++ b/static/assets/QuestStatusWindow-DCQZBsLK.js @@ -1 +1 @@ -import{r as c,j as t,D as u,a as f}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const j=({id:p,zIndex:x})=>{const[s,h]=c.useState(null);c.useEffect(()=>{const e=async()=>{try{h(await f("/quest-status"))}catch{}};e();const o=setInterval(e,3e4);return()=>clearInterval(o)},[]);const i=s?Object.keys(s.quest_data).sort():[],l=new Set;if(s)for(const e of Object.values(s.quest_data))for(const o of Object.keys(e))l.add(o);const n=Array.from(l).sort();return t.jsx(u,{id:p,title:"Quest Status",zIndex:x,width:780,height:500,children:t.jsx("div",{style:{flex:1,overflow:"auto",fontSize:"0.72rem"},children:s?i.length===0?t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No quest data available"}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsx("th",{style:{textAlign:"left",padding:"4px 8px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.65rem",fontWeight:600,minWidth:140},children:"Character"}),n.map(e=>t.jsx("th",{style:{textAlign:"center",padding:"4px 6px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.6rem",fontWeight:600,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e,children:e.replace(" Timer","").replace(" Pickup","")},e))]})}),t.jsx("tbody",{children:i.map(e=>{const o=s.quest_data[e]||{};return t.jsxs("tr",{style:{borderBottom:"1px solid #222"},children:[t.jsx("td",{style:{padding:"3px 8px",color:"#ccc",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:e}),n.map(d=>{const r=o[d],a=r==="READY";return t.jsx("td",{style:{textAlign:"center",padding:"3px 6px",color:a?"#4c4":r?"#ca0":"#333",fontWeight:a?600:400,fontSize:a?"0.7rem":"0.68rem"},children:r||"β€”"},d)})]},e)})})]}):t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"Loading quest data..."})})})};export{j as QuestStatusWindow}; +import{r as c,j as t,D as u,a as f}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const j=({id:p,zIndex:x})=>{const[s,h]=c.useState(null);c.useEffect(()=>{const e=async()=>{try{h(await f("/quest-status"))}catch{}};e();const o=setInterval(e,3e4);return()=>clearInterval(o)},[]);const i=s?Object.keys(s.quest_data).sort():[],l=new Set;if(s)for(const e of Object.values(s.quest_data))for(const o of Object.keys(e))l.add(o);const n=Array.from(l).sort();return t.jsx(u,{id:p,title:"Quest Status",zIndex:x,width:780,height:500,children:t.jsx("div",{style:{flex:1,overflow:"auto",fontSize:"0.72rem"},children:s?i.length===0?t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No quest data available"}):t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsx("th",{style:{textAlign:"left",padding:"4px 8px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.65rem",fontWeight:600,minWidth:140},children:"Character"}),n.map(e=>t.jsx("th",{style:{textAlign:"center",padding:"4px 6px",borderBottom:"1px solid #444",color:"#888",fontSize:"0.6rem",fontWeight:600,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e,children:e.replace(" Timer","").replace(" Pickup","")},e))]})}),t.jsx("tbody",{children:i.map(e=>{const o=s.quest_data[e]||{};return t.jsxs("tr",{style:{borderBottom:"1px solid #222"},children:[t.jsx("td",{style:{padding:"3px 8px",color:"#ccc",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:160},children:e}),n.map(d=>{const r=o[d],a=r==="READY";return t.jsx("td",{style:{textAlign:"center",padding:"3px 6px",color:a?"#4c4":r?"#ca0":"#333",fontWeight:a?600:400,fontSize:a?"0.7rem":"0.68rem"},children:r||"β€”"},d)})]},e)})})]}):t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"Loading quest data..."})})})};export{j as QuestStatusWindow}; diff --git a/static/assets/RadarWindow-B3i5zXC8.js b/static/assets/RadarWindow-DwR1V8eq.js similarity index 99% rename from static/assets/RadarWindow-B3i5zXC8.js rename to static/assets/RadarWindow-DwR1V8eq.js index 6b60d634..bcb00bd6 100644 --- a/static/assets/RadarWindow-B3i5zXC8.js +++ b/static/assets/RadarWindow-DwR1V8eq.js @@ -1 +1 @@ -import{r as x,j as c,D as ne}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const q=300,H=.5,se={walls:{r:0,g:0,b:255},innerWalls:{r:127,g:127,b:255},rampedWalls:{r:77,g:255,b:255},floors:{r:0,g:127,b:255},stairs:{r:0,g:63,b:255}},le={walls:{r:140,g:140,b:180},innerWalls:{r:100,g:100,b:140},rampedWalls:{r:120,g:160,b:120},floors:{r:60,g:80,b:60},stairs:{r:180,g:160,b:80}};function oe(d){const g=document.createElement("canvas");g.width=10,g.height=10;const w=g.getContext("2d");w.drawImage(d,0,0,10,10);const a=w.getImageData(0,0,10,10),t=a.data;for(let p=0;p240&&R>240&&k>240){t[p+3]=0;continue}let E=!1;for(const[L,I]of Object.entries(se))if(Math.abs(_-I.r)<15&&Math.abs(R-I.g)<15&&Math.abs(k-I.b)<15){const W=le[L];t[p]=W.r,t[p+1]=W.g,t[p+2]=W.b,E=!0;break}!E&&_<15&&R<15&&k<15&&(t[p+3]=100)}return w.putImageData(a,0,0),g}function ie(d){return d===1?Math.PI:d<-.7&&d>-.8?Math.PI/2:d>.7&&d<.8?-Math.PI/2:0}let A=null;function ce(){A||(A={},fetch("/dungeon_tiles.json").then(d=>d.json()).then(d=>{Object.entries(d).forEach(([g,w])=>{const a=new Image;a.onload=()=>{A[g]=oe(a)},a.src=w})}).catch(()=>{}))}const K={Monster:"#ff4444",Player:"#4488ff",NPC:"#44cc44",Vendor:"#44cc44",Portal:"#aa44ff",Corpse:"#ff8800",Container:"#cccc44",Door:"#888888"};function re(d){const g=(d%360+360)%360;return["N","NE","E","SE","S","SW","W","NW"][Math.round(g/45)%8]}const fe=({id:d,charName:g,zIndex:w,socket:a,radarData:t})=>{const p=x.useRef(null),_=x.useRef(H),[R,k]=x.useState(H),[E,L]=x.useState(null),I=x.useRef(null),W=x.useRef([]);x.useEffect(()=>{const n=new Image;n.src="/dereth.png",n.onload=()=>{I.current=n},ce()},[]),x.useEffect(()=>((a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"start_radar"})),()=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"stop_radar"}))}),[g,a]);const Q=x.useCallback(n=>{n.preventDefault();const e=n.deltaY>0?1.25:.8;_.current=Math.max(.02,Math.min(5,_.current*e)),k(_.current)},[]),D=x.useCallback(n=>{const e=p.current;if(!e)return;const o=e.getBoundingClientRect(),s=(n.clientX-o.left)*(e.width/o.width),r=(n.clientY-o.top)*(e.height/o.height);let M=null,u=20;W.current.forEach(f=>{if(f._px===void 0)return;const S=Math.sqrt((s-f._px)**2+(r-f._py)**2);S{var G;const n=p.current;if(!n||!t)return;const e=n.getContext("2d");if(!e)return;const o=q,s=o/2,r=o/2,M=t.objects??[],u=t.player_ew??0,f=t.player_ns??0,S=t.player_heading??0,b=t.is_dungeon??!1,V=t.player_x??0,Z=t.player_y??0,Y=_.current,z=b?o/2/(Y*240):o/2/Y,j=S*Math.PI/180;e.clearRect(0,0,o,o),e.fillStyle="#111",e.beginPath(),e.arc(s,r,s,0,Math.PI*2),e.fill(),e.save(),e.beginPath(),e.arc(s,r,s-1,0,Math.PI*2),e.clip();const B=t.landblock??null,te=t.player_raw_z??0;if(b&&B&&((G=window.__dungeonMapCache)!=null&&G[B])){const l=window.__dungeonMapCache[B],h=Math.floor((te+3)/6)*6;e.translate(s,r),e.rotate(-(S-180)*Math.PI/180);const i=10*z,O=A&&Object.keys(A).length>0;(l.z_levels||[]).slice().sort((y,m)=>(y.z===h?1:0)-(m.z===h?1:0)).forEach(y=>{const m=y.z===h;e.globalAlpha=m?.85:.12,(y.cells||[]).forEach(T=>{const P=-(T.x-V)*z,N=(T.y-Z)*z,C=O?A[String(T.env_id)]:null;C?(e.save(),e.translate(P,N),e.rotate(ie(T.rotation)),e.drawImage(C,-i/2,-i/2,i,i),e.restore()):(e.fillStyle=m?"#3a5a3a":"#1a2a1a",e.fillRect(P-i/2,N-i/2,i,i))})}),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0)}else if(!b&&I.current){const l=I.current,h=l.naturalWidth/204.2,i=(u+102.1)*h,O=(102.1-f)*h;e.globalAlpha=.4,e.save(),e.translate(s,r),e.rotate(-j);const v=Y*h*2;e.drawImage(l,i-v/2,O-v/2,v,v,-s,-r,o,o),e.restore(),e.globalAlpha=1}e.restore(),e.strokeStyle="#333",e.lineWidth=1;for(let l=1;l<=4;l++)e.beginPath(),e.arc(s,r,s/4*l,0,Math.PI*2),e.stroke();e.beginPath(),e.moveTo(s,0),e.lineTo(s,o),e.moveTo(0,r),e.lineTo(o,r),e.stroke(),e.font="bold 12px monospace",e.textAlign="center",e.textBaseline="middle",[{l:"N",a:0},{l:"E",a:Math.PI/2},{l:"S",a:Math.PI},{l:"W",a:-Math.PI/2}].forEach(({l,a:h})=>{const i=h-j;e.fillStyle=l==="N"?"#cc4444":"#888",e.fillText(l,s+Math.sin(i)*(s-12),r-Math.cos(i)*(s-12))}),e.strokeStyle="#666",e.lineWidth=1,e.beginPath(),e.moveTo(s,r),e.lineTo(s,r-s*.85),e.stroke();const $=b?Math.PI-j:j,X=Math.cos($),F=Math.sin($);M.forEach(l=>{let h,i;b&&l.raw_x!==void 0?(h=-(l.raw_x-V),i=l.raw_y-Z):(h=(l.ew??0)-u,i=(l.ns??0)-f);const O=h*X-i*F,v=b?h*F+i*X:-(h*F+i*X),y=s+O*z,m=r+v*z;if(Math.sqrt((y-s)**2+(m-r)**2)>s-4)return;l._px=y,l._py=m;const P=l.object_class??l.type??"",N=K[P]??"#888",C=l.id===E,J=C?6:P==="Monster"||P==="Player"?4:3;C&&(e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(y,m,J+3,0,Math.PI*2),e.stroke()),e.fillStyle=N,e.beginPath(),e.arc(y,m,J,0,Math.PI*2),e.fill(),(P==="Player"||P==="Portal"||C)&&(e.fillStyle=C?"#fff":N,e.font="9px monospace",e.textAlign="left",e.fillText(l.name,y+6,m+3))}),W.current=M,e.fillStyle="#ffcc00",e.beginPath(),e.arc(s,r,5,0,Math.PI*2),e.fill(),e.strokeStyle="#fff",e.lineWidth=1,e.stroke()},[t,R,E]);const U=((t==null?void 0:t.objects)??[]).map(n=>{const e=(t==null?void 0:t.player_ew)??0,o=(t==null?void 0:t.player_ns)??0,s=(t==null?void 0:t.is_dungeon)??!1,r=(t==null?void 0:t.player_x)??0,M=(t==null?void 0:t.player_y)??0;let u,f,S;s&&n.raw_x!==void 0?(u=-(n.raw_x-r),f=n.raw_y-M,S=Math.sqrt(u*u+f*f)):(u=(n.ew??0)-e,f=(n.ns??0)-o,S=Math.sqrt(u*u+f*f)*240);const b=Math.atan2(u,f)*180/Math.PI;return{...n,dist:S,dir:re(b)}}).sort((n,e)=>n.dist-e.dist),ee=Math.round(R*240);return c.jsxs(ne,{id:d,title:`Radar: ${g}`,zIndex:w,width:360,height:560,children:[c.jsxs("div",{style:{padding:"4px 8px",display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"#888",borderBottom:"1px solid #333",background:"#1a1a1a"},children:[c.jsxs("span",{children:["Range: ~",ee,"m"]}),c.jsx("span",{style:{fontSize:"0.65rem",color:"#555"},children:"Scroll to zoom"})]}),c.jsx("canvas",{ref:p,width:q,height:q,style:{display:"block",margin:"0 auto",borderBottom:"1px solid #333",cursor:"crosshair",flexShrink:0},onWheel:Q,onClick:D}),c.jsxs("div",{style:{flex:1,overflowY:"auto",fontSize:"0.72rem",minHeight:0},children:[c.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#666",fontSize:"0.65rem",fontWeight:600},children:[c.jsx("span",{style:{width:8}}),c.jsx("span",{style:{flex:1,marginLeft:6},children:"Name"}),c.jsx("span",{style:{width:55,textAlign:"left"},children:"Type"}),c.jsx("span",{style:{width:40,textAlign:"right"},children:"Dist"}),c.jsx("span",{style:{width:24,textAlign:"center"},children:"Dir"})]}),U.length===0&&c.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"Waiting for radar data..."}),U.map(n=>{const e=n.object_class??n.type??"",o=K[e]??"#888",s=n.id===E;return c.jsxs("div",{onClick:()=>L(s?null:n.id),style:{display:"flex",alignItems:"center",padding:"2px 6px",borderBottom:"1px solid #1a1a1a",cursor:"pointer",color:"#ccc",background:s?"#1a2a3a":"",borderLeft:s?"2px solid #4488ff":"2px solid transparent"},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:o,flexShrink:0}}),c.jsx("span",{style:{flex:1,marginLeft:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.name}),c.jsx("span",{style:{width:55,color:"#888",fontSize:"0.65rem"},children:e}),c.jsx("span",{style:{width:40,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:n.dist<1e3?`${Math.round(n.dist)}m`:`${(n.dist/1e3).toFixed(1)}km`}),c.jsx("span",{style:{width:24,textAlign:"center",color:"#666"},children:n.dir})]},n.id)})]})]})};export{fe as RadarWindow}; +import{r as x,j as c,D as ne}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const q=300,H=.5,se={walls:{r:0,g:0,b:255},innerWalls:{r:127,g:127,b:255},rampedWalls:{r:77,g:255,b:255},floors:{r:0,g:127,b:255},stairs:{r:0,g:63,b:255}},le={walls:{r:140,g:140,b:180},innerWalls:{r:100,g:100,b:140},rampedWalls:{r:120,g:160,b:120},floors:{r:60,g:80,b:60},stairs:{r:180,g:160,b:80}};function oe(d){const g=document.createElement("canvas");g.width=10,g.height=10;const w=g.getContext("2d");w.drawImage(d,0,0,10,10);const a=w.getImageData(0,0,10,10),t=a.data;for(let p=0;p240&&R>240&&k>240){t[p+3]=0;continue}let E=!1;for(const[L,I]of Object.entries(se))if(Math.abs(_-I.r)<15&&Math.abs(R-I.g)<15&&Math.abs(k-I.b)<15){const W=le[L];t[p]=W.r,t[p+1]=W.g,t[p+2]=W.b,E=!0;break}!E&&_<15&&R<15&&k<15&&(t[p+3]=100)}return w.putImageData(a,0,0),g}function ie(d){return d===1?Math.PI:d<-.7&&d>-.8?Math.PI/2:d>.7&&d<.8?-Math.PI/2:0}let A=null;function ce(){A||(A={},fetch("/dungeon_tiles.json").then(d=>d.json()).then(d=>{Object.entries(d).forEach(([g,w])=>{const a=new Image;a.onload=()=>{A[g]=oe(a)},a.src=w})}).catch(()=>{}))}const K={Monster:"#ff4444",Player:"#4488ff",NPC:"#44cc44",Vendor:"#44cc44",Portal:"#aa44ff",Corpse:"#ff8800",Container:"#cccc44",Door:"#888888"};function re(d){const g=(d%360+360)%360;return["N","NE","E","SE","S","SW","W","NW"][Math.round(g/45)%8]}const fe=({id:d,charName:g,zIndex:w,socket:a,radarData:t})=>{const p=x.useRef(null),_=x.useRef(H),[R,k]=x.useState(H),[E,L]=x.useState(null),I=x.useRef(null),W=x.useRef([]);x.useEffect(()=>{const n=new Image;n.src="/dereth.png",n.onload=()=>{I.current=n},ce()},[]),x.useEffect(()=>((a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"start_radar"})),()=>{(a==null?void 0:a.readyState)===WebSocket.OPEN&&a.send(JSON.stringify({player_name:g,command:"stop_radar"}))}),[g,a]);const Q=x.useCallback(n=>{n.preventDefault();const e=n.deltaY>0?1.25:.8;_.current=Math.max(.02,Math.min(5,_.current*e)),k(_.current)},[]),D=x.useCallback(n=>{const e=p.current;if(!e)return;const o=e.getBoundingClientRect(),s=(n.clientX-o.left)*(e.width/o.width),r=(n.clientY-o.top)*(e.height/o.height);let M=null,u=20;W.current.forEach(f=>{if(f._px===void 0)return;const S=Math.sqrt((s-f._px)**2+(r-f._py)**2);S{var G;const n=p.current;if(!n||!t)return;const e=n.getContext("2d");if(!e)return;const o=q,s=o/2,r=o/2,M=t.objects??[],u=t.player_ew??0,f=t.player_ns??0,S=t.player_heading??0,b=t.is_dungeon??!1,V=t.player_x??0,Z=t.player_y??0,Y=_.current,z=b?o/2/(Y*240):o/2/Y,j=S*Math.PI/180;e.clearRect(0,0,o,o),e.fillStyle="#111",e.beginPath(),e.arc(s,r,s,0,Math.PI*2),e.fill(),e.save(),e.beginPath(),e.arc(s,r,s-1,0,Math.PI*2),e.clip();const B=t.landblock??null,te=t.player_raw_z??0;if(b&&B&&((G=window.__dungeonMapCache)!=null&&G[B])){const l=window.__dungeonMapCache[B],h=Math.floor((te+3)/6)*6;e.translate(s,r),e.rotate(-(S-180)*Math.PI/180);const i=10*z,O=A&&Object.keys(A).length>0;(l.z_levels||[]).slice().sort((y,m)=>(y.z===h?1:0)-(m.z===h?1:0)).forEach(y=>{const m=y.z===h;e.globalAlpha=m?.85:.12,(y.cells||[]).forEach(T=>{const P=-(T.x-V)*z,N=(T.y-Z)*z,C=O?A[String(T.env_id)]:null;C?(e.save(),e.translate(P,N),e.rotate(ie(T.rotation)),e.drawImage(C,-i/2,-i/2,i,i),e.restore()):(e.fillStyle=m?"#3a5a3a":"#1a2a1a",e.fillRect(P-i/2,N-i/2,i,i))})}),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0)}else if(!b&&I.current){const l=I.current,h=l.naturalWidth/204.2,i=(u+102.1)*h,O=(102.1-f)*h;e.globalAlpha=.4,e.save(),e.translate(s,r),e.rotate(-j);const v=Y*h*2;e.drawImage(l,i-v/2,O-v/2,v,v,-s,-r,o,o),e.restore(),e.globalAlpha=1}e.restore(),e.strokeStyle="#333",e.lineWidth=1;for(let l=1;l<=4;l++)e.beginPath(),e.arc(s,r,s/4*l,0,Math.PI*2),e.stroke();e.beginPath(),e.moveTo(s,0),e.lineTo(s,o),e.moveTo(0,r),e.lineTo(o,r),e.stroke(),e.font="bold 12px monospace",e.textAlign="center",e.textBaseline="middle",[{l:"N",a:0},{l:"E",a:Math.PI/2},{l:"S",a:Math.PI},{l:"W",a:-Math.PI/2}].forEach(({l,a:h})=>{const i=h-j;e.fillStyle=l==="N"?"#cc4444":"#888",e.fillText(l,s+Math.sin(i)*(s-12),r-Math.cos(i)*(s-12))}),e.strokeStyle="#666",e.lineWidth=1,e.beginPath(),e.moveTo(s,r),e.lineTo(s,r-s*.85),e.stroke();const $=b?Math.PI-j:j,X=Math.cos($),F=Math.sin($);M.forEach(l=>{let h,i;b&&l.raw_x!==void 0?(h=-(l.raw_x-V),i=l.raw_y-Z):(h=(l.ew??0)-u,i=(l.ns??0)-f);const O=h*X-i*F,v=b?h*F+i*X:-(h*F+i*X),y=s+O*z,m=r+v*z;if(Math.sqrt((y-s)**2+(m-r)**2)>s-4)return;l._px=y,l._py=m;const P=l.object_class??l.type??"",N=K[P]??"#888",C=l.id===E,J=C?6:P==="Monster"||P==="Player"?4:3;C&&(e.strokeStyle="#fff",e.lineWidth=2,e.beginPath(),e.arc(y,m,J+3,0,Math.PI*2),e.stroke()),e.fillStyle=N,e.beginPath(),e.arc(y,m,J,0,Math.PI*2),e.fill(),(P==="Player"||P==="Portal"||C)&&(e.fillStyle=C?"#fff":N,e.font="9px monospace",e.textAlign="left",e.fillText(l.name,y+6,m+3))}),W.current=M,e.fillStyle="#ffcc00",e.beginPath(),e.arc(s,r,5,0,Math.PI*2),e.fill(),e.strokeStyle="#fff",e.lineWidth=1,e.stroke()},[t,R,E]);const U=((t==null?void 0:t.objects)??[]).map(n=>{const e=(t==null?void 0:t.player_ew)??0,o=(t==null?void 0:t.player_ns)??0,s=(t==null?void 0:t.is_dungeon)??!1,r=(t==null?void 0:t.player_x)??0,M=(t==null?void 0:t.player_y)??0;let u,f,S;s&&n.raw_x!==void 0?(u=-(n.raw_x-r),f=n.raw_y-M,S=Math.sqrt(u*u+f*f)):(u=(n.ew??0)-e,f=(n.ns??0)-o,S=Math.sqrt(u*u+f*f)*240);const b=Math.atan2(u,f)*180/Math.PI;return{...n,dist:S,dir:re(b)}}).sort((n,e)=>n.dist-e.dist),ee=Math.round(R*240);return c.jsxs(ne,{id:d,title:`Radar: ${g}`,zIndex:w,width:360,height:560,children:[c.jsxs("div",{style:{padding:"4px 8px",display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"#888",borderBottom:"1px solid #333",background:"#1a1a1a"},children:[c.jsxs("span",{children:["Range: ~",ee,"m"]}),c.jsx("span",{style:{fontSize:"0.65rem",color:"#555"},children:"Scroll to zoom"})]}),c.jsx("canvas",{ref:p,width:q,height:q,style:{display:"block",margin:"0 auto",borderBottom:"1px solid #333",cursor:"crosshair",flexShrink:0},onWheel:Q,onClick:D}),c.jsxs("div",{style:{flex:1,overflowY:"auto",fontSize:"0.72rem",minHeight:0},children:[c.jsxs("div",{style:{display:"flex",padding:"3px 6px",borderBottom:"1px solid #333",color:"#666",fontSize:"0.65rem",fontWeight:600},children:[c.jsx("span",{style:{width:8}}),c.jsx("span",{style:{flex:1,marginLeft:6},children:"Name"}),c.jsx("span",{style:{width:55,textAlign:"left"},children:"Type"}),c.jsx("span",{style:{width:40,textAlign:"right"},children:"Dist"}),c.jsx("span",{style:{width:24,textAlign:"center"},children:"Dir"})]}),U.length===0&&c.jsx("div",{style:{padding:12,color:"#555",textAlign:"center",fontSize:"0.7rem"},children:"Waiting for radar data..."}),U.map(n=>{const e=n.object_class??n.type??"",o=K[e]??"#888",s=n.id===E;return c.jsxs("div",{onClick:()=>L(s?null:n.id),style:{display:"flex",alignItems:"center",padding:"2px 6px",borderBottom:"1px solid #1a1a1a",cursor:"pointer",color:"#ccc",background:s?"#1a2a3a":"",borderLeft:s?"2px solid #4488ff":"2px solid transparent"},children:[c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:o,flexShrink:0}}),c.jsx("span",{style:{flex:1,marginLeft:6,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.name}),c.jsx("span",{style:{width:55,color:"#888",fontSize:"0.65rem"},children:e}),c.jsx("span",{style:{width:40,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:n.dist<1e3?`${Math.round(n.dist)}m`:`${(n.dist/1e3).toFixed(1)}km`}),c.jsx("span",{style:{width:24,textAlign:"center",color:"#666"},children:n.dir})]},n.id)})]})]})};export{fe as RadarWindow}; diff --git a/static/assets/StatsWindow-B6zfbHhl.js b/static/assets/StatsWindow-DKBKOgS_.js similarity index 93% rename from static/assets/StatsWindow-B6zfbHhl.js rename to static/assets/StatsWindow-DKBKOgS_.js index 0a7034d5..d1ec7e60 100644 --- a/static/assets/StatsWindow-B6zfbHhl.js +++ b/static/assets/StatsWindow-DKBKOgS_.js @@ -1 +1 @@ -import{r as o,j as t,D as d}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const c=[{title:"Kills per Hour",id:1},{title:"Memory (MB)",id:2},{title:"CPU (%)",id:3},{title:"Mem Handles",id:4}],m=[{label:"1H",value:"now-1h"},{label:"6H",value:"now-6h"},{label:"24H",value:"now-24h"},{label:"7D",value:"now-7d"}],v=({id:s,charName:a,zIndex:i})=>{const[l,r]=o.useState("now-24h"),n=e=>`/grafana/d-solo/dereth-tracker/dereth-tracker-dashboard?panelId=${e}&var-character=${encodeURIComponent(a)}&from=${l}&to=now&theme=light`;return t.jsxs(d,{id:s,title:`Stats: ${a}`,zIndex:i,width:750,height:480,children:[t.jsx("div",{className:"ml-stats-controls",children:m.map(e=>t.jsx("button",{className:`ml-stats-range-btn ${l===e.value?"active":""}`,onClick:()=>r(e.value),children:e.label},e.value))}),t.jsx("div",{className:"ml-stats-grid",children:c.map(e=>t.jsx("div",{className:"ml-stats-panel",children:t.jsx("iframe",{src:n(e.id),width:"100%",height:"100%",frameBorder:"0",title:e.title})},e.id))})]})};export{v as StatsWindow}; +import{r as o,j as t,D as d}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const c=[{title:"Kills per Hour",id:1},{title:"Memory (MB)",id:2},{title:"CPU (%)",id:3},{title:"Mem Handles",id:4}],m=[{label:"1H",value:"now-1h"},{label:"6H",value:"now-6h"},{label:"24H",value:"now-24h"},{label:"7D",value:"now-7d"}],v=({id:s,charName:a,zIndex:i})=>{const[l,r]=o.useState("now-24h"),n=e=>`/grafana/d-solo/dereth-tracker/dereth-tracker-dashboard?panelId=${e}&var-character=${encodeURIComponent(a)}&from=${l}&to=now&theme=light`;return t.jsxs(d,{id:s,title:`Stats: ${a}`,zIndex:i,width:750,height:480,children:[t.jsx("div",{className:"ml-stats-controls",children:m.map(e=>t.jsx("button",{className:`ml-stats-range-btn ${l===e.value?"active":""}`,onClick:()=>r(e.value),children:e.label},e.value))}),t.jsx("div",{className:"ml-stats-grid",children:c.map(e=>t.jsx("div",{className:"ml-stats-panel",children:t.jsx("iframe",{src:n(e.id),width:"100%",height:"100%",frameBorder:"0",title:e.title})},e.id))})]})};export{v as StatsWindow}; diff --git a/static/assets/VitalSharingWindow-MVVa2yWs.js b/static/assets/VitalSharingWindow-Cqg_448n.js similarity index 97% rename from static/assets/VitalSharingWindow-MVVa2yWs.js rename to static/assets/VitalSharingWindow-Cqg_448n.js index 787e559c..71b342ed 100644 --- a/static/assets/VitalSharingWindow-MVVa2yWs.js +++ b/static/assets/VitalSharingWindow-Cqg_448n.js @@ -1 +1 @@ -import{r as n,j as t,D as x,a as m}from"./index-3SHiQu4l.js";import"./react-yfL0ty4i.js";const v=({id:o,zIndex:c})=>{const[a,d]=n.useState([]);n.useEffect(()=>{const e=async()=>{try{const s=await m("/vital-sharing/peers");d(s.peers??[])}catch{}};e();const l=setInterval(e,5e3);return()=>clearInterval(l)},[]);const h=(e,l)=>l>0?Math.min(100,e/l*100):0;return t.jsx(x,{id:o,title:"Vital Sharing Network",zIndex:c,width:520,height:450,children:t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.75rem"},children:a.length===0?t.jsx("div",{style:{padding:16,color:"#666",textAlign:"center"},children:"No vital-sharing peers connected"}):a.map(e=>{var l,s,r;return t.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[t.jsx("span",{style:{color:e.plugin_connected?"#4c4":"#a33",fontSize:"0.8rem"},children:"●"}),t.jsx("strong",{style:{flex:1},children:e.character_name}),e.subscribed&&t.jsx("span",{style:{color:"#6bf",fontSize:"0.65rem"},children:"[subscribed]"})]}),t.jsxs("div",{style:{color:"#666",fontSize:"0.68rem",marginBottom:3},children:["tags: ",((l=e.tags)==null?void 0:l.join(", "))||"none"]}),e.vitals&&e.vitals.max_health>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[{label:"HP",cur:e.vitals.current_health,max:e.vitals.max_health,bg:"#330000",fill:"#c44"},{label:"STA",cur:e.vitals.current_stamina,max:e.vitals.max_stamina,bg:"#331a00",fill:"#ca0"},{label:"MANA",cur:e.vitals.current_mana,max:e.vitals.max_mana,bg:"#001433",fill:"#48f"}].map(i=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsx("span",{style:{width:32,color:"#888",fontSize:"0.65rem"},children:i.label}),t.jsx("div",{style:{flex:1,height:6,background:i.bg,borderRadius:3,overflow:"hidden"},children:t.jsx("div",{style:{width:`${h(i.cur,i.max)}%`,height:"100%",background:i.fill,borderRadius:3}})}),t.jsxs("span",{style:{width:60,textAlign:"right",fontSize:"0.65rem",color:"#888"},children:[i.cur,"/",i.max]})]},i.label))}),e.position&&t.jsxs("div",{style:{color:"#555",fontSize:"0.65rem",marginTop:2},children:[(s=e.position.ns)==null?void 0:s.toFixed(1),"N, ",(r=e.position.ew)==null?void 0:r.toFixed(1),"E"]})]},e.character_name)})})})};export{v as VitalSharingWindow}; +import{r as n,j as t,D as x,a as m}from"./index-d7uW0_CB.js";import"./react-yfL0ty4i.js";const v=({id:o,zIndex:c})=>{const[a,d]=n.useState([]);n.useEffect(()=>{const e=async()=>{try{const s=await m("/vital-sharing/peers");d(s.peers??[])}catch{}};e();const l=setInterval(e,5e3);return()=>clearInterval(l)},[]);const h=(e,l)=>l>0?Math.min(100,e/l*100):0;return t.jsx(x,{id:o,title:"Vital Sharing Network",zIndex:c,width:520,height:450,children:t.jsx("div",{style:{flex:1,overflowY:"auto",padding:6,fontSize:"0.75rem"},children:a.length===0?t.jsx("div",{style:{padding:16,color:"#666",textAlign:"center"},children:"No vital-sharing peers connected"}):a.map(e=>{var l,s,r;return t.jsxs("div",{style:{padding:"6px 8px",marginBottom:4,background:"#1f1f1f",borderRadius:3,border:"1px solid #333"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:3},children:[t.jsx("span",{style:{color:e.plugin_connected?"#4c4":"#a33",fontSize:"0.8rem"},children:"●"}),t.jsx("strong",{style:{flex:1},children:e.character_name}),e.subscribed&&t.jsx("span",{style:{color:"#6bf",fontSize:"0.65rem"},children:"[subscribed]"})]}),t.jsxs("div",{style:{color:"#666",fontSize:"0.68rem",marginBottom:3},children:["tags: ",((l=e.tags)==null?void 0:l.join(", "))||"none"]}),e.vitals&&e.vitals.max_health>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[{label:"HP",cur:e.vitals.current_health,max:e.vitals.max_health,bg:"#330000",fill:"#c44"},{label:"STA",cur:e.vitals.current_stamina,max:e.vitals.max_stamina,bg:"#331a00",fill:"#ca0"},{label:"MANA",cur:e.vitals.current_mana,max:e.vitals.max_mana,bg:"#001433",fill:"#48f"}].map(i=>t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[t.jsx("span",{style:{width:32,color:"#888",fontSize:"0.65rem"},children:i.label}),t.jsx("div",{style:{flex:1,height:6,background:i.bg,borderRadius:3,overflow:"hidden"},children:t.jsx("div",{style:{width:`${h(i.cur,i.max)}%`,height:"100%",background:i.fill,borderRadius:3}})}),t.jsxs("span",{style:{width:60,textAlign:"right",fontSize:"0.65rem",color:"#888"},children:[i.cur,"/",i.max]})]},i.label))}),e.position&&t.jsxs("div",{style:{color:"#555",fontSize:"0.65rem",marginTop:2},children:[(s=e.position.ns)==null?void 0:s.toFixed(1),"N, ",(r=e.position.ew)==null?void 0:r.toFixed(1),"E"]})]},e.character_name)})})})};export{v as VitalSharingWindow}; diff --git a/static/assets/index-3SHiQu4l.js b/static/assets/index-3SHiQu4l.js deleted file mode 100644 index cb9d87dd..00000000 --- a/static/assets/index-3SHiQu4l.js +++ /dev/null @@ -1,34 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsWindow-B6zfbHhl.js","assets/react-yfL0ty4i.js","assets/CharacterWindow-DrrpU--7.js","assets/InventoryWindow-rVjaqxW-.js","assets/RadarWindow-B3i5zXC8.js","assets/CombatStatsWindow-DLWkDKIY.js","assets/CombatPickerWindow-2NQUGplv.js","assets/IssuesWindow-C_A54UOW.js","assets/VitalSharingWindow-MVVa2yWs.js","assets/QuestStatusWindow-DL34Ths2.js","assets/PlayerDashboardWindow-qdSQRhha.js","assets/AgentWindow-Bk40GB4J.js","assets/AdminUsersWindow-C8y7Dpy1.js"])))=>i.map(i=>d[i]); -import{r as Dm,g as nh,a as ch}from"./react-yfL0ty4i.js";(function(){const p=document.createElement("link").relList;if(p&&p.supports&&p.supports("modulepreload"))return;for(const D of document.querySelectorAll('link[rel="modulepreload"]'))d(D);new MutationObserver(D=>{for(const j of D)if(j.type==="childList")for(const O of j.addedNodes)O.tagName==="LINK"&&O.rel==="modulepreload"&&d(O)}).observe(document,{childList:!0,subtree:!0});function E(D){const j={};return D.integrity&&(j.integrity=D.integrity),D.referrerPolicy&&(j.referrerPolicy=D.referrerPolicy),D.crossOrigin==="use-credentials"?j.credentials="include":D.crossOrigin==="anonymous"?j.credentials="omit":j.credentials="same-origin",j}function d(D){if(D.ep)return;D.ep=!0;const j=E(D);fetch(D.href,j)}})();var of={exports:{}},gu={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Sm;function ih(){if(Sm)return gu;Sm=1;var s=Symbol.for("react.transitional.element"),p=Symbol.for("react.fragment");function E(d,D,j){var O=null;if(j!==void 0&&(O=""+j),D.key!==void 0&&(O=""+D.key),"key"in D){j={};for(var N in D)N!=="key"&&(j[N]=D[N])}else j=D;return D=j.ref,{$$typeof:s,type:d,key:O,ref:D!==void 0?D:null,props:j}}return gu.Fragment=p,gu.jsx=E,gu.jsxs=E,gu}var bm;function fh(){return bm||(bm=1,of.exports=ih()),of.exports}var r=fh(),z=Dm();const bu=nh(z);var df={exports:{}},Su={},mf={exports:{}},rf={};/** - * @license React - * scheduler.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var zm;function sh(){return zm||(zm=1,(function(s){function p(g,C){var G=g.length;g.push(C);l:for(;0>>1,B=g[R];if(0>>1;RD(F,G))RlD(_t,F)?(g[R]=_t,g[Rl]=G,R=Rl):(g[R]=F,g[sl]=G,R=sl);else if(RlD(_t,G))g[R]=_t,g[Rl]=G,R=Rl;else break l}}return C}function D(g,C){var G=g.sortIndex-C.sortIndex;return G!==0?G:g.id-C.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var j=performance;s.unstable_now=function(){return j.now()}}else{var O=Date,N=O.now();s.unstable_now=function(){return O.now()-N}}var v=[],M=[],Y=1,T=null,U=3,q=!1,I=!1,ul=!1,rl=!1,Sl=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function xl(g){for(var C=E(M);C!==null;){if(C.callback===null)d(M);else if(C.startTime<=g)d(M),C.sortIndex=C.expirationTime,p(v,C);else break;C=E(M)}}function Zl(g){if(ul=!1,xl(g),!I)if(E(v)!==null)I=!0,$||($=!0,Tl());else{var C=E(M);C!==null&&bt(Zl,C.startTime-g)}}var $=!1,P=-1,Q=5,L=-1;function k(){return rl?!0:!(s.unstable_now()-Lg&&k());){var R=T.callback;if(typeof R=="function"){T.callback=null,U=T.priorityLevel;var B=R(T.expirationTime<=g);if(g=s.unstable_now(),typeof B=="function"){T.callback=B,xl(g),C=!0;break t}T===E(v)&&d(v),xl(g)}else d(v);T=E(v)}if(T!==null)C=!0;else{var fl=E(M);fl!==null&&bt(Zl,fl.startTime-g),C=!1}}break l}finally{T=null,U=G,q=!1}C=void 0}}finally{C?Tl():$=!1}}}var Tl;if(typeof J=="function")Tl=function(){J(Ul)};else if(typeof MessageChannel<"u"){var Nt=new MessageChannel,Et=Nt.port2;Nt.port1.onmessage=Ul,Tl=function(){Et.postMessage(null)}}else Tl=function(){Sl(Ul,0)};function bt(g,C){P=Sl(function(){g(s.unstable_now())},C)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(g){g.callback=null},s.unstable_forceFrameRate=function(g){0>g||125R?(g.sortIndex=G,p(M,g),E(v)===null&&g===E(M)&&(ul?(K(P),P=-1):ul=!0,bt(Zl,G-R))):(g.sortIndex=B,p(v,g),I||q||(I=!0,$||($=!0,Tl()))),g},s.unstable_shouldYield=k,s.unstable_wrapCallback=function(g){var C=U;return function(){var G=U;U=C;try{return g.apply(this,arguments)}finally{U=G}}}})(rf)),rf}var pm;function oh(){return pm||(pm=1,mf.exports=sh()),mf.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Tm;function dh(){if(Tm)return Su;Tm=1;var s=oh(),p=Dm(),E=ch();function d(l){var t="https://react.dev/errors/"+l;if(1B||(l.current=R[B],R[B]=null,B--)}function F(l,t){B++,R[B]=l.current,l.current=t}var Rl=fl(null),_t=fl(null),Wt=fl(null),Tu=fl(null);function Au(l,t){switch(F(Wt,t),F(_t,l),F(Rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Qd(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Qd(t),l=Zd(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}sl(Rl),F(Rl,l)}function Ga(){sl(Rl),sl(_t),sl(Wt)}function Ln(l){l.memoizedState!==null&&F(Tu,l);var t=Rl.current,a=Zd(t,l.type);t!==a&&(F(_t,l),F(Rl,a))}function Eu(l){_t.current===l&&(sl(Rl),sl(_t)),Tu.current===l&&(sl(Tu),ru._currentValue=G)}var Kn,vf;function pa(l){if(Kn===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Kn=t&&t[1]||"",vf=-1)":-1u||f[e]!==y[u]){var A=` -`+f[e].replace(" at new "," at ");return l.displayName&&A.includes("")&&(A=A.replace("",l.displayName)),A}while(1<=e&&0<=u);break}}}finally{Jn=!1,Error.prepareStackTrace=a}return(a=l?l.displayName||l.name:"")?pa(a):""}function qm(l,t){switch(l.tag){case 26:case 27:case 5:return pa(l.type);case 16:return pa("Lazy");case 13:return l.child!==t&&t!==null?pa("Suspense Fallback"):pa("Suspense");case 19:return pa("SuspenseList");case 0:case 15:return wn(l.type,!1);case 11:return wn(l.type.render,!1);case 1:return wn(l.type,!0);case 31:return pa("Activity");default:return""}}function gf(l){try{var t="",a=null;do t+=qm(l,a),a=l,l=l.return;while(l);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var kn=Object.prototype.hasOwnProperty,Wn=s.unstable_scheduleCallback,$n=s.unstable_cancelCallback,Bm=s.unstable_shouldYield,Ym=s.unstable_requestPaint,Fl=s.unstable_now,Xm=s.unstable_getCurrentPriorityLevel,Sf=s.unstable_ImmediatePriority,bf=s.unstable_UserBlockingPriority,_u=s.unstable_NormalPriority,Gm=s.unstable_LowPriority,zf=s.unstable_IdlePriority,Qm=s.log,Zm=s.unstable_setDisableYieldValue,_e=null,Il=null;function $t(l){if(typeof Qm=="function"&&Zm(l),Il&&typeof Il.setStrictMode=="function")try{Il.setStrictMode(_e,l)}catch{}}var Pl=Math.clz32?Math.clz32:Km,Vm=Math.log,Lm=Math.LN2;function Km(l){return l>>>=0,l===0?32:31-(Vm(l)/Lm|0)|0}var Mu=256,xu=262144,Du=4194304;function Ta(l){var t=l&42;if(t!==0)return t;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Ou(l,t,a){var e=l.pendingLanes;if(e===0)return 0;var u=0,n=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=e&134217727;return i!==0?(e=i&~n,e!==0?u=Ta(e):(c&=i,c!==0?u=Ta(c):a||(a=i&~l,a!==0&&(u=Ta(a))))):(i=e&~n,i!==0?u=Ta(i):c!==0?u=Ta(c):a||(a=e&~l,a!==0&&(u=Ta(a)))),u===0?0:t!==0&&t!==u&&(t&n)===0&&(n=u&-u,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:u}function Me(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function Jm(l,t){switch(l){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pf(){var l=Du;return Du<<=1,(Du&62914560)===0&&(Du=4194304),l}function Fn(l){for(var t=[],a=0;31>a;a++)t.push(l);return t}function xe(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function wm(l,t,a,e,u,n){var c=l.pendingLanes;l.pendingLanes=a,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=a,l.entangledLanes&=a,l.errorRecoveryDisabledLanes&=a,l.shellSuspendCounter=0;var i=l.entanglements,f=l.expirationTimes,y=l.hiddenUpdates;for(a=c&~a;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Pm=/[\n"\\]/g;function ft(l){return l.replace(Pm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ec(l,t,a,e,u,n,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+it(t)):l.value!==""+it(t)&&(l.value=""+it(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?uc(l,c,it(t)):a!=null?uc(l,c,it(a)):e!=null&&l.removeAttribute("value"),u==null&&n!=null&&(l.defaultChecked=!!n),u!=null&&(l.checked=u&&typeof u!="function"&&typeof u!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+it(i):l.removeAttribute("name")}function Rf(l,t,a,e,u,n,c,i){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(l.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){ac(l);return}a=a!=null?""+it(a):"",t=t!=null?""+it(t):a,i||t===l.value||(l.value=t),l.defaultValue=t}e=e??u,e=typeof e!="function"&&typeof e!="symbol"&&!!e,l.checked=i?l.checked:!!e,l.defaultChecked=!!e,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),ac(l)}function uc(l,t,a){t==="number"&&Uu(l.ownerDocument)===l||l.defaultValue===""+a||(l.defaultValue=""+a)}function Ja(l,t,a,e){if(l=l.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=!1;if(Ct)try{var je={};Object.defineProperty(je,"passive",{get:function(){sc=!0}}),window.addEventListener("test",je,je),window.removeEventListener("test",je,je)}catch{sc=!1}var It=null,oc=null,Ru=null;function Qf(){if(Ru)return Ru;var l,t=oc,a=t.length,e,u="value"in It?It.value:It.textContent,n=u.length;for(l=0;l=Re),wf=" ",kf=!1;function Wf(l,t){switch(l){case"keyup":return xr.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $f(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var $a=!1;function Or(l,t){switch(l){case"compositionend":return $f(t);case"keypress":return t.which!==32?null:(kf=!0,wf);case"textInput":return l=t.data,l===wf&&kf?null:l;default:return null}}function Nr(l,t){if($a)return l==="compositionend"||!yc&&Wf(l,t)?(l=Qf(),Ru=oc=It=null,$a=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-l};l=e}l:{for(;a;){if(a.nextSibling){a=a.nextSibling;break l}a=a.parentNode}a=void 0}a=us(a)}}function cs(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?cs(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function is(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=Uu(l.document);t instanceof l.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)l=t.contentWindow;else break;t=Uu(l.document)}return t}function Sc(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var Yr=Ct&&"documentMode"in document&&11>=document.documentMode,Fa=null,bc=null,Ye=null,zc=!1;function fs(l,t,a){var e=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;zc||Fa==null||Fa!==Uu(e)||(e=Fa,"selectionStart"in e&&Sc(e)?e={start:e.selectionStart,end:e.selectionEnd}:(e=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection(),e={anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset}),Ye&&Be(Ye,e)||(Ye=e,e=Dn(bc,"onSelect"),0>=c,u-=c,Mt=1<<32-Pl(t)+u|a<W?(el=X,X=null):el=X.sibling;var il=S(m,X,h[W],_);if(il===null){X===null&&(X=el);break}l&&X&&il.alternate===null&&t(m,X),o=n(il,o,W),cl===null?Z=il:cl.sibling=il,cl=il,X=el}if(W===h.length)return a(m,X),nl&&Ht(m,W),Z;if(X===null){for(;WW?(el=X,X=null):el=X.sibling;var za=S(m,X,il.value,_);if(za===null){X===null&&(X=el);break}l&&X&&za.alternate===null&&t(m,X),o=n(za,o,W),cl===null?Z=za:cl.sibling=za,cl=za,X=el}if(il.done)return a(m,X),nl&&Ht(m,W),Z;if(X===null){for(;!il.done;W++,il=h.next())il=x(m,il.value,_),il!==null&&(o=n(il,o,W),cl===null?Z=il:cl.sibling=il,cl=il);return nl&&Ht(m,W),Z}for(X=e(X);!il.done;W++,il=h.next())il=b(X,m,W,il.value,_),il!==null&&(l&&il.alternate!==null&&X.delete(il.key===null?W:il.key),o=n(il,o,W),cl===null?Z=il:cl.sibling=il,cl=il);return l&&X.forEach(function(uh){return t(m,uh)}),nl&&Ht(m,W),Z}function vl(m,o,h,_){if(typeof h=="object"&&h!==null&&h.type===ul&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case q:l:{for(var Z=h.key;o!==null;){if(o.key===Z){if(Z=h.type,Z===ul){if(o.tag===7){a(m,o.sibling),_=u(o,h.props.children),_.return=m,m=_;break l}}else if(o.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===Q&&Ca(Z)===o.type){a(m,o.sibling),_=u(o,h.props),Le(_,h),_.return=m,m=_;break l}a(m,o);break}else t(m,o);o=o.sibling}h.type===ul?(_=Da(h.props.children,m.mode,_,h.key),_.return=m,m=_):(_=Lu(h.type,h.key,h.props,null,m.mode,_),Le(_,h),_.return=m,m=_)}return c(m);case I:l:{for(Z=h.key;o!==null;){if(o.key===Z)if(o.tag===4&&o.stateNode.containerInfo===h.containerInfo&&o.stateNode.implementation===h.implementation){a(m,o.sibling),_=u(o,h.children||[]),_.return=m,m=_;break l}else{a(m,o);break}else t(m,o);o=o.sibling}_=xc(h,m.mode,_),_.return=m,m=_}return c(m);case Q:return h=Ca(h),vl(m,o,h,_)}if(bt(h))return H(m,o,h,_);if(Tl(h)){if(Z=Tl(h),typeof Z!="function")throw Error(d(150));return h=Z.call(h),V(m,o,h,_)}if(typeof h.then=="function")return vl(m,o,Fu(h),_);if(h.$$typeof===J)return vl(m,o,wu(m,h),_);Iu(m,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,o!==null&&o.tag===6?(a(m,o.sibling),_=u(o,h),_.return=m,m=_):(a(m,o),_=Mc(h,m.mode,_),_.return=m,m=_),c(m)):a(m,o)}return function(m,o,h,_){try{Ve=0;var Z=vl(m,o,h,_);return fe=null,Z}catch(X){if(X===ie||X===Wu)throw X;var cl=tt(29,X,null,m.mode);return cl.lanes=_,cl.return=m,cl}finally{}}}var Ha=js(!0),Us=js(!1),ea=!1;function Xc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gc(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function ua(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function na(l,t,a){var e=l.updateQueue;if(e===null)return null;if(e=e.shared,(ol&2)!==0){var u=e.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),e.pending=t,t=Vu(l),ys(l,null,a),t}return Zu(l,e,t,a),Vu(l)}function Ke(l,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,Af(l,a)}}function Qc(l,t){var a=l.updateQueue,e=l.alternate;if(e!==null&&(e=e.updateQueue,a===e)){var u=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?u=n=c:n=n.next=c,a=a.next}while(a!==null);n===null?u=n=t:n=n.next=t}else u=n=t;a={baseState:e.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:e.shared,callbacks:e.callbacks},l.updateQueue=a;return}l=a.lastBaseUpdate,l===null?a.firstBaseUpdate=t:l.next=t,a.lastBaseUpdate=t}var Zc=!1;function Je(){if(Zc){var l=ce;if(l!==null)throw l}}function we(l,t,a,e){Zc=!1;var u=l.updateQueue;ea=!1;var n=u.firstBaseUpdate,c=u.lastBaseUpdate,i=u.shared.pending;if(i!==null){u.shared.pending=null;var f=i,y=f.next;f.next=null,c===null?n=y:c.next=y,c=f;var A=l.alternate;A!==null&&(A=A.updateQueue,i=A.lastBaseUpdate,i!==c&&(i===null?A.firstBaseUpdate=y:i.next=y,A.lastBaseUpdate=f))}if(n!==null){var x=u.baseState;c=0,A=y=f=null,i=n;do{var S=i.lane&-536870913,b=S!==i.lane;if(b?(al&S)===S:(e&S)===S){S!==0&&S===ne&&(Zc=!0),A!==null&&(A=A.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var H=l,V=i;S=t;var vl=a;switch(V.tag){case 1:if(H=V.payload,typeof H=="function"){x=H.call(vl,x,S);break l}x=H;break l;case 3:H.flags=H.flags&-65537|128;case 0:if(H=V.payload,S=typeof H=="function"?H.call(vl,x,S):H,S==null)break l;x=T({},x,S);break l;case 2:ea=!0}}S=i.callback,S!==null&&(l.flags|=64,b&&(l.flags|=8192),b=u.callbacks,b===null?u.callbacks=[S]:b.push(S))}else b={lane:S,tag:i.tag,payload:i.payload,callback:i.callback,next:null},A===null?(y=A=b,f=x):A=A.next=b,c|=S;if(i=i.next,i===null){if(i=u.shared.pending,i===null)break;b=i,i=b.next,b.next=null,u.lastBaseUpdate=b,u.shared.pending=null}}while(!0);A===null&&(f=x),u.baseState=f,u.firstBaseUpdate=y,u.lastBaseUpdate=A,n===null&&(u.shared.lanes=0),oa|=c,l.lanes=c,l.memoizedState=x}}function Cs(l,t){if(typeof l!="function")throw Error(d(191,l));l.call(t)}function Rs(l,t){var a=l.callbacks;if(a!==null)for(l.callbacks=null,l=0;ln?n:8;var c=g.T,i={};g.T=i,ii(l,!1,t,a);try{var f=u(),y=g.S;if(y!==null&&y(i,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var A=wr(f,e);$e(l,t,A,ct(l))}else $e(l,t,e,ct(l))}catch(x){$e(l,t,{then:function(){},status:"rejected",reason:x},ct())}finally{C.p=n,c!==null&&i.types!==null&&(c.types=i.types),g.T=c}}function Pr(){}function ni(l,t,a,e){if(l.tag!==5)throw Error(d(476));var u=ro(l).queue;mo(l,u,t,G,a===null?Pr:function(){return ho(l),a(e)})}function ro(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xt,lastRenderedState:G},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xt,lastRenderedState:a},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function ho(l){var t=ro(l);t.next===null&&(t=l.alternate.memoizedState),$e(l,t.next.queue,{},ct())}function ci(){return Xl(ru)}function yo(){return Ml().memoizedState}function vo(){return Ml().memoizedState}function l0(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var a=ct();l=ua(a);var e=na(t,l,a);e!==null&&($l(e,t,a),Ke(e,t,a)),t={cache:Hc()},l.payload=t;return}t=t.return}}function t0(l,t,a){var e=ct();a={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},sn(l)?So(t,a):(a=Ec(l,t,a,e),a!==null&&($l(a,l,e),bo(a,t,e)))}function go(l,t,a){var e=ct();$e(l,t,a,e)}function $e(l,t,a,e){var u={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(sn(l))So(t,u);else{var n=l.alternate;if(l.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var c=t.lastRenderedState,i=n(c,a);if(u.hasEagerState=!0,u.eagerState=i,lt(i,c))return Zu(l,t,u,0),gl===null&&Qu(),!1}catch{}finally{}if(a=Ec(l,t,u,e),a!==null)return $l(a,l,e),bo(a,t,e),!0}return!1}function ii(l,t,a,e){if(e={lane:2,revertLane:Xi(),gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(l)){if(t)throw Error(d(479))}else t=Ec(l,a,e,2),t!==null&&$l(t,l,2)}function sn(l){var t=l.alternate;return l===w||t!==null&&t===w}function So(l,t){oe=tn=!0;var a=l.pending;a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t}function bo(l,t,a){if((a&4194048)!==0){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,Af(l,a)}}var Fe={readContext:Xl,use:un,useCallback:Al,useContext:Al,useEffect:Al,useImperativeHandle:Al,useLayoutEffect:Al,useInsertionEffect:Al,useMemo:Al,useReducer:Al,useRef:Al,useState:Al,useDebugValue:Al,useDeferredValue:Al,useTransition:Al,useSyncExternalStore:Al,useId:Al,useHostTransitionStatus:Al,useFormState:Al,useActionState:Al,useOptimistic:Al,useMemoCache:Al,useCacheRefresh:Al};Fe.useEffectEvent=Al;var zo={readContext:Xl,use:un,useCallback:function(l,t){return Vl().memoizedState=[l,t===void 0?null:t],l},useContext:Xl,useEffect:ao,useImperativeHandle:function(l,t,a){a=a!=null?a.concat([l]):null,cn(4194308,4,co.bind(null,t,l),a)},useLayoutEffect:function(l,t){return cn(4194308,4,l,t)},useInsertionEffect:function(l,t){cn(4,2,l,t)},useMemo:function(l,t){var a=Vl();t=t===void 0?null:t;var e=l();if(qa){$t(!0);try{l()}finally{$t(!1)}}return a.memoizedState=[e,t],e},useReducer:function(l,t,a){var e=Vl();if(a!==void 0){var u=a(t);if(qa){$t(!0);try{a(t)}finally{$t(!1)}}}else u=t;return e.memoizedState=e.baseState=u,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},e.queue=l,l=l.dispatch=t0.bind(null,w,l),[e.memoizedState,l]},useRef:function(l){var t=Vl();return l={current:l},t.memoizedState=l},useState:function(l){l=li(l);var t=l.queue,a=go.bind(null,w,t);return t.dispatch=a,[l.memoizedState,a]},useDebugValue:ei,useDeferredValue:function(l,t){var a=Vl();return ui(a,l,t)},useTransition:function(){var l=li(!1);return l=mo.bind(null,w,l.queue,!0,!1),Vl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,a){var e=w,u=Vl();if(nl){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),gl===null)throw Error(d(349));(al&127)!==0||Gs(e,t,a)}u.memoizedState=a;var n={value:a,getSnapshot:t};return u.queue=n,ao(Zs.bind(null,e,n,l),[l]),e.flags|=2048,me(9,{destroy:void 0},Qs.bind(null,e,n,a,t),null),a},useId:function(){var l=Vl(),t=gl.identifierPrefix;if(nl){var a=xt,e=Mt;a=(e&~(1<<32-Pl(e)-1)).toString(32)+a,t="_"+t+"R_"+a,a=an++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof e.is=="string"?c.createElement("select",{is:e.is}):c.createElement("select"),e.multiple?n.multiple=!0:e.size&&(n.size=e.size);break;default:n=typeof e.is=="string"?c.createElement(u,{is:e.is}):c.createElement(u)}}n[Bl]=t,n[Ll]=e;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)n.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=n;l:switch(Ql(n,u,e),u){case"button":case"input":case"select":case"textarea":e=!!e.autoFocus;break l;case"img":e=!0;break l;default:e=!1}e&&Qt(t)}}return zl(t),pi(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,a),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==e&&Qt(t);else{if(typeof e!="string"&&t.stateNode===null)throw Error(d(166));if(l=Wt.current,ee(t)){if(l=t.stateNode,a=t.memoizedProps,e=null,u=Yl,u!==null)switch(u.tag){case 27:case 5:e=u.memoizedProps}l[Bl]=t,l=!!(l.nodeValue===a||e!==null&&e.suppressHydrationWarning===!0||Xd(l.nodeValue,a)),l||ta(t,!0)}else l=On(l).createTextNode(e),l[Bl]=t,t.stateNode=l}return zl(t),null;case 31:if(a=t.memoizedState,l===null||l.memoizedState!==null){if(e=ee(t),a!==null){if(l===null){if(!e)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(557));l[Bl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zl(t),l=!1}else a=jc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=a),l=!0;if(!l)return t.flags&256?(et(t),t):(et(t),null);if((t.flags&128)!==0)throw Error(d(558))}return zl(t),null;case 13:if(e=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(u=ee(t),e!==null&&e.dehydrated!==null){if(l===null){if(!u)throw Error(d(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(d(317));u[Bl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zl(t),u=!1}else u=jc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(et(t),t):(et(t),null)}return et(t),(t.flags&128)!==0?(t.lanes=a,t):(a=e!==null,l=l!==null&&l.memoizedState!==null,a&&(e=t.child,u=null,e.alternate!==null&&e.alternate.memoizedState!==null&&e.alternate.memoizedState.cachePool!==null&&(u=e.alternate.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==u&&(e.flags|=2048)),a!==l&&a&&(t.child.flags|=8192),hn(t,t.updateQueue),zl(t),null);case 4:return Ga(),l===null&&Vi(t.stateNode.containerInfo),zl(t),null;case 10:return Bt(t.type),zl(t),null;case 19:if(sl(_l),e=t.memoizedState,e===null)return zl(t),null;if(u=(t.flags&128)!==0,n=e.rendering,n===null)if(u)Pe(e,!1);else{if(El!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(n=ln(l),n!==null){for(t.flags|=128,Pe(e,!1),l=n.updateQueue,t.updateQueue=l,hn(t,l),t.subtreeFlags=0,l=a,a=t.child;a!==null;)vs(a,l),a=a.sibling;return F(_l,_l.current&1|2),nl&&Ht(t,e.treeForkCount),t.child}l=l.sibling}e.tail!==null&&Fl()>bn&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304)}else{if(!u)if(l=ln(n),l!==null){if(t.flags|=128,u=!0,l=l.updateQueue,t.updateQueue=l,hn(t,l),Pe(e,!0),e.tail===null&&e.tailMode==="hidden"&&!n.alternate&&!nl)return zl(t),null}else 2*Fl()-e.renderingStartTime>bn&&a!==536870912&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304);e.isBackwards?(n.sibling=t.child,t.child=n):(l=e.last,l!==null?l.sibling=n:t.child=n,e.last=n)}return e.tail!==null?(l=e.tail,e.rendering=l,e.tail=l.sibling,e.renderingStartTime=Fl(),l.sibling=null,a=_l.current,F(_l,u?a&1|2:a&1),nl&&Ht(t,e.treeForkCount),l):(zl(t),null);case 22:case 23:return et(t),Lc(),e=t.memoizedState!==null,l!==null?l.memoizedState!==null!==e&&(t.flags|=8192):e&&(t.flags|=8192),e?(a&536870912)!==0&&(t.flags&128)===0&&(zl(t),t.subtreeFlags&6&&(t.flags|=8192)):zl(t),a=t.updateQueue,a!==null&&hn(t,a.retryQueue),a=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(t.flags|=2048),l!==null&&sl(Ua),null;case 24:return a=null,l!==null&&(a=l.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Bt(Dl),zl(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function c0(l,t){switch(Oc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return Bt(Dl),Ga(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return Eu(t),null;case 31:if(t.memoizedState!==null){if(et(t),t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(et(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return sl(_l),null;case 4:return Ga(),null;case 10:return Bt(t.type),null;case 22:case 23:return et(t),Lc(),l!==null&&sl(Ua),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return Bt(Dl),null;case 25:return null;default:return null}}function Lo(l,t){switch(Oc(t),t.tag){case 3:Bt(Dl),Ga();break;case 26:case 27:case 5:Eu(t);break;case 4:Ga();break;case 31:t.memoizedState!==null&&et(t);break;case 13:et(t);break;case 19:sl(_l);break;case 10:Bt(t.type);break;case 22:case 23:et(t),Lc(),l!==null&&sl(Ua);break;case 24:Bt(Dl)}}function lu(l,t){try{var a=t.updateQueue,e=a!==null?a.lastEffect:null;if(e!==null){var u=e.next;a=u;do{if((a.tag&l)===l){e=void 0;var n=a.create,c=a.inst;e=n(),c.destroy=e}a=a.next}while(a!==u)}}catch(i){ml(t,t.return,i)}}function fa(l,t,a){try{var e=t.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var n=u.next;e=n;do{if((e.tag&l)===l){var c=e.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,u=t;var f=a,y=i;try{y()}catch(A){ml(u,f,A)}}}e=e.next}while(e!==n)}}catch(A){ml(t,t.return,A)}}function Ko(l){var t=l.updateQueue;if(t!==null){var a=l.stateNode;try{Rs(t,a)}catch(e){ml(l,l.return,e)}}}function Jo(l,t,a){a.props=Ba(l.type,l.memoizedProps),a.state=l.memoizedState;try{a.componentWillUnmount()}catch(e){ml(l,t,e)}}function tu(l,t){try{var a=l.ref;if(a!==null){switch(l.tag){case 26:case 27:case 5:var e=l.stateNode;break;case 30:e=l.stateNode;break;default:e=l.stateNode}typeof a=="function"?l.refCleanup=a(e):a.current=e}}catch(u){ml(l,t,u)}}function Dt(l,t){var a=l.ref,e=l.refCleanup;if(a!==null)if(typeof e=="function")try{e()}catch(u){ml(l,t,u)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){ml(l,t,u)}else a.current=null}function wo(l){var t=l.type,a=l.memoizedProps,e=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&e.focus();break l;case"img":a.src?e.src=a.src:a.srcSet&&(e.srcset=a.srcSet)}}catch(u){ml(l,l.return,u)}}function Ti(l,t,a){try{var e=l.stateNode;D0(e,l.type,a,t),e[Ll]=t}catch(u){ml(l,l.return,u)}}function ko(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ya(l.type)||l.tag===4}function Ai(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||ko(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&ya(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ei(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(l,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(l),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ut));else if(e!==4&&(e===27&&ya(l.type)&&(a=l.stateNode,t=null),l=l.child,l!==null))for(Ei(l,t,a),l=l.sibling;l!==null;)Ei(l,t,a),l=l.sibling}function yn(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?a.insertBefore(l,t):a.appendChild(l);else if(e!==4&&(e===27&&ya(l.type)&&(a=l.stateNode),l=l.child,l!==null))for(yn(l,t,a),l=l.sibling;l!==null;)yn(l,t,a),l=l.sibling}function Wo(l){var t=l.stateNode,a=l.memoizedProps;try{for(var e=l.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Ql(t,e,a),t[Bl]=l,t[Ll]=a}catch(n){ml(l,l.return,n)}}var Zt=!1,jl=!1,_i=!1,$o=typeof WeakSet=="function"?WeakSet:Set,ql=null;function i0(l,t){if(l=l.containerInfo,Ji=qn,l=is(l),Sc(l)){if("selectionStart"in l)var a={start:l.selectionStart,end:l.selectionEnd};else l:{a=(a=l.ownerDocument)&&a.defaultView||window;var e=a.getSelection&&a.getSelection();if(e&&e.rangeCount!==0){a=e.anchorNode;var u=e.anchorOffset,n=e.focusNode;e=e.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break l}var c=0,i=-1,f=-1,y=0,A=0,x=l,S=null;t:for(;;){for(var b;x!==a||u!==0&&x.nodeType!==3||(i=c+u),x!==n||e!==0&&x.nodeType!==3||(f=c+e),x.nodeType===3&&(c+=x.nodeValue.length),(b=x.firstChild)!==null;)S=x,x=b;for(;;){if(x===l)break t;if(S===a&&++y===u&&(i=c),S===n&&++A===e&&(f=c),(b=x.nextSibling)!==null)break;x=S,S=x.parentNode}x=b}a=i===-1||f===-1?null:{start:i,end:f}}else a=null}a=a||{start:0,end:0}}else a=null;for(wi={focusedElem:l,selectionRange:a},qn=!1,ql=t;ql!==null;)if(t=ql,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,ql=l;else for(;ql!==null;){switch(t=ql,n=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(a=0;a title"))),Ql(n,e,a),n[Bl]=l,Hl(n),e=n;break l;case"link":var c=am("link","href",u).get(e+(a.href||""));if(c){for(var i=0;ivl&&(c=vl,vl=V,V=c);var m=ns(i,V),o=ns(i,vl);if(m&&o&&(b.rangeCount!==1||b.anchorNode!==m.node||b.anchorOffset!==m.offset||b.focusNode!==o.node||b.focusOffset!==o.offset)){var h=x.createRange();h.setStart(m.node,m.offset),b.removeAllRanges(),V>vl?(b.addRange(h),b.extend(o.node,o.offset)):(h.setEnd(o.node,o.offset),b.addRange(h))}}}}for(x=[],b=i;b=b.parentNode;)b.nodeType===1&&x.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;ia?32:a,g.T=null,a=Ui,Ui=null;var n=ma,c=wt;if(Cl=0,ge=ma=null,wt=0,(ol&6)!==0)throw Error(d(331));var i=ol;if(ol|=4,id(n.current),ud(n,n.current,c,a),ol=i,iu(0,!1),Il&&typeof Il.onPostCommitFiberRoot=="function")try{Il.onPostCommitFiberRoot(_e,n)}catch{}return!0}finally{C.p=u,g.T=e,_d(l,t)}}function xd(l,t,a){t=ot(a,t),t=di(l.stateNode,t,2),l=na(l,t,2),l!==null&&(xe(l,2),Ot(l))}function ml(l,t,a){if(l.tag===3)xd(l,l,a);else for(;t!==null;){if(t.tag===3){xd(t,l,a);break}else if(t.tag===1){var e=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof e.componentDidCatch=="function"&&(da===null||!da.has(e))){l=ot(a,l),a=Do(2),e=na(t,a,2),e!==null&&(Oo(a,e,t,l),xe(e,2),Ot(e));break}}t=t.return}}function qi(l,t,a){var e=l.pingCache;if(e===null){e=l.pingCache=new o0;var u=new Set;e.set(t,u)}else u=e.get(t),u===void 0&&(u=new Set,e.set(t,u));u.has(a)||(Di=!0,u.add(a),l=y0.bind(null,l,t,a),t.then(l,l))}function y0(l,t,a){var e=l.pingCache;e!==null&&e.delete(t),l.pingedLanes|=l.suspendedLanes&a,l.warmLanes&=~a,gl===l&&(al&a)===a&&(El===4||El===3&&(al&62914560)===al&&300>Fl()-Sn?(ol&2)===0&&Se(l,0):Oi|=a,ve===al&&(ve=0)),Ot(l)}function Dd(l,t){t===0&&(t=pf()),l=xa(l,t),l!==null&&(xe(l,t),Ot(l))}function v0(l){var t=l.memoizedState,a=0;t!==null&&(a=t.retryLane),Dd(l,a)}function g0(l,t){var a=0;switch(l.tag){case 31:case 13:var e=l.stateNode,u=l.memoizedState;u!==null&&(a=u.retryLane);break;case 19:e=l.stateNode;break;case 22:e=l.stateNode._retryCache;break;default:throw Error(d(314))}e!==null&&e.delete(t),Dd(l,a)}function S0(l,t){return Wn(l,t)}var _n=null,ze=null,Bi=!1,Mn=!1,Yi=!1,ha=0;function Ot(l){l!==ze&&l.next===null&&(ze===null?_n=ze=l:ze=ze.next=l),Mn=!0,Bi||(Bi=!0,z0())}function iu(l,t){if(!Yi&&Mn){Yi=!0;do for(var a=!1,e=_n;e!==null;){if(l!==0){var u=e.pendingLanes;if(u===0)var n=0;else{var c=e.suspendedLanes,i=e.pingedLanes;n=(1<<31-Pl(42|l)+1)-1,n&=u&~(c&~i),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Ud(e,n))}else n=al,n=Ou(e,e===gl?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),(n&3)===0||Me(e,n)||(a=!0,Ud(e,n));e=e.next}while(a);Yi=!1}}function b0(){Od()}function Od(){Mn=Bi=!1;var l=0;ha!==0&&N0()&&(l=ha);for(var t=Fl(),a=null,e=_n;e!==null;){var u=e.next,n=Nd(e,t);n===0?(e.next=null,a===null?_n=u:a.next=u,u===null&&(ze=a)):(a=e,(l!==0||(n&3)!==0)&&(Mn=!0)),e=u}Cl!==0&&Cl!==5||iu(l),ha!==0&&(ha=0)}function Nd(l,t){for(var a=l.suspendedLanes,e=l.pingedLanes,u=l.expirationTimes,n=l.pendingLanes&-62914561;0i)break;var A=f.transferSize,x=f.initiatorType;A&&Gd(x)&&(f=f.responseEnd,c+=A*(f"u"?null:document;function Id(l,t,a){var e=pe;if(e&&typeof t=="string"&&t){var u=ft(t);u='link[rel="'+l+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Fd.has(u)||(Fd.add(u),l={rel:l,crossOrigin:a,href:t},e.querySelector(u)===null&&(t=e.createElement("link"),Ql(t,"link",l),Hl(t),e.head.appendChild(t)))}}function X0(l){kt.D(l),Id("dns-prefetch",l,null)}function G0(l,t){kt.C(l,t),Id("preconnect",l,t)}function Q0(l,t,a){kt.L(l,t,a);var e=pe;if(e&&l&&t){var u='link[rel="preload"][as="'+ft(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+ft(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+ft(a.imageSizes)+'"]')):u+='[href="'+ft(l)+'"]';var n=u;switch(t){case"style":n=Te(l);break;case"script":n=Ae(l)}vt.has(n)||(l=T({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:l,as:t},a),vt.set(n,l),e.querySelector(u)!==null||t==="style"&&e.querySelector(du(n))||t==="script"&&e.querySelector(mu(n))||(t=e.createElement("link"),Ql(t,"link",l),Hl(t),e.head.appendChild(t)))}}function Z0(l,t){kt.m(l,t);var a=pe;if(a&&l){var e=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+ft(e)+'"][href="'+ft(l)+'"]',n=u;switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ae(l)}if(!vt.has(n)&&(l=T({rel:"modulepreload",href:l},t),vt.set(n,l),a.querySelector(u)===null)){switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mu(n)))return}e=a.createElement("link"),Ql(e,"link",l),Hl(e),a.head.appendChild(e)}}}function V0(l,t,a){kt.S(l,t,a);var e=pe;if(e&&l){var u=La(e).hoistableStyles,n=Te(l);t=t||"default";var c=u.get(n);if(!c){var i={loading:0,preload:null};if(c=e.querySelector(du(n)))i.loading=5;else{l=T({rel:"stylesheet",href:l,"data-precedence":t},a),(a=vt.get(n))&&lf(l,a);var f=c=e.createElement("link");Hl(f),Ql(f,"link",l),f._p=new Promise(function(y,A){f.onload=y,f.onerror=A}),f.addEventListener("load",function(){i.loading|=1}),f.addEventListener("error",function(){i.loading|=2}),i.loading|=4,jn(c,t,e)}c={type:"stylesheet",instance:c,count:1,state:i},u.set(n,c)}}}function L0(l,t){kt.X(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ae(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=T({src:l,async:!0},t),(t=vt.get(u))&&tf(l,t),n=a.createElement("script"),Hl(n),Ql(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function K0(l,t){kt.M(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ae(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=T({src:l,async:!0,type:"module"},t),(t=vt.get(u))&&tf(l,t),n=a.createElement("script"),Hl(n),Ql(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function Pd(l,t,a,e){var u=(u=Wt.current)?Nn(u):null;if(!u)throw Error(d(446));switch(l){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Te(a.href),a=La(u).hoistableStyles,e=a.get(t),e||(e={type:"style",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){l=Te(a.href);var n=La(u).hoistableStyles,c=n.get(l);if(c||(u=u.ownerDocument||u,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(l,c),(n=u.querySelector(du(l)))&&!n._p&&(c.instance=n,c.state.loading=5),vt.has(l)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vt.set(l,a),n||J0(u,l,a,c.state))),t&&e===null)throw Error(d(528,""));return c}if(t&&e!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ae(a),a=La(u).hoistableScripts,e=a.get(t),e||(e={type:"script",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,l))}}function Te(l){return'href="'+ft(l)+'"'}function du(l){return'link[rel="stylesheet"]['+l+"]"}function lm(l){return T({},l,{"data-precedence":l.precedence,precedence:null})}function J0(l,t,a,e){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?e.loading=1:(t=l.createElement("link"),e.preload=t,t.addEventListener("load",function(){return e.loading|=1}),t.addEventListener("error",function(){return e.loading|=2}),Ql(t,"link",a),Hl(t),l.head.appendChild(t))}function Ae(l){return'[src="'+ft(l)+'"]'}function mu(l){return"script[async]"+l}function tm(l,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var e=l.querySelector('style[data-href~="'+ft(a.href)+'"]');if(e)return t.instance=e,Hl(e),e;var u=T({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return e=(l.ownerDocument||l).createElement("style"),Hl(e),Ql(e,"style",u),jn(e,a.precedence,l),t.instance=e;case"stylesheet":u=Te(a.href);var n=l.querySelector(du(u));if(n)return t.state.loading|=4,t.instance=n,Hl(n),n;e=lm(a),(u=vt.get(u))&&lf(e,u),n=(l.ownerDocument||l).createElement("link"),Hl(n);var c=n;return c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Ql(n,"link",e),t.state.loading|=4,jn(n,a.precedence,l),t.instance=n;case"script":return n=Ae(a.src),(u=l.querySelector(mu(n)))?(t.instance=u,Hl(u),u):(e=a,(u=vt.get(n))&&(e=T({},a),tf(e,u)),l=l.ownerDocument||l,u=l.createElement("script"),Hl(u),Ql(u,"link",e),l.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(e=t.instance,t.state.loading|=4,jn(e,a.precedence,l));return t.instance}function jn(l,t,a){for(var e=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=e.length?e[e.length-1]:null,n=u,c=0;c title"):null)}function w0(l,t,a){if(a===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return l=t.disabled,typeof t.precedence=="string"&&l==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function um(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function k0(l,t,a,e){if(a.type==="stylesheet"&&(typeof e.media!="string"||matchMedia(e.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Te(e.href),n=t.querySelector(du(u));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Cn.bind(l),t.then(l,l)),a.state.loading|=4,a.instance=n,Hl(n);return}n=t.ownerDocument||t,e=lm(e),(u=vt.get(u))&&lf(e,u),n=n.createElement("link"),Hl(n);var c=n;c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Ql(n,"link",e),a.instance=n}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(l.count++,a=Cn.bind(l),t.addEventListener("load",a),t.addEventListener("error",a))}}var af=0;function W0(l,t){return l.stylesheets&&l.count===0&&Hn(l,l.stylesheets),0af?50:800)+t);return l.unsuspend=a,function(){l.unsuspend=null,clearTimeout(e),clearTimeout(u)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hn(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Rn=null;function Hn(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Rn=new Map,t.forEach($0,l),Rn=null,Cn.call(l))}function $0(l,t){if(!(t.state.loading&4)){var a=Rn.get(l);if(a)var e=a.get(null);else{a=new Map,Rn.set(l,a);for(var u=l.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(p){console.error(p)}}return s(),df.exports=dh(),df.exports}var rh=mh();const Om=z.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),hh=({children:s})=>{const[p,E]=z.useState([]),d=z.useRef(1e4),D=z.useCallback((N,v,M)=>{E(Y=>Y.find(U=>U.id===N)?Y.map(U=>U.id===N?{...U,zIndex:++d.current}:U):[...Y,{id:N,title:v,charName:M,zIndex:++d.current}])},[]),j=z.useCallback(N=>{E(v=>v.filter(M=>M.id!==N))},[]),O=z.useCallback(N=>{E(v=>v.map(M=>M.id===N?{...M,zIndex:++d.current}:M))},[]);return r.jsx(Om.Provider,{value:{windows:p,openWindow:D,closeWindow:j,bringToFront:O},children:s})},zu=()=>z.useContext(Om),gt={west:-102.1,east:102.1,north:102.1,south:-102.1};function pu(s,p,E,d){const D=(s-gt.west)/(gt.east-gt.west)*E,j=(gt.north-p)/(gt.north-gt.south)*d;return{x:D,y:j}}function yh(s,p,E,d,D,j,O){const N=(s-d)/E,v=(p-D)/E,M=gt.west+N/j*(gt.east-gt.west),Y=gt.north-v/O*(gt.north-gt.south);return{ew:M,ns:Y}}function hf(s,p){const E=s>=0?"N":"S",d=p>=0?"E":"W";return`${Math.abs(s).toFixed(1)}${E}, ${Math.abs(p).toFixed(1)}${d}`}const Nm=bu.memo(({players:s,imgW:p,imgH:E,getColor:d,onHover:D,onSelect:j,selectedPlayer:O})=>{const{openWindow:N}=zu(),[v,M]=z.useState(null);z.useEffect(()=>{const T=()=>M(null);return v&&window.addEventListener("click",T),()=>window.removeEventListener("click",T)},[v]);const Y=z.useMemo(()=>s.filter(T=>T.ew!==void 0&&T.ns!==void 0).map(T=>({...T,pos:pu(T.ew,T.ns,p,E),color:d(T.character_name)})),[s,p,E,d]);return r.jsxs("div",{className:"ml-dots-layer",children:[Y.map(T=>r.jsx("div",{className:`ml-dot ${O===T.character_name?"ml-dot-selected":""}`,style:{left:T.pos.x,top:T.pos.y,backgroundColor:T.color},onMouseEnter:U=>{var I;const q=(I=U.currentTarget.closest(".ml-map-container"))==null?void 0:I.getBoundingClientRect();q&&D(T,U.clientX-q.left,U.clientY-q.top)},onMouseLeave:()=>D(null,0,0),onClick:()=>j(T.character_name),onDoubleClick:()=>N(`chat-${T.character_name}`,`Chat: ${T.character_name}`,T.character_name),onContextMenu:U=>{var Sl;U.preventDefault();const q=T.character_name,I=(Sl=U.currentTarget.closest(".ml-map-container"))==null?void 0:Sl.getBoundingClientRect(),ul=I?U.clientX-I.left:U.clientX,rl=I?U.clientY-I.top:U.clientY;M({name:q,x:ul,y:rl})}},T.character_name)),v&&r.jsx("div",{style:{position:"fixed",left:v.x+410,top:v.y,background:"#1a1a1a",border:"1px solid #444",borderRadius:4,zIndex:9999,padding:"2px 0",fontSize:"0.75rem",boxShadow:"0 4px 12px rgba(0,0,0,0.5)",minWidth:120},children:[{label:"Chat",id:"chat"},{label:"Stats",id:"stats"},{label:"Inventory",id:"inv"},{label:"Character",id:"char"},{label:"Combat",id:"combat"},{label:"Radar",id:"radar"}].map(T=>r.jsx("div",{onClick:()=>{N(`${T.id}-${v.name}`,`${T.label}: ${v.name}`,v.name),M(null)},style:{padding:"4px 12px",cursor:"pointer",color:"#ccc"},onMouseEnter:U=>U.currentTarget.style.background="#333",onMouseLeave:U=>U.currentTarget.style.background="",children:T.label},T.id))})]})});Nm.displayName="PlayerDots";const Vn="/api";async function At(s){const p=await fetch(`${Vn}${s}`,{credentials:"include"});if(!p.ok)throw new Error(`API ${s}: ${p.status}`);return p.json()}async function yf(s,p){var d;const E=await fetch(`${Vn}${s}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(p??{})});if(!E.ok){let D="";try{D=((d=await E.json())==null?void 0:d.detail)??""}catch{}throw new Error(`API ${s}: ${E.status}${D?` (${D})`:""}`)}return E.json()}async function vh(s,p){var d;const E=await fetch(`${Vn}${s}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(p??{})});if(!E.ok){let D="";try{D=((d=await E.json())==null?void 0:d.detail)??""}catch{}throw new Error(`API ${s}: ${E.status}${D?` (${D})`:""}`)}return E.json()}async function gh(s){var E;const p=await fetch(`${Vn}${s}`,{method:"DELETE",credentials:"include"});if(!p.ok){let d="";try{d=((E=await p.json())==null?void 0:E.detail)??""}catch{}throw new Error(`API ${s}: ${p.status}${d?` (${d})`:""}`)}return p.json()}function Sh(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const jm=bu.memo(({imgW:s,imgH:p,getColor:E})=>{const[d,D]=z.useState([]);z.useEffect(()=>{const O=async()=>{try{const v=await At("/trails/?seconds=600");D(v.trails??[])}catch{}};O();const N=setInterval(O,2e3);return()=>clearInterval(N)},[]);const j=z.useMemo(()=>{const O={};for(const N of d){const{x:v,y:M}=pu(N.ew,N.ns,s,p);O[N.character_name]||(O[N.character_name]=[]),O[N.character_name].push(`${v},${M}`)}return Object.entries(O).filter(([,N])=>N.length>=2).map(([N,v])=>({name:N,points:v.join(" ")}))},[d,s,p]);return r.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${s} ${p}`,preserveAspectRatio:"none",children:j.map(O=>r.jsx("polyline",{points:O.points,stroke:E(O.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},O.name))})});jm.displayName="TrailsSVG";const bh=({imgW:s,imgH:p,enabled:E})=>{const d=z.useRef(null),[D,j]=z.useState([]);return z.useEffect(()=>{if(!E)return;(async()=>{try{const N=await At("/spawns/heatmap?hours=24&limit=50000");j(N.spawn_points??[])}catch{}})()},[E]),z.useEffect(()=>{const O=d.current;if(!O||!E||D.length===0||s===0)return;O.width=s,O.height=p;const N=O.getContext("2d");if(N){N.clearRect(0,0,s,p);for(const v of D){const{x:M,y:Y}=pu(v.ew,v.ns,s,p),T=Math.max(5,Math.min(12,5+Math.sqrt(v.intensity*.5))),U=N.createRadialGradient(M,Y,0,M,Y,T);U.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,v.intensity/40)})`),U.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,v.intensity/120)})`),U.addColorStop(1,"rgba(255, 150, 0, 0)"),N.fillStyle=U,N.fillRect(M-T,Y-T,T*2,T*2)}}},[D,s,p,E]),E?r.jsx("canvas",{ref:d,className:"ml-heatmap-canvas"}):null},zh=({imgW:s,imgH:p,enabled:E})=>{const[d,D]=z.useState([]);z.useEffect(()=>{if(!E)return;const O=async()=>{try{const v=await At("/portals");D(v.portals??[])}catch{}};O();const N=setInterval(O,6e4);return()=>clearInterval(N)},[E]);const j=z.useMemo(()=>d.map(O=>({...O,pos:pu(O.coordinates.ew,O.coordinates.ns,s,p)})),[d,s,p]);return!E||j.length===0?null:r.jsx("div",{className:"ml-portals-layer",children:j.map((O,N)=>r.jsx("div",{className:"ml-portal-icon",style:{left:O.pos.x,top:O.pos.y},title:`${O.portal_name} (by ${O.discovered_by})`},N))})},Em=20,_m=.3,ph=({players:s,getColor:p,onSelectPlayer:E,showHeatmap:d,showPortals:D,selectedPlayer:j})=>{var Zl;const O=z.useRef(null),N=z.useRef(null),[v,M]=z.useState({w:0,h:0}),[Y,T]=z.useState(null),U=z.useRef(null),q=z.useRef({scale:1,offX:0,offY:0}),I=z.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),ul=z.useCallback(()=>{if(N.current){const{scale:$,offX:P,offY:Q}=q.current;N.current.style.transform=`translate(${P}px, ${Q}px) scale(${$})`}},[]),rl=z.useCallback($=>{const P=$.currentTarget;if(M({w:P.naturalWidth,h:P.naturalHeight}),O.current){const Q=O.current.clientWidth,L=O.current.clientHeight,k=Math.min(Q/P.naturalWidth,L/P.naturalHeight);q.current={scale:k,offX:(Q-P.naturalWidth*k)/2,offY:(L-P.naturalHeight*k)/2},ul()}},[ul]),Sl=z.useCallback($=>{var Et;$.preventDefault();const P=(Et=O.current)==null?void 0:Et.getBoundingClientRect();if(!P)return;const Q=q.current,L=$.deltaY<0?1.1:.9,k=Math.min(Em,Math.max(_m,Q.scale*L)),Ul=k/Q.scale,Tl=$.clientX-P.left,Nt=$.clientY-P.top;q.current={scale:k,offX:Tl-(Tl-Q.offX)*Ul,offY:Nt-(Nt-Q.offY)*Ul},ul()},[ul]),K=z.useCallback($=>{if($.button!==0)return;const P=q.current;I.current={dragging:!0,sx:$.clientX,sy:$.clientY,startOffX:P.offX,startOffY:P.offY}},[]);z.useEffect(()=>{const $=Q=>{const L=I.current;if(L.dragging&&(q.current.offX=L.startOffX+(Q.clientX-L.sx),q.current.offY=L.startOffY+(Q.clientY-L.sy),ul()),O.current&&v.w>0&&U.current){const k=O.current.getBoundingClientRect(),Ul=q.current,Tl=yh(Q.clientX-k.left,Q.clientY-k.top,Ul.scale,Ul.offX,Ul.offY,v.w,v.h);U.current.textContent=hf(Tl.ns,Tl.ew)}},P=()=>{I.current.dragging=!1};return window.addEventListener("mousemove",$),window.addEventListener("mouseup",P),()=>{window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",P)}},[ul,v.w,v.h]);const J=z.useRef(null);z.useEffect(()=>{if(!j||v.w===0||!O.current||J.current===j)return;const $=s.find(Ul=>Ul.character_name===j);if(!$)return;J.current=j;const{x:P,y:Q}=pu($.ew,$.ns,v.w,v.h),L=O.current.getBoundingClientRect(),k=3;q.current={scale:Math.min(Em,Math.max(_m,k)),offX:L.width/2-P*k,offY:L.height/2-Q*k},ul()},[j,s,v.w,v.h,ul]),z.useEffect(()=>{j||(J.current=null)},[j]);const xl=z.useCallback(($,P,Q)=>{T($?{x:P,y:Q,player:$}:null)},[]);return r.jsxs("div",{className:"ml-map-container",ref:O,onWheel:Sl,onMouseDown:K,children:[r.jsxs("div",{ref:N,className:"ml-map-group",children:[r.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:rl,draggable:!1}),v.w>0&&r.jsxs(r.Fragment,{children:[r.jsx(bh,{imgW:v.w,imgH:v.h,enabled:d}),r.jsx(jm,{imgW:v.w,imgH:v.h,getColor:p}),r.jsx(Nm,{players:s,imgW:v.w,imgH:v.h,getColor:p,onHover:xl,onSelect:E,selectedPlayer:j}),r.jsx(zh,{imgW:v.w,imgH:v.h,enabled:D})]})]}),Y&&r.jsxs("div",{className:"ml-tooltip",style:{left:Y.x+12,top:Y.y-10},children:[r.jsx("strong",{children:Y.player.character_name}),r.jsx("br",{}),hf(Y.player.ns,Y.player.ew),r.jsx("br",{}),Y.player.kills_per_hour," kph Β· ",(Zl=Y.player.kills)==null?void 0:Zl.toLocaleString()," kills"]}),r.jsx("div",{className:"ml-coords",ref:U})]})},Um=bu.memo(({player:s,vitals:p,color:E,onSelect:d,isSelected:D})=>{var Y,T;const{openWindow:j}=zu(),O=(s.vt_state||"idle").toLowerCase(),N=O==="combat"||O==="hunt",v=(s.total_rares??0)>0?Math.round((s.total_kills??0)/(s.total_rares??1)).toLocaleString():null,M=s.character_name;return r.jsxs("li",{className:`ml-player-row ${D?"ml-player-selected":""}`,style:{borderLeftColor:E},children:[r.jsxs("div",{className:"ml-pr-header",onClick:d,children:[r.jsx("span",{className:"ml-pr-name",children:M}),r.jsx("span",{className:"ml-pr-coords",children:hf(s.ns,s.ew)})]}),r.jsxs("div",{className:"ml-pr-vitals",children:[r.jsx("div",{className:"ml-vital-bar hp",children:r.jsx("div",{className:"ml-vital-fill",style:{width:`${(p==null?void 0:p.health_percentage)??0}%`}})}),r.jsx("div",{className:"ml-vital-bar sta",children:r.jsx("div",{className:"ml-vital-fill",style:{width:`${(p==null?void 0:p.stamina_percentage)??0}%`}})}),r.jsx("div",{className:"ml-vital-bar mana",children:r.jsx("div",{className:"ml-vital-fill",style:{width:`${(p==null?void 0:p.mana_percentage)??0}%`}})})]}),r.jsxs("div",{className:"ml-pr-grid",children:[r.jsxs("span",{className:"ml-gs",title:"Session kills",children:["βš”οΈ ",((Y=s.kills)==null?void 0:Y.toLocaleString())??0]}),r.jsxs("span",{className:"ml-gs",title:"Total kills",children:["πŸ† ",(s.total_kills??0).toLocaleString()]}),r.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[s.kills_per_hour??"0"," ",r.jsx("span",{className:"ml-suffix",children:"KPH"})]}),r.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["πŸ’Ž ",s.session_rares??0," / ",s.total_rares??0]}),r.jsx("span",{className:"ml-gs",title:"Kills per rare",children:v?r.jsxs(r.Fragment,{children:["πŸ“Š ",v," ",r.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),r.jsx("span",{className:`ml-meta-pill ${N?"active":O!=="idle"&&O!=="default"&&O!==""?"other":""}`,children:s.vt_state||"idle"}),r.jsxs("span",{className:"ml-gs",title:"Online time",children:["πŸ• ",((T=s.onlinetime)==null?void 0:T.replace(/^00\./,""))??"--"]}),r.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",s.deaths??"0"]}),r.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[r.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),s.prismatic_taper_count??"0"]})]}),r.jsxs("div",{className:"ml-pr-buttons",children:[r.jsx("button",{className:"ml-btn accent",onClick:()=>j(`chat-${M}`,`Chat: ${M}`,M),children:"Chat"}),r.jsx("button",{className:"ml-btn accent",onClick:()=>j(`stats-${M}`,`Stats: ${M}`,M),children:"Stats"}),r.jsx("button",{className:"ml-btn accent",onClick:()=>j(`inv-${M}`,`Inventory: ${M}`,M),children:"Inv"}),r.jsx("button",{className:"ml-btn",onClick:()=>j(`char-${M}`,`Character: ${M}`,M),children:"Char"}),r.jsx("button",{className:"ml-btn",onClick:()=>j(`combat-${M}`,`Combat: ${M}`,M),children:"Combat"}),r.jsx("button",{className:"ml-btn",onClick:()=>j(`radar-${M}`,`Radar: ${M}`,M),children:"Radar"})]})]})});Um.displayName="PlayerRow";const Th=({players:s,vitals:p,getColor:E,onSelect:d,selectedPlayer:D})=>{const j=z.useRef(null),[O,N]=z.useState(!1),v=z.useCallback(()=>{j.current&&N(j.current.scrollTop>200)},[]);return r.jsxs("div",{style:{position:"relative",flex:1,minHeight:0},children:[r.jsx("ul",{className:"ml-player-list",ref:j,onScroll:v,children:s.map(M=>r.jsx(Um,{player:M,vitals:p.get(M.character_name)??null,color:E(M.character_name),onSelect:()=>d(M.character_name),isSelected:D===M.character_name},M.character_name))}),O&&r.jsx("button",{onClick:()=>{var M;(M=j.current)==null||M.scrollTo({top:0,behavior:"smooth"})},style:{position:"absolute",bottom:8,right:8,width:28,height:28,borderRadius:"50%",background:"rgba(68,136,255,0.2)",border:"1px solid rgba(68,136,255,0.4)",color:"#6af",cursor:"pointer",fontSize:"0.8rem",display:"flex",alignItems:"center",justifyContent:"center"},children:"β–²"})]})},Ah=[{key:"name",label:"Name"},{key:"kph",label:"KPH"},{key:"skills",label:"S.Kills"},{key:"srares",label:"S.Rares"},{key:"tkills",label:"T.Kills"},{key:"kpr",label:"KPR"}],Eh=({value:s,onChange:p})=>r.jsx("div",{className:"ml-sort-buttons",children:Ah.map(E=>r.jsx("button",{className:`ml-sort-btn ${s===E.key?"active":""}`,onClick:()=>p(E.key),children:E.label},E.key))}),_h=()=>At("/live"),Mh=()=>At("/combat-stats"),xh=()=>At("/server-health"),Dh=()=>At("/total-rares"),Oh=()=>At("/total-kills"),dy=(s,p)=>yf("/agent/ask",{message:s,session_id:p}),my=()=>yf("/agent/sessions/new",{}),ry=s=>At(`/agent/sessions/${encodeURIComponent(s)}/history`),Nh=()=>At("/me");async function jh(){await fetch("/api/logout",{credentials:"include",redirect:"manual"}),window.location.href="/login"}const hy=()=>At("/api-admin/users"),yy=(s,p,E)=>yf("/api-admin/users",{username:s,password:p,is_admin:E}),vy=(s,p)=>vh(`/api-admin/users/${s}`,p),gy=s=>gh(`/api-admin/users/${s}`);function Uh(){const[s,p]=z.useState(null),[E,d]=z.useState(!0);return z.useEffect(()=>{let D=!1;return Nh().then(j=>{D||p(j)}).catch(()=>{D||p(null)}).finally(()=>{D||d(!1)}),()=>{D=!0}},[]),{user:s,loading:E}}const Ch=()=>{const{openWindow:s}=zu(),{user:p}=Uh(),E=!!(p!=null&&p.is_admin),d=z.useCallback(async()=>{if(confirm("Log out?"))try{await jh()}catch{window.location.href="/login"}},[]);return r.jsxs("div",{className:"ml-tool-links",children:[r.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("agent","Overlord Assistant"),children:"πŸ€– Assistant"}),r.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("playerdash","Player Dashboard"),children:"πŸ‘₯ Dashboard"}),r.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("queststatus","Quest Status"),children:"πŸ“œ Quests"}),r.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("issues","Issues Board"),children:"πŸ“‹ Issues"}),r.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("vitalsharing","Vital Sharing"),children:"🀝 Vitals"}),r.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("combatpicker","Combat Stats"),children:"βš”οΈ Combat"}),E&&r.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>s("adminusers","Admin Β· Users"),children:"πŸ›‘οΈ Admin"}),r.jsxs("span",{className:"ml-tool-link ml-tool-link-logout",style:{cursor:"pointer"},onClick:d,title:p?`Logged in as ${p.username}`:"Log out",children:["πŸšͺ Log out",p?` (${p.username})`:""]})]})},Rh=({players:s,vitals:p,serverHealth:E,totalRares:d,totalKills:D,getColor:j,onSelectPlayer:O,showHeatmap:N,showPortals:v,onToggleHeatmap:M,onTogglePortals:Y,version:T,selectedPlayer:U})=>{var $,P;const[q,I]=z.useState("name"),[ul,rl]=z.useState(""),Sl=z.useMemo(()=>s.reduce((Q,L)=>Q+(parseInt(L.kills_per_hour)||0),0),[s]),K=(($=E==null?void 0:E.status)==null?void 0:$.toLowerCase())==="online"||((P=E==null?void 0:E.status)==null?void 0:P.toLowerCase())==="up",J=z.useDeferredValue(s),xl=z.useDeferredValue(p),Zl=z.useMemo(()=>{let Q=[...J];switch(ul&&(Q=Q.filter(L=>L.character_name.toLowerCase().startsWith(ul.toLowerCase()))),q){case"kph":Q.sort((L,k)=>(parseInt(k.kills_per_hour)||0)-(parseInt(L.kills_per_hour)||0));break;case"skills":Q.sort((L,k)=>(k.kills||0)-(L.kills||0));break;case"srares":Q.sort((L,k)=>(k.session_rares??0)-(L.session_rares??0));break;case"tkills":Q.sort((L,k)=>(k.total_kills??0)-(L.total_kills??0));break;case"kpr":Q.sort((L,k)=>{const Ul=(L.total_kills??0)/Math.max(1,L.total_rares??1),Tl=(k.total_kills??0)/Math.max(1,k.total_rares??1);return Ul-Tl});break;default:Q.sort((L,k)=>L.character_name.localeCompare(k.character_name))}return Q},[J,q,ul]);return r.jsxs("div",{className:"ml-sidebar",children:[T&&r.jsxs("div",{className:"ml-version",children:["v",T]}),r.jsx("div",{className:"ml-sidebar-header",children:r.jsxs("span",{className:"ml-sidebar-title",style:{cursor:"pointer"},onClick:()=>{const Q=document.createElement("div");Q.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000;z-index:999999;display:flex;align-items:center;justify-content:center;";const L=document.createElement("video");L.src="/rick.mp4",L.autoplay=!0,L.loop=!0,L.style.cssText="width:100vw;height:100vh;object-fit:cover;",Q.appendChild(L),document.body.appendChild(Q),document.body.style.animation="ml-shake 0.05s 30";const k=document.createElement("style");k.textContent="@keyframes ml-shake{0%,100%{transform:translate(0) rotate(0)}25%{transform:translate(-15px,10px) rotate(-2deg)}50%{transform:translate(15px,-10px) rotate(2deg)}75%{transform:translate(-10px,-15px) rotate(-1deg)}} @keyframes ml-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}",document.head.appendChild(k),setTimeout(()=>{Q.style.animation="ml-spin 3s linear infinite"},1500),L.play().catch(()=>{})},children:["Active Mosswart Enjoyers (",s.length,")"]})}),r.jsxs("div",{className:"ml-server-status",children:[r.jsx("span",{className:`ml-status-dot ${K?"online":"offline"}`}),r.jsxs("span",{className:"ml-status-text",children:["Coldeve ",K?"Online":"Offline"]}),(E==null?void 0:E.player_count)!=null&&r.jsxs("span",{className:"ml-status-detail",children:["πŸ‘₯ ",E.player_count]}),(E==null?void 0:E.latency_ms)!=null&&r.jsxs("span",{className:"ml-status-detail",children:[Math.round(E.latency_ms),"ms"]}),(E==null?void 0:E.uptime_seconds)!=null&&r.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(E.uptime_seconds/3600),"h"]})]}),r.jsxs("div",{className:"ml-counters",children:[r.jsxs("div",{className:"ml-counter rares",children:[r.jsx("span",{className:"ml-counter-val",children:d}),r.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),r.jsxs("div",{className:`ml-counter kph ${Sl>5e3?"ultra":""}`,children:[r.jsx("span",{className:"ml-counter-val",children:Sl.toLocaleString()}),r.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),r.jsxs("div",{className:"ml-counter kills",children:[r.jsx("span",{className:"ml-counter-val",children:D.toLocaleString()}),r.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),r.jsxs("div",{className:"ml-tool-links",children:[r.jsx("a",{href:"/inventory.html",target:"_blank",className:"ml-tool-link",children:"πŸ” Inv Search"}),r.jsx("a",{href:"/suitbuilder.html",target:"_blank",className:"ml-tool-link",children:"πŸ›‘οΈ Suitbuilder"}),r.jsx("a",{href:"/debug.html",target:"_blank",className:"ml-tool-link",children:"πŸ› Debug"})]}),r.jsx(Ch,{}),r.jsxs("div",{className:"ml-toggles",children:[r.jsxs("label",{className:"ml-toggle-label",children:[r.jsx("input",{type:"checkbox",checked:N,onChange:Q=>M(Q.target.checked)}),r.jsx("span",{children:"Spawn Heatmap"})]}),r.jsxs("label",{className:"ml-toggle-label",children:[r.jsx("input",{type:"checkbox",checked:v,onChange:Q=>Y(Q.target.checked)}),r.jsx("span",{children:"Portals"})]})]}),r.jsx("div",{style:{borderTop:"1px solid #333",marginTop:4,paddingTop:4}}),r.jsx(Eh,{value:q,onChange:I}),r.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:ul,onChange:Q=>rl(Q.target.value)}),r.jsx(Th,{players:Zl,vitals:xl,getColor:j,onSelect:O,selectedPlayer:U})]})},Hh="modulepreload",qh=function(s){return"/"+s},Mm={},St=function(p,E,d){let D=Promise.resolve();if(E&&E.length>0){let O=function(M){return Promise.all(M.map(Y=>Promise.resolve(Y).then(T=>({status:"fulfilled",value:T}),T=>({status:"rejected",reason:T}))))};document.getElementsByTagName("link");const N=document.querySelector("meta[property=csp-nonce]"),v=(N==null?void 0:N.nonce)||(N==null?void 0:N.getAttribute("nonce"));D=O(E.map(M=>{if(M=qh(M),M in Mm)return;Mm[M]=!0;const Y=M.endsWith(".css"),T=Y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${M}"]${T}`))return;const U=document.createElement("link");if(U.rel=Y?"stylesheet":Hh,Y||(U.as="script"),U.crossOrigin="",U.href=M,v&&U.setAttribute("nonce",v),document.head.appendChild(U),Y)return new Promise((q,I)=>{U.addEventListener("load",q),U.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${M}`)))})}))}function j(O){const N=new Event("vite:preloadError",{cancelable:!0});if(N.payload=O,window.dispatchEvent(N),!N.defaultPrevented)throw O}return D.then(O=>{for(const N of O||[])N.status==="rejected"&&j(N.reason);return p().catch(j)})},Bh=({id:s,title:p,zIndex:E,width:d=700,height:D=340,children:j})=>{const{closeWindow:O,bringToFront:N}=zu(),v=z.useRef(null),M=z.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),Y=z.useRef({resizing:!1,sx:0,sy:0,sw:0,sh:0}),T=z.useRef({x:420,y:10+Math.random()*40}),[U,q]=z.useState({w:d,h:D}),I=z.useCallback(rl=>{var K;rl.preventDefault(),N(s);const Sl=(K=v.current)==null?void 0:K.getBoundingClientRect();Sl&&(M.current={dragging:!0,sx:rl.clientX,sy:rl.clientY,ox:Sl.left,oy:Sl.top})},[s,N]),ul=z.useCallback(rl=>{rl.preventDefault(),rl.stopPropagation(),Y.current={resizing:!0,sx:rl.clientX,sy:rl.clientY,sw:U.w,sh:U.h}},[U.w,U.h]);return z.useEffect(()=>{const rl=K=>{const J=M.current;J.dragging&&v.current&&(T.current.x=J.ox+(K.clientX-J.sx),T.current.y=J.oy+(K.clientY-J.sy),v.current.style.left=`${T.current.x}px`,v.current.style.top=`${T.current.y}px`);const xl=Y.current;if(xl.resizing){const Zl=Math.max(300,xl.sw+(K.clientX-xl.sx)),$=Math.max(200,xl.sh+(K.clientY-xl.sy));q({w:Zl,h:$})}},Sl=()=>{M.current.dragging=!1,Y.current.resizing=!1};return window.addEventListener("mousemove",rl),window.addEventListener("mouseup",Sl),()=>{window.removeEventListener("mousemove",rl),window.removeEventListener("mouseup",Sl)}},[]),r.jsxs("div",{ref:v,className:"ml-window",style:{zIndex:E,width:U.w,height:U.h,left:T.current.x,top:T.current.y},onMouseDown:()=>N(s),children:[r.jsxs("div",{className:"ml-window-header",onMouseDown:I,children:[r.jsx("span",{className:"ml-window-title",children:p}),r.jsx("button",{className:"ml-window-close",onClick:()=>O(s),children:"Γ—"})]}),r.jsx("div",{className:"ml-window-content",children:j}),r.jsx("div",{className:"ml-window-resize",onMouseDown:ul})]})},Yh={0:"#00FF00",2:"#FFFFFF",3:"#FF0000",4:"#FFFFFF",5:"#33CCFF",6:"#CCFF99",7:"#00FFFF",14:"#FFD700",15:"#FF69B4",17:"#AAAAFF",18:"#88FF88",21:"#FF8888",22:"#FFAA66"},Cm=50,Rm=s=>`mo-chat-history-${s}`;function Xh(s){try{const p=localStorage.getItem(Rm(s));return p?JSON.parse(p):[]}catch{return[]}}function Gh(s,p){try{localStorage.setItem(Rm(s),JSON.stringify(p.slice(-Cm)))}catch{}}const Qh=({id:s,charName:p,zIndex:E,messages:d,socket:D})=>{const j=z.useRef(null),[O,N]=z.useState(""),[v,M]=z.useState(!1),Y=z.useRef(Xh(p)),T=z.useRef(-1),U=z.useRef(""),q=z.useRef(!1);z.useEffect(()=>{const K=j.current;K&&(q.current?M(!0):(K.scrollTop=K.scrollHeight,M(!1)))},[d.length]);const I=z.useCallback(()=>{const K=j.current;if(!K)return;const J=K.scrollHeight-K.scrollTop-K.clientHeight<30;q.current=!J,J&&M(!1)},[]),ul=z.useCallback(()=>{const K=j.current;K&&(K.scrollTop=K.scrollHeight,q.current=!1,M(!1))},[]),rl=z.useCallback(K=>{K.preventDefault();const J=O.trim();!J||!D||D.readyState!==WebSocket.OPEN||(D.send(JSON.stringify({player_name:p,command:J})),Y.current.push(J),Y.current.length>Cm&&Y.current.shift(),Gh(p,Y.current),T.current=-1,U.current="",N(""),q.current=!1)},[O,D,p]),Sl=z.useCallback(K=>{const J=Y.current;if(J.length!==0){if(K.key==="ArrowUp")K.preventDefault(),T.current===-1?(U.current=O,T.current=J.length-1):T.current>0&&T.current--,N(J[T.current]);else if(K.key==="ArrowDown"){if(K.preventDefault(),T.current===-1)return;T.currentr.jsx("div",{className:"ml-chat-line",style:{color:Yh[K.color??2]??"#ddd"},children:K.text},J))}),v&&r.jsx("div",{onClick:ul,style:{padding:"3px 0",textAlign:"center",fontSize:"0.65rem",color:"#6af",background:"#1a2a3a",cursor:"pointer",borderTop:"1px solid #334"},children:"β–Ό New messages below"}),r.jsx("form",{className:"ml-chat-form",onSubmit:rl,children:r.jsx("input",{className:"ml-chat-input",value:O,onChange:K=>N(K.target.value),onKeyDown:Sl,placeholder:"Enter chat..."})})]})},Zh=z.lazy(()=>St(()=>import("./StatsWindow-B6zfbHhl.js"),__vite__mapDeps([0,1])).then(s=>({default:s.StatsWindow}))),Vh=z.lazy(()=>St(()=>import("./CharacterWindow-DrrpU--7.js"),__vite__mapDeps([2,1])).then(s=>({default:s.CharacterWindow}))),Lh=z.lazy(()=>St(()=>import("./InventoryWindow-rVjaqxW-.js"),__vite__mapDeps([3,1])).then(s=>({default:s.InventoryWindow}))),Kh=z.lazy(()=>St(()=>import("./RadarWindow-B3i5zXC8.js"),__vite__mapDeps([4,1])).then(s=>({default:s.RadarWindow}))),Jh=z.lazy(()=>St(()=>import("./CombatStatsWindow-DLWkDKIY.js"),__vite__mapDeps([5,1])).then(s=>({default:s.CombatStatsWindow}))),wh=z.lazy(()=>St(()=>import("./CombatPickerWindow-2NQUGplv.js"),__vite__mapDeps([6,1])).then(s=>({default:s.CombatPickerWindow}))),kh=z.lazy(()=>St(()=>import("./IssuesWindow-C_A54UOW.js"),__vite__mapDeps([7,1])).then(s=>({default:s.IssuesWindow}))),Wh=z.lazy(()=>St(()=>import("./VitalSharingWindow-MVVa2yWs.js"),__vite__mapDeps([8,1])).then(s=>({default:s.VitalSharingWindow}))),$h=z.lazy(()=>St(()=>import("./QuestStatusWindow-DL34Ths2.js"),__vite__mapDeps([9,1])).then(s=>({default:s.QuestStatusWindow}))),Fh=z.lazy(()=>St(()=>import("./PlayerDashboardWindow-qdSQRhha.js"),__vite__mapDeps([10,1])).then(s=>({default:s.PlayerDashboardWindow}))),Ih=z.lazy(()=>St(()=>import("./AgentWindow-Bk40GB4J.js"),__vite__mapDeps([11,1])).then(s=>({default:s.AgentWindow}))),Ph=z.lazy(()=>St(()=>import("./AdminUsersWindow-C8y7Dpy1.js"),__vite__mapDeps([12,1])).then(s=>({default:s.AdminUsersWindow}))),Hm=bu.memo(({characters:s,chatMessages:p,nearbyObjects:E,inventoryVersions:d,equipmentCantrips:D,characterStats:j,socket:O})=>{const{windows:N}=zu();return r.jsx(z.Suspense,{fallback:null,children:N.map(v=>{var T;const M=v.charName??"";switch(v.id.split("-")[0]){case"chat":return r.jsx(Qh,{id:v.id,charName:M,zIndex:v.zIndex,messages:p.get(M)??[],socket:O},v.id);case"stats":return r.jsx(Zh,{id:v.id,charName:M,zIndex:v.zIndex},v.id);case"char":return r.jsx(Vh,{id:v.id,charName:M,zIndex:v.zIndex,vitals:((T=s.get(M))==null?void 0:T.vitals)??void 0,liveStats:j.get(M)},v.id);case"inv":return r.jsx(Lh,{id:v.id,charName:M,zIndex:v.zIndex,inventoryVersion:d.get(M)??0,equipmentCantrips:D.get(M)},v.id);case"radar":return r.jsx(Kh,{id:v.id,charName:M,zIndex:v.zIndex,socket:O,radarData:E.get(M)??null},v.id);case"combat":return r.jsx(Jh,{id:v.id,charName:M,zIndex:v.zIndex},v.id);case"combatpicker":return r.jsx(wh,{id:v.id,zIndex:v.zIndex,characters:s},v.id);case"issues":return r.jsx(kh,{id:v.id,zIndex:v.zIndex},v.id);case"vitalsharing":return r.jsx(Wh,{id:v.id,zIndex:v.zIndex},v.id);case"queststatus":return r.jsx($h,{id:v.id,zIndex:v.zIndex},v.id);case"playerdash":return r.jsx(Fh,{id:v.id,zIndex:v.zIndex,characters:s},v.id);case"agent":return r.jsx(Ih,{id:v.id,zIndex:v.zIndex},v.id);case"adminusers":return r.jsx(Ph,{id:v.id,zIndex:v.zIndex},v.id);default:return null}})})});Hm.displayName="WindowRenderer";let ly=0;const ty=({recentRares:s})=>{const[p,E]=z.useState([]),[d,D]=z.useState(0),[j,O]=z.useState([]);z.useEffect(()=>{if(s.length>d&&d>0){const v=s.slice(0,s.length-d);for(const M of v){const Y=++ly;E(T=>[...T,{key:Y,charName:M.character_name,rareName:M.name,exiting:!1}]),N();try{const T=new AudioContext,U=T.createOscillator(),q=T.createGain();U.connect(q),q.connect(T.destination),U.frequency.value=880,U.type="sine",q.gain.value=.3,U.start(),q.gain.exponentialRampToValueAtTime(.001,T.currentTime+.5),U.stop(T.currentTime+.5)}catch{}setTimeout(()=>{E(T=>T.map(U=>U.key===Y?{...U,exiting:!0}:U)),setTimeout(()=>{E(T=>T.filter(U=>U.key!==Y))},500)},6e3)}}D(s.length)},[s.length]);const N=z.useCallback(()=>{const v=Date.now(),M=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],Y=Array.from({length:30},(T,U)=>{const q=Math.PI*2*U/30+(Math.random()-.5)*.5,I=100+Math.random()*200;return{dx:Math.cos(q)*I,dy:Math.sin(q)*I-50,color:M[Math.floor(Math.random()*M.length)]}});O(T=>[...T,{id:v,particles:Y}]),setTimeout(()=>O(T=>T.filter(U=>U.id!==v)),2200)},[]);return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"ml-rare-notifications",children:p.map(v=>r.jsxs("div",{className:`ml-rare-notif ${v.exiting?"exiting":""}`,children:[r.jsx("div",{className:"ml-rare-notif-title",children:"πŸŽ† LEGENDARY RARE! πŸŽ†"}),r.jsx("div",{className:"ml-rare-notif-name",children:v.rareName}),r.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),r.jsx("div",{className:"ml-rare-notif-char",children:v.charName})]},v.key))}),r.jsx("div",{className:"ml-fireworks",children:j.map(v=>r.jsx(bu.Fragment,{children:v.particles.map((M,Y)=>r.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:M.color,"--dx":`${M.dx}px`,"--dy":`${M.dy+200}px`}},Y))},v.id))})]})};let ay=0;const ey=({deathAlerts:s})=>{const[p,E]=z.useState([]),d=z.useRef(0);return z.useEffect(()=>{if(s.length>d.current&&d.current>0){const D=s.slice(d.current);for(const j of D){const O=++ay;E(N=>[...N,{key:O,alert:j,exiting:!1}]);try{const N=new AudioContext,v=N.createOscillator(),M=N.createGain();v.connect(M),M.connect(N.destination),v.frequency.value=440,v.type="sawtooth",M.gain.value=.2,v.start(),M.gain.exponentialRampToValueAtTime(.001,N.currentTime+.8),v.stop(N.currentTime+.8)}catch{}setTimeout(()=>{E(N=>N.map(v=>v.key===O?{...v,exiting:!0}:v)),setTimeout(()=>E(N=>N.filter(v=>v.key!==O)),500)},8e3)}}d.current=s.length},[s.length]),p.length===0?null:r.jsx("div",{style:{position:"fixed",top:70,left:"50%",transform:"translateX(-50%)",zIndex:99999,display:"flex",flexDirection:"column",gap:6,pointerEvents:"none"},children:p.map(D=>r.jsxs("div",{style:{background:"linear-gradient(135deg, #2a0a0a, #1a0000)",border:"2px solid #cc4444",borderRadius:8,padding:"12px 24px",textAlign:"center",boxShadow:"0 0 30px rgba(204, 68, 68, 0.3)",animation:D.exiting?"ml-notif-out 0.5s ease-in forwards":"ml-notif-in 0.5s ease-out"},children:[r.jsx("div",{style:{fontSize:"1.2rem",fontWeight:800,color:"#ff4444"},children:"☠️ CHARACTER DIED ☠️"}),r.jsx("div",{style:{fontSize:"1rem",fontWeight:600,color:"#fff",marginTop:2},children:D.alert.character_name}),r.jsxs("div",{style:{fontSize:"0.8rem",color:"#c88",marginTop:2},children:["Vitae: ",D.alert.vitae,"%"]})]},D.key))})},xm=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf","#ff4444","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff","#ff8844","#88ff44","#4488ff","#ff4488","#cc3333","#33cc33","#3333cc","#cccc33","#cc33cc","#33cccc","#cc6633","#66cc33","#3366cc","#cc3366","#ff6666","#66ff66","#6666ff","#ffff66","#ff66ff","#66ffff","#ffaa66","#aaff66","#66aaff","#ff66aa","#990099","#009900","#000099","#990000","#009999","#999900","#aa5500","#55aa00","#0055aa","#aa0055","#ffaaaa","#aaffaa","#aaaaff","#ffffaa","#ffaaff","#aaffff","#ffccaa","#ccffaa","#aaccff","#ffaacc"];function uy(s){let p=0;for(let E=0;E{let D=s.current.get(d);return D||(D=p.current{const p=ny(),[E,d]=z.useState(!1),[D,j]=z.useState(!1),[O,N]=z.useState(null),v=z.useMemo(()=>Array.from(s.characters.values()).filter(q=>q.telemetry).map(q=>q.telemetry),[s.characters]),M=z.useMemo(()=>new Map(Array.from(s.characters.values()).filter(q=>q.vitals).map(q=>[q.name,q.vitals])),[s.characters]),[Y,T]=z.useState("");z.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(q=>q.json()).then(q=>T(q.version??"")).catch(()=>{})},[]);const U=z.useCallback(q=>{N(I=>I===q?null:q)},[]);return r.jsx(hh,{children:r.jsxs("div",{className:"ml-layout",children:[r.jsx(Rh,{players:v,vitals:M,serverHealth:s.serverHealth,totalRares:s.totalRares,totalKills:s.totalKills,getColor:p,onSelectPlayer:U,showHeatmap:E,showPortals:D,onToggleHeatmap:d,onTogglePortals:j,version:Y,selectedPlayer:O}),r.jsx(ph,{players:v,getColor:p,onSelectPlayer:U,showHeatmap:E,showPortals:D,selectedPlayer:O}),r.jsx(Hm,{characters:s.characters,chatMessages:s.chatMessages,nearbyObjects:s.nearbyObjects,inventoryVersions:s.inventoryVersions,equipmentCantrips:s.equipmentCantrips,characterStats:s.characterStats,socket:s.socketRef.current}),r.jsx(ty,{recentRares:s.recentRares}),r.jsx(ey,{deathAlerts:s.deathAlerts})]})})};function iy(s){const p=z.useRef(null),E=z.useRef(0),d=z.useRef(s);d.current=s;const D=z.useCallback(()=>{var O;if(((O=p.current)==null?void 0:O.readyState)===WebSocket.OPEN)return;const j=new WebSocket(Sh());p.current=j,j.addEventListener("message",N=>{try{const v=JSON.parse(N.data);d.current(v)}catch{}}),j.addEventListener("close",()=>{p.current=null,E.current=window.setTimeout(D,2e3)}),j.addEventListener("error",()=>{j.close()})},[]);return z.useEffect(()=>(D(),()=>{var j;clearTimeout(E.current),(j=p.current)==null||j.close(),p.current=null}),[D]),p}function fy(){const[s,p]=z.useState(new Map),[E,d]=z.useState(null),[D,j]=z.useState(0),[O,N]=z.useState(0),[v,M]=z.useState([]),Y=z.useRef(new Map),[T,U]=z.useState(0),[q,I]=z.useState(new Map),ul=z.useRef(new Map),[rl,Sl]=z.useState(0),K=z.useRef(new Map),[J,xl]=z.useState(0),[Zl,$]=z.useState([]),[P,Q]=z.useState(new Map),L=z.useRef(s);L.current=s;const k=z.useCallback((g,C)=>{p(G=>{const R=new Map(G),B=R.get(g)??{name:g,telemetry:null,vitals:null,combat:null,lastUpdate:0};return R.set(g,C(B)),R})},[]),Ul=z.useCallback(g=>{var C,G;if(g.type){if(g.type==="telemetry"){const R=g;k(R.character_name,B=>({...B,telemetry:R,lastUpdate:Date.now()}))}else if(g.type==="vitals"){const R=g,B=(C=L.current.get(R.character_name))==null?void 0:C.vitals;B&&(B.vitae??0)===0&&(R.vitae??0)>0&&$(fl=>[...fl,{character_name:R.character_name,vitae:R.vitae,timestamp:new Date().toISOString()}].slice(-50)),k(R.character_name,fl=>({...fl,vitals:R,lastUpdate:Date.now()}))}else if(g.type==="combat_stats"){const R=g;k(R.character_name,B=>({...B,combat:R,lastUpdate:Date.now()}))}else if(g.type==="rare"){const R=g;M(B=>[R,...B].slice(0,50))}else if(g.type==="inventory_delta"){const R=g;R.character_name&&I(B=>{const fl=new Map(B);return fl.set(R.character_name,(fl.get(R.character_name)??0)+1),fl})}else if(g.type==="character_stats"){const R=g;K.current.set(R.character_name,g),xl(B=>B+1)}else if(g.type==="equipment_cantrip_state"){const R=g;ul.current.set(R.character_name,R),Sl(B=>B+1)}else if(g.type==="dungeon_map"){const R=g;R.landblock&&(window.__dungeonMapCache||(window.__dungeonMapCache={}),window.__dungeonMapCache[R.landblock]=R)}else if(g.type==="nearby_objects"){const R=g;if(Q(B=>{const fl=new Map(B);return fl.set(R.character_name,R),fl}),R.is_dungeon&&R.landblock&&!((G=window.__dungeonMapCache)!=null&&G[R.landblock])){const B=Tl.current;(B==null?void 0:B.readyState)===WebSocket.OPEN&&B.send(JSON.stringify({type:"request_dungeon_map",landblock:R.landblock}))}}else if(g.type==="chat"){const R=g,B=Y.current.get(R.character_name)??[];B.push({text:R.text,color:R.color,timestamp:R.timestamp}),B.length>1e3&&B.splice(0,B.length-1e3),Y.current.set(R.character_name,B),U(fl=>fl+1)}}},[k]),Tl=iy(Ul);z.useEffect(()=>{const g=async()=>{try{const G=await _h();p(R=>{var fl;const B=new Map(R);for(const sl of G.players??[]){const F=B.get(sl.character_name);B.set(sl.character_name,{name:sl.character_name,telemetry:sl,vitals:(F==null?void 0:F.vitals)??null,combat:(F==null?void 0:F.combat)??null,lastUpdate:Date.now()})}for(const sl of B.keys())(fl=G.players)!=null&&fl.some(F=>F.character_name===sl)||B.delete(sl);return B})}catch{}};g();const C=setInterval(g,5e3);return()=>clearInterval(C)},[]),z.useEffect(()=>{const g=async()=>{try{const G=await Mh();for(const R of G.stats??[])k(R.character_name,B=>({...B,combat:{...R,type:"combat_stats"}}))}catch{}};g();const C=setInterval(g,3e4);return()=>clearInterval(C)},[k]),z.useEffect(()=>{const g=async()=>{try{d(await xh())}catch{}};g();const C=setInterval(g,3e4);return()=>clearInterval(C)},[]),z.useEffect(()=>{const g=async()=>{try{const[G,R]=await Promise.all([Dh(),Oh()]);j(G.all_time??0),N(R.total??0)}catch{}};g();const C=setInterval(g,3e5);return()=>clearInterval(C)},[]);const Nt=z.useMemo(()=>Y.current,[T]),Et=z.useMemo(()=>ul.current,[rl]),bt=z.useMemo(()=>K.current,[J]);return{characters:s,serverHealth:E,totalRares:D,totalKills:O,recentRares:v,chatMessages:Nt,nearbyObjects:P,inventoryVersions:q,equipmentCantrips:Et,characterStats:bt,deathAlerts:Zl,socketRef:Tl}}function sy(){const s=fy();return r.jsx(cy,{data:s})}rh.createRoot(document.getElementById("root")).render(r.jsx(z.StrictMode,{children:r.jsx(sy,{})}));"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(()=>{});export{Bh as D,At as a,ry as b,dy as c,my as d,Uh as e,yy as f,vy as g,gy as h,r as j,hy as l,z as r,zu as u}; diff --git a/static/assets/index-Hl9Lf_CI.css b/static/assets/index-C28HcMMD.css similarity index 94% rename from static/assets/index-Hl9Lf_CI.css rename to static/assets/index-C28HcMMD.css index 52536191..0cca8385 100644 --- a/static/assets/index-Hl9Lf_CI.css +++ b/static/assets/index-C28HcMMD.css @@ -1 +1 @@ -.ml-layout{display:flex;height:100vh;overflow:hidden;background:#111;color:#eee;font-family:Segoe UI,sans-serif}.ml-sidebar{width:400px;min-width:400px;background:#1a1a1a;border-right:2px solid #333;display:flex;flex-direction:column;overflow-y:auto;padding:12px 14px;scrollbar-width:none;-ms-overflow-style:none}.ml-sidebar::-webkit-scrollbar{display:none}.ml-sidebar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.ml-sidebar-title{font-size:.85rem;font-weight:600;color:#88f}.ml-view-toggle{font-size:.7rem;padding:3px 10px;background:#333;color:#aaa;border:1px solid #555;border-radius:3px;cursor:pointer}.ml-view-toggle:hover{background:#444;color:#fff}.ml-server-status{display:flex;align-items:center;gap:6px;padding:4px 0 8px;font-size:.75rem;color:#aaa}.ml-status-dot{width:8px;height:8px;border-radius:50%}.ml-status-dot.online{background:#4c4;animation:ml-pulse 2s ease-in-out infinite}.ml-status-dot.offline{background:#c44}.ml-status-detail{color:#888;font-size:.7rem}.ml-status-latency{margin-left:auto;color:#888}.ml-tool-links{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}.ml-tool-link{font-size:.68rem;color:#8ac;text-decoration:none;padding:2px 6px;background:#4488ff14;border:1px solid rgba(68,136,255,.15);border-radius:3px;transition:all .15s}.ml-tool-link:hover{background:#4488ff2e;color:#adf}@keyframes ml-pulse{0%,to{opacity:1}50%{opacity:.4}}.ml-counters{display:flex;gap:6px;margin-bottom:10px}.ml-counter{flex:1;text-align:center;padding:6px 4px;border-radius:4px;background:#222;border:1px solid #333}.ml-counter-val{display:block;font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums}.ml-counter-lbl{display:block;font-size:.6rem;color:#888;text-transform:uppercase;letter-spacing:.3px}.ml-counter.rares .ml-counter-val{color:#fc0}.ml-counter.kph .ml-counter-val{color:#4af}.ml-counter.kph{border-color:#234;animation:ml-kph-glow 3s ease-in-out infinite}.ml-counter.kph.ultra{background:linear-gradient(135deg,#112,#221);animation:ml-kph-glow 1.5s ease-in-out infinite}.ml-counter.kills .ml-counter-val{color:#f66}@keyframes ml-kph-glow{0%,to{box-shadow:0 0 4px #4af3}50%{box-shadow:0 0 12px #44aaff80}}.ml-sort-buttons{display:flex;gap:2px;margin:8px 0}.ml-sort-btn{flex:1;padding:4px 0;font-size:.65rem;font-weight:600;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer;text-transform:uppercase;letter-spacing:.3px}.ml-sort-btn:hover{background:#333;color:#ccc}.ml-sort-btn.active{background:#334;color:#88f;border-color:#88f}.ml-filter{width:100%;padding:5px 8px;font-size:.78rem;background:#222;color:#eee;border:1px solid #444;border-radius:3px;outline:none;margin-bottom:8px;box-sizing:border-box}.ml-filter:focus{border-color:#88f}.ml-filter::placeholder{color:#666}.ml-player-list{list-style:none;margin:0;padding:0;flex:1;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.ml-player-list::-webkit-scrollbar{display:none}.ml-player-row{padding:6px 8px;border-bottom:1px solid #2a2a2a;border-left:3px solid transparent;cursor:pointer;transition:background .1s}.ml-player-row:hover{background:#252525}.ml-player-row.ml-player-selected{background:#2a3344}.ml-pr-name{font-size:.82rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ml-pr-coords{font-size:.65rem;color:#888;margin-bottom:3px}.ml-pr-vitals{display:flex;gap:3px;margin-bottom:4px}.ml-vital-bar{flex:1;height:4px;border-radius:2px;overflow:hidden}.ml-vital-bar.hp{background:#300}.ml-vital-bar.sta{background:#331a00}.ml-vital-bar.mana{background:#001433}.ml-vital-bar.hp .ml-vital-fill{background:linear-gradient(90deg,#f44,#f66)}.ml-vital-bar.sta .ml-vital-fill{background:linear-gradient(90deg,#fa0,#fc4)}.ml-vital-bar.mana .ml-vital-fill{background:linear-gradient(90deg,#48f,#6af)}.ml-vital-fill{height:100%;border-radius:2px;transition:width .3s ease-out}.ml-pr-header{display:flex;justify-content:space-between;align-items:baseline;cursor:pointer}.ml-pr-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1px 8px;font-size:.68rem;color:#aaa;margin-bottom:4px}.ml-gs{font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-suffix{font-size:.58rem;color:#666;text-transform:uppercase;letter-spacing:.3px}.ml-taper-icon{width:14px;height:14px;margin-right:2px;vertical-align:text-bottom}.ml-meta-pill{font-size:.6rem;padding:0 6px;border-radius:3px;background:#333;color:#888;text-align:center;justify-self:end}.ml-pr-buttons{display:flex;gap:3px;margin-top:4px}.ml-btn{padding:2px 8px;font-size:.63rem;font-weight:500;border:1px solid #3a3a3a;border-radius:4px;background:#2a2a2a;color:#999;cursor:pointer;white-space:nowrap;transition:all .15s;letter-spacing:.2px}.ml-btn:hover{background:#383838;color:#ddd;border-color:#555}.ml-btn.accent{background:#4488ff1f;color:#6aadff;border-color:#4488ff4d}.ml-btn.accent:hover{background:#4488ff38;color:#8ec5ff;border-color:#4488ff80}.ml-meta-pill.active{background:#44cc4426;color:#4c4}.ml-meta-pill.other{background:#cc444426;color:#c44}.ml-map-container{flex:1;position:relative;overflow:hidden;background:#000;cursor:grab}.ml-map-container:active{cursor:grabbing}.ml-map-group{position:absolute;top:0;left:0;transform-origin:0 0}.ml-map-img{display:block;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ml-dots-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-dot{position:absolute;width:6px;height:6px;border-radius:50%;transform:translate(-50%,-50%);border:1px solid rgba(0,0,0,.5);pointer-events:all;cursor:pointer;z-index:5}.ml-dot:hover{width:10px;height:10px;z-index:10}.ml-dot.ml-dot-selected{width:10px;height:10px;z-index:10;animation:ml-blink .6s step-end infinite}@keyframes ml-blink{50%{opacity:0}}.ml-version{font-size:.65rem;color:#aaa;margin-bottom:2px}.ml-agent{display:flex;flex-direction:column;height:100%;font-size:.85rem}.ml-agent-toolbar{display:flex;align-items:center;gap:8px;padding:6px 8px;border-bottom:1px solid #333;background:#1a1a1a}.ml-agent-btn{background:#2a2a3a;color:#ddd;border:1px solid #444;border-radius:3px;padding:3px 8px;font-size:.75rem;cursor:pointer}.ml-agent-btn:hover:not(:disabled){background:#353550;border-color:#88f}.ml-agent-btn:disabled{opacity:.5;cursor:not-allowed}.ml-agent-session{font-family:monospace;font-size:.7rem;color:#888;margin-left:auto}.ml-agent-messages{flex:1;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:10px}.ml-agent-empty{color:#888;font-style:italic;text-align:center;padding:20px;line-height:1.5}.ml-agent-msg{display:flex;flex-direction:column;gap:2px;max-width:92%}.ml-agent-user{align-self:flex-end}.ml-agent-assistant,.ml-agent-error{align-self:flex-start}.ml-agent-role{font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#888}.ml-agent-user .ml-agent-role{color:#88f;text-align:right}.ml-agent-assistant .ml-agent-role{color:#6fd07a}.ml-agent-error .ml-agent-role{color:#d66}.ml-agent-text{padding:7px 10px;border-radius:6px;background:#232333;color:#e8e8e8;white-space:pre-wrap;word-break:break-word;line-height:1.4}.ml-agent-user .ml-agent-text{background:#2a3a55;color:#fff}.ml-agent-error .ml-agent-text{background:#3a1c1c;color:#faa}.ml-agent-thinking{color:#888;font-style:italic}.ml-agent-form{display:flex;gap:6px;padding:6px 8px;border-top:1px solid #333;background:#1a1a1a}.ml-agent-input{flex:1;resize:none;background:#111;color:#eee;border:1px solid #444;border-radius:3px;padding:5px 7px;font-family:inherit;font-size:.85rem;line-height:1.3}.ml-agent-input:focus{outline:1px solid #88f;border-color:#88f}.ml-agent-input:disabled{opacity:.6}.ml-agent-send{background:#2a3a55;color:#fff;border:1px solid #4466aa;border-radius:3px;padding:0 14px;font-size:.85rem;cursor:pointer}.ml-agent-send:hover:not(:disabled){background:#34507a}.ml-agent-send:disabled{opacity:.4;cursor:not-allowed}.ml-tooltip{position:absolute;background:#001e3ceb;color:#eee;padding:6px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:1000;white-space:nowrap;border:1px solid #335}.ml-coords{position:absolute;bottom:8px;left:8px;background:#003264d9;color:#eee;padding:4px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:100;font-variant-numeric:tabular-nums}.ml-toggles{display:flex;gap:12px;margin-bottom:8px;font-size:.72rem}.ml-toggle-label{display:flex;align-items:center;gap:4px;color:#aaa;cursor:pointer}.ml-toggle-label input{accent-color:#4488ff}.ml-trails-svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-heatmap-canvas{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;opacity:.8}.ml-portals-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-portal-icon{position:absolute;width:6px;height:6px;transform:translate(-50%,-50%);pointer-events:all;cursor:help}.ml-portal-icon:before{content:"πŸŒ€";font-size:10px;position:absolute;transform:translate(-50%,-50%)}.ml-window{position:fixed;background:#1a1a1a;border:1px solid #444;border-radius:6px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 8px 32px #00000080}.ml-window-header{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:linear-gradient(135deg,#2a3a5a,#1a2a40);cursor:move;-webkit-user-select:none;user-select:none;border-bottom:1px solid #334}.ml-window-title{font-size:.8rem;font-weight:600;color:#acf}.ml-window-close{background:none;border:none;color:#888;font-size:1.1rem;cursor:pointer;line-height:1;padding:0 4px}.ml-window-close:hover{color:#f66}.ml-window-content{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-window-resize{position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;opacity:.3;background:linear-gradient(135deg,transparent 50%,#888 50%,transparent 52%,#888 65%,transparent 67%,#888 80%)}.ml-window-resize:hover{opacity:.6}.ml-stats-controls{display:flex;gap:4px;padding:6px 10px;border-bottom:1px solid #333}.ml-stats-range-btn{padding:3px 10px;font-size:.7rem;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer}.ml-stats-range-btn.active{background:#4488ff26;color:#6aadff;border-color:#4488ff4d}.ml-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;flex:1}.ml-stats-panel{min-height:200px;background:#fff;border-radius:3px;overflow:hidden}.ml-stats-panel iframe{border:none}.ml-chat-messages{flex:1;overflow-y:auto;padding:6px 10px;font-size:.75rem;font-family:Consolas,Courier New,monospace;line-height:1.4}.ml-chat-line{word-break:break-word}.ml-chat-form{display:flex;border-top:1px solid #333;padding:4px}.ml-chat-input{flex:1;background:#222;color:#eee;border:1px solid #444;border-radius:3px;padding:4px 8px;font-size:.78rem;outline:none}.ml-chat-input:focus{border-color:#48f}.ml-chat-input::placeholder{color:#666}.ml-rare-notifications{position:fixed;top:20px;left:50%;transform:translate(-50%);z-index:99999;display:flex;flex-direction:column;gap:8px;pointer-events:none}.ml-rare-notif{background:linear-gradient(135deg,#1a0a2e,#2a1040);border:2px solid #ffcc00;border-radius:8px;padding:16px 32px;text-align:center;animation:ml-notif-in .5s ease-out;box-shadow:0 0 40px #ffcc004d}.ml-rare-notif.exiting{animation:ml-notif-out .5s ease-in forwards}.ml-rare-notif-title{font-size:1.4rem;font-weight:800;color:#fc0;text-shadow:0 0 20px rgba(255,204,0,.5);margin-bottom:4px}.ml-rare-notif-name{font-size:1.1rem;font-weight:600;color:#fff;margin-bottom:4px}.ml-rare-notif-by{font-size:.75rem;color:#888}.ml-rare-notif-char{font-size:1rem;font-weight:700;color:#fc0}@keyframes ml-notif-in{0%{transform:translateY(-40px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ml-notif-out{to{transform:translateY(-60px);opacity:0}}.ml-fireworks{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:99998}.ml-firework-particle{position:absolute;width:6px;height:6px;border-radius:50%;animation:ml-particle 2s cubic-bezier(.25,.46,.45,.94) forwards}@keyframes ml-particle{0%{transform:translate(0) scale(1);opacity:1}to{transform:translate(var(--dx),var(--dy)) scale(0);opacity:0}}.ml-tool-link-logout{margin-top:4px;color:#d88;border-top:1px dashed #444;padding-top:4px;font-size:.78rem}.ml-tool-link-logout:hover{color:#f88;background:#963c3c26}.ml-admin{display:flex;flex-direction:column;height:100%;padding:8px 10px;gap:10px;font-size:.85rem;overflow-y:auto}.ml-admin-section{background:#1a1a1a;border:1px solid #333;border-radius:4px;padding:8px 10px}.ml-admin-section h3{margin:0 0 6px;font-size:.9rem;color:#cfcfff;font-weight:600}.ml-admin-error{background:#3a1c1c;border:1px solid #803333;color:#faa;padding:6px 9px;border-radius:4px;font-family:monospace;font-size:.78rem;white-space:pre-wrap}.ml-admin-muted{color:#888;font-style:italic}.ml-admin-create{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.ml-admin-create input[type=text],.ml-admin-create input[type=password]{background:#111;color:#eee;border:1px solid #444;border-radius:3px;padding:4px 7px;font-size:.82rem;flex:1 1 140px;min-width:100px}.ml-admin-create label{display:inline-flex;align-items:center;gap:4px;color:#ccc;font-size:.8rem}.ml-admin button{background:#2a2a3a;color:#ddd;border:1px solid #444;border-radius:3px;padding:3px 9px;font-size:.78rem;cursor:pointer;margin-right:4px}.ml-admin button:hover:not(:disabled){background:#353550;border-color:#88f}.ml-admin button:disabled{opacity:.45;cursor:not-allowed}.ml-admin-danger{color:#faa;border-color:#803333!important}.ml-admin-danger:hover:not(:disabled){background:#3a1c1c!important}.ml-admin-table{width:100%;border-collapse:collapse;font-size:.78rem}.ml-admin-table th,.ml-admin-table td{text-align:left;padding:4px 6px;border-bottom:1px solid #2a2a2a;vertical-align:middle}.ml-admin-table th{color:#aaa;font-weight:600;text-transform:uppercase;font-size:.68rem;letter-spacing:.04em}.ml-admin-table tbody tr:hover{background:#ffffff06}.ml-admin-toggle{font-family:monospace;font-weight:700;min-width:28px;text-align:center}.ml-admin-pw-edit{display:inline-flex;gap:4px;align-items:center}.ml-admin-pw-edit input{background:#111;color:#eee;border:1px solid #88f;border-radius:3px;padding:3px 6px;font-family:monospace;font-size:.78rem;width:160px}@media(max-width:768px){.ml-layout{flex-direction:column}.ml-sidebar{width:100%;min-width:100%;max-height:40vh;border-right:none;border-bottom:2px solid #333}.ml-map-container{min-height:60vh}} +.ml-layout{display:flex;height:100vh;overflow:hidden;background:#111;color:#eee;font-family:Segoe UI,sans-serif}.ml-sidebar{width:400px;min-width:400px;background:#1a1a1a;border-right:2px solid #333;display:flex;flex-direction:column;overflow-y:auto;padding:12px 14px;scrollbar-width:none;-ms-overflow-style:none}.ml-sidebar::-webkit-scrollbar{display:none}.ml-sidebar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.ml-sidebar-title{font-size:.85rem;font-weight:600;color:#88f}.ml-view-toggle{font-size:.7rem;padding:3px 10px;background:#333;color:#aaa;border:1px solid #555;border-radius:3px;cursor:pointer}.ml-view-toggle:hover{background:#444;color:#fff}.ml-server-status{display:flex;align-items:center;gap:6px;padding:4px 0 8px;font-size:.75rem;color:#aaa}.ml-status-dot{width:8px;height:8px;border-radius:50%}.ml-status-dot.online{background:#4c4;animation:ml-pulse 2s ease-in-out infinite}.ml-status-dot.offline{background:#c44}.ml-status-detail{color:#888;font-size:.7rem}.ml-status-latency{margin-left:auto;color:#888}.ml-tool-links{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}.ml-tool-link{font-size:.68rem;color:#8ac;text-decoration:none;padding:2px 6px;background:#4488ff14;border:1px solid rgba(68,136,255,.15);border-radius:3px;transition:all .15s}.ml-tool-link:hover{background:#4488ff2e;color:#adf}@keyframes ml-pulse{0%,to{opacity:1}50%{opacity:.4}}.ml-counters{display:flex;gap:6px;margin-bottom:10px}.ml-counter{flex:1;text-align:center;padding:6px 4px;border-radius:4px;background:#222;border:1px solid #333}.ml-counter-val{display:block;font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums}.ml-counter-lbl{display:block;font-size:.6rem;color:#888;text-transform:uppercase;letter-spacing:.3px}.ml-counter.rares .ml-counter-val{color:#fc0}.ml-counter.kph .ml-counter-val{color:#4af}.ml-counter.kph{border-color:#234;animation:ml-kph-glow 3s ease-in-out infinite}.ml-counter.kph.ultra{background:linear-gradient(135deg,#112,#221);animation:ml-kph-glow 1.5s ease-in-out infinite}.ml-counter.kills .ml-counter-val{color:#f66}@keyframes ml-kph-glow{0%,to{box-shadow:0 0 4px #4af3}50%{box-shadow:0 0 12px #44aaff80}}.ml-sort-buttons{display:flex;gap:2px;margin:8px 0}.ml-sort-btn{flex:1;padding:4px 0;font-size:.65rem;font-weight:600;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer;text-transform:uppercase;letter-spacing:.3px}.ml-sort-btn:hover{background:#333;color:#ccc}.ml-sort-btn.active{background:#334;color:#88f;border-color:#88f}.ml-filter{width:100%;padding:5px 8px;font-size:.78rem;background:#222;color:#eee;border:1px solid #444;border-radius:3px;outline:none;margin-bottom:8px;box-sizing:border-box}.ml-filter:focus{border-color:#88f}.ml-filter::placeholder{color:#666}.ml-player-list{list-style:none;margin:0;padding:0;flex:1;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.ml-player-list::-webkit-scrollbar{display:none}.ml-player-row{padding:6px 8px;border-bottom:1px solid #2a2a2a;border-left:3px solid transparent;cursor:pointer;transition:background .1s}.ml-player-row:hover{background:#252525}.ml-player-row.ml-player-selected{background:#2a3344}.ml-pr-name{font-size:.82rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ml-pr-coords{font-size:.65rem;color:#888;margin-bottom:3px}.ml-pr-vitals{display:flex;gap:3px;margin-bottom:4px}.ml-vital-bar{flex:1;height:4px;border-radius:2px;overflow:hidden}.ml-vital-bar.hp{background:#300}.ml-vital-bar.sta{background:#331a00}.ml-vital-bar.mana{background:#001433}.ml-vital-bar.hp .ml-vital-fill{background:linear-gradient(90deg,#f44,#f66)}.ml-vital-bar.sta .ml-vital-fill{background:linear-gradient(90deg,#fa0,#fc4)}.ml-vital-bar.mana .ml-vital-fill{background:linear-gradient(90deg,#48f,#6af)}.ml-vital-fill{height:100%;border-radius:2px;transition:width .3s ease-out}.ml-pr-header{display:flex;justify-content:space-between;align-items:baseline;cursor:pointer}.ml-pr-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1px 8px;font-size:.68rem;color:#aaa;margin-bottom:4px}.ml-gs{font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-suffix{font-size:.58rem;color:#666;text-transform:uppercase;letter-spacing:.3px}.ml-taper-icon{width:14px;height:14px;margin-right:2px;vertical-align:text-bottom}.ml-meta-pill{font-size:.6rem;padding:0 6px;border-radius:3px;background:#333;color:#888;text-align:center;justify-self:end}.ml-pr-buttons{display:flex;gap:3px;margin-top:4px}.ml-btn{padding:2px 8px;font-size:.63rem;font-weight:500;border:1px solid #3a3a3a;border-radius:4px;background:#2a2a2a;color:#999;cursor:pointer;white-space:nowrap;transition:all .15s;letter-spacing:.2px}.ml-btn:hover{background:#383838;color:#ddd;border-color:#555}.ml-btn.accent{background:#4488ff1f;color:#6aadff;border-color:#4488ff4d}.ml-btn.accent:hover{background:#4488ff38;color:#8ec5ff;border-color:#4488ff80}.ml-meta-pill.active{background:#44cc4426;color:#4c4}.ml-meta-pill.other{background:#cc444426;color:#c44}.ml-map-container{flex:1;position:relative;overflow:hidden;background:#000;cursor:grab}.ml-map-container:active{cursor:grabbing}.ml-map-group{position:absolute;top:0;left:0;transform-origin:0 0}.ml-map-img{display:block;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ml-dots-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-dot{position:absolute;width:6px;height:6px;border-radius:50%;transform:translate(-50%,-50%);border:1px solid rgba(0,0,0,.5);pointer-events:all;cursor:pointer;z-index:5}.ml-dot:hover{width:10px;height:10px;z-index:10}.ml-dot.ml-dot-selected{width:10px;height:10px;z-index:10;animation:ml-blink .6s step-end infinite}@keyframes ml-blink{50%{opacity:0}}.ml-version{font-size:.65rem;color:#aaa;margin-bottom:2px}.ml-agent{display:flex;flex-direction:column;height:100%;font-size:.85rem}.ml-agent-toolbar{display:flex;align-items:center;gap:8px;padding:6px 8px;border-bottom:1px solid #333;background:#1a1a1a}.ml-agent-btn{background:#2a2a3a;color:#ddd;border:1px solid #444;border-radius:3px;padding:3px 8px;font-size:.75rem;cursor:pointer}.ml-agent-btn:hover:not(:disabled){background:#353550;border-color:#88f}.ml-agent-btn:disabled{opacity:.5;cursor:not-allowed}.ml-agent-session{font-family:monospace;font-size:.7rem;color:#888;margin-left:auto}.ml-agent-messages{flex:1;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:10px}.ml-agent-empty{color:#888;font-style:italic;text-align:center;padding:20px;line-height:1.5}.ml-agent-msg{display:flex;flex-direction:column;gap:2px;max-width:92%}.ml-agent-user{align-self:flex-end}.ml-agent-assistant,.ml-agent-error{align-self:flex-start}.ml-agent-role{font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#888}.ml-agent-user .ml-agent-role{color:#88f;text-align:right}.ml-agent-assistant .ml-agent-role{color:#6fd07a}.ml-agent-error .ml-agent-role{color:#d66}.ml-agent-text{padding:7px 10px;border-radius:6px;background:#232333;color:#e8e8e8;white-space:pre-wrap;word-break:break-word;line-height:1.4}.ml-agent-user .ml-agent-text{background:#2a3a55;color:#fff}.ml-agent-error .ml-agent-text{background:#3a1c1c;color:#faa}.ml-agent-thinking{color:#888;font-style:italic}.ml-agent-form{display:flex;gap:6px;padding:6px 8px;border-top:1px solid #333;background:#1a1a1a}.ml-agent-input{flex:1;resize:none;background:#111;color:#eee;border:1px solid #444;border-radius:3px;padding:5px 7px;font-family:inherit;font-size:.85rem;line-height:1.3}.ml-agent-input:focus{outline:1px solid #88f;border-color:#88f}.ml-agent-input:disabled{opacity:.6}.ml-agent-send{background:#2a3a55;color:#fff;border:1px solid #4466aa;border-radius:3px;padding:0 14px;font-size:.85rem;cursor:pointer}.ml-agent-send:hover:not(:disabled){background:#34507a}.ml-agent-send:disabled{opacity:.4;cursor:not-allowed}.ml-tooltip{position:absolute;background:#001e3ceb;color:#eee;padding:6px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:1000;white-space:nowrap;border:1px solid #335}.ml-coords{position:absolute;bottom:8px;left:8px;background:#003264d9;color:#eee;padding:4px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:100;font-variant-numeric:tabular-nums}.ml-toggles{display:flex;gap:12px;margin-bottom:8px;font-size:.72rem}.ml-toggle-label{display:flex;align-items:center;gap:4px;color:#aaa;cursor:pointer}.ml-toggle-label input{accent-color:#4488ff}.ml-trails-svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-heatmap-canvas{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;opacity:.8}.ml-portals-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-portal-icon{position:absolute;width:6px;height:6px;transform:translate(-50%,-50%);pointer-events:all;cursor:help}.ml-portal-icon:before{content:"πŸŒ€";font-size:10px;position:absolute;transform:translate(-50%,-50%)}.ml-window{position:fixed;background:#1a1a1a;border:1px solid #444;border-radius:6px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 8px 32px #00000080}.ml-window-header{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:linear-gradient(135deg,#2a3a5a,#1a2a40);cursor:move;-webkit-user-select:none;user-select:none;border-bottom:1px solid #334}.ml-window-title{font-size:.8rem;font-weight:600;color:#acf}.ml-window-close{background:none;border:none;color:#888;font-size:1.1rem;cursor:pointer;line-height:1;padding:0 4px}.ml-window-close:hover{color:#f66}.ml-window-content{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-window-resize{position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;opacity:.3;background:linear-gradient(135deg,transparent 50%,#888 50%,transparent 52%,#888 65%,transparent 67%,#888 80%)}.ml-window-resize:hover{opacity:.6}.ml-stats-controls{display:flex;gap:4px;padding:6px 10px;border-bottom:1px solid #333}.ml-stats-range-btn{padding:3px 10px;font-size:.7rem;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer}.ml-stats-range-btn.active{background:#4488ff26;color:#6aadff;border-color:#4488ff4d}.ml-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;flex:1}.ml-stats-panel{min-height:200px;background:#fff;border-radius:3px;overflow:hidden}.ml-stats-panel iframe{border:none}.ml-chat-messages{flex:1;overflow-y:auto;padding:6px 10px;font-size:.75rem;font-family:Consolas,Courier New,monospace;line-height:1.4}.ml-chat-line{word-break:break-word}.ml-chat-form{display:flex;border-top:1px solid #333;padding:4px}.ml-chat-input{flex:1;background:#222;color:#eee;border:1px solid #444;border-radius:3px;padding:4px 8px;font-size:.78rem;outline:none}.ml-chat-input:focus{border-color:#48f}.ml-chat-input::placeholder{color:#666}.ml-rare-notifications{position:fixed;top:20px;left:50%;transform:translate(-50%);z-index:99999;display:flex;flex-direction:column;gap:8px;pointer-events:none}.ml-rare-notif{background:linear-gradient(135deg,#1a0a2e,#2a1040);border:2px solid #ffcc00;border-radius:8px;padding:16px 32px;text-align:center;animation:ml-notif-in .5s ease-out;box-shadow:0 0 40px #ffcc004d}.ml-rare-notif.exiting{animation:ml-notif-out .5s ease-in forwards}.ml-rare-notif-title{font-size:1.4rem;font-weight:800;color:#fc0;text-shadow:0 0 20px rgba(255,204,0,.5);margin-bottom:4px}.ml-rare-notif-name{font-size:1.1rem;font-weight:600;color:#fff;margin-bottom:4px}.ml-rare-notif-by{font-size:.75rem;color:#888}.ml-rare-notif-char{font-size:1rem;font-weight:700;color:#fc0}@keyframes ml-notif-in{0%{transform:translateY(-40px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ml-notif-out{to{transform:translateY(-60px);opacity:0}}.ml-fireworks{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:99998}.ml-firework-particle{position:absolute;width:6px;height:6px;border-radius:50%;animation:ml-particle 2s cubic-bezier(.25,.46,.45,.94) forwards}@keyframes ml-particle{0%{transform:translate(0) scale(1);opacity:1}to{transform:translate(var(--dx),var(--dy)) scale(0);opacity:0}}.ml-tool-link-logout{margin-top:4px;color:#d88;border-top:1px dashed #444;padding-top:4px;font-size:.78rem}.ml-tool-link-logout:hover{color:#f88;background:#963c3c26}.ml-admin{display:flex;flex-direction:column;height:100%;padding:8px 10px;gap:10px;font-size:.85rem;overflow-y:auto}.ml-admin-section{background:#1a1a1a;border:1px solid #333;border-radius:4px;padding:8px 10px}.ml-admin-section h3{margin:0 0 6px;font-size:.9rem;color:#cfcfff;font-weight:600}.ml-admin-error{background:#3a1c1c;border:1px solid #803333;color:#faa;padding:6px 9px;border-radius:4px;font-family:monospace;font-size:.78rem;white-space:pre-wrap}.ml-admin-muted{color:#888;font-style:italic}.ml-admin-create{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.ml-admin-create input[type=text],.ml-admin-create input[type=password]{background:#111;color:#eee;border:1px solid #444;border-radius:3px;padding:4px 7px;font-size:.82rem;flex:1 1 140px;min-width:100px}.ml-admin-create label{display:inline-flex;align-items:center;gap:4px;color:#ccc;font-size:.8rem}.ml-admin button{background:#2a2a3a;color:#ddd;border:1px solid #444;border-radius:3px;padding:3px 9px;font-size:.78rem;cursor:pointer;margin-right:4px}.ml-admin button:hover:not(:disabled){background:#353550;border-color:#88f}.ml-admin button:disabled{opacity:.45;cursor:not-allowed}.ml-admin-danger{color:#faa;border-color:#803333!important}.ml-admin-danger:hover:not(:disabled){background:#3a1c1c!important}.ml-admin-table{width:100%;border-collapse:collapse;font-size:.78rem}.ml-admin-table th,.ml-admin-table td{text-align:left;padding:4px 6px;border-bottom:1px solid #2a2a2a;vertical-align:middle}.ml-admin-table th{color:#aaa;font-weight:600;text-transform:uppercase;font-size:.68rem;letter-spacing:.04em}.ml-admin-table tbody tr:hover{background:#ffffff06}.ml-admin-toggle{font-family:monospace;font-weight:700;min-width:28px;text-align:center}.ml-admin-pw-edit{display:inline-flex;gap:4px;align-items:center}.ml-admin-pw-edit input{background:#111;color:#eee;border:1px solid #88f;border-radius:3px;padding:3px 6px;font-family:monospace;font-size:.78rem;width:160px}.ml-dashboard-page{display:flex;flex-direction:column;height:100vh;width:100vw;background:#111;color:#ddd;font-family:inherit}.ml-dashboard-header{display:flex;align-items:center;gap:14px;padding:10px 16px;background:#1a1a1a;border-bottom:1px solid #333;font-size:.9rem}.ml-dashboard-title{font-weight:600;color:#cfcfff;font-size:1rem}.ml-dashboard-count{color:#6af;font-variant-numeric:tabular-nums;font-size:.85rem}.ml-dashboard-version{font-family:monospace;font-size:.7rem;color:#888}.ml-dashboard-main{flex:1;display:flex;flex-direction:column;overflow:hidden;padding:8px 12px}@media(max-width:768px){.ml-layout{flex-direction:column}.ml-sidebar{width:100%;min-width:100%;max-height:40vh;border-right:none;border-bottom:2px solid #333}.ml-map-container{min-height:60vh}} diff --git a/static/assets/index-d7uW0_CB.js b/static/assets/index-d7uW0_CB.js new file mode 100644 index 00000000..68f0cb0c --- /dev/null +++ b/static/assets/index-d7uW0_CB.js @@ -0,0 +1,34 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsWindow-DKBKOgS_.js","assets/react-yfL0ty4i.js","assets/CharacterWindow-B7YBkp-L.js","assets/InventoryWindow-ZxZJFETP.js","assets/RadarWindow-DwR1V8eq.js","assets/CombatStatsWindow-D1mRyTZ9.js","assets/CombatPickerWindow-DO9GiqPu.js","assets/IssuesWindow-BxSy4plP.js","assets/VitalSharingWindow-Cqg_448n.js","assets/QuestStatusWindow-DCQZBsLK.js","assets/AgentWindow-Bwz75p50.js","assets/AdminUsersWindow-DKxAPN9c.js"])))=>i.map(i=>d[i]); +import{r as jd,g as fh,a as sh}from"./react-yfL0ty4i.js";(function(){const z=document.createElement("link").relList;if(z&&z.supports&&z.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))o(M);new MutationObserver(M=>{for(const U of M)if(U.type==="childList")for(const j of U.addedNodes)j.tagName==="LINK"&&j.rel==="modulepreload"&&o(j)}).observe(document,{childList:!0,subtree:!0});function T(M){const U={};return M.integrity&&(U.integrity=M.integrity),M.referrerPolicy&&(U.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?U.credentials="include":M.crossOrigin==="anonymous"?U.credentials="omit":U.credentials="same-origin",U}function o(M){if(M.ep)return;M.ep=!0;const U=T(M);fetch(M.href,U)}})();var of={exports:{}},Sn={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bd;function oh(){if(bd)return Sn;bd=1;var f=Symbol.for("react.transitional.element"),z=Symbol.for("react.fragment");function T(o,M,U){var j=null;if(U!==void 0&&(j=""+U),M.key!==void 0&&(j=""+M.key),"key"in M){U={};for(var N in M)N!=="key"&&(U[N]=M[N])}else U=M;return M=U.ref,{$$typeof:f,type:o,key:j,ref:M!==void 0?M:null,props:U}}return Sn.Fragment=z,Sn.jsx=T,Sn.jsxs=T,Sn}var pd;function rh(){return pd||(pd=1,of.exports=oh()),of.exports}var d=rh(),A=jd();const pn=fh(A);var rf={exports:{}},bn={},df={exports:{}},mf={};/** + * @license React + * scheduler.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var zd;function dh(){return zd||(zd=1,(function(f){function z(g,R){var G=g.length;g.push(R);l:for(;0>>1,Y=g[H];if(0>>1;HM(I,G))RlM(_t,I)?(g[H]=_t,g[Rl]=G,H=Rl):(g[H]=I,g[sl]=G,H=sl);else if(RlM(_t,G))g[H]=_t,g[Rl]=G,H=Rl;else break l}}return R}function M(g,R){var G=g.sortIndex-R.sortIndex;return G!==0?G:g.id-R.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var U=performance;f.unstable_now=function(){return U.now()}}else{var j=Date,N=j.now();f.unstable_now=function(){return j.now()-N}}var h=[],p=[],C=1,S=null,O=3,B=!1,k=!1,nl=!1,ml=!1,Sl=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function Ml(g){for(var R=T(p);R!==null;){if(R.callback===null)o(p);else if(R.startTime<=g)o(p),R.sortIndex=R.expirationTime,z(h,R);else break;R=T(p)}}function Vl(g){if(nl=!1,Ml(g),!k)if(T(h)!==null)k=!0,F||(F=!0,xl());else{var R=T(p);R!==null&&bt(Vl,R.startTime-g)}}var F=!1,P=-1,Q=5,L=-1;function W(){return ml?!0:!(f.unstable_now()-Lg&&W());){var H=S.callback;if(typeof H=="function"){S.callback=null,O=S.priorityLevel;var Y=H(S.expirationTime<=g);if(g=f.unstable_now(),typeof Y=="function"){S.callback=Y,Ml(g),R=!0;break t}S===T(h)&&o(h),Ml(g)}else o(h);S=T(h)}if(S!==null)R=!0;else{var fl=T(p);fl!==null&&bt(Vl,fl.startTime-g),R=!1}}break l}finally{S=null,O=G,B=!1}R=void 0}}finally{R?xl():F=!1}}}var xl;if(typeof J=="function")xl=function(){J(Ul)};else if(typeof MessageChannel<"u"){var Nt=new MessageChannel,Tt=Nt.port2;Nt.port1.onmessage=Ul,xl=function(){Tt.postMessage(null)}}else xl=function(){Sl(Ul,0)};function bt(g,R){P=Sl(function(){g(f.unstable_now())},R)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(g){g.callback=null},f.unstable_forceFrameRate=function(g){0>g||125H?(g.sortIndex=G,z(p,g),T(h)===null&&g===T(p)&&(nl?(K(P),P=-1):nl=!0,bt(Vl,G-H))):(g.sortIndex=Y,z(h,g),k||B||(k=!0,F||(F=!0,xl()))),g},f.unstable_shouldYield=W,f.unstable_wrapCallback=function(g){var R=O;return function(){var G=O;O=R;try{return g.apply(this,arguments)}finally{O=G}}}})(mf)),mf}var xd;function mh(){return xd||(xd=1,df.exports=dh()),df.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ad;function hh(){if(Ad)return bn;Ad=1;var f=mh(),z=jd(),T=sh();function o(l){var t="https://react.dev/errors/"+l;if(1Y||(l.current=H[Y],H[Y]=null,Y--)}function I(l,t){Y++,H[Y]=l.current,l.current=t}var Rl=fl(null),_t=fl(null),Wt=fl(null),An=fl(null);function Tn(l,t){switch(I(Wt,t),I(_t,l),I(Rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Vr(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Vr(t),l=Zr(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}sl(Rl),I(Rl,l)}function Ga(){sl(Rl),sl(_t),sl(Wt)}function Lu(l){l.memoizedState!==null&&I(An,l);var t=Rl.current,a=Zr(t,l.type);t!==a&&(I(_t,l),I(Rl,a))}function _n(l){_t.current===l&&(sl(Rl),sl(_t)),An.current===l&&(sl(An),hn._currentValue=G)}var Ku,gf;function za(l){if(Ku===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ku=t&&t[1]||"",gf=-1)":-1n||s[e]!==v[n]){var _=` +`+s[e].replace(" at new "," at ");return l.displayName&&_.includes("")&&(_=_.replace("",l.displayName)),_}while(1<=e&&0<=n);break}}}finally{Ju=!1,Error.prepareStackTrace=a}return(a=l?l.displayName||l.name:"")?za(a):""}function Xd(l,t){switch(l.tag){case 26:case 27:case 5:return za(l.type);case 16:return za("Lazy");case 13:return l.child!==t&&t!==null?za("Suspense Fallback"):za("Suspense");case 19:return za("SuspenseList");case 0:case 15:return wu(l.type,!1);case 11:return wu(l.type.render,!1);case 1:return wu(l.type,!0);case 31:return za("Activity");default:return""}}function Sf(l){try{var t="",a=null;do t+=Xd(l,a),a=l,l=l.return;while(l);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var ku=Object.prototype.hasOwnProperty,Wu=f.unstable_scheduleCallback,$u=f.unstable_cancelCallback,Gd=f.unstable_shouldYield,Qd=f.unstable_requestPaint,Fl=f.unstable_now,Vd=f.unstable_getCurrentPriorityLevel,bf=f.unstable_ImmediatePriority,pf=f.unstable_UserBlockingPriority,En=f.unstable_NormalPriority,Zd=f.unstable_LowPriority,zf=f.unstable_IdlePriority,Ld=f.log,Kd=f.unstable_setDisableYieldValue,_e=null,Il=null;function $t(l){if(typeof Ld=="function"&&Kd(l),Il&&typeof Il.setStrictMode=="function")try{Il.setStrictMode(_e,l)}catch{}}var Pl=Math.clz32?Math.clz32:kd,Jd=Math.log,wd=Math.LN2;function kd(l){return l>>>=0,l===0?32:31-(Jd(l)/wd|0)|0}var Mn=256,Dn=262144,jn=4194304;function xa(l){var t=l&42;if(t!==0)return t;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Nn(l,t,a){var e=l.pendingLanes;if(e===0)return 0;var n=0,u=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=e&134217727;return i!==0?(e=i&~u,e!==0?n=xa(e):(c&=i,c!==0?n=xa(c):a||(a=i&~l,a!==0&&(n=xa(a))))):(i=e&~u,i!==0?n=xa(i):c!==0?n=xa(c):a||(a=e&~l,a!==0&&(n=xa(a)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:n}function Ee(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function Wd(l,t){switch(l){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xf(){var l=jn;return jn<<=1,(jn&62914560)===0&&(jn=4194304),l}function Fu(l){for(var t=[],a=0;31>a;a++)t.push(l);return t}function Me(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function $d(l,t,a,e,n,u){var c=l.pendingLanes;l.pendingLanes=a,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=a,l.entangledLanes&=a,l.errorRecoveryDisabledLanes&=a,l.shellSuspendCounter=0;var i=l.entanglements,s=l.expirationTimes,v=l.hiddenUpdates;for(a=c&~a;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var am=/[\n"\\]/g;function ft(l){return l.replace(am,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ec(l,t,a,e,n,u,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+it(t)):l.value!==""+it(t)&&(l.value=""+it(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?nc(l,c,it(t)):a!=null?nc(l,c,it(a)):e!=null&&l.removeAttribute("value"),n==null&&u!=null&&(l.defaultChecked=!!u),n!=null&&(l.checked=n&&typeof n!="function"&&typeof n!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+it(i):l.removeAttribute("name")}function Hf(l,t,a,e,n,u,c,i){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(l.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){ac(l);return}a=a!=null?""+it(a):"",t=t!=null?""+it(t):a,i||t===l.value||(l.value=t),l.defaultValue=t}e=e??n,e=typeof e!="function"&&typeof e!="symbol"&&!!e,l.checked=i?l.checked:!!e,l.defaultChecked=!!e,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),ac(l)}function nc(l,t,a){t==="number"&&Cn(l.ownerDocument)===l||l.defaultValue===""+a||(l.defaultValue=""+a)}function Ja(l,t,a,e){if(l=l.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=!1;if(Ct)try{var Oe={};Object.defineProperty(Oe,"passive",{get:function(){sc=!0}}),window.addEventListener("test",Oe,Oe),window.removeEventListener("test",Oe,Oe)}catch{sc=!1}var It=null,oc=null,Hn=null;function Vf(){if(Hn)return Hn;var l,t=oc,a=t.length,e,n="value"in It?It.value:It.textContent,u=n.length;for(l=0;l=Re),kf=" ",Wf=!1;function $f(l,t){switch(l){case"keyup":return Nm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ff(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var $a=!1;function Um(l,t){switch(l){case"compositionend":return Ff(t);case"keypress":return t.which!==32?null:(Wf=!0,kf);case"textInput":return l=t.data,l===kf&&Wf?null:l;default:return null}}function Cm(l,t){if($a)return l==="compositionend"||!yc&&$f(l,t)?(l=Vf(),Hn=oc=It=null,$a=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-l};l=e}l:{for(;a;){if(a.nextSibling){a=a.nextSibling;break l}a=a.parentNode}a=void 0}a=us(a)}}function is(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?is(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function fs(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=Cn(l.document);t instanceof l.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)l=t.contentWindow;else break;t=Cn(l.document)}return t}function Sc(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var Qm=Ct&&"documentMode"in document&&11>=document.documentMode,Fa=null,bc=null,Ye=null,pc=!1;function ss(l,t,a){var e=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;pc||Fa==null||Fa!==Cn(e)||(e=Fa,"selectionStart"in e&&Sc(e)?e={start:e.selectionStart,end:e.selectionEnd}:(e=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection(),e={anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset}),Ye&&qe(Ye,e)||(Ye=e,e=Du(bc,"onSelect"),0>=c,n-=c,Et=1<<32-Pl(t)+n|a<$?(el=X,X=null):el=X.sibling;var il=b(m,X,y[$],E);if(il===null){X===null&&(X=el);break}l&&X&&il.alternate===null&&t(m,X),r=u(il,r,$),cl===null?V=il:cl.sibling=il,cl=il,X=el}if($===y.length)return a(m,X),ul&&Ht(m,$),V;if(X===null){for(;$$?(el=X,X=null):el=X.sibling;var pa=b(m,X,il.value,E);if(pa===null){X===null&&(X=el);break}l&&X&&pa.alternate===null&&t(m,X),r=u(pa,r,$),cl===null?V=pa:cl.sibling=pa,cl=pa,X=el}if(il.done)return a(m,X),ul&&Ht(m,$),V;if(X===null){for(;!il.done;$++,il=y.next())il=D(m,il.value,E),il!==null&&(r=u(il,r,$),cl===null?V=il:cl.sibling=il,cl=il);return ul&&Ht(m,$),V}for(X=e(X);!il.done;$++,il=y.next())il=x(X,m,$,il.value,E),il!==null&&(l&&il.alternate!==null&&X.delete(il.key===null?$:il.key),r=u(il,r,$),cl===null?V=il:cl.sibling=il,cl=il);return l&&X.forEach(function(ih){return t(m,ih)}),ul&&Ht(m,$),V}function vl(m,r,y,E){if(typeof y=="object"&&y!==null&&y.type===nl&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case B:l:{for(var V=y.key;r!==null;){if(r.key===V){if(V=y.type,V===nl){if(r.tag===7){a(m,r.sibling),E=n(r,y.props.children),E.return=m,m=E;break l}}else if(r.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===Q&&Ca(V)===r.type){a(m,r.sibling),E=n(r,y.props),Le(E,y),E.return=m,m=E;break l}a(m,r);break}else t(m,r);r=r.sibling}y.type===nl?(E=Da(y.props.children,m.mode,E,y.key),E.return=m,m=E):(E=Kn(y.type,y.key,y.props,null,m.mode,E),Le(E,y),E.return=m,m=E)}return c(m);case k:l:{for(V=y.key;r!==null;){if(r.key===V)if(r.tag===4&&r.stateNode.containerInfo===y.containerInfo&&r.stateNode.implementation===y.implementation){a(m,r.sibling),E=n(r,y.children||[]),E.return=m,m=E;break l}else{a(m,r);break}else t(m,r);r=r.sibling}E=Mc(y,m.mode,E),E.return=m,m=E}return c(m);case Q:return y=Ca(y),vl(m,r,y,E)}if(bt(y))return q(m,r,y,E);if(xl(y)){if(V=xl(y),typeof V!="function")throw Error(o(150));return y=V.call(y),Z(m,r,y,E)}if(typeof y.then=="function")return vl(m,r,In(y),E);if(y.$$typeof===J)return vl(m,r,kn(m,y),E);Pn(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,r!==null&&r.tag===6?(a(m,r.sibling),E=n(r,y),E.return=m,m=E):(a(m,r),E=Ec(y,m.mode,E),E.return=m,m=E),c(m)):a(m,r)}return function(m,r,y,E){try{Ze=0;var V=vl(m,r,y,E);return fe=null,V}catch(X){if(X===ie||X===$n)throw X;var cl=tt(29,X,null,m.mode);return cl.lanes=E,cl.return=m,cl}finally{}}}var Ha=Us(!0),Cs=Us(!1),ea=!1;function Xc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gc(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function na(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function ua(l,t,a){var e=l.updateQueue;if(e===null)return null;if(e=e.shared,(ol&2)!==0){var n=e.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t,t=Ln(l),vs(l,null,a),t}return Zn(l,e,t,a),Ln(l)}function Ke(l,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,Tf(l,a)}}function Qc(l,t){var a=l.updateQueue,e=l.alternate;if(e!==null&&(e=e.updateQueue,a===e)){var n=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?n=u=c:u=u.next=c,a=a.next}while(a!==null);u===null?n=u=t:u=u.next=t}else n=u=t;a={baseState:e.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:e.shared,callbacks:e.callbacks},l.updateQueue=a;return}l=a.lastBaseUpdate,l===null?a.firstBaseUpdate=t:l.next=t,a.lastBaseUpdate=t}var Vc=!1;function Je(){if(Vc){var l=ce;if(l!==null)throw l}}function we(l,t,a,e){Vc=!1;var n=l.updateQueue;ea=!1;var u=n.firstBaseUpdate,c=n.lastBaseUpdate,i=n.shared.pending;if(i!==null){n.shared.pending=null;var s=i,v=s.next;s.next=null,c===null?u=v:c.next=v,c=s;var _=l.alternate;_!==null&&(_=_.updateQueue,i=_.lastBaseUpdate,i!==c&&(i===null?_.firstBaseUpdate=v:i.next=v,_.lastBaseUpdate=s))}if(u!==null){var D=n.baseState;c=0,_=v=s=null,i=u;do{var b=i.lane&-536870913,x=b!==i.lane;if(x?(al&b)===b:(e&b)===b){b!==0&&b===ue&&(Vc=!0),_!==null&&(_=_.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var q=l,Z=i;b=t;var vl=a;switch(Z.tag){case 1:if(q=Z.payload,typeof q=="function"){D=q.call(vl,D,b);break l}D=q;break l;case 3:q.flags=q.flags&-65537|128;case 0:if(q=Z.payload,b=typeof q=="function"?q.call(vl,D,b):q,b==null)break l;D=S({},D,b);break l;case 2:ea=!0}}b=i.callback,b!==null&&(l.flags|=64,x&&(l.flags|=8192),x=n.callbacks,x===null?n.callbacks=[b]:x.push(b))}else x={lane:b,tag:i.tag,payload:i.payload,callback:i.callback,next:null},_===null?(v=_=x,s=D):_=_.next=x,c|=b;if(i=i.next,i===null){if(i=n.shared.pending,i===null)break;x=i,i=x.next,x.next=null,n.lastBaseUpdate=x,n.shared.pending=null}}while(!0);_===null&&(s=D),n.baseState=s,n.firstBaseUpdate=v,n.lastBaseUpdate=_,u===null&&(n.shared.lanes=0),oa|=c,l.lanes=c,l.memoizedState=D}}function Rs(l,t){if(typeof l!="function")throw Error(o(191,l));l.call(t)}function Hs(l,t){var a=l.callbacks;if(a!==null)for(l.callbacks=null,l=0;lu?u:8;var c=g.T,i={};g.T=i,ii(l,!1,t,a);try{var s=n(),v=g.S;if(v!==null&&v(i,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var _=$m(s,e);$e(l,t,_,ct(l))}else $e(l,t,e,ct(l))}catch(D){$e(l,t,{then:function(){},status:"rejected",reason:D},ct())}finally{R.p=u,c!==null&&i.types!==null&&(c.types=i.types),g.T=c}}function a0(){}function ui(l,t,a,e){if(l.tag!==5)throw Error(o(476));var n=ho(l).queue;mo(l,n,t,G,a===null?a0:function(){return yo(l),a(e)})}function ho(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xt,lastRenderedState:G},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xt,lastRenderedState:a},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function yo(l){var t=ho(l);t.next===null&&(t=l.alternate.memoizedState),$e(l,t.next.queue,{},ct())}function ci(){return Xl(hn)}function vo(){return El().memoizedState}function go(){return El().memoizedState}function e0(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var a=ct();l=na(a);var e=ua(t,l,a);e!==null&&($l(e,t,a),Ke(e,t,a)),t={cache:Hc()},l.payload=t;return}t=t.return}}function n0(l,t,a){var e=ct();a={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},su(l)?bo(t,a):(a=Tc(l,t,a,e),a!==null&&($l(a,l,e),po(a,t,e)))}function So(l,t,a){var e=ct();$e(l,t,a,e)}function $e(l,t,a,e){var n={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(su(l))bo(t,n);else{var u=l.alternate;if(l.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var c=t.lastRenderedState,i=u(c,a);if(n.hasEagerState=!0,n.eagerState=i,lt(i,c))return Zn(l,t,n,0),gl===null&&Vn(),!1}catch{}finally{}if(a=Tc(l,t,n,e),a!==null)return $l(a,l,e),po(a,t,e),!0}return!1}function ii(l,t,a,e){if(e={lane:2,revertLane:Xi(),gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},su(l)){if(t)throw Error(o(479))}else t=Tc(l,a,e,2),t!==null&&$l(t,l,2)}function su(l){var t=l.alternate;return l===w||t!==null&&t===w}function bo(l,t){oe=au=!0;var a=l.pending;a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t}function po(l,t,a){if((a&4194048)!==0){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,Tf(l,a)}}var Fe={readContext:Xl,use:uu,useCallback:Al,useContext:Al,useEffect:Al,useImperativeHandle:Al,useLayoutEffect:Al,useInsertionEffect:Al,useMemo:Al,useReducer:Al,useRef:Al,useState:Al,useDebugValue:Al,useDeferredValue:Al,useTransition:Al,useSyncExternalStore:Al,useId:Al,useHostTransitionStatus:Al,useFormState:Al,useActionState:Al,useOptimistic:Al,useMemoCache:Al,useCacheRefresh:Al};Fe.useEffectEvent=Al;var zo={readContext:Xl,use:uu,useCallback:function(l,t){return Zl().memoizedState=[l,t===void 0?null:t],l},useContext:Xl,useEffect:eo,useImperativeHandle:function(l,t,a){a=a!=null?a.concat([l]):null,iu(4194308,4,io.bind(null,t,l),a)},useLayoutEffect:function(l,t){return iu(4194308,4,l,t)},useInsertionEffect:function(l,t){iu(4,2,l,t)},useMemo:function(l,t){var a=Zl();t=t===void 0?null:t;var e=l();if(Ba){$t(!0);try{l()}finally{$t(!1)}}return a.memoizedState=[e,t],e},useReducer:function(l,t,a){var e=Zl();if(a!==void 0){var n=a(t);if(Ba){$t(!0);try{a(t)}finally{$t(!1)}}}else n=t;return e.memoizedState=e.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:n},e.queue=l,l=l.dispatch=n0.bind(null,w,l),[e.memoizedState,l]},useRef:function(l){var t=Zl();return l={current:l},t.memoizedState=l},useState:function(l){l=li(l);var t=l.queue,a=So.bind(null,w,t);return t.dispatch=a,[l.memoizedState,a]},useDebugValue:ei,useDeferredValue:function(l,t){var a=Zl();return ni(a,l,t)},useTransition:function(){var l=li(!1);return l=mo.bind(null,w,l.queue,!0,!1),Zl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,a){var e=w,n=Zl();if(ul){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),gl===null)throw Error(o(349));(al&127)!==0||Qs(e,t,a)}n.memoizedState=a;var u={value:a,getSnapshot:t};return n.queue=u,eo(Zs.bind(null,e,u,l),[l]),e.flags|=2048,de(9,{destroy:void 0},Vs.bind(null,e,u,a,t),null),a},useId:function(){var l=Zl(),t=gl.identifierPrefix;if(ul){var a=Mt,e=Et;a=(e&~(1<<32-Pl(e)-1)).toString(32)+a,t="_"+t+"R_"+a,a=eu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof e.is=="string"?c.createElement("select",{is:e.is}):c.createElement("select"),e.multiple?u.multiple=!0:e.size&&(u.size=e.size);break;default:u=typeof e.is=="string"?c.createElement(n,{is:e.is}):c.createElement(n)}}u[ql]=t,u[Ll]=e;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)u.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=u;l:switch(Ql(u,n,e),n){case"button":case"input":case"select":case"textarea":e=!!e.autoFocus;break l;case"img":e=!0;break l;default:e=!1}e&&Qt(t)}}return pl(t),zi(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,a),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==e&&Qt(t);else{if(typeof e!="string"&&t.stateNode===null)throw Error(o(166));if(l=Wt.current,ee(t)){if(l=t.stateNode,a=t.memoizedProps,e=null,n=Yl,n!==null)switch(n.tag){case 27:case 5:e=n.memoizedProps}l[ql]=t,l=!!(l.nodeValue===a||e!==null&&e.suppressHydrationWarning===!0||Gr(l.nodeValue,a)),l||ta(t,!0)}else l=ju(l).createTextNode(e),l[ql]=t,t.stateNode=l}return pl(t),null;case 31:if(a=t.memoizedState,l===null||l.memoizedState!==null){if(e=ee(t),a!==null){if(l===null){if(!e)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(557));l[ql]=t}else ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pl(t),l=!1}else a=Oc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=a),l=!0;if(!l)return t.flags&256?(et(t),t):(et(t),null);if((t.flags&128)!==0)throw Error(o(558))}return pl(t),null;case 13:if(e=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(n=ee(t),e!==null&&e.dehydrated!==null){if(l===null){if(!n)throw Error(o(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));n[ql]=t}else ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;pl(t),n=!1}else n=Oc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(et(t),t):(et(t),null)}return et(t),(t.flags&128)!==0?(t.lanes=a,t):(a=e!==null,l=l!==null&&l.memoizedState!==null,a&&(e=t.child,n=null,e.alternate!==null&&e.alternate.memoizedState!==null&&e.alternate.memoizedState.cachePool!==null&&(n=e.alternate.memoizedState.cachePool.pool),u=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(u=e.memoizedState.cachePool.pool),u!==n&&(e.flags|=2048)),a!==l&&a&&(t.child.flags|=8192),hu(t,t.updateQueue),pl(t),null);case 4:return Ga(),l===null&&Zi(t.stateNode.containerInfo),pl(t),null;case 10:return qt(t.type),pl(t),null;case 19:if(sl(_l),e=t.memoizedState,e===null)return pl(t),null;if(n=(t.flags&128)!==0,u=e.rendering,u===null)if(n)Pe(e,!1);else{if(Tl!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(u=tu(l),u!==null){for(t.flags|=128,Pe(e,!1),l=u.updateQueue,t.updateQueue=l,hu(t,l),t.subtreeFlags=0,l=a,a=t.child;a!==null;)gs(a,l),a=a.sibling;return I(_l,_l.current&1|2),ul&&Ht(t,e.treeForkCount),t.child}l=l.sibling}e.tail!==null&&Fl()>bu&&(t.flags|=128,n=!0,Pe(e,!1),t.lanes=4194304)}else{if(!n)if(l=tu(u),l!==null){if(t.flags|=128,n=!0,l=l.updateQueue,t.updateQueue=l,hu(t,l),Pe(e,!0),e.tail===null&&e.tailMode==="hidden"&&!u.alternate&&!ul)return pl(t),null}else 2*Fl()-e.renderingStartTime>bu&&a!==536870912&&(t.flags|=128,n=!0,Pe(e,!1),t.lanes=4194304);e.isBackwards?(u.sibling=t.child,t.child=u):(l=e.last,l!==null?l.sibling=u:t.child=u,e.last=u)}return e.tail!==null?(l=e.tail,e.rendering=l,e.tail=l.sibling,e.renderingStartTime=Fl(),l.sibling=null,a=_l.current,I(_l,n?a&1|2:a&1),ul&&Ht(t,e.treeForkCount),l):(pl(t),null);case 22:case 23:return et(t),Lc(),e=t.memoizedState!==null,l!==null?l.memoizedState!==null!==e&&(t.flags|=8192):e&&(t.flags|=8192),e?(a&536870912)!==0&&(t.flags&128)===0&&(pl(t),t.subtreeFlags&6&&(t.flags|=8192)):pl(t),a=t.updateQueue,a!==null&&hu(t,a.retryQueue),a=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(t.flags|=2048),l!==null&&sl(Ua),null;case 24:return a=null,l!==null&&(a=l.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qt(Dl),pl(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function s0(l,t){switch(jc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return qt(Dl),Ga(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return _n(t),null;case 31:if(t.memoizedState!==null){if(et(t),t.alternate===null)throw Error(o(340));ja()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(et(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ja()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return sl(_l),null;case 4:return Ga(),null;case 10:return qt(t.type),null;case 22:case 23:return et(t),Lc(),l!==null&&sl(Ua),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return qt(Dl),null;case 25:return null;default:return null}}function Ko(l,t){switch(jc(t),t.tag){case 3:qt(Dl),Ga();break;case 26:case 27:case 5:_n(t);break;case 4:Ga();break;case 31:t.memoizedState!==null&&et(t);break;case 13:et(t);break;case 19:sl(_l);break;case 10:qt(t.type);break;case 22:case 23:et(t),Lc(),l!==null&&sl(Ua);break;case 24:qt(Dl)}}function ln(l,t){try{var a=t.updateQueue,e=a!==null?a.lastEffect:null;if(e!==null){var n=e.next;a=n;do{if((a.tag&l)===l){e=void 0;var u=a.create,c=a.inst;e=u(),c.destroy=e}a=a.next}while(a!==n)}}catch(i){dl(t,t.return,i)}}function fa(l,t,a){try{var e=t.updateQueue,n=e!==null?e.lastEffect:null;if(n!==null){var u=n.next;e=u;do{if((e.tag&l)===l){var c=e.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,n=t;var s=a,v=i;try{v()}catch(_){dl(n,s,_)}}}e=e.next}while(e!==u)}}catch(_){dl(t,t.return,_)}}function Jo(l){var t=l.updateQueue;if(t!==null){var a=l.stateNode;try{Hs(t,a)}catch(e){dl(l,l.return,e)}}}function wo(l,t,a){a.props=qa(l.type,l.memoizedProps),a.state=l.memoizedState;try{a.componentWillUnmount()}catch(e){dl(l,t,e)}}function tn(l,t){try{var a=l.ref;if(a!==null){switch(l.tag){case 26:case 27:case 5:var e=l.stateNode;break;case 30:e=l.stateNode;break;default:e=l.stateNode}typeof a=="function"?l.refCleanup=a(e):a.current=e}}catch(n){dl(l,t,n)}}function Dt(l,t){var a=l.ref,e=l.refCleanup;if(a!==null)if(typeof e=="function")try{e()}catch(n){dl(l,t,n)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){dl(l,t,n)}else a.current=null}function ko(l){var t=l.type,a=l.memoizedProps,e=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&e.focus();break l;case"img":a.src?e.src=a.src:a.srcSet&&(e.srcset=a.srcSet)}}catch(n){dl(l,l.return,n)}}function xi(l,t,a){try{var e=l.stateNode;O0(e,l.type,a,t),e[Ll]=t}catch(n){dl(l,l.return,n)}}function Wo(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ya(l.type)||l.tag===4}function Ai(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||Wo(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&ya(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ti(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(l,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(l),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ut));else if(e!==4&&(e===27&&ya(l.type)&&(a=l.stateNode,t=null),l=l.child,l!==null))for(Ti(l,t,a),l=l.sibling;l!==null;)Ti(l,t,a),l=l.sibling}function yu(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?a.insertBefore(l,t):a.appendChild(l);else if(e!==4&&(e===27&&ya(l.type)&&(a=l.stateNode),l=l.child,l!==null))for(yu(l,t,a),l=l.sibling;l!==null;)yu(l,t,a),l=l.sibling}function $o(l){var t=l.stateNode,a=l.memoizedProps;try{for(var e=l.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ql(t,e,a),t[ql]=l,t[Ll]=a}catch(u){dl(l,l.return,u)}}var Vt=!1,Ol=!1,_i=!1,Fo=typeof WeakSet=="function"?WeakSet:Set,Bl=null;function o0(l,t){if(l=l.containerInfo,Ji=Bu,l=fs(l),Sc(l)){if("selectionStart"in l)var a={start:l.selectionStart,end:l.selectionEnd};else l:{a=(a=l.ownerDocument)&&a.defaultView||window;var e=a.getSelection&&a.getSelection();if(e&&e.rangeCount!==0){a=e.anchorNode;var n=e.anchorOffset,u=e.focusNode;e=e.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break l}var c=0,i=-1,s=-1,v=0,_=0,D=l,b=null;t:for(;;){for(var x;D!==a||n!==0&&D.nodeType!==3||(i=c+n),D!==u||e!==0&&D.nodeType!==3||(s=c+e),D.nodeType===3&&(c+=D.nodeValue.length),(x=D.firstChild)!==null;)b=D,D=x;for(;;){if(D===l)break t;if(b===a&&++v===n&&(i=c),b===u&&++_===e&&(s=c),(x=D.nextSibling)!==null)break;D=b,b=D.parentNode}D=x}a=i===-1||s===-1?null:{start:i,end:s}}else a=null}a=a||{start:0,end:0}}else a=null;for(wi={focusedElem:l,selectionRange:a},Bu=!1,Bl=t;Bl!==null;)if(t=Bl,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,Bl=l;else for(;Bl!==null;){switch(t=Bl,u=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(a=0;a title"))),Ql(u,e,a),u[ql]=l,Hl(u),e=u;break l;case"link":var c=ed("link","href",n).get(e+(a.href||""));if(c){for(var i=0;ivl&&(c=vl,vl=Z,Z=c);var m=cs(i,Z),r=cs(i,vl);if(m&&r&&(x.rangeCount!==1||x.anchorNode!==m.node||x.anchorOffset!==m.offset||x.focusNode!==r.node||x.focusOffset!==r.offset)){var y=D.createRange();y.setStart(m.node,m.offset),x.removeAllRanges(),Z>vl?(x.addRange(y),x.extend(r.node,r.offset)):(y.setEnd(r.node,r.offset),x.addRange(y))}}}}for(D=[],x=i;x=x.parentNode;)x.nodeType===1&&D.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;ia?32:a,g.T=null,a=Ui,Ui=null;var u=da,c=wt;if(Cl=0,ge=da=null,wt=0,(ol&6)!==0)throw Error(o(331));var i=ol;if(ol|=4,fr(u.current),ur(u,u.current,c,a),ol=i,fn(0,!1),Il&&typeof Il.onPostCommitFiberRoot=="function")try{Il.onPostCommitFiberRoot(_e,u)}catch{}return!0}finally{R.p=n,g.T=e,Er(l,t)}}function Dr(l,t,a){t=ot(a,t),t=ri(l.stateNode,t,2),l=ua(l,t,2),l!==null&&(Me(l,2),jt(l))}function dl(l,t,a){if(l.tag===3)Dr(l,l,a);else for(;t!==null;){if(t.tag===3){Dr(t,l,a);break}else if(t.tag===1){var e=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof e.componentDidCatch=="function"&&(ra===null||!ra.has(e))){l=ot(a,l),a=jo(2),e=ua(t,a,2),e!==null&&(No(a,e,t,l),Me(e,2),jt(e));break}}t=t.return}}function Bi(l,t,a){var e=l.pingCache;if(e===null){e=l.pingCache=new m0;var n=new Set;e.set(t,n)}else n=e.get(t),n===void 0&&(n=new Set,e.set(t,n));n.has(a)||(Di=!0,n.add(a),l=S0.bind(null,l,t,a),t.then(l,l))}function S0(l,t,a){var e=l.pingCache;e!==null&&e.delete(t),l.pingedLanes|=l.suspendedLanes&a,l.warmLanes&=~a,gl===l&&(al&a)===a&&(Tl===4||Tl===3&&(al&62914560)===al&&300>Fl()-Su?(ol&2)===0&&Se(l,0):ji|=a,ve===al&&(ve=0)),jt(l)}function jr(l,t){t===0&&(t=xf()),l=Ma(l,t),l!==null&&(Me(l,t),jt(l))}function b0(l){var t=l.memoizedState,a=0;t!==null&&(a=t.retryLane),jr(l,a)}function p0(l,t){var a=0;switch(l.tag){case 31:case 13:var e=l.stateNode,n=l.memoizedState;n!==null&&(a=n.retryLane);break;case 19:e=l.stateNode;break;case 22:e=l.stateNode._retryCache;break;default:throw Error(o(314))}e!==null&&e.delete(t),jr(l,a)}function z0(l,t){return Wu(l,t)}var _u=null,pe=null,qi=!1,Eu=!1,Yi=!1,ha=0;function jt(l){l!==pe&&l.next===null&&(pe===null?_u=pe=l:pe=pe.next=l),Eu=!0,qi||(qi=!0,A0())}function fn(l,t){if(!Yi&&Eu){Yi=!0;do for(var a=!1,e=_u;e!==null;){if(l!==0){var n=e.pendingLanes;if(n===0)var u=0;else{var c=e.suspendedLanes,i=e.pingedLanes;u=(1<<31-Pl(42|l)+1)-1,u&=n&~(c&~i),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Cr(e,u))}else u=al,u=Nn(e,e===gl?u:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),(u&3)===0||Ee(e,u)||(a=!0,Cr(e,u));e=e.next}while(a);Yi=!1}}function x0(){Nr()}function Nr(){Eu=qi=!1;var l=0;ha!==0&&C0()&&(l=ha);for(var t=Fl(),a=null,e=_u;e!==null;){var n=e.next,u=Or(e,t);u===0?(e.next=null,a===null?_u=n:a.next=n,n===null&&(pe=a)):(a=e,(l!==0||(u&3)!==0)&&(Eu=!0)),e=n}Cl!==0&&Cl!==5||fn(l),ha!==0&&(ha=0)}function Or(l,t){for(var a=l.suspendedLanes,e=l.pingedLanes,n=l.expirationTimes,u=l.pendingLanes&-62914561;0i)break;var _=s.transferSize,D=s.initiatorType;_&&Qr(D)&&(s=s.responseEnd,c+=_*(s"u"?null:document;function Pr(l,t,a){var e=ze;if(e&&typeof t=="string"&&t){var n=ft(t);n='link[rel="'+l+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),Ir.has(n)||(Ir.add(n),l={rel:l,crossOrigin:a,href:t},e.querySelector(n)===null&&(t=e.createElement("link"),Ql(t,"link",l),Hl(t),e.head.appendChild(t)))}}function V0(l){kt.D(l),Pr("dns-prefetch",l,null)}function Z0(l,t){kt.C(l,t),Pr("preconnect",l,t)}function L0(l,t,a){kt.L(l,t,a);var e=ze;if(e&&l&&t){var n='link[rel="preload"][as="'+ft(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+ft(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+ft(a.imageSizes)+'"]')):n+='[href="'+ft(l)+'"]';var u=n;switch(t){case"style":u=xe(l);break;case"script":u=Ae(l)}vt.has(u)||(l=S({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:l,as:t},a),vt.set(u,l),e.querySelector(n)!==null||t==="style"&&e.querySelector(dn(u))||t==="script"&&e.querySelector(mn(u))||(t=e.createElement("link"),Ql(t,"link",l),Hl(t),e.head.appendChild(t)))}}function K0(l,t){kt.m(l,t);var a=ze;if(a&&l){var e=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+ft(e)+'"][href="'+ft(l)+'"]',u=n;switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ae(l)}if(!vt.has(u)&&(l=S({rel:"modulepreload",href:l},t),vt.set(u,l),a.querySelector(n)===null)){switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mn(u)))return}e=a.createElement("link"),Ql(e,"link",l),Hl(e),a.head.appendChild(e)}}}function J0(l,t,a){kt.S(l,t,a);var e=ze;if(e&&l){var n=La(e).hoistableStyles,u=xe(l);t=t||"default";var c=n.get(u);if(!c){var i={loading:0,preload:null};if(c=e.querySelector(dn(u)))i.loading=5;else{l=S({rel:"stylesheet",href:l,"data-precedence":t},a),(a=vt.get(u))&&lf(l,a);var s=c=e.createElement("link");Hl(s),Ql(s,"link",l),s._p=new Promise(function(v,_){s.onload=v,s.onerror=_}),s.addEventListener("load",function(){i.loading|=1}),s.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Ou(c,t,e)}c={type:"stylesheet",instance:c,count:1,state:i},n.set(u,c)}}}function w0(l,t){kt.X(l,t);var a=ze;if(a&&l){var e=La(a).hoistableScripts,n=Ae(l),u=e.get(n);u||(u=a.querySelector(mn(n)),u||(l=S({src:l,async:!0},t),(t=vt.get(n))&&tf(l,t),u=a.createElement("script"),Hl(u),Ql(u,"link",l),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},e.set(n,u))}}function k0(l,t){kt.M(l,t);var a=ze;if(a&&l){var e=La(a).hoistableScripts,n=Ae(l),u=e.get(n);u||(u=a.querySelector(mn(n)),u||(l=S({src:l,async:!0,type:"module"},t),(t=vt.get(n))&&tf(l,t),u=a.createElement("script"),Hl(u),Ql(u,"link",l),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},e.set(n,u))}}function ld(l,t,a,e){var n=(n=Wt.current)?Nu(n):null;if(!n)throw Error(o(446));switch(l){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=xe(a.href),a=La(n).hoistableStyles,e=a.get(t),e||(e={type:"style",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){l=xe(a.href);var u=La(n).hoistableStyles,c=u.get(l);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(l,c),(u=n.querySelector(dn(l)))&&!u._p&&(c.instance=u,c.state.loading=5),vt.has(l)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vt.set(l,a),u||W0(n,l,a,c.state))),t&&e===null)throw Error(o(528,""));return c}if(t&&e!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ae(a),a=La(n).hoistableScripts,e=a.get(t),e||(e={type:"script",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,l))}}function xe(l){return'href="'+ft(l)+'"'}function dn(l){return'link[rel="stylesheet"]['+l+"]"}function td(l){return S({},l,{"data-precedence":l.precedence,precedence:null})}function W0(l,t,a,e){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?e.loading=1:(t=l.createElement("link"),e.preload=t,t.addEventListener("load",function(){return e.loading|=1}),t.addEventListener("error",function(){return e.loading|=2}),Ql(t,"link",a),Hl(t),l.head.appendChild(t))}function Ae(l){return'[src="'+ft(l)+'"]'}function mn(l){return"script[async]"+l}function ad(l,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var e=l.querySelector('style[data-href~="'+ft(a.href)+'"]');if(e)return t.instance=e,Hl(e),e;var n=S({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return e=(l.ownerDocument||l).createElement("style"),Hl(e),Ql(e,"style",n),Ou(e,a.precedence,l),t.instance=e;case"stylesheet":n=xe(a.href);var u=l.querySelector(dn(n));if(u)return t.state.loading|=4,t.instance=u,Hl(u),u;e=td(a),(n=vt.get(n))&&lf(e,n),u=(l.ownerDocument||l).createElement("link"),Hl(u);var c=u;return c._p=new Promise(function(i,s){c.onload=i,c.onerror=s}),Ql(u,"link",e),t.state.loading|=4,Ou(u,a.precedence,l),t.instance=u;case"script":return u=Ae(a.src),(n=l.querySelector(mn(u)))?(t.instance=n,Hl(n),n):(e=a,(n=vt.get(u))&&(e=S({},a),tf(e,n)),l=l.ownerDocument||l,n=l.createElement("script"),Hl(n),Ql(n,"link",e),l.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(e=t.instance,t.state.loading|=4,Ou(e,a.precedence,l));return t.instance}function Ou(l,t,a){for(var e=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=e.length?e[e.length-1]:null,u=n,c=0;c title"):null)}function $0(l,t,a){if(a===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return l=t.disabled,typeof t.precedence=="string"&&l==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ud(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function F0(l,t,a,e){if(a.type==="stylesheet"&&(typeof e.media!="string"||matchMedia(e.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=xe(e.href),u=t.querySelector(dn(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Cu.bind(l),t.then(l,l)),a.state.loading|=4,a.instance=u,Hl(u);return}u=t.ownerDocument||t,e=td(e),(n=vt.get(n))&&lf(e,n),u=u.createElement("link"),Hl(u);var c=u;c._p=new Promise(function(i,s){c.onload=i,c.onerror=s}),Ql(u,"link",e),a.instance=u}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(l.count++,a=Cu.bind(l),t.addEventListener("load",a),t.addEventListener("error",a))}}var af=0;function I0(l,t){return l.stylesheets&&l.count===0&&Hu(l,l.stylesheets),0af?50:800)+t);return l.unsuspend=a,function(){l.unsuspend=null,clearTimeout(e),clearTimeout(n)}}:null}function Cu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hu(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Ru=null;function Hu(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Ru=new Map,t.forEach(P0,l),Ru=null,Cu.call(l))}function P0(l,t){if(!(t.state.loading&4)){var a=Ru.get(l);if(a)var e=a.get(null);else{a=new Map,Ru.set(l,a);for(var n=l.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(z){console.error(z)}}return f(),rf.exports=hh(),rf.exports}var vh=yh();const Nd=A.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),gh=({children:f})=>{const[z,T]=A.useState([]),o=A.useRef(1e4),M=A.useCallback((N,h,p)=>{T(C=>C.find(O=>O.id===N)?C.map(O=>O.id===N?{...O,zIndex:++o.current}:O):[...C,{id:N,title:h,charName:p,zIndex:++o.current}])},[]),U=A.useCallback(N=>{T(h=>h.filter(p=>p.id!==N))},[]),j=A.useCallback(N=>{T(h=>h.map(p=>p.id===N?{...p,zIndex:++o.current}:p))},[]);return d.jsx(Nd.Provider,{value:{windows:z,openWindow:M,closeWindow:U,bringToFront:j},children:f})},zn=()=>A.useContext(Nd),gt={west:-102.1,east:102.1,north:102.1,south:-102.1};function xn(f,z,T,o){const M=(f-gt.west)/(gt.east-gt.west)*T,U=(gt.north-z)/(gt.north-gt.south)*o;return{x:M,y:U}}function Sh(f,z,T,o,M,U,j){const N=(f-o)/T,h=(z-M)/T,p=gt.west+N/U*(gt.east-gt.west),C=gt.north-h/j*(gt.north-gt.south);return{ew:p,ns:C}}function hf(f,z){const T=f>=0?"N":"S",o=z>=0?"E":"W";return`${Math.abs(f).toFixed(1)}${T}, ${Math.abs(z).toFixed(1)}${o}`}const Od=pn.memo(({players:f,imgW:z,imgH:T,getColor:o,onHover:M,onSelect:U,selectedPlayer:j})=>{const{openWindow:N}=zn(),[h,p]=A.useState(null);A.useEffect(()=>{const S=()=>p(null);return h&&window.addEventListener("click",S),()=>window.removeEventListener("click",S)},[h]);const C=A.useMemo(()=>f.filter(S=>S.ew!==void 0&&S.ns!==void 0).map(S=>({...S,pos:xn(S.ew,S.ns,z,T),color:o(S.character_name)})),[f,z,T,o]);return d.jsxs("div",{className:"ml-dots-layer",children:[C.map(S=>d.jsx("div",{className:`ml-dot ${j===S.character_name?"ml-dot-selected":""}`,style:{left:S.pos.x,top:S.pos.y,backgroundColor:S.color},onMouseEnter:O=>{var k;const B=(k=O.currentTarget.closest(".ml-map-container"))==null?void 0:k.getBoundingClientRect();B&&M(S,O.clientX-B.left,O.clientY-B.top)},onMouseLeave:()=>M(null,0,0),onClick:()=>U(S.character_name),onDoubleClick:()=>N(`chat-${S.character_name}`,`Chat: ${S.character_name}`,S.character_name),onContextMenu:O=>{var Sl;O.preventDefault();const B=S.character_name,k=(Sl=O.currentTarget.closest(".ml-map-container"))==null?void 0:Sl.getBoundingClientRect(),nl=k?O.clientX-k.left:O.clientX,ml=k?O.clientY-k.top:O.clientY;p({name:B,x:nl,y:ml})}},S.character_name)),h&&d.jsx("div",{style:{position:"fixed",left:h.x+410,top:h.y,background:"#1a1a1a",border:"1px solid #444",borderRadius:4,zIndex:9999,padding:"2px 0",fontSize:"0.75rem",boxShadow:"0 4px 12px rgba(0,0,0,0.5)",minWidth:120},children:[{label:"Chat",id:"chat"},{label:"Stats",id:"stats"},{label:"Inventory",id:"inv"},{label:"Character",id:"char"},{label:"Combat",id:"combat"},{label:"Radar",id:"radar"}].map(S=>d.jsx("div",{onClick:()=>{N(`${S.id}-${h.name}`,`${S.label}: ${h.name}`,h.name),p(null)},style:{padding:"4px 12px",cursor:"pointer",color:"#ccc"},onMouseEnter:O=>O.currentTarget.style.background="#333",onMouseLeave:O=>O.currentTarget.style.background="",children:S.label},S.id))})]})});Od.displayName="PlayerDots";const Zu="/api";async function At(f){const z=await fetch(`${Zu}${f}`,{credentials:"include"});if(!z.ok)throw new Error(`API ${f}: ${z.status}`);return z.json()}async function yf(f,z){var o;const T=await fetch(`${Zu}${f}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(z??{})});if(!T.ok){let M="";try{M=((o=await T.json())==null?void 0:o.detail)??""}catch{}throw new Error(`API ${f}: ${T.status}${M?` (${M})`:""}`)}return T.json()}async function bh(f,z){var o;const T=await fetch(`${Zu}${f}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(z??{})});if(!T.ok){let M="";try{M=((o=await T.json())==null?void 0:o.detail)??""}catch{}throw new Error(`API ${f}: ${T.status}${M?` (${M})`:""}`)}return T.json()}async function ph(f){var T;const z=await fetch(`${Zu}${f}`,{method:"DELETE",credentials:"include"});if(!z.ok){let o="";try{o=((T=await z.json())==null?void 0:T.detail)??""}catch{}throw new Error(`API ${f}: ${z.status}${o?` (${o})`:""}`)}return z.json()}function zh(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const Ud=pn.memo(({imgW:f,imgH:z,getColor:T})=>{const[o,M]=A.useState([]);A.useEffect(()=>{const j=async()=>{try{const h=await At("/trails/?seconds=600");M(h.trails??[])}catch{}};j();const N=setInterval(j,2e3);return()=>clearInterval(N)},[]);const U=A.useMemo(()=>{const j={};for(const N of o){const{x:h,y:p}=xn(N.ew,N.ns,f,z);j[N.character_name]||(j[N.character_name]=[]),j[N.character_name].push(`${h},${p}`)}return Object.entries(j).filter(([,N])=>N.length>=2).map(([N,h])=>({name:N,points:h.join(" ")}))},[o,f,z]);return d.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${f} ${z}`,preserveAspectRatio:"none",children:U.map(j=>d.jsx("polyline",{points:j.points,stroke:T(j.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},j.name))})});Ud.displayName="TrailsSVG";const xh=({imgW:f,imgH:z,enabled:T})=>{const o=A.useRef(null),[M,U]=A.useState([]);return A.useEffect(()=>{if(!T)return;(async()=>{try{const N=await At("/spawns/heatmap?hours=24&limit=50000");U(N.spawn_points??[])}catch{}})()},[T]),A.useEffect(()=>{const j=o.current;if(!j||!T||M.length===0||f===0)return;j.width=f,j.height=z;const N=j.getContext("2d");if(N){N.clearRect(0,0,f,z);for(const h of M){const{x:p,y:C}=xn(h.ew,h.ns,f,z),S=Math.max(5,Math.min(12,5+Math.sqrt(h.intensity*.5))),O=N.createRadialGradient(p,C,0,p,C,S);O.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,h.intensity/40)})`),O.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,h.intensity/120)})`),O.addColorStop(1,"rgba(255, 150, 0, 0)"),N.fillStyle=O,N.fillRect(p-S,C-S,S*2,S*2)}}},[M,f,z,T]),T?d.jsx("canvas",{ref:o,className:"ml-heatmap-canvas"}):null},Ah=({imgW:f,imgH:z,enabled:T})=>{const[o,M]=A.useState([]);A.useEffect(()=>{if(!T)return;const j=async()=>{try{const h=await At("/portals");M(h.portals??[])}catch{}};j();const N=setInterval(j,6e4);return()=>clearInterval(N)},[T]);const U=A.useMemo(()=>o.map(j=>({...j,pos:xn(j.coordinates.ew,j.coordinates.ns,f,z)})),[o,f,z]);return!T||U.length===0?null:d.jsx("div",{className:"ml-portals-layer",children:U.map((j,N)=>d.jsx("div",{className:"ml-portal-icon",style:{left:j.pos.x,top:j.pos.y},title:`${j.portal_name} (by ${j.discovered_by})`},N))})},_d=20,Ed=.3,Th=({players:f,getColor:z,onSelectPlayer:T,showHeatmap:o,showPortals:M,selectedPlayer:U})=>{var Vl;const j=A.useRef(null),N=A.useRef(null),[h,p]=A.useState({w:0,h:0}),[C,S]=A.useState(null),O=A.useRef(null),B=A.useRef({scale:1,offX:0,offY:0}),k=A.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),nl=A.useCallback(()=>{if(N.current){const{scale:F,offX:P,offY:Q}=B.current;N.current.style.transform=`translate(${P}px, ${Q}px) scale(${F})`}},[]),ml=A.useCallback(F=>{const P=F.currentTarget;if(p({w:P.naturalWidth,h:P.naturalHeight}),j.current){const Q=j.current.clientWidth,L=j.current.clientHeight,W=Math.min(Q/P.naturalWidth,L/P.naturalHeight);B.current={scale:W,offX:(Q-P.naturalWidth*W)/2,offY:(L-P.naturalHeight*W)/2},nl()}},[nl]),Sl=A.useCallback(F=>{var Tt;F.preventDefault();const P=(Tt=j.current)==null?void 0:Tt.getBoundingClientRect();if(!P)return;const Q=B.current,L=F.deltaY<0?1.1:.9,W=Math.min(_d,Math.max(Ed,Q.scale*L)),Ul=W/Q.scale,xl=F.clientX-P.left,Nt=F.clientY-P.top;B.current={scale:W,offX:xl-(xl-Q.offX)*Ul,offY:Nt-(Nt-Q.offY)*Ul},nl()},[nl]),K=A.useCallback(F=>{if(F.button!==0)return;const P=B.current;k.current={dragging:!0,sx:F.clientX,sy:F.clientY,startOffX:P.offX,startOffY:P.offY}},[]);A.useEffect(()=>{const F=Q=>{const L=k.current;if(L.dragging&&(B.current.offX=L.startOffX+(Q.clientX-L.sx),B.current.offY=L.startOffY+(Q.clientY-L.sy),nl()),j.current&&h.w>0&&O.current){const W=j.current.getBoundingClientRect(),Ul=B.current,xl=Sh(Q.clientX-W.left,Q.clientY-W.top,Ul.scale,Ul.offX,Ul.offY,h.w,h.h);O.current.textContent=hf(xl.ns,xl.ew)}},P=()=>{k.current.dragging=!1};return window.addEventListener("mousemove",F),window.addEventListener("mouseup",P),()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",P)}},[nl,h.w,h.h]);const J=A.useRef(null);A.useEffect(()=>{if(!U||h.w===0||!j.current||J.current===U)return;const F=f.find(Ul=>Ul.character_name===U);if(!F)return;J.current=U;const{x:P,y:Q}=xn(F.ew,F.ns,h.w,h.h),L=j.current.getBoundingClientRect(),W=3;B.current={scale:Math.min(_d,Math.max(Ed,W)),offX:L.width/2-P*W,offY:L.height/2-Q*W},nl()},[U,f,h.w,h.h,nl]),A.useEffect(()=>{U||(J.current=null)},[U]);const Ml=A.useCallback((F,P,Q)=>{S(F?{x:P,y:Q,player:F}:null)},[]);return d.jsxs("div",{className:"ml-map-container",ref:j,onWheel:Sl,onMouseDown:K,children:[d.jsxs("div",{ref:N,className:"ml-map-group",children:[d.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:ml,draggable:!1}),h.w>0&&d.jsxs(d.Fragment,{children:[d.jsx(xh,{imgW:h.w,imgH:h.h,enabled:o}),d.jsx(Ud,{imgW:h.w,imgH:h.h,getColor:z}),d.jsx(Od,{players:f,imgW:h.w,imgH:h.h,getColor:z,onHover:Ml,onSelect:T,selectedPlayer:U}),d.jsx(Ah,{imgW:h.w,imgH:h.h,enabled:M})]})]}),C&&d.jsxs("div",{className:"ml-tooltip",style:{left:C.x+12,top:C.y-10},children:[d.jsx("strong",{children:C.player.character_name}),d.jsx("br",{}),hf(C.player.ns,C.player.ew),d.jsx("br",{}),C.player.kills_per_hour," kph Β· ",(Vl=C.player.kills)==null?void 0:Vl.toLocaleString()," kills"]}),d.jsx("div",{className:"ml-coords",ref:O})]})},Cd=pn.memo(({player:f,vitals:z,color:T,onSelect:o,isSelected:M})=>{var C,S;const{openWindow:U}=zn(),j=(f.vt_state||"idle").toLowerCase(),N=j==="combat"||j==="hunt",h=(f.total_rares??0)>0?Math.round((f.total_kills??0)/(f.total_rares??1)).toLocaleString():null,p=f.character_name;return d.jsxs("li",{className:`ml-player-row ${M?"ml-player-selected":""}`,style:{borderLeftColor:T},children:[d.jsxs("div",{className:"ml-pr-header",onClick:o,children:[d.jsx("span",{className:"ml-pr-name",children:p}),d.jsx("span",{className:"ml-pr-coords",children:hf(f.ns,f.ew)})]}),d.jsxs("div",{className:"ml-pr-vitals",children:[d.jsx("div",{className:"ml-vital-bar hp",children:d.jsx("div",{className:"ml-vital-fill",style:{width:`${(z==null?void 0:z.health_percentage)??0}%`}})}),d.jsx("div",{className:"ml-vital-bar sta",children:d.jsx("div",{className:"ml-vital-fill",style:{width:`${(z==null?void 0:z.stamina_percentage)??0}%`}})}),d.jsx("div",{className:"ml-vital-bar mana",children:d.jsx("div",{className:"ml-vital-fill",style:{width:`${(z==null?void 0:z.mana_percentage)??0}%`}})})]}),d.jsxs("div",{className:"ml-pr-grid",children:[d.jsxs("span",{className:"ml-gs",title:"Session kills",children:["βš”οΈ ",((C=f.kills)==null?void 0:C.toLocaleString())??0]}),d.jsxs("span",{className:"ml-gs",title:"Total kills",children:["πŸ† ",(f.total_kills??0).toLocaleString()]}),d.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[f.kills_per_hour??"0"," ",d.jsx("span",{className:"ml-suffix",children:"KPH"})]}),d.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["πŸ’Ž ",f.session_rares??0," / ",f.total_rares??0]}),d.jsx("span",{className:"ml-gs",title:"Kills per rare",children:h?d.jsxs(d.Fragment,{children:["πŸ“Š ",h," ",d.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),d.jsx("span",{className:`ml-meta-pill ${N?"active":j!=="idle"&&j!=="default"&&j!==""?"other":""}`,children:f.vt_state||"idle"}),d.jsxs("span",{className:"ml-gs",title:"Online time",children:["πŸ• ",((S=f.onlinetime)==null?void 0:S.replace(/^00\./,""))??"--"]}),d.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",f.deaths??"0"]}),d.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[d.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),f.prismatic_taper_count??"0"]})]}),d.jsxs("div",{className:"ml-pr-buttons",children:[d.jsx("button",{className:"ml-btn accent",onClick:()=>U(`chat-${p}`,`Chat: ${p}`,p),children:"Chat"}),d.jsx("button",{className:"ml-btn accent",onClick:()=>U(`stats-${p}`,`Stats: ${p}`,p),children:"Stats"}),d.jsx("button",{className:"ml-btn accent",onClick:()=>U(`inv-${p}`,`Inventory: ${p}`,p),children:"Inv"}),d.jsx("button",{className:"ml-btn",onClick:()=>U(`char-${p}`,`Character: ${p}`,p),children:"Char"}),d.jsx("button",{className:"ml-btn",onClick:()=>U(`combat-${p}`,`Combat: ${p}`,p),children:"Combat"}),d.jsx("button",{className:"ml-btn",onClick:()=>U(`radar-${p}`,`Radar: ${p}`,p),children:"Radar"})]})]})});Cd.displayName="PlayerRow";const _h=({players:f,vitals:z,getColor:T,onSelect:o,selectedPlayer:M})=>{const U=A.useRef(null),[j,N]=A.useState(!1),h=A.useCallback(()=>{U.current&&N(U.current.scrollTop>200)},[]);return d.jsxs("div",{style:{position:"relative",flex:1,minHeight:0},children:[d.jsx("ul",{className:"ml-player-list",ref:U,onScroll:h,children:f.map(p=>d.jsx(Cd,{player:p,vitals:z.get(p.character_name)??null,color:T(p.character_name),onSelect:()=>o(p.character_name),isSelected:M===p.character_name},p.character_name))}),j&&d.jsx("button",{onClick:()=>{var p;(p=U.current)==null||p.scrollTo({top:0,behavior:"smooth"})},style:{position:"absolute",bottom:8,right:8,width:28,height:28,borderRadius:"50%",background:"rgba(68,136,255,0.2)",border:"1px solid rgba(68,136,255,0.4)",color:"#6af",cursor:"pointer",fontSize:"0.8rem",display:"flex",alignItems:"center",justifyContent:"center"},children:"β–²"})]})},Eh=[{key:"name",label:"Name"},{key:"kph",label:"KPH"},{key:"skills",label:"S.Kills"},{key:"srares",label:"S.Rares"},{key:"tkills",label:"T.Kills"},{key:"kpr",label:"KPR"}],Mh=({value:f,onChange:z})=>d.jsx("div",{className:"ml-sort-buttons",children:Eh.map(T=>d.jsx("button",{className:`ml-sort-btn ${f===T.key?"active":""}`,onClick:()=>z(T.key),children:T.label},T.key))}),Dh=()=>At("/live"),jh=()=>At("/combat-stats"),Nh=()=>At("/server-health"),Oh=()=>At("/total-rares"),Uh=()=>At("/total-kills"),vy=(f,z)=>yf("/agent/ask",{message:f,session_id:z}),gy=()=>yf("/agent/sessions/new",{}),Sy=f=>At(`/agent/sessions/${encodeURIComponent(f)}/history`),Ch=()=>At("/me");async function Rh(){await fetch("/api/logout",{credentials:"include",redirect:"manual"}),window.location.href="/login"}const by=()=>At("/api-admin/users"),py=(f,z,T)=>yf("/api-admin/users",{username:f,password:z,is_admin:T}),zy=(f,z)=>bh(`/api-admin/users/${f}`,z),xy=f=>ph(`/api-admin/users/${f}`);function Hh(){const[f,z]=A.useState(null),[T,o]=A.useState(!0);return A.useEffect(()=>{let M=!1;return Ch().then(U=>{M||z(U)}).catch(()=>{M||z(null)}).finally(()=>{M||o(!1)}),()=>{M=!0}},[]),{user:f,loading:T}}const Bh=()=>{const{openWindow:f}=zn(),{user:z}=Hh(),T=!!(z!=null&&z.is_admin),o=A.useCallback(async()=>{if(confirm("Log out?"))try{await Rh()}catch{window.location.href="/login"}},[]);return d.jsxs("div",{className:"ml-tool-links",children:[d.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>f("agent","Overlord Assistant"),children:"πŸ€– Assistant"}),d.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},title:"Opens the player dashboard in a new tab",onClick:()=>window.open("/?view=dashboard","_blank","noopener"),children:"πŸ‘₯ Dashboard β†—"}),d.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>f("queststatus","Quest Status"),children:"πŸ“œ Quests"}),d.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>f("issues","Issues Board"),children:"πŸ“‹ Issues"}),d.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>f("vitalsharing","Vital Sharing"),children:"🀝 Vitals"}),d.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>f("combatpicker","Combat Stats"),children:"βš”οΈ Combat"}),T&&d.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>f("adminusers","Admin Β· Users"),children:"πŸ›‘οΈ Admin"}),d.jsxs("span",{className:"ml-tool-link ml-tool-link-logout",style:{cursor:"pointer"},onClick:o,title:z?`Logged in as ${z.username}`:"Log out",children:["πŸšͺ Log out",z?` (${z.username})`:""]})]})},qh=({players:f,vitals:z,serverHealth:T,totalRares:o,totalKills:M,getColor:U,onSelectPlayer:j,showHeatmap:N,showPortals:h,onToggleHeatmap:p,onTogglePortals:C,version:S,selectedPlayer:O})=>{var F,P;const[B,k]=A.useState("name"),[nl,ml]=A.useState(""),Sl=A.useMemo(()=>f.reduce((Q,L)=>Q+(parseInt(L.kills_per_hour)||0),0),[f]),K=((F=T==null?void 0:T.status)==null?void 0:F.toLowerCase())==="online"||((P=T==null?void 0:T.status)==null?void 0:P.toLowerCase())==="up",J=A.useDeferredValue(f),Ml=A.useDeferredValue(z),Vl=A.useMemo(()=>{let Q=[...J];switch(nl&&(Q=Q.filter(L=>L.character_name.toLowerCase().startsWith(nl.toLowerCase()))),B){case"kph":Q.sort((L,W)=>(parseInt(W.kills_per_hour)||0)-(parseInt(L.kills_per_hour)||0));break;case"skills":Q.sort((L,W)=>(W.kills||0)-(L.kills||0));break;case"srares":Q.sort((L,W)=>(W.session_rares??0)-(L.session_rares??0));break;case"tkills":Q.sort((L,W)=>(W.total_kills??0)-(L.total_kills??0));break;case"kpr":Q.sort((L,W)=>{const Ul=(L.total_kills??0)/Math.max(1,L.total_rares??1),xl=(W.total_kills??0)/Math.max(1,W.total_rares??1);return Ul-xl});break;default:Q.sort((L,W)=>L.character_name.localeCompare(W.character_name))}return Q},[J,B,nl]);return d.jsxs("div",{className:"ml-sidebar",children:[S&&d.jsxs("div",{className:"ml-version",children:["v",S]}),d.jsx("div",{className:"ml-sidebar-header",children:d.jsxs("span",{className:"ml-sidebar-title",style:{cursor:"pointer"},onClick:()=>{const Q=document.createElement("div");Q.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000;z-index:999999;display:flex;align-items:center;justify-content:center;";const L=document.createElement("video");L.src="/rick.mp4",L.autoplay=!0,L.loop=!0,L.style.cssText="width:100vw;height:100vh;object-fit:cover;",Q.appendChild(L),document.body.appendChild(Q),document.body.style.animation="ml-shake 0.05s 30";const W=document.createElement("style");W.textContent="@keyframes ml-shake{0%,100%{transform:translate(0) rotate(0)}25%{transform:translate(-15px,10px) rotate(-2deg)}50%{transform:translate(15px,-10px) rotate(2deg)}75%{transform:translate(-10px,-15px) rotate(-1deg)}} @keyframes ml-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}",document.head.appendChild(W),setTimeout(()=>{Q.style.animation="ml-spin 3s linear infinite"},1500),L.play().catch(()=>{})},children:["Active Mosswart Enjoyers (",f.length,")"]})}),d.jsxs("div",{className:"ml-server-status",children:[d.jsx("span",{className:`ml-status-dot ${K?"online":"offline"}`}),d.jsxs("span",{className:"ml-status-text",children:["Coldeve ",K?"Online":"Offline"]}),(T==null?void 0:T.player_count)!=null&&d.jsxs("span",{className:"ml-status-detail",children:["πŸ‘₯ ",T.player_count]}),(T==null?void 0:T.latency_ms)!=null&&d.jsxs("span",{className:"ml-status-detail",children:[Math.round(T.latency_ms),"ms"]}),(T==null?void 0:T.uptime_seconds)!=null&&d.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(T.uptime_seconds/3600),"h"]})]}),d.jsxs("div",{className:"ml-counters",children:[d.jsxs("div",{className:"ml-counter rares",children:[d.jsx("span",{className:"ml-counter-val",children:o}),d.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),d.jsxs("div",{className:`ml-counter kph ${Sl>5e3?"ultra":""}`,children:[d.jsx("span",{className:"ml-counter-val",children:Sl.toLocaleString()}),d.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),d.jsxs("div",{className:"ml-counter kills",children:[d.jsx("span",{className:"ml-counter-val",children:M.toLocaleString()}),d.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),d.jsxs("div",{className:"ml-tool-links",children:[d.jsx("a",{href:"/inventory.html",target:"_blank",className:"ml-tool-link",children:"πŸ” Inv Search"}),d.jsx("a",{href:"/suitbuilder.html",target:"_blank",className:"ml-tool-link",children:"πŸ›‘οΈ Suitbuilder"}),d.jsx("a",{href:"/debug.html",target:"_blank",className:"ml-tool-link",children:"πŸ› Debug"})]}),d.jsx(Bh,{}),d.jsxs("div",{className:"ml-toggles",children:[d.jsxs("label",{className:"ml-toggle-label",children:[d.jsx("input",{type:"checkbox",checked:N,onChange:Q=>p(Q.target.checked)}),d.jsx("span",{children:"Spawn Heatmap"})]}),d.jsxs("label",{className:"ml-toggle-label",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:Q=>C(Q.target.checked)}),d.jsx("span",{children:"Portals"})]})]}),d.jsx("div",{style:{borderTop:"1px solid #333",marginTop:4,paddingTop:4}}),d.jsx(Mh,{value:B,onChange:k}),d.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:nl,onChange:Q=>ml(Q.target.value)}),d.jsx(_h,{players:Vl,vitals:Ml,getColor:U,onSelect:j,selectedPlayer:O})]})},Yh="modulepreload",Xh=function(f){return"/"+f},Md={},St=function(z,T,o){let M=Promise.resolve();if(T&&T.length>0){let j=function(p){return Promise.all(p.map(C=>Promise.resolve(C).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};document.getElementsByTagName("link");const N=document.querySelector("meta[property=csp-nonce]"),h=(N==null?void 0:N.nonce)||(N==null?void 0:N.getAttribute("nonce"));M=j(T.map(p=>{if(p=Xh(p),p in Md)return;Md[p]=!0;const C=p.endsWith(".css"),S=C?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${S}`))return;const O=document.createElement("link");if(O.rel=C?"stylesheet":Yh,C||(O.as="script"),O.crossOrigin="",O.href=p,h&&O.setAttribute("nonce",h),document.head.appendChild(O),C)return new Promise((B,k)=>{O.addEventListener("load",B),O.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${p}`)))})}))}function U(j){const N=new Event("vite:preloadError",{cancelable:!0});if(N.payload=j,window.dispatchEvent(N),!N.defaultPrevented)throw j}return M.then(j=>{for(const N of j||[])N.status==="rejected"&&U(N.reason);return z().catch(U)})},Rd=({id:f,title:z,zIndex:T,width:o=700,height:M=340,children:U})=>{const{closeWindow:j,bringToFront:N}=zn(),h=A.useRef(null),p=A.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),C=A.useRef({resizing:!1,sx:0,sy:0,sw:0,sh:0}),S=A.useRef({x:420,y:10+Math.random()*40}),[O,B]=A.useState({w:o,h:M}),k=A.useCallback(ml=>{var K;ml.preventDefault(),N(f);const Sl=(K=h.current)==null?void 0:K.getBoundingClientRect();Sl&&(p.current={dragging:!0,sx:ml.clientX,sy:ml.clientY,ox:Sl.left,oy:Sl.top})},[f,N]),nl=A.useCallback(ml=>{ml.preventDefault(),ml.stopPropagation(),C.current={resizing:!0,sx:ml.clientX,sy:ml.clientY,sw:O.w,sh:O.h}},[O.w,O.h]);return A.useEffect(()=>{const ml=K=>{const J=p.current;J.dragging&&h.current&&(S.current.x=J.ox+(K.clientX-J.sx),S.current.y=J.oy+(K.clientY-J.sy),h.current.style.left=`${S.current.x}px`,h.current.style.top=`${S.current.y}px`);const Ml=C.current;if(Ml.resizing){const Vl=Math.max(300,Ml.sw+(K.clientX-Ml.sx)),F=Math.max(200,Ml.sh+(K.clientY-Ml.sy));B({w:Vl,h:F})}},Sl=()=>{p.current.dragging=!1,C.current.resizing=!1};return window.addEventListener("mousemove",ml),window.addEventListener("mouseup",Sl),()=>{window.removeEventListener("mousemove",ml),window.removeEventListener("mouseup",Sl)}},[]),d.jsxs("div",{ref:h,className:"ml-window",style:{zIndex:T,width:O.w,height:O.h,left:S.current.x,top:S.current.y},onMouseDown:()=>N(f),children:[d.jsxs("div",{className:"ml-window-header",onMouseDown:k,children:[d.jsx("span",{className:"ml-window-title",children:z}),d.jsx("button",{className:"ml-window-close",onClick:()=>j(f),children:"Γ—"})]}),d.jsx("div",{className:"ml-window-content",children:U}),d.jsx("div",{className:"ml-window-resize",onMouseDown:nl})]})},Gh={0:"#00FF00",2:"#FFFFFF",3:"#FF0000",4:"#FFFFFF",5:"#33CCFF",6:"#CCFF99",7:"#00FFFF",14:"#FFD700",15:"#FF69B4",17:"#AAAAFF",18:"#88FF88",21:"#FF8888",22:"#FFAA66"},Hd=50,Bd=f=>`mo-chat-history-${f}`;function Qh(f){try{const z=localStorage.getItem(Bd(f));return z?JSON.parse(z):[]}catch{return[]}}function Vh(f,z){try{localStorage.setItem(Bd(f),JSON.stringify(z.slice(-Hd)))}catch{}}const Zh=({id:f,charName:z,zIndex:T,messages:o,socket:M})=>{const U=A.useRef(null),[j,N]=A.useState(""),[h,p]=A.useState(!1),C=A.useRef(Qh(z)),S=A.useRef(-1),O=A.useRef(""),B=A.useRef(!1);A.useEffect(()=>{const K=U.current;K&&(B.current?p(!0):(K.scrollTop=K.scrollHeight,p(!1)))},[o.length]);const k=A.useCallback(()=>{const K=U.current;if(!K)return;const J=K.scrollHeight-K.scrollTop-K.clientHeight<30;B.current=!J,J&&p(!1)},[]),nl=A.useCallback(()=>{const K=U.current;K&&(K.scrollTop=K.scrollHeight,B.current=!1,p(!1))},[]),ml=A.useCallback(K=>{K.preventDefault();const J=j.trim();!J||!M||M.readyState!==WebSocket.OPEN||(M.send(JSON.stringify({player_name:z,command:J})),C.current.push(J),C.current.length>Hd&&C.current.shift(),Vh(z,C.current),S.current=-1,O.current="",N(""),B.current=!1)},[j,M,z]),Sl=A.useCallback(K=>{const J=C.current;if(J.length!==0){if(K.key==="ArrowUp")K.preventDefault(),S.current===-1?(O.current=j,S.current=J.length-1):S.current>0&&S.current--,N(J[S.current]);else if(K.key==="ArrowDown"){if(K.preventDefault(),S.current===-1)return;S.currentd.jsx("div",{className:"ml-chat-line",style:{color:Gh[K.color??2]??"#ddd"},children:K.text},J))}),h&&d.jsx("div",{onClick:nl,style:{padding:"3px 0",textAlign:"center",fontSize:"0.65rem",color:"#6af",background:"#1a2a3a",cursor:"pointer",borderTop:"1px solid #334"},children:"β–Ό New messages below"}),d.jsx("form",{className:"ml-chat-form",onSubmit:ml,children:d.jsx("input",{className:"ml-chat-input",value:j,onChange:K=>N(K.target.value),onKeyDown:Sl,placeholder:"Enter chat..."})})]})},Lh=A.lazy(()=>St(()=>import("./StatsWindow-DKBKOgS_.js"),__vite__mapDeps([0,1])).then(f=>({default:f.StatsWindow}))),Kh=A.lazy(()=>St(()=>import("./CharacterWindow-B7YBkp-L.js"),__vite__mapDeps([2,1])).then(f=>({default:f.CharacterWindow}))),Jh=A.lazy(()=>St(()=>import("./InventoryWindow-ZxZJFETP.js"),__vite__mapDeps([3,1])).then(f=>({default:f.InventoryWindow}))),wh=A.lazy(()=>St(()=>import("./RadarWindow-DwR1V8eq.js"),__vite__mapDeps([4,1])).then(f=>({default:f.RadarWindow}))),kh=A.lazy(()=>St(()=>import("./CombatStatsWindow-D1mRyTZ9.js"),__vite__mapDeps([5,1])).then(f=>({default:f.CombatStatsWindow}))),Wh=A.lazy(()=>St(()=>import("./CombatPickerWindow-DO9GiqPu.js"),__vite__mapDeps([6,1])).then(f=>({default:f.CombatPickerWindow}))),$h=A.lazy(()=>St(()=>import("./IssuesWindow-BxSy4plP.js"),__vite__mapDeps([7,1])).then(f=>({default:f.IssuesWindow}))),Fh=A.lazy(()=>St(()=>import("./VitalSharingWindow-Cqg_448n.js"),__vite__mapDeps([8,1])).then(f=>({default:f.VitalSharingWindow}))),Ih=A.lazy(()=>St(()=>import("./QuestStatusWindow-DCQZBsLK.js"),__vite__mapDeps([9,1])).then(f=>({default:f.QuestStatusWindow}))),Ph=A.lazy(()=>St(()=>Promise.resolve().then(()=>ry),void 0).then(f=>({default:f.PlayerDashboardWindow}))),ly=A.lazy(()=>St(()=>import("./AgentWindow-Bwz75p50.js"),__vite__mapDeps([10,1])).then(f=>({default:f.AgentWindow}))),ty=A.lazy(()=>St(()=>import("./AdminUsersWindow-DKxAPN9c.js"),__vite__mapDeps([11,1])).then(f=>({default:f.AdminUsersWindow}))),qd=pn.memo(({characters:f,chatMessages:z,nearbyObjects:T,inventoryVersions:o,equipmentCantrips:M,characterStats:U,socket:j})=>{const{windows:N}=zn();return d.jsx(A.Suspense,{fallback:null,children:N.map(h=>{var S;const p=h.charName??"";switch(h.id.split("-")[0]){case"chat":return d.jsx(Zh,{id:h.id,charName:p,zIndex:h.zIndex,messages:z.get(p)??[],socket:j},h.id);case"stats":return d.jsx(Lh,{id:h.id,charName:p,zIndex:h.zIndex},h.id);case"char":return d.jsx(Kh,{id:h.id,charName:p,zIndex:h.zIndex,vitals:((S=f.get(p))==null?void 0:S.vitals)??void 0,liveStats:U.get(p)},h.id);case"inv":return d.jsx(Jh,{id:h.id,charName:p,zIndex:h.zIndex,inventoryVersion:o.get(p)??0,equipmentCantrips:M.get(p)},h.id);case"radar":return d.jsx(wh,{id:h.id,charName:p,zIndex:h.zIndex,socket:j,radarData:T.get(p)??null},h.id);case"combat":return d.jsx(kh,{id:h.id,charName:p,zIndex:h.zIndex},h.id);case"combatpicker":return d.jsx(Wh,{id:h.id,zIndex:h.zIndex,characters:f},h.id);case"issues":return d.jsx($h,{id:h.id,zIndex:h.zIndex},h.id);case"vitalsharing":return d.jsx(Fh,{id:h.id,zIndex:h.zIndex},h.id);case"queststatus":return d.jsx(Ih,{id:h.id,zIndex:h.zIndex},h.id);case"playerdash":return d.jsx(Ph,{id:h.id,zIndex:h.zIndex,characters:f},h.id);case"agent":return d.jsx(ly,{id:h.id,zIndex:h.zIndex},h.id);case"adminusers":return d.jsx(ty,{id:h.id,zIndex:h.zIndex},h.id);default:return null}})})});qd.displayName="WindowRenderer";let ay=0;const ey=({recentRares:f})=>{const[z,T]=A.useState([]),[o,M]=A.useState(0),[U,j]=A.useState([]);A.useEffect(()=>{if(f.length>o&&o>0){const h=f.slice(0,f.length-o);for(const p of h){const C=++ay;T(S=>[...S,{key:C,charName:p.character_name,rareName:p.name,exiting:!1}]),N();try{const S=new AudioContext,O=S.createOscillator(),B=S.createGain();O.connect(B),B.connect(S.destination),O.frequency.value=880,O.type="sine",B.gain.value=.3,O.start(),B.gain.exponentialRampToValueAtTime(.001,S.currentTime+.5),O.stop(S.currentTime+.5)}catch{}setTimeout(()=>{T(S=>S.map(O=>O.key===C?{...O,exiting:!0}:O)),setTimeout(()=>{T(S=>S.filter(O=>O.key!==C))},500)},6e3)}}M(f.length)},[f.length]);const N=A.useCallback(()=>{const h=Date.now(),p=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],C=Array.from({length:30},(S,O)=>{const B=Math.PI*2*O/30+(Math.random()-.5)*.5,k=100+Math.random()*200;return{dx:Math.cos(B)*k,dy:Math.sin(B)*k-50,color:p[Math.floor(Math.random()*p.length)]}});j(S=>[...S,{id:h,particles:C}]),setTimeout(()=>j(S=>S.filter(O=>O.id!==h)),2200)},[]);return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"ml-rare-notifications",children:z.map(h=>d.jsxs("div",{className:`ml-rare-notif ${h.exiting?"exiting":""}`,children:[d.jsx("div",{className:"ml-rare-notif-title",children:"πŸŽ† LEGENDARY RARE! πŸŽ†"}),d.jsx("div",{className:"ml-rare-notif-name",children:h.rareName}),d.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),d.jsx("div",{className:"ml-rare-notif-char",children:h.charName})]},h.key))}),d.jsx("div",{className:"ml-fireworks",children:U.map(h=>d.jsx(pn.Fragment,{children:h.particles.map((p,C)=>d.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:p.color,"--dx":`${p.dx}px`,"--dy":`${p.dy+200}px`}},C))},h.id))})]})};let ny=0;const uy=({deathAlerts:f})=>{const[z,T]=A.useState([]),o=A.useRef(0);return A.useEffect(()=>{if(f.length>o.current&&o.current>0){const M=f.slice(o.current);for(const U of M){const j=++ny;T(N=>[...N,{key:j,alert:U,exiting:!1}]);try{const N=new AudioContext,h=N.createOscillator(),p=N.createGain();h.connect(p),p.connect(N.destination),h.frequency.value=440,h.type="sawtooth",p.gain.value=.2,h.start(),p.gain.exponentialRampToValueAtTime(.001,N.currentTime+.8),h.stop(N.currentTime+.8)}catch{}setTimeout(()=>{T(N=>N.map(h=>h.key===j?{...h,exiting:!0}:h)),setTimeout(()=>T(N=>N.filter(h=>h.key!==j)),500)},8e3)}}o.current=f.length},[f.length]),z.length===0?null:d.jsx("div",{style:{position:"fixed",top:70,left:"50%",transform:"translateX(-50%)",zIndex:99999,display:"flex",flexDirection:"column",gap:6,pointerEvents:"none"},children:z.map(M=>d.jsxs("div",{style:{background:"linear-gradient(135deg, #2a0a0a, #1a0000)",border:"2px solid #cc4444",borderRadius:8,padding:"12px 24px",textAlign:"center",boxShadow:"0 0 30px rgba(204, 68, 68, 0.3)",animation:M.exiting?"ml-notif-out 0.5s ease-in forwards":"ml-notif-in 0.5s ease-out"},children:[d.jsx("div",{style:{fontSize:"1.2rem",fontWeight:800,color:"#ff4444"},children:"☠️ CHARACTER DIED ☠️"}),d.jsx("div",{style:{fontSize:"1rem",fontWeight:600,color:"#fff",marginTop:2},children:M.alert.character_name}),d.jsxs("div",{style:{fontSize:"0.8rem",color:"#c88",marginTop:2},children:["Vitae: ",M.alert.vitae,"%"]})]},M.key))})},Dd=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf","#ff4444","#44ff44","#4444ff","#ffff44","#ff44ff","#44ffff","#ff8844","#88ff44","#4488ff","#ff4488","#cc3333","#33cc33","#3333cc","#cccc33","#cc33cc","#33cccc","#cc6633","#66cc33","#3366cc","#cc3366","#ff6666","#66ff66","#6666ff","#ffff66","#ff66ff","#66ffff","#ffaa66","#aaff66","#66aaff","#ff66aa","#990099","#009900","#000099","#990000","#009999","#999900","#aa5500","#55aa00","#0055aa","#aa0055","#ffaaaa","#aaffaa","#aaaaff","#ffffaa","#ffaaff","#aaffff","#ffccaa","#ccffaa","#aaccff","#ffaacc"];function cy(f){let z=0;for(let T=0;T{let M=f.current.get(o);return M||(M=z.current{const z=iy(),[T,o]=A.useState(!1),[M,U]=A.useState(!1),[j,N]=A.useState(null),h=A.useMemo(()=>Array.from(f.characters.values()).filter(B=>B.telemetry).map(B=>B.telemetry),[f.characters]),p=A.useMemo(()=>new Map(Array.from(f.characters.values()).filter(B=>B.vitals).map(B=>[B.name,B.vitals])),[f.characters]),[C,S]=A.useState("");A.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(B=>B.json()).then(B=>S(B.version??"")).catch(()=>{})},[]);const O=A.useCallback(B=>{N(k=>k===B?null:B)},[]);return d.jsx(gh,{children:d.jsxs("div",{className:"ml-layout",children:[d.jsx(qh,{players:h,vitals:p,serverHealth:f.serverHealth,totalRares:f.totalRares,totalKills:f.totalKills,getColor:z,onSelectPlayer:O,showHeatmap:T,showPortals:M,onToggleHeatmap:o,onTogglePortals:U,version:C,selectedPlayer:j}),d.jsx(Th,{players:h,getColor:z,onSelectPlayer:O,showHeatmap:T,showPortals:M,selectedPlayer:j}),d.jsx(qd,{characters:f.characters,chatMessages:f.chatMessages,nearbyObjects:f.nearbyObjects,inventoryVersions:f.inventoryVersions,equipmentCantrips:f.equipmentCantrips,characterStats:f.characterStats,socket:f.socketRef.current}),d.jsx(ey,{recentRares:f.recentRares}),d.jsx(uy,{deathAlerts:f.deathAlerts})]})})};function sy(f){const z=A.useRef(null),T=A.useRef(0),o=A.useRef(f);o.current=f;const M=A.useCallback(()=>{var j;if(((j=z.current)==null?void 0:j.readyState)===WebSocket.OPEN)return;const U=new WebSocket(zh());z.current=U,U.addEventListener("message",N=>{try{const h=JSON.parse(N.data);o.current(h)}catch{}}),U.addEventListener("close",()=>{z.current=null,T.current=window.setTimeout(M,2e3)}),U.addEventListener("error",()=>{U.close()})},[]);return A.useEffect(()=>(M(),()=>{var U;clearTimeout(T.current),(U=z.current)==null||U.close(),z.current=null}),[M]),z}function Yd(){const[f,z]=A.useState(new Map),[T,o]=A.useState(null),[M,U]=A.useState(0),[j,N]=A.useState(0),[h,p]=A.useState([]),C=A.useRef(new Map),[S,O]=A.useState(0),[B,k]=A.useState(new Map),nl=A.useRef(new Map),[ml,Sl]=A.useState(0),K=A.useRef(new Map),[J,Ml]=A.useState(0),[Vl,F]=A.useState([]),[P,Q]=A.useState(new Map),L=A.useRef(f);L.current=f;const W=A.useCallback((g,R)=>{z(G=>{const H=new Map(G),Y=H.get(g)??{name:g,telemetry:null,vitals:null,combat:null,lastUpdate:0};return H.set(g,R(Y)),H})},[]),Ul=A.useCallback(g=>{var R,G;if(g.type){if(g.type==="telemetry"){const H=g;W(H.character_name,Y=>({...Y,telemetry:H,lastUpdate:Date.now()}))}else if(g.type==="vitals"){const H=g,Y=(R=L.current.get(H.character_name))==null?void 0:R.vitals;Y&&(Y.vitae??0)===0&&(H.vitae??0)>0&&F(fl=>[...fl,{character_name:H.character_name,vitae:H.vitae,timestamp:new Date().toISOString()}].slice(-50)),W(H.character_name,fl=>({...fl,vitals:H,lastUpdate:Date.now()}))}else if(g.type==="combat_stats"){const H=g;W(H.character_name,Y=>({...Y,combat:H,lastUpdate:Date.now()}))}else if(g.type==="rare"){const H=g;p(Y=>[H,...Y].slice(0,50))}else if(g.type==="inventory_delta"){const H=g;H.character_name&&k(Y=>{const fl=new Map(Y);return fl.set(H.character_name,(fl.get(H.character_name)??0)+1),fl})}else if(g.type==="character_stats"){const H=g;K.current.set(H.character_name,g),Ml(Y=>Y+1)}else if(g.type==="equipment_cantrip_state"){const H=g;nl.current.set(H.character_name,H),Sl(Y=>Y+1)}else if(g.type==="dungeon_map"){const H=g;H.landblock&&(window.__dungeonMapCache||(window.__dungeonMapCache={}),window.__dungeonMapCache[H.landblock]=H)}else if(g.type==="nearby_objects"){const H=g;if(Q(Y=>{const fl=new Map(Y);return fl.set(H.character_name,H),fl}),H.is_dungeon&&H.landblock&&!((G=window.__dungeonMapCache)!=null&&G[H.landblock])){const Y=xl.current;(Y==null?void 0:Y.readyState)===WebSocket.OPEN&&Y.send(JSON.stringify({type:"request_dungeon_map",landblock:H.landblock}))}}else if(g.type==="chat"){const H=g,Y=C.current.get(H.character_name)??[];Y.push({text:H.text,color:H.color,timestamp:H.timestamp}),Y.length>1e3&&Y.splice(0,Y.length-1e3),C.current.set(H.character_name,Y),O(fl=>fl+1)}}},[W]),xl=sy(Ul);A.useEffect(()=>{const g=async()=>{try{const G=await Dh();z(H=>{var fl;const Y=new Map(H);for(const sl of G.players??[]){const I=Y.get(sl.character_name);Y.set(sl.character_name,{name:sl.character_name,telemetry:sl,vitals:(I==null?void 0:I.vitals)??null,combat:(I==null?void 0:I.combat)??null,lastUpdate:Date.now()})}for(const sl of Y.keys())(fl=G.players)!=null&&fl.some(I=>I.character_name===sl)||Y.delete(sl);return Y})}catch{}};g();const R=setInterval(g,5e3);return()=>clearInterval(R)},[]),A.useEffect(()=>{const g=async()=>{try{const G=await jh();for(const H of G.stats??[])W(H.character_name,Y=>({...Y,combat:{...H,type:"combat_stats"}}))}catch{}};g();const R=setInterval(g,3e4);return()=>clearInterval(R)},[W]),A.useEffect(()=>{const g=async()=>{try{o(await Nh())}catch{}};g();const R=setInterval(g,3e4);return()=>clearInterval(R)},[]),A.useEffect(()=>{const g=async()=>{try{const[G,H]=await Promise.all([Oh(),Uh()]);U(G.all_time??0),N(H.total??0)}catch{}};g();const R=setInterval(g,3e5);return()=>clearInterval(R)},[]);const Nt=A.useMemo(()=>C.current,[S]),Tt=A.useMemo(()=>nl.current,[ml]),bt=A.useMemo(()=>K.current,[J]);return{characters:f,serverHealth:T,totalRares:M,totalKills:j,recentRares:h,chatMessages:Nt,nearbyObjects:P,inventoryVersions:B,equipmentCantrips:Tt,characterStats:bt,deathAlerts:Vl,socketRef:xl}}const vf=({characters:f})=>{const[z,T]=A.useState("kph"),[o,M]=A.useState(!1),U=A.useMemo(()=>{const p=Array.from(f.values()).filter(C=>C.telemetry).map(C=>{var O,B,k;const S=C.telemetry;return{name:C.name,kills:S.kills??0,kph:parseInt(S.kills_per_hour)||0,totalKills:S.total_kills??0,rares:S.total_rares??0,sessionRares:S.session_rares??0,deaths:parseInt(S.deaths)||0,totalDeaths:parseInt(S.total_deaths)||0,uptime:((O=S.onlinetime)==null?void 0:O.replace(/^00\./,""))??"",state:S.vt_state??"idle",tapers:parseInt(S.prismatic_taper_count)||0,hp:((B=C.vitals)==null?void 0:B.health_percentage)??0,vitae:((k=C.vitals)==null?void 0:k.vitae)??0}});return p.sort((C,S)=>{let O=0;switch(z){case"name":O=C.name.localeCompare(S.name);break;case"kills":O=C.kills-S.kills;break;case"kph":O=C.kph-S.kph;break;case"rares":O=C.rares-S.rares;break;case"deaths":O=C.totalDeaths-S.totalDeaths;break;case"uptime":O=C.uptime.localeCompare(S.uptime);break;case"state":O=C.state.localeCompare(S.state);break}return o?O:-O}),p},[f,z,o]),j=p=>{z===p?M(!o):(T(p),M(!1))},N=p=>({padding:"4px 6px",cursor:"pointer",userSelect:"none",color:z===p?"#6af":"#888",fontSize:"0.65rem",fontWeight:600,whiteSpace:"nowrap",borderBottom:"1px solid #444"}),h=p=>z===p?o?" β–²":" β–Ό":"";return d.jsxs("div",{style:{flex:1,overflow:"auto",fontSize:"0.73rem"},children:[d.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[d.jsx("thead",{children:d.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[d.jsxs("th",{style:{...N("name"),textAlign:"left"},onClick:()=>j("name"),children:["Character",h("name")]}),d.jsxs("th",{style:{...N("state"),textAlign:"center"},onClick:()=>j("state"),children:["State",h("state")]}),d.jsxs("th",{style:{...N("kph"),textAlign:"right"},onClick:()=>j("kph"),children:["KPH",h("kph")]}),d.jsxs("th",{style:{...N("kills"),textAlign:"right"},onClick:()=>j("kills"),children:["Session",h("kills")]}),d.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Total"}),d.jsxs("th",{style:{...N("rares"),textAlign:"right"},onClick:()=>j("rares"),children:["Rares",h("rares")]}),d.jsxs("th",{style:{...N("deaths"),textAlign:"right"},onClick:()=>j("deaths"),children:["Deaths",h("deaths")]}),d.jsxs("th",{style:{...N("uptime"),textAlign:"right"},onClick:()=>j("uptime"),children:["Uptime",h("uptime")]}),d.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"HP%"}),d.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Vitae"}),d.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Tapers"})]})}),d.jsx("tbody",{children:U.map(p=>{const C=p.state.toLowerCase(),S=C==="combat"||C==="hunt";return d.jsxs("tr",{style:{borderBottom:"1px solid #1a1a1a"},children:[d.jsx("td",{style:{padding:"3px 6px",color:"#ccc",fontWeight:500,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.name}),d.jsx("td",{style:{textAlign:"center",padding:"3px 6px"},children:d.jsx("span",{style:{fontSize:"0.6rem",padding:"1px 6px",borderRadius:3,background:S?"rgba(68,204,68,0.15)":C==="idle"||C==="default"?"rgba(100,100,100,0.2)":"rgba(204,68,68,0.15)",color:S?"#4c4":C==="idle"||C==="default"?"#888":"#c44"},children:p.state})}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#4c4",fontVariantNumeric:"tabular-nums"},children:p.kph.toLocaleString()}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#ccc",fontVariantNumeric:"tabular-nums"},children:p.kills.toLocaleString()}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:p.totalKills.toLocaleString()}),d.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",color:"#fc0",fontVariantNumeric:"tabular-nums"},children:[p.rares,p.sessionRares>0?` (${p.sessionRares})`:""]}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:p.totalDeaths>0?"#c66":"#555",fontVariantNumeric:"tabular-nums"},children:p.totalDeaths}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:p.uptime}),d.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:p.hp>80?"#4c4":p.hp>40?"#ca0":"#c44"},children:[p.hp.toFixed(0),"%"]}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:p.vitae>0?"#f66":"#333"},children:p.vitae>0?`${p.vitae}%`:""}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:p.tapers.toLocaleString()})]},p.name)})})]}),U.length===0&&d.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No characters online"})]})},oy=({id:f,zIndex:z,characters:T})=>d.jsx(Rd,{id:f,title:"Player Dashboard",zIndex:z,width:850,height:500,children:d.jsx(vf,{characters:T})}),ry=Object.freeze(Object.defineProperty({__proto__:null,PlayerDashboardContent:vf,PlayerDashboardWindow:oy},Symbol.toStringTag,{value:"Module"})),dy=()=>{const f=Yd(),[z,T]=A.useState("");A.useEffect(()=>{const M=document.title;return document.title="Overlord Dashboard",()=>{document.title=M}},[]),A.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(M=>M.json()).then(M=>T(M.version??"")).catch(()=>{})},[]);const o=Array.from(f.characters.values()).filter(M=>M.telemetry).length;return d.jsxs("div",{className:"ml-dashboard-page",children:[d.jsxs("header",{className:"ml-dashboard-header",children:[d.jsx("span",{className:"ml-dashboard-title",children:"πŸ‘₯ Player Dashboard"}),d.jsxs("span",{className:"ml-dashboard-count",children:[o," online"]}),d.jsx("span",{style:{flex:1}}),z&&d.jsxs("span",{className:"ml-dashboard-version",children:["v",z]})]}),d.jsx("main",{className:"ml-dashboard-main",children:d.jsx(vf,{characters:f.characters})})]})};function my(){return new URLSearchParams(window.location.search).get("view")==="dashboard"?d.jsx(dy,{}):d.jsx(hy,{})}function hy(){const f=Yd();return d.jsx(fy,{data:f})}vh.createRoot(document.getElementById("root")).render(d.jsx(A.StrictMode,{children:d.jsx(my,{})}));"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(()=>{});export{Rd as D,At as a,Sy as b,vy as c,gy as d,Hh as e,py as f,zy as g,xy as h,d as j,by as l,A as r,zn as u}; diff --git a/static/index.html b/static/index.html index 91f98daa..a3fcdcca 100644 --- a/static/index.html +++ b/static/index.html @@ -8,9 +8,9 @@ - + - +