From 5f43ddce93d04c19ea20ac037fa378065d0a229e Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 23 May 2026 19:35:09 +0200 Subject: [PATCH] feat(dashboard): click-to-highlight rows + character column auto-sizes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two small UX improvements to the Player Dashboard table (works in both the new-tab fullscreen page and the deprecated in-app window since they share PlayerDashboardContent): 1. Row highlight: click anywhere on a row to highlight it (blue tint + thin outline). Click again to unhighlight. Single selection — useful for tracking one character down a long sorted list. 2. Character column no longer truncates: removed maxWidth/overflow/ textOverflow on the name cell. Column now sizes to the longest character name (still no wrapping; container scrolls horizontally if names are extreme). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../windows/PlayerDashboardWindow.tsx | 18 ++++++++-- ...xAPN9c.js => AdminUsersWindow-CjCV57tE.js} | 2 +- ...ow-Bwz75p50.js => AgentWindow-D4IwDfCh.js} | 2 +- ...7YBkp-L.js => CharacterWindow-DB25PGyW.js} | 2 +- ...iqPu.js => CombatPickerWindow-EVVSrp8z.js} | 2 +- ...RyTZ9.js => CombatStatsWindow-DSDCf8zG.js} | 2 +- ...xZJFETP.js => InventoryWindow-CsRCfFA4.js} | 2 +- ...w-BxSy4plP.js => IssuesWindow-B7wMTxUh.js} | 2 +- ...ZBsLK.js => QuestStatusWindow-BZVZJ6b0.js} | 2 +- ...ow-DwR1V8eq.js => RadarWindow-BWeCin-b.js} | 2 +- ...ow-DKBKOgS_.js => StatsWindow-CIRZXtNg.js} | 2 +- ...448n.js => VitalSharingWindow-Cr06Ao6f.js} | 2 +- static/assets/index-DbyZVOR_.js | 34 +++++++++++++++++++ static/assets/index-d7uW0_CB.js | 34 ------------------- static/index.html | 2 +- 15 files changed, 62 insertions(+), 48 deletions(-) rename static/assets/{AdminUsersWindow-DKxAPN9c.js => AdminUsersWindow-CjCV57tE.js} (98%) rename static/assets/{AgentWindow-Bwz75p50.js => AgentWindow-D4IwDfCh.js} (96%) rename static/assets/{CharacterWindow-B7YBkp-L.js => CharacterWindow-DB25PGyW.js} (99%) rename static/assets/{CombatPickerWindow-DO9GiqPu.js => CombatPickerWindow-EVVSrp8z.js} (92%) rename static/assets/{CombatStatsWindow-D1mRyTZ9.js => CombatStatsWindow-DSDCf8zG.js} (99%) rename static/assets/{InventoryWindow-ZxZJFETP.js => InventoryWindow-CsRCfFA4.js} (99%) rename static/assets/{IssuesWindow-BxSy4plP.js => IssuesWindow-B7wMTxUh.js} (99%) rename static/assets/{QuestStatusWindow-DCQZBsLK.js => QuestStatusWindow-BZVZJ6b0.js} (96%) rename static/assets/{RadarWindow-DwR1V8eq.js => RadarWindow-BWeCin-b.js} (99%) rename static/assets/{StatsWindow-DKBKOgS_.js => StatsWindow-CIRZXtNg.js} (93%) rename static/assets/{VitalSharingWindow-Cqg_448n.js => VitalSharingWindow-Cr06Ao6f.js} (97%) create mode 100644 static/assets/index-DbyZVOR_.js delete mode 100644 static/assets/index-d7uW0_CB.js diff --git a/frontend/src/components/windows/PlayerDashboardWindow.tsx b/frontend/src/components/windows/PlayerDashboardWindow.tsx index 34c68eee..be9cdfa6 100644 --- a/frontend/src/components/windows/PlayerDashboardWindow.tsx +++ b/frontend/src/components/windows/PlayerDashboardWindow.tsx @@ -15,6 +15,9 @@ type SortCol = 'name' | 'kills' | 'kph' | 'rares' | 'deaths' | 'uptime' | 'state export const PlayerDashboardContent: React.FC = ({ characters }) => { const [sortCol, setSortCol] = useState('kph'); const [sortAsc, setSortAsc] = useState(false); + // Click-to-highlight one row at a time. Click again to unhighlight. + // Helps when watching a specific character across a long list. + const [selectedName, setSelectedName] = useState(null); const players = useMemo(() => { const list = Array.from(characters.values()).filter(c => c.telemetry).map(c => { @@ -88,9 +91,20 @@ export const PlayerDashboardContent: React.FC = ({ characters }) = {players.map(p => { const stateLC = p.state.toLowerCase(); const isActive = stateLC === 'combat' || stateLC === 'hunt'; + const isSelected = selectedName === p.name; return ( - - {p.name} + setSelectedName(isSelected ? null : p.name)} + style={{ + borderBottom: '1px solid #1a1a1a', + cursor: 'pointer', + background: isSelected ? 'rgba(102, 170, 255, 0.18)' : undefined, + outline: isSelected ? '1px solid rgba(102, 170, 255, 0.55)' : undefined, + outlineOffset: '-1px', + }} + > + {p.name} {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-DbyZVOR_.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-Bwz75p50.js b/static/assets/AgentWindow-D4IwDfCh.js similarity index 96% rename from static/assets/AgentWindow-Bwz75p50.js rename to static/assets/AgentWindow-D4IwDfCh.js index 634f6bba..966c2dd4 100644 --- a/static/assets/AgentWindow-Bwz75p50.js +++ b/static/assets/AgentWindow-D4IwDfCh.js @@ -1 +1 @@ -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}; +import{r as n,b as w,c as k,d as E,j as t,D as I}from"./index-DbyZVOR_.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-B7YBkp-L.js b/static/assets/CharacterWindow-DB25PGyW.js similarity index 99% rename from static/assets/CharacterWindow-B7YBkp-L.js rename to static/assets/CharacterWindow-DB25PGyW.js index 8575820f..6330042a 100644 --- a/static/assets/CharacterWindow-B7YBkp-L.js +++ b/static/assets/CharacterWindow-DB25PGyW.js @@ -1 +1 @@ -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}; +import{r as f,a as J,j as e,D as K}from"./index-DbyZVOR_.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-DO9GiqPu.js b/static/assets/CombatPickerWindow-EVVSrp8z.js similarity index 92% rename from static/assets/CombatPickerWindow-DO9GiqPu.js rename to static/assets/CombatPickerWindow-EVVSrp8z.js index f1f5a811..a4ea17a6 100644 --- a/static/assets/CombatPickerWindow-DO9GiqPu.js +++ b/static/assets/CombatPickerWindow-EVVSrp8z.js @@ -1 +1 @@ -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}; +import{u as c,j as r,D as d}from"./index-DbyZVOR_.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-D1mRyTZ9.js b/static/assets/CombatStatsWindow-DSDCf8zG.js similarity index 99% rename from static/assets/CombatStatsWindow-D1mRyTZ9.js rename to static/assets/CombatStatsWindow-DSDCf8zG.js index a6db34f2..0fd018c1 100644 --- a/static/assets/CombatStatsWindow-D1mRyTZ9.js +++ b/static/assets/CombatStatsWindow-DSDCf8zG.js @@ -1 +1 @@ -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}; +import{r as A,a as B,j as t,D as L}from"./index-DbyZVOR_.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-ZxZJFETP.js b/static/assets/InventoryWindow-CsRCfFA4.js similarity index 99% rename from static/assets/InventoryWindow-ZxZJFETP.js rename to static/assets/InventoryWindow-CsRCfFA4.js index 1b43a01f..c2e91230 100644 --- a/static/assets/InventoryWindow-ZxZJFETP.js +++ b/static/assets/InventoryWindow-CsRCfFA4.js @@ -1 +1 @@ -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}; +import{r as _,a as T,j as n,D as Q}from"./index-DbyZVOR_.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-BxSy4plP.js b/static/assets/IssuesWindow-B7wMTxUh.js similarity index 99% rename from static/assets/IssuesWindow-BxSy4plP.js rename to static/assets/IssuesWindow-B7wMTxUh.js index ec6ebeec..c0565692 100644 --- a/static/assets/IssuesWindow-BxSy4plP.js +++ b/static/assets/IssuesWindow-B7wMTxUh.js @@ -1 +1 @@ -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}; +import{r as n,a as W,j as e,D as L}from"./index-DbyZVOR_.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/QuestStatusWindow-DCQZBsLK.js b/static/assets/QuestStatusWindow-BZVZJ6b0.js similarity index 96% rename from static/assets/QuestStatusWindow-DCQZBsLK.js rename to static/assets/QuestStatusWindow-BZVZJ6b0.js index e20396fb..ff0cd80c 100644 --- a/static/assets/QuestStatusWindow-DCQZBsLK.js +++ b/static/assets/QuestStatusWindow-BZVZJ6b0.js @@ -1 +1 @@ -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}; +import{r as c,j as t,D as u,a as f}from"./index-DbyZVOR_.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-DwR1V8eq.js b/static/assets/RadarWindow-BWeCin-b.js similarity index 99% rename from static/assets/RadarWindow-DwR1V8eq.js rename to static/assets/RadarWindow-BWeCin-b.js index bcb00bd6..65735e76 100644 --- a/static/assets/RadarWindow-DwR1V8eq.js +++ b/static/assets/RadarWindow-BWeCin-b.js @@ -1 +1 @@ -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}; +import{r as x,j as c,D as ne}from"./index-DbyZVOR_.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-DKBKOgS_.js b/static/assets/StatsWindow-CIRZXtNg.js similarity index 93% rename from static/assets/StatsWindow-DKBKOgS_.js rename to static/assets/StatsWindow-CIRZXtNg.js index d1ec7e60..6eae5b0a 100644 --- a/static/assets/StatsWindow-DKBKOgS_.js +++ b/static/assets/StatsWindow-CIRZXtNg.js @@ -1 +1 @@ -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}; +import{r as o,j as t,D as d}from"./index-DbyZVOR_.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-Cqg_448n.js b/static/assets/VitalSharingWindow-Cr06Ao6f.js similarity index 97% rename from static/assets/VitalSharingWindow-Cqg_448n.js rename to static/assets/VitalSharingWindow-Cr06Ao6f.js index 71b342ed..808fa8b4 100644 --- a/static/assets/VitalSharingWindow-Cqg_448n.js +++ b/static/assets/VitalSharingWindow-Cr06Ao6f.js @@ -1 +1 @@ -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}; +import{r as n,j as t,D as x,a as m}from"./index-DbyZVOR_.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-DbyZVOR_.js b/static/assets/index-DbyZVOR_.js new file mode 100644 index 00000000..db8e2a9e --- /dev/null +++ b/static/assets/index-DbyZVOR_.js @@ -0,0 +1,34 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsWindow-CIRZXtNg.js","assets/react-yfL0ty4i.js","assets/CharacterWindow-DB25PGyW.js","assets/InventoryWindow-CsRCfFA4.js","assets/RadarWindow-BWeCin-b.js","assets/CombatStatsWindow-DSDCf8zG.js","assets/CombatPickerWindow-EVVSrp8z.js","assets/IssuesWindow-B7wMTxUh.js","assets/VitalSharingWindow-Cr06Ao6f.js","assets/QuestStatusWindow-BZVZJ6b0.js","assets/AgentWindow-D4IwDfCh.js","assets/AdminUsersWindow-CjCV57tE.js"])))=>i.map(i=>d[i]); +import{r as Nd,g as fh,a as sh}from"./react-yfL0ty4i.js";(function(){const p=document.createElement("link").relList;if(p&&p.supports&&p.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 A(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=A(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"),p=Symbol.for("react.fragment");function A(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 O in M)O!=="key"&&(U[O]=M[O])}else U=M;return M=U.ref,{$$typeof:f,type:o,key:j,ref:M!==void 0?M:null,props:U}}return Sn.Fragment=p,Sn.jsx=A,Sn.jsxs=A,Sn}var pd;function rh(){return pd||(pd=1,of.exports=oh()),of.exports}var d=rh(),x=Nd();const pn=fh(x);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 p(S,R){var G=S.length;S.push(R);l:for(;0>>1,Y=S[H];if(0>>1;HM(I,G))RlM(_t,I)?(S[H]=_t,S[Rl]=G,H=Rl):(S[H]=I,S[ol]=G,H=ol);else if(RlM(_t,G))S[H]=_t,S[Rl]=G,H=Rl;else break l}}return R}function M(S,R){var G=S.sortIndex-R.sortIndex;return G!==0?G:S.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,O=j.now();f.unstable_now=function(){return j.now()-O}}var h=[],_=[],B=1,y=null,N=3,C=!1,Q=!1,P=!1,fl=!1,Sl=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function Ml(S){for(var R=A(_);R!==null;){if(R.callback===null)o(_);else if(R.startTime<=S)o(_),R.sortIndex=R.expirationTime,p(h,R);else break;R=A(_)}}function Vl(S){if(P=!1,Ml(S),!Q)if(A(h)!==null)Q=!0,F||(F=!0,xl());else{var R=A(_);R!==null&&bt(Vl,R.startTime-S)}}var F=!1,ll=-1,V=5,K=-1;function W(){return fl?!0:!(f.unstable_now()-KS&&W());){var H=y.callback;if(typeof H=="function"){y.callback=null,N=y.priorityLevel;var Y=H(y.expirationTime<=S);if(S=f.unstable_now(),typeof Y=="function"){y.callback=Y,Ml(S),R=!0;break t}y===A(h)&&o(h),Ml(S)}else o(h);y=A(h)}if(y!==null)R=!0;else{var sl=A(_);sl!==null&&bt(Vl,sl.startTime-S),R=!1}}break l}finally{y=null,N=G,C=!1}R=void 0}}finally{R?xl():F=!1}}}var xl;if(typeof w=="function")xl=function(){w(Ul)};else if(typeof MessageChannel<"u"){var jt=new MessageChannel,Tt=jt.port2;jt.port1.onmessage=Ul,xl=function(){Tt.postMessage(null)}}else xl=function(){Sl(Ul,0)};function bt(S,R){ll=Sl(function(){S(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(S){S.callback=null},f.unstable_forceFrameRate=function(S){0>S||125H?(S.sortIndex=G,p(_,S),A(h)===null&&S===A(_)&&(P?(J(ll),ll=-1):P=!0,bt(Vl,G-H))):(S.sortIndex=Y,p(h,S),Q||C||(Q=!0,F||(F=!0,xl()))),S},f.unstable_shouldYield=W,f.unstable_wrapCallback=function(S){var R=N;return function(){var G=N;N=R;try{return S.apply(this,arguments)}finally{N=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(),p=Nd(),A=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=sl(null),_t=sl(null),Wt=sl(null),An=sl(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}}ol(Rl),I(Rl,l)}function Ga(){ol(Rl),ol(_t),ol(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&&(ol(Rl),ol(_t)),An.current===l&&(ol(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]!==g[n]){var T=` +`+s[e].replace(" at new "," at ");return l.displayName&&T.includes("")&&(T=T.replace("",l.displayName)),T}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,Nn=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 jn(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=Nn;return Nn<<=1,(Nn&62914560)===0&&(Nn=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,g=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 jm.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<$?(nl=X,X=null):nl=X.sibling;var il=b(m,X,v[$],E);if(il===null){X===null&&(X=nl);break}l&&X&&il.alternate===null&&t(m,X),r=u(il,r,$),cl===null?Z=il:cl.sibling=il,cl=il,X=nl}if($===v.length)return a(m,X),ul&&Ht(m,$),Z;if(X===null){for(;$$?(nl=X,X=null):nl=X.sibling;var pa=b(m,X,il.value,E);if(pa===null){X===null&&(X=nl);break}l&&X&&pa.alternate===null&&t(m,X),r=u(pa,r,$),cl===null?Z=pa:cl.sibling=pa,cl=pa,X=nl}if(il.done)return a(m,X),ul&&Ht(m,$),Z;if(X===null){for(;!il.done;$++,il=v.next())il=D(m,il.value,E),il!==null&&(r=u(il,r,$),cl===null?Z=il:cl.sibling=il,cl=il);return ul&&Ht(m,$),Z}for(X=e(X);!il.done;$++,il=v.next())il=z(X,m,$,il.value,E),il!==null&&(l&&il.alternate!==null&&X.delete(il.key===null?$:il.key),r=u(il,r,$),cl===null?Z=il:cl.sibling=il,cl=il);return l&&X.forEach(function(ih){return t(m,ih)}),ul&&Ht(m,$),Z}function vl(m,r,v,E){if(typeof v=="object"&&v!==null&&v.type===P&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case C:l:{for(var Z=v.key;r!==null;){if(r.key===Z){if(Z=v.type,Z===P){if(r.tag===7){a(m,r.sibling),E=n(r,v.props.children),E.return=m,m=E;break l}}else if(r.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===V&&Ca(Z)===r.type){a(m,r.sibling),E=n(r,v.props),Le(E,v),E.return=m,m=E;break l}a(m,r);break}else t(m,r);r=r.sibling}v.type===P?(E=Da(v.props.children,m.mode,E,v.key),E.return=m,m=E):(E=Kn(v.type,v.key,v.props,null,m.mode,E),Le(E,v),E.return=m,m=E)}return c(m);case Q:l:{for(Z=v.key;r!==null;){if(r.key===Z)if(r.tag===4&&r.stateNode.containerInfo===v.containerInfo&&r.stateNode.implementation===v.implementation){a(m,r.sibling),E=n(r,v.children||[]),E.return=m,m=E;break l}else{a(m,r);break}else t(m,r);r=r.sibling}E=Mc(v,m.mode,E),E.return=m,m=E}return c(m);case V:return v=Ca(v),vl(m,r,v,E)}if(bt(v))return q(m,r,v,E);if(xl(v)){if(Z=xl(v),typeof Z!="function")throw Error(o(150));return v=Z.call(v),L(m,r,v,E)}if(typeof v.then=="function")return vl(m,r,In(v),E);if(v.$$typeof===w)return vl(m,r,kn(m,v),E);Pn(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,r!==null&&r.tag===6?(a(m,r.sibling),E=n(r,v),E.return=m,m=E):(a(m,r),E=Ec(v,m.mode,E),E.return=m,m=E),c(m)):a(m,r)}return function(m,r,v,E){try{Ze=0;var Z=vl(m,r,v,E);return fe=null,Z}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,(rl&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,g=s.next;s.next=null,c===null?u=g:c.next=g,c=s;var T=l.alternate;T!==null&&(T=T.updateQueue,i=T.lastBaseUpdate,i!==c&&(i===null?T.firstBaseUpdate=g:i.next=g,T.lastBaseUpdate=s))}if(u!==null){var D=n.baseState;c=0,T=g=s=null,i=u;do{var b=i.lane&-536870913,z=b!==i.lane;if(z?(el&b)===b:(e&b)===b){b!==0&&b===ue&&(Vc=!0),T!==null&&(T=T.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var q=l,L=i;b=t;var vl=a;switch(L.tag){case 1:if(q=L.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=L.payload,b=typeof q=="function"?q.call(vl,D,b):q,b==null)break l;D=y({},D,b);break l;case 2:ea=!0}}b=i.callback,b!==null&&(l.flags|=64,z&&(l.flags|=8192),z=n.callbacks,z===null?n.callbacks=[b]:z.push(b))}else z={lane:b,tag:i.tag,payload:i.payload,callback:i.callback,next:null},T===null?(g=T=z,s=D):T=T.next=z,c|=b;if(i=i.next,i===null){if(i=n.shared.pending,i===null)break;z=i,i=z.next,z.next=null,n.lastBaseUpdate=z,n.shared.pending=null}}while(!0);T===null&&(s=D),n.baseState=s,n.firstBaseUpdate=g,n.lastBaseUpdate=T,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=S.T,i={};S.T=i,ii(l,!1,t,a);try{var s=n(),g=S.S;if(g!==null&&g(i,s),s!==null&&typeof s=="object"&&typeof s.then=="function"){var T=$m(s,e);$e(l,t,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),S.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===k||t!==null&&t===k}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,k,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,k,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,k,l.queue,!0,!1),Zl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,a){var e=k,n=Zl();if(ul){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),gl===null)throw Error(o(349));(el&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=Nu(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 Na(),(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 Na(),(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(ol(_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&&ol(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(Nc(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));Na()}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));Na()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return ol(_l),null;case 4:return Ga(),null;case 10:return qt(t.type),null;case 22:case 23:return et(t),Lc(),l!==null&&ol(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(Nc(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:ol(_l);break;case 10:qt(t.type);break;case 22:case 23:et(t),Lc(),l!==null&&ol(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){ml(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,g=i;try{g()}catch(T){ml(n,s,T)}}}e=e.next}while(e!==u)}}catch(T){ml(t,t.return,T)}}function Jo(l){var t=l.updateQueue;if(t!==null){var a=l.stateNode;try{Hs(t,a)}catch(e){ml(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){ml(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){ml(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){ml(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){ml(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){ml(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){ml(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){ml(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,g=0,T=0,D=l,b=null;t:for(;;){for(var z;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),(z=D.firstChild)!==null;)b=D,D=z;for(;;){if(D===l)break t;if(b===a&&++g===n&&(i=c),b===u&&++T===e&&(s=c),(z=D.nextSibling)!==null)break;D=b,b=D.parentNode}D=z}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=L,L=c);var m=cs(i,L),r=cs(i,vl);if(m&&r&&(z.rangeCount!==1||z.anchorNode!==m.node||z.anchorOffset!==m.offset||z.focusNode!==r.node||z.focusOffset!==r.offset)){var v=D.createRange();v.setStart(m.node,m.offset),z.removeAllRanges(),L>vl?(z.addRange(v),z.extend(r.node,r.offset)):(v.setEnd(r.node,r.offset),z.addRange(v))}}}}for(D=[],z=i;z=z.parentNode;)z.nodeType===1&&D.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;ia?32:a,S.T=null,a=Ui,Ui=null;var u=da,c=wt;if(Cl=0,ge=da=null,wt=0,(rl&6)!==0)throw Error(o(331));var i=rl;if(rl|=4,fr(u.current),ur(u,u.current,c,a),rl=i,fn(0,!1),Il&&typeof Il.onPostCommitFiberRoot=="function")try{Il.onPostCommitFiberRoot(_e,u)}catch{}return!0}finally{R.p=n,S.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),Nt(l))}function ml(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=No(2),e=ua(t,a,2),e!==null&&(jo(a,e,t,l),Me(e,2),Nt(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&&(el&a)===a&&(Tl===4||Tl===3&&(el&62914560)===el&&300>Fl()-Su?(rl&2)===0&&Se(l,0):Ni|=a,ve===el&&(ve=0)),Nt(l)}function Nr(l,t){t===0&&(t=xf()),l=Ma(l,t),l!==null&&(Me(l,t),Nt(l))}function b0(l){var t=l.memoizedState,a=0;t!==null&&(a=t.retryLane),Nr(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),Nr(l,a)}function z0(l,t){return Wu(l,t)}var _u=null,pe=null,qi=!1,Eu=!1,Yi=!1,ha=0;function Nt(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=el,u=jn(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(){jr()}function jr(){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 T=s.transferSize,D=s.initiatorType;T&&Qr(D)&&(s=s.responseEnd,c+=T*(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=y({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=y({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=y({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(g,T){s.onload=g,s.onerror=T}),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=y({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=y({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)?ju(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 y({},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=y({},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=y({},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(p){console.error(p)}}return f(),rf.exports=hh(),rf.exports}var vh=yh();const jd=x.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),gh=({children:f})=>{const[p,A]=x.useState([]),o=x.useRef(1e4),M=x.useCallback((O,h,_)=>{A(B=>B.find(N=>N.id===O)?B.map(N=>N.id===O?{...N,zIndex:++o.current}:N):[...B,{id:O,title:h,charName:_,zIndex:++o.current}])},[]),U=x.useCallback(O=>{A(h=>h.filter(_=>_.id!==O))},[]),j=x.useCallback(O=>{A(h=>h.map(_=>_.id===O?{..._,zIndex:++o.current}:_))},[]);return d.jsx(jd.Provider,{value:{windows:p,openWindow:M,closeWindow:U,bringToFront:j},children:f})},zn=()=>x.useContext(jd),gt={west:-102.1,east:102.1,north:102.1,south:-102.1};function xn(f,p,A,o){const M=(f-gt.west)/(gt.east-gt.west)*A,U=(gt.north-p)/(gt.north-gt.south)*o;return{x:M,y:U}}function Sh(f,p,A,o,M,U,j){const O=(f-o)/A,h=(p-M)/A,_=gt.west+O/U*(gt.east-gt.west),B=gt.north-h/j*(gt.north-gt.south);return{ew:_,ns:B}}function hf(f,p){const A=f>=0?"N":"S",o=p>=0?"E":"W";return`${Math.abs(f).toFixed(1)}${A}, ${Math.abs(p).toFixed(1)}${o}`}const Od=pn.memo(({players:f,imgW:p,imgH:A,getColor:o,onHover:M,onSelect:U,selectedPlayer:j})=>{const{openWindow:O}=zn(),[h,_]=x.useState(null);x.useEffect(()=>{const y=()=>_(null);return h&&window.addEventListener("click",y),()=>window.removeEventListener("click",y)},[h]);const B=x.useMemo(()=>f.filter(y=>y.ew!==void 0&&y.ns!==void 0).map(y=>({...y,pos:xn(y.ew,y.ns,p,A),color:o(y.character_name)})),[f,p,A,o]);return d.jsxs("div",{className:"ml-dots-layer",children:[B.map(y=>d.jsx("div",{className:`ml-dot ${j===y.character_name?"ml-dot-selected":""}`,style:{left:y.pos.x,top:y.pos.y,backgroundColor:y.color},onMouseEnter:N=>{var Q;const C=(Q=N.currentTarget.closest(".ml-map-container"))==null?void 0:Q.getBoundingClientRect();C&&M(y,N.clientX-C.left,N.clientY-C.top)},onMouseLeave:()=>M(null,0,0),onClick:()=>U(y.character_name),onDoubleClick:()=>O(`chat-${y.character_name}`,`Chat: ${y.character_name}`,y.character_name),onContextMenu:N=>{var Sl;N.preventDefault();const C=y.character_name,Q=(Sl=N.currentTarget.closest(".ml-map-container"))==null?void 0:Sl.getBoundingClientRect(),P=Q?N.clientX-Q.left:N.clientX,fl=Q?N.clientY-Q.top:N.clientY;_({name:C,x:P,y:fl})}},y.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(y=>d.jsx("div",{onClick:()=>{O(`${y.id}-${h.name}`,`${y.label}: ${h.name}`,h.name),_(null)},style:{padding:"4px 12px",cursor:"pointer",color:"#ccc"},onMouseEnter:N=>N.currentTarget.style.background="#333",onMouseLeave:N=>N.currentTarget.style.background="",children:y.label},y.id))})]})});Od.displayName="PlayerDots";const Zu="/api";async function At(f){const p=await fetch(`${Zu}${f}`,{credentials:"include"});if(!p.ok)throw new Error(`API ${f}: ${p.status}`);return p.json()}async function yf(f,p){var o;const A=await fetch(`${Zu}${f}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(p??{})});if(!A.ok){let M="";try{M=((o=await A.json())==null?void 0:o.detail)??""}catch{}throw new Error(`API ${f}: ${A.status}${M?` (${M})`:""}`)}return A.json()}async function bh(f,p){var o;const A=await fetch(`${Zu}${f}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(p??{})});if(!A.ok){let M="";try{M=((o=await A.json())==null?void 0:o.detail)??""}catch{}throw new Error(`API ${f}: ${A.status}${M?` (${M})`:""}`)}return A.json()}async function ph(f){var A;const p=await fetch(`${Zu}${f}`,{method:"DELETE",credentials:"include"});if(!p.ok){let o="";try{o=((A=await p.json())==null?void 0:A.detail)??""}catch{}throw new Error(`API ${f}: ${p.status}${o?` (${o})`:""}`)}return p.json()}function zh(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const Ud=pn.memo(({imgW:f,imgH:p,getColor:A})=>{const[o,M]=x.useState([]);x.useEffect(()=>{const j=async()=>{try{const h=await At("/trails/?seconds=600");M(h.trails??[])}catch{}};j();const O=setInterval(j,2e3);return()=>clearInterval(O)},[]);const U=x.useMemo(()=>{const j={};for(const O of o){const{x:h,y:_}=xn(O.ew,O.ns,f,p);j[O.character_name]||(j[O.character_name]=[]),j[O.character_name].push(`${h},${_}`)}return Object.entries(j).filter(([,O])=>O.length>=2).map(([O,h])=>({name:O,points:h.join(" ")}))},[o,f,p]);return d.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${f} ${p}`,preserveAspectRatio:"none",children:U.map(j=>d.jsx("polyline",{points:j.points,stroke:A(j.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},j.name))})});Ud.displayName="TrailsSVG";const xh=({imgW:f,imgH:p,enabled:A})=>{const o=x.useRef(null),[M,U]=x.useState([]);return x.useEffect(()=>{if(!A)return;(async()=>{try{const O=await At("/spawns/heatmap?hours=24&limit=50000");U(O.spawn_points??[])}catch{}})()},[A]),x.useEffect(()=>{const j=o.current;if(!j||!A||M.length===0||f===0)return;j.width=f,j.height=p;const O=j.getContext("2d");if(O){O.clearRect(0,0,f,p);for(const h of M){const{x:_,y:B}=xn(h.ew,h.ns,f,p),y=Math.max(5,Math.min(12,5+Math.sqrt(h.intensity*.5))),N=O.createRadialGradient(_,B,0,_,B,y);N.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,h.intensity/40)})`),N.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,h.intensity/120)})`),N.addColorStop(1,"rgba(255, 150, 0, 0)"),O.fillStyle=N,O.fillRect(_-y,B-y,y*2,y*2)}}},[M,f,p,A]),A?d.jsx("canvas",{ref:o,className:"ml-heatmap-canvas"}):null},Ah=({imgW:f,imgH:p,enabled:A})=>{const[o,M]=x.useState([]);x.useEffect(()=>{if(!A)return;const j=async()=>{try{const h=await At("/portals");M(h.portals??[])}catch{}};j();const O=setInterval(j,6e4);return()=>clearInterval(O)},[A]);const U=x.useMemo(()=>o.map(j=>({...j,pos:xn(j.coordinates.ew,j.coordinates.ns,f,p)})),[o,f,p]);return!A||U.length===0?null:d.jsx("div",{className:"ml-portals-layer",children:U.map((j,O)=>d.jsx("div",{className:"ml-portal-icon",style:{left:j.pos.x,top:j.pos.y},title:`${j.portal_name} (by ${j.discovered_by})`},O))})},_d=20,Ed=.3,Th=({players:f,getColor:p,onSelectPlayer:A,showHeatmap:o,showPortals:M,selectedPlayer:U})=>{var Vl;const j=x.useRef(null),O=x.useRef(null),[h,_]=x.useState({w:0,h:0}),[B,y]=x.useState(null),N=x.useRef(null),C=x.useRef({scale:1,offX:0,offY:0}),Q=x.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),P=x.useCallback(()=>{if(O.current){const{scale:F,offX:ll,offY:V}=C.current;O.current.style.transform=`translate(${ll}px, ${V}px) scale(${F})`}},[]),fl=x.useCallback(F=>{const ll=F.currentTarget;if(_({w:ll.naturalWidth,h:ll.naturalHeight}),j.current){const V=j.current.clientWidth,K=j.current.clientHeight,W=Math.min(V/ll.naturalWidth,K/ll.naturalHeight);C.current={scale:W,offX:(V-ll.naturalWidth*W)/2,offY:(K-ll.naturalHeight*W)/2},P()}},[P]),Sl=x.useCallback(F=>{var Tt;F.preventDefault();const ll=(Tt=j.current)==null?void 0:Tt.getBoundingClientRect();if(!ll)return;const V=C.current,K=F.deltaY<0?1.1:.9,W=Math.min(_d,Math.max(Ed,V.scale*K)),Ul=W/V.scale,xl=F.clientX-ll.left,jt=F.clientY-ll.top;C.current={scale:W,offX:xl-(xl-V.offX)*Ul,offY:jt-(jt-V.offY)*Ul},P()},[P]),J=x.useCallback(F=>{if(F.button!==0)return;const ll=C.current;Q.current={dragging:!0,sx:F.clientX,sy:F.clientY,startOffX:ll.offX,startOffY:ll.offY}},[]);x.useEffect(()=>{const F=V=>{const K=Q.current;if(K.dragging&&(C.current.offX=K.startOffX+(V.clientX-K.sx),C.current.offY=K.startOffY+(V.clientY-K.sy),P()),j.current&&h.w>0&&N.current){const W=j.current.getBoundingClientRect(),Ul=C.current,xl=Sh(V.clientX-W.left,V.clientY-W.top,Ul.scale,Ul.offX,Ul.offY,h.w,h.h);N.current.textContent=hf(xl.ns,xl.ew)}},ll=()=>{Q.current.dragging=!1};return window.addEventListener("mousemove",F),window.addEventListener("mouseup",ll),()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",ll)}},[P,h.w,h.h]);const w=x.useRef(null);x.useEffect(()=>{if(!U||h.w===0||!j.current||w.current===U)return;const F=f.find(Ul=>Ul.character_name===U);if(!F)return;w.current=U;const{x:ll,y:V}=xn(F.ew,F.ns,h.w,h.h),K=j.current.getBoundingClientRect(),W=3;C.current={scale:Math.min(_d,Math.max(Ed,W)),offX:K.width/2-ll*W,offY:K.height/2-V*W},P()},[U,f,h.w,h.h,P]),x.useEffect(()=>{U||(w.current=null)},[U]);const Ml=x.useCallback((F,ll,V)=>{y(F?{x:ll,y:V,player:F}:null)},[]);return d.jsxs("div",{className:"ml-map-container",ref:j,onWheel:Sl,onMouseDown:J,children:[d.jsxs("div",{ref:O,className:"ml-map-group",children:[d.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:fl,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:p}),d.jsx(Od,{players:f,imgW:h.w,imgH:h.h,getColor:p,onHover:Ml,onSelect:A,selectedPlayer:U}),d.jsx(Ah,{imgW:h.w,imgH:h.h,enabled:M})]})]}),B&&d.jsxs("div",{className:"ml-tooltip",style:{left:B.x+12,top:B.y-10},children:[d.jsx("strong",{children:B.player.character_name}),d.jsx("br",{}),hf(B.player.ns,B.player.ew),d.jsx("br",{}),B.player.kills_per_hour," kph · ",(Vl=B.player.kills)==null?void 0:Vl.toLocaleString()," kills"]}),d.jsx("div",{className:"ml-coords",ref:N})]})},Cd=pn.memo(({player:f,vitals:p,color:A,onSelect:o,isSelected:M})=>{var B,y;const{openWindow:U}=zn(),j=(f.vt_state||"idle").toLowerCase(),O=j==="combat"||j==="hunt",h=(f.total_rares??0)>0?Math.round((f.total_kills??0)/(f.total_rares??1)).toLocaleString():null,_=f.character_name;return d.jsxs("li",{className:`ml-player-row ${M?"ml-player-selected":""}`,style:{borderLeftColor:A},children:[d.jsxs("div",{className:"ml-pr-header",onClick:o,children:[d.jsx("span",{className:"ml-pr-name",children:_}),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:`${(p==null?void 0:p.health_percentage)??0}%`}})}),d.jsx("div",{className:"ml-vital-bar sta",children:d.jsx("div",{className:"ml-vital-fill",style:{width:`${(p==null?void 0:p.stamina_percentage)??0}%`}})}),d.jsx("div",{className:"ml-vital-bar mana",children:d.jsx("div",{className:"ml-vital-fill",style:{width:`${(p==null?void 0:p.mana_percentage)??0}%`}})})]}),d.jsxs("div",{className:"ml-pr-grid",children:[d.jsxs("span",{className:"ml-gs",title:"Session kills",children:["⚔️ ",((B=f.kills)==null?void 0:B.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 ${O?"active":j!=="idle"&&j!=="default"&&j!==""?"other":""}`,children:f.vt_state||"idle"}),d.jsxs("span",{className:"ml-gs",title:"Online time",children:["🕐 ",((y=f.onlinetime)==null?void 0:y.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-${_}`,`Chat: ${_}`,_),children:"Chat"}),d.jsx("button",{className:"ml-btn accent",onClick:()=>U(`stats-${_}`,`Stats: ${_}`,_),children:"Stats"}),d.jsx("button",{className:"ml-btn accent",onClick:()=>U(`inv-${_}`,`Inventory: ${_}`,_),children:"Inv"}),d.jsx("button",{className:"ml-btn",onClick:()=>U(`char-${_}`,`Character: ${_}`,_),children:"Char"}),d.jsx("button",{className:"ml-btn",onClick:()=>U(`combat-${_}`,`Combat: ${_}`,_),children:"Combat"}),d.jsx("button",{className:"ml-btn",onClick:()=>U(`radar-${_}`,`Radar: ${_}`,_),children:"Radar"})]})]})});Cd.displayName="PlayerRow";const _h=({players:f,vitals:p,getColor:A,onSelect:o,selectedPlayer:M})=>{const U=x.useRef(null),[j,O]=x.useState(!1),h=x.useCallback(()=>{U.current&&O(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(_=>d.jsx(Cd,{player:_,vitals:p.get(_.character_name)??null,color:A(_.character_name),onSelect:()=>o(_.character_name),isSelected:M===_.character_name},_.character_name))}),j&&d.jsx("button",{onClick:()=>{var _;(_=U.current)==null||_.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:p})=>d.jsx("div",{className:"ml-sort-buttons",children:Eh.map(A=>d.jsx("button",{className:`ml-sort-btn ${f===A.key?"active":""}`,onClick:()=>p(A.key),children:A.label},A.key))}),Dh=()=>At("/live"),Nh=()=>At("/combat-stats"),jh=()=>At("/server-health"),Oh=()=>At("/total-rares"),Uh=()=>At("/total-kills"),vy=(f,p)=>yf("/agent/ask",{message:f,session_id:p}),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,p,A)=>yf("/api-admin/users",{username:f,password:p,is_admin:A}),zy=(f,p)=>bh(`/api-admin/users/${f}`,p),xy=f=>ph(`/api-admin/users/${f}`);function Hh(){const[f,p]=x.useState(null),[A,o]=x.useState(!0);return x.useEffect(()=>{let M=!1;return Ch().then(U=>{M||p(U)}).catch(()=>{M||p(null)}).finally(()=>{M||o(!1)}),()=>{M=!0}},[]),{user:f,loading:A}}const Bh=()=>{const{openWindow:f}=zn(),{user:p}=Hh(),A=!!(p!=null&&p.is_admin),o=x.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"}),A&&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:p?`Logged in as ${p.username}`:"Log out",children:["🚪 Log out",p?` (${p.username})`:""]})]})},qh=({players:f,vitals:p,serverHealth:A,totalRares:o,totalKills:M,getColor:U,onSelectPlayer:j,showHeatmap:O,showPortals:h,onToggleHeatmap:_,onTogglePortals:B,version:y,selectedPlayer:N})=>{var F,ll;const[C,Q]=x.useState("name"),[P,fl]=x.useState(""),Sl=x.useMemo(()=>f.reduce((V,K)=>V+(parseInt(K.kills_per_hour)||0),0),[f]),J=((F=A==null?void 0:A.status)==null?void 0:F.toLowerCase())==="online"||((ll=A==null?void 0:A.status)==null?void 0:ll.toLowerCase())==="up",w=x.useDeferredValue(f),Ml=x.useDeferredValue(p),Vl=x.useMemo(()=>{let V=[...w];switch(P&&(V=V.filter(K=>K.character_name.toLowerCase().startsWith(P.toLowerCase()))),C){case"kph":V.sort((K,W)=>(parseInt(W.kills_per_hour)||0)-(parseInt(K.kills_per_hour)||0));break;case"skills":V.sort((K,W)=>(W.kills||0)-(K.kills||0));break;case"srares":V.sort((K,W)=>(W.session_rares??0)-(K.session_rares??0));break;case"tkills":V.sort((K,W)=>(W.total_kills??0)-(K.total_kills??0));break;case"kpr":V.sort((K,W)=>{const Ul=(K.total_kills??0)/Math.max(1,K.total_rares??1),xl=(W.total_kills??0)/Math.max(1,W.total_rares??1);return Ul-xl});break;default:V.sort((K,W)=>K.character_name.localeCompare(W.character_name))}return V},[w,C,P]);return d.jsxs("div",{className:"ml-sidebar",children:[y&&d.jsxs("div",{className:"ml-version",children:["v",y]}),d.jsx("div",{className:"ml-sidebar-header",children:d.jsxs("span",{className:"ml-sidebar-title",style:{cursor:"pointer"},onClick:()=>{const V=document.createElement("div");V.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 K=document.createElement("video");K.src="/rick.mp4",K.autoplay=!0,K.loop=!0,K.style.cssText="width:100vw;height:100vh;object-fit:cover;",V.appendChild(K),document.body.appendChild(V),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(()=>{V.style.animation="ml-spin 3s linear infinite"},1500),K.play().catch(()=>{})},children:["Active Mosswart Enjoyers (",f.length,")"]})}),d.jsxs("div",{className:"ml-server-status",children:[d.jsx("span",{className:`ml-status-dot ${J?"online":"offline"}`}),d.jsxs("span",{className:"ml-status-text",children:["Coldeve ",J?"Online":"Offline"]}),(A==null?void 0:A.player_count)!=null&&d.jsxs("span",{className:"ml-status-detail",children:["👥 ",A.player_count]}),(A==null?void 0:A.latency_ms)!=null&&d.jsxs("span",{className:"ml-status-detail",children:[Math.round(A.latency_ms),"ms"]}),(A==null?void 0:A.uptime_seconds)!=null&&d.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(A.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:O,onChange:V=>_(V.target.checked)}),d.jsx("span",{children:"Spawn Heatmap"})]}),d.jsxs("label",{className:"ml-toggle-label",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:V=>B(V.target.checked)}),d.jsx("span",{children:"Portals"})]})]}),d.jsx("div",{style:{borderTop:"1px solid #333",marginTop:4,paddingTop:4}}),d.jsx(Mh,{value:C,onChange:Q}),d.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:P,onChange:V=>fl(V.target.value)}),d.jsx(_h,{players:Vl,vitals:Ml,getColor:U,onSelect:j,selectedPlayer:N})]})},Yh="modulepreload",Xh=function(f){return"/"+f},Md={},St=function(p,A,o){let M=Promise.resolve();if(A&&A.length>0){let j=function(_){return Promise.all(_.map(B=>Promise.resolve(B).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const O=document.querySelector("meta[property=csp-nonce]"),h=(O==null?void 0:O.nonce)||(O==null?void 0:O.getAttribute("nonce"));M=j(A.map(_=>{if(_=Xh(_),_ in Md)return;Md[_]=!0;const B=_.endsWith(".css"),y=B?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${_}"]${y}`))return;const N=document.createElement("link");if(N.rel=B?"stylesheet":Yh,B||(N.as="script"),N.crossOrigin="",N.href=_,h&&N.setAttribute("nonce",h),document.head.appendChild(N),B)return new Promise((C,Q)=>{N.addEventListener("load",C),N.addEventListener("error",()=>Q(new Error(`Unable to preload CSS for ${_}`)))})}))}function U(j){const O=new Event("vite:preloadError",{cancelable:!0});if(O.payload=j,window.dispatchEvent(O),!O.defaultPrevented)throw j}return M.then(j=>{for(const O of j||[])O.status==="rejected"&&U(O.reason);return p().catch(U)})},Rd=({id:f,title:p,zIndex:A,width:o=700,height:M=340,children:U})=>{const{closeWindow:j,bringToFront:O}=zn(),h=x.useRef(null),_=x.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),B=x.useRef({resizing:!1,sx:0,sy:0,sw:0,sh:0}),y=x.useRef({x:420,y:10+Math.random()*40}),[N,C]=x.useState({w:o,h:M}),Q=x.useCallback(fl=>{var J;fl.preventDefault(),O(f);const Sl=(J=h.current)==null?void 0:J.getBoundingClientRect();Sl&&(_.current={dragging:!0,sx:fl.clientX,sy:fl.clientY,ox:Sl.left,oy:Sl.top})},[f,O]),P=x.useCallback(fl=>{fl.preventDefault(),fl.stopPropagation(),B.current={resizing:!0,sx:fl.clientX,sy:fl.clientY,sw:N.w,sh:N.h}},[N.w,N.h]);return x.useEffect(()=>{const fl=J=>{const w=_.current;w.dragging&&h.current&&(y.current.x=w.ox+(J.clientX-w.sx),y.current.y=w.oy+(J.clientY-w.sy),h.current.style.left=`${y.current.x}px`,h.current.style.top=`${y.current.y}px`);const Ml=B.current;if(Ml.resizing){const Vl=Math.max(300,Ml.sw+(J.clientX-Ml.sx)),F=Math.max(200,Ml.sh+(J.clientY-Ml.sy));C({w:Vl,h:F})}},Sl=()=>{_.current.dragging=!1,B.current.resizing=!1};return window.addEventListener("mousemove",fl),window.addEventListener("mouseup",Sl),()=>{window.removeEventListener("mousemove",fl),window.removeEventListener("mouseup",Sl)}},[]),d.jsxs("div",{ref:h,className:"ml-window",style:{zIndex:A,width:N.w,height:N.h,left:y.current.x,top:y.current.y},onMouseDown:()=>O(f),children:[d.jsxs("div",{className:"ml-window-header",onMouseDown:Q,children:[d.jsx("span",{className:"ml-window-title",children:p}),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:P})]})},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 p=localStorage.getItem(Bd(f));return p?JSON.parse(p):[]}catch{return[]}}function Vh(f,p){try{localStorage.setItem(Bd(f),JSON.stringify(p.slice(-Hd)))}catch{}}const Zh=({id:f,charName:p,zIndex:A,messages:o,socket:M})=>{const U=x.useRef(null),[j,O]=x.useState(""),[h,_]=x.useState(!1),B=x.useRef(Qh(p)),y=x.useRef(-1),N=x.useRef(""),C=x.useRef(!1);x.useEffect(()=>{const J=U.current;J&&(C.current?_(!0):(J.scrollTop=J.scrollHeight,_(!1)))},[o.length]);const Q=x.useCallback(()=>{const J=U.current;if(!J)return;const w=J.scrollHeight-J.scrollTop-J.clientHeight<30;C.current=!w,w&&_(!1)},[]),P=x.useCallback(()=>{const J=U.current;J&&(J.scrollTop=J.scrollHeight,C.current=!1,_(!1))},[]),fl=x.useCallback(J=>{J.preventDefault();const w=j.trim();!w||!M||M.readyState!==WebSocket.OPEN||(M.send(JSON.stringify({player_name:p,command:w})),B.current.push(w),B.current.length>Hd&&B.current.shift(),Vh(p,B.current),y.current=-1,N.current="",O(""),C.current=!1)},[j,M,p]),Sl=x.useCallback(J=>{const w=B.current;if(w.length!==0){if(J.key==="ArrowUp")J.preventDefault(),y.current===-1?(N.current=j,y.current=w.length-1):y.current>0&&y.current--,O(w[y.current]);else if(J.key==="ArrowDown"){if(J.preventDefault(),y.current===-1)return;y.currentd.jsx("div",{className:"ml-chat-line",style:{color:Gh[J.color??2]??"#ddd"},children:J.text},w))}),h&&d.jsx("div",{onClick:P,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:fl,children:d.jsx("input",{className:"ml-chat-input",value:j,onChange:J=>O(J.target.value),onKeyDown:Sl,placeholder:"Enter chat..."})})]})},Lh=x.lazy(()=>St(()=>import("./StatsWindow-CIRZXtNg.js"),__vite__mapDeps([0,1])).then(f=>({default:f.StatsWindow}))),Kh=x.lazy(()=>St(()=>import("./CharacterWindow-DB25PGyW.js"),__vite__mapDeps([2,1])).then(f=>({default:f.CharacterWindow}))),Jh=x.lazy(()=>St(()=>import("./InventoryWindow-CsRCfFA4.js"),__vite__mapDeps([3,1])).then(f=>({default:f.InventoryWindow}))),wh=x.lazy(()=>St(()=>import("./RadarWindow-BWeCin-b.js"),__vite__mapDeps([4,1])).then(f=>({default:f.RadarWindow}))),kh=x.lazy(()=>St(()=>import("./CombatStatsWindow-DSDCf8zG.js"),__vite__mapDeps([5,1])).then(f=>({default:f.CombatStatsWindow}))),Wh=x.lazy(()=>St(()=>import("./CombatPickerWindow-EVVSrp8z.js"),__vite__mapDeps([6,1])).then(f=>({default:f.CombatPickerWindow}))),$h=x.lazy(()=>St(()=>import("./IssuesWindow-B7wMTxUh.js"),__vite__mapDeps([7,1])).then(f=>({default:f.IssuesWindow}))),Fh=x.lazy(()=>St(()=>import("./VitalSharingWindow-Cr06Ao6f.js"),__vite__mapDeps([8,1])).then(f=>({default:f.VitalSharingWindow}))),Ih=x.lazy(()=>St(()=>import("./QuestStatusWindow-BZVZJ6b0.js"),__vite__mapDeps([9,1])).then(f=>({default:f.QuestStatusWindow}))),Ph=x.lazy(()=>St(()=>Promise.resolve().then(()=>ry),void 0).then(f=>({default:f.PlayerDashboardWindow}))),ly=x.lazy(()=>St(()=>import("./AgentWindow-D4IwDfCh.js"),__vite__mapDeps([10,1])).then(f=>({default:f.AgentWindow}))),ty=x.lazy(()=>St(()=>import("./AdminUsersWindow-CjCV57tE.js"),__vite__mapDeps([11,1])).then(f=>({default:f.AdminUsersWindow}))),qd=pn.memo(({characters:f,chatMessages:p,nearbyObjects:A,inventoryVersions:o,equipmentCantrips:M,characterStats:U,socket:j})=>{const{windows:O}=zn();return d.jsx(x.Suspense,{fallback:null,children:O.map(h=>{var y;const _=h.charName??"";switch(h.id.split("-")[0]){case"chat":return d.jsx(Zh,{id:h.id,charName:_,zIndex:h.zIndex,messages:p.get(_)??[],socket:j},h.id);case"stats":return d.jsx(Lh,{id:h.id,charName:_,zIndex:h.zIndex},h.id);case"char":return d.jsx(Kh,{id:h.id,charName:_,zIndex:h.zIndex,vitals:((y=f.get(_))==null?void 0:y.vitals)??void 0,liveStats:U.get(_)},h.id);case"inv":return d.jsx(Jh,{id:h.id,charName:_,zIndex:h.zIndex,inventoryVersion:o.get(_)??0,equipmentCantrips:M.get(_)},h.id);case"radar":return d.jsx(wh,{id:h.id,charName:_,zIndex:h.zIndex,socket:j,radarData:A.get(_)??null},h.id);case"combat":return d.jsx(kh,{id:h.id,charName:_,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[p,A]=x.useState([]),[o,M]=x.useState(0),[U,j]=x.useState([]);x.useEffect(()=>{if(f.length>o&&o>0){const h=f.slice(0,f.length-o);for(const _ of h){const B=++ay;A(y=>[...y,{key:B,charName:_.character_name,rareName:_.name,exiting:!1}]),O();try{const y=new AudioContext,N=y.createOscillator(),C=y.createGain();N.connect(C),C.connect(y.destination),N.frequency.value=880,N.type="sine",C.gain.value=.3,N.start(),C.gain.exponentialRampToValueAtTime(.001,y.currentTime+.5),N.stop(y.currentTime+.5)}catch{}setTimeout(()=>{A(y=>y.map(N=>N.key===B?{...N,exiting:!0}:N)),setTimeout(()=>{A(y=>y.filter(N=>N.key!==B))},500)},6e3)}}M(f.length)},[f.length]);const O=x.useCallback(()=>{const h=Date.now(),_=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],B=Array.from({length:30},(y,N)=>{const C=Math.PI*2*N/30+(Math.random()-.5)*.5,Q=100+Math.random()*200;return{dx:Math.cos(C)*Q,dy:Math.sin(C)*Q-50,color:_[Math.floor(Math.random()*_.length)]}});j(y=>[...y,{id:h,particles:B}]),setTimeout(()=>j(y=>y.filter(N=>N.id!==h)),2200)},[]);return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"ml-rare-notifications",children:p.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((_,B)=>d.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:_.color,"--dx":`${_.dx}px`,"--dy":`${_.dy+200}px`}},B))},h.id))})]})};let ny=0;const uy=({deathAlerts:f})=>{const[p,A]=x.useState([]),o=x.useRef(0);return x.useEffect(()=>{if(f.length>o.current&&o.current>0){const M=f.slice(o.current);for(const U of M){const j=++ny;A(O=>[...O,{key:j,alert:U,exiting:!1}]);try{const O=new AudioContext,h=O.createOscillator(),_=O.createGain();h.connect(_),_.connect(O.destination),h.frequency.value=440,h.type="sawtooth",_.gain.value=.2,h.start(),_.gain.exponentialRampToValueAtTime(.001,O.currentTime+.8),h.stop(O.currentTime+.8)}catch{}setTimeout(()=>{A(O=>O.map(h=>h.key===j?{...h,exiting:!0}:h)),setTimeout(()=>A(O=>O.filter(h=>h.key!==j)),500)},8e3)}}o.current=f.length},[f.length]),p.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:p.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 p=0;for(let A=0;A{let M=f.current.get(o);return M||(M=p.current{const p=iy(),[A,o]=x.useState(!1),[M,U]=x.useState(!1),[j,O]=x.useState(null),h=x.useMemo(()=>Array.from(f.characters.values()).filter(C=>C.telemetry).map(C=>C.telemetry),[f.characters]),_=x.useMemo(()=>new Map(Array.from(f.characters.values()).filter(C=>C.vitals).map(C=>[C.name,C.vitals])),[f.characters]),[B,y]=x.useState("");x.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(C=>C.json()).then(C=>y(C.version??"")).catch(()=>{})},[]);const N=x.useCallback(C=>{O(Q=>Q===C?null:C)},[]);return d.jsx(gh,{children:d.jsxs("div",{className:"ml-layout",children:[d.jsx(qh,{players:h,vitals:_,serverHealth:f.serverHealth,totalRares:f.totalRares,totalKills:f.totalKills,getColor:p,onSelectPlayer:N,showHeatmap:A,showPortals:M,onToggleHeatmap:o,onTogglePortals:U,version:B,selectedPlayer:j}),d.jsx(Th,{players:h,getColor:p,onSelectPlayer:N,showHeatmap:A,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 p=x.useRef(null),A=x.useRef(0),o=x.useRef(f);o.current=f;const M=x.useCallback(()=>{var j;if(((j=p.current)==null?void 0:j.readyState)===WebSocket.OPEN)return;const U=new WebSocket(zh());p.current=U,U.addEventListener("message",O=>{try{const h=JSON.parse(O.data);o.current(h)}catch{}}),U.addEventListener("close",()=>{p.current=null,A.current=window.setTimeout(M,2e3)}),U.addEventListener("error",()=>{U.close()})},[]);return x.useEffect(()=>(M(),()=>{var U;clearTimeout(A.current),(U=p.current)==null||U.close(),p.current=null}),[M]),p}function Yd(){const[f,p]=x.useState(new Map),[A,o]=x.useState(null),[M,U]=x.useState(0),[j,O]=x.useState(0),[h,_]=x.useState([]),B=x.useRef(new Map),[y,N]=x.useState(0),[C,Q]=x.useState(new Map),P=x.useRef(new Map),[fl,Sl]=x.useState(0),J=x.useRef(new Map),[w,Ml]=x.useState(0),[Vl,F]=x.useState([]),[ll,V]=x.useState(new Map),K=x.useRef(f);K.current=f;const W=x.useCallback((S,R)=>{p(G=>{const H=new Map(G),Y=H.get(S)??{name:S,telemetry:null,vitals:null,combat:null,lastUpdate:0};return H.set(S,R(Y)),H})},[]),Ul=x.useCallback(S=>{var R,G;if(S.type){if(S.type==="telemetry"){const H=S;W(H.character_name,Y=>({...Y,telemetry:H,lastUpdate:Date.now()}))}else if(S.type==="vitals"){const H=S,Y=(R=K.current.get(H.character_name))==null?void 0:R.vitals;Y&&(Y.vitae??0)===0&&(H.vitae??0)>0&&F(sl=>[...sl,{character_name:H.character_name,vitae:H.vitae,timestamp:new Date().toISOString()}].slice(-50)),W(H.character_name,sl=>({...sl,vitals:H,lastUpdate:Date.now()}))}else if(S.type==="combat_stats"){const H=S;W(H.character_name,Y=>({...Y,combat:H,lastUpdate:Date.now()}))}else if(S.type==="rare"){const H=S;_(Y=>[H,...Y].slice(0,50))}else if(S.type==="inventory_delta"){const H=S;H.character_name&&Q(Y=>{const sl=new Map(Y);return sl.set(H.character_name,(sl.get(H.character_name)??0)+1),sl})}else if(S.type==="character_stats"){const H=S;J.current.set(H.character_name,S),Ml(Y=>Y+1)}else if(S.type==="equipment_cantrip_state"){const H=S;P.current.set(H.character_name,H),Sl(Y=>Y+1)}else if(S.type==="dungeon_map"){const H=S;H.landblock&&(window.__dungeonMapCache||(window.__dungeonMapCache={}),window.__dungeonMapCache[H.landblock]=H)}else if(S.type==="nearby_objects"){const H=S;if(V(Y=>{const sl=new Map(Y);return sl.set(H.character_name,H),sl}),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(S.type==="chat"){const H=S,Y=B.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),B.current.set(H.character_name,Y),N(sl=>sl+1)}}},[W]),xl=sy(Ul);x.useEffect(()=>{const S=async()=>{try{const G=await Dh();p(H=>{var sl;const Y=new Map(H);for(const ol of G.players??[]){const I=Y.get(ol.character_name);Y.set(ol.character_name,{name:ol.character_name,telemetry:ol,vitals:(I==null?void 0:I.vitals)??null,combat:(I==null?void 0:I.combat)??null,lastUpdate:Date.now()})}for(const ol of Y.keys())(sl=G.players)!=null&&sl.some(I=>I.character_name===ol)||Y.delete(ol);return Y})}catch{}};S();const R=setInterval(S,5e3);return()=>clearInterval(R)},[]),x.useEffect(()=>{const S=async()=>{try{const G=await Nh();for(const H of G.stats??[])W(H.character_name,Y=>({...Y,combat:{...H,type:"combat_stats"}}))}catch{}};S();const R=setInterval(S,3e4);return()=>clearInterval(R)},[W]),x.useEffect(()=>{const S=async()=>{try{o(await jh())}catch{}};S();const R=setInterval(S,3e4);return()=>clearInterval(R)},[]),x.useEffect(()=>{const S=async()=>{try{const[G,H]=await Promise.all([Oh(),Uh()]);U(G.all_time??0),O(H.total??0)}catch{}};S();const R=setInterval(S,3e5);return()=>clearInterval(R)},[]);const jt=x.useMemo(()=>B.current,[y]),Tt=x.useMemo(()=>P.current,[fl]),bt=x.useMemo(()=>J.current,[w]);return{characters:f,serverHealth:A,totalRares:M,totalKills:j,recentRares:h,chatMessages:jt,nearbyObjects:ll,inventoryVersions:C,equipmentCantrips:Tt,characterStats:bt,deathAlerts:Vl,socketRef:xl}}const vf=({characters:f})=>{const[p,A]=x.useState("kph"),[o,M]=x.useState(!1),[U,j]=x.useState(null),O=x.useMemo(()=>{const y=Array.from(f.values()).filter(N=>N.telemetry).map(N=>{var Q,P,fl;const C=N.telemetry;return{name:N.name,kills:C.kills??0,kph:parseInt(C.kills_per_hour)||0,totalKills:C.total_kills??0,rares:C.total_rares??0,sessionRares:C.session_rares??0,deaths:parseInt(C.deaths)||0,totalDeaths:parseInt(C.total_deaths)||0,uptime:((Q=C.onlinetime)==null?void 0:Q.replace(/^00\./,""))??"",state:C.vt_state??"idle",tapers:parseInt(C.prismatic_taper_count)||0,hp:((P=N.vitals)==null?void 0:P.health_percentage)??0,vitae:((fl=N.vitals)==null?void 0:fl.vitae)??0}});return y.sort((N,C)=>{let Q=0;switch(p){case"name":Q=N.name.localeCompare(C.name);break;case"kills":Q=N.kills-C.kills;break;case"kph":Q=N.kph-C.kph;break;case"rares":Q=N.rares-C.rares;break;case"deaths":Q=N.totalDeaths-C.totalDeaths;break;case"uptime":Q=N.uptime.localeCompare(C.uptime);break;case"state":Q=N.state.localeCompare(C.state);break}return o?Q:-Q}),y},[f,p,o]),h=y=>{p===y?M(!o):(A(y),M(!1))},_=y=>({padding:"4px 6px",cursor:"pointer",userSelect:"none",color:p===y?"#6af":"#888",fontSize:"0.65rem",fontWeight:600,whiteSpace:"nowrap",borderBottom:"1px solid #444"}),B=y=>p===y?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:{..._("name"),textAlign:"left"},onClick:()=>h("name"),children:["Character",B("name")]}),d.jsxs("th",{style:{..._("state"),textAlign:"center"},onClick:()=>h("state"),children:["State",B("state")]}),d.jsxs("th",{style:{..._("kph"),textAlign:"right"},onClick:()=>h("kph"),children:["KPH",B("kph")]}),d.jsxs("th",{style:{..._("kills"),textAlign:"right"},onClick:()=>h("kills"),children:["Session",B("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:{..._("rares"),textAlign:"right"},onClick:()=>h("rares"),children:["Rares",B("rares")]}),d.jsxs("th",{style:{..._("deaths"),textAlign:"right"},onClick:()=>h("deaths"),children:["Deaths",B("deaths")]}),d.jsxs("th",{style:{..._("uptime"),textAlign:"right"},onClick:()=>h("uptime"),children:["Uptime",B("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:O.map(y=>{const N=y.state.toLowerCase(),C=N==="combat"||N==="hunt",Q=U===y.name;return d.jsxs("tr",{onClick:()=>j(Q?null:y.name),style:{borderBottom:"1px solid #1a1a1a",cursor:"pointer",background:Q?"rgba(102, 170, 255, 0.18)":void 0,outline:Q?"1px solid rgba(102, 170, 255, 0.55)":void 0,outlineOffset:"-1px"},children:[d.jsx("td",{style:{padding:"3px 10px 3px 6px",color:"#ccc",fontWeight:500,whiteSpace:"nowrap"},children:y.name}),d.jsx("td",{style:{textAlign:"center",padding:"3px 6px"},children:d.jsx("span",{style:{fontSize:"0.6rem",padding:"1px 6px",borderRadius:3,background:C?"rgba(68,204,68,0.15)":N==="idle"||N==="default"?"rgba(100,100,100,0.2)":"rgba(204,68,68,0.15)",color:C?"#4c4":N==="idle"||N==="default"?"#888":"#c44"},children:y.state})}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#4c4",fontVariantNumeric:"tabular-nums"},children:y.kph.toLocaleString()}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#ccc",fontVariantNumeric:"tabular-nums"},children:y.kills.toLocaleString()}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:y.totalKills.toLocaleString()}),d.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",color:"#fc0",fontVariantNumeric:"tabular-nums"},children:[y.rares,y.sessionRares>0?` (${y.sessionRares})`:""]}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:y.totalDeaths>0?"#c66":"#555",fontVariantNumeric:"tabular-nums"},children:y.totalDeaths}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:y.uptime}),d.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:y.hp>80?"#4c4":y.hp>40?"#ca0":"#c44"},children:[y.hp.toFixed(0),"%"]}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:y.vitae>0?"#f66":"#333"},children:y.vitae>0?`${y.vitae}%`:""}),d.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:y.tapers.toLocaleString()})]},y.name)})})]}),O.length===0&&d.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No characters online"})]})},oy=({id:f,zIndex:p,characters:A})=>d.jsx(Rd,{id:f,title:"Player Dashboard",zIndex:p,width:850,height:500,children:d.jsx(vf,{characters:A})}),ry=Object.freeze(Object.defineProperty({__proto__:null,PlayerDashboardContent:vf,PlayerDashboardWindow:oy},Symbol.toStringTag,{value:"Module"})),dy=()=>{const f=Yd(),[p,A]=x.useState("");x.useEffect(()=>{const M=document.title;return document.title="Overlord Dashboard",()=>{document.title=M}},[]),x.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(M=>M.json()).then(M=>A(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}}),p&&d.jsxs("span",{className:"ml-dashboard-version",children:["v",p]})]}),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(x.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,x as r,zn as u}; diff --git a/static/assets/index-d7uW0_CB.js b/static/assets/index-d7uW0_CB.js deleted file mode 100644 index 68f0cb0c..00000000 --- a/static/assets/index-d7uW0_CB.js +++ /dev/null @@ -1,34 +0,0 @@ -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 a3fcdcca..9e1b55ea 100644 --- a/static/index.html +++ b/static/index.html @@ -8,7 +8,7 @@ - +