From d26f1f725c143e8b18583775985a1958561a4b57 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 15 Apr 2026 18:57:55 +0200 Subject: [PATCH] Fix inventory window never refreshing live (per-character version) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inventoryVersion counter in useLiveData was a single global value that bumped on every inventory_delta for any character. With 60+ active chars all generating deltas, the global counter advanced multiple times per second. InventoryWindow's debounce effect watched this global counter, so every bump reset its 2-second fetch timer. Since bumps arrived faster than 2s, the fetch never fired — the window appeared frozen until the user closed and reopened it (which triggered the initial-fetch effect). Fix: make inventoryVersions a Map keyed by character name. Each inventory_delta now only bumps its own character's counter, so an open window's debounce correctly fires 2s after its character's last delta, ignoring unrelated traffic. Co-Authored-By: Claude Opus 4.6 (1M context) --- frontend/src/components/map/MapLayout.tsx | 2 +- .../src/components/windows/WindowRenderer.tsx | 8 ++- frontend/src/hooks/useLiveData.ts | 23 ++++-- .../_build/assets/CharacterWindow-r4JBxCcd.js | 1 + .../assets/CombatPickerWindow-Dn19Owcx.js | 1 + .../assets/CombatStatsWindow-Cp6gbZMF.js | 1 + .../_build/assets/InventoryWindow-BakfUY1F.js | 1 + static/_build/assets/IssuesWindow-CrYOTY1n.js | 1 + .../assets/PlayerDashboardWindow-fofpF1Et.js | 1 + .../assets/QuestStatusWindow-YiUHZSeT.js | 1 + static/_build/assets/RadarWindow-CqeTYRoC.js | 1 + static/_build/assets/StatsWindow-B26MeIH_.js | 1 + .../assets/VitalSharingWindow-DDYw2SOf.js | 1 + static/_build/assets/index-BipVD-xb.js | 34 +++++++++ static/_build/assets/index-BsAcOCNp.css | 1 + static/_build/assets/react-yfL0ty4i.js | 17 +++++ static/_build/index.html | 18 +++++ static/_build/sw.js | 72 +++++++++++++++++++ 18 files changed, 176 insertions(+), 9 deletions(-) create mode 100644 static/_build/assets/CharacterWindow-r4JBxCcd.js create mode 100644 static/_build/assets/CombatPickerWindow-Dn19Owcx.js create mode 100644 static/_build/assets/CombatStatsWindow-Cp6gbZMF.js create mode 100644 static/_build/assets/InventoryWindow-BakfUY1F.js create mode 100644 static/_build/assets/IssuesWindow-CrYOTY1n.js create mode 100644 static/_build/assets/PlayerDashboardWindow-fofpF1Et.js create mode 100644 static/_build/assets/QuestStatusWindow-YiUHZSeT.js create mode 100644 static/_build/assets/RadarWindow-CqeTYRoC.js create mode 100644 static/_build/assets/StatsWindow-B26MeIH_.js create mode 100644 static/_build/assets/VitalSharingWindow-DDYw2SOf.js create mode 100644 static/_build/assets/index-BipVD-xb.js create mode 100644 static/_build/assets/index-BsAcOCNp.css create mode 100644 static/_build/assets/react-yfL0ty4i.js create mode 100644 static/_build/index.html create mode 100644 static/_build/sw.js diff --git a/frontend/src/components/map/MapLayout.tsx b/frontend/src/components/map/MapLayout.tsx index fd6a4092..73b11215 100644 --- a/frontend/src/components/map/MapLayout.tsx +++ b/frontend/src/components/map/MapLayout.tsx @@ -66,7 +66,7 @@ export const MapLayout: React.FC = ({ data }) => { selectedPlayer={selectedPlayer} /> diff --git a/frontend/src/components/windows/WindowRenderer.tsx b/frontend/src/components/windows/WindowRenderer.tsx index a506cb9a..ea4f06cb 100644 --- a/frontend/src/components/windows/WindowRenderer.tsx +++ b/frontend/src/components/windows/WindowRenderer.tsx @@ -17,13 +17,15 @@ interface Props { characters: Map; chatMessages: Map>; nearbyObjects: Map; - inventoryVersion: number; + /** Per-character inventory counters. InventoryWindow watches only its + * own character's value so unrelated deltas don't reset its debounce. */ + inventoryVersions: Map; equipmentCantrips: Map; characterStats: Map; socket: WebSocket | null; } -export const WindowRenderer: React.FC = React.memo(({ characters, chatMessages, nearbyObjects, inventoryVersion, equipmentCantrips, characterStats, socket }) => { +export const WindowRenderer: React.FC = React.memo(({ characters, chatMessages, nearbyObjects, inventoryVersions, equipmentCantrips, characterStats, socket }) => { const { windows } = useWindowManager(); return ( @@ -44,7 +46,7 @@ export const WindowRenderer: React.FC = React.memo(({ characters, chatMes liveStats={characterStats.get(charName)} />; case 'inv': return ; + inventoryVersion={inventoryVersions.get(charName) ?? 0} equipmentCantrips={equipmentCantrips.get(charName)} />; case 'radar': return ; diff --git a/frontend/src/hooks/useLiveData.ts b/frontend/src/hooks/useLiveData.ts index a04a79d2..7abf5481 100644 --- a/frontend/src/hooks/useLiveData.ts +++ b/frontend/src/hooks/useLiveData.ts @@ -14,7 +14,11 @@ export interface DashboardState { recentRares: RareMessage[]; chatMessages: Map>; nearbyObjects: Map; - inventoryVersion: number; + /** Per-character inventory version counter — bumps when that character + * receives an inventory_delta. Open windows watch only their own + * character's counter so deltas for unrelated chars don't reset their + * debounce timer. */ + inventoryVersions: Map; equipmentCantrips: Map; characterStats: Map; deathAlerts: Array<{ character_name: string; vitae: number; timestamp: string }>; @@ -29,7 +33,7 @@ export function useLiveData(): DashboardState { const [recentRares, setRecentRares] = useState([]); const chatMessagesRef = useRef(new Map>()); const [chatVersion, setChatVersion] = useState(0); - const [inventoryVersion, setInventoryVersion] = useState(0); + const [inventoryVersions, setInventoryVersions] = useState>(new Map()); const equipmentCantripRef = useRef(new Map()); const [equipCantripVersion, setEquipCantripVersion] = useState(0); const characterStatsRef = useRef(new Map()); @@ -72,8 +76,17 @@ export function useLiveData(): DashboardState { setRecentRares(prev => [r, ...prev].slice(0, 50)); } else if (msg.type === 'inventory_delta') { const d = msg as unknown as { character_name: string }; - // Bump inventory version so open inventory windows can re-fetch - setInventoryVersion(v => v + 1); + // Bump ONLY this character's inventory version so an open window for + // that character re-fetches. Deltas for other characters don't touch + // it, which keeps the 2s debounce in InventoryWindow from being reset + // forever by unrelated chatter. + if (d.character_name) { + setInventoryVersions(prev => { + const next = new Map(prev); + next.set(d.character_name, (next.get(d.character_name) ?? 0) + 1); + return next; + }); + } } else if (msg.type === 'character_stats') { // Store full character stats for CharacterWindow live updates const cs = msg as unknown as { character_name: string }; @@ -200,5 +213,5 @@ export function useLiveData(): DashboardState { // eslint-disable-next-line react-hooks/exhaustive-deps const characterStats = useMemo(() => characterStatsRef.current, [charStatsVersion]); - return { characters, serverHealth, totalRares, totalKills, recentRares, chatMessages, nearbyObjects, inventoryVersion, equipmentCantrips, characterStats, deathAlerts, socketRef }; + return { characters, serverHealth, totalRares, totalKills, recentRares, chatMessages, nearbyObjects, inventoryVersions, equipmentCantrips, characterStats, deathAlerts, socketRef }; } diff --git a/static/_build/assets/CharacterWindow-r4JBxCcd.js b/static/_build/assets/CharacterWindow-r4JBxCcd.js new file mode 100644 index 00000000..4c08fffe --- /dev/null +++ b/static/_build/assets/CharacterWindow-r4JBxCcd.js @@ -0,0 +1 @@ +import{r as f,a as J,j as e,D as K}from"./index-BipVD-xb.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/_build/assets/CombatPickerWindow-Dn19Owcx.js b/static/_build/assets/CombatPickerWindow-Dn19Owcx.js new file mode 100644 index 00000000..afddc2fa --- /dev/null +++ b/static/_build/assets/CombatPickerWindow-Dn19Owcx.js @@ -0,0 +1 @@ +import{u as c,j as r,D as d}from"./index-BipVD-xb.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/_build/assets/CombatStatsWindow-Cp6gbZMF.js b/static/_build/assets/CombatStatsWindow-Cp6gbZMF.js new file mode 100644 index 00000000..0bcf3b93 --- /dev/null +++ b/static/_build/assets/CombatStatsWindow-Cp6gbZMF.js @@ -0,0 +1 @@ +import{r as A,a as B,j as t,D as L}from"./index-BipVD-xb.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/_build/assets/InventoryWindow-BakfUY1F.js b/static/_build/assets/InventoryWindow-BakfUY1F.js new file mode 100644 index 00000000..5fc71b3d --- /dev/null +++ b/static/_build/assets/InventoryWindow-BakfUY1F.js @@ -0,0 +1 @@ +import{r as _,a as T,j as n,D as Q}from"./index-BipVD-xb.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 C(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/${C(e.icon_underlay_id)}.png`:null,d=e.icon_overlay_id&&e.icon_overlay_id>100?`/icons/${C(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/${C(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),D=_.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(D.current),D.current=window.setTimeout(()=>{T(`/inventory/${encodeURIComponent(o)}?limit=1000`).then(t=>j((t.items??[]).map(X))).catch(()=>{})},2e3),()=>clearTimeout(D.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/${C(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/_build/assets/IssuesWindow-CrYOTY1n.js b/static/_build/assets/IssuesWindow-CrYOTY1n.js new file mode 100644 index 00000000..a8cc16f9 --- /dev/null +++ b/static/_build/assets/IssuesWindow-CrYOTY1n.js @@ -0,0 +1 @@ +import{r as n,a as W,j as e,D as L}from"./index-BipVD-xb.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/_build/assets/PlayerDashboardWindow-fofpF1Et.js b/static/_build/assets/PlayerDashboardWindow-fofpF1Et.js new file mode 100644 index 00000000..f995660d --- /dev/null +++ b/static/_build/assets/PlayerDashboardWindow-fofpF1Et.js @@ -0,0 +1 @@ +import{r as d,j as t,D as y}from"./index-BipVD-xb.js";import"./react-yfL0ty4i.js";const A=({id:u,zIndex:f,characters:h})=>{const[o,k]=d.useState("kph"),[c,x]=d.useState(!1),p=d.useMemo(()=>{const e=Array.from(h.values()).filter(r=>r.telemetry).map(r=>{var i,g,m;const s=r.telemetry;return{name:r.name,kills:s.kills??0,kph:parseInt(s.kills_per_hour)||0,totalKills:s.total_kills??0,rares:s.total_rares??0,sessionRares:s.session_rares??0,deaths:parseInt(s.deaths)||0,totalDeaths:parseInt(s.total_deaths)||0,uptime:((i=s.onlinetime)==null?void 0:i.replace(/^00\./,""))??"",state:s.vt_state??"idle",tapers:parseInt(s.prismatic_taper_count)||0,hp:((g=r.vitals)==null?void 0:g.health_percentage)??0,vitae:((m=r.vitals)==null?void 0:m.vitae)??0}});return e.sort((r,s)=>{let i=0;switch(o){case"name":i=r.name.localeCompare(s.name);break;case"kills":i=r.kills-s.kills;break;case"kph":i=r.kph-s.kph;break;case"rares":i=r.rares-s.rares;break;case"deaths":i=r.totalDeaths-s.totalDeaths;break;case"uptime":i=r.uptime.localeCompare(s.uptime);break;case"state":i=r.state.localeCompare(s.state);break}return c?i:-i}),e},[h,o,c]),l=e=>{o===e?x(!c):(k(e),x(!1))},a=e=>({padding:"4px 6px",cursor:"pointer",userSelect:"none",color:o===e?"#6af":"#888",fontSize:"0.65rem",fontWeight:600,whiteSpace:"nowrap",borderBottom:"1px solid #444"}),n=e=>o===e?c?" ▲":" ▼":"";return t.jsx(y,{id:u,title:"Player Dashboard",zIndex:f,width:850,height:500,children:t.jsxs("div",{style:{flex:1,overflow:"auto",fontSize:"0.73rem"},children:[t.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[t.jsx("thead",{children:t.jsxs("tr",{style:{position:"sticky",top:0,background:"#1a1a1a",zIndex:1},children:[t.jsxs("th",{style:{...a("name"),textAlign:"left"},onClick:()=>l("name"),children:["Character",n("name")]}),t.jsxs("th",{style:{...a("state"),textAlign:"center"},onClick:()=>l("state"),children:["State",n("state")]}),t.jsxs("th",{style:{...a("kph"),textAlign:"right"},onClick:()=>l("kph"),children:["KPH",n("kph")]}),t.jsxs("th",{style:{...a("kills"),textAlign:"right"},onClick:()=>l("kills"),children:["Session",n("kills")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Total"}),t.jsxs("th",{style:{...a("rares"),textAlign:"right"},onClick:()=>l("rares"),children:["Rares",n("rares")]}),t.jsxs("th",{style:{...a("deaths"),textAlign:"right"},onClick:()=>l("deaths"),children:["Deaths",n("deaths")]}),t.jsxs("th",{style:{...a("uptime"),textAlign:"right"},onClick:()=>l("uptime"),children:["Uptime",n("uptime")]}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"HP%"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Vitae"}),t.jsx("th",{style:{textAlign:"right",padding:"4px 6px",color:"#888",fontSize:"0.65rem",fontWeight:600,borderBottom:"1px solid #444"},children:"Tapers"})]})}),t.jsx("tbody",{children:p.map(e=>{const r=e.state.toLowerCase(),s=r==="combat"||r==="hunt";return t.jsxs("tr",{style:{borderBottom:"1px solid #1a1a1a"},children:[t.jsx("td",{style:{padding:"3px 6px",color:"#ccc",fontWeight:500,maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsx("td",{style:{textAlign:"center",padding:"3px 6px"},children:t.jsx("span",{style:{fontSize:"0.6rem",padding:"1px 6px",borderRadius:3,background:s?"rgba(68,204,68,0.15)":r==="idle"||r==="default"?"rgba(100,100,100,0.2)":"rgba(204,68,68,0.15)",color:s?"#4c4":r==="idle"||r==="default"?"#888":"#c44"},children:e.state})}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#4c4",fontVariantNumeric:"tabular-nums"},children:e.kph.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#ccc",fontVariantNumeric:"tabular-nums"},children:e.kills.toLocaleString()}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.totalKills.toLocaleString()}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",color:"#fc0",fontVariantNumeric:"tabular-nums"},children:[e.rares,e.sessionRares>0?` (${e.sessionRares})`:""]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:e.totalDeaths>0?"#c66":"#555",fontVariantNumeric:"tabular-nums"},children:e.totalDeaths}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.uptime}),t.jsxs("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.hp>80?"#4c4":e.hp>40?"#ca0":"#c44"},children:[e.hp.toFixed(0),"%"]}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",fontVariantNumeric:"tabular-nums",color:e.vitae>0?"#f66":"#333"},children:e.vitae>0?`${e.vitae}%`:""}),t.jsx("td",{style:{textAlign:"right",padding:"3px 6px",color:"#888",fontVariantNumeric:"tabular-nums"},children:e.tapers.toLocaleString()})]},e.name)})})]}),p.length===0&&t.jsx("div",{style:{padding:20,color:"#666",textAlign:"center"},children:"No characters online"})]})})};export{A as PlayerDashboardWindow}; diff --git a/static/_build/assets/QuestStatusWindow-YiUHZSeT.js b/static/_build/assets/QuestStatusWindow-YiUHZSeT.js new file mode 100644 index 00000000..5e754c87 --- /dev/null +++ b/static/_build/assets/QuestStatusWindow-YiUHZSeT.js @@ -0,0 +1 @@ +import{r as c,j as t,D as u,a as f}from"./index-BipVD-xb.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/_build/assets/RadarWindow-CqeTYRoC.js b/static/_build/assets/RadarWindow-CqeTYRoC.js new file mode 100644 index 00000000..a031f851 --- /dev/null +++ b/static/_build/assets/RadarWindow-CqeTYRoC.js @@ -0,0 +1 @@ +import{r as x,j as c,D as ne}from"./index-BipVD-xb.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/_build/assets/StatsWindow-B26MeIH_.js b/static/_build/assets/StatsWindow-B26MeIH_.js new file mode 100644 index 00000000..4a8fa311 --- /dev/null +++ b/static/_build/assets/StatsWindow-B26MeIH_.js @@ -0,0 +1 @@ +import{r as o,j as t,D as d}from"./index-BipVD-xb.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/_build/assets/VitalSharingWindow-DDYw2SOf.js b/static/_build/assets/VitalSharingWindow-DDYw2SOf.js new file mode 100644 index 00000000..fbcd6f2f --- /dev/null +++ b/static/_build/assets/VitalSharingWindow-DDYw2SOf.js @@ -0,0 +1 @@ +import{r as n,j as t,D as x,a as m}from"./index-BipVD-xb.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/_build/assets/index-BipVD-xb.js b/static/_build/assets/index-BipVD-xb.js new file mode 100644 index 00000000..57a0a089 --- /dev/null +++ b/static/_build/assets/index-BipVD-xb.js @@ -0,0 +1,34 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StatsWindow-B26MeIH_.js","assets/react-yfL0ty4i.js","assets/CharacterWindow-r4JBxCcd.js","assets/InventoryWindow-BakfUY1F.js","assets/RadarWindow-CqeTYRoC.js","assets/CombatStatsWindow-Cp6gbZMF.js","assets/CombatPickerWindow-Dn19Owcx.js","assets/IssuesWindow-CrYOTY1n.js","assets/VitalSharingWindow-DDYw2SOf.js","assets/QuestStatusWindow-YiUHZSeT.js","assets/PlayerDashboardWindow-fofpF1Et.js"])))=>i.map(i=>d[i]); +import{r as M0,g as eh,a as uh}from"./react-yfL0ty4i.js";(function(){const M=document.createElement("link").relList;if(M&&M.supports&&M.supports("modulepreload"))return;for(const U of document.querySelectorAll('link[rel="modulepreload"]'))d(U);new MutationObserver(U=>{for(const N of U)if(N.type==="childList")for(const D of N.addedNodes)D.tagName==="LINK"&&D.rel==="modulepreload"&&d(D)}).observe(document,{childList:!0,subtree:!0});function x(U){const N={};return U.integrity&&(N.integrity=U.integrity),U.referrerPolicy&&(N.referrerPolicy=U.referrerPolicy),U.crossOrigin==="use-credentials"?N.credentials="include":U.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function d(U){if(U.ep)return;U.ep=!0;const N=x(U);fetch(U.href,N)}})();var sf={exports:{}},gu={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var v0;function nh(){if(v0)return gu;v0=1;var o=Symbol.for("react.transitional.element"),M=Symbol.for("react.fragment");function x(d,U,N){var D=null;if(N!==void 0&&(D=""+N),U.key!==void 0&&(D=""+U.key),"key"in U){N={};for(var O in U)O!=="key"&&(N[O]=U[O])}else N=U;return U=N.ref,{$$typeof:o,type:d,key:D,ref:U!==void 0?U:null,props:N}}return gu.Fragment=M,gu.jsx=x,gu.jsxs=x,gu}var g0;function ch(){return g0||(g0=1,sf.exports=nh()),sf.exports}var y=ch(),T=M0();const bu=eh(T);var of={exports:{}},Su={},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 S0;function ih(){return S0||(S0=1,(function(o){function M(v,C){var G=v.length;v.push(C);l:for(;0>>1,B=v[R];if(0>>1;RU($,G))RlU(At,$)?(v[R]=At,v[Rl]=G,R=Rl):(v[R]=$,v[sl]=G,R=sl);else if(RlU(At,G))v[R]=At,v[Rl]=G,R=Rl;else break l}}return C}function U(v,C){var G=v.sortIndex-C.sortIndex;return G!==0?G:v.id-C.id}if(o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;o.unstable_now=function(){return N.now()}}else{var D=Date,O=D.now();o.unstable_now=function(){return D.now()-O}}var S=[],E=[],Y=1,z=null,j=3,q=!1,I=!1,ul=!1,rl=!1,Sl=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function xl(v){for(var C=x(E);C!==null;){if(C.callback===null)d(E);else if(C.startTime<=v)d(E),C.sortIndex=C.expirationTime,M(S,C);else break;C=x(E)}}function Zl(v){if(ul=!1,xl(v),!I)if(x(S)!==null)I=!0,F||(F=!0,Tl());else{var C=x(E);C!==null&&St(Zl,C.startTime-v)}}var F=!1,P=-1,Q=5,L=-1;function k(){return rl?!0:!(o.unstable_now()-Lv&&k());){var R=z.callback;if(typeof R=="function"){z.callback=null,j=z.priorityLevel;var B=R(z.expirationTime<=v);if(v=o.unstable_now(),typeof B=="function"){z.callback=B,xl(v),C=!0;break t}z===x(S)&&d(S),xl(v)}else d(S);z=x(S)}if(z!==null)C=!0;else{var fl=x(E);fl!==null&&St(Zl,fl.startTime-v),C=!1}}break l}finally{z=null,j=G,q=!1}C=void 0}}finally{C?Tl():F=!1}}}var Tl;if(typeof J=="function")Tl=function(){J(jl)};else if(typeof MessageChannel<"u"){var Ot=new MessageChannel,Tt=Ot.port2;Ot.port1.onmessage=jl,Tl=function(){Tt.postMessage(null)}}else Tl=function(){Sl(jl,0)};function St(v,C){P=Sl(function(){v(o.unstable_now())},C)}o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(v){v.callback=null},o.unstable_forceFrameRate=function(v){0>v||125R?(v.sortIndex=G,M(E,v),x(S)===null&&v===x(E)&&(ul?(K(P),P=-1):ul=!0,St(Zl,G-R))):(v.sortIndex=B,M(S,v),I||q||(I=!0,F||(F=!0,Tl()))),v},o.unstable_shouldYield=k,o.unstable_wrapCallback=function(v){var C=j;return function(){var G=j;j=C;try{return v.apply(this,arguments)}finally{j=G}}}})(mf)),mf}var b0;function fh(){return b0||(b0=1,df.exports=ih()),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 z0;function sh(){if(z0)return Su;z0=1;var o=fh(),M=M0(),x=uh();function d(l){var t="https://react.dev/errors/"+l;if(1B||(l.current=R[B],R[B]=null,B--)}function $(l,t){B++,R[B]=l.current,l.current=t}var Rl=fl(null),At=fl(null),kt=fl(null),Tu=fl(null);function Au(l,t){switch($(kt,t),$(At,l),$(Rl,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Xd(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Xd(t),l=Gd(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}sl(Rl),$(Rl,l)}function Ga(){sl(Rl),sl(At),sl(kt)}function Vn(l){l.memoizedState!==null&&$(Tu,l);var t=Rl.current,a=Gd(t,l.type);t!==a&&($(At,l),$(Rl,a))}function Eu(l){At.current===l&&(sl(Rl),sl(At)),Tu.current===l&&(sl(Tu),ru._currentValue=G)}var Ln,hf;function pa(l){if(Ln===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Ln=t&&t[1]||"",hf=-1)":-1u||f[e]!==h[u]){var p=` +`+f[e].replace(" at new "," at ");return l.displayName&&p.includes("")&&(p=p.replace("",l.displayName)),p}while(1<=e&&0<=u);break}}}finally{Kn=!1,Error.prepareStackTrace=a}return(a=l?l.displayName||l.name:"")?pa(a):""}function R0(l,t){switch(l.tag){case 26:case 27:case 5:return pa(l.type);case 16:return pa("Lazy");case 13:return l.child!==t&&t!==null?pa("Suspense Fallback"):pa("Suspense");case 19:return pa("SuspenseList");case 0:case 15:return Jn(l.type,!1);case 11:return Jn(l.type.render,!1);case 1:return Jn(l.type,!0);case 31:return pa("Activity");default:return""}}function yf(l){try{var t="",a=null;do t+=R0(l,a),a=l,l=l.return;while(l);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var wn=Object.prototype.hasOwnProperty,kn=o.unstable_scheduleCallback,Wn=o.unstable_cancelCallback,H0=o.unstable_shouldYield,q0=o.unstable_requestPaint,$l=o.unstable_now,B0=o.unstable_getCurrentPriorityLevel,vf=o.unstable_ImmediatePriority,gf=o.unstable_UserBlockingPriority,_u=o.unstable_NormalPriority,Y0=o.unstable_LowPriority,Sf=o.unstable_IdlePriority,X0=o.log,G0=o.unstable_setDisableYieldValue,_e=null,Il=null;function Wt(l){if(typeof X0=="function"&&G0(l),Il&&typeof Il.setStrictMode=="function")try{Il.setStrictMode(_e,l)}catch{}}var Pl=Math.clz32?Math.clz32:V0,Q0=Math.log,Z0=Math.LN2;function V0(l){return l>>>=0,l===0?32:31-(Q0(l)/Z0|0)|0}var Mu=256,xu=262144,Du=4194304;function Ta(l){var t=l&42;if(t!==0)return t;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Ou(l,t,a){var e=l.pendingLanes;if(e===0)return 0;var u=0,n=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=e&134217727;return i!==0?(e=i&~n,e!==0?u=Ta(e):(c&=i,c!==0?u=Ta(c):a||(a=i&~l,a!==0&&(u=Ta(a))))):(i=e&~n,i!==0?u=Ta(i):c!==0?u=Ta(c):a||(a=e&~l,a!==0&&(u=Ta(a)))),u===0?0:t!==0&&t!==u&&(t&n)===0&&(n=u&-u,a=t&-t,n>=a||n===32&&(a&4194048)!==0)?t:u}function Me(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function L0(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 bf(){var l=Du;return Du<<=1,(Du&62914560)===0&&(Du=4194304),l}function Fn(l){for(var t=[],a=0;31>a;a++)t.push(l);return t}function xe(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function K0(l,t,a,e,u,n){var c=l.pendingLanes;l.pendingLanes=a,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=a,l.entangledLanes&=a,l.errorRecoveryDisabledLanes&=a,l.shellSuspendCounter=0;var i=l.entanglements,f=l.expirationTimes,h=l.hiddenUpdates;for(a=c&~a;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var $0=/[\n"\\]/g;function ft(l){return l.replace($0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ac(l,t,a,e,u,n,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+it(t)):l.value!==""+it(t)&&(l.value=""+it(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?ec(l,c,it(t)):a!=null?ec(l,c,it(a)):e!=null&&l.removeAttribute("value"),u==null&&n!=null&&(l.defaultChecked=!!n),u!=null&&(l.checked=u&&typeof u!="function"&&typeof u!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+it(i):l.removeAttribute("name")}function jf(l,t,a,e,u,n,c,i){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(l.type=n),t!=null||a!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){tc(l);return}a=a!=null?""+it(a):"",t=t!=null?""+it(t):a,i||t===l.value||(l.value=t),l.defaultValue=t}e=e??u,e=typeof e!="function"&&typeof e!="symbol"&&!!e,l.checked=i?l.checked:!!e,l.defaultChecked=!!e,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),tc(l)}function ec(l,t,a){t==="number"&&ju(l.ownerDocument)===l||l.defaultValue===""+a||(l.defaultValue=""+a)}function Ja(l,t,a,e){if(l=l.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fc=!1;if(jt)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){fc=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch{fc=!1}var $t=null,sc=null,Ru=null;function Xf(){if(Ru)return Ru;var l,t=sc,a=t.length,e,u="value"in $t?$t.value:$t.textContent,n=u.length;for(l=0;l=Re),Kf=" ",Jf=!1;function wf(l,t){switch(l){case"keyup":return _m.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kf(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Fa=!1;function xm(l,t){switch(l){case"compositionend":return kf(t);case"keypress":return t.which!==32?null:(Jf=!0,Kf);case"textInput":return l=t.data,l===Kf&&Jf?null:l;default:return null}}function Dm(l,t){if(Fa)return l==="compositionend"||!hc&&wf(l,t)?(l=Xf(),Ru=sc=$t=null,Fa=!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=as(a)}}function us(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?us(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function ns(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=ju(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=ju(l.document)}return t}function gc(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=jt&&"documentMode"in document&&11>=document.documentMode,$a=null,Sc=null,Ye=null,bc=!1;function cs(l,t,a){var e=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;bc||$a==null||$a!==ju(e)||(e=$a,"selectionStart"in e&&gc(e)?e={start:e.selectionStart,end:e.selectionEnd}:(e=(e.ownerDocument&&e.ownerDocument.defaultView||window).getSelection(),e={anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset}),Ye&&Be(Ye,e)||(Ye=e,e=Dn(Sc,"onSelect"),0>=c,u-=c,Et=1<<32-Pl(t)+u|a<W?(el=X,X=null):el=X.sibling;var il=g(m,X,r[W],A);if(il===null){X===null&&(X=el);break}l&&X&&il.alternate===null&&t(m,X),s=n(il,s,W),cl===null?Z=il:cl.sibling=il,cl=il,X=el}if(W===r.length)return a(m,X),nl&&Rt(m,W),Z;if(X===null){for(;WW?(el=X,X=null):el=X.sibling;var ba=g(m,X,il.value,A);if(ba===null){X===null&&(X=el);break}l&&X&&ba.alternate===null&&t(m,X),s=n(ba,s,W),cl===null?Z=ba:cl.sibling=ba,cl=ba,X=el}if(il.done)return a(m,X),nl&&Rt(m,W),Z;if(X===null){for(;!il.done;W++,il=r.next())il=_(m,il.value,A),il!==null&&(s=n(il,s,W),cl===null?Z=il:cl.sibling=il,cl=il);return nl&&Rt(m,W),Z}for(X=e(X);!il.done;W++,il=r.next())il=b(X,m,W,il.value,A),il!==null&&(l&&il.alternate!==null&&X.delete(il.key===null?W:il.key),s=n(il,s,W),cl===null?Z=il:cl.sibling=il,cl=il);return l&&X.forEach(function(ah){return t(m,ah)}),nl&&Rt(m,W),Z}function vl(m,s,r,A){if(typeof r=="object"&&r!==null&&r.type===ul&&r.key===null&&(r=r.props.children),typeof r=="object"&&r!==null){switch(r.$$typeof){case q:l:{for(var Z=r.key;s!==null;){if(s.key===Z){if(Z=r.type,Z===ul){if(s.tag===7){a(m,s.sibling),A=u(s,r.props.children),A.return=m,m=A;break l}}else if(s.elementType===Z||typeof Z=="object"&&Z!==null&&Z.$$typeof===Q&&Ca(Z)===s.type){a(m,s.sibling),A=u(s,r.props),Le(A,r),A.return=m,m=A;break l}a(m,s);break}else t(m,s);s=s.sibling}r.type===ul?(A=Da(r.props.children,m.mode,A,r.key),A.return=m,m=A):(A=Lu(r.type,r.key,r.props,null,m.mode,A),Le(A,r),A.return=m,m=A)}return c(m);case I:l:{for(Z=r.key;s!==null;){if(s.key===Z)if(s.tag===4&&s.stateNode.containerInfo===r.containerInfo&&s.stateNode.implementation===r.implementation){a(m,s.sibling),A=u(s,r.children||[]),A.return=m,m=A;break l}else{a(m,s);break}else t(m,s);s=s.sibling}A=Mc(r,m.mode,A),A.return=m,m=A}return c(m);case Q:return r=Ca(r),vl(m,s,r,A)}if(St(r))return H(m,s,r,A);if(Tl(r)){if(Z=Tl(r),typeof Z!="function")throw Error(d(150));return r=Z.call(r),V(m,s,r,A)}if(typeof r.then=="function")return vl(m,s,$u(r),A);if(r.$$typeof===J)return vl(m,s,wu(m,r),A);Iu(m,r)}return typeof r=="string"&&r!==""||typeof r=="number"||typeof r=="bigint"?(r=""+r,s!==null&&s.tag===6?(a(m,s.sibling),A=u(s,r),A.return=m,m=A):(a(m,s),A=_c(r,m.mode,A),A.return=m,m=A),c(m)):a(m,s)}return function(m,s,r,A){try{Ve=0;var Z=vl(m,s,r,A);return fe=null,Z}catch(X){if(X===ie||X===Wu)throw X;var cl=tt(29,X,null,m.mode);return cl.lanes=A,cl.return=m,cl}finally{}}}var Ha=Os(!0),Ns=Os(!1),aa=!1;function Yc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xc(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 ea(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 u=e.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),e.pending=t,t=Vu(l),rs(l,null,a),t}return Zu(l,e,t,a),Vu(l)}function Ke(l,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}function Gc(l,t){var a=l.updateQueue,e=l.alternate;if(e!==null&&(e=e.updateQueue,a===e)){var u=null,n=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};n===null?u=n=c:n=n.next=c,a=a.next}while(a!==null);n===null?u=n=t:n=n.next=t}else u=n=t;a={baseState:e.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:e.shared,callbacks:e.callbacks},l.updateQueue=a;return}l=a.lastBaseUpdate,l===null?a.firstBaseUpdate=t:l.next=t,a.lastBaseUpdate=t}var Qc=!1;function Je(){if(Qc){var l=ce;if(l!==null)throw l}}function we(l,t,a,e){Qc=!1;var u=l.updateQueue;aa=!1;var n=u.firstBaseUpdate,c=u.lastBaseUpdate,i=u.shared.pending;if(i!==null){u.shared.pending=null;var f=i,h=f.next;f.next=null,c===null?n=h:c.next=h,c=f;var p=l.alternate;p!==null&&(p=p.updateQueue,i=p.lastBaseUpdate,i!==c&&(i===null?p.firstBaseUpdate=h:i.next=h,p.lastBaseUpdate=f))}if(n!==null){var _=u.baseState;c=0,p=h=f=null,i=n;do{var g=i.lane&-536870913,b=g!==i.lane;if(b?(al&g)===g:(e&g)===g){g!==0&&g===ne&&(Qc=!0),p!==null&&(p=p.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var H=l,V=i;g=t;var vl=a;switch(V.tag){case 1:if(H=V.payload,typeof H=="function"){_=H.call(vl,_,g);break l}_=H;break l;case 3:H.flags=H.flags&-65537|128;case 0:if(H=V.payload,g=typeof H=="function"?H.call(vl,_,g):H,g==null)break l;_=z({},_,g);break l;case 2:aa=!0}}g=i.callback,g!==null&&(l.flags|=64,b&&(l.flags|=8192),b=u.callbacks,b===null?u.callbacks=[g]:b.push(g))}else b={lane:g,tag:i.tag,payload:i.payload,callback:i.callback,next:null},p===null?(h=p=b,f=_):p=p.next=b,c|=g;if(i=i.next,i===null){if(i=u.shared.pending,i===null)break;b=i,i=b.next,b.next=null,u.lastBaseUpdate=b,u.shared.pending=null}}while(!0);p===null&&(f=_),u.baseState=f,u.firstBaseUpdate=h,u.lastBaseUpdate=p,n===null&&(u.shared.lanes=0),sa|=c,l.lanes=c,l.memoizedState=_}}function Us(l,t){if(typeof l!="function")throw Error(d(191,l));l.call(t)}function js(l,t){var a=l.callbacks;if(a!==null)for(l.callbacks=null,l=0;ln?n:8;var c=v.T,i={};v.T=i,ci(l,!1,t,a);try{var f=u(),h=v.S;if(h!==null&&h(i,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var p=Km(f,e);Fe(l,t,p,ct(l))}else Fe(l,t,e,ct(l))}catch(_){Fe(l,t,{then:function(){},status:"rejected",reason:_},ct())}finally{C.p=n,c!==null&&i.types!==null&&(c.types=i.types),v.T=c}}function $m(){}function ui(l,t,a,e){if(l.tag!==5)throw Error(d(476));var u=oo(l).queue;so(l,u,t,G,a===null?$m:function(){return mo(l),a(e)})}function oo(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:Yt,lastRenderedState:G},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yt,lastRenderedState:a},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function mo(l){var t=oo(l);t.next===null&&(t=l.alternate.memoizedState),Fe(l,t.next.queue,{},ct())}function ni(){return Xl(ru)}function ro(){return Ml().memoizedState}function ho(){return Ml().memoizedState}function Im(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var a=ct();l=ea(a);var e=ua(t,l,a);e!==null&&(Fl(e,t,a),Ke(e,t,a)),t={cache:Rc()},l.payload=t;return}t=t.return}}function Pm(l,t,a){var e=ct();a={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},sn(l)?vo(t,a):(a=Ac(l,t,a,e),a!==null&&(Fl(a,l,e),go(a,t,e)))}function yo(l,t,a){var e=ct();Fe(l,t,a,e)}function Fe(l,t,a,e){var u={lane:e,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(sn(l))vo(t,u);else{var n=l.alternate;if(l.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var c=t.lastRenderedState,i=n(c,a);if(u.hasEagerState=!0,u.eagerState=i,lt(i,c))return Zu(l,t,u,0),gl===null&&Qu(),!1}catch{}finally{}if(a=Ac(l,t,u,e),a!==null)return Fl(a,l,e),go(a,t,e),!0}return!1}function ci(l,t,a,e){if(e={lane:2,revertLane:Yi(),gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(l)){if(t)throw Error(d(479))}else t=Ac(l,a,e,2),t!==null&&Fl(t,l,2)}function sn(l){var t=l.alternate;return l===w||t!==null&&t===w}function vo(l,t){oe=tn=!0;var a=l.pending;a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t}function go(l,t,a){if((a&4194048)!==0){var e=t.lanes;e&=l.pendingLanes,a|=e,t.lanes=a,pf(l,a)}}var $e={readContext:Xl,use:un,useCallback:Al,useContext:Al,useEffect:Al,useImperativeHandle:Al,useLayoutEffect:Al,useInsertionEffect:Al,useMemo:Al,useReducer:Al,useRef:Al,useState:Al,useDebugValue:Al,useDeferredValue:Al,useTransition:Al,useSyncExternalStore:Al,useId:Al,useHostTransitionStatus:Al,useFormState:Al,useActionState:Al,useOptimistic:Al,useMemoCache:Al,useCacheRefresh:Al};$e.useEffectEvent=Al;var So={readContext:Xl,use:un,useCallback:function(l,t){return Vl().memoizedState=[l,t===void 0?null:t],l},useContext:Xl,useEffect:lo,useImperativeHandle:function(l,t,a){a=a!=null?a.concat([l]):null,cn(4194308,4,uo.bind(null,t,l),a)},useLayoutEffect:function(l,t){return cn(4194308,4,l,t)},useInsertionEffect:function(l,t){cn(4,2,l,t)},useMemo:function(l,t){var a=Vl();t=t===void 0?null:t;var e=l();if(qa){Wt(!0);try{l()}finally{Wt(!1)}}return a.memoizedState=[e,t],e},useReducer:function(l,t,a){var e=Vl();if(a!==void 0){var u=a(t);if(qa){Wt(!0);try{a(t)}finally{Wt(!1)}}}else u=t;return e.memoizedState=e.baseState=u,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},e.queue=l,l=l.dispatch=Pm.bind(null,w,l),[e.memoizedState,l]},useRef:function(l){var t=Vl();return l={current:l},t.memoizedState=l},useState:function(l){l=Pc(l);var t=l.queue,a=yo.bind(null,w,t);return t.dispatch=a,[l.memoizedState,a]},useDebugValue:ai,useDeferredValue:function(l,t){var a=Vl();return ei(a,l,t)},useTransition:function(){var l=Pc(!1);return l=so.bind(null,w,l.queue,!0,!1),Vl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,a){var e=w,u=Vl();if(nl){if(a===void 0)throw Error(d(407));a=a()}else{if(a=t(),gl===null)throw Error(d(349));(al&127)!==0||Ys(e,t,a)}u.memoizedState=a;var n={value:a,getSnapshot:t};return u.queue=n,lo(Gs.bind(null,e,n,l),[l]),e.flags|=2048,me(9,{destroy:void 0},Xs.bind(null,e,n,a,t),null),a},useId:function(){var l=Vl(),t=gl.identifierPrefix;if(nl){var a=_t,e=Et;a=(e&~(1<<32-Pl(e)-1)).toString(32)+a,t="_"+t+"R_"+a,a=an++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof e.is=="string"?c.createElement("select",{is:e.is}):c.createElement("select"),e.multiple?n.multiple=!0:e.size&&(n.size=e.size);break;default:n=typeof e.is=="string"?c.createElement(u,{is:e.is}):c.createElement(u)}}n[Bl]=t,n[Ll]=e;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)n.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=n;l:switch(Ql(n,u,e),u){case"button":case"input":case"select":case"textarea":e=!!e.autoFocus;break l;case"img":e=!0;break l;default:e=!1}e&&Gt(t)}}return zl(t),zi(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,a),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==e&&Gt(t);else{if(typeof e!="string"&&t.stateNode===null)throw Error(d(166));if(l=kt.current,ee(t)){if(l=t.stateNode,a=t.memoizedProps,e=null,u=Yl,u!==null)switch(u.tag){case 27:case 5:e=u.memoizedProps}l[Bl]=t,l=!!(l.nodeValue===a||e!==null&&e.suppressHydrationWarning===!0||Bd(l.nodeValue,a)),l||la(t,!0)}else l=On(l).createTextNode(e),l[Bl]=t,t.stateNode=l}return zl(t),null;case 31:if(a=t.memoizedState,l===null||l.memoizedState!==null){if(e=ee(t),a!==null){if(l===null){if(!e)throw Error(d(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(d(557));l[Bl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zl(t),l=!1}else a=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=a),l=!0;if(!l)return t.flags&256?(et(t),t):(et(t),null);if((t.flags&128)!==0)throw Error(d(558))}return zl(t),null;case 13:if(e=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(u=ee(t),e!==null&&e.dehydrated!==null){if(l===null){if(!u)throw Error(d(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(d(317));u[Bl]=t}else Oa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zl(t),u=!1}else u=Nc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(et(t),t):(et(t),null)}return et(t),(t.flags&128)!==0?(t.lanes=a,t):(a=e!==null,l=l!==null&&l.memoizedState!==null,a&&(e=t.child,u=null,e.alternate!==null&&e.alternate.memoizedState!==null&&e.alternate.memoizedState.cachePool!==null&&(u=e.alternate.memoizedState.cachePool.pool),n=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),n!==u&&(e.flags|=2048)),a!==l&&a&&(t.child.flags|=8192),hn(t,t.updateQueue),zl(t),null);case 4:return Ga(),l===null&&Zi(t.stateNode.containerInfo),zl(t),null;case 10:return qt(t.type),zl(t),null;case 19:if(sl(_l),e=t.memoizedState,e===null)return zl(t),null;if(u=(t.flags&128)!==0,n=e.rendering,n===null)if(u)Pe(e,!1);else{if(El!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(n=ln(l),n!==null){for(t.flags|=128,Pe(e,!1),l=n.updateQueue,t.updateQueue=l,hn(t,l),t.subtreeFlags=0,l=a,a=t.child;a!==null;)hs(a,l),a=a.sibling;return $(_l,_l.current&1|2),nl&&Rt(t,e.treeForkCount),t.child}l=l.sibling}e.tail!==null&&$l()>bn&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304)}else{if(!u)if(l=ln(n),l!==null){if(t.flags|=128,u=!0,l=l.updateQueue,t.updateQueue=l,hn(t,l),Pe(e,!0),e.tail===null&&e.tailMode==="hidden"&&!n.alternate&&!nl)return zl(t),null}else 2*$l()-e.renderingStartTime>bn&&a!==536870912&&(t.flags|=128,u=!0,Pe(e,!1),t.lanes=4194304);e.isBackwards?(n.sibling=t.child,t.child=n):(l=e.last,l!==null?l.sibling=n:t.child=n,e.last=n)}return e.tail!==null?(l=e.tail,e.rendering=l,e.tail=l.sibling,e.renderingStartTime=$l(),l.sibling=null,a=_l.current,$(_l,u?a&1|2:a&1),nl&&Rt(t,e.treeForkCount),l):(zl(t),null);case 22:case 23:return et(t),Vc(),e=t.memoizedState!==null,l!==null?l.memoizedState!==null!==e&&(t.flags|=8192):e&&(t.flags|=8192),e?(a&536870912)!==0&&(t.flags&128)===0&&(zl(t),t.subtreeFlags&6&&(t.flags|=8192)):zl(t),a=t.updateQueue,a!==null&&hn(t,a.retryQueue),a=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(a=l.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(t.flags|=2048),l!==null&&sl(ja),null;case 24:return a=null,l!==null&&(a=l.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qt(Dl),zl(t),null;case 25:return null;case 30:return null}throw Error(d(156,t.tag))}function ur(l,t){switch(Dc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return qt(Dl),Ga(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return Eu(t),null;case 31:if(t.memoizedState!==null){if(et(t),t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(et(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Oa()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return sl(_l),null;case 4:return Ga(),null;case 10:return qt(t.type),null;case 22:case 23:return et(t),Vc(),l!==null&&sl(ja),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 Zo(l,t){switch(Dc(t),t.tag){case 3:qt(Dl),Ga();break;case 26:case 27:case 5:Eu(t);break;case 4:Ga();break;case 31:t.memoizedState!==null&&et(t);break;case 13:et(t);break;case 19:sl(_l);break;case 10:qt(t.type);break;case 22:case 23:et(t),Vc(),l!==null&&sl(ja);break;case 24:qt(Dl)}}function lu(l,t){try{var a=t.updateQueue,e=a!==null?a.lastEffect:null;if(e!==null){var u=e.next;a=u;do{if((a.tag&l)===l){e=void 0;var n=a.create,c=a.inst;e=n(),c.destroy=e}a=a.next}while(a!==u)}}catch(i){ml(t,t.return,i)}}function ia(l,t,a){try{var e=t.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var n=u.next;e=n;do{if((e.tag&l)===l){var c=e.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,u=t;var f=a,h=i;try{h()}catch(p){ml(u,f,p)}}}e=e.next}while(e!==n)}}catch(p){ml(t,t.return,p)}}function Vo(l){var t=l.updateQueue;if(t!==null){var a=l.stateNode;try{js(t,a)}catch(e){ml(l,l.return,e)}}}function Lo(l,t,a){a.props=Ba(l.type,l.memoizedProps),a.state=l.memoizedState;try{a.componentWillUnmount()}catch(e){ml(l,t,e)}}function tu(l,t){try{var a=l.ref;if(a!==null){switch(l.tag){case 26:case 27:case 5:var e=l.stateNode;break;case 30:e=l.stateNode;break;default:e=l.stateNode}typeof a=="function"?l.refCleanup=a(e):a.current=e}}catch(u){ml(l,t,u)}}function Mt(l,t){var a=l.ref,e=l.refCleanup;if(a!==null)if(typeof e=="function")try{e()}catch(u){ml(l,t,u)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){ml(l,t,u)}else a.current=null}function 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(u){ml(l,l.return,u)}}function pi(l,t,a){try{var e=l.stateNode;Mr(e,l.type,a,t),e[Ll]=t}catch(u){ml(l,l.return,u)}}function Jo(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&ha(l.type)||l.tag===4}function Ti(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||Jo(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&&ha(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ai(l,t,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&&ha(l.type)&&(a=l.stateNode,t=null),l=l.child,l!==null))for(Ai(l,t,a),l=l.sibling;l!==null;)Ai(l,t,a),l=l.sibling}function yn(l,t,a){var e=l.tag;if(e===5||e===6)l=l.stateNode,t?a.insertBefore(l,t):a.appendChild(l);else if(e!==4&&(e===27&&ha(l.type)&&(a=l.stateNode),l=l.child,l!==null))for(yn(l,t,a),l=l.sibling;l!==null;)yn(l,t,a),l=l.sibling}function wo(l){var t=l.stateNode,a=l.memoizedProps;try{for(var e=l.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Ql(t,e,a),t[Bl]=l,t[Ll]=a}catch(n){ml(l,l.return,n)}}var Qt=!1,Ul=!1,Ei=!1,ko=typeof WeakSet=="function"?WeakSet:Set,ql=null;function nr(l,t){if(l=l.containerInfo,Ki=qn,l=ns(l),gc(l)){if("selectionStart"in l)var a={start:l.selectionStart,end:l.selectionEnd};else l:{a=(a=l.ownerDocument)&&a.defaultView||window;var e=a.getSelection&&a.getSelection();if(e&&e.rangeCount!==0){a=e.anchorNode;var u=e.anchorOffset,n=e.focusNode;e=e.focusOffset;try{a.nodeType,n.nodeType}catch{a=null;break l}var c=0,i=-1,f=-1,h=0,p=0,_=l,g=null;t:for(;;){for(var b;_!==a||u!==0&&_.nodeType!==3||(i=c+u),_!==n||e!==0&&_.nodeType!==3||(f=c+e),_.nodeType===3&&(c+=_.nodeValue.length),(b=_.firstChild)!==null;)g=_,_=b;for(;;){if(_===l)break t;if(g===a&&++h===u&&(i=c),g===n&&++p===e&&(f=c),(b=_.nextSibling)!==null)break;_=g,g=_.parentNode}_=b}a=i===-1||f===-1?null:{start:i,end:f}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ji={focusedElem:l,selectionRange:a},qn=!1,ql=t;ql!==null;)if(t=ql,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,ql=l;else for(;ql!==null;){switch(t=ql,n=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(a=0;a title"))),Ql(n,e,a),n[Bl]=l,Hl(n),e=n;break l;case"link":var c=l0("link","href",u).get(e+(a.href||""));if(c){for(var i=0;ivl&&(c=vl,vl=V,V=c);var m=es(i,V),s=es(i,vl);if(m&&s&&(b.rangeCount!==1||b.anchorNode!==m.node||b.anchorOffset!==m.offset||b.focusNode!==s.node||b.focusOffset!==s.offset)){var r=_.createRange();r.setStart(m.node,m.offset),b.removeAllRanges(),V>vl?(b.addRange(r),b.extend(s.node,s.offset)):(r.setEnd(s.node,s.offset),b.addRange(r))}}}}for(_=[],b=i;b=b.parentNode;)b.nodeType===1&&_.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<_.length;i++){var A=_[i];A.element.scrollLeft=A.left,A.element.scrollTop=A.top}}qn=!!Ki,Ji=Ki=null}finally{ol=u,C.p=e,v.T=a}}l.current=t,Cl=2}}function pd(){if(Cl===2){Cl=0;var l=da,t=ge,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=v.T,v.T=null;var e=C.p;C.p=2;var u=ol;ol|=4;try{Wo(l,t.alternate,t)}finally{ol=u,C.p=e,v.T=a}}Cl=3}}function Td(){if(Cl===4||Cl===3){Cl=0,q0();var l=da,t=ge,a=Jt,e=fd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Cl=5:(Cl=0,ge=da=null,Ad(l,l.pendingLanes));var u=l.pendingLanes;if(u===0&&(oa=null),In(a),t=t.stateNode,Il&&typeof Il.onCommitFiberRoot=="function")try{Il.onCommitFiberRoot(_e,t,void 0,(t.current.flags&128)===128)}catch{}if(e!==null){t=v.T,u=C.p,C.p=2,v.T=null;try{for(var n=l.onRecoverableError,c=0;ca?32:a,v.T=null,a=Ui,Ui=null;var n=da,c=Jt;if(Cl=0,ge=da=null,Jt=0,(ol&6)!==0)throw Error(d(331));var i=ol;if(ol|=4,nd(n.current),ad(n,n.current,c,a),ol=i,iu(0,!1),Il&&typeof Il.onPostCommitFiberRoot=="function")try{Il.onPostCommitFiberRoot(_e,n)}catch{}return!0}finally{C.p=u,v.T=e,Ad(l,t)}}function _d(l,t,a){t=ot(a,t),t=oi(l.stateNode,t,2),l=ua(l,t,2),l!==null&&(xe(l,2),xt(l))}function ml(l,t,a){if(l.tag===3)_d(l,l,a);else for(;t!==null;){if(t.tag===3){_d(t,l,a);break}else if(t.tag===1){var e=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof e.componentDidCatch=="function"&&(oa===null||!oa.has(e))){l=ot(a,l),a=Mo(2),e=ua(t,a,2),e!==null&&(xo(a,e,t,l),xe(e,2),xt(e));break}}t=t.return}}function Hi(l,t,a){var e=l.pingCache;if(e===null){e=l.pingCache=new fr;var u=new Set;e.set(t,u)}else u=e.get(t),u===void 0&&(u=new Set,e.set(t,u));u.has(a)||(xi=!0,u.add(a),l=rr.bind(null,l,t,a),t.then(l,l))}function rr(l,t,a){var e=l.pingCache;e!==null&&e.delete(t),l.pingedLanes|=l.suspendedLanes&a,l.warmLanes&=~a,gl===l&&(al&a)===a&&(El===4||El===3&&(al&62914560)===al&&300>$l()-Sn?(ol&2)===0&&Se(l,0):Di|=a,ve===al&&(ve=0)),xt(l)}function Md(l,t){t===0&&(t=bf()),l=xa(l,t),l!==null&&(xe(l,t),xt(l))}function hr(l){var t=l.memoizedState,a=0;t!==null&&(a=t.retryLane),Md(l,a)}function yr(l,t){var a=0;switch(l.tag){case 31:case 13:var e=l.stateNode,u=l.memoizedState;u!==null&&(a=u.retryLane);break;case 19:e=l.stateNode;break;case 22:e=l.stateNode._retryCache;break;default:throw Error(d(314))}e!==null&&e.delete(t),Md(l,a)}function vr(l,t){return kn(l,t)}var _n=null,ze=null,qi=!1,Mn=!1,Bi=!1,ra=0;function xt(l){l!==ze&&l.next===null&&(ze===null?_n=ze=l:ze=ze.next=l),Mn=!0,qi||(qi=!0,Sr())}function iu(l,t){if(!Bi&&Mn){Bi=!0;do for(var a=!1,e=_n;e!==null;){if(l!==0){var u=e.pendingLanes;if(u===0)var n=0;else{var c=e.suspendedLanes,i=e.pingedLanes;n=(1<<31-Pl(42|l)+1)-1,n&=u&~(c&~i),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(a=!0,Nd(e,n))}else n=al,n=Ou(e,e===gl?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),(n&3)===0||Me(e,n)||(a=!0,Nd(e,n));e=e.next}while(a);Bi=!1}}function gr(){xd()}function xd(){Mn=qi=!1;var l=0;ra!==0&&Dr()&&(l=ra);for(var t=$l(),a=null,e=_n;e!==null;){var u=e.next,n=Dd(e,t);n===0?(e.next=null,a===null?_n=u:a.next=u,u===null&&(ze=a)):(a=e,(l!==0||(n&3)!==0)&&(Mn=!0)),e=u}Cl!==0&&Cl!==5||iu(l),ra!==0&&(ra=0)}function Dd(l,t){for(var a=l.suspendedLanes,e=l.pingedLanes,u=l.expirationTimes,n=l.pendingLanes&-62914561;0i)break;var p=f.transferSize,_=f.initiatorType;p&&Yd(_)&&(f=f.responseEnd,c+=p*(f"u"?null:document;function Fd(l,t,a){var e=pe;if(e&&typeof t=="string"&&t){var u=ft(t);u='link[rel="'+l+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Wd.has(u)||(Wd.add(u),l={rel:l,crossOrigin:a,href:t},e.querySelector(u)===null&&(t=e.createElement("link"),Ql(t,"link",l),Hl(t),e.head.appendChild(t)))}}function Br(l){wt.D(l),Fd("dns-prefetch",l,null)}function Yr(l,t){wt.C(l,t),Fd("preconnect",l,t)}function Xr(l,t,a){wt.L(l,t,a);var e=pe;if(e&&l&&t){var u='link[rel="preload"][as="'+ft(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+ft(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+ft(a.imageSizes)+'"]')):u+='[href="'+ft(l)+'"]';var n=u;switch(t){case"style":n=Te(l);break;case"script":n=Ae(l)}vt.has(n)||(l=z({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:l,as:t},a),vt.set(n,l),e.querySelector(u)!==null||t==="style"&&e.querySelector(du(n))||t==="script"&&e.querySelector(mu(n))||(t=e.createElement("link"),Ql(t,"link",l),Hl(t),e.head.appendChild(t)))}}function Gr(l,t){wt.m(l,t);var a=pe;if(a&&l){var e=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+ft(e)+'"][href="'+ft(l)+'"]',n=u;switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ae(l)}if(!vt.has(n)&&(l=z({rel:"modulepreload",href:l},t),vt.set(n,l),a.querySelector(u)===null)){switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mu(n)))return}e=a.createElement("link"),Ql(e,"link",l),Hl(e),a.head.appendChild(e)}}}function Qr(l,t,a){wt.S(l,t,a);var e=pe;if(e&&l){var u=La(e).hoistableStyles,n=Te(l);t=t||"default";var c=u.get(n);if(!c){var i={loading:0,preload:null};if(c=e.querySelector(du(n)))i.loading=5;else{l=z({rel:"stylesheet",href:l,"data-precedence":t},a),(a=vt.get(n))&&Pi(l,a);var f=c=e.createElement("link");Hl(f),Ql(f,"link",l),f._p=new Promise(function(h,p){f.onload=h,f.onerror=p}),f.addEventListener("load",function(){i.loading|=1}),f.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Un(c,t,e)}c={type:"stylesheet",instance:c,count:1,state:i},u.set(n,c)}}}function Zr(l,t){wt.X(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ae(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=z({src:l,async:!0},t),(t=vt.get(u))&&lf(l,t),n=a.createElement("script"),Hl(n),Ql(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function Vr(l,t){wt.M(l,t);var a=pe;if(a&&l){var e=La(a).hoistableScripts,u=Ae(l),n=e.get(u);n||(n=a.querySelector(mu(u)),n||(l=z({src:l,async:!0,type:"module"},t),(t=vt.get(u))&&lf(l,t),n=a.createElement("script"),Hl(n),Ql(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function $d(l,t,a,e){var u=(u=kt.current)?Nn(u):null;if(!u)throw Error(d(446));switch(l){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Te(a.href),a=La(u).hoistableStyles,e=a.get(t),e||(e={type:"style",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){l=Te(a.href);var n=La(u).hoistableStyles,c=n.get(l);if(c||(u=u.ownerDocument||u,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(l,c),(n=u.querySelector(du(l)))&&!n._p&&(c.instance=n,c.state.loading=5),vt.has(l)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vt.set(l,a),n||Lr(u,l,a,c.state))),t&&e===null)throw Error(d(528,""));return c}if(t&&e!==null)throw Error(d(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ae(a),a=La(u).hoistableScripts,e=a.get(t),e||(e={type:"script",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};default:throw Error(d(444,l))}}function Te(l){return'href="'+ft(l)+'"'}function du(l){return'link[rel="stylesheet"]['+l+"]"}function Id(l){return z({},l,{"data-precedence":l.precedence,precedence:null})}function Lr(l,t,a,e){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?e.loading=1:(t=l.createElement("link"),e.preload=t,t.addEventListener("load",function(){return e.loading|=1}),t.addEventListener("error",function(){return e.loading|=2}),Ql(t,"link",a),Hl(t),l.head.appendChild(t))}function Ae(l){return'[src="'+ft(l)+'"]'}function mu(l){return"script[async]"+l}function Pd(l,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var e=l.querySelector('style[data-href~="'+ft(a.href)+'"]');if(e)return t.instance=e,Hl(e),e;var u=z({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return e=(l.ownerDocument||l).createElement("style"),Hl(e),Ql(e,"style",u),Un(e,a.precedence,l),t.instance=e;case"stylesheet":u=Te(a.href);var n=l.querySelector(du(u));if(n)return t.state.loading|=4,t.instance=n,Hl(n),n;e=Id(a),(u=vt.get(u))&&Pi(e,u),n=(l.ownerDocument||l).createElement("link"),Hl(n);var c=n;return c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Ql(n,"link",e),t.state.loading|=4,Un(n,a.precedence,l),t.instance=n;case"script":return n=Ae(a.src),(u=l.querySelector(mu(n)))?(t.instance=u,Hl(u),u):(e=a,(u=vt.get(n))&&(e=z({},a),lf(e,u)),l=l.ownerDocument||l,u=l.createElement("script"),Hl(u),Ql(u,"link",e),l.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(d(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(e=t.instance,t.state.loading|=4,Un(e,a.precedence,l));return t.instance}function Un(l,t,a){for(var e=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=e.length?e[e.length-1]:null,n=u,c=0;c title"):null)}function Kr(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 a0(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function Jr(l,t,a,e){if(a.type==="stylesheet"&&(typeof e.media!="string"||matchMedia(e.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Te(e.href),n=t.querySelector(du(u));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Cn.bind(l),t.then(l,l)),a.state.loading|=4,a.instance=n,Hl(n);return}n=t.ownerDocument||t,e=Id(e),(u=vt.get(u))&&Pi(e,u),n=n.createElement("link"),Hl(n);var c=n;c._p=new Promise(function(i,f){c.onload=i,c.onerror=f}),Ql(n,"link",e),a.instance=n}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(l.count++,a=Cn.bind(l),t.addEventListener("load",a),t.addEventListener("error",a))}}var tf=0;function wr(l,t){return l.stylesheets&&l.count===0&&Hn(l,l.stylesheets),0tf?50:800)+t);return l.unsuspend=a,function(){l.unsuspend=null,clearTimeout(e),clearTimeout(u)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hn(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Rn=null;function Hn(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Rn=new Map,t.forEach(kr,l),Rn=null,Cn.call(l))}function kr(l,t){if(!(t.state.loading&4)){var a=Rn.get(l);if(a)var e=a.get(null);else{a=new Map,Rn.set(l,a);for(var u=l.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(M){console.error(M)}}return o(),of.exports=sh(),of.exports}var dh=oh();const x0=T.createContext({windows:[],openWindow:()=>{},closeWindow:()=>{},bringToFront:()=>{}}),mh=({children:o})=>{const[M,x]=T.useState([]),d=T.useRef(1e4),U=T.useCallback((O,S,E)=>{x(Y=>Y.find(j=>j.id===O)?Y.map(j=>j.id===O?{...j,zIndex:++d.current}:j):[...Y,{id:O,title:S,charName:E,zIndex:++d.current}])},[]),N=T.useCallback(O=>{x(S=>S.filter(E=>E.id!==O))},[]),D=T.useCallback(O=>{x(S=>S.map(E=>E.id===O?{...E,zIndex:++d.current}:E))},[]);return y.jsx(x0.Provider,{value:{windows:M,openWindow:U,closeWindow:N,bringToFront:D},children:o})},zu=()=>T.useContext(x0),gt={west:-102.1,east:102.1,north:102.1,south:-102.1};function pu(o,M,x,d){const U=(o-gt.west)/(gt.east-gt.west)*x,N=(gt.north-M)/(gt.north-gt.south)*d;return{x:U,y:N}}function rh(o,M,x,d,U,N,D){const O=(o-d)/x,S=(M-U)/x,E=gt.west+O/N*(gt.east-gt.west),Y=gt.north-S/D*(gt.north-gt.south);return{ew:E,ns:Y}}function rf(o,M){const x=o>=0?"N":"S",d=M>=0?"E":"W";return`${Math.abs(o).toFixed(1)}${x}, ${Math.abs(M).toFixed(1)}${d}`}const D0=bu.memo(({players:o,imgW:M,imgH:x,getColor:d,onHover:U,onSelect:N,selectedPlayer:D})=>{const{openWindow:O}=zu(),[S,E]=T.useState(null);T.useEffect(()=>{const z=()=>E(null);return S&&window.addEventListener("click",z),()=>window.removeEventListener("click",z)},[S]);const Y=T.useMemo(()=>o.filter(z=>z.ew!==void 0&&z.ns!==void 0).map(z=>({...z,pos:pu(z.ew,z.ns,M,x),color:d(z.character_name)})),[o,M,x,d]);return y.jsxs("div",{className:"ml-dots-layer",children:[Y.map(z=>y.jsx("div",{className:`ml-dot ${D===z.character_name?"ml-dot-selected":""}`,style:{left:z.pos.x,top:z.pos.y,backgroundColor:z.color},onMouseEnter:j=>{var I;const q=(I=j.currentTarget.closest(".ml-map-container"))==null?void 0:I.getBoundingClientRect();q&&U(z,j.clientX-q.left,j.clientY-q.top)},onMouseLeave:()=>U(null,0,0),onClick:()=>N(z.character_name),onDoubleClick:()=>O(`chat-${z.character_name}`,`Chat: ${z.character_name}`,z.character_name),onContextMenu:j=>{var Sl;j.preventDefault();const q=z.character_name,I=(Sl=j.currentTarget.closest(".ml-map-container"))==null?void 0:Sl.getBoundingClientRect(),ul=I?j.clientX-I.left:j.clientX,rl=I?j.clientY-I.top:j.clientY;E({name:q,x:ul,y:rl})}},z.character_name)),S&&y.jsx("div",{style:{position:"fixed",left:S.x+410,top:S.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(z=>y.jsx("div",{onClick:()=>{O(`${z.id}-${S.name}`,`${z.label}: ${S.name}`,S.name),E(null)},style:{padding:"4px 12px",cursor:"pointer",color:"#ccc"},onMouseEnter:j=>j.currentTarget.style.background="#333",onMouseLeave:j=>j.currentTarget.style.background="",children:z.label},z.id))})]})});D0.displayName="PlayerDots";const hh="/api";async function za(o){const M=await fetch(`${hh}${o}`,{credentials:"include"});if(!M.ok)throw new Error(`API ${o}: ${M.status}`);return M.json()}function yh(){return`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}/api/ws/live`}const O0=bu.memo(({imgW:o,imgH:M,getColor:x})=>{const[d,U]=T.useState([]);T.useEffect(()=>{const D=async()=>{try{const S=await za("/trails/?seconds=600");U(S.trails??[])}catch{}};D();const O=setInterval(D,2e3);return()=>clearInterval(O)},[]);const N=T.useMemo(()=>{const D={};for(const O of d){const{x:S,y:E}=pu(O.ew,O.ns,o,M);D[O.character_name]||(D[O.character_name]=[]),D[O.character_name].push(`${S},${E}`)}return Object.entries(D).filter(([,O])=>O.length>=2).map(([O,S])=>({name:O,points:S.join(" ")}))},[d,o,M]);return y.jsx("svg",{className:"ml-trails-svg",viewBox:`0 0 ${o} ${M}`,preserveAspectRatio:"none",children:N.map(D=>y.jsx("polyline",{points:D.points,stroke:x(D.name),fill:"none",strokeWidth:2,strokeOpacity:.7,strokeLinecap:"round",strokeLinejoin:"round"},D.name))})});O0.displayName="TrailsSVG";const vh=({imgW:o,imgH:M,enabled:x})=>{const d=T.useRef(null),[U,N]=T.useState([]);return T.useEffect(()=>{if(!x)return;(async()=>{try{const O=await za("/spawns/heatmap?hours=24&limit=50000");N(O.spawn_points??[])}catch{}})()},[x]),T.useEffect(()=>{const D=d.current;if(!D||!x||U.length===0||o===0)return;D.width=o,D.height=M;const O=D.getContext("2d");if(O){O.clearRect(0,0,o,M);for(const S of U){const{x:E,y:Y}=pu(S.ew,S.ns,o,M),z=Math.max(5,Math.min(12,5+Math.sqrt(S.intensity*.5))),j=O.createRadialGradient(E,Y,0,E,Y,z);j.addColorStop(0,`rgba(255, 0, 0, ${Math.min(.9,S.intensity/40)})`),j.addColorStop(.6,`rgba(255, 100, 0, ${Math.min(.4,S.intensity/120)})`),j.addColorStop(1,"rgba(255, 150, 0, 0)"),O.fillStyle=j,O.fillRect(E-z,Y-z,z*2,z*2)}}},[U,o,M,x]),x?y.jsx("canvas",{ref:d,className:"ml-heatmap-canvas"}):null},gh=({imgW:o,imgH:M,enabled:x})=>{const[d,U]=T.useState([]);T.useEffect(()=>{if(!x)return;const D=async()=>{try{const S=await za("/portals");U(S.portals??[])}catch{}};D();const O=setInterval(D,6e4);return()=>clearInterval(O)},[x]);const N=T.useMemo(()=>d.map(D=>({...D,pos:pu(D.coordinates.ew,D.coordinates.ns,o,M)})),[d,o,M]);return!x||N.length===0?null:y.jsx("div",{className:"ml-portals-layer",children:N.map((D,O)=>y.jsx("div",{className:"ml-portal-icon",style:{left:D.pos.x,top:D.pos.y},title:`${D.portal_name} (by ${D.discovered_by})`},O))})},T0=20,A0=.3,Sh=({players:o,getColor:M,onSelectPlayer:x,showHeatmap:d,showPortals:U,selectedPlayer:N})=>{var Zl;const D=T.useRef(null),O=T.useRef(null),[S,E]=T.useState({w:0,h:0}),[Y,z]=T.useState(null),j=T.useRef(null),q=T.useRef({scale:1,offX:0,offY:0}),I=T.useRef({dragging:!1,sx:0,sy:0,startOffX:0,startOffY:0}),ul=T.useCallback(()=>{if(O.current){const{scale:F,offX:P,offY:Q}=q.current;O.current.style.transform=`translate(${P}px, ${Q}px) scale(${F})`}},[]),rl=T.useCallback(F=>{const P=F.currentTarget;if(E({w:P.naturalWidth,h:P.naturalHeight}),D.current){const Q=D.current.clientWidth,L=D.current.clientHeight,k=Math.min(Q/P.naturalWidth,L/P.naturalHeight);q.current={scale:k,offX:(Q-P.naturalWidth*k)/2,offY:(L-P.naturalHeight*k)/2},ul()}},[ul]),Sl=T.useCallback(F=>{var Tt;F.preventDefault();const P=(Tt=D.current)==null?void 0:Tt.getBoundingClientRect();if(!P)return;const Q=q.current,L=F.deltaY<0?1.1:.9,k=Math.min(T0,Math.max(A0,Q.scale*L)),jl=k/Q.scale,Tl=F.clientX-P.left,Ot=F.clientY-P.top;q.current={scale:k,offX:Tl-(Tl-Q.offX)*jl,offY:Ot-(Ot-Q.offY)*jl},ul()},[ul]),K=T.useCallback(F=>{if(F.button!==0)return;const P=q.current;I.current={dragging:!0,sx:F.clientX,sy:F.clientY,startOffX:P.offX,startOffY:P.offY}},[]);T.useEffect(()=>{const F=Q=>{const L=I.current;if(L.dragging&&(q.current.offX=L.startOffX+(Q.clientX-L.sx),q.current.offY=L.startOffY+(Q.clientY-L.sy),ul()),D.current&&S.w>0&&j.current){const k=D.current.getBoundingClientRect(),jl=q.current,Tl=rh(Q.clientX-k.left,Q.clientY-k.top,jl.scale,jl.offX,jl.offY,S.w,S.h);j.current.textContent=rf(Tl.ns,Tl.ew)}},P=()=>{I.current.dragging=!1};return window.addEventListener("mousemove",F),window.addEventListener("mouseup",P),()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",P)}},[ul,S.w,S.h]);const J=T.useRef(null);T.useEffect(()=>{if(!N||S.w===0||!D.current||J.current===N)return;const F=o.find(jl=>jl.character_name===N);if(!F)return;J.current=N;const{x:P,y:Q}=pu(F.ew,F.ns,S.w,S.h),L=D.current.getBoundingClientRect(),k=3;q.current={scale:Math.min(T0,Math.max(A0,k)),offX:L.width/2-P*k,offY:L.height/2-Q*k},ul()},[N,o,S.w,S.h,ul]),T.useEffect(()=>{N||(J.current=null)},[N]);const xl=T.useCallback((F,P,Q)=>{z(F?{x:P,y:Q,player:F}:null)},[]);return y.jsxs("div",{className:"ml-map-container",ref:D,onWheel:Sl,onMouseDown:K,children:[y.jsxs("div",{ref:O,className:"ml-map-group",children:[y.jsx("img",{src:"/dereth.png",alt:"Dereth",className:"ml-map-img",onLoad:rl,draggable:!1}),S.w>0&&y.jsxs(y.Fragment,{children:[y.jsx(vh,{imgW:S.w,imgH:S.h,enabled:d}),y.jsx(O0,{imgW:S.w,imgH:S.h,getColor:M}),y.jsx(D0,{players:o,imgW:S.w,imgH:S.h,getColor:M,onHover:xl,onSelect:x,selectedPlayer:N}),y.jsx(gh,{imgW:S.w,imgH:S.h,enabled:U})]})]}),Y&&y.jsxs("div",{className:"ml-tooltip",style:{left:Y.x+12,top:Y.y-10},children:[y.jsx("strong",{children:Y.player.character_name}),y.jsx("br",{}),rf(Y.player.ns,Y.player.ew),y.jsx("br",{}),Y.player.kills_per_hour," kph · ",(Zl=Y.player.kills)==null?void 0:Zl.toLocaleString()," kills"]}),y.jsx("div",{className:"ml-coords",ref:j})]})},N0=bu.memo(({player:o,vitals:M,color:x,onSelect:d,isSelected:U})=>{var Y,z;const{openWindow:N}=zu(),D=(o.vt_state||"idle").toLowerCase(),O=D==="combat"||D==="hunt",S=(o.total_rares??0)>0?Math.round((o.total_kills??0)/(o.total_rares??1)).toLocaleString():null,E=o.character_name;return y.jsxs("li",{className:`ml-player-row ${U?"ml-player-selected":""}`,style:{borderLeftColor:x},children:[y.jsxs("div",{className:"ml-pr-header",onClick:d,children:[y.jsx("span",{className:"ml-pr-name",children:E}),y.jsx("span",{className:"ml-pr-coords",children:rf(o.ns,o.ew)})]}),y.jsxs("div",{className:"ml-pr-vitals",children:[y.jsx("div",{className:"ml-vital-bar hp",children:y.jsx("div",{className:"ml-vital-fill",style:{width:`${(M==null?void 0:M.health_percentage)??0}%`}})}),y.jsx("div",{className:"ml-vital-bar sta",children:y.jsx("div",{className:"ml-vital-fill",style:{width:`${(M==null?void 0:M.stamina_percentage)??0}%`}})}),y.jsx("div",{className:"ml-vital-bar mana",children:y.jsx("div",{className:"ml-vital-fill",style:{width:`${(M==null?void 0:M.mana_percentage)??0}%`}})})]}),y.jsxs("div",{className:"ml-pr-grid",children:[y.jsxs("span",{className:"ml-gs",title:"Session kills",children:["⚔️ ",((Y=o.kills)==null?void 0:Y.toLocaleString())??0]}),y.jsxs("span",{className:"ml-gs",title:"Total kills",children:["🏆 ",(o.total_kills??0).toLocaleString()]}),y.jsxs("span",{className:"ml-gs",title:"Kills per hour",children:[o.kills_per_hour??"0"," ",y.jsx("span",{className:"ml-suffix",children:"KPH"})]}),y.jsxs("span",{className:"ml-gs",title:"Rares (session / total)",children:["💎 ",o.session_rares??0," / ",o.total_rares??0]}),y.jsx("span",{className:"ml-gs",title:"Kills per rare",children:S?y.jsxs(y.Fragment,{children:["📊 ",S," ",y.jsx("span",{className:"ml-suffix",children:"KPR"})]}):""}),y.jsx("span",{className:`ml-meta-pill ${O?"active":D!=="idle"&&D!=="default"&&D!==""?"other":""}`,children:o.vt_state||"idle"}),y.jsxs("span",{className:"ml-gs",title:"Online time",children:["🕐 ",((z=o.onlinetime)==null?void 0:z.replace(/^00\./,""))??"--"]}),y.jsxs("span",{className:"ml-gs",title:"Deaths",children:["☠️ ",o.deaths??"0"]}),y.jsxs("span",{className:"ml-gs",title:"Prismatic tapers",children:[y.jsx("img",{src:"/prismatic-taper-icon.png",className:"ml-taper-icon",alt:""}),o.prismatic_taper_count??"0"]})]}),y.jsxs("div",{className:"ml-pr-buttons",children:[y.jsx("button",{className:"ml-btn accent",onClick:()=>N(`chat-${E}`,`Chat: ${E}`,E),children:"Chat"}),y.jsx("button",{className:"ml-btn accent",onClick:()=>N(`stats-${E}`,`Stats: ${E}`,E),children:"Stats"}),y.jsx("button",{className:"ml-btn accent",onClick:()=>N(`inv-${E}`,`Inventory: ${E}`,E),children:"Inv"}),y.jsx("button",{className:"ml-btn",onClick:()=>N(`char-${E}`,`Character: ${E}`,E),children:"Char"}),y.jsx("button",{className:"ml-btn",onClick:()=>N(`combat-${E}`,`Combat: ${E}`,E),children:"Combat"}),y.jsx("button",{className:"ml-btn",onClick:()=>N(`radar-${E}`,`Radar: ${E}`,E),children:"Radar"})]})]})});N0.displayName="PlayerRow";const bh=({players:o,vitals:M,getColor:x,onSelect:d,selectedPlayer:U})=>{const N=T.useRef(null),[D,O]=T.useState(!1),S=T.useCallback(()=>{N.current&&O(N.current.scrollTop>200)},[]);return y.jsxs("div",{style:{position:"relative",flex:1,minHeight:0},children:[y.jsx("ul",{className:"ml-player-list",ref:N,onScroll:S,children:o.map(E=>y.jsx(N0,{player:E,vitals:M.get(E.character_name)??null,color:x(E.character_name),onSelect:()=>d(E.character_name),isSelected:U===E.character_name},E.character_name))}),D&&y.jsx("button",{onClick:()=>{var E;(E=N.current)==null||E.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:"▲"})]})},zh=[{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"}],ph=({value:o,onChange:M})=>y.jsx("div",{className:"ml-sort-buttons",children:zh.map(x=>y.jsx("button",{className:`ml-sort-btn ${o===x.key?"active":""}`,onClick:()=>M(x.key),children:x.label},x.key))}),Th=()=>{const{openWindow:o}=zu();return y.jsxs("div",{className:"ml-tool-links",children:[y.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("playerdash","Player Dashboard"),children:"👥 Dashboard"}),y.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("queststatus","Quest Status"),children:"📜 Quests"}),y.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("issues","Issues Board"),children:"📋 Issues"}),y.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("vitalsharing","Vital Sharing"),children:"🤝 Vitals"}),y.jsx("span",{className:"ml-tool-link",style:{cursor:"pointer"},onClick:()=>o("combatpicker","Combat Stats"),children:"⚔️ Combat"})]})},Ah=({players:o,vitals:M,serverHealth:x,totalRares:d,totalKills:U,getColor:N,onSelectPlayer:D,showHeatmap:O,showPortals:S,onToggleHeatmap:E,onTogglePortals:Y,version:z,selectedPlayer:j})=>{var F,P;const[q,I]=T.useState("name"),[ul,rl]=T.useState(""),Sl=T.useMemo(()=>o.reduce((Q,L)=>Q+(parseInt(L.kills_per_hour)||0),0),[o]),K=((F=x==null?void 0:x.status)==null?void 0:F.toLowerCase())==="online"||((P=x==null?void 0:x.status)==null?void 0:P.toLowerCase())==="up",J=T.useDeferredValue(o),xl=T.useDeferredValue(M),Zl=T.useMemo(()=>{let Q=[...J];switch(ul&&(Q=Q.filter(L=>L.character_name.toLowerCase().startsWith(ul.toLowerCase()))),q){case"kph":Q.sort((L,k)=>(parseInt(k.kills_per_hour)||0)-(parseInt(L.kills_per_hour)||0));break;case"skills":Q.sort((L,k)=>(k.kills||0)-(L.kills||0));break;case"srares":Q.sort((L,k)=>(k.session_rares??0)-(L.session_rares??0));break;case"tkills":Q.sort((L,k)=>(k.total_kills??0)-(L.total_kills??0));break;case"kpr":Q.sort((L,k)=>{const jl=(L.total_kills??0)/Math.max(1,L.total_rares??1),Tl=(k.total_kills??0)/Math.max(1,k.total_rares??1);return jl-Tl});break;default:Q.sort((L,k)=>L.character_name.localeCompare(k.character_name))}return Q},[J,q,ul]);return y.jsxs("div",{className:"ml-sidebar",children:[z&&y.jsxs("div",{className:"ml-version",children:["v",z]}),y.jsx("div",{className:"ml-sidebar-header",children:y.jsxs("span",{className:"ml-sidebar-title",style:{cursor:"pointer"},onClick:()=>{const Q=document.createElement("div");Q.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000;z-index:999999;display:flex;align-items:center;justify-content:center;";const L=document.createElement("video");L.src="/rick.mp4",L.autoplay=!0,L.loop=!0,L.style.cssText="width:100vw;height:100vh;object-fit:cover;",Q.appendChild(L),document.body.appendChild(Q),document.body.style.animation="ml-shake 0.05s 30";const k=document.createElement("style");k.textContent="@keyframes ml-shake{0%,100%{transform:translate(0) rotate(0)}25%{transform:translate(-15px,10px) rotate(-2deg)}50%{transform:translate(15px,-10px) rotate(2deg)}75%{transform:translate(-10px,-15px) rotate(-1deg)}} @keyframes ml-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}",document.head.appendChild(k),setTimeout(()=>{Q.style.animation="ml-spin 3s linear infinite"},1500),L.play().catch(()=>{})},children:["Active Mosswart Enjoyers (",o.length,")"]})}),y.jsxs("div",{className:"ml-server-status",children:[y.jsx("span",{className:`ml-status-dot ${K?"online":"offline"}`}),y.jsxs("span",{className:"ml-status-text",children:["Coldeve ",K?"Online":"Offline"]}),(x==null?void 0:x.player_count)!=null&&y.jsxs("span",{className:"ml-status-detail",children:["👥 ",x.player_count]}),(x==null?void 0:x.latency_ms)!=null&&y.jsxs("span",{className:"ml-status-detail",children:[Math.round(x.latency_ms),"ms"]}),(x==null?void 0:x.uptime_seconds)!=null&&y.jsxs("span",{className:"ml-status-detail",children:["Up: ",Math.floor(x.uptime_seconds/3600),"h"]})]}),y.jsxs("div",{className:"ml-counters",children:[y.jsxs("div",{className:"ml-counter rares",children:[y.jsx("span",{className:"ml-counter-val",children:d}),y.jsx("span",{className:"ml-counter-lbl",children:"Rares"})]}),y.jsxs("div",{className:`ml-counter kph ${Sl>5e3?"ultra":""}`,children:[y.jsx("span",{className:"ml-counter-val",children:Sl.toLocaleString()}),y.jsx("span",{className:"ml-counter-lbl",children:"Server KPH"})]}),y.jsxs("div",{className:"ml-counter kills",children:[y.jsx("span",{className:"ml-counter-val",children:U.toLocaleString()}),y.jsx("span",{className:"ml-counter-lbl",children:"Kills"})]})]}),y.jsxs("div",{className:"ml-tool-links",children:[y.jsx("a",{href:"/inventory.html",target:"_blank",className:"ml-tool-link",children:"🔍 Inv Search"}),y.jsx("a",{href:"/suitbuilder.html",target:"_blank",className:"ml-tool-link",children:"🛡️ Suitbuilder"}),y.jsx("a",{href:"/debug.html",target:"_blank",className:"ml-tool-link",children:"🐛 Debug"})]}),y.jsx(Th,{}),y.jsxs("div",{className:"ml-toggles",children:[y.jsxs("label",{className:"ml-toggle-label",children:[y.jsx("input",{type:"checkbox",checked:O,onChange:Q=>E(Q.target.checked)}),y.jsx("span",{children:"Spawn Heatmap"})]}),y.jsxs("label",{className:"ml-toggle-label",children:[y.jsx("input",{type:"checkbox",checked:S,onChange:Q=>Y(Q.target.checked)}),y.jsx("span",{children:"Portals"})]})]}),y.jsx("div",{style:{borderTop:"1px solid #333",marginTop:4,paddingTop:4}}),y.jsx(ph,{value:q,onChange:I}),y.jsx("input",{className:"ml-filter",type:"text",placeholder:"Filter players...",value:ul,onChange:Q=>rl(Q.target.value)}),y.jsx(bh,{players:Zl,vitals:xl,getColor:N,onSelect:D,selectedPlayer:j})]})},Eh="modulepreload",_h=function(o){return"/"+o},E0={},Dt=function(M,x,d){let U=Promise.resolve();if(x&&x.length>0){let D=function(E){return Promise.all(E.map(Y=>Promise.resolve(Y).then(z=>({status:"fulfilled",value:z}),z=>({status:"rejected",reason:z}))))};document.getElementsByTagName("link");const O=document.querySelector("meta[property=csp-nonce]"),S=(O==null?void 0:O.nonce)||(O==null?void 0:O.getAttribute("nonce"));U=D(x.map(E=>{if(E=_h(E),E in E0)return;E0[E]=!0;const Y=E.endsWith(".css"),z=Y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${E}"]${z}`))return;const j=document.createElement("link");if(j.rel=Y?"stylesheet":Eh,Y||(j.as="script"),j.crossOrigin="",j.href=E,S&&j.setAttribute("nonce",S),document.head.appendChild(j),Y)return new Promise((q,I)=>{j.addEventListener("load",q),j.addEventListener("error",()=>I(new Error(`Unable to preload CSS for ${E}`)))})}))}function N(D){const O=new Event("vite:preloadError",{cancelable:!0});if(O.payload=D,window.dispatchEvent(O),!O.defaultPrevented)throw D}return U.then(D=>{for(const O of D||[])O.status==="rejected"&&N(O.reason);return M().catch(N)})},Mh=({id:o,title:M,zIndex:x,width:d=700,height:U=340,children:N})=>{const{closeWindow:D,bringToFront:O}=zu(),S=T.useRef(null),E=T.useRef({dragging:!1,sx:0,sy:0,ox:0,oy:0}),Y=T.useRef({resizing:!1,sx:0,sy:0,sw:0,sh:0}),z=T.useRef({x:420,y:10+Math.random()*40}),[j,q]=T.useState({w:d,h:U}),I=T.useCallback(rl=>{var K;rl.preventDefault(),O(o);const Sl=(K=S.current)==null?void 0:K.getBoundingClientRect();Sl&&(E.current={dragging:!0,sx:rl.clientX,sy:rl.clientY,ox:Sl.left,oy:Sl.top})},[o,O]),ul=T.useCallback(rl=>{rl.preventDefault(),rl.stopPropagation(),Y.current={resizing:!0,sx:rl.clientX,sy:rl.clientY,sw:j.w,sh:j.h}},[j.w,j.h]);return T.useEffect(()=>{const rl=K=>{const J=E.current;J.dragging&&S.current&&(z.current.x=J.ox+(K.clientX-J.sx),z.current.y=J.oy+(K.clientY-J.sy),S.current.style.left=`${z.current.x}px`,S.current.style.top=`${z.current.y}px`);const xl=Y.current;if(xl.resizing){const Zl=Math.max(300,xl.sw+(K.clientX-xl.sx)),F=Math.max(200,xl.sh+(K.clientY-xl.sy));q({w:Zl,h:F})}},Sl=()=>{E.current.dragging=!1,Y.current.resizing=!1};return window.addEventListener("mousemove",rl),window.addEventListener("mouseup",Sl),()=>{window.removeEventListener("mousemove",rl),window.removeEventListener("mouseup",Sl)}},[]),y.jsxs("div",{ref:S,className:"ml-window",style:{zIndex:x,width:j.w,height:j.h,left:z.current.x,top:z.current.y},onMouseDown:()=>O(o),children:[y.jsxs("div",{className:"ml-window-header",onMouseDown:I,children:[y.jsx("span",{className:"ml-window-title",children:M}),y.jsx("button",{className:"ml-window-close",onClick:()=>D(o),children:"×"})]}),y.jsx("div",{className:"ml-window-content",children:N}),y.jsx("div",{className:"ml-window-resize",onMouseDown:ul})]})},xh={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"},U0=50,j0=o=>`mo-chat-history-${o}`;function Dh(o){try{const M=localStorage.getItem(j0(o));return M?JSON.parse(M):[]}catch{return[]}}function Oh(o,M){try{localStorage.setItem(j0(o),JSON.stringify(M.slice(-U0)))}catch{}}const Nh=({id:o,charName:M,zIndex:x,messages:d,socket:U})=>{const N=T.useRef(null),[D,O]=T.useState(""),[S,E]=T.useState(!1),Y=T.useRef(Dh(M)),z=T.useRef(-1),j=T.useRef(""),q=T.useRef(!1);T.useEffect(()=>{const K=N.current;K&&(q.current?E(!0):(K.scrollTop=K.scrollHeight,E(!1)))},[d.length]);const I=T.useCallback(()=>{const K=N.current;if(!K)return;const J=K.scrollHeight-K.scrollTop-K.clientHeight<30;q.current=!J,J&&E(!1)},[]),ul=T.useCallback(()=>{const K=N.current;K&&(K.scrollTop=K.scrollHeight,q.current=!1,E(!1))},[]),rl=T.useCallback(K=>{K.preventDefault();const J=D.trim();!J||!U||U.readyState!==WebSocket.OPEN||(U.send(JSON.stringify({player_name:M,command:J})),Y.current.push(J),Y.current.length>U0&&Y.current.shift(),Oh(M,Y.current),z.current=-1,j.current="",O(""),q.current=!1)},[D,U,M]),Sl=T.useCallback(K=>{const J=Y.current;if(J.length!==0){if(K.key==="ArrowUp")K.preventDefault(),z.current===-1?(j.current=D,z.current=J.length-1):z.current>0&&z.current--,O(J[z.current]);else if(K.key==="ArrowDown"){if(K.preventDefault(),z.current===-1)return;z.currenty.jsx("div",{className:"ml-chat-line",style:{color:xh[K.color??2]??"#ddd"},children:K.text},J))}),S&&y.jsx("div",{onClick:ul,style:{padding:"3px 0",textAlign:"center",fontSize:"0.65rem",color:"#6af",background:"#1a2a3a",cursor:"pointer",borderTop:"1px solid #334"},children:"▼ New messages below"}),y.jsx("form",{className:"ml-chat-form",onSubmit:rl,children:y.jsx("input",{className:"ml-chat-input",value:D,onChange:K=>O(K.target.value),onKeyDown:Sl,placeholder:"Enter chat..."})})]})},Uh=T.lazy(()=>Dt(()=>import("./StatsWindow-B26MeIH_.js"),__vite__mapDeps([0,1])).then(o=>({default:o.StatsWindow}))),jh=T.lazy(()=>Dt(()=>import("./CharacterWindow-r4JBxCcd.js"),__vite__mapDeps([2,1])).then(o=>({default:o.CharacterWindow}))),Ch=T.lazy(()=>Dt(()=>import("./InventoryWindow-BakfUY1F.js"),__vite__mapDeps([3,1])).then(o=>({default:o.InventoryWindow}))),Rh=T.lazy(()=>Dt(()=>import("./RadarWindow-CqeTYRoC.js"),__vite__mapDeps([4,1])).then(o=>({default:o.RadarWindow}))),Hh=T.lazy(()=>Dt(()=>import("./CombatStatsWindow-Cp6gbZMF.js"),__vite__mapDeps([5,1])).then(o=>({default:o.CombatStatsWindow}))),qh=T.lazy(()=>Dt(()=>import("./CombatPickerWindow-Dn19Owcx.js"),__vite__mapDeps([6,1])).then(o=>({default:o.CombatPickerWindow}))),Bh=T.lazy(()=>Dt(()=>import("./IssuesWindow-CrYOTY1n.js"),__vite__mapDeps([7,1])).then(o=>({default:o.IssuesWindow}))),Yh=T.lazy(()=>Dt(()=>import("./VitalSharingWindow-DDYw2SOf.js"),__vite__mapDeps([8,1])).then(o=>({default:o.VitalSharingWindow}))),Xh=T.lazy(()=>Dt(()=>import("./QuestStatusWindow-YiUHZSeT.js"),__vite__mapDeps([9,1])).then(o=>({default:o.QuestStatusWindow}))),Gh=T.lazy(()=>Dt(()=>import("./PlayerDashboardWindow-fofpF1Et.js"),__vite__mapDeps([10,1])).then(o=>({default:o.PlayerDashboardWindow}))),C0=bu.memo(({characters:o,chatMessages:M,nearbyObjects:x,inventoryVersions:d,equipmentCantrips:U,characterStats:N,socket:D})=>{const{windows:O}=zu();return y.jsx(T.Suspense,{fallback:null,children:O.map(S=>{var z;const E=S.charName??"";switch(S.id.split("-")[0]){case"chat":return y.jsx(Nh,{id:S.id,charName:E,zIndex:S.zIndex,messages:M.get(E)??[],socket:D},S.id);case"stats":return y.jsx(Uh,{id:S.id,charName:E,zIndex:S.zIndex},S.id);case"char":return y.jsx(jh,{id:S.id,charName:E,zIndex:S.zIndex,vitals:((z=o.get(E))==null?void 0:z.vitals)??void 0,liveStats:N.get(E)},S.id);case"inv":return y.jsx(Ch,{id:S.id,charName:E,zIndex:S.zIndex,inventoryVersion:d.get(E)??0,equipmentCantrips:U.get(E)},S.id);case"radar":return y.jsx(Rh,{id:S.id,charName:E,zIndex:S.zIndex,socket:D,radarData:x.get(E)??null},S.id);case"combat":return y.jsx(Hh,{id:S.id,charName:E,zIndex:S.zIndex},S.id);case"combatpicker":return y.jsx(qh,{id:S.id,zIndex:S.zIndex,characters:o},S.id);case"issues":return y.jsx(Bh,{id:S.id,zIndex:S.zIndex},S.id);case"vitalsharing":return y.jsx(Yh,{id:S.id,zIndex:S.zIndex},S.id);case"queststatus":return y.jsx(Xh,{id:S.id,zIndex:S.zIndex},S.id);case"playerdash":return y.jsx(Gh,{id:S.id,zIndex:S.zIndex,characters:o},S.id);default:return null}})})});C0.displayName="WindowRenderer";let Qh=0;const Zh=({recentRares:o})=>{const[M,x]=T.useState([]),[d,U]=T.useState(0),[N,D]=T.useState([]);T.useEffect(()=>{if(o.length>d&&d>0){const S=o.slice(0,o.length-d);for(const E of S){const Y=++Qh;x(z=>[...z,{key:Y,charName:E.character_name,rareName:E.name,exiting:!1}]),O();try{const z=new AudioContext,j=z.createOscillator(),q=z.createGain();j.connect(q),q.connect(z.destination),j.frequency.value=880,j.type="sine",q.gain.value=.3,j.start(),q.gain.exponentialRampToValueAtTime(.001,z.currentTime+.5),j.stop(z.currentTime+.5)}catch{}setTimeout(()=>{x(z=>z.map(j=>j.key===Y?{...j,exiting:!0}:j)),setTimeout(()=>{x(z=>z.filter(j=>j.key!==Y))},500)},6e3)}}U(o.length)},[o.length]);const O=T.useCallback(()=>{const S=Date.now(),E=["#FFD700","#FF4444","#FF8800","#AA44FF","#4488FF"],Y=Array.from({length:30},(z,j)=>{const q=Math.PI*2*j/30+(Math.random()-.5)*.5,I=100+Math.random()*200;return{dx:Math.cos(q)*I,dy:Math.sin(q)*I-50,color:E[Math.floor(Math.random()*E.length)]}});D(z=>[...z,{id:S,particles:Y}]),setTimeout(()=>D(z=>z.filter(j=>j.id!==S)),2200)},[]);return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"ml-rare-notifications",children:M.map(S=>y.jsxs("div",{className:`ml-rare-notif ${S.exiting?"exiting":""}`,children:[y.jsx("div",{className:"ml-rare-notif-title",children:"🎆 LEGENDARY RARE! 🎆"}),y.jsx("div",{className:"ml-rare-notif-name",children:S.rareName}),y.jsx("div",{className:"ml-rare-notif-by",children:"found by"}),y.jsx("div",{className:"ml-rare-notif-char",children:S.charName})]},S.key))}),y.jsx("div",{className:"ml-fireworks",children:N.map(S=>y.jsx(bu.Fragment,{children:S.particles.map((E,Y)=>y.jsx("div",{className:"ml-firework-particle",style:{left:"50%",top:"30%",backgroundColor:E.color,"--dx":`${E.dx}px`,"--dy":`${E.dy+200}px`}},Y))},S.id))})]})};let Vh=0;const Lh=({deathAlerts:o})=>{const[M,x]=T.useState([]),d=T.useRef(0);return T.useEffect(()=>{if(o.length>d.current&&d.current>0){const U=o.slice(d.current);for(const N of U){const D=++Vh;x(O=>[...O,{key:D,alert:N,exiting:!1}]);try{const O=new AudioContext,S=O.createOscillator(),E=O.createGain();S.connect(E),E.connect(O.destination),S.frequency.value=440,S.type="sawtooth",E.gain.value=.2,S.start(),E.gain.exponentialRampToValueAtTime(.001,O.currentTime+.8),S.stop(O.currentTime+.8)}catch{}setTimeout(()=>{x(O=>O.map(S=>S.key===D?{...S,exiting:!0}:S)),setTimeout(()=>x(O=>O.filter(S=>S.key!==D)),500)},8e3)}}d.current=o.length},[o.length]),M.length===0?null:y.jsx("div",{style:{position:"fixed",top:70,left:"50%",transform:"translateX(-50%)",zIndex:99999,display:"flex",flexDirection:"column",gap:6,pointerEvents:"none"},children:M.map(U=>y.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:U.exiting?"ml-notif-out 0.5s ease-in forwards":"ml-notif-in 0.5s ease-out"},children:[y.jsx("div",{style:{fontSize:"1.2rem",fontWeight:800,color:"#ff4444"},children:"☠️ CHARACTER DIED ☠️"}),y.jsx("div",{style:{fontSize:"1rem",fontWeight:600,color:"#fff",marginTop:2},children:U.alert.character_name}),y.jsxs("div",{style:{fontSize:"0.8rem",color:"#c88",marginTop:2},children:["Vitae: ",U.alert.vitae,"%"]})]},U.key))})},_0=["#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 Kh(o){let M=0;for(let x=0;x{let U=o.current.get(d);return U||(U=M.current<_0.length?_0[M.current++]:Kh(d),o.current.set(d,U)),U},[])}const wh=({data:o})=>{const M=Jh(),[x,d]=T.useState(!1),[U,N]=T.useState(!1),[D,O]=T.useState(null),S=T.useMemo(()=>Array.from(o.characters.values()).filter(q=>q.telemetry).map(q=>q.telemetry),[o.characters]),E=T.useMemo(()=>new Map(Array.from(o.characters.values()).filter(q=>q.vitals).map(q=>[q.name,q.vitals])),[o.characters]),[Y,z]=T.useState("");T.useEffect(()=>{fetch("/api/api-version",{credentials:"include"}).then(q=>q.json()).then(q=>z(q.version??"")).catch(()=>{})},[]);const j=T.useCallback(q=>{O(I=>I===q?null:q)},[]);return y.jsx(mh,{children:y.jsxs("div",{className:"ml-layout",children:[y.jsx(Ah,{players:S,vitals:E,serverHealth:o.serverHealth,totalRares:o.totalRares,totalKills:o.totalKills,getColor:M,onSelectPlayer:j,showHeatmap:x,showPortals:U,onToggleHeatmap:d,onTogglePortals:N,version:Y,selectedPlayer:D}),y.jsx(Sh,{players:S,getColor:M,onSelectPlayer:j,showHeatmap:x,showPortals:U,selectedPlayer:D}),y.jsx(C0,{characters:o.characters,chatMessages:o.chatMessages,nearbyObjects:o.nearbyObjects,inventoryVersions:o.inventoryVersions,equipmentCantrips:o.equipmentCantrips,characterStats:o.characterStats,socket:o.socketRef.current}),y.jsx(Zh,{recentRares:o.recentRares}),y.jsx(Lh,{deathAlerts:o.deathAlerts})]})})};function kh(o){const M=T.useRef(null),x=T.useRef(0),d=T.useRef(o);d.current=o;const U=T.useCallback(()=>{var D;if(((D=M.current)==null?void 0:D.readyState)===WebSocket.OPEN)return;const N=new WebSocket(yh());M.current=N,N.addEventListener("message",O=>{try{const S=JSON.parse(O.data);d.current(S)}catch{}}),N.addEventListener("close",()=>{M.current=null,x.current=window.setTimeout(U,2e3)}),N.addEventListener("error",()=>{N.close()})},[]);return T.useEffect(()=>(U(),()=>{var N;clearTimeout(x.current),(N=M.current)==null||N.close(),M.current=null}),[U]),M}const Wh=()=>za("/live"),Fh=()=>za("/combat-stats"),$h=()=>za("/server-health"),Ih=()=>za("/total-rares"),Ph=()=>za("/total-kills");function ly(){const[o,M]=T.useState(new Map),[x,d]=T.useState(null),[U,N]=T.useState(0),[D,O]=T.useState(0),[S,E]=T.useState([]),Y=T.useRef(new Map),[z,j]=T.useState(0),[q,I]=T.useState(new Map),ul=T.useRef(new Map),[rl,Sl]=T.useState(0),K=T.useRef(new Map),[J,xl]=T.useState(0),[Zl,F]=T.useState([]),[P,Q]=T.useState(new Map),L=T.useRef(o);L.current=o;const k=T.useCallback((v,C)=>{M(G=>{const R=new Map(G),B=R.get(v)??{name:v,telemetry:null,vitals:null,combat:null,lastUpdate:0};return R.set(v,C(B)),R})},[]),jl=T.useCallback(v=>{var C,G;if(v.type){if(v.type==="telemetry"){const R=v;k(R.character_name,B=>({...B,telemetry:R,lastUpdate:Date.now()}))}else if(v.type==="vitals"){const R=v,B=(C=L.current.get(R.character_name))==null?void 0:C.vitals;B&&(B.vitae??0)===0&&(R.vitae??0)>0&&F(fl=>[...fl,{character_name:R.character_name,vitae:R.vitae,timestamp:new Date().toISOString()}].slice(-50)),k(R.character_name,fl=>({...fl,vitals:R,lastUpdate:Date.now()}))}else if(v.type==="combat_stats"){const R=v;k(R.character_name,B=>({...B,combat:R,lastUpdate:Date.now()}))}else if(v.type==="rare"){const R=v;E(B=>[R,...B].slice(0,50))}else if(v.type==="inventory_delta"){const R=v;R.character_name&&I(B=>{const fl=new Map(B);return fl.set(R.character_name,(fl.get(R.character_name)??0)+1),fl})}else if(v.type==="character_stats"){const R=v;K.current.set(R.character_name,v),xl(B=>B+1)}else if(v.type==="equipment_cantrip_state"){const R=v;ul.current.set(R.character_name,R),Sl(B=>B+1)}else if(v.type==="dungeon_map"){const R=v;R.landblock&&(window.__dungeonMapCache||(window.__dungeonMapCache={}),window.__dungeonMapCache[R.landblock]=R)}else if(v.type==="nearby_objects"){const R=v;if(Q(B=>{const fl=new Map(B);return fl.set(R.character_name,R),fl}),R.is_dungeon&&R.landblock&&!((G=window.__dungeonMapCache)!=null&&G[R.landblock])){const B=Tl.current;(B==null?void 0:B.readyState)===WebSocket.OPEN&&B.send(JSON.stringify({type:"request_dungeon_map",landblock:R.landblock}))}}else if(v.type==="chat"){const R=v,B=Y.current.get(R.character_name)??[];B.push({text:R.text,color:R.color,timestamp:R.timestamp}),B.length>1e3&&B.splice(0,B.length-1e3),Y.current.set(R.character_name,B),j(fl=>fl+1)}}},[k]),Tl=kh(jl);T.useEffect(()=>{const v=async()=>{try{const G=await Wh();M(R=>{var fl;const B=new Map(R);for(const sl of G.players??[]){const $=B.get(sl.character_name);B.set(sl.character_name,{name:sl.character_name,telemetry:sl,vitals:($==null?void 0:$.vitals)??null,combat:($==null?void 0:$.combat)??null,lastUpdate:Date.now()})}for(const sl of B.keys())(fl=G.players)!=null&&fl.some($=>$.character_name===sl)||B.delete(sl);return B})}catch{}};v();const C=setInterval(v,5e3);return()=>clearInterval(C)},[]),T.useEffect(()=>{const v=async()=>{try{const G=await Fh();for(const R of G.stats??[])k(R.character_name,B=>({...B,combat:{...R,type:"combat_stats"}}))}catch{}};v();const C=setInterval(v,3e4);return()=>clearInterval(C)},[k]),T.useEffect(()=>{const v=async()=>{try{d(await $h())}catch{}};v();const C=setInterval(v,3e4);return()=>clearInterval(C)},[]),T.useEffect(()=>{const v=async()=>{try{const[G,R]=await Promise.all([Ih(),Ph()]);N(G.all_time??0),O(R.total??0)}catch{}};v();const C=setInterval(v,3e5);return()=>clearInterval(C)},[]);const Ot=T.useMemo(()=>Y.current,[z]),Tt=T.useMemo(()=>ul.current,[rl]),St=T.useMemo(()=>K.current,[J]);return{characters:o,serverHealth:x,totalRares:U,totalKills:D,recentRares:S,chatMessages:Ot,nearbyObjects:P,inventoryVersions:q,equipmentCantrips:Tt,characterStats:St,deathAlerts:Zl,socketRef:Tl}}function ty(){const o=ly();return y.jsx(wh,{data:o})}dh.createRoot(document.getElementById("root")).render(y.jsx(T.StrictMode,{children:y.jsx(ty,{})}));"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").catch(()=>{});export{Mh as D,za as a,y as j,T as r,zu as u}; diff --git a/static/_build/assets/index-BsAcOCNp.css b/static/_build/assets/index-BsAcOCNp.css new file mode 100644 index 00000000..2ee8e2a9 --- /dev/null +++ b/static/_build/assets/index-BsAcOCNp.css @@ -0,0 +1 @@ +.ml-layout{display:flex;height:100vh;overflow:hidden;background:#111;color:#eee;font-family:Segoe UI,sans-serif}.ml-sidebar{width:400px;min-width:400px;background:#1a1a1a;border-right:2px solid #333;display:flex;flex-direction:column;overflow-y:auto;padding:12px 14px;scrollbar-width:none;-ms-overflow-style:none}.ml-sidebar::-webkit-scrollbar{display:none}.ml-sidebar-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.ml-sidebar-title{font-size:.85rem;font-weight:600;color:#88f}.ml-view-toggle{font-size:.7rem;padding:3px 10px;background:#333;color:#aaa;border:1px solid #555;border-radius:3px;cursor:pointer}.ml-view-toggle:hover{background:#444;color:#fff}.ml-server-status{display:flex;align-items:center;gap:6px;padding:4px 0 8px;font-size:.75rem;color:#aaa}.ml-status-dot{width:8px;height:8px;border-radius:50%}.ml-status-dot.online{background:#4c4;animation:ml-pulse 2s ease-in-out infinite}.ml-status-dot.offline{background:#c44}.ml-status-detail{color:#888;font-size:.7rem}.ml-status-latency{margin-left:auto;color:#888}.ml-tool-links{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px}.ml-tool-link{font-size:.68rem;color:#8ac;text-decoration:none;padding:2px 6px;background:#4488ff14;border:1px solid rgba(68,136,255,.15);border-radius:3px;transition:all .15s}.ml-tool-link:hover{background:#4488ff2e;color:#adf}@keyframes ml-pulse{0%,to{opacity:1}50%{opacity:.4}}.ml-counters{display:flex;gap:6px;margin-bottom:10px}.ml-counter{flex:1;text-align:center;padding:6px 4px;border-radius:4px;background:#222;border:1px solid #333}.ml-counter-val{display:block;font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums}.ml-counter-lbl{display:block;font-size:.6rem;color:#888;text-transform:uppercase;letter-spacing:.3px}.ml-counter.rares .ml-counter-val{color:#fc0}.ml-counter.kph .ml-counter-val{color:#4af}.ml-counter.kph{border-color:#234;animation:ml-kph-glow 3s ease-in-out infinite}.ml-counter.kph.ultra{background:linear-gradient(135deg,#112,#221);animation:ml-kph-glow 1.5s ease-in-out infinite}.ml-counter.kills .ml-counter-val{color:#f66}@keyframes ml-kph-glow{0%,to{box-shadow:0 0 4px #4af3}50%{box-shadow:0 0 12px #44aaff80}}.ml-sort-buttons{display:flex;gap:2px;margin:8px 0}.ml-sort-btn{flex:1;padding:4px 0;font-size:.65rem;font-weight:600;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer;text-transform:uppercase;letter-spacing:.3px}.ml-sort-btn:hover{background:#333;color:#ccc}.ml-sort-btn.active{background:#334;color:#88f;border-color:#88f}.ml-filter{width:100%;padding:5px 8px;font-size:.78rem;background:#222;color:#eee;border:1px solid #444;border-radius:3px;outline:none;margin-bottom:8px;box-sizing:border-box}.ml-filter:focus{border-color:#88f}.ml-filter::placeholder{color:#666}.ml-player-list{list-style:none;margin:0;padding:0;flex:1;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.ml-player-list::-webkit-scrollbar{display:none}.ml-player-row{padding:6px 8px;border-bottom:1px solid #2a2a2a;border-left:3px solid transparent;cursor:pointer;transition:background .1s}.ml-player-row:hover{background:#252525}.ml-player-row.ml-player-selected{background:#2a3344}.ml-pr-name{font-size:.82rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ml-pr-coords{font-size:.65rem;color:#888;margin-bottom:3px}.ml-pr-vitals{display:flex;gap:3px;margin-bottom:4px}.ml-vital-bar{flex:1;height:4px;border-radius:2px;overflow:hidden}.ml-vital-bar.hp{background:#300}.ml-vital-bar.sta{background:#331a00}.ml-vital-bar.mana{background:#001433}.ml-vital-bar.hp .ml-vital-fill{background:linear-gradient(90deg,#f44,#f66)}.ml-vital-bar.sta .ml-vital-fill{background:linear-gradient(90deg,#fa0,#fc4)}.ml-vital-bar.mana .ml-vital-fill{background:linear-gradient(90deg,#48f,#6af)}.ml-vital-fill{height:100%;border-radius:2px;transition:width .3s ease-out}.ml-pr-header{display:flex;justify-content:space-between;align-items:baseline;cursor:pointer}.ml-pr-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1px 8px;font-size:.68rem;color:#aaa;margin-bottom:4px}.ml-gs{font-variant-numeric:tabular-nums;display:inline-flex;align-items:center;gap:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ml-suffix{font-size:.58rem;color:#666;text-transform:uppercase;letter-spacing:.3px}.ml-taper-icon{width:14px;height:14px;margin-right:2px;vertical-align:text-bottom}.ml-meta-pill{font-size:.6rem;padding:0 6px;border-radius:3px;background:#333;color:#888;text-align:center;justify-self:end}.ml-pr-buttons{display:flex;gap:3px;margin-top:4px}.ml-btn{padding:2px 8px;font-size:.63rem;font-weight:500;border:1px solid #3a3a3a;border-radius:4px;background:#2a2a2a;color:#999;cursor:pointer;white-space:nowrap;transition:all .15s;letter-spacing:.2px}.ml-btn:hover{background:#383838;color:#ddd;border-color:#555}.ml-btn.accent{background:#4488ff1f;color:#6aadff;border-color:#4488ff4d}.ml-btn.accent:hover{background:#4488ff38;color:#8ec5ff;border-color:#4488ff80}.ml-meta-pill.active{background:#44cc4426;color:#4c4}.ml-meta-pill.other{background:#cc444426;color:#c44}.ml-map-container{flex:1;position:relative;overflow:hidden;background:#000;cursor:grab}.ml-map-container:active{cursor:grabbing}.ml-map-group{position:absolute;top:0;left:0;transform-origin:0 0}.ml-map-img{display:block;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.ml-dots-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-dot{position:absolute;width:6px;height:6px;border-radius:50%;transform:translate(-50%,-50%);border:1px solid rgba(0,0,0,.5);pointer-events:all;cursor:pointer;z-index:5}.ml-dot:hover{width:10px;height:10px;z-index:10}.ml-dot.ml-dot-selected{width:10px;height:10px;z-index:10;animation:ml-blink .6s step-end infinite}@keyframes ml-blink{50%{opacity:0}}.ml-version{font-size:.65rem;color:#aaa;margin-bottom:2px}.ml-tooltip{position:absolute;background:#001e3ceb;color:#eee;padding:6px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:1000;white-space:nowrap;border:1px solid #335}.ml-coords{position:absolute;bottom:8px;left:8px;background:#003264d9;color:#eee;padding:4px 10px;border-radius:4px;font-size:.75rem;pointer-events:none;z-index:100;font-variant-numeric:tabular-nums}.ml-toggles{display:flex;gap:12px;margin-bottom:8px;font-size:.72rem}.ml-toggle-label{display:flex;align-items:center;gap:4px;color:#aaa;cursor:pointer}.ml-toggle-label input{accent-color:#4488ff}.ml-trails-svg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-heatmap-canvas{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;opacity:.8}.ml-portals-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.ml-portal-icon{position:absolute;width:6px;height:6px;transform:translate(-50%,-50%);pointer-events:all;cursor:help}.ml-portal-icon:before{content:"🌀";font-size:10px;position:absolute;transform:translate(-50%,-50%)}.ml-window{position:fixed;background:#1a1a1a;border:1px solid #444;border-radius:6px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 8px 32px #00000080}.ml-window-header{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:linear-gradient(135deg,#2a3a5a,#1a2a40);cursor:move;-webkit-user-select:none;user-select:none;border-bottom:1px solid #334}.ml-window-title{font-size:.8rem;font-weight:600;color:#acf}.ml-window-close{background:none;border:none;color:#888;font-size:1.1rem;cursor:pointer;line-height:1;padding:0 4px}.ml-window-close:hover{color:#f66}.ml-window-content{flex:1;overflow:auto;display:flex;flex-direction:column}.ml-window-resize{position:absolute;bottom:0;right:0;width:14px;height:14px;cursor:nwse-resize;opacity:.3;background:linear-gradient(135deg,transparent 50%,#888 50%,transparent 52%,#888 65%,transparent 67%,#888 80%)}.ml-window-resize:hover{opacity:.6}.ml-stats-controls{display:flex;gap:4px;padding:6px 10px;border-bottom:1px solid #333}.ml-stats-range-btn{padding:3px 10px;font-size:.7rem;background:#2a2a2a;color:#888;border:1px solid #444;border-radius:3px;cursor:pointer}.ml-stats-range-btn.active{background:#4488ff26;color:#6aadff;border-color:#4488ff4d}.ml-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;flex:1}.ml-stats-panel{min-height:200px;background:#fff;border-radius:3px;overflow:hidden}.ml-stats-panel iframe{border:none}.ml-chat-messages{flex:1;overflow-y:auto;padding:6px 10px;font-size:.75rem;font-family:Consolas,Courier New,monospace;line-height:1.4}.ml-chat-line{word-break:break-word}.ml-chat-form{display:flex;border-top:1px solid #333;padding:4px}.ml-chat-input{flex:1;background:#222;color:#eee;border:1px solid #444;border-radius:3px;padding:4px 8px;font-size:.78rem;outline:none}.ml-chat-input:focus{border-color:#48f}.ml-chat-input::placeholder{color:#666}.ml-rare-notifications{position:fixed;top:20px;left:50%;transform:translate(-50%);z-index:99999;display:flex;flex-direction:column;gap:8px;pointer-events:none}.ml-rare-notif{background:linear-gradient(135deg,#1a0a2e,#2a1040);border:2px solid #ffcc00;border-radius:8px;padding:16px 32px;text-align:center;animation:ml-notif-in .5s ease-out;box-shadow:0 0 40px #ffcc004d}.ml-rare-notif.exiting{animation:ml-notif-out .5s ease-in forwards}.ml-rare-notif-title{font-size:1.4rem;font-weight:800;color:#fc0;text-shadow:0 0 20px rgba(255,204,0,.5);margin-bottom:4px}.ml-rare-notif-name{font-size:1.1rem;font-weight:600;color:#fff;margin-bottom:4px}.ml-rare-notif-by{font-size:.75rem;color:#888}.ml-rare-notif-char{font-size:1rem;font-weight:700;color:#fc0}@keyframes ml-notif-in{0%{transform:translateY(-40px);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes ml-notif-out{to{transform:translateY(-60px);opacity:0}}.ml-fireworks{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:99998}.ml-firework-particle{position:absolute;width:6px;height:6px;border-radius:50%;animation:ml-particle 2s cubic-bezier(.25,.46,.45,.94) forwards}@keyframes ml-particle{0%{transform:translate(0) scale(1);opacity:1}to{transform:translate(var(--dx),var(--dy)) scale(0);opacity:0}}@media(max-width:768px){.ml-layout{flex-direction:column}.ml-sidebar{width:100%;min-width:100%;max-height:40vh;border-right:none;border-bottom:2px solid #333}.ml-map-container{min-height:60vh}} diff --git a/static/_build/assets/react-yfL0ty4i.js b/static/_build/assets/react-yfL0ty4i.js new file mode 100644 index 00000000..bbc8e109 --- /dev/null +++ b/static/_build/assets/react-yfL0ty4i.js @@ -0,0 +1,17 @@ +function ue(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var I={exports:{}},n={};/** + * @license React + * react.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 K;function te(){if(K)return n;K=1;var p=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),m=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),t=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),C=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=C&&e[C]||e["@@iterator"],typeof e=="function"?e:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,k={};function O(e,r,o){this.props=e,this.context=r,this.refs=k,this.updater=o||U}O.prototype.isReactComponent={},O.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function b(){}b.prototype=O.prototype;function H(e,r,o){this.props=e,this.context=r,this.refs=k,this.updater=o||U}var N=H.prototype=new b;N.constructor=H,Y(N,O.prototype),N.isPureReactComponent=!0;var q=Array.isArray;function D(){}var a={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function L(e,r,o){var u=o.ref;return{$$typeof:p,type:e,key:r,ref:u!==void 0?u:null,props:o}}function Q(e,r){return L(e.type,r,e.props)}function j(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function Z(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return r[o]})}var G=/\/+/g;function M(e,r){return typeof e=="object"&&e!==null&&e.key!=null?Z(""+e.key):r.toString(36)}function J(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(D,D):(e.status="pending",e.then(function(r){e.status==="pending"&&(e.status="fulfilled",e.value=r)},function(r){e.status==="pending"&&(e.status="rejected",e.reason=r)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function S(e,r,o,u,s){var f=typeof e;(f==="undefined"||f==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(f){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case p:case R:l=!0;break;case c:return l=e._init,S(l(e._payload),r,o,u,s)}}if(l)return s=s(e),l=u===""?"."+M(e,0):u,q(s)?(o="",l!=null&&(o=l.replace(G,"$&/")+"/"),S(s,r,o,"",function(ee){return ee})):s!=null&&(j(s)&&(s=Q(s,o+(s.key==null||e&&e.key===s.key?"":(""+s.key).replace(G,"$&/")+"/")+l)),r.push(s)),1;l=0;var d=u===""?".":u+":";if(q(e))for(var g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(p)}catch(R){console.error(R)}}return p(),$.exports=ne(),$.exports}export{oe as a,ue as g,re as r}; diff --git a/static/_build/index.html b/static/_build/index.html new file mode 100644 index 00000000..c93e8955 --- /dev/null +++ b/static/_build/index.html @@ -0,0 +1,18 @@ + + + + + + Mosswart Overlord v2 + + + + + + + + + +
+ + diff --git a/static/_build/sw.js b/static/_build/sw.js new file mode 100644 index 00000000..71839ee5 --- /dev/null +++ b/static/_build/sw.js @@ -0,0 +1,72 @@ +// Service worker for MosswartOverlord v2 — caches static assets for instant repeat loads +const CACHE_NAME = 'mo-v2-cache-v1'; +const STATIC_ASSETS = [ + '/dereth.png', + '/dereth_highres.png', + '/prismatic-taper-icon.png', + '/icons/0600127E.png', + '/icons/06000133.png', + '/icons/06001080.png', +]; + +self.addEventListener('install', (event) => { + event.waitUntil( + caches.open(CACHE_NAME).then(cache => cache.addAll(STATIC_ASSETS)) + ); + self.skipWaiting(); +}); + +self.addEventListener('activate', (event) => { + event.waitUntil( + caches.keys().then(keys => + Promise.all(keys.filter(k => k !== CACHE_NAME).map(k => caches.delete(k))) + ) + ); + self.clients.claim(); +}); + +self.addEventListener('fetch', (event) => { + const url = new URL(event.request.url); + + // Cache icon images on first fetch + if (url.pathname.startsWith('/icons/') && event.request.method === 'GET') { + event.respondWith( + caches.match(event.request).then(cached => { + if (cached) return cached; + return fetch(event.request).then(response => { + if (response.ok) { + const clone = response.clone(); + caches.open(CACHE_NAME).then(cache => cache.put(event.request, clone)); + } + return response; + }); + }) + ); + return; + } + + // Cache dungeon_tiles.json (large, rarely changes) + if (url.pathname === '/dungeon_tiles.json') { + event.respondWith( + caches.match(event.request).then(cached => { + if (cached) return cached; + return fetch(event.request).then(response => { + if (response.ok) { + const clone = response.clone(); + caches.open(CACHE_NAME).then(cache => cache.put(event.request, clone)); + } + return response; + }); + }) + ); + return; + } + + // Cache static assets (map images etc) + if (STATIC_ASSETS.some(a => url.pathname === a)) { + event.respondWith( + caches.match(event.request).then(cached => cached || fetch(event.request)) + ); + return; + } +});