PageSourceSearch

https://www.thegitcity.com/_next/static/chunks/app/page-47d9cce2b0…?dpl=dpl_5ZY6M9bFx6nPgFT1eKyADNfp6aLM

js thegitcity.com collected 2026-10-03 22:25:38 UTC 223,572 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974],{996:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(95155);let a={pixels:"/currencies/pixels.svg",gitc:"/currencies/gitc.svg"},n={pixels:"Pixels",gitc:"GITC"};function l({currency:e,size:t=16,className:r,style:i}){return(0,s.jsx)("img",{src:a[e],width:t,height:t,alt:n[e],draggable:!1,className:r,style:{imageRendering:"pixelated",...i}})}},9555:(e,t,r)=>{Promise.resolve().then(r.bind(r,55100))},11462:(e,t,r)=>{"use strict";r.d(t,{m:()=>i});var s=r(12115);r(16385);let a={github:"reading your GitHub",building:"raising your building",claim:"claiming your building",lot:"finding you a lot in the city"},n=null;async function l(){}function i(e,t,r){let[i,o]=(0,s.useState)([]),[c,d]=(0,s.useState)("idle"),[u,x]=(0,s.useState)(null),[p,m]=(0,s.useState)(0),h=(0,s.useRef)(0),b=(0,s.useCallback)(e=>{o(t=>[...t,{...e,id:++h.current}])},[]),g=(0,s.useCallback)((e,t,r)=>{o(s=>s.map(s=>s.step===e&&"pending"===s.status?{...s,status:t,...r?{text:r}:{}}:s))},[]),f=(0,s.useCallback)(e=>{switch(e.type){case"session":b({text:`signed in as ${e.login}`,status:"done"});return;case"start":if("town"===e.step)return;b({text:a[e.step],status:"pending",step:e.step,startedAt:Date.now()});return;case"done":if("town"===e.step){e.joined&&b({text:"joining your company town",status:"done"});return}g(e.step,"done","github"===e.step&&null!=e.repos&&null!=e.contributions?`${a.github}: ${e.repos.toLocaleString("en-US")} repos, ${e.contributions.toLocaleString("en-US")} contributions`:void 0);return;case"fail":"town"!==e.step&&g(e.step,"fail");return;case"ready":x(e.redirect),d("ready");return}},[b,g]);return(0,s.useEffect)(()=>{if(!e)return;let s=new AbortController;return o([]),x(null),d("running"),(async()=>{await (n??=l());let e=await fetch("/api/auth/provision",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({next:t,ref:r}),signal:s.signal});if(401===e.status)return void window.location.replace("/?error=auth_failed");if(!e.ok||!e.body)throw Error(`setup failed (${e.status})`);let a=e.body.pipeThrough(new TextDecoderStream).getReader(),i="",o=!1;for(;;){let{value:e,done:t}=await a.read();if(t)break;let r=(i+=e).split("\n");for(let e of(i=r.pop()??"",r)){if(!e.trim())continue;let t=JSON.parse(e);"ready"===t.type&&(o=!0),f(t)}}if(!o)throw Error("connection closed early")})().catch(e=>{s.signal.aborted||(console.error("[auth:setup]",e),d("failed"))}),()=>s.abort()},[e,p,t,r,f]),(0,s.useEffect)(()=>{if("running"!==c)return;let e=setInterval(()=>{let e=Date.now();o(t=>t.some(t=>"pending"===t.status&&!t.warned&&t.startedAt&&e-t.startedAt>5e3)?t.map(t=>"pending"===t.status&&t.startedAt&&e-t.startedAt>5e3?{...t,warned:!0}:t):t)},1e3);return()=>clearInterval(e)},[c]),{lines:i,status:c,redirect:u,retry:(0,s.useCallback)(()=>m(e=>e+1),[])}}},15034:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var s=r(95155);let a={bronze:{h:"#e3a05c",b:"#cd7f32",d:"#8a5420"},silver:{h:"#ececf0",b:"#c0c0c0",d:"#7c7c88"},gold:{h:"#ffe88a",b:"#ffd700",d:"#b08c00"},diamond:{h:"#eafcff",b:"#b9f2ff",d:"#5fb9d6"}},n={bronze:[".....h.....","....hbb....","...hbbbd...","..hbbbbbd..",".hbbb.bbbd.","hbbb...bbbd","hbb.....bbd"],silver:["hhhhbbbbbdd","hhbbbbbbbdd","hbbbbbbbbbd","hbbbbbbbbbd",".hbbbbbbbd.",".hbbbbbbbd.","..bbbbbbd..","...bbbbd...","....bbd....",".....b....."],gold:[".....h.....","....hbb....","....hbb....","hhhhhbbbddd",".hhbbbbbdd.","..hbbbbbd..","...bbbbd...","..bbbbbbb..","..bbb.ddd..","..b.....d.."],diamond:["..hhhbbbb..",".hhhbbbbbd.","hhbbbbbbbdd",".hbbbbbbdd.","..bbbbbdd..","...bbbdd...","....bdd....",".....d....."]};function l({tier:e,size:t=40}){let r=n[e]??n.bronze,i=a[e]??a.bronze,o=r[0].length,c=r.length;return(0,s.jsx)("svg",{width:t,height:Math.round(t*c/o),viewBox:`0 0 ${o} ${c}`,shapeRendering:"crispEdges","aria-hidden":!0,children:r.flatMap((e,t)=>[...e].map((e,r)=>"."===e?null:(0,s.jsx)("rect",{x:r,y:t,width:1,height:1,fill:i[e]},`${r}-${t}`)))})}},33145:(e,t,r)=>{"use strict";r.d(t,{P:()=>a,S:()=>s});let s=!1,a="OCT 8"},36217:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var s=r(95155),a=r(12115),n=r(64579),l=r(36970);function i({event:e,viewerLogin:t,variant:r,onNavigate:o,onCounterAttack:c}){let[d,u]=(0,a.useState)("idle"),x=(0,l.UK)(e),p=(0,l.WN)(e,t),m=(0,l.rS)(e,p),h=(0,l.x5)(e,t),b=m?.level?(0,n.$P)(m.level).color:"var(--color-border, #2a2a2a)",g=m?.rank!=null&&m.rank<=1e3?m.rank:null,f=async e=>{if("sending"!==d&&"sent"!==d){u("sending");try{let t=await fetch("/api/interactions/kudos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({receiver_login:e})});u(t.ok?"sent":"error")}catch{u("error")}}},y=e=>t=>{t.stopPropagation(),e()},v=m?.avatar_url??null;return(0,s.jsxs)("div",{onClick:()=>{p&&o?.(p)},className:["group relative flex cursor-pointer items-center gap-2.5","pulse"===r?"w-72 border border-border bg-bg-raised p-2 pl-2.5 shadow-lg shadow-black/40":"px-3 py-2 hover:bg-bg-card/50"].join(" "),children:[(0,s.jsx)("span",{className:"absolute left-0 top-0 h-full w-[2px]",style:{backgroundColor:x.color}}),(0,s.jsx)("div",{className:"relative shrink-0",title:p?`@${p}`:void 0,children:v?(0,s.jsx)("img",{src:v,alt:p??"",className:"h-8 w-8 border-2",style:{imageRendering:"pixelated",borderColor:b}}):(0,s.jsx)("div",{className:"h-8 w-8 border-2 bg-bg-card",style:{borderColor:b}})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"truncate text-[11px] leading-tight text-cream normal-case",children:(0,l.qF)(e,t)}),(0,s.jsxs)("div",{className:"mt-0.5 flex items-center gap-1.5 text-[8px] text-dim",children:[(0,s.jsx)("span",{style:{color:x.color},children:x.label}),null!=g&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-dim/50",children:"\xb7"}),(0,s.jsxs)("span",{style:{color:b}
1,children:["#",g.toLocaleString()]})]}),(0,s.jsx)("span",{className:"text-dim/50",children:"\xb7"}),(0,s.jsx)("span",{children:(0,l.KW)(e.created_at)})]})]}),h?.kind==="counter_attack"&&c&&(0,s.jsx)("button",{onClick:y(()=>c(h.login)),className:"shrink-0 border px-2 py-1 text-[9px] text-red-400 transition-colors hover:bg-red-500/10",style:{borderColor:"#ef444455"},children:"Hit back"}),h?.kind==="kudos_back"&&(0,s.jsx)("button",{onClick:y(()=>f(h.login)),disabled:"sent"===d||"sending"===d,className:"shrink-0 border px-2 py-1 text-[9px] transition-colors disabled:opacity-60",style:{borderColor:"error"===d?"#f8717155":"#c8e64a55",color:"error"===d?"#f87171":"#c8e64a"},children:"sent"===d?"Sent":"sending"===d?"...":"error"===d?"Retry":"+1 back"})]})}},36970:(e,t,r)=>{"use strict";r.d(t,{KW:()=>x,Kh:()=>u,UK:()=>a,WN:()=>o,eD:()=>m,gC:()=>p,qF:()=>d,rS:()=>i,x5:()=>c});let s={raid:"#ef4444",social:"#c8e64a",progress:"#ffd700",streak:"#fb923c",cosmetic:"#a78bfa",new:"#60a5fa",visit:"#22d3ee",misc:"#94a3b8"};function a(e){let t=(e,t)=>({category:e,label:t,color:s[e]});switch(e.event_type){case"raid_success":return t("raid","RAID");case"raid_failed":return t("raid","DEFENSE");case"kudos_given":return t("social","KUDOS");case"gift_sent":return t("social","GIFT");case"referral":return t("social","REFERRAL");case"achievement_unlocked":return t("progress","TROPHY");case"github_star_verified":return t("progress","STAR");case"rank_up":return t("progress","RANK");case"leaderboard_change":return t("progress","TOP");case"drop_pulled":return t("progress","DROP");case"dailies_completed":return t("progress","MISSIONS");case"streak_checkin":return t("streak","STREAK");case"item_equipped":return t("cosmetic","EQUIP");case"item_purchased":return t("cosmetic","SHOP");case"dev_joined":return t("new","NEW");case"building_claimed":return t("new","CLAIM");case"visit_milestone":return t("visit","VISITS");case"dev_highlight":return t("misc","HIGHLIGHT");default:return t("misc","CITY")}}function n(e){let t=e.metadata??{};return e.actor?.login??t.login??t.giver_login??t.attacker_login??t.referrer_login??null}function l(e){let t=e.metadata??{};return e.target?.login??t.receiver_login??t.defender_login??t.referred_login??null}function i(e,t){if(!t)return e.actor??e.target??null;let r=t.toLowerCase();return e.actor?.login?.toLowerCase()===r?e.actor:e.target?.login?.toLowerCase()===r?e.target:e.actor??e.target??null}function o(e,t){let r=t?.toLowerCase(),s=n(e),a=l(e);return r&&s?.toLowerCase()===r&&a?a:s??a}function c(e,t){let r=t?.toLowerCase();if(!r)return null;let s=n(e),a=l(e),i=a?.toLowerCase()===r;switch(e.event_type){case"raid_success":case"raid_failed":if(i&&s)return{kind:"counter_attack",login:s};return null;case"kudos_given":case"gift_sent":case"referral":if(i&&s)return{kind:"kudos_back",login:s};return null;default:return null}}function d(e,t){var r;let s,a=e.metadata??{},i=t?.toLowerCase()??null,o=(e,t="someone")=>e?i&&e.toLowerCase()===i?"you":`@${e}`:t,c=n(e),d=l(e);switch(e.event_type){case"achievement_unlocked":s=a.count&&a.count>1?`${o(c)} unlocked ${a.count} achievements`:`${o(c)} unlocked "${a.achievement_name??"an achievement"}"`;break;case"building_claimed":s=`${o(c)} claimed their building`;break;case"item_purchased":s=`${o(c)} bought ${a.item_id??"an item"}`;break;case"kudos_given":s=`${o(c)} gave kudos to ${o(d)}`;break;case"referral":s=`${o(c)} brought ${o(d)} to the city`;break;case"gift_sent":s=`${o(c)} gifted ${a.item_id??"an item"} to ${o(d)}`;break;case"dev_joined":s=`${o(c)} joined the city`;break;case"visit_milestone":s=`${o(d??c)}'s building got ${a.visit_count??"many"} visits today`;break;case"item_equipped":s=`${o(c)} equipped ${a.item_id??"an item"}`;break;case"rank_up":s=`${o(c)} climbed to #${a.new_rank??"?"}`;break;case"leaderboard_change":s=`${o(c)} entered the top ${a.position??3}`;break;case"raid_success":s=`${o(c)} raided ${o(d)}'s building`;break;case"raid_failed":s=`${o(d)} defended against ${o(c)}`;break;case"streak_checkin":s=`${o(c)} checked in (${a.streak??"?"}-day streak)`;break;case"github_star_verified":s=`${o(c)} unlocked the GitHub Star`;break;case"drop_pulled":s=`${o(c)} pulled a reward drop`;break;case"dailies_completed":s=`${o(c)} completed today's missions`;break;case"dev_highlight":{let e=o(c);switch(a.highlight){case"contributions":s=`${e}
1 has ${Number(a.value).toLocaleString()} contributions`;break;case"stars":s=`${e} has ${Number(a.value).toLocaleString()} stars across their repos`;break;case"rank":s=`${e} ranked #${a.value} in the city`;break;case"streak":s=`${e} is on a ${a.value}-day commit streak`;break;case"language":s=`${e} builds with ${a.value}`;break;case"repos":s=`${e} has ${a.value} public repos`;break;default:s=`${e} is in the city`}break}default:s=`${o(c)} is active in the city`}return(r=s).charAt(0).toUpperCase()+r.slice(1)}function u(e){let t=new Set,r=[];for(let s of e)t.has(s.id)||(t.add(s.id),r.push(s));return r}function x(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t} min ago`;let r=Math.floor(t/60);if(r<24)return`${r}h ago`;let s=Math.floor(r/24);return`${s}d ago`}function p(e){let t=new Date(e).getTime(),r=Date.now()-t;if(r<36e5)return"now";let s=new Date;return(s.setHours(0,0,0,0),t>=s.getTime())?"today":r<6048e5?"week":"older"}let m={now:"HAPPENING NOW",today:"EARLIER TODAY",week:"THIS WEEK",older:"EARLIER"}},39995:(e,t,r)=>{"use strict";r.d(t,{Dj:()=>i,a4:()=>o,yU:()=>l});var s=r(95155);let a={github:["..#......#..",".###....###.",".##########.","############","###..##..###","###..##..###","############","############",".##########.","..########..","..###..###..","............"],linkedin:["############","############","############","###.########","############","###.##...###","###.##.#.###","###.##.#.###","###.##.#.###","############","############","############"],twitter:["##........##","###......###",".###....###.","..###..###..","...######...","....####....","....####....","...######...","..###..###..",".###....###.","###......###","##........##"],youtube:["............",".##########.","############","#####.######","#####..#####","#####...####","#####...####","#####..#####","#####.######","############",".##########.","............"],website:["....####....","..##.##.##..",".##.####.##.",".##.####.##.","##.######.##","##........##","##.######.##",".##.####.##.",".##.####.##.","..##.##.##..","..########..","....####...."],email:["............","............","############","#.########.#","##.######.##","###.####.###","####.##.####","#####..#####","############","############","############","............"],pencil:["........###.",".......####.","......#####.",".....#####..","....#####...","...#####....","..#####.....",".#####......",".####.......",".###........",".#..........","............"]},n=Object.fromEntries(Object.keys(a).map(e=>[e,function(e){let t="";for(let r=0;r<e.length;r++)for(let s=0;s<e[r].length;s++)"#"===e[r][s]&&(t+=`M${s} ${r}h1v1h-1z`);return t}(a[e])])),l={github:"GitHub",linkedin:"LinkedIn",twitter:"X",youtube:"YouTube",website:"Website",email:"Email",pencil:"Edit"};function i({name:e,size:t=12}){return(0,s.jsx)("svg",{width:t,height:t,viewBox:"0 0 12 12",shapeRendering:"crispEdges","aria-hidden":!0,focusable:!1,children:(0,s.jsx)("path",{d:n[e],fill:"currentColor"})})}function o({name:e,href:t,size:r=28,className:a="",hoverColor:n}){let c=t.startsWith("mailto:");return(0,s.jsxs)("a",{href:t,...c?{}:{target:"_blank",rel:"noopener noreferrer nofollow ugc"},"aria-label":l[e],className:`group relative inline-flex shrink-0 items-center justify-center border-2 border-border-light bg-bg/40 text-muted transition-colors btn-press hover:border-[color:var(--chip-hover)] hover:text-[color:var(--chip-hover)] ${a}`,style:{width:r,height:r,"--chip-hover":n??"var(--color-lime)"},children:[(0,s.jsx)(i,{name:e,size:r>=48?24:12}),(0,s.jsx)("span",{className:"pointer-events-none absolute bottom-full left-1/2 z-30 mb-1.5 hidden -translate-x-1/2 whitespace-nowrap border-2 border-border-light bg-bg px-1.5 py-0.5 text-[8px] normal-case tracking-wider text-cream group-hover:block group-focus-visible:block",role:"tooltip",children:function(e,t){if("email"===e)return t.replace(/^mailto:/,"");if("website"===e)try{return new URL(t).hostname.replace(/^www\./,"")}catch{}return l[e]}(e,t)})]})}},54124:(e,t,r)=>{"use strict";r.d(t,{dG:()=>s});let s=["linkedin","twitter","youtube","website","email"]},55100:(e,t,r)=>{"use strict";r.d(t,{default:()=>tS});var s=r(95155),a=r(39092),n=r.n(a),l=r(12115),i=r(33210),o=r(29857),c=r(73321);let d=[[15e3,0],[15e3,14e3],[0,14e3],[-15e3,14e3],[3e4,0],[3e4,14e3]];function u({count:e}){let[t,r]=(0,l.useState)({fps:0,p95:0}),a=(0,l.useRef)([]);return(0,l.useEffect)(()=>{let e=0,t=performance.now(),s=t,n=l=>{if(a.current.push(l-t),t=l,l-s>=1e3){let e=a.current.slice().sort((e,t)=>
1e-t),t=e[Math.floor(.95*e.length)]??0;r({fps:Math.round(1e3*e.length/(l-s)),p95:Math.round(t)}),a.current=[],s=l}e=requestAnimationFrame(n)};return e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[]),(0,s.jsxs)("div",{className:"pointer-events-none fixed left-3 top-16 z-[100] bg-black/80 px-3 py-2 font-pixel text-xs text-lime-300",children:[(0,s.jsxs)("div",{children:[e.toLocaleString("en-US")," buildings"]}),(0,s.jsxs)("div",{children:[t.fps," fps \xb7 p95 ",t.p95," ms"]})]})}var x=r(23271),p=r(41541),m=r(30262),h=r(91114);function b(e){return[[.4,"$ git init city"],[h.wZ.bridge+.15,"$ git add developers"],[h.wZ.climb+.15,"$ git commit --floors"],[h.wZ.zoom+.15,`${e.toLocaleString("en-US")} contributors.`],[h.wZ.dive+.15,"Welcome to Git City."]]}function g({total:e,onSkip:t}){let r=(0,l.useRef)(null),a=(0,l.useRef)([]),n=(0,l.useRef)([]),i=(0,l.useRef)([]),o=b(e);return(0,l.useEffect)(()=>{let t=0,s=()=>{t=requestAnimationFrame(s);let l=h.$w.active?h.$w.t:0,o=b(e);if(r.current){let e=Math.min(1,(l-o[0][0])/.25,(h.wZ.land-l)/.25);r.current.style.opacity=String(Math.max(0,e))}let c=-1;o.forEach(([e,t],r)=>{let s=a.current[r],i=n.current[r];if(s&&i){if(l<e){s.style.display="none";return}c=r,s.style.display="block",i.textContent=t.slice(0,Math.min(t.length,Math.floor((l-e)/.045)+1))}}),o.forEach((e,t)=>{let r=a.current[t];r&&(r.style.opacity=t===c?"1":"0.45")}),o.forEach(([e,t],r)=>{let s=i.current[r];if(!s)return;let a=(l-e)/.045>=t.length;s.style.opacity=r!==c||a&&Math.floor((l-e)*2)%2!=0?"0":"1"})};return t=requestAnimationFrame(s),()=>cancelAnimationFrame(t)},[e]),(0,l.useEffect)(()=>{let e=window.setTimeout(()=>{window.addEventListener("keydown",t),window.addEventListener("pointerdown",t)},300);return()=>{window.clearTimeout(e),window.removeEventListener("keydown",t),window.removeEventListener("pointerdown",t)}},[t]),(0,s.jsxs)("div",{className:"pointer-events-none fixed inset-0 z-50",children:[(0,s.jsx)("div",{ref:r,className:"absolute border-[3px] border-border bg-bg/90 font-pixel normal-case",style:{opacity:0,left:"5%",top:"8%",padding:"0.8em 1.1em",fontSize:"clamp(0.75rem, 1.7vw, 1.3rem)"},children:o.map((e,t)=>(0,s.jsxs)("p",{ref:e=>{a.current[t]=e},style:{display:"none",lineHeight:1.7,color:m.DQ,textShadow:`0 0 0.4em ${m.DQ}55`,whiteSpace:"nowrap"},children:[(0,s.jsx)("span",{ref:e=>{n.current[t]=e},className:"tabular-nums"}),(0,s.jsx)("span",{ref:e=>{i.current[t]=e},className:"inline-block align-middle",style:{opacity:0,width:"0.55em",height:"1em",marginLeft:"0.2em",backgroundColor:m.DQ}})]},t))}),(0,s.jsx)("p",{className:"absolute top-4 right-4 font-pixel text-[10px] uppercase text-cream/40 sm:text-xs",children:"Skip >"})]})}var f=r(56507),y=r(37206),v=r(16385),j=r(33570),w=r(79014),k=r(5772),N=r(98500),_=r.n(N),S=r(64579),C=r(36217),$=r(36970);function T({events:e,viewerLogin:t,onOpenHub:r,onNavigate:a,onCounterAttack:i,hasBottomBar:o=!1,hubOpen:c=!1}){let[d,u]=(0,l.useState)([]),[x,p]=(0,l.useState)(0),m=(0,l.useRef)(new Set),h=(0,l.useRef)(!0),b=(0,l.useRef)(new Map),g=e.filter(e=>!e.id.startsWith("syn-")).slice(0,8);(0,l.useEffect)(()=>{let t=m.current;if(h.current){e.forEach(e=>t.add(e.id)),h.current=!1;return}let r=e.filter(e=>!t.has(e.id)&&!e.id.startsWith("syn-"));if(0===r.length)return;r.forEach(e=>t.add(e.id));let s=r.slice(0,3);for(let e of(u(e=>{let t=[...s,...e];return t.filter((e,r)=>t.findIndex(t=>t.id===e.id)===r).slice(0,3)}),s)){let t=setTimeout(()=>{u(t=>t.filter(t=>t.id!==e.id)),b.current.delete(e.id)},9e3);b.current.set(e.id,t)}},[e]),(0,l.useEffect)(()=>{if(g.length<=1)return;let e=setInterval(()=>p(e=>e+1),4e3);return()=>clearInterval(e)},[g.length]),(0,l.useEffect)(()=>{let e=b.current;return()=>{e.forEach(e=>clearTimeout(e)),e.clear()}},[]);let f=g.length?g[x%g.length]:null,y=f?(0,$.WN)(f,t):null,v=f?(0,$.rS)(f,y):null,j=f?(0,$.UK)(f):null,w=v?.level?(0,S.$P)(v.level).color:"#2a2a2a";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"jsx-c1bbbc7c63c6cc3d pointer-events-none fixed right-3 top-16 z-30 flex flex-col gap-2",children:d.map(e=>(0,s.jsxs)("div",{className:"jsx-c1bbbc7c63c6cc3d pulse-card pointer-events-auto relative",children:[(0,s.jsx)("button",{onClick:()=>{var t;let r;return t=e.id,u(e=>e.filter(e=>e.id!==t)),void((r=b.current.get(t))&&(clearTimeout(r),b.current.delete(t)))},"aria-label":"Dismiss",className:"jsx-c1bbbc7c63c6cc3d absolute -right-1.5 -top-1.5 z-10 flex h-4 w-4 items-center justify-center border border-border bg-bg text-[8px] text-muted hover:text-cream",children:"✕"}),(0,s.jsx)(C.A,{event:e,viewerLogin:t,variant:"pulse",onNavigate:a,onCounterAttack:i})]},e.id))}),(0,s.jsxs)("div",{className:`jsx-c1bbbc7c63c6cc3d fixed ${o?"bottom-11.5 sm:bottom-0":"bottom-0"} left-0 right-0 z-30 flex h-7 items-center border-t border-border/30 bg-bg/90 backdrop-blur-sm`,children:[(0,s.jsxs)("button",{onClick:r,style:{color:c?"#c8e64a":void 0},"aria-expanded":c,className:"jsx-c1bbbc7c63c6cc3d flex shrink-0 items-center gap-1.5 border-r border-border/30 px-3 text-[9px] transition-colors hover:text-[#c8e64a]",children:[(0,s.jsx)("span",{className:"jsx-c1bbbc7c63c6cc3d live-dot inline-block h-1.5 w-1.5 rounded-full bg-[#c8e64a]"}),(0,s.jsx)("span",{className:"jsx-c1bbbc7c63c6cc3d "+((c?"":"text-cream")||""),children:"CITY ACTIVITY"})]}),f&&(0,s.jsx)("button",{onClick:r,title:"Open city activity",className:"jsx-c1bbbc7c63c6cc3d flex min-w-0 flex-1 items-center gap-2 px-3 text-left",children:(0,s.jsxs)("span",{className:"jsx-c1bbbc7c63c6cc3d highlight-fade flex min-w-0 items-center gap-2",children:[v?.avatar_url?(0,s.jsx)("img",{src:v.avatar_url,alt:"",style:{imageRendering:"pixelated",borderColor:w},className:"jsx-c1bbbc7c63c6cc3d h-4 w-4 shrink-0 border"}):(0,s.jsx)("span",{style:{borderColor:w},className:"jsx-c1bbbc7c63c6cc3d h-4 w-4 shrink-0 border"}),j&&(0,s.jsx)("span",{style:{backgroundColor:j.color},className:"jsx-c1bbbc7c63c6cc3d hidden h-1.5 w-1.5 shrink-0 rounded-full sm:inline-block"}),(0,s.jsx)("span",{className:"jsx-c1bbbc7c63c6cc3d truncate text-[10px] text-muted normal-case",children:(0,$.qF)(f,t)}),(0,s.jsx)("span",{className:"jsx-c1bbbc7c63c6cc3d hidden shrink-0 text-[8px] text-dim sm:inline",children:(0,$.KW)(f.created_at)})]},f.id)}),(0,s.jsxs)("div",{className:"jsx-c1bbbc7c63c6cc3d hidden shrink-0 items-center gap-2 border-l border-border/30 pl-2 pr-3 sm:flex",children:[(0,s.jsx)("a",{href:"/terms",className:"jsx-c1bbbc7c63c6cc3d text-[8px] text-cream/20 transition-colors hover:text-cream/50",children:"Terms"}),(0,s.jsx)("span",{className:"jsx-c1bbbc7c63c6cc3d text-[8px] text-cream/10",children:"\xb7"}),(0,s.jsx)("a",{href:"/privacy",className:"jsx-c1bbbc7c63c6cc3d text-[8px] text-cream/20 transition-colors hover:text-cream/50",children:"Privacy"})]})]}),(0,s.jsx)(n(),{id:"c1bbbc7c63c6cc3d",children:".pulse-card.jsx-c1bbbc7c63c6cc3d{animation:pulse-in.35s cubic-bezier(.16,1,.3,1)}@keyframes pulse-in{0%{opacity:0;transform:translatey(12px)scale(.96)}100%{opacity:1;transform:translatey(0)scale(1)}}.highlight-fade.jsx-c1bbbc7c63c6cc3d{animation:highlight-fade.5s ease}@keyframes highlight-fade{0%{opacity:0;transform:translatey(4px)}100%{opacity:1;transform:translatey(0)}}.live-dot.jsx-c1bbbc7c63c6cc3d{animation:live-pulse 2s ease-in-out infinite}@keyframes live-pulse{0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(200,230,74,.5)}50%{opacity:.6;box-shadow:0 0 0 3px rgba(200,230,74,0)}}"})]})}var E=r(52462),L=r(15034),I=r(77649);let R="gc_checkin";var z=r(69400);let D="git-city-pvp-enabled";function M(){let e=window.localStorage.getItem(D);return null===e||"true"===e}let P=[15,22,2];function A(e=new Date){let t=e.getUTCHours(),r=e.getTime();for(let s of P)if(t===s)return{active:!0,multiplier:2,endsInMs:Math.max(0,Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),s,0,0,0)+36e5-r),startsInMs:0};let s=1/0;for(let t of P)for(let a of[0,1]){let n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()+a,t,0,0,0);n>r&&n<s&&(s=n)}return{active:!1,multiplier:1,endsInMs:0,startsInMs:Math.max(0,s-r)}}function O(e){let t=Math.max(0,Math.floor(e/1e3)),r=Math.floor(t/60);return`${r.toString().padStart(2,"0")}:${(t%60).toString().padStart(2,"0")}`}let F=["tip: shielded for 3s after reboot","tip: toggle Force Push off in the top bar to fly safe","tip: 2\xd7 XP during Force Push Happy Hour","have you tried turning it off and on again?","stack overflow at line 3","panic: runtime error","segmentation fault (core dumped)","exit code 137 — out of memory","git revert HEAD next time","did not match any files known to git"],U="#e8dcc8",G="#c8b89c",H="#8c8c9c",B="#c8e64a",W="#d44";function Y(){return{lastAttackerId:null,lastAttackerAt:0,attackerLogin:null,attackerX:0,attackerZ:0,lastHitConfirmedAt:0,lastDamageAt:0,downedUntil:0,killFeed:[],now:Date.now(),selfX:0,selfZ:0,selfYaw:0}}function X({selfStateRef:e,pilotsRef:t,pvpEnabled:r,selfPosRef:a,selfYawRef:i}){let o,[c,d]=(0,l.useState)(Y),[u,x]=(0,l.useState)(""),[p,m]=(0,l.useState)(null),[h,b]=(0,l.useState)(0),g=(0,l.useRef)(!1);(0,l.useEffect)(()=>{let r=setInterval(()=>{let r=e.current,s=r.lastAttackerId?t.current.get(r.lastAttackerId):null,n=Date.now(),l=r.downedUntil>n;l!==g.current&&(l?(x(F[Math.floor(Math.random()*F.length)]),m(s?s.login:null)):b(n),g.current=l),d({lastAttackerId:r.lastAttackerId,lastAttackerAt:r.lastAttackerAt,attackerLogin:s?s.login:null,attackerX:r.lastAttackerX,attackerZ:r.lastAttackerZ,lastHitConfirmedAt:r.lastHitConfirmedAt,lastDamageAt:r.lastDamageAt,downedUntil:r.downedUntil,killFeed:r.killFeed,now:n,selfX:a?.current.x??0,selfZ:a?.current.z??0,selfYaw:i?.current??0})},60);return()=>clearInterval(r)},[e,t,a,i]);let f=(0,l.useMemo)(()=>A(new Date(c.now)),[c.now]),y=c.downedUntil>c.now,v=c.now-c.lastHitConfirmedAt,j=c.lastHitConfirmedAt>0&&v<250,w=j?Math.max(0,1-v/250):0,k=c.now-c.lastDamageAt,N=c.lastDamageAt>0&&k<200,_=N?Math.max(0,1-k/200):0,S=c.lastDamageAt>0&&k<3e3,C=S?Math.max(0,1-k/3e3):0,$=0;S&&($=180*(Math.atan2(c.attackerX-c.selfX,-(c.attackerZ-c.selfZ))-c.selfYaw)/Math.PI);let T=c.killFeed.filter(e=>c.now-e.at<6e3);return(0,s.jsxs)(s.Fragment,{children:[f.active&&(0,s.jsx)("div",{style:{to
1p:72},className:"jsx-22e29c45efacba00 pointer-events-none fixed left-1/2 z-50 -translate-x-1/2 transform",children:(0,s.jsxs)("div",{className:"jsx-22e29c45efacba00 inline-flex items-center gap-2 border-[3px] border-border bg-bg/70 px-4 py-1.5 backdrop-blur-sm",children:[(0,s.jsx)("span",{className:"jsx-22e29c45efacba00 text-[10px]",children:"\uD83D\uDD25"}),(0,s.jsx)("span",{className:"jsx-22e29c45efacba00 text-[10px] uppercase text-cream tracking-wider",children:"Force Push Happy Hour"}),(0,s.jsx)("span",{className:"jsx-22e29c45efacba00 mx-1 text-border",children:"|"}),(0,s.jsx)("span",{style:{color:B,letterSpacing:"0.05em"},className:"jsx-22e29c45efacba00 text-[10px] uppercase font-bold",children:"2\xd7 XP"}),(0,s.jsx)("span",{className:"jsx-22e29c45efacba00 mx-1 text-border",children:"|"}),(0,s.jsx)("span",{style:{color:B},className:"jsx-22e29c45efacba00 text-[10px]",children:O(f.endsInMs)})]})}),T.length>0&&(0,s.jsx)("div",{style:{top:16,right:16,display:"flex",flexDirection:"column",gap:2,alignItems:"flex-end",fontFamily:"Silkscreen, monospace",maxWidth:320},className:"jsx-22e29c45efacba00 pointer-events-none fixed z-50 text-right",children:T.map(e=>{let t=c.now-e.at,r=t<4e3?1:Math.max(0,1-(t-4e3)/2e3);return(0,s.jsxs)("div",{style:{fontSize:10,letterSpacing:"0.04em",textTransform:"uppercase",color:G,opacity:r,textShadow:"0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000",whiteSpace:"nowrap"},className:"jsx-22e29c45efacba00",children:[e.happyHour&&(0,s.jsx)("span",{style:{marginRight:4},className:"jsx-22e29c45efacba00",children:"\uD83D\uDD25"}),(0,s.jsx)("span",{style:{color:e.killerWasSelf?B:G},className:"jsx-22e29c45efacba00",children:e.killerWasSelf?"you":`@${e.killerLogin}`}),(0,s.jsx)("span",{style:{color:H,margin:"0 6px"},className:"jsx-22e29c45efacba00",children:"→"}),(0,s.jsx)("span",{style:{color:e.victimWasSelf?W:G},className:"jsx-22e29c45efacba00",children:e.victimWasSelf?"you":`@${e.victimLogin}`}),e.killerWasSelf&&(0,s.jsxs)("span",{style:{color:B,marginLeft:8},className:"jsx-22e29c45efacba00",children:["+",e.happyHour?10:5," XP"]})]},e.id)})}),j&&r&&(0,s.jsxs)("div",{style:{width:28,height:28,opacity:w},className:"jsx-22e29c45efacba00 pointer-events-none fixed left-1/2 top-1/2 z-40 -translate-x-1/2 -translate-y-1/2 transform",children:[(0,s.jsx)("div",{style:{position:"absolute",left:4,top:4,width:20,height:3,background:B,transform:"rotate(45deg)",transformOrigin:"center"},className:"jsx-22e29c45efacba00"}),(0,s.jsx)("div",{style:{position:"absolute",left:4,top:4,width:20,height:3,background:B,transform:"rotate(-45deg)",transformOrigin:"center",marginTop:18},className:"jsx-22e29c45efacba00"})]}),N&&(0,s.jsx)("div",{style:{opacity:_,boxShadow:`inset 0 0 120px 40px ${W}`},className:"jsx-22e29c45efacba00 pointer-events-none fixed inset-0 z-[55]"}),S&&(a||i)&&(0,s.jsxs)("div",{style:{transform:`translate(-50%, -50%) rotate(${$}deg)`,width:6,height:220,opacity:C,transformOrigin:"center center"},className:"jsx-22e29c45efacba00 pointer-events-none fixed left-1/2 top-1/2 z-50",children:[(0,s.jsx)("div",{style:{position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:0,height:0,borderLeft:"10px solid transparent",borderRight:"10px solid transparent",borderBottom:`16px solid ${W}`},className:"jsx-22e29c45efacba00"}),(0,s.jsx)("div",{style:{position:"absolute",left:"50%",top:16,transform:"translateX(-50%)",width:4,height:60,background:W},className:"jsx-22e29c45efacba00"})]}),c.attackerLogin&&c.lastAttackerAt>0&&c.now-c.lastAttackerAt<5e3&&(0,s.jsx)("div",{style:{top:f.active?108:72},className:"jsx-22e29c45efacba00 pointer-events-none fixed left-1/2 z-50 -translate-x-1/2 transform",children:(0,s.jsx)("div",{style:{borderColor:W},className:"jsx-22e29c45efacba00 inline-flex items-center gap-2 border-[3px] bg-bg/70 px-3 py-1 backdrop-blur-sm",children:(0,s.jsxs)("span",{style:{color:W},className:"jsx-22e29c45efacba00 text-[10px] uppercase tracking-wider",children:["shot by @",c.attackerLogin]})})}),y&&(o=Math.max(0,Math.ceil((c.downedUntil-c.now)/1e3)),(0,s.jsxs)("div",{style:{background:"rgba(0, 0, 0, 0.78)",backdropFilter:"blur(3px)",animation:"pvp-death-in 0.18s ease-out"},className:"jsx-22e29c45efacba00 pointer-events-none fixed inset-0 z-[60] flex items-center justify-center",children:[(0,s.jsx)("div",{style:{height:2,background:`linear-gradient(90deg, transparent 0%, ${W} 50%, transparent 100%)`,opacity:.7},className:"jsx-22e29c45efacba00 pointer-events-none absolute inset-x-0 top-0"}),(0,s.jsxs)("div",{style:{background:"rgba(28,28,32,0.95)",border:`3px solid ${W}`,padding:"28px 56px",minWidth:360,fontFamily:"Silkscreen, monospace"},className:"jsx-22e29c45efacba00 text-center",children:[(0,s.jsx)("div",{style:{fontSize:9,color:W,letterSpacing:"0.3em",opacity:.7,marginBottom:6},className:"jsx-22e29c45efacba00",children:"─── error ───"}),(0,s.jsx)("div",{style:{color:W,fontSize:42,letterSpacing:"0.2em",textTransform:"uppercase",lineHeight:1,textShadow:`0 0 12px ${W}55`},className:"jsx-22e29c45efacba00",children:"Build Failed"}),p&&(0,s.jsxs)("div",{style:{marginTop:14,fontSize:11,color:U,letterSpacing:"0.12em",textTransform:"uppercase"},className:"jsx-22e29c45efacba00",children:["killed by"," ",(0,s.jsxs)("span",{style:{color:W,fontWeight:"bold"},className:"jsx-22e29c45efacba00",children:["@",p]})]}),(0,s.jsxs)("div",{style:{marginTop:18,display:"flex",alignItems:"baseline",justifyContent:"center",gap:10},className:"jsx-22e29c45efacba00",children:[(0,s.jsx)("span",{style:{fontSize:10,
1color:H,letterSpacing:"0.15em",textTransform:"uppercase"},className:"jsx-22e29c45efacba00",children:"rebooting in"}),(0,s.jsx)("span",{style:{fontSize:28,color:U,letterSpacing:"0.05em",minWidth:22,display:"inline-block",animation:"pvp-countdown-pulse 0.4s ease-out"},className:"jsx-22e29c45efacba00",children:o},o)]}),u&&(0,s.jsx)("div",{style:{marginTop:18,paddingTop:12,borderTop:"1px solid #2a2a30",fontSize:9,color:H,letterSpacing:"0.08em",fontStyle:"italic"},className:"jsx-22e29c45efacba00",children:u})]})]})),h>0&&c.now-h<1400&&(0,s.jsx)("div",{style:{animation:"pvp-deployed 1.4s ease-out forwards"},className:"jsx-22e29c45efacba00 pointer-events-none fixed left-1/2 top-1/2 z-[58] -translate-x-1/2 -translate-y-1/2 transform",children:(0,s.jsx)("div",{style:{background:"rgba(28,28,32,0.92)",border:`3px solid ${B}`,padding:"10px 24px",fontFamily:"Silkscreen, monospace",fontSize:16,color:B,letterSpacing:"0.2em",textTransform:"uppercase",textShadow:`0 0 10px ${B}55`},className:"jsx-22e29c45efacba00",children:"⚡ Deployed"})}),(0,s.jsx)(n(),{id:"22e29c45efacba00",children:"@keyframes pvp-death-in{from{opacity:0}to{opacity:1}}@keyframes pvp-countdown-pulse{0%{transform:scale(1.4);opacity:0}
140%{transform:scale(1);opacity:1}100%{transform:scale(1);opacity:1}}@keyframes pvp-deployed{0%{opacity:0;transform:translate(-50%,-50%)scale(.7)}15%{opacity:1;transform:translate(-50%,-50%)scale(1.1)}25%{transform:translate(-50%,-50%)scale(1)}80%{opacity:1;transform:translate(-50%,-50%)scale(1)}100%{opacity:0;transform:translate(-50%,-50%)scale(1)}}"})]})}function J(){let[e,t]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=setInterval(()=>t(e=>(e+1)%1e6),1e3);return()=>clearInterval(e)},[]);let r=A();return r.active?(0,s.jsxs)("div",{style:{background:"#c8e64a",color:"#1c1c20",padding:"2px 6px",fontFamily:"Silkscreen, monospace",fontSize:"9px",letterSpacing:"0.08em",boxShadow:"2px 2px 0 0 #8aaa1a, 0 0 12px rgba(200,230,74,0.6)",transform:"rotate(6deg)",animation:"fp-fly-badge-pulse 1.4s ease-in-out infinite"},className:"jsx-31d15c6b73df82f6 pointer-events-none absolute -top-2 -right-3 z-20 select-none",children:["\uD83D\uDD25 2\xd7 XP \xb7 ",O(r.endsInMs),(0,s.jsx)(n(),{id:"31d15c6b73df82f6",children:"@keyframes fp-fly-badge-pulse{0%,100%{transform:rotate(6deg)scale(1)}50%{transform:rotate(6deg)scale(1.06)}}"})]}):null}let Z=[[0,1,1,0,1,1,0],[1,1,1,1,1,1,1],[1,1,1,1,1,1,1],[0,1,1,1,1,1,0],[0,0,1,1,1,0,0],[0,0,0,1,0,0,0]];function K({filled:e,size:t=16,color:r="#c8e64a",emptyColor:a="#5c5c6c"}){return(0,s.jsx)("svg",{width:t,height:6*t/7,viewBox:"0 0 7 6",shapeRendering:"crispEdges",style:{display:"block"},children:Z.map((t,n)=>t.map((t,l)=>t?(0,s.jsx)("rect",{x:l,y:n,width:1,height:1,fill:e?r:"transparent",stroke:e?void 0:a,strokeWidth:.18*!e},`${l}-${n}`):null))})}var V=r(996),q=r(39995),Q=r(54124),ee=r(35327);let et={phase:"idle",previewData:null,raidData:null,attackerBuilding:null,defenderBuilding:null,error:null,loading:!1},er={intro:4500,outro_win:3500,outro_lose:3e3};function es({developer:e,isLoggedIn:t,isAdmin:r,onLogin:a,onClose:n,onAdminAdd:i,accent:o,shadow:c}){let[d,u]=(0,l.useState)(!1),[x,p]=(0,l.useState)(!1),[m,h]=(0,l.useState)(null),b=`${window.location.origin}/?user=${e.github_login}`,g=async()=>{if(i&&!x){p(!0),h(null);try{await i(e.github_login)}catch(e){h(e instanceof Error?e.message:"Failed to add"),p(!1)}}};return(0,s.jsxs)("div",{className:"fixed inset-0 z-40 flex items-center justify-center px-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-bg/70 backdrop-blur-sm",onClick:n}),(0,s.jsxs)("div",{className:"relative mx-3 border-[3px] border-border bg-bg-raised p-4 text-center sm:mx-0 sm:p-6",style:{maxWidth:340},children:[(0,s.jsx)("button",{onClick:n,className:"absolute top-2 right-3 text-[10px] text-muted transition-colors hover:text-cream",children:"✕"}),e.avatar_url&&(0,s.jsx)(k.default,{src:e.avatar_url,alt:e.github_login,width:48,height:48,className:"mx-auto mb-3 border-2 border-border",style:{imageRendering:"pixelated"}}),(0,s.jsxs)("p",{className:"text-xs text-cream normal-case",children:[(0,s.jsxs)("span",{style:{color:o},children:["@",e.github_login]}),e.name&&(0,s.jsxs)("span",{className:"text-muted",children:[" (",e.name,")"]})]}),(0,s.jsx)("p",{className:"mt-2 text-[10px] text-muted normal-case",children:"Not in the city yet"}),(0,s.jsxs)("p",{className:"mt-2 text-[10px] text-muted normal-case",children:[(0,s.jsx)("span",{style:{color:o},children:e.contributions.toLocaleString()})," contributions"," \xb7 ",(0,s.jsx)("span",{style:{color:o},children:e.total_stars.toLocaleString()})," stars"," \xb7 ",(0,s.jsx)("span",{style:{color:o},children:e.public_repos})," repos"]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2 sm:mt-5 sm:flex-row sm:justify-center sm:gap-3",children:[r&&i?(0,s.jsx)("button",{onClick:g,disabled:x,className:"btn-press whitespace-nowrap px-4 py-2 text-[10px] text-bg disabled:opacity-60",style:{backgroundColor:o,boxSh
1adow:`3px 3px 0 0 ${c}`},children:x?"Adding…":"Add to city"}):!t&&(0,s.jsx)("button",{onClick:()=>{a(),n()},className:"btn-press whitespace-nowrap px-4 py-2 text-[10px] text-bg",style:{backgroundColor:o,boxShadow:`3px 3px 0 0 ${c}`},children:"This is me? Sign in"}),(0,s.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(b),u(!0),setTimeout(()=>u(!1),2e3)},className:"btn-press whitespace-nowrap border-[3px] border-border px-4 py-2 text-[10px] text-cream transition-colors hover:border-border-light",children:d?"Link copied!":"Invite this dev"})]}),m&&(0,s.jsx)("p",{className:"mt-3 text-[10px] text-red-400 normal-case",children:m})]})]})}var ea=r(97185);let en=["remote: warning: 3 devs pushed to main on a Friday","remote: hint: fog detected over Golden Gate, rendering anyway","remote: 42 merge conflicts resolved peacefully today","remote: note: someone force-pushed. the city forgives.","remote: tip: tallest building belongs to whoever commits most"],el=["remote: still receiving objects...","remote: network is slow, hang tight...","remote: almost there..."],ei=e=>Math.floor(e).toLocaleString("en-US");function eo({stage:e,error:t,stats:r,onRetry:a,onFadeComplete:n,setup:i}){let[o,c]=(0,l.useState)([]),[d,u]=(0,l.useState)(!1),[x,p]=(0,l.useState)(!1),[h,b]=(0,l.useState)(!1),g=(0,l.useRef)(0),f=(0,l.useRef)(e),y=(0,l.useRef)(r),v=(0,l.useRef)(i?.status);(0,l.useEffect)(()=>{v.current=i?.status},[i?.status]);let[j,w]=(0,l.useState)(0),k="error"===e,N=(0,l.useRef)(null);(0,l.useEffect)(()=>{f.current=e,y.current=r,N.current="ready"===e?N.current??performance.now():null},[e,r]);let _=(0,l.useCallback)((e,t,r)=>{let s=++g.current;return c(a=>[...a,{id:s,cls:e,text:t,...r}]),s},[]),S=(0,l.useCallback)((e,t)=>{c(r=>r.map(r=>r.id===e?{...r,...t}:r))},[]);(0,l.useEffect)(()=>{let e=!1,t=()=>!e&&"error"!==f.current,r=performance.now(),s=()=>{let e=N.current;if(null==e)return 1;let t=performance.now(),s=Math.max(e,r+2500);return t<s?1:t-s>1200?1/0:8},a=0,n=async e=>{if(s()===1/0)return;if(a>=e){a-=e;return}let r=e-a;for(a=0;r>0;){if(!t())throw Error("aborted");await new Promise(e=>setTimeout(e,40));let e=s();if(e===1/0)return;r-=40*e}a=-r},l=async e=>{let t=_("cmd","",{typing:!0}),r="";for(let s of e)S(t,{text:r+=s}),await n(12+14*Math.random());S(t,{typing:!1})},i=async(e,t,r)=>{let s=_(e,t(0)),a=0;for(;a<r;)await n(60),a+=60,.15>Math.random()||S(s,{text:t(Math.min(1,a/r))});S(s,{text:t(1)})},o=async(e,t)=>{let r=_("step",e);await n(t),S(r,{done:!0})};return(async function(){c([]),u(!1),p(!1),b(!1);let e=()=>y.current?.total_developers||83586;for(;"running"===v.current||"idle"===v.current||"failed"===v.current;){if(!t())throw Error("aborted");await new Promise(e=>setTimeout(e,40))}"ready"===v.current&&(_("blank",""),r=performance.now()-2500),await l("git clone [email protected]:world/bay-area.git"),await n(150),_("out","Cloning into 'bay-area'..."),await n(200),_("remote",`remote: Enumerating buildings: ${ei(1196228)}, done.`),await n(180),await i("remote",t=>`remote: Counting developers: ${Math.floor(100*t)}% (${ei(t*e())}/${ei(e())})${t>=1?", done.":""}`,300),.6>Math.random()&&(await n(120),_("remote",en[Math.floor(Math.random()*en.length)])),await n(150),await i("out",e=>{let t=4002*e,r=t>=1024?`${(t/1024).toFixed(2)} MiB`:`${Math.floor(t)} KiB`,s=e>=1?"done.":`${(1.4+1.2*Math.random()).toFixed(2)} MiB/s`;return`Receiving objects: ${Math.floor(100*e)}% (${ei(1196228*e)}/${ei(1196228)}), ${r} | ${s}`},800),await i("out",e=>`Resolving streets: ${Math.floor(100*e)}% (${ei(25097*e)}/${ei(25097)})${e>=1?", done.":""}`,350),_("out","Checking out the skyline... done."),await n(180),_("blank",""),await l("cd bay-area && npm run city"),await n(150),await o("compiling shaders",200),await o(`planting ${ei(1017)} parks`,180),await o(`indexing ${ei(y.current?.total_contributions||0x44ca61c)} contributions`,200),await o(`turning on ${ei(1196228)} lights`,250),_("blank",""),_("welcome",`Welcome to GIT CITY — population ${ei(e())}`),u(!0);let s=0,a=0;for(;"ready"!==f.current;){if(!t())throw Error("aborted");await new Promise(e=>setTimeout(e,40)),(s+=40)>
1=4e3&&a<el.length&&(_("remote",el[a++]),s=0)}if(!t())throw Error("aborted");u(!1),p(!0),b(!0)})().catch(()=>{}),()=>{e=!0}},[j,_,S]);let C=(0,l.useCallback)(()=>{w(e=>e+1),a()},[a]),$=(0,l.useCallback)(e=>{h&&e.target===e.currentTarget&&n()},[h,n]);return(0,s.jsxs)("div",{className:`fixed inset-0 z-100 bg-bg transition-opacity duration-400 ${h?"pointer-events-none opacity-0":"opacity-100"}`,style:h?{transitionDelay:"520ms"}:void 0,onTransitionEnd:$,children:[(0,s.jsx)("style",{children:m.hB}),(0,s.jsx)("div",{className:"flex h-full items-center justify-center p-6",children:(0,s.jsxs)("div",{className:m.K$,style:m.tx,children:[i&&(0,s.jsx)(ea.A,{setup:i}),o.map(e=>(0,s.jsxs)("div",{className:"min-h-[1.9em] whitespace-pre-wrap break-all",children:["cmd"===e.cls&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{style:{color:m.DQ},children:"$ "}),(0,s.jsx)("span",{className:"text-neutral-300",children:e.text}),e.typing&&(0,s.jsx)(m.DE,{})]}),"out"===e.cls&&(0,s.jsx)("span",{className:"text-neutral-300",children:e.text}),"remote"===e.cls&&(0,s.jsx)("span",{className:"text-neutral-500",children:e.text}),"step"===e.cls&&(0,s.jsxs)("span",{className:"text-neutral-500",children:["  ▸ ",e.text,"...",e.done&&(0,s.jsx)("span",{style:{color:m.DQ},children:" done"})]}),"welcome"===e.cls&&(0,s.jsx)("span",{style:{color:m.DQ},children:e.text}),"error"===e.cls&&(0,s.jsx)("span",{className:"text-[#e05252]",children:e.text})]},e.id)),d&&!k&&(0,s.jsxs)("div",{className:"min-h-[1.9em]",children:[(0,s.jsx)("span",{style:{color:m.DQ},children:"$ "}),(0,s.jsx)(m.DE,{})]}),k&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"min-h-[1.9em]"}),(0,s.jsx)("div",{className:"min-h-[1.9em] text-[#e05252]",children:`fatal: unable to access 'git.city': ${t??"something went wrong"}`}),(0,s.jsx)("div",{className:"min-h-[1.9em] text-[#e05252]",children:"hint: check your connection and try again"}),(0,s.jsx)("button",{onClick:C,className:"btn-press mt-4 px-6 py-2 font-pixel text-xs text-bg",style:{backgroundColor:m.DQ},children:"RETRY"})]})]})}),(0,s.jsx)(m.jG,{}),x&&(0,s.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-white",style:{opacity:0,animation:"gc-flash 500ms ease-out 400ms forwards"}})]})}var ec=r(11462),ed=r(72252);let eu=null;function ex(e){eu=Object.defineProperties({timestamp:Date.now()},Object.getOwnPropertyDescriptors(e))}var ep=r(99961),em=r(4591);class eh{constructor(e){this.pending=null,this.value=e}get current(){if(this.pending){let e=this.pending;this.pending=null,this.value=e()}return this.value}set current(e){this.pending=null,this.value=e}setLazy(e){this.pending=e}}var eb=r(37463),eg=r(79391),ef=r(54754),ey=r(55479),ev=r(32535),ej=r(33145),ew=r(52011),ek=r(97650),eN=r(82576),e_=r(94266),eS=r(69981);let eC="gate",e$=Math.atan2(-500,850)+Math.PI,eT="Silkscreen, monospace",eE="#232a36",eL="#161b24",eI="#c8e64a",eR="#e8c547";function ez(e){let t=new ek.GOR(e);return t.colorSpace=ek.er$,t.magFilter=ek.hxR,t.minFilter=ek.$_I,t.anisotropy=4,t}function eD(e,t,r,s){let a=s;for(e.font=`${a}px ${eT}`;e.measureText(t).width>r&&a>10;)a-=2,e.font=`${a}px ${eT}`}function eM(e,t,r){e.fillStyle=eS.NX,e.fillRect(t,r,64,64),e.fillStyle=eI;for(let s=4;s<60;s+=8)e.fillRect(t+s,r+4,4,3),e.fillRect(t+s,r+57,4,3),e.fillRect(t+4,r+s,3,4),e.fillRect(t+57,r+s,3,4);e.textAlign="center",e.textBaseline="middle",e.font=`36px ${eT}`,e.fillText("?",t+32,r+34)}function eP(e,t){let r=document.createElement("canvas");r.width=e,r.height=t;let s=r.getContext("2d");return s.fillStyle=eS.NX,s.fillRect(0,0,e,t),[r,s]}function eA({map:e,w:t,h:r,glow:a=.7}){return(0,s.jsxs)("mesh",{children:[(0,s.jsx)("planeGeometry",{args:[t,r]}),(0,s.jsx)("meshStandardMaterial",{map:e,emissiveMap:e,emissive:"#ffffff",emissiveIntensity:a,roughness:.9})]})}function eO({at:e,size:t,color:r=eE,glow:a=.3,rot:n}){return(0,s.jsxs)("mesh",{position:e,rotation:n,children:[(0,s.jsx)("boxGeometry",{args:t}),(0,s.jsx)("meshStandardMaterial",{color:r,emissive:r,emissiveIntensity:a,roughness:.85})]})}function eF({at:e,size:t}){return(0,s.jsxs)("mesh",{position:e,children:[(0,s.jsx)("boxGeometry",{args:t}),(0,s.jsx)("meshStandardMaterial",{color:eI,emissive:eI,emissiveIntensity:.9,toneMapped:!1})]})}function eU({map:e,w:t,z:r,tilt:a=.95}){let n=3*t/8,l=14+n/2*Math.cos(a),i=r-n/2*Math.sin(a);return(0,s.jsxs)("group",{children:[(0,s.jsx)(eO,{at:[0,7,i],size:[t+20,14,n*Math.sin(a)+50],color:eL}),(0,s.jsxs)("group",{position:[0,l,i],rotation:[-a,0,0],children:[(0,s.jsx)(eO,{at:[0,0,-12],size:[t+16,n+16,24]}),(0,s.jsx)("group",{position:[0,0,.6],children:(0,s.jsx)(eA,{map:e,w:t,h:n,glow:.85})})]})]})}function eG({at:e,scale:t,map:r,rot:a=0,phase:n=0}){return(0,s.jsx)("group",{position:e,scale:t,children:(0,s.jsx)(e_.lN,{position:[0,0],rot:a,map:r,phase:n})})}function eH({tex:e}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eN.A,{children:[(0,s.jsx)(eO,{at:[0,10,0],size:[300,20,300],color:eL}),(0,s.jsx)(eO,{at:[0,30,0],size:[250,20,250]}),(0,s.jsx)(eO,{at:[0,90,0],size:[170,100,170],color:eL}),(0,s.jsx)(eF,{at:[0,143,0],size:[174,6,174]}),(0,s.jsx)(eO,{at:[0,150,0],size:[172,8,172],color:eL}),(0,s.jsxs)("mesh",{position:[0,242,0],rotation:[0,Math.PI/4,0],children:[(0,s.jsx)("cylinderGeometry",{args:[34,66,176,4]}),(0,s.jsx)("meshStandardMaterial",{color:eE,emissive:eE,emissiveIntensity:.3,roughness:.85,flatShading:!0})]}),(0,s.jsxs)("mesh",{position:[0,356,0],rotation:[0,Math.PI/4,0],children:[(0,s.jsx)("cylinderGeometry",{args:[0,40,52,4]}),(0,s.jsx)("meshStandardMaterial",{color:eR,emissive:eR,emissiveIntensity:.6,roughness:.5,flatShading:!0})]}),(0,s.jsx)(eF,{at:[0,310,0],size:[56,6,56]}),[0,1,2,3].map(t=>(0,s.jsx)("group",{rotation:[0,t*Math.PI/2,0],children:(0,s.jsx)("group",{position:[0,90,85.5],children:(0,s.jsx)(eA,{map:e.logo,w:80,h:80})})},t)),(0,s.jsx)("group",{position:[0,0,200],children:(0,s.jsx)("group",{scale:12,children:(0,s.jsx)(e_.QB,{position:[0,0],rot:0,map:e.wide})})}),(0,s.jsx)(eU,{map:e.plaque,w:360,z:350})]},e.id),(0,s.jsx)(eG,{at:[0,382,0],scale:6,map:e.cloth})]})}function eB({tex:e}){let t=(0,l.useRef)(null);return(0,ew.D)(({clock:e})=>{let r=t.current;if(!r)return;let s=e.elapsedTime,a=Math.min(1,s%9/2.4);r.rotation.y=(Math.floor(s/9)+a*a*(3-2*a))*Math.PI*2,r.position.y=330+8*Math.sin(1.2*s)}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eN.A,{children:[(0,s.jsx)(eO,{at:[0,12,0],size:[320,24,320],color:eL}),(0,s.jsxs)("mesh",{position:[0,94,0],children:[(0,s.jsx)("cylinderGeometry",{args:[110,125,140,8]}),(0,s.jsx)("meshStandardMaterial",{color:eE,emissive:eE,emissiveIntensity:.3,roughness:.85,flatShading:!0})]}),(0,s.jsxs)("mesh",{position:[0,170,0],children:[(0,s.jsx)("cylinderGeometry",{args:[120,110,12,8]}),(0,s.jsx)("meshStandardMaterial",{color:eL,emissive:eL,emissiveIntensity:.3,roughness:.85,flatShading:!0})]}),(0,s.jsxs)("mesh",{position:[0,150,0],rotation:[Math.PI/2,0,Math.PI/8],children:[(0,s.jsx)("torusGeometry",{args:[116,4,4,8]}),(0,s.jsx)("meshStandardMaterial",{color:eI,emissive:eI,emissiveIntensity:.9,toneMapped:!1})]}
1),(0,s.jsxs)("group",{position:[0,110,150],rotation:[-.55,0,0],children:[(0,s.jsx)(eO,{at:[0,0,-10],size:[292,152,20],color:eL}),(0,s.jsx)("group",{position:[0,0,.6],children:(0,s.jsx)(eA,{map:e.wide,w:280,h:140})})]}),(0,s.jsx)(eO,{at:[0,30,170],size:[300,60,60],color:eL}),(0,s.jsx)(eU,{map:e.plaque,w:360,z:350})]},e.id),(0,s.jsxs)("group",{ref:t,position:[0,330,0],children:[(0,s.jsxs)("mesh",{children:[(0,s.jsx)("boxGeometry",{args:[270,270,14]}),(0,s.jsx)("meshStandardMaterial",{color:eR,emissive:eR,emissiveIntensity:.5,roughness:.5})]}),(0,s.jsx)("group",{position:[0,0,7.5],children:(0,s.jsx)(eA,{map:e.logo,w:250,h:250,glow:.85})}),(0,s.jsx)("group",{position:[0,0,-7.5],rotation:[0,Math.PI,0],children:(0,s.jsx)(eA,{map:e.logo,w:250,h:250,glow:.85})})]}),(0,s.jsx)(eG,{at:[-190,0,-70],scale:9,map:e.cloth,rot:180})]})}function eW({tex:e}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eN.A,{children:[[-225,225].map(e=>(0,s.jsxs)("group",{position:[e,0,0],children:[(0,s.jsx)(eO,{at:[0,18,0],size:[110,36,110],color:eL}),(0,s.jsx)(eO,{at:[0,115,0],size:[70,230,70]}),(0,s.jsx)(eF,{at:[0,115,36],size:[10,170,4]}),(0,s.jsx)(eF,{at:[0,115,-36],size:[10,170,4]})]},e)),(0,s.jsx)(eO,{at:[0,315,0],size:[540,170,60],color:eL}),(0,s.jsx)(eO,{at:[0,410,0],size:[570,20,80]}),(0,s.jsx)(eF,{at:[0,234,0],size:[542,8,62]}),(0,s.jsx)("group",{position:[0,319,30.6],children:(0,s.jsx)(eA,{map:e.wide,w:310,h:155})}),(0,s.jsx)("group",{position:[0,319,-30.6],rotation:[0,Math.PI,0],children:(0,s.jsx)(eA,{map:e.wide,w:310,h:155})}),[-1,1].map(t=>(0,s.jsx)("group",{position:[540*t/2+.6*t,315,0],rotation:[0,t*Math.PI/2,0],children:(0,s.jsx)(eA,{map:e.logo,w:54,h:54})},t)),(0,s.jsx)(eU,{map:e.plaque,w:360,z:150})]},e.id),(0,s.jsx)(eG,{at:[-225,420,0],scale:5,map:e.cloth,rot:180}),(0,s.jsx)(eG,{at:[225,420,0],scale:5,map:e.cloth,phase:1.4})]})}let eY={obelisk:[380,570,530,100],trophy:[420,480,520,95],gate:[590,580,260,50]};function eX({town:e,variant:t,onClick:r,teaser:a=null}){let n,i,o,c=(n=function(e){let[t,r]=(0,l.useState)(null);return(0,l.useEffect)(()=>{if(!e)return;let t=!0;return(0,eS.px)(e).then(s=>t&&r({url:e,img:s})).catch(()=>t&&r(null)),()=>{t=!1}},[e]),e&&t?.url===e?t.img:null}(e?.logoUrl??null),i=function(){let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=!0;return(document.fonts?.load("40px Silkscreen")??Promise.resolve()).catch(()=>null).finally(()=>e&&t(!0)),()=>{e=!1}},[]),e}(),o=(0,l.useMemo)(()=>({id:`${e?.slug??"-"}:${e?.name??""}:${e?.perDev??""}:${n?"l":"n"}:${i?"f":"-"}:${a??""}`,wide:e?(0,eS.hi)(n,e.name):a?function(e){let[t,r]=eP(256,128);return r.strokeStyle=eI,r.lineWidth=4,r.strokeRect(4,4,248,120),r.textAlign="center",r.textBaseline="middle",r.fillStyle="#ffffff",eD(r,"GIT CITY TOWNS",220,26),r.fillText("GIT CITY TOWNS",128,40),r.fillStyle=eI,eD(r,e,220,44),r.fillText(e,128,88),ez(t)}(a):function(){let[e,t]=eP(256,128);return t.strokeStyle=eI,t.lineWidth=4,t.setLineDash([12,8]),t.strokeRect(4,4,248,120),t.fillStyle="#ffffff",t.textAlign="center",t.textBaseline="middle",eD(t,"YOUR TOWN",228,40),t.fillText("YOUR TOWN",128,44),t.fillText("HERE",128,88),ez(e)}(),cloth:e?(0,eS.EW)(n,e.name):function(){let[e,t]=eP(96,64);return eM(t,16,0),ez(e)}(),logo:e&&n?(0,eS.hW)(n):function(){let[e,t]=eP(64,64);return eM(t,0,0),ez(e)}(),plaque:function(e,t=!1){let r=document.createElement("canvas");r.width=256,r.height=96;let s=r.getContext("2d");s.fillStyle=eS.NX,s.fillRect(0,0,256,96),s.strokeStyle=e?eR:eI,s.lineWidth=4,s.strokeRect(2,2,252,92),s.textAlign="center",s.textBaseline="middle",s.fillStyle=e?eR:"#8a93a3",eD(s,"TOWN OF THE WEEK",232,22),s.fillText("TOWN OF THE WEEK",128,28);let a=e?`${Math.round(e.perDev).toLocaleString("en-US")} PER DEV`:t?"SOON":"CREATE A TOWN";return s.fillStyle=e?"#ffffff":eI,eD(s,a,232,34),s.fillText(a,128,64),ez(r)}(e,!!a)}),[n,e?.slug,e?.name,e?.perDev,i,a]),(0,l.useEffect)(()=>()=>{o.wide.dispose(),o.cloth.dispose(),o.logo.dispose(),o.plaque.dispose()},[o]),o),d=!!r,u=(0,l.useRef)(null),x=(0,l.useRef)(null),p=(0,l.useRef)(r);(0,l.useEffect)(()=>{p.current=r},[r]);let{gl:m,camera:h,scene:b}=(0,ew.C)();(0,l.useEffect)(()=>
1{if(!d)return;let e=m.domElement,t=window,r=new ek.tBo,s=new ek.I9Y,a=t=>{let a=u.current,n=x.current;if(!a||!n)return!1;let l=e.getBoundingClientRect();s.x=(t.clientX-l.left)/l.width*2-1,s.y=-(2*((t.clientY-l.top)/l.height))+1,r.setFromCamera(s,h);let i=r.intersectObject(n,!1);if(0===i.length)return!1;let o=i[0].distance;for(let e of r.intersectObjects(b.children,!0)){if(e.distance>=o)break;if(e.object.isInstancedMesh)return!1;for(let t=e.object;t&&t!==a;t=t.parent)if(t.userData?.isLandmark)return!1}return!0},n=null,l=e=>{a(e)&&(t.__monumentClicked=!0,n={time:performance.now(),x:e.clientX,y:e.clientY})},i=e=>{if(t.__monumentClicked=!1,!n)return;let r=performance.now()-n.time,s=e.clientX-n.x,a=e.clientY-n.y;n=null,r>400||s*s+a*a>625||p.current?.()},o="ontouchstart"in window||navigator.maxTouchPoints>0,c=0,g=o?null:e=>{let r=performance.now();!(r-c<66)&&(c=r,a(e)?(document.body.style.cursor="pointer",t.__monumentCursor=!0):t.__monumentCursor&&(t.__monumentCursor=!1))};return e.addEventListener("pointerdown",l,!0),window.addEventListener("pointerup",i,!0),g&&e.addEventListener("pointermove",g,!0),()=>{e.removeEventListener("pointerdown",l,!0),window.removeEventListener("pointerup",i,!0),g&&e.removeEventListener("pointermove",g,!0),t.__monumentClicked=!1,t.__monumentCursor=!1}},[m,h,b,d]);let[g,f,y,v]=eY[t];return(0,s.jsxs)("group",{ref:u,rotation:[0,e$,0],scale:1.5,userData:{isLandmark:!0},children:[(0,s.jsxs)("mesh",{ref:x,position:[0,f/2,v],visible:!1,children:[(0,s.jsx)("boxGeometry",{args:[g,f,y]}),(0,s.jsx)("meshBasicMaterial",{})]}),"obelisk"===t&&(0,s.jsx)(eH,{tex:c},t),"trophy"===t&&(0,s.jsx)(eB,{tex:c},t),"gate"===t&&(0,s.jsx)(eW,{tex:c},t)]})}let eJ=(0,y.default)(()=>Promise.all([r.e(4664),r.e(6413),r.e(7575),r.e(2344),r.e(8296),r.e(4364),r.e(7167),r.e(1037),r.e(6601),r.e(267),r.e(9956),r.e(9155),r.e(4676),r.e(4969)]).then(r.bind(r,51610)),{loadableGenerated:{webpack:()=>[51610]},ssr:!1}),eZ={x:800,z:1e3,tx:0,tz:0},eK=new Set,eV={get:()=>eZ,set:(e,t,r,s)=>{eZ={x:e,z:t,tx:r,tz:s},eK.forEach(e=>e())},subscribe:e=>(eK.add(e),()=>{eK.delete(e)})},eq={speed:0,x:0,z:0,yaw:0},eQ=new Set,e0=()=>eq,e1=e=>(eQ.add(e),()=>{eQ.delete(e)});function e2(e){let t=(0,l.useSyncExternalStore)(eV.subscribe,eV.get,eV.get),r=(0,l.useSyncExternalStore)(e1,e0,e0);return(0,s.jsx)(ed.A,{...e,cameraX:t.x,cameraZ:t.z,cameraTargetX:t.tx,cameraTargetZ:t.tz,playerX:r.x,playerZ:r.z,playerYaw:r.yaw})}function e5(){let e=(0,l.useSyncExternalStore)(e1,e0,e0);return(0,s.jsx)(s.Fragment,{children:Math.round(e.speed)})}let e3=(0,y.default)(()=>r.e(5308).then(r.bind(r,55308)),{loadableGenerated:{webpack:()=>[55308]},ssr:!1}),e4=(0,y.default)(()=>r.e(3822).then(r.bind(r,13822)),{loadableGenerated:{webpack:()=>[13822]},ssr:!1}),e8=(0,y.default)(()=>r.e(9468).then(r.bind(r,19468)),{loadableGenerated:{webpack:()=>[19468]},ssr:!1}),e6=(0,y.default)(()=>r.e(9175).then(r.bind(r,49175)),{loadableGenerated:{webpack:()=>[49175]},ssr:!1}),e7=(0,y.default)(()=>Promise.all([r.e(2344),r.e(9956),r.e(5734)]).then(r.bind(r,2737)),{loadableGenerated:{webpack:()=>[2737]},ssr:!1}),e9=(0,y.default)(()=>r.e(9742).then(r.bind(r,19742)),{loadableGenerated:{webpack:()=>[19742]},ssr:!1}),te=(0,y.default)(()=>r.e(6194).then(r.bind(r,46194)),{loadableGenerated:{webpack:()=>[46194]},ssr:!1}),tt=(0,y.default)(()=>r.e(3284).then(r.bind(r,53284)),{loadableGenerated:{webpack:()=>[53284]},ssr:!1}),tr=(0,y.default)(()=>r.e(859).then(r.bind(r,70859)),{loadableGenerated:{webpack:()=>[70859]},ssr:!1}),ts=(0,y.default)(()=>Promise.all([r.e(7575),r.e(2344),r.e(4364),r.e(7167),r.e(4365)]).then(r.bind(r,29398)),{loadableGenerated:{webpack:()=>[29398]},ssr:!1}),ta=(0,y.default)(()=>r.e(8800).then(r.bind(r,8800)),{loadableGenerated:{webpack:()=>[8800]},ssr:!1}),tn=(0,y.default)(()=>r.e(5916).then(r.bind(r,73535)),{loadableGenerated:{webpack:()=>[73535]},ssr:!1}),tl=[{name:"Emerald",accent:"#f0c060",shadow:"#806020"},{name:"Midnight",accent:"#6090e0",shadow:"#203870"},{name:"Sunset",accent:"#c8e64a",shadow:"#5a7a00"},{name:"Neon",accent:"#e040c0",shadow:"#600860"}],ti={bronze:"#cd7f32",silver:"#c0c0c0",gold:"#ffd700",diamond:"#b9f2ff"},to={god_mode:"diamond",legend:"diamond",famous:"diamond",mayor:"diamond",machine:"gold",popular:"gold",factory:"gold",influencer:"gold",philanthropist:"gold",icon:"gold",legendary:"gold",grinder:"silver",architect:"silver",patron:"silver",beloved:"silver",admired:"silver",first_push:"bronze",committed:"bronze",builder:"bronze",rising_star:"bronze",recruiter:"bronze",generous:"bronze",gifted:"bronze",appreciated:"bronze",on_fire:"bronze",generous_streak:"bronze",dedicated:"silver",obsessed:"gold",no_life:"diamond",white_rabbit:"diamond",daily_rookie:"bronze",daily_regular:"silver",daily_master:"gold",daily_legend:"diamond"},tc={god_mode:"God Mode",legend:"Legend",famous:"Famous",mayor:"Mayor",machine:"Machine",popular:"Popular",factory:"Factory",influencer:"Influencer",grinder:"Grinder",architect:"Architect",builder:"Builder",rising_star:"Rising Star",recruiter:"Recruiter",committed:"Committed",first_push:"First Push",philanthropist:"Philanthropist",patron:"Patron",generous:"Generous",icon:"Icon",beloved:"Beloved",gifted:"Gifted",legendary:"Legendary",admired:"Admired",appreciated:"Appreciated",on_fire:"On Fire",dedicated:"Dedicated",obsessed:"Obsessed",no_life:"No Life",generous_streak:"Generous Streak",white_rabbit:"White Rabbit",daily_rookie:"Daily Rookie",daily_regular:"Daily Regular",daily_master:"Daily Master",daily_legend:"Daily Legend"},td=["Vibe Coder","Stack Overflow Tourist","Console.log Debugger","Ctrl+C Ctrl+V Engineer","Senior Googler","Git Push --force Enjoyer","Dark Mode Pur
1ist","Rubber Duck Whisperer","Merge Conflict Magnet","README Skipper","npm install Addict","Localhost Champion","Monday Deployer","Production Debugger","Legacy Code Archaeologist","Off-By-One Specialist","Commit Message Poet","Tab Supremacist","Docker Compose Therapist","10x Dev (Self-Proclaimed)","AI Prompt Jockey","Semicolon Forgetter","CSS Trial-and-Error Main","Works On My Machine Dev","TODO: Fix Later Dev","Infinite Loop Survivor","PR Approved (Didn't Read)","LGTM Speed Runner","404 Brain Not Found","Sudo Make Me A Sandwich"];function tu(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return td[(t%td.length+td.length)%td.length]}let tx=new Map,tp=e=>tx.set(e.github_login.toLowerCase(),e),tm=()=>new Set(tx.keys());async function th(){try{let e=await fetch("/api/city/my-lot",{method:"POST"});if(!e.ok)return null;return(await e.json()).lot??null}catch{return null}}let tb=[1e4,15e3,2e4,25e3,3e4,4e4,5e4,75e3,1e5],tg=[{delay:0,text:"Fetching GitHub profile..."},{delay:2e3,text:"Analyzing contributions..."},{delay:5e3,text:"Building the city block..."},{delay:9e3,text:"Almost there..."},{delay:13e3,text:"This one's a big profile. Hang tight..."}],tf=new Set(["not-found","org","no-activity"]),ty={"not-found":{primary:e=>`"@${e}" doesn't exist on GitHub`,secondary:"Check the spelling — could be a typo. GitHub usernames are case-insensitive."},org:{primary:e=>`"@${e}" is an organization, not a person`,secondary:"Git City is for individual profiles. Try searching for one of its contributors by their personal username."},"no-activity":{primary:e=>`"@${e}" has no public activity yet`,secondary:"Is this you? Open your profile settings, scroll to 'Contributions & activity', and enable 'Include private contributions'. Then search again.",hasLink:!0},"rate-limit":{primary:()=>"Search limit reached",secondary:"You can look up 10 new profiles per hour. Developers already in the city are unlimited."},"github-rate-limit":{primary:()=>"GitHub's API is temporarily unavailable",secondary:"Too many requests to GitHub. Try again in a few minutes."},timeout:{primary:e=>`Fetching "@${e}" took too long`,secondary:"GitHub's API was slow to respond. This usually resolves itself — try again in a moment.",hasRetry:!0},network:{primary:()=>"Couldn't reach the server",secondary:"Check your internet connection and try again.",hasRetry:!0},generic:{primary:()=>"Something went wrong",secondary:"An unexpected error occurred. Try again.",hasRetry:!0}};function tv({mode:e,preference:t,accent:r,onSelect:a}){let[n,i]=(0,l.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[n&&(0,s.jsxs)("div",{className:"absolute bottom-full left-0 mb-2 flex w-44 flex-col border-[3px] border-border bg-bg/95 backdrop-blur-sm animate-[fade-in_0.15s_ease-out]",children:[(0,s.jsx)("div",{className:"border-b-2 border-border px-3 py-1.5 text-[9px] uppercase tracking-wider text-muted",children:"Graphics"}),[{value:"auto",label:"AUTO",hint:"detect my GPU"},{value:"high",label:"HIGH",hint:"full effects"},{value:"low",label:"LOW",hint:"best FPS"}].map(e=>(0,s.jsxs)("button",{onClick:()=>{a(e.value),i(!1)},className:"flex items-baseline gap-2 px-3 py-1.5 text-left text-[10px] transition-colors hover:bg-bg-raised",children:[(0,s.jsx)("span",{style:{color:t===e.value?r:"transparent"},children:"▸"}),(0,s.jsx)("span",{className:"text-cream",children:e.label}),(0,s.jsx)("span",{className:"ml-auto text-[8px] text-muted",children:e.hint})]},e.value))]}),(0,s.jsxs)("button",{onClick:()=>i(e=>!e),title:"Graphics quality",className:"btn-press flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",children:[(0,s.jsx)("span",{style:{color:r},children:"◆"}),(0,s.jsx)("span",{className:"text-cream",children:"Graphics"}),(0,s.jsx)("span",{className:"text-dim",suppressHydrationWarning:!0,children:"high"===e?"HIGH":"LOW"})]})]})}function tj({feedback:e,accentColor:t,onDismiss:r,onRetry:a}){let[n,i]=(0,l.useState)(0);if((0,l.useEffect)(()=>{if(e?.type!=="loading"){let e=setTimeout(()=>i(0),0);return()=>clearTimeout(e)}let t=tg.map((e,t)=>setTimeout(()=>i(t),e.delay));return()=>t.forEach(clearTimeout)},[e?.type]),(0,l.useEffect)(()=>
1{if(e?.type!=="error")return;let t=e.code??"generic";if("no-activity"===t||"network"===t||"generic"===t||"timeout"===t)return;let s=setTimeout(r,8e3);return()=>clearTimeout(s)},[e,r]),!e)return null;if("loading"===e.type)return(0,s.jsxs)("div",{className:"flex items-center gap-2 py-1 animate-[fade-in_0.15s_ease-out]",children:[(0,s.jsx)("span",{className:"blink-dot h-2 w-2 shrink-0",style:{backgroundColor:t}}),(0,s.jsx)("span",{className:"text-[11px] text-muted normal-case",children:tg[n].text})]});let o=e.code??"generic",c=ty[o]??ty.generic,d=e.username??"";return(0,s.jsxs)("div",{className:"relative w-full max-w-md border-[3px] bg-bg-raised/90 px-4 py-3 backdrop-blur-sm animate-[fade-in_0.15s_ease-out]",style:{borderColor:"rate-limit"===o?t+"66":"rgba(248, 81, 73, 0.4)"},children:[(0,s.jsx)("button",{onClick:r,className:"absolute top-2 right-2 text-[10px] text-muted transition-colors hover:text-cream",children:"✕"}),(0,s.jsx)("p",{className:"text-[11px] text-cream normal-case pr-4",children:c.primary(d)}),(0,s.jsx)("p",{className:"mt-1 text-[10px] text-muted normal-case",children:c.secondary}),c.hasLink&&(0,s.jsx)("a",{href:"https://github.com/settings/profile",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-[10px] normal-case transition-colors hover:text-cream",style:{color:t},children:"Open Profile Settings →"}),c.hasRetry&&(0,s.jsx)("button",{onClick:a,className:"btn-press mt-2 border-2 border-border px-3 py-1 text-[10px] text-cream transition-colors hover:border-border-light",children:"Retry"})]})}let tw=[{label:"Contributors",key:"contributions",tab:"contributors"},{label:"Stars",key:"total_stars",tab:"stars"},{label:"Repos",key:"public_repos",tab:"architects"}];function tk({buildings:e,accent:t}){let[r,a]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=setInterval(()=>{a(e=>(e+1)%tw.length)},1e4);return()=>clearInterval(e)},[]);let n=tw[r],i=(0,l.useMemo)(()=>e.slice().sort((e,t)=>t[n.key]-e[n.key]).slice(0,5),[e,n.key]);return(0,s.jsxs)("div",{className:"hidden w-50 sm:block",children:[(0,s.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,s.jsx)("button",{onClick:()=>a(e=>(e+1)%tw.length),className:"text-[10px] text-muted transition-colors hover:text-cream normal-case",style:{color:t},children:n.label}),(0,s.jsx)("a",{href:`/leaderboard?tab=${n.tab}`,className:"text-[9px] text-muted transition-colors hover:text-cream normal-case",children:"View all →"})]}),(0,s.jsx)("div",{className:"border-2 border-border bg-bg-raised/80 backdrop-blur-sm",children:i.map((e,r)=>(0,s.jsxs)("a",{href:`/dev/${e.login}`,className:"flex items-center justify-between px-3 py-1.5 transition-colors hover:bg-bg-card",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 overflow-hidden",children:[(0,s.jsxs)("span",{className:"text-[10px]",style:{color:0===r?"#ffd700":1===r?"#c0c0c0":2===r?"#cd7f32":t},children:["#",r+1]}),(0,s.jsx)("span",{className:"truncate text-[10px] text-cream normal-case",children:e.login})]}),(0,s.jsx)("span",{className:"ml-2 shrink-0 text-[10px] text-muted",children:e[n.key].toLocaleString()})]},e.login))})]})}function tN(e){return e>=30?"#aa44ff":e>=14?"#ff2222":e>=7?"#ff8833":"#4488ff"}function t_({serverIsAdmin:e,townOfWeek:t}){let r,a,m,h,b,y,N,C,$,P,A,O,F,U,G,H,B,W,Y,Z,ea,en,el,ei,ed,ew,ek,eN,e_,eS,e$,eT,eE,eL,eI,eR,ez,eD,eM,eP=(0,c.useSearchParams)(),eA=(0,c.useRouter)(),eO=eP.get("user"),eF=eP.get("gifted"),[eU]=(0,l.useState)(()=>"1"===eP.get("setup")),[eG]=(0,l.useState)(()=>eP.get("ref")),eH=(0,ec.m)(eU,null,eG),[eB,eW]=(0,l.useState)(eU);(0,l.useEffect)(()=>{"ready"===eH.status&&eH.redirect&&window.history.replaceState(null,"",eH.redirect)},[eH.status,eH.redirect]);let[eY,eZ]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eZ(!0)},[]);let eK=Number.isFinite(r=Number(eP.get("bench")))&&r>0?Math.min(4e5,Math.floor(r)):0,[e0,e1]=(0,l.useState)(null),[td,tg]=(0,l.useState)([]);(0,l.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch("/api/events/active"),r=await t.json();if(e)return;if(r.live&&r.event){let e=r.event.theme_config?.variant==="cafetopia"?"cafetopia":"duck";
1e1({id:r.event.id,maxHp:r.event.boss_max_hp,variant:e,participants:r.participants??0,tuning:r.event.boss_config??void 0}),tg(Array.isArray(r.leaderboard)?r.leaderboard:[])}else e1(null),tg([])}catch{}};t();let r=setInterval(t,12e3);return()=>{e=!0,clearInterval(r)}},[]);let ty=(0,l.useCallback)((e,t={})=>{try{let r=localStorage.getItem("gitcity_anon_id");r||(r=crypto.randomUUID(),localStorage.setItem("gitcity_anon_id",r)),fetch("/api/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event_name:e,anonymous_id:r,props:t}),keepalive:!0}).catch(()=>{})}catch{}},[]),tw=(0,l.useMemo)(()=>{let e=eP.get("boss");if("duck"===e||"cafetopia"===e){if(eP.has("bossPhase")){let t=parseInt(eP.get("bossPhase")??"1",10);return{variant:e,mode:"static",phase:t>=1&&t<=4?t:1}}return{variant:e,mode:"live"}}return e0?{variant:e0.variant,mode:"live",eventId:e0.id,maxHp:e0.maxHp,serverAuthoritative:!0,tuning:e0.tuning}:null},[eP,e0]),[tS,tC]=(0,l.useState)(""),t$=(0,l.useRef)(new Map),[tT,tE]=(0,l.useState)([]),[tL]=(0,l.useState)(()=>new eh([])),tI=(0,l.useRef)(void 0),tR=(0,l.useRef)([]),[tz,tD]=(0,l.useState)([]),[tM,tP]=(0,l.useState)([]),[tA,tO]=(0,l.useState)(null),[tF,tU]=(0,l.useState)([]),[tG,tH]=(0,l.useState)(null),tB=(0,l.useRef)(void 0),[tW,tY]=(0,l.useState)([]),[tX,tJ]=(0,l.useState)(!1),[tZ,tK]=(0,l.useState)("init"),[tV,tq]=(0,l.useState)(0),[tQ,t0]=(0,l.useState)(null),[t1,t2]=(0,l.useState)(null),[t5,t3]=(0,l.useState)(!1),[t4,t8]=(0,l.useState)("airplane"),t6=(0,l.useRef)(null),t7=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(tw?.mode!=="live"||!tw.serverAuthoritative||!tw.eventId)return;let e=tw.eventId;t6.current!==e&&(t6.current=e,ty("raid_viewed",{event_id:e})),t5&&t7.current!==e&&(t7.current=e,ty("raid_joined",{event_id:e}))},[tw,t5,ty]);let[t9,re]=(0,l.useState)(!1),[rt,rr]=(0,l.useState)(!1),[rs,ra]=(0,l.useState)(!1),[rn,rl]=(0,l.useState)(0),{mode:ri,preference:ro,setPreference:rc,downgradeAutoTier:rd}
1=(0,eg.s)(),[ru,rx]=(0,l.useState)(!1),rp=(0,l.useRef)(0),rm=(0,l.useRef)(!1),rh=(0,l.useRef)("init");(0,l.useEffect)(()=>{rh.current=tZ,performance.mark(`city:${tZ}`)},[tZ]);let rb=(0,l.useCallback)(()=>{rp.current+=1,!(rp.current<2)&&("done"!==rh.current?(rd(),rp.current=0):rm.current||(rm.current=!0,rx(!0)))},[rd]);(0,l.useEffect)(()=>{let e=localStorage.getItem("gitcity_theme");if(null!==e){let t=parseInt(e,10);t>=0&&t<=3&&rl(t)}},[]);let rg=(0,l.useCallback)(e=>{let t=tR.current;if(0===t.length)return;let r=new Map;for(let e of t)r.set(e.n,e);for(let t of e){let e=r.get(t.rank);e&&(t.active_drop={id:e.id,rarity:e.r,points:e.p,max_pulls:e.m,pull_count:e.c,expires_at:e.x})}},[]),rf=(0,l.useRef)({x:0,z:0}),ry=(0,l.useRef)(0),[rv,rj]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!t5)return void rj(!1);rj(!0);let e=setTimeout(()=>rj(!1),6e3);return()=>clearTimeout(e)},[t5]);let[rw,rk]=(0,l.useState)(3),[rN,r_]=(0,l.useState)(!1),[rS,rC]=(0,l.useState)(0),[r$,rT]=(0,l.useState)(null),[rE,rL]=(0,l.useState)(!1),[rI,rR]=(0,l.useState)(!1),[rz,rD]=(0,l.useState)({score:0,earned:0,combo:0,collected:0,maxCombo:1}),[rM,rP]=(0,l.useState)(0),rA=(0,l.useRef)(0),rO=(0,l.useRef)(0),rF=(0,l.useRef)(0),rU=(0,l.useRef)(null),[rG,rH]=(0,l.useState)(0),[rB,rW]=(0,l.useState)({total_developers:0,total_contributions:0}),[rY,rX]=(0,l.useState)([]),[rJ,rZ]=(0,l.useState)(null),[rK,rV]=(0,l.useState)(null),[rq,rQ]=(0,l.useState)(!1),[r0,r1]=(0,l.useState)(null),[r2,r5]=(0,l.useState)(null),[r3,r4]=(0,l.useState)(!1),[r8,r6]=(0,l.useState)(!1),[r7,r9]=(0,l.useState)(!1),[se,st]=(0,l.useState)(!0);(0,l.useEffect)(()=>{try{"0"===localStorage.getItem("gc_force_lights_on")&&st(!1)}catch{}},[]);let sr=(0,l.useCallback)(()=>{st(e=>{let t=!e;try{localStorage.setItem("gc_force_lights_on",t?"1":"0")}catch{}return t})},[]),[ss,sa]=(0,l.useState)(!1),[sn,sl]=(0,l.useState)(!1),[si,so]=(0,l.useState)(null),[sc,sd]=(0,l.useState)(!1),[su,sx]=(0,l.useState)(null),[sp,sm]=(0,l.useState)(null),[sh,sb]=(0,l.useState)(!1),[sg,sf]=(0,l.useState)(!1),[sy,sv]=(0,l.useState)([]),[sj,sw]=(0,l.useState)(!1),[sk,sN]=(0,l.useState)(null),[s_,sS]=(0,l.useState)(!1),[sC,s$]=(0,l.useState)(!1),[sT,sE]=(0,l.useState)(null),[sL,sI]=(0,l.useState)(!1),[sR,sz]=(0,l.useState)({}),sD=(0,l.useRef)(!1),[sM,sP]=(0,l.useState)(!1),[sA,sO]=(0,l.useState)(!1),[sF,sU]=(0,l.useState)(!1),[sG,sH]=(0,l.useState)("common"),[sB,sW]=(0,l.useState)(24),[sY,sX]=(0,l.useState)(50),[sJ,sZ]=(0,l.useState)(""),[sK,sV]=(0,l.useState)([]),[sq,sQ]=(0,l.useState)(!1),[s0,s1]=(0,l.useState)(null),s2=(0,l.useRef)(null),[s5,s3]=(0,l.useState)(null),s4=(0,l.useRef)(new Map),[s8,s6]=(0,l.useState)(null),[s7,s9]=(0,l.useState)(null),[ae,at]=(0,l.useState)(!1);(0,l.useEffect)(()=>{s7?at(!0):at(!1)},[s7]);let[ar,as]=(0,l.useState)(!1),[aa,an]=(0,l.useState)(!1),[al,ai]=(0,l.useState)(null),[ao,ac]=(0,l.useState)(null),[ad,au]=(0,l.useState)(null),[ax,ap]=(0,l.useState)(null),[am,ah]=(0,l.useState)(!1),[ab,ag]=(0,l.useState)(!1),[af,ay]=(0,l.useState)("en"),[av,aj]=(0,l.useState)(null),[aw,ak]=(0,l.useState)(ef.Nc),[aN,a_]=(0,l.useState)(null),[aS,aC]=(0,l.useState)(null),[a$,aT]=(0,l.useState)(!1),[aE,aL]=(0,l.useState)(!1),[aI,aR]=(0,l.useState)(!1),[az,aD]=(0,l.useState)(null),[aM,aP]=(0,l.useState)(0),[aA,aO]=(0,l.useState)(!1),[aF,aU]=(0,l.useState)(-1),[aG,aH]=(0,l.useState)(0);(0,l.useEffect)(()=>{let e=parseInt(localStorage.getItem("gitcity_rabbit_progress")??"0",10)||0;e>0&&aH(e)},[]);let[aB,aW]=(0,l.useState)(null),[aY,aX]=(0,l.useState)(!1),[aJ,aZ]=(0,l.useState)(null),aK=(0,l.useRef)(0),aV=(0,l.useRef)(!1),[aq,aQ]=(0,l.useState)(!1),[a0,a1]=(0,l.useState)(null),[a2,a5]=(0,l.useState)(!1),a3=(0,l.useRef)(null),[a4,a8]=(0,l.useState)(null),[a6,a7]=(0,l.useState)(!1),[a9,ne]=(0,l.useState)(!1),[nt,nr]=(0,l.useState)(null),ns=(0,l.useRef)(void 0),na=(0,l.useRef)(void 0),nn=(0,l.useRef)(void 0),nl=(0,l.useRef)(!1),[ni,no]=(0,l.useState)(null),[nc,nd]=function(){let[e,t]=(0,l.useState)(et),r=(0,l.useRef)(null),s=(0,l.useRef)(""),a=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{r.current&&clearTimeout(r.current),(0,ee.o7)()},[]);let n=(0,l.useCallback)(e=>{switch(t(t=>({...t,phase:e,error:null})),r.current&&(clearTimeout(r.current),r.current=null),e){case"intro":(0,ee.MH)(),(0,ee.yb)("takeoff");break;case"flight":(0,ee.yb)("flight");break;case"attack":(0,ee.Iz)("flight");break;case"outro_win":(0,ee.o7)(),(0,ee.yb)("victory");break;case"outro_lose":(0,ee.o7)(),(0,ee.yb)("crash"),setTimeout(()=>(0,ee.yb)("defeat"),500);break;case"share":case"done":case"idle":(0,ee.o7)()}let s=er[e];s&&(r.current=setTimeout(()=>{"intro"===e?a.current?.("flight"):"outro_win"===e?a.current?.("share"):"outro_lose"===e&&a.current?.("share")},s))},[]);(0,l.useEffect)(()=>{a.current=n}),(0,l.useEffect)(()=>
1{if("idle"===e.phase||"preview"===e.phase||"share"===e.phase)return;let t=()=>{document.hidden&&r.current&&(clearTimeout(r.current),r.current=null)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[e.phase]);let i=(0,l.useCallback)(async(e,r,a)=>{s.current=e,t(e=>({...e,loading:!0,error:null}));let n=r.find(e=>e.login===a)??null,l=r.find(t=>t.login===e)??null;try{let r=await fetch("/api/raid/preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_login:e})});if(!r.ok){let e=await r.json();t(t=>({...t,loading:!1,error:e.error||"Failed to load raid preview"}));return}let s=await r.json();t({phase:"preview",previewData:s,raidData:null,attackerBuilding:n,defenderBuilding:l,error:null,loading:!1})}catch{t(e=>({...e,loading:!1,error:"Network error"}))}},[]),o=(0,l.useCallback)(async(e,a)=>{t(e=>({...e,loading:!0}));try{let l=await fetch("/api/raid/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_login:s.current,boost_purchase_id:e,vehicle_id:a})});if(!l.ok){let e=await l.json();t(t=>({...t,loading:!1,error:e.error||"Raid failed"}));return}let i=await l.json();t(e=>(e.attackerBuilding&&(i.attacker.position=e.attackerBuilding.position,i.attacker.height=e.attackerBuilding.height),e.defenderBuilding&&(i.defender.position=e.defenderBuilding.position,i.defender.height=e.defenderBuilding.height),{...e,raidData:i,loading:!1,phase:"intro"})),(0,ee.MH)(),(0,ee.yb)("takeoff"),r.current=setTimeout(()=>n("flight"),4500)}catch{t(e=>({...e,loading:!1,error:"Network error"}))}},[n]),c=(0,l.useCallback)(e=>{switch(e){case"intro":n("flight");break;case"flight":n("attack");break;case"attack":t(e=>(n(e.raidData?.success?"outro_win":"outro_lose"),e));break;case"outro_win":case"outro_lose":n("share");break;case"share":n("done")}},[n]);return[e,{startPreview:i,executeRaid:o,skipToShare:(0,l.useCallback)(()=>{n("share")},[n]),exitRaid:(0,l.useCallback)(()=>{r.current&&clearTimeout(r.current),(0,ee.o7)(),t(et)},[]),onPhaseComplete:c}]}(),nu=(0,l.useRef)("idle"),nx=(0,l.useRef)(null);(0,l.useEffect)(()=>{fetch("https://api.github.com/repos/srizzon/git-city").then(e=>e.ok?e.json():null).then(e=>{e?.stargazers_count!=null&&a_(e.stargazers_count)}).catch(()=>{}),fetch("https://discord.com/api/v9/invites/2bTjFAkny7?with_counts=true").then(e=>e.ok?e.json():null).then(e=>{e?.approximate_member_count!=null&&aC(e.approximate_member_count)}).catch(()=>{});let e="https://git-city-arcade.srizzon.partykit.dev";if(e){let t=e.startsWith("http")?e:`${e.includes("localhost")?"http":"https"}://${e}`;fetch(`${t}/parties/lobby/main`).then(e=>e.ok?e.json():null).then(e=>{e?.count&&aP(e.count)}).catch(()=>{})}},[]),(0,l.useEffect)(()=>{nc.raidData?.success&&nc.defenderBuilding&&(nx.current={defenderLogin:nc.defenderBuilding.login,attackerLogin:nc.raidData.attacker.login,tagStyle:nc.raidData.tag_style})},[nc.raidData,nc.defenderBuilding]),(0,l.useEffect)(()=>{let e=nu.current;if(nu.current=nc.phase,"idle"===nc.phase&&"idle"!==e&&"preview"!==e&&nx.current){let{defenderLogin:e,attackerLogin:t,tagStyle:r}=nx.current;nx.current=null,tE(s=>s.map(s=>s.login===e?{...s,active_raid_tag:{attacker_login:t,tag_style:r,expires_at:new Date(Date.now()+6048e5).toISOString()}}:s))}},[nc.phase]),(0,l.useEffect)(()=>{fetch("/api/sky-ads").then(e=>e.ok?e.json():null).then(e=>{Array.isArray(e)&&e.length>0&&ak(e)}).catch(()=>{})},[]);let np=s7?s7[1].login:null,[nm,nh]=(0,l.useState)(!1),nb=tl[rn],ng=(0,l.useRef)(!1),nf=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e={flyMode:t5,raidMode:"idle"!==nc.phase&&"preview"!==nc.phase,accent:nb.accent,shadow:nb.shadow,hidden:t5&&nm};window.__gcRadioMode=e,window.dispatchEvent(new CustomEvent("gc:radio-mode",{detail:e}))},[t5,nc.phase,nb.accent,nb.shadow,nm]),(0,l.useEffect)(()=>{let e=()=>nh(window.innerWidth<640||"ontouchstart"in window);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,l.useEffect)(()=>{let e=(0,v.fV)();e.auth.getSession().then(({data:{session:e}})=>{if(so(e),e){let t=(e.user?.user_metadata?.user_name??e.user?.user_metadata?.preferred_username??"").toLowerCase();t&&(0,ey.gm)({github_login:t,email:e.user?.email??void 0})}});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{if(so(t),t&&"TOKEN_REFRESHED"!==e){let e=(t.user?.user_metadata?.user_name??t.user?.user_metadata?.preferred_username??"").toLowerCase();e&&(0,ey.gm)({github_login:e,email:t.user?.email??void 0})}});return()=>t.unsubscribe()},[]);let ny=(si?.user?.user_metadata?.user_name??si?.user?.user_metadata?.preferred_username??"").toLowerCase(),{pilotsRef:nv,projectilesRef:nj,selfStateRef:nw,selfId:nk,pvpEnabled:nN,sendMove:n_,sendShoot:nS,reportHit:nC,togglePvp:n$,pendingRespawnRef:nT,bossStateRef:nE,engageBoss:nL,sendBossHit:nI,sendBossSelfHit:nR}=function(e,t,r,s){let a=(0,l.useRef)(new Map),n=(0,l.useRef)(new Map),i=(0,l.useRef)(null),o=(0,l.useRef)({hp:3,pvpEnabled:M(),invulnUntil:0,downedUntil:0,joinedAt:0,lastAttackerId:null,lastAttackerAt:0,lastAttackerX:0,lastAttackerZ:0,lastHitConfirmedAt:0,lastDamageAt:0,killFeed:[]}),c=(0,l.useRef)({active:!1,hp:0,maxHp:0,phase:1,defeated:!1,finalHitWasSelf:!1,updatedAt:0}),d=(0,l.useRef)(null),u=(0,l.useRef)(0),x=(0,l.useRef)(e);x.current=e;let p=(0,l.useRef)(null),[m,h]=(0,l.useState)(null),[b,g]=(0,l.useState)(M());(0,l.useEffect)(()=>{let e=new z.Ay({host:"https://git-city-arcade.srizzon.partykit.dev",party:"fly",room:"city"});d.current=e,e.addEventListener("open",()=>{p.current=e.id,h(e.id),x.current&&(e.send(JSON.stringify({type:"join",login:t||"anonymous",avatar:r,vehicle:s})),e.send(JSON.stringify({type:"toggle_pvp",enabled:o.current.pvpEnabled})))}),e.addEventListener("message",e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=p.current;if("sync"===t.type)for(let e of t.pilots){if(r&&e.id===r){o.current.hp=e.hp,o.current.invulnUntil=e.invulnUntil,o.current.downedUntil=e.downedUntil,o.current.joinedAt=e.joinedAt,o.current.pvpEnabled=e.pvpEnabled;continue}a.current.set(e.id,{login:e.login,avatar:e.avatar,vehicle:e.vehicle,x:e.x,y:e.y,z:e.z,yaw:e.yaw,bank:e.bank,prevX:e.x,prevY:e.y,prevZ:e.z,prevYaw:e.yaw,prevBank:e.bank,lerpTimer:1,hp:e.hp,pvpEnabled:e.pvpEnabled,invulnUntil:e.invulnUntil,downedUntil:e.downedUntil,joinedAt:e.joinedAt})}if("join"===t.type){let e=t.pilot;if(r&&e.id===r){o.current.hp=e.hp,o.current.invulnUntil=e.invulnUntil,o.current.downedUntil=e.downedUntil,o.current.joinedAt=e.joinedAt,o.current.pvpEnabled=e.pvpEnabled;return}a.current.set(e.id,{login:e.login,avatar:e.avatar,vehicle:e.vehicle,x:e.x,y:e.y,z:e.z,yaw:e.yaw,bank:e.bank,prevX:e.x,prevY:e.y,prevZ:e.z,prevYaw:e.yaw,prevBank:e.bank,lerpTimer:1,hp:e.hp,pvpEnabled:e.pvpEnabled,invulnUntil:e.invulnUntil,downedUntil:e.downedUntil,joinedAt:e.joinedAt})}if("move"===t.type){let e=a.current.get(t.id);e&&(e.prevX=e.x,e.prevY=e.y,e.prevZ=e.z,e.prevYaw=e.yaw,e.prevBank=e.bank,e.x=t.x,e.y=t.y,e.z=t.z,e.yaw=t.yaw,e.bank=t.bank,e.lerpTimer=0)}if("leave"===t.type&&a.current.delete(t.id),"shoot"===t.type){if(r&&t.shooterId===r)return;
1let e=`${t.shooterId}-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;n.current.set(e,{id:e,shooterId:t.shooterId,x:t.x,y:t.y,z:t.z,dirX:t.dirX,dirY:t.dirY,dirZ:t.dirZ,bornAt:Date.now()})}if("hit"===t.type)if(r&&t.targetId===r){o.current.hp=t.newHp,o.current.lastAttackerId=t.shooterId,o.current.lastAttackerAt=Date.now(),o.current.lastDamageAt=Date.now();let e=a.current.get(t.shooterId);e&&(o.current.lastAttackerX=e.x,o.current.lastAttackerZ=e.z),t.newHp<=0&&o.current.downedUntil<=Date.now()&&(o.current.downedUntil=Date.now()+5e3)}else{let e=a.current.get(t.targetId);e&&(e.hp=t.newHp)}if("kill"===t.type){let e=r===t.killerId,s=r===t.victimId,n={id:`${t.killToken||t.killerId+t.victimId+Date.now()}`,killerLogin:t.killerLogin,victimLogin:t.victimLogin,killerWasSelf:e,victimWasSelf:s,happyHour:!!t.happyHour,at:Date.now()};if(o.current.killFeed=[n,...o.current.killFeed].slice(0,6),s){o.current.hp=0,o.current.downedUntil=Date.now()+5e3,o.current.lastAttackerId=t.killerId,o.current.lastAttackerAt=Date.now(),o.current.lastDamageAt=Date.now();let e=a.current.get(t.killerId);e&&(o.current.lastAttackerX=e.x,o.current.lastAttackerZ=e.z)}else{let e=a.current.get(t.victimId);e&&(e.hp=0,e.downedUntil=Date.now()+5e3)}r&&t.killerId===r&&fetch("/api/pvp/credit-kill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kill_token:t.killToken})}).catch(()=>{})}if("respawn"===t.type)if(r&&t.id===r)o.current.hp=3,o.current.downedUntil=0,o.current.invulnUntil=t.invulnUntil,i.current={x:t.x,y:t.y,z:t.z,at:Date.now()};else{let e=a.current.get(t.id);e&&(e.hp=3,e.downedUntil=0,e.invulnUntil=t.invulnUntil,e.x=t.x,e.y=t.y,e.z=t.z,e.prevX=t.x,e.prevY=t.y,e.prevZ=t.z,e.lerpTimer=1)}if("pvp_state"===t.type)if(r&&t.id===r)o.current.pvpEnabled=t.pvpEnabled,o.current.hp=t.hp,o.current.invulnUntil=t.invulnUntil,o.current.downedUntil=t.downedUntil,o.current.joinedAt=t.joinedAt;else{let e=a.current.get(t.id);e&&(e.pvpEnabled=t.pvpEnabled,e.hp=t.hp,e.invulnUntil=t.invulnUntil,e.downedUntil=t.downedUntil)}"boss_state"===t.type&&(c.current.active=t.active,c.current.hp=t.hp,c.current.maxHp=t.maxHp,c.current.phase=t.phase,c.current.updatedAt=Date.now(),t.active&&(c.current.defeated=!1)),"boss_defeated"===t.type&&(c.current.active=!1,c.current.hp=0,c.current.defeated=!0,c.current.finalHitWasSelf=!!r&&t.finalHitterId===r,c.current.updatedAt=Date.now()),"boss_damage_receipt"===t.type&&fetch("/api/events/credit-damage",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({damage_token:t.token})}).catch(()=>{})});let l=a.current,u=n.current;return()=>{e.close(),d.current=null,l.clear(),u.clear(),p.current=null,h(null)}},[]),(0,l.useEffect)(()=>{let e=setInterval(()=>{let e=Date.now();for(let[t,r]of n.current)e-r.bornAt>1500&&n.current.delete(t)},250);return()=>clearInterval(e)},[]),(0,l.useEffect)(()=>{let a=d.current;a&&a.readyState===WebSocket.OPEN&&e&&(a.send(JSON.stringify({type:"join",login:t||"anonymous",avatar:r,vehicle:s})),a.send(JSON.stringify({type:"toggle_pvp",enabled:o.current.pvpEnabled})))},[e,t,r,s]);let f=(0,l.useCallback)((e,t,r,s,a)=>{if(!x.current||!d.current)return;let n=Date.now();n-u.current<100||(u.current=n,d.current?.send(JSON.stringify({type:"move",x:e,y:t,z:r,yaw:s,bank:a})))},[]),y=(0,l.useCallback)((e,t,r,s,a,l)=>{let i=d.current;if(!i||i.readyState!==WebSocket.OPEN||!x.current||!o.current.pvpEnabled)return;let c=p.current;if(c){let i=`local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;n.current.set(i,{id:i,shooterId:c,x:e,y:t,z:r,dirX:s,dirY:a,dirZ:l,bornAt:Date.now()})}i.send(JSON.stringify({type:"shoot",x:e,y:t,z:r,dirX:s,dirY:a,dirZ:l}))},[]),v=(0,l.useCallback)(e=>{let t=d.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"hit",targetId:e}))},[]),j=(0,l.useCallback)(e=>{o.current.pvpEnabled=e,window.localStorage.setItem(D,String(e)),g(e);let t=d.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"toggle_pvp",enabled:e}))},[]),w=(0,l.useCallback)(e=>{let t=d.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"engage_boss",maxHp:e}))},[]);return{pilotsRef:a,projectilesRef:n,selfStateRef:o,pendingRespawnRef:i,selfId:m,pvpEnabled:b,sendMove:f,sendShoot:y,reportHit:v,togglePvp:j,bossStateRef:c,engageBoss:w,sendBossHit:(0,l.useCallback)(e=>{let t=d.current;!t||t.readyState!==WebSocket.OPEN||x.current&&t.send(JSON.stringify({type:"boss_hit",kind:e}))},[]),sendBossSelfHit:(0,l.useCallback)(()=>{let e=d.current;!e||e.readyState!==WebSocket.OPEN||x.current&&e.send(JSON.stringify({type:"boss_self_hit"}))},[])}}(t5,ny,si?.user?.user_metadata?.avatar_url??"",t4),[nz,nD]=(0,l.useState)(!1),nM=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=nM.current;if(nM.current=e0?.id??null,e&&!e0){let e=nE.current;if(!e.defeated&&e.updatedAt>0){nD(!0);let e=setTimeout(()=>nD(!1),12e3);return()=>clearTimeout(e)}}},[e0,nE]),(0,l.useEffect)(()=>
1{if(!t5)return;let e=setInterval(()=>{rk(nw.current.hp)},100);return()=>clearInterval(e)},[t5,nw]),(0,l.useEffect)(()=>{si&&fetch("/api/vscode-key").then(e=>e.json()).then(e=>{e.key&&r5(e.key)}).catch(()=>{})},[si]),(0,l.useEffect)(()=>{if(!si||0===tT.length||sD.current||!tT.some(e=>e.active_drop))return;sD.current=!0;let e=!1;return fetch("/api/drops/my-pulls").then(e=>e.ok?e.json():null).then(t=>{if(e||!t?.pulls)return;let r={};for(let[e,s]of Object.entries(t.pulls))r[e]={points:s.points};Object.keys(r).length>0&&sz(r),tE(e=>e.map(e=>{let r=e.active_drop&&t.pulls[e.active_drop.id];return r?{...e,active_drop:{...e.active_drop,pull_count:r.pull_count}}:e}))}).catch(()=>{}),()=>{e=!0}},[si,tT]);let nP=(0,l.useRef)(!1),[nA,nO]=(0,l.useState)("");(0,l.useEffect)(()=>{if(nP.current||"done"!==tZ||0===tT.length)return;let e=tT.filter(e=>e.active_drop);if(0===e.length)return;nP.current=!0;let t=[...new Set(e.map(e=>e.district).filter(Boolean))],r=t.slice(0,2).map(e=>w.O8[e]??e),s=t.length-r.length,a="Drops are hidden in the city";r.length>0&&(a=`Drops hidden in ${r.join(", ")}${s>0?` +${s} more`:""}`),nO(a);let n=setTimeout(()=>{sP(!0),setTimeout(()=>sP(!1),5e3)},3e3);return()=>clearTimeout(n)},[tZ,tT]),(0,l.useEffect)(()=>{let t=e&&!!ny;sO(t),t&&fetch("/api/items").then(e=>e.json()).then(e=>sV(e.items??[])).catch(()=>{})},[ny,e]),(0,l.useEffect)(()=>{ny?fetch("/api/pixels/balance").then(e=>e.json()).then(e=>aD(e.balance??0)).catch(()=>{}):aD(null)},[ny]),(0,l.useEffect)(()=>{if(!t5||rN)return;let e=setInterval(()=>{rH(Math.floor((Date.now()-rA.current-rF.current)/1e3))},1e3);return()=>clearInterval(e)},[t5,rN]),(0,l.useEffect)(()=>{t5&&(a7(!1),ne(!1),nr(null),clearTimeout(ns.current),clearTimeout(na.current),clearTimeout(nn.current))},[t5]);let nF=si?.user?.id;(0,l.useEffect)(()=>{nF&&fetch("/api/raid/loadout").then(e=>e.ok?e.json():null).then(e=>{e?.vehicle&&t8(e.vehicle)}).catch(()=>{})},[nF]);let nU=(0,l.useRef)(!1);(0,l.useEffect)(()=>{nF&&!nU.current&&(nU.current=!0,fetch("/api/preferences/theme").then(e=>e.ok?e.json():null).then(e=>{e&&"number"==typeof e.city_theme&&e.city_theme>=0&&e.city_theme<=3&&(rl(e.city_theme),localStorage.setItem("gitcity_theme",String(e.city_theme)))}).catch(()=>{}))},[nF]);let nG=(0,l.useCallback)(()=>{rl(e=>{let t=(e+1)%tl.length;return localStorage.setItem("gitcity_theme",String(t)),nF&&fetch("/api/preferences/theme",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({city_theme:t})}).catch(()=>{}),t})},[nF]);(0,l.useEffect)(()=>{let e=eP.get("ref");if(e){(0,ey.fP)(e);try{localStorage.setItem("gc_ref",JSON.stringify({login:e,expires:Date.now()+6048e5}))}catch{}}},[eP]);let nH=(0,l.useCallback)(async()=>{(0,ey.fO)("city");let e=(0,v.fV)(),t=`${window.location.origin}/auth/callback`;try{let e=localStorage.getItem("gc_ref");if(e){let{login:r,expires:s}=JSON.parse(e);Date.now()<s&&r&&(t+=`?ref=${encodeURIComponent(r)}`)}}catch{}await (0,j.U)(e,t)},[]);(0,l.useEffect)(()=>{let e=!1,t=async()=>{try{let t=await fetch("/api/feed?limit=50&today=1");if(!t.ok)return;let r=await t.json();e||sv(r.events??[])}catch{}};t();let r=setInterval(t,12e4);return()=>{e=!0,clearInterval(r)}},[]),(0,l.useEffect)(()=>(sp&&si&&sp.login.toLowerCase()!==ny&&(s2.current=setTimeout(async()=>{try{if(!tT.find(e=>e.login===sp.login))return;await fetch("/api/interactions/visit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({building_login:sp.login})}),lw.current("visit_building"),lw.current("visit_3_buildings")}catch{}},3e3)),()=>{s2.current&&clearTimeout(s2.current)}),[sp,si,ny,tT]),(0,l.useEffect)(()=>{if(s3(null),!sp)return;let e=sp.login.toLowerCase(),t=s4.current.get(e);if(t)return void s3(t);let r=new AbortController;return fetch(`/api/social-links?login=${encodeURIComponent(e)}`,{signal:r.signal}).then(e=>e.ok?e.json():null).then(t=>{let r=t?.links??{};s4.current.set(e,r),s3(r)}).catch(()=>{}),()=>r.abort()},[sp]);let nB=(0,l.useCallback)(async()=>{if(sp&&!s_&&!sC&&si&&sp.login.toLowerCase()!==ny){sS(!0),sE(null);try{let e=await fetch("/api/interactions/kudos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({receiver_login:sp.login})});if(e.ok){(0,ey.ac)(sp.login),lw.current("give_kudos"),lw.current("give_kudos_3"),s$(!0);let e=(sp.kudos_count??0)+1;sm({...sp,kudos_count:e}),tE(t=>t.map(t=>t.login===sp.login?{...t,kudos_count:e}:t)),setTimeout(()=>s$(!1),3e3)}else{let t=await e.json().catch(()=>null),r=t?.error||"Could not send kudos";sE(r),setTimeout(()=>sE(null),3e3)}}catch{}finally{sS(!1)}}},[sp,s_,sC,si,ny]),nW=(0,l.useCallback)(async e=>{if(!sL&&si){sI(!0);try{let t=await fetch("/api/drops/pull",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({drop_id:e})}),r=await t.json();if(t.ok&&r.ok&&(sz(t=>({...t,[e]:{points:r.points_earned}})),!r.already_pulled&&sp?.active_drop?.id===e)){let t={...sp.active_drop,pull_count:sp.active_drop.pull_count+1};sm({...sp,active_drop:t}),tE(r=>r.map(r=>r.active_drop?.id===e?{...r,active_drop:t}:r))}}catch{}finally{sI(!1)}}},[sL,si,sp]),nY=(0,l.useCallback)(async()=>
1{if(sp&&!sq){sQ(!0),s1(null);try{let e=await fetch("/api/admin/drops",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({building_login:sp.login,rarity:sG,duration_hours:sB,max_pulls:sY,item_reward:"legendary"===sG&&sJ?sJ:void 0})}),t=await e.json();if(e.ok){let e=t.drop,r={id:e.id,rarity:e.rarity,points:e.points,max_pulls:e.max_pulls,pull_count:0,expires_at:e.expires_at};sm({...sp,active_drop:r}),tE(e=>e.map(e=>e.login===sp.login?{...e,active_drop:r}:e)),sU(!1),s1("Planted!"),setTimeout(()=>s1(null),2e3)}else s1(t.error??"Failed")}catch{s1("Network error")}finally{sQ(!1)}}},[sp,sq,sG,sB,sY,sJ]),nX=(0,l.useCallback)(async()=>{if(sp&&si){an(!0),ai(null),au(null),ap(null),ah(!1);try{let e=await fetch("/api/items");if(!e.ok)return;let{items:t}=await e.json(),r=new Set(sp.owned_items??[]),s=new Set(["flag","custom_color"]),a=t.filter(e=>(e.price_pixels??0)>0&&!s.has(e.id)).map(e=>({...e,owned:r.has(e.id)}));ai(a)}catch{}}},[sp,si]),nJ=(0,l.useCallback)(async e=>{if(sp&&!ao){ac(e),au(null);try{let t=await fetch("/api/pixels/spend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({item_id:e,gifted_to_login:sp.login})}),r=await t.json();if(t.ok&&r.success)au(null),ai(t=>t?.map(t=>t.id===e?{...t,owned:!0}:t)??null),sm(t=>t&&!t.owned_items.includes(e)?{...t,owned_items:[...t.owned_items,e]}:t),"number"==typeof r.new_balance?aD(r.new_balance):"number"==typeof r.price&&aD(e=>null==e?e:Math.max(0,e-r.price)),ah(!0);else{let e="insufficient_balance"===r.error?"Not enough PX. Buy more at /pixels":"already_owned"===r.error?"They already own this item":r.error||"Gift failed";au(e)}}catch{au("Network error. Try again.")}finally{ac(null)}}},[sp,ao]),nZ=(0,l.useRef)(999),nK=(0,l.useCallback)(()=>{aO(!1),aU(-1)},[]);(0,l.useEffect)(()=>{if(t5&&!sp&&!a$&&!aE&&!aI||!t5&&!rs&&!rJ&&!rK&&!sp&&!sh&&!aa&&!s7&&!s8&&!aE&&!a$&&!aI&&!aA&&!r0&&"idle"===nc.phase)return;let e=e=>{if("Escape"===e.code){if(aE)return void aL(!1);if(a$)return void aT(!1);if(aI)return void aR(!1);if(aA)return void nK();if("idle"!==nc.phase)return void("preview"===nc.phase?nd.exitRaid():"flight"===nc.phase||"attack"===nc.phase?nd.skipToShare():(nc.phase,nd.exitRaid()));t5&&sp?(sm(null),rZ(null)):!t5&&(s7?(sm(s7[0]),rZ(s7[0].login),s9(null),s6(null)):s8?(sm(s8),rZ(s8.login),s6(null)):aa?(an(!1),ai(null)):sh?sb(!1):r0?r1(null):rK?(rV(null),sm(null),rZ(null)):sp?(sm(null),rZ(null)):rJ?rZ(null):rs&&(ra(!1),rZ(nf.current),nf.current=null))}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t5,rs,rJ,rK,sp,sh,aa,s7,s8,aE,a$,aI,aA,nK,nc.phase,nd,r0]),(0,l.useEffect)(()=>{if(!aA)return void aU(-1);let e=[];return e.push(setTimeout(()=>aU(0),500)),e.push(setTimeout(()=>aU(1),4e3)),()=>e.forEach(clearTimeout)},[aA]),(0,l.useEffect)(()=>{si&&(async()=>{try{let e=await fetch("/api/rabbit?check=true");if(!e.ok)return;let t=await e.json(),r=t?.progress??0;aH(r),localStorage.setItem("gitcity_rabbit_progress",String(r)),r>0&&r<5&&aW(r+1)}catch{}})()},[si]),(0,l.useEffect)(()=>{if(!aJ)return;let e=setTimeout(()=>aZ(null),3e3);return()=>clearTimeout(e)},[aJ]);let nV=(0,l.useCallback)(async()=>{if(!aB)return;aW(null);let e=(si?.user?.user_metadata?.user_name??"").toLowerCase(),t=e&&tT.some(t=>t.login.toLowerCase()===e&&t.claimed);if(si&&t)try{let e=await fetch("/api/rabbit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sighting:aB})}),t=await e.json();if(e.ok){if(aH(t.progress),localStorage.setItem("gitcity_rabbit_progress",String(t.progress)),t.completed)return void aX(!0);aZ("The rabbit moves deeper..."),setTimeout(()=>aW(t.progress+1),2e3);return}}catch{}(aH(aB),localStorage.setItem("gitcity_rabbit_progress",String(aB)),aB>=5)?nH():(aZ("The rabbit moves deeper..."),setTimeout(()=>aW(aB+1),2e3))},[aB,si,tT,nH]),nq=(0,l.useCallback)(async(e=!1)=>{let t;e&&(eu=null);let r=[],s=null,a=[];if(!e){let e=await (0,ep.u9)();if(e){if(s=e.stats,a=e._d??[],tI.current=e.norms,(t=e.layout)&&0===tx.size){tL.setLazy(()=>e.developers),a.length>0&&(tR.current=a),rW(s);let r=await (0,ep.Ol)();if(tB.current=r,r){let e={...t,sfMap:(0,eb.kY)(r)};return rg(e.buildings),tE(e.buildings),tD(e.plazas),tP(e.decorations),tO(e.river),tU(e.bridges),tY(e.districtZones),tH(e.sfMap??null),ex({...e,stats:s,get rawDevs(){return tL.current},norms:tI.current}),e.buildings}}r=e.developers}}if(0===r.length&&(0,j.e)())try{let e=await fetch("/api/city?from=0&to=1000");if(e.ok){let t=await e.json();r=t.developers??[],s=t.stats??null,a=t._d??[]}}catch{}if(0===r.length)return null;try{let e=localStorage.getItem("gitcity:loadout_override");if(e){let{developerId:t,loadout:s,ts:a}=JSON.parse(e);if(Date.now()-a<6e5){let e=r.findIndex(e=>e.id===t);-1!==e&&(r[e]={...r[e],loadout:s})}else localStorage.removeItem("gitcity:loadout_override")}}catch{}if(tx.size>0){let e=new Set(r.map(e=>String(e.github_login).toLowerCase()));for(let[t,s]of tx)e.has(t)||r.push(s);t=void 0}tL.current=r,a.length>0&&(tR.current=a),rW(s);let n=await (0,ep.Ol)();tB.current=n,t||await (0,ep.Hc)(n,r);let l=t&&n?{...t,sfMap:(0,eb.kY)(n)}:(0,w.ZV)(r,n,tI.current,tm());return rg(l.buildings),tE(l.buildings),tD(l.plazas),tP(l.decorations),tO(l.river),tU(l.bridges),tY(l.districtZones),tH(l.sfMap??null),ex({...l,stats:s,rawDevs:tL.current,norms:tI.current}),l.buildings},[]),nQ=(0,l.useCallback)(()=>{tK("done"),eW(!1);let e=eP.get("user")||eP.get("compare");localStorage.getItem("gitcity_intro_seen")||e||re(!0)},[eP]),n0=(0,l.useCallback)(()=>{tK("init"),tq(0),t0(null),ng.current=!1},[]);(0,l.useEffect)(()=>
1{if(ng.current)return;ng.current=!0;let e=eu?Date.now()-eu.timestamp>3e5?(eu=null,null):eu:null;if(e){tL.setLazy(()=>e.rawDevs??[]),tI.current=e.norms,tE(e.buildings),tD(e.plazas),tP(e.decorations),tO(e.river),tU(e.bridges),tY(e.districtZones),tH(e.sfMap??null),rW(e.stats),(0,ep.Ol)().then(e=>{tB.current=e}),tK("done");return}let t=performance.now();!async function(){try{tK("init"),tq(3);let e=document.createElement("canvas");if(!(e.getContext("webgl")||e.getContext("experimental-webgl"))){t0("Your browser does not support WebGL. Try Chrome, Firefox, or Edge."),tK("error");return}tK("fetching"),tq(10);let r=[],s=null,a=[],n=await (0,ep.u9)(),l=n?.layout,i=!!(n&&l&&0===tx.size);if(n&&(i||(r=n.developers),s=n.stats,a=n._d??[],tI.current=n.norms),!i&&(!r||0===r.length)&&(0,j.e)())try{let e=await fetch("/api/city?from=0&to=1000");if(e.ok){let t=await e.json();r=t.developers??[],s=t.stats??null,a=t._d??[]}}catch{}if(tq(30),performance.mark("city:data"),!i&&(!r||0===r.length)){tq(100),tK("ready");return}try{let e=i?null:localStorage.getItem("gitcity:loadout_override");if(e){let{developerId:t,loadout:s,ts:a}=JSON.parse(e);if(Date.now()-a<6e5){let e=r.findIndex(e=>e.id===t);-1!==e&&(r[e]={...r[e],loadout:s})}else localStorage.removeItem("gitcity:loadout_override")}}catch{}if(tK("generating"),tq(45),await new Promise(e=>setTimeout(e,0)),tx.size>0){let e=new Set(r.map(e=>e.github_login.toLowerCase()));for(let[t,s]of tx)e.has(t)||r.push(s);l=void 0}i&&n?tL.setLazy(()=>n.developers):tL.current=r,a.length>0&&(tR.current=a),rW(s);let o=await (0,ep.Ol)();tB.current=o,l||await (0,ep.Hc)(o,r);let c=l&&o?{...l,sfMap:(0,eb.kY)(o)}:(0,w.ZV)(r,o,tI.current,tm());rg(c.buildings),performance.mark("city:layout"),tE(c.buildings),tD(c.plazas),tP(c.decorations),tO(c.river),tU(c.bridges),tY(c.districtZones),tH(c.sfMap??null),tq(55),tK("rendering"),tq(65),await (0,em.V)(2e4),tq(80),ex({...c,stats:s,get rawDevs(){return tL.current},norms:tI.current}),tq(95);let d=performance.now()-t;d<800&&await new Promise(e=>setTimeout(e,800-d)),tq(100),tK("ready")}catch(e){t0(e instanceof Error?e.message:"Something went wrong"),tK("error")}}()},[tZ]);let n1=(0,l.useCallback)(()=>{re(!1),rr(!0),setTimeout(()=>rr(!1),1200),localStorage.setItem("gitcity_intro_seen","true"),si||localStorage.getItem("gitcity_welcome_seen")||(a5(!0),setTimeout(()=>a5(!1),12e3))},[si]),n2=(0,l.useCallback)(()=>{re(!0)},[]),n5=(0,l.useRef)(!1),n3=(0,l.useRef)(!1);(0,l.useEffect)(()=>{if(!eO||eF||0===tT.length)return;let e=tT.find(e=>e.login.toLowerCase()===eO.toLowerCase());if(!e){if(n3.current)return;n3.current=!0,(async()=>{try{let e=!!ny&&eO.toLowerCase()===ny,[t,r]=await Promise.all([fetch(`/api/dev/${encodeURIComponent(eO)}`),e?th():Promise.resolve(null)]);if(!t.ok)return;let s=await t.json();if(!1===s.exists)return;let a=tL.current.find(e=>e.github_login.toLowerCase()===eO.toLowerCase());if(a&&tx.has(eO.toLowerCase()))return;let n=r??s.lot??a?.lot??null,l=a?{...a,lot:n}:{...s,owned_items:[],achievements:[],loadout:null,custom_color:null,billboard_images:[],active_raid_tag:null,kudos_count:s.kudos_count??0,visit_count:s.visit_count??0,app_streak:s.app_streak??0,raid_xp:s.raid_xp??0,rabbit_completed:!1,xp_total:s.xp_total??0,xp_level:s.xp_level??1,lot:n};tp(l),tL.current=a?tL.current.map(e=>e===a?l:e):[...tL.current,l];let i=(0,w.ZV)(tL.current,tB.current,tI.current,tm());rg(i.buildings),tE(i.buildings),tD(i.plazas),tP(i.decorations),tO(i.river),tU(i.bridges),tY(i.districtZones),ex({...i,stats:rB??{total_developers:0,total_contributions:0},rawDevs:tL.current,norms:tI.current});let o=i.buildings.find(e=>e.login.toLowerCase()===eO.toLowerCase());o&&!n5.current&&(n5.current=!0,rZ(eO),sm(o),ra(!0))}finally{n3.current=!1}})();return}n5.current?sm(t=>t&&t.login.toLowerCase()===eO.toLowerCase()?e:t):(n5.current=!0,rZ(eO),sm(e),ra(!0),e.claimed||fetch(`/api/dev/${encodeURIComponent(eO)}`).then(e=>e.ok?e.json():null).then(e=>{!e||!1===e.exists||e.claimed&&(tE(e=>e.map(e=>e.login.toLowerCase()===eO.toLowerCase()?{...e,claimed:!0}:e)),sm(e=>e&&e.login.toLowerCase()===eO.toLowerCase()?{...e,claimed:!0}:e))}).catch(()=>{}))},[eO,eF,tT,rB,ny]);let n4=(0,l.useRef)(null),n8=(0,l.useRef)(0),[n6,n7]=(0,l.useState)(0),n9=(0,l.useRef)(!1);(0,l.useEffect)(()=>
1{if(!ny||0===tT.length)return;let e=tT.find(e=>e.login.toLowerCase()===ny);if(e){e.claimed||n9.current||(n9.current=!0,fetch(`/api/dev/${encodeURIComponent(ny)}`).then(e=>e.ok?e.json():null).then(e=>{e&&!1!==e.exists&&e.claimed&&tE(e=>e.map(e=>e.login.toLowerCase()===ny?{...e,claimed:!0}:e))}).catch(()=>{}));return}eO&&eO.toLowerCase()===ny||n4.current!==ny&&(n4.current=ny,(async()=>{try{let[e,t]=await Promise.all([fetch(`/api/dev/${encodeURIComponent(ny)}`),th()]);if(!e.ok){if(n4.current=null,n8.current<3){let e=++n8.current;setTimeout(()=>n7(e),2e3*2**e)}return}let r=await e.json();if(!1===r.exists)return;let s=tL.current.find(e=>e.github_login.toLowerCase()===ny);if(s&&tx.has(ny))return;let a=t??r.lot??s?.lot??null,n=s?{...s,lot:a}:{...r,owned_items:[],achievements:[],loadout:null,custom_color:null,billboard_images:[],active_raid_tag:null,kudos_count:r.kudos_count??0,visit_count:r.visit_count??0,app_streak:r.app_streak??0,raid_xp:r.raid_xp??0,rabbit_completed:!1,xp_total:r.xp_total??0,xp_level:r.xp_level??1,lot:a};tp(n),tL.current=s?tL.current.map(e=>e===s?n:e):[...tL.current,n];let l=(0,w.ZV)(tL.current,tB.current,tI.current,tm());rg(l.buildings),tE(l.buildings),tD(l.plazas),tP(l.decorations),tO(l.river),tU(l.bridges),tY(l.districtZones),ex({...l,stats:rB??{total_developers:0,total_contributions:0},rawDevs:tL.current,norms:tI.current})}catch{n4.current=null}})())},[ny,tT,eO,rB,n6]);let le=eP.get("compare"),lt=(0,l.useRef)(!1);(0,l.useEffect)(()=>{if(!le||0===tT.length||lt.current)return;let e=le.split(",").map(e=>e.trim().toLowerCase());if(2!==e.length||e[0]===e[1])return;let t=tT.find(t=>t.login.toLowerCase()===e[0]),r=tT.find(t=>t.login.toLowerCase()===e[1]);if(t&&r){lt.current=!0,s9([t,r]),rZ(t.login),ra(!0);return}lt.current=!0,(async()=>{let s=[!t?e[0]:null,!r?e[1]:null].filter(Boolean);await Promise.all(s.map(e=>fetch(`/api/dev/${encodeURIComponent(e)}`)));let a=await nq(!0);if(!a)return;let n=a.find(t=>t.login.toLowerCase()===e[0]),l=a.find(t=>t.login.toLowerCase()===e[1]);n&&l&&(s9([n,l]),rZ(n.login),ra(!0))})()},[le,tT,nq]);let lr=eP.get("purchased");(0,l.useEffect)(()=>{if(lr){sx(lr),nq();let e=setTimeout(()=>sx(null),5e3);return()=>clearTimeout(e)}},[lr,nq]);let[ls,la]=(0,l.useState)(null),ln=(0,l.useRef)(!1);(0,l.useEffect)(()=>{if(eF&&eO&&tT.length>0&&!ln.current){ln.current=!0,la({item:eF,to:eO}),nq(),rZ(eO);let e=tT.find(e=>e.login.toLowerCase()===eO.toLowerCase());e&&(sm(e),ra(!0));let t=setTimeout(()=>la(null),5e3);return()=>clearTimeout(t)}},[eF,eO,tT,nq]);let ll=(0,l.useCallback)(async e=>{let t="string"!=typeof e,r=("string"==typeof e?e:tS).trim().toLowerCase();if(!r)return"none";(0,ey.v3)(r);let s=t$.current.get(r);if(s)return t2({type:"error",code:s,username:r}),"error";tJ(!0),t2({type:"loading"}),rZ(null),sm(null),rV(null);try{if(s8&&r===s8.login.toLowerCase())return as(!0),setTimeout(()=>as(!1),2e3),t2(null),"none";let e=tT.some(e=>e.login.toLowerCase()===r),s=await fetch(`/api/dev/${encodeURIComponent(r)}`),a=await s.json();if(!s.ok){let e="generic";return 404===s.status?e="not-found":504===s.status?e="timeout":429===s.status?e=a.error?.includes("GitHub")?"github-rate-limit":"rate-limit":400===s.status&&(a.error?.includes("Organization")?e="org":a.error?.includes("no public activity")&&(e="no-activity")),tf.has(e)&&t$.current.set(r,e),t2({type:"error",code:e,username:r,raw:a.error}),"error"}if(t2(null),!1===a.exists&&a.preview)return r1(a.preview),t&&tC(""),"invite";let n=null,l=(a.github_login??r).toLowerCase(),i=tL.current.find(e=>e.github_login?.toLowerCase()===l),o={...i??{},...a,owned_items:i?.owned_items??[],achievements:i?.achievements??[],loadout:i?.loadout??null,custom_color:i?.custom_color??null,billboard_images:i?.billboard_images??[],active_raid_tag:i?.active_raid_tag??null,kudos_count:a.kudos_count??i?.kudos_count??0,visit_count:a.visit_count??i?.visit_count??0,app_streak:a.app_streak??i?.app_streak??0,raid_xp:a.raid_xp??i?.raid_xp??0,rabbit_completed:a.rabbit_completed??i?.rabbit_completed??!1,xp_total:a.xp_total??i?.xp_total??0,xp_level:a.xp_level??i?.xp_level??1,lot:a.lot??i?.lot??null};tp(o),tL.current=i?tL.current.map(e=>e.github_login?.toLowerCase()===l?o:e):[...tL.current,o];let c=(0,w.ZV)(tL.current,tB.current,tI.current,tm());rg(c.buildings),tE(c.buildings),tD(c.plazas),tP(c.decorations),tO(c.river),tU(c.bridges),tY(c.districtZones),ex({...c,stats:rB??{total_developers:0,total_contributions:0},rawDevs:tL.current,norms:tI.current}),n=c.buildings,rZ(a.github_login),ny&&r===ny&&!nl.current&&(nl.current=!0,no(a.github_login),setTimeout(()=>no(null),4e3));let d=(n??tT).find(e=>e.login.toLowerCase()===l);return s8&&!s7&&d?s8?(s9([s8,d]),rZ(s8.login)):d&&(sm(d),ra(!0)):!e&&t?(rV({login:a.github_login,contributions:a.contributions,rank:a.rank,avatar_url:a.avatar_url}),d&&sm(d),rQ(!1)):d&&(sm(d),ra(!0)),t&&tC(""),d?"focused":"pending"}catch{return t2({type:"error",code:"network",username:r}),"error"}finally{tJ(!1)}},[tS,tT,ny,s8,s7,rB]),li=(0,l.useCallback)(async e=>{let t=e.trim().toLowerCase();if(!t)return;let r=tT.find(e=>e.login.toLowerCase()===t);if(r){nm&&sw(!1),rZ(r.login),sm(r),rs||ra(!0);return}sN({login:t,phase:"loading"}),nm&&sw(!1);let s=await ll(t);"focused"===s||"invite"===s?sN(null):"pending"===s?(sN({login:t,phase:"pending"}),setTimeout(()=>sN(e=>e?.login===t?null:e),5e3)):"error"===s?(sN({login:t,phase:"error"}),setTimeout(()=>sN(e=>e?.login===t?null:e),5e3)):sN(null)},[tT,rs,nm,ll]),lo=(0,l.useCallback)(async e=>{let t=e.trim().toLowerCase();if(!t)return;let r=await fetch("/api/admin/dev/add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t})}),s=await r.json();if(!r.ok)throw Error(s?.error??"Failed to add developer");let a=(s.github_login??t).toLowerCase(),n=tL.current.some(e=>e.github_login?.toLowerCase()===a),l=tL.current.find(e=>e.github_login?.toLowerCase()===a),i={...l??{},...s,owned_items:l?.owned_items??[],achievements:l?.achievements??[],loadout:l?.loadout??null,custom_color:l?.custom_color??null,billboard_images:l?.billboard_images??[],active_raid_tag:l?.active_raid_tag??null,kudos_count:s.kudos_count??l?.kudos_count??0,visit_count:s.visit_count??l?.visit_count??0,app_streak:s.app_streak??l?.app_streak??0,raid_xp:s.raid_xp??l?.raid_xp??0,rabbit_completed:s.rabbit_completed??l?.rabbit_completed??!1,xp_total:s.xp_total??l?.xp_total??0,xp_level:s.xp_level??l?.xp_level??1,lot:s.lot??l?.lot??null};tp(i),tL.current=n?tL.current.map(e=>e.github_login?.toLowerCase()===a?i:e):[...tL.current,i];let o=(0,w.ZV)(tL.current,tB.current,tI.current,tm());rg(o.buildings),tE(o.buildings),tD(o.plazas),tP(o.decorations),tO(o.river),tU(o.bridges),tY(
1o.districtZones),ex({...o,stats:rB??{total_developers:0,total_contributions:0},rawDevs:tL.current,norms:tI.current}),r1(null),rZ(s.github_login);let c=o.buildings.find(e=>e.login.toLowerCase()===a);c&&sm(c),ra(!0)},[rB,rg]),lc=async()=>{await fetch("/api/auth/signout",{method:"POST"}),so(null)},ld=async()=>{sd(!0);try{let e=await fetch("/api/claim",{method:"POST"});e.ok?((0,ey.fn)(ny),await nq()):409===e.status&&await nq(!0)}finally{sd(!1)}},lu=async()=>{if(!sg){sf(!0);try{(await fetch("/api/claim-free-item",{method:"POST"})).ok&&((0,ey.iH)(),await nq(),sb(!0))}finally{sf(!1)}}},lx=ny?tT.find(e=>e.login.toLowerCase()===ny):null,lp=!!si&&!!lx&&!lx.claimed,lm="/shop",lh=!!si&&!!lx?.claimed&&!lx.owned_items.includes("flag"),{streakData:lb}=function(e,t){let[r,s]=(0,l.useState)(()=>{try{let e=sessionStorage.getItem(R);if(e){let t=JSON.parse(e);return t.checked_in=!1,t}}catch{}return null}),[a,n]=(0,l.useState)(!1),i=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{!e||!t||i.current||sessionStorage.getItem(R)||(i.current=!0,n(!0),fetch("/api/checkin",{method:"POST"}).then(e=>e.ok?e.json():null).then(e=>{e&&(s(e),sessionStorage.setItem(R,JSON.stringify(e)),e.unseen_count>0&&fetch("/api/achievements/mark-seen",{method:"POST"}).catch(()=>{}))}).catch(()=>{i.current=!1}).finally(()=>n(!1)))},[e,t]),{streakData:r,loading:a}}(si,!!lx?.claimed),{data:lg,trackClientMission:lf,claim:ly,refresh:lv,toasts:lj}=function(e,t){let[r,s]=(0,l.useState)(null),[a,n]=(0,l.useState)(!1),i=(0,l.useRef)(!1),o=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/dailies");if(!e.ok)return;let t=await e.json();s(t)}catch{}},[]);(0,l.useEffect)(()=>{e&&t&&(i.current||(i.current=!0,n(!0),o().finally(()=>n(!1))))},[e,t,o]);let c=(0,l.useCallback)(async()=>{await o()},[o]),[d,u]=(0,l.useState)([]),x=(0,l.useRef)(0),p=(0,l.useCallback)((e,t)=>{let r=++x.current;u(s=>[...s,{id:r,title:e,done:t}]),setTimeout(()=>u(e=>e.filter(e=>e.id!==r)),2500)},[]),m=(0,l.useCallback)(async e=>{if(!r)return;let t=r.missions.find(t=>t.id===e);if(!t||t.completed)return;let a=Math.min(t.progress+1,t.threshold),n=a>=t.threshold;t.threshold>1?p(`${t.title} (${a}/${t.threshold})`,n):p(t.title,n),s(t=>{if(!t)return t;let r=t.missions.map(t=>t.id!==e?t:{...t,progress:a,completed:n}),s=r.filter(e=>e.completed).length;return{...t,missions:r,completed_count:s,all_completed:3===s}}),fetch("/api/dailies/progress",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mission_id:e})}).catch(()=>{})},[r,p]);return{data:r,loading:a,refresh:c,trackClientMission:m,claim:(0,l.useCallback)(async()=>{try{let e=await fetch("/api/dailies/claim",{method:"POST"});if(!e.ok)return null;let t=await e.json();return s(e=>e?{...e,reward_claimed:!0,dailies_streak:t.streak,dailies_completed:t.total}:e),t}catch{return null}},[]),toasts:d}}(si,!!lx?.claimed),lw=(0,l.useRef)(lf);lw.current=lf,(0,l.useEffect)(()=>{if(!lb?.xp||!lx)return;let e=lb.xp.new_level;e>(lx.xp_level??1)&&a8(e)},[lb?.xp,lx]);let{count:lk}=function(){let[e,t]=(0,l.useState)(1),r=(0,l.useRef)("");return(0,l.useEffect)(()=>{r.current||(r.current=crypto.randomUUID());let e=!1,s=null,a=null;async function n(){try{await fetch("/api/online",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:r.current})})}catch{}}async function l(){try{let r=await fetch("/api/online");if(!r.ok)return;let s=await r.json();e||"number"!=typeof s.count||t(Math.max(1,s.count))}catch{}}function i(){n(),l(),s=setInterval(n,3e4),a=setInterval(l,1e4)}function o(){s&&(clearInterval(s),s=null),a&&(clearInterval(a),a=null)}function c(){document.hidden?o():i()}return i(),document.addEventListener("visibilitychange",c),()=>{e=!0,o(),document.removeEventListener("visibilitychange",c)}},[]),{count:e,status:"connected"}}(),{liveCount:lN,liveByLogin:l_}=function(){let[e,t]=(0,l.useState)(new Map),r=(0,l.useRef)(null),s=(0,l.useRef)(new Map),a=(0,l.useCallback)(()=>{t(new Map(s.current))},[]);return(0,l.useEffect)(()=>{fetch("/api/presence").then(e=>e.json()).then(e=>{if(e.developers){let t=new Map;for(let r of e.developers)t.set(r.githubLogin,{githubLogin:r.githubLogin,avatarUrl:r.avatarUrl,status:r.status,language:r.language});s.current=t,a()}}).catch(()=>{});let e=(0,v.fV)().channel("coding-presence");r.current=e,e.on("broadcast",{event:"heartbeat"},({payload:e})=>
1{if(e?.githubLogin){if("offline"===e.status){s.current.delete(e.githubLogin),a();return}s.current.set(e.githubLogin,{githubLogin:e.githubLogin,avatarUrl:e.avatarUrl,status:e.status??"active",language:e.language}),a()}}).subscribe();let t={current:null};function n(){fetch("/api/presence").then(e=>e.json()).then(e=>{if(e.developers){let t=new Map;for(let r of e.developers)t.set(r.githubLogin,{githubLogin:r.githubLogin,avatarUrl:r.avatarUrl,status:r.status,language:r.language});s.current=t,a()}}).catch(()=>{})}function l(){n(),t.current=setInterval(n,3e4)}function i(){t.current&&(clearInterval(t.current),t.current=null)}function o(){document.hidden?i():l()}return l(),document.addEventListener("visibilitychange",o),()=>{e.unsubscribe(),r.current=null,i(),document.removeEventListener("visibilitychange",o)}},[a]),{liveCount:e.size,liveLogins:new Set(Array.from(e.values()).map(e=>e.githubLogin)),liveByLogin:e}}(),lS=(0,l.useMemo)(()=>se?1.2:(0,j.e)()?1:0===lN?.05:1===lN?.35:2===lN?.55:lN<=5?.55+(lN-2)*.15:lN<=15?1+(Math.min(lN,15)-5)*.02:Math.min(1.4,1.2+(lN-15)*.02),[lN,se]),lC=eP.has("celebrate"),l$=(0,l.useMemo)(()=>{if(lC)return!0;if(rB.total_developers<tb[0])return!1;let e=[...tb].reverse().find(e=>rB.total_developers>=e);if(!e)return!1;let t=rY.find(t=>t.milestone===e);return!t||Date.now()-new Date(t.reached_at).getTime()<864e5},[rB.total_developers,rY,lC]);(0,l.useEffect)(()=>{fetch("/api/milestone-celebration").then(e=>e.ok?e.json():[]).then(e=>{Array.isArray(e)&&rX(e)}).catch(()=>{})},[]),(0,l.useEffect)(()=>{if(rB.total_developers<tb[0])return;let e=[...tb].reverse().find(e=>rB.total_developers>=e);!e||rY.some(t=>t.milestone===e)||fetch("/api/milestone-celebration",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({total_developers:rB.total_developers})}).then(e=>e.json()).then(e=>{e.celebrated&&rX(t=>[{milestone:e.milestone,reached_at:e.reached_at??new Date().toISOString()},...t])}).catch(()=>{})},[rB.total_developers,rY]),(0,l.useEffect)(()=>{if("done"===tZ&&si&&!t5&&!t9)return ns.current=setTimeout(()=>{try{let e=localStorage.getItem("gitcity_fly_history");if(!e)return;let t=JSON.parse(e);if(!t.seeds||0===Object.keys(t.seeds).length)return;let r=new Date,s=new Date(r.getFullYear(),0,0),a=Math.floor((r.getTime()-s.getTime())/864e5),n=`${r.getFullYear()}-${a}`;if(t.seeds[n])return;a7(!0),ns.current=setTimeout(()=>a7(!1),15e3)}catch{}},2e3),()=>clearTimeout(ns.current)},[tZ,si,t5,t9]),(0,l.useEffect)(()=>{if("done"===tZ&&!t5&&!t9){try{if(localStorage.getItem("gitcity_fly_history")||localStorage.getItem("gitcity_fly_hint_seen"))return}catch{return}return na.current=setTimeout(()=>{ne(!0),na.current=setTimeout(()=>{ne(!1);try{localStorage.setItem("gitcity_fly_hint_seen","1")}catch{}},1e4)},5e3),()=>clearTimeout(na.current)}},[tZ,t5,t9]);let lT=(0,l.useMemo)(()=>eK?function(e,t){if(t<=e.length||0===e.length)return e;let r=e.slice();for(let s=0;r.length<t&&s<d.length;s++){let[a,n]=d[s];for(let l of e){if(r.length>=t)break;let e=`${l.login}~${s+1}`;r.push({...l,login:e,loginLower:e.toLowerCase(),position:[l.position[0]+a,l.position[1],l.position[2]+n]})}}return r}(tT,eK):tT,[tT,eK]);return(0,s.jsxs)("main",{className:"relative min-h-screen overflow-hidden bg-bg font-pixel uppercase text-warm",children:[eK>0&&(0,s.jsx)(u,{count:lT.length}),t5&&"1"===eP.get("tune")&&(0,s.jsx)(x.a,{}),tw?.mode==="live"&&(0,s.jsx)(e3,{flyMode:t5,accentColor:nb.accent,shadowColor:nb.shadow,leaderboard:td,participants:e0?.participants??0,selfLogin:ny}),nz&&(0,s.jsx)("div",{className:"pointer-events-none fixed left-1/2 top-24 z-50 -translate-x-1/2",children:(0,s.jsxs)("div",{className:"border-2 bg-bg/90 px-5 py-3 text-center font-pixel uppercase backdrop-blur-sm",style:{borderColor:"#f0c060",boxShadow:"4px 4px 0 0 rgba(240,192,96,0.35)"},children:[(0,s.jsx)("div",{className:"text-[13px] tracking-[0.2em]",style:{color:"#f0c060"},children:"The Boss Duck escaped"}),(0,s.jsx)("div",{className:"mt-1 text-[10px] tracking-wider text-cream/70",children:"The city held the line. It will return."})]})}),(0,s.jsx)(eJ,{perfMode:ri,onPerfDecline:rb,bossPreview:tw,onCompareCinematicEnd:()=>at(!1),buildings:lT,plazas:tz,decorations:tM,river:tA,bridges:tF,sfMap:tG,flyMode:t5,flyVehicle:t4,onExitFly:rU.current=()=>{let e=Date.now()-rA.current,t=rO.current>0?Date.now()-rO.current:0,r=Math.max(0,e-rF.current-t),s=rz.collected>0?Math.max(0,(90-r/1e3)/90):0,a=Math.floor(.5*rz.score*s),n=rz.score+a,l=rM;try{l=Math.max(l,parseInt(localStorage.getItem("gitcity_fly_pb")||"0",10)||0)}catch{}let i=l>0&&n>l;if(i){rP(n);try{localStorage.setItem("gitcity_fly_pb",String(n))}catch{}}if(n>0)try{let e=new Date,t=new Date(e.getFullYear(),0,0),r=Math.floor((e.getTime()-t.getTime())/864e5),s=`${e.getFullYear()}-${r}`,a=localStorage.getItem("gitcity_fly_history"),l=a?JSON.parse(a):{seeds:{},currentStreak:0,longestStreak:0,lastPlayedSeed:""},i=l.seeds[s];if(l.seeds[s]={bestScore:Math.max(i?.bestScore??0,n),playCount:(i?.playCount??0)+1},l.lastPlayedSeed!==s){let t=r-1,a=t>=1?`${e.getFullYear()}-${t}`:`${e.getFullYear()-1}-365`;l.lastPlayedSeed===a?l.currentStreak=(l.currentStreak||0)+1:(l.lastPlayedSeed,l.currentStreak=1),l.lastPlayedSeed=s}l.longestStreak=Math.max(l.longestStreak||0,l.currentStreak),localStorage.setItem("gitcity_fly_history",JSON.stringify(l))}catch{}if(t3(!1),r_(!1),rL(!1),rR(!1),n>0&&(nr({...{score:n,collected:rz.collected,maxCombo:rz.maxCombo,timeBonus:a,isNewPB:i},rank:0,totalPilots:0}),nn.current=setTimeout(()=>nr(null),12e3),si)){let e=Math.min(Math.max(rz.maxCombo,1),3);fetch("/api/fly-scores",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({score:n,collected:rz.collected,max_combo:e,flight_ms:r})}).then(e=>e.ok?e.json():null).then(e=>{e&&nr(t=>t?{...t,rank:e.rank_today??0,totalPilots:e.total??0}:null)}
1).catch(()=>{})}},themeIndex:rn,onHud:(e,t,r,s,a)=>{rf.current.x=r,rf.current.z=s,ry.current=a,eq={speed:e,x:r-40*Math.sin(a),z:s-40*Math.cos(a),yaw:a},eQ.forEach(e=>e())},onPause:e=>{e?rO.current=Date.now():rO.current>0&&(rF.current+=Date.now()-rO.current,rO.current=0),r_(e)},onCollect:(e,t,r,s,a)=>rD({score:e,earned:t,combo:r,collected:s,maxCombo:a}),focusedBuilding:rJ,focusedBuildingB:np,accentColor:nb.accent,onClearFocus:()=>rZ(null),flyPauseSignal:rS,isMobile:nm,onJoystickState:t5?rT:void 0,flyBoostActive:rE,flyBrakeActive:rI,flyHasOverlay:!!sp||a$||aE||aI||aA,flyStartPaused:!1,holdRise:"done"!==tZ,celebrationActive:l$,onCameraMove:eV.set,skyAds:aw,onAdClick:e=>{if((0,ey.WI)(e.id,e.vehicle,e.link),e.link&&(0,ef.qS)(e.vehicle)){let t=(0,ef.Sn)(e)??e.link,r=e.link.startsWith("mailto:");(0,ef.Xm)(e.id,"click",ny||void 0),(0,ey.ME)(e.id,e.vehicle),ty("sky_ad_click",{ad_id:e.id,vehicle:e.vehicle,brand:e.brand??""}),(async()=>{let s=await (0,ef.Xm)(e.id,"cta_click",ny||void 0),a=s?(0,ef._v)(t,s):t;r?window.location.href=a:window.open(a,"_blank","noopener,noreferrer")})();try{a1(e.brand||new URL(e.link).hostname.replace("www.",""))}catch{a1(e.brand||"link")}setTimeout(()=>a1(null),2500)}else(0,ef.Xm)(e.id,"click",ny||void 0),aj(e)},onAdViewed:e=>{try{let t="gc_ad_viewed",r=sessionStorage.getItem(t),s=r?JSON.parse(r):[];if(s.includes(e))return;s.push(e),sessionStorage.setItem(t,JSON.stringify(s))}catch{}(0,ef.Xm)(e,"impression",ny||void 0);let t=aw.find(t=>t.id===e);t&&(0,ey.Vm)(t.id,t.vehicle,t.brand)},introMode:t9,onIntroEnd:n1,onFocusInfo:()=>{},ghostPreviewLogin:ni,liveByLogin:l_,cityEnergy:lS,raidPhase:nc.phase,raidData:nc.raidData,raidAttacker:nc.attackerBuilding,raidDefender:nc.defenderBuilding,onRaidPhaseComplete:nd.onPhaseComplete,plazaCenter:ej.S?(0,s.jsx)(eX,{town:t,variant:eC,onClick:()=>eA.push(t?`/town/${t.slug}`:"/towns/new")}):(0,s.jsx)(eX,{town:null,variant:eC,teaser:ej.P,onClick:()=>{ev.Ay.capture("rivalry_cta_clicked",{from:"plaza_gate"}),eA.push("/towns")}}),rabbitSighting:aB,onRabbitCaught:nV,rabbitCinematic:aA,onRabbitCinematicEnd:nK,rabbitCinematicTarget:aB??void 0,onBuildingClick:e=>{if((0,ey.Lp)(e.login),si||aV.current||(aK.current+=1,aK.current>=1&&(aV.current=!0,aQ(!0),(0,ey.jx)(),setTimeout(()=>aQ(!1),8e3))),s8&&!s7){if(e.login.toLowerCase()===s8.login.toLowerCase()){as(!0),setTimeout(()=>as(!1),2e3);return}s9([s8,e]),rZ(s8.login);return}!s7&&(sm(e),rZ(e.login),s$(!1),sE(null),nZ.current=999,lx?.district&&e.district&&e.district!==lx.district&&lw.current("explore_district"),t5?rC(e=>e+1):rs||ra(!0))},onFlyMove:n_,flyPilotsRef:nv,flyProjectilesRef:nj,flySelfStateRef:nw,flySelfId:nk,flyOnShoot:nS,flyOnReportHit:nC,flyPvpEnabled:nN,flyPendingRespawnRef:nT,flyBossStateRef:nE,flyEngageBoss:nL,flySendBossHit:nI,flySendBossSelfHit:nR}),t5&&(0,s.jsx)(X,{selfStateRef:nw,pilotsRef:nv,pvpEnabled:nN,onTogglePvp:n$,selfPosRef:rf,selfYawRef:ry}),("done"!==tZ||eB)&&(0,s.jsx)(eo,{stage:"done"===tZ?"ready":tZ,setup:eU?eH:void 0,progress:tV,error:tQ,stats:rB,onRetry:n0,onFadeComplete:nQ}),t9&&(0,s.jsx)(g,{total:rB.total_developers||tT.length,onSkip:n1}),t5&&(0,s.jsxs)("div",{className:"pointer-events-none fixed inset-0 z-30",children:[nm?(0,s.jsxs)("div",{className:"pointer-events-auto absolute left-2 right-2 flex items-center gap-1.5 border-[3px] border-border bg-bg/80 px-2 py-1.5 backdrop-blur-sm",style:{top:"max(8px, env(safe-area-inset-top, 8px))"},children:[(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),rU.current?.()},onTouchStart:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),className:"btn-press shrink-0 text-[10px] tracking-wider uppercase",style:{color:nb.accent},children:"Exit"}),(0,s.jsx)("span",{className:"text-border",children:"|"}),(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),rN?window.dispatchEvent(new KeyboardEvent("keydown",{code:"Space",bubbles:!0})):rC(e=>e+1)},onTouchStart:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),className:"btn-press shrink-0 text-[10px] tracking-wider uppercase text-cream",children:rN?"Resume":"Pause"}),(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsx)("span",{className:`h-1.5 w-1.5 shrink-0 ${rN?"":"blink-dot"}`,style:{backgroundColor:rN?"#f85149":nb.accent}}),(0,s.jsx)("span",{className:"text-[9px]",style:{color:nb.accent},children:rz.score}),(0,s.jsx)("span",{className:"text-[9px] text-muted",children:"PX"}),rz.combo>=2&&(0,s.jsxs)("span",{className:"animate-pulse text-[9px] font-bold",style:{color:"#ffd700"},children:["\xd7",rz.combo>=4?3:rz.combo>=3?2:1.5]}),(0,s.jsx)("span",{className:"text-border",children:"|"}),(0,s.jsxs)("span",{className:"text-[9px] text-muted",children:[rz.collected,(0,s.jsx)("span",{style:{color:nb.accent},children:"/40"})]}),(0,s.jsxs)("span",{className:"text-[9px]",style:{color:rG<90?nb.accent:"#f85149"},children:[Math.floor(rG/60),":",String(rG%60).padStart(2,"0")]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"pointer-events-auto absolute top-4 left-1/2 -translate-x-1/2",children:(0,s.jsxs)("div",{className:"inline-flex items-center gap-3 border-[3px] border-border bg-bg/70 px-5 py-2.5 backdrop-blur-sm",children:[(0,s.jsx)("span",{className:`h-2 w-2 shrink-0 ${rN?"":"blink-dot"}`,style:{backgroundColor:rN?"#f85149":nb.accent}}),(0,s.jsx)("span",{className:"text-[10px] text-cream",children:rN?"Paused":"Fly"}),(0,s.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,s.jsx)("span",{className:"text-[10px]",style:{color:nb.accent},children:rz.score}),(0,s.jsx)("span",{className:"text-[10px] text-muted",children:"PX"}),rz.combo>=2&&(0,s.jsxs)("span",{className:"animate-pulse text-[10px] font-bold",style:{color:"#ffd700"},children:["\xd7",rz.combo>=4?3:rz.combo>=3?2:1.5]}),nN&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,s.jsx)("span",{className:"inline-flex items-center gap-1",children:[0,1,2].map(e=>(0,s.jsx)(K,{filled:e<rw,size:16,color:nb.accent},e))})]}),(0,s.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,s.jsx)("span",{className:"text-[10px] text-cream",children:rz.collected}),(0,s.jsx)("span",{className:"text-[10px] text-muted",children:"/40"}),(0,s.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,s.jsxs)("span",{className:"text-[10px]",style:{color:rG<90?nb.accent:"#f85149"},children:[Math.floor(rG/60),":",String(rG%60).padStart(2,"0")]}),(0,s.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,s.jsx)("span",{className:"text-[10px] uppercase text-muted tracking-wider",children:"SPD"}),(0,s.jsx)("span",{className:"text-[10px]",style:{color:nb.accent},children:(0,s.jsx)(e5,{})}),(0,s.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,s.jsxs)("button",{onClick:()=>n$(!nN),role:"switch","aria-checked":nN,title:nN?"Disable combat":"Enable combat",className:"btn-press inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[10px] uppercase tracking-wider",style:{color:nN?nb.accent:"#8c8c9c",cursor:"pointer",background:"transparent",border:"none",padding:0},children:[(0,s.jsx)("span",{style:{fontSize:11},children:nN?"⚡":"○"}),(0,s.jsx)("span",{children:"Force Push"}),(0,s.jsx)("span",{style:{color:nN?nb.accent:"#5c5c6c"},children:nN?"ON":"OFF"})]}),rM>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"mx-1 text-border",children:"|"}),(0,s.jsxs)("span",{className:"text-[8px] text-muted",children:["BEST"," ",(0,s.jsx)("span",{style:{color:nb.accent},children:rM})]})]})]})})}),!nm&&(0,s.jsxs)("div",{className:"pointer-events-auto absolute bottom-14 left-3 sm:left-4 flex flex-col-reverse items-start gap-2",children:[(0,s.jsx)("button",{onClick:()=>rj(e=>!e),className:"btn-press inline-flex items-center gap-1 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] uppercase tracking-wider backdrop-blur-sm transition-colors hover:border-border-light",style:{color:rv?nb.accent:"#8c8c9c"},title:rv?"Hide controls":"Show controls",children:"? Help"}),rv&&(0,s.jsx)("div",{className:"inline-flex flex-col gap-1 border-[3px] border-border bg-bg/70 px-3 py-2 text-[10px] leading-tight text-muted backdrop-blur-sm animate-[fade-in_0.2s_ease-out]",children:rN?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap text-cream uppercase tracking-wider",children:"Drag"}),(0,s.jsx)("span",{children:"orbit"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap text-cream uppercase tracking-wider",children:"Scroll"}),(0,s.jsx)("span",{children:"zoom"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap text-cream uppercase tracking-wider",children:"WASD"}),(0,s.jsx)("span",{children:"resume"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap uppercase tracking-wider",style:{color:nb.accent},children:"ESC"}),(0,s.jsx)("span",{children:"exit fly"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap uppercase tracking-wider",style:{color:"#d44"},children:"ESC \xd7 2"}),(0,s.jsx)("span",{children:"exit fly"})]}),(0,s.jsx)("div",{className:"my-0.5 h-px w-full bg-border"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap text-cream uppercase tracking-wider",children:"Mouse"}),(0,s.jsx)("span",{children:"steer"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap text-cream uppercase tracking-wider",children:"Scroll"}),(0,s.jsx)("span",{children:"speed, down to a hover"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap text-cream uppercase tracking-wider",children:"Shift / Q"}),(0,s.jsx)("span",{children:"boost / brake"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap text-cream uppercase tracking-wider",children:"Click / F"}),(0,s.jsx)("span",{children:"fire"})]}),(0,s.jsx)("div",{className:"my-0.5 h-px w-full bg-border"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap uppercase tracking-wider",style:{color:nb.accent},children:"R"}),(0,s.jsx)("span",{children:"return to city"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"w-20 shrink-0 whitespace-nowrap uppercase tracking-wider",style:{color:nb.accent},children:"P"}),(0,s.jsx)("span",{children:"pause"})]})]})})]})]}),nm&&t5&&(0,s.jsxs)(s.Fragment,{children:[!rN&&(0,s.jsxs)("div",{className:"fixed z-50 flex gap-1.5 select-none",style:{bottom:"max(24px, env(safe-area-inset-bottom, 24px))",left:"16px",WebkitTouchCallout:"none"},children:[(0,s.jsx)("button",{onTouchStart:e=>{e.stopPropagation(),rR(!0)},onTouchEnd:e=>{e.stopPropagation(),rR(!1)},onTouchCancel:()=>rR(!1),className:"btn-press border-[3px] bg-bg/80 px-3 py-2 text-[10px] tracking-widest uppercase backdrop-blur-sm transition-all",style:{borderColor:rI?nb.accent:"var(--color-border)",color:rI?nb.accent:"var(--color-muted)"},children:"Slow"}),(0,s.jsx)("button",{onTouchStart:e=>{e.stopPropagation(),rL(!0)},onTouchEnd:e=>{e.stopPropagation(),rL(!1)},onTouchCancel:()=>rL(!1),className:"btn-press border-[3px] bg-bg/80 px-3 py-2 text-[10px] tracking-widest uppercase backdrop-blur-sm transition-all",style:{borderColor:rE?"#ffb428":"var(--color-border)",color:rE?"#ffb428":"var(--color-cream)",boxShadow:rE?"0 0 12px rgba(255,180,40,0.25)":"none"},children:"Boost"})]}),r$&&(0,s.jsxs)("div",{style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:30},children:[(0,s.jsx)("div",{style:{position:"absolute",left:r$.baseX-60,top:r$.baseY-60,width:120,height:120,borderRadius:"50%",border:"1.5px solid rgba(255,255,255,0.2)",background:"rgba(255,255,255,0.04)"}}),(0,s.jsx)("div",{style:{position:"absolute",left:r$.baseX+r$.dx-18,top:r$.baseY+r$.dy-18,width:36,height:36,borderRadius:"50%",background:"rgba(255,255,255,0.25)",border:"1px solid rgba(255,255,255,0.35)",willChange:"transform"}})]})]}),(0,s.jsx)(e2,{buildings:tT,visible:"done"===tZ&&!t9&&!aA&&(rs||t5),flyMode:t5,onWorldClick:rs&&!t5?(e,t)=>f.WJ.send({type:"flyTo",x:e,z:t}):void 0,districtZones:tW,remotePilotsRef:nv,rabbitPos:aB&&aB>=1&&aB<=5?tz[aB-1]?.position??null:null}),rs&&!t5&&(0,s.jsxs)("div",{className:"pointer-events-none fixed inset-0 z-20",children:[(0,s.jsx)("div",{className:"pointer-events-auto absolute top-3 left-3 sm:top-4 sm:left-4",children:(0,s.jsxs)("button",{onClick:()=>{sp?(sm(null),rZ(null)):(ra(!1),rZ(nf.current),nf.current=null)},className:"flex items-center gap-2 border-[3px] border-border bg-bg/70 px-3 py-1.5 text-[10px] backdrop-blur-sm transition-colors",style:{borderColor:void 0},onMouseEnter:e=>e.currentTarget.style.borderColor=nb.accent+"80",onMouseLeave:e=>e.currentTarget.style.borderColor="",children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"ESC"}),(0,s.jsx)("span",{className:"text-cream",children:"Back"})]})}),(0,s.jsxs)("div",{className:"pointer-events-auto fixed bottom-10 left-3 z-31 flex flex-col-reverse items-start gap-2 sm:left-4 sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:nG,className:"btn-press flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"▶"}),(0,s.jsx)("span",{className:"text-cream",children:nb.name}),(0,s.jsxs)("span",{className:"text-dim",children:[rn+1,"/",tl.length]})]}),eY&&(0,s.jsx)("div",{id:"gc-radio-slot"}),(0,s.jsx)(tv,{mode:ri,preference:ro,accent:nb.accent,onSelect:e=>{rx(!1),rc(e)}})]}),!t5&&(0,s.jsx)(p.A,{camera:eV,accent:nb.accent,showPlaces:!sp}),!sp&&(0,s.jsxs)("div",{className:"absolute bottom-20 left-3 hidden text-[8px] leading-loose text-muted sm:left-4 sm:block sm:text-[9px]",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Drag"})," move"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Scroll"})," zoom"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Right-drag"})," rotate"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"2-finger swipe"})," rotate"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Double-click"})," zoom in"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Click"})," building"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"ESC"})," back"]})]})]}),!t5&&!t9&&!aA&&(0,s.jsxs)("div",{className:`pointer-events-auto fixed top-3 left-3 z-30 items-center gap-1.5 sm:gap-2 sm:top-4 sm:left-4 ${rs?"hidden":"flex"}`,children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm sm:hidden",children:[(0,s.jsx)("span",{className:"live-dot h-1.5 w-1.5 shrink-0 rounded-full bg-[#ef4444]"}),(0,s.jsx)("span",{className:"text-cream",children:lk.toLocaleStr
1ing()}),(0,s.jsx)("span",{className:"text-muted",children:"live"})]}),null!=aN&&(0,s.jsxs)("a",{href:"https://github.com/srizzon/git-city",target:"_blank",rel:"noopener noreferrer",className:"hidden sm:flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",children:[(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",className:"text-cream",children:(0,s.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"})}),(0,s.jsx)("span",{style:{color:nb.accent},children:"★"}),(0,s.jsx)("span",{className:"text-cream",children:aN.toLocaleString()})]}),(0,s.jsxs)("a",{href:"https://discord.gg/2bTjFAkny7",target:"_blank",rel:"noopener noreferrer",className:"hidden sm:flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",children:[(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",className:"text-[#5865F2]",children:(0,s.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.947 2.418-2.157 2.418z"})}),(0,s.jsx)("span",{className:"hidden sm:inline text-cream",children:"Discord"}),null!=aS&&(0,s.jsx)("span",{className:"text-cream",children:aS.toLocaleString()})]})]}),!t5&&!t9&&!aA&&(0,s.jsxs)("div",{className:`pointer-events-auto fixed top-3 right-3 z-30 items-center gap-1.5 sm:gap-2 sm:top-4 sm:right-4 ${rs?"hidden":"hidden sm:flex"}`,children:[ny&&(0,s.jsxs)(_(),{href:"/shop",className:"flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light cursor-pointer",title:"Open the shop",children:[(0,s.jsx)(V.A,{currency:"pixels",size:12}),(0,s.jsx)("span",{className:"text-cream",children:null===az?"—":az.toLocaleString()}),(0,s.jsx)("span",{className:"ml-0.5",style:{color:"#c8e64a"},children:"+"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm",children:[(0,s.jsx)("span",{className:"live-dot h-1.5 w-1.5 shrink-0 rounded-full bg-[#ef4444]"}),(0,s.jsx)("span",{className:"text-cream",children:lk.toLocaleString()}),(0,s.jsx)("span",{className:"text-muted",children:"live"})]}),(a=0===lN?"City sleeping":lN<=2?"City waking up":lN<=9?"City alive":"City buzzing",m=0===lN?"bg-muted/50":lN<=2?"bg-[#fbbf24]":"bg-[#4ade80]",h=0===lN?"":"live-dot",(0,s.jsxs)("div",{className:"relative hidden sm:block",children:[(0,s.jsxs)("button",{onClick:()=>r9(e=>!e),className:"flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",children:[(0,s.jsx)("span",{className:`${h} h-1.5 w-1.5 flex-shrink-0 rounded-full ${m}`}),lN>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-cream",children:lN}),(0,s.jsx)("span",{className:"text-muted",children:"coding"})]}):(0,s.jsx)("span",{className:"text-muted",children:a})]}
1),r7&&(N=[...(y=(b=Array.from(l_.values())).find(e=>"srizzon"===e.githubLogin.toLowerCase()))?[y]:[],...b.filter(e=>"srizzon"!==e.githubLogin.toLowerCase()).slice(0,y?4:5)],C=b.length-N.length,(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-80 border-[3px] border-border bg-bg/95 backdrop-blur-sm",children:[(0,s.jsx)("div",{className:"border-b border-border px-5 py-3 text-xs text-muted",children:"Coding right now"}),(0,s.jsxs)("button",{onClick:sr,className:"flex w-full items-center justify-between gap-3 border-b border-border px-5 py-3 text-left transition-colors hover:bg-white/5",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-[11px] text-cream",children:"Keep lights on"}),(0,s.jsx)("div",{className:"text-[10px] normal-case text-muted",children:"Don't dim the city when idle"})]}),(0,s.jsx)("span",{className:`relative h-4 w-7 flex-shrink-0 rounded-full transition-colors ${se?"bg-[#4ade80]":"bg-muted/40"}`,children:(0,s.jsx)("span",{className:`absolute top-0.5 h-3 w-3 rounded-full bg-bg transition-transform ${se?"translate-x-3.5":"translate-x-0.5"}`})})]}),(0,s.jsx)("div",{children:N.map(e=>{let t="srizzon"===e.githubLogin.toLowerCase();return(0,s.jsxs)("button",{onClick:()=>{let t=tT.find(t=>t.login.toLowerCase()===e.githubLogin.toLowerCase());t&&(sm(null),rZ(t.login),r9(!1))},className:"flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-white/5",children:[(0,s.jsx)("div",{className:"relative flex-shrink-0",children:e.avatarUrl&&(0,s.jsx)("img",{src:e.avatarUrl,alt:"",className:"h-6 w-6 rounded-full",style:t?{boxShadow:"0 0 6px #fbbf24"}:void 0})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:`truncate text-[11px] ${t?"text-[#fbbf24]":"text-cream"}`,children:e.githubLogin}),t&&(0,s.jsx)("span",{className:"shrink-0 text-[8px] text-[#fbbf24]/70",children:"CREATOR"})]}),(0,s.jsx)("div",{className:"truncate text-[10px] normal-case text-muted",children:t?"building the city":e.language||""})]}),(0,s.jsx)("span",{className:`live-dot h-2 w-2 flex-shrink-0 rounded-full ${t?"bg-[#fbbf24]":"bg-[#4ade80]"}`})]},e.githubLogin)})}),(0,s.jsx)("div",{className:"border-t border-border",children:(0,s.jsxs)(_(),{href:"/live",onClick:()=>r9(!1),className:"block px-4 py-2.5 text-center text-[11px] text-muted transition-colors hover:text-cream",children:[C>0?`+${C} more`:"View live page","→"]})}),(0,s.jsx)("div",{className:"border-t border-border",children:si?l_.has(ny)?(0,s.jsx)("div",{className:"px-5 py-3.5 text-center text-xs normal-case text-[#4ade80]",children:"Your building is powering the city"}):r2?(0,s.jsxs)("div",{className:"px-5 py-5",children:[(0,s.jsx)("p",{className:"mb-3 text-sm font-bold text-cream",children:"Your API Key"}),(0,s.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 truncate bg-white/5 px-3 py-2 text-[11px] normal-case text-cream",children:r2}),(0,s.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(r2),r6(!0),setTimeout(()=>r6(!1),2e3)},className:"btn-press shrink-0 border border-border px-3 py-2 text-[11px] text-cream transition-colors hover:border-border-light",children:r8?"Copied!":"Copy"})]}),(0,s.jsxs)("div",{className:"space-y-2.5 text-xs normal-case text-muted",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-cream",children:"1."})," Install ",(0,s.jsx)("a",{href:"https://marketplace.visualstudio.com/items?itemName=git-city.gitcity",target:"_blank",rel:"noopener noreferrer",className:"text-[#4ade80] hover:underline",children:"Git City: Pulse"})," in VS Code"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-cream",children:"2."})," Cmd+Shift+P → “Pulse: Connect”"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-cream",children:"3."})," Paste your key and start coding"]})]}),(0,s.jsx)("p",{className:"mt-3 text-[10px] normal-case text-muted/50",children:"Your building lights up in ~30s"}),(0,s.jsx)("p",{className:"mt-1.5 text-[10px] normal-case text-muted/50",children:"Only your username and language are shared publicly. Control what's sent in VS Code Settings > Git City > Privacy."})]}):(0,s.jsxs)("div",{className:"px-5 py-5",children:[(0,s.jsx)("p",{className:"mb-3 text-sm normal-case text-cream font-bold",children:"Keep your city alive"}),(0,s.jsx)("p",{className:"mb-3 text-[11px] normal-case text-muted",children:"When you code, your building glows and the city stays lit. Every active dev powers the signal."}),(0,s.jsxs)("div",{className:"mb-4 space-y-2.5 text-xs normal-case text-muted",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-cream",children:"1."})," Generate your key below"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-cream",children:"2."})," Install ",(0,s.jsx)("a",{href:"https://marketplace.visualstudio.com/items?itemName=git-city.gitcity",target:"_blank",rel:"noopener noreferrer",className:"text-[#4ade80] hover:underline",children:"Git City: Pulse"})," in VS Code"]}),(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"text-cream",children:"3."})," Paste key in VS Code, start coding"]})]}),(0,s.jsx)("button",{onClick:async()=>{r4(!0);try{let e=await fetch("/api/vscode-key",{method:"POST"}),t=await e.json();t.key&&(r5(t.key),navigator.clipboard.writeText(t.key),r6(!0),setTimeout(()=>r6(!1),2e3))}finally{r4(!1)}},disabled:r3,className:"btn-press w-full py-2.5 text-center text-xs text-bg",style:{backgroundColor:"#4ade80",boxShadow:"2px 2px 0 0 #16a34a"},children:r3?"Generating...":r8?"Key copied to clipboard!":"Generate API Key"}),(0,s.jsx)("p",{className:"mt-3 text-[10px] normal-case text-muted/50",children:"Only your username and language are shared publicly. You can control this in VS Code Settings > Git City > Privacy."})]}):(0,s.jsxs)("div",{className:"px-5 py-5 text-center",children:[(0,s.jsx)("p",{className:"mb-3 text-xs normal-case text-muted",children:"Keep your city alive while you code"}),(0,s.jsx)(_(),{href:"/auth",onClick:()=>r9(!1),className:"btn-press inline-block w-full py-2.5 text-center text-xs text-bg",style:{backgroundColor:"#4ade80",boxShadow:"2px 2px 0 0 #16a34a"},children:"Sign in with GitHub"})]})})]}))]}))]}),sn&&(0,s.jsx)("div",{className:"pointer-events-auto fixed inset-0 z-50 flex items-end sm:hidden",onClick:()=>sl(!1),children:(0,s.jsxs)("div",{className:"w-full border-t-2 border-border bg-bg px-5 py-6 animate-[slide-up_0.2s_ease-out]",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"live-dot h-2 w-2 rounded-full bg-[#4ade80]"}),(0,s.jsxs)("span",{className:"text-sm text-cream",children:[lN," coding right now"]})]}),(0,s.jsx)("button",{onClick:()=>sl(!1),className:"text-muted",children:(0,s.jsx)(i.A,{size:16})})]}),(0,s.jsx)("p",{className:"mb-5 text-xs text-muted normal-case leading-relaxed",children:"Every developer coding right now is keeping the city alive. Their buildings light up in real time as they work."}),(0,s.jsxs)("button",{onClick:sr,className:"mb-4 flex w-full items-center justify-between gap-3 border-2 border-border px-4 py-3 text-left",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-xs text-cream",children:"Keep lights on"}),(0,s.jsx)("div",{className:"text-[10px] normal-case text-muted",children:"Don't dim the city when idle"})]}),(0,s.jsx)("span",{className:`relative h-5 w-9 flex-shrink-0 rounded-full transition-colors ${se?"bg-[#4ade80]":"bg-muted/40"}`,children:(0,s.jsx)("span",{className:`absolute top-0.5 h-4 w-4 roun
1ded-full bg-bg transition-transform ${se?"translate-x-4":"translate-x-0.5"}`})})]}),(0,s.jsx)(_(),{href:"/live",onClick:()=>sl(!1),className:"btn-press block w-full py-3 text-center text-xs text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"See who's coding live"})]})}),!t5&&!t9&&!aA&&!rs&&(0,s.jsx)("button",{onClick:()=>sa(!0),className:"pointer-events-auto fixed top-3 right-3 z-40 flex h-8 w-8 items-center justify-center border-2 border-border bg-bg/80 backdrop-blur-sm sm:hidden",children:(0,s.jsx)(o.A,{size:16,className:"text-cream"})}),ss&&(0,s.jsxs)("div",{className:"pointer-events-auto fixed inset-0 z-50 flex flex-col bg-bg sm:hidden animate-[slide-in-right_0.25s_ease-out]",style:{background:"var(--color-bg)"},children:[si?(0,s.jsxs)("div",{className:"px-5 pt-6 pb-5 border-b border-border",style:{background:nb.accent+"0d"},children:[(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)(_(),{href:`/dev/${ny}`,onClick:()=>sa(!1),className:"flex items-center gap-3",children:[lx?.avatar_url&&(0,s.jsx)(k.default,{src:lx.avatar_url,alt:"",width:48,height:48,unoptimized:!0,className:"h-12 w-12 rounded-full border-2",style:{borderColor:nb.accent}}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-sm text-cream font-bold",children:["@",ny]}),lb&&lb.streak>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-xs",style:{color:tN(lb.streak)},children:["\uD83D\uDD25",(0,s.jsx)("span",{className:"font-bold",children:lb.streak})]})]}),lx&&(0,s.jsxs)("div",{className:"mt-0.5 text-[10px] text-muted normal-case",children:[lx.district," district",lx.claimed&&(0,s.jsx)("span",{className:"ml-1.5 text-[#4ade80]",children:"claimed"})]}),l_.has(ny)&&(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-1 text-[10px]",style:{color:nb.accent},children:[(0,s.jsx)("span",{className:"live-dot h-1.5 w-1.5 rounded-full bg-[#4ade80]"}),"coding now"]})]})]}),(0,s.jsx)("button",{onClick:()=>sa(!1),className:"flex h-8 w-8 items-center justify-center border-2 border-border text-muted",children:(0,s.jsx)(i.A,{size:14})})]}),lp&&(0,s.jsx)("button",{onClick:()=>{ld(),sa(!1)},disabled:sc,className:"btn-press mt-4 w-full py-2.5 text-xs text-bg disabled:opacity-40",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:sc?"...":"Claim your building"})]}):(0,s.jsxs)("div",{className:"px-5 pt-6 pb-5 border-b border-border",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("span",{className:"text-xs text-muted",children:"GIT CITY"}),(0,s.jsx)("button",{onClick:()=>sa(!1),className:"flex h-8 w-8 items-center justify-center border-2 border-border text-muted",children:(0,s.jsx)(i.A,{size:14})})]}),(0,s.jsx)("p",{className:"mb-3 text-xs text-muted normal-case leading-relaxed",children:"Your GitHub commits build a real 3D city. Sign in to claim your building."}),(0,s.jsx)("button",{onClick:()=>{nH(),sa(!1)},className:"btn-press w-full py-3 text-xs text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"Sign in with GitHub"})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,s.jsx)("div",{className:"px-5 pt-4 pb-1",children:(0,s.jsx)("p",{className:"text-[9px] text-muted/50 uppercase tracking-[0.2em]",children:"City"})}),(0,s.jsxs)("div",{className:"divide-y divide-border/40",children:[(0,s.jsxs)(_(),{href:"/live",onClick:()=>sa(!1),className:"flex items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 text-sm text-cream",children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-[#ef4444] ${lk>0?"live-dot":""}`}),"Live",(0,s.jsxs)("span",{className:"text-[10px] text-muted",children:[lk.toLocaleString()," online"]})]}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]}),(0,s.jsxs)(_(),{href:"/live",onClick:()=>sa(!1),className:"flex items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 text-sm text-cream",children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-[#4ade80] ${lN>0?"live-dot":""}`}),"Coding",lN>0&&(0,s.jsxs)("span",{className:"text-[10px] text-muted",children:[lN," active"]})]}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]}),(0,s.jsxs)("button",{onClick:()=>{sa(!1),si?window.location.href="/arcade":((0,ey.A5)(),aR(!0))},className:"flex w-full items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 text-sm text-cream",children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-[#a78bfa] ${aM>0?"animate-pulse":""}`}),"Lobby",(0,s.jsxs)("span",{className:"text-[10px] text-muted",children:[aM," playing"]})]}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]})]}),(0,s.jsx)("div",{className:"px-5 pt-5 pb-1",children:(0,s.jsx)("p",{className:"text-[9px] text-muted/50 uppercase tracking-[0.2em]",children:"Explore"})}),(0,s.jsxs)("div",{className:"divide-y divide-border/40",children:[(0,s.jsxs)(_(),{href:lm,onClick:()=>sa(!1),className:"flex items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsx)("span",{className:"text-sm text-cream",children:"Shop"}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]}),(0,s.jsxs)(_(),{href:"/leaderboard",onClick:()=>sa(!1),className:"flex items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsx)("span",{className:"text-sm text-cream",children:"Leaderboard"}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]}),ej.S&&(0,s.jsxs)(_(),{href:"/towns",onClick:()=>sa(!1),className:"flex items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsx)("span",{className:"text-sm text-cream",children:"Towns"}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]})]}),(0,s.jsx)("div",{className:"px-5 pt-5 pb-1",children:(0,s.jsx)("p",{className:"text-[9px] text-muted/50 uppercase tracking-[0.2em]",children:"Community"})}),(0,s.jsxs)("div",{className:"divide-y divide-border/40",children:[(0,s.jsxs)("a",{href:"https://discord.gg/2bTjFAkny7",target:"_blank",rel:"noopener noreferrer",onClick:()=>sa(!1),className:"flex items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 text-sm text-cream",children:[(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"
1currentColor",className:"text-[#5865F2] shrink-0",children:(0,s.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.095 2.157 2.42 0 1.333-.947 2.418-2.157 2.418z"})}),"Discord",null!=aS&&(0,s.jsxs)("span",{className:"text-[10px] text-muted",children:[aS.toLocaleString()," members"]})]}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]}),(0,s.jsxs)("a",{href:"https://github.com/srizzon/git-city",target:"_blank",rel:"noopener noreferrer",onClick:()=>sa(!1),className:"flex items-center justify-between px-5 py-3.5 active:bg-white/5",children:[(0,s.jsxs)("span",{className:"flex items-center gap-2 text-sm text-cream",children:[(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",className:"text-cream shrink-0",children:(0,s.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"})}),"GitHub",null!=aN&&(0,s.jsxs)("span",{className:"text-[10px] text-muted",children:["★ ",aN.toLocaleString()]})]}),(0,s.jsx)("span",{className:"text-xs",style:{color:nb.accent},children:"→"})]})]}),(0,s.jsxs)("div",{className:"border-t border-border px-5 py-4",children:[(0,s.jsx)("p",{className:"mb-3 text-[10px] text-muted uppercase tracking-widest",children:"Theme"}),(0,s.jsx)("div",{className:"grid grid-cols-4 gap-2",children:tl.map((e,t)=>(0,s.jsx)("button",{onClick:()=>{rl(t);try{localStorage.setItem("gitcity_theme",String(t))}catch{}},className:"py-2.5 text-[10px] border-2 transition-colors",style:{borderColor:rn===t?e.accent:"var(--color-border)",color:rn===t?e.accent:"var(--color-muted)",backgroundColor:rn===t?e.accent+"18":"transparent"},children:e.name},e.name))})]}),si&&(0,s.jsx)("div",{className:"border-t border-border px-5 py-4",children:(0,s.jsx)("a",{href:"/settings",className:"text-[11px] text-muted transition-colors hover:text-cream normal-case",children:"Notification settings"})}),(0,s.jsx)("div",{className:"border-t border-border px-5 py-4",children:(0,s.jsxs)("p",{className:"text-[10px] text-muted/40 normal-case",children:["A city of ",tT.length.toLocaleString()," developers."]})})]})]}),!t5&&!rs&&!t9&&!aA&&(0,s.jsxs)("div",{className:`pointer-events-none fixed inset-0 z-20 flex flex-col items-center justify-between pt-16 pb-4 px-3 sm:py-8 sm:px-4${rt?" intro-ui-enter":""}`,style:{background:"linear-gradient(to bottom, rgba(13,13,15,0.88) 0%, rgba(13,13,15,0.55) 30%, transparent 60%, transparent 85%, rgba(13,13,15,0.5) 100%)"},children:[(0,s.jsxs)("div",{className:"pointer-events-auto flex w-full max-w-2xl flex-col items-center gap-2 sm:gap-5",children:[(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsxs)("h1",{className:`text-2xl text-cream sm:text-3xl md:text-5xl${rt?" intro-title-enter":""}`,children:["Git"," ",(0,s.jsx)("span",{style:{color:nb.accent},children:"City"})]}),(0,s.jsx)("p",{className:"mt-2 text-[10px] leading-relaxed text-cream/80 normal-case",children:rB.total_developers>
10?`A city of ${rB.total_developers.toLocaleString()} GitHub developers. Find yourself.`:"A global city of GitHub developers. Find yourself."}),(0,s.jsxs)("p",{className:"pointer-events-auto mt-1 text-[9px] text-cream/50 normal-case hidden sm:block",children:["built by"," ",(0,s.jsx)("a",{href:"https://x.com/samuelrizzondev",target:"_blank",rel:"noopener noreferrer",className:"transition-colors hover:text-cream",style:{color:nb.accent},children:"@samuelrizzondev"})]})]}),(0,s.jsx)("div",{className:"hidden sm:flex sm:justify-center w-full",children:tw?.mode==="live"?(0,s.jsx)(e4,{accentColor:nb.accent,shadowColor:nb.shadow,participants:e0?.participants??0,onJoin:()=>{rZ(null),t3(!0),rD({score:0,earned:0,combo:0,collected:0,maxCombo:1}),rA.current=Date.now(),rO.current=0,rF.current=0,rH(0)}}):(()=>{let e=[1e4,2e4,5e4,1e5],t=rB.total_developers;if(t<=0)return null;let r=e.find(e=>t<e);if(!r)return null;let a=e[e.indexOf(r)-1]??0,n=(t-a)/(r-a)*100,l=r-t,i=r>=1e3?`${r/1e3}K`:r.toLocaleString();return(0,s.jsx)("div",{className:"w-full max-w-sm",children:(0,s.jsxs)("div",{className:"border-[2px] border-border bg-bg/80 px-4 py-3 backdrop-blur-sm",children:[(0,s.jsxs)("div",{className:"mb-2 flex items-baseline justify-between",children:[(0,s.jsxs)("span",{className:"text-[9px] tracking-wider",style:{color:nb.accent},children:["ROAD TO ",i]}),(0,s.jsxs)("span",{className:"text-[9px] text-cream/60",children:[l.toLocaleString()," to go"]})]}),(0,s.jsx)("div",{className:"relative h-2.5 w-full overflow-hidden border-[2px] border-border bg-bg",children:(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 transition-all duration-1000",style:{width:`${n}%`,backgroundColor:nb.accent,boxShadow:`0 0 8px ${nb.accent}60`}})}),(0,s.jsxs)("div",{className:"mt-2 flex items-baseline justify-between",children:[(0,s.jsxs)("span",{className:"text-[10px] text-cream",children:[t.toLocaleString()," ",(0,s.jsxs)("span",{className:"text-cream/40",children:["/ ",r.toLocaleString()]})]}),(0,s.jsxs)("span",{className:"text-[8px] text-cream/40 normal-case",children:["Something unlocks at ",i,"..."]})]})]})})})()}),a2&&!si?(0,s.jsxs)("div",{className:"flex w-full max-w-md flex-col items-center gap-2 border-[3px] bg-bg-raised/90 px-5 py-4 backdrop-blur-sm animate-[slide-up_0.3s_ease-out]",style:{borderColor:nb.accent},children:[(0,s.jsx)("p",{className:"text-[11px] text-cream normal-case leading-relaxed",children:"Find your building in the city"}),(0,s.jsx)("button",{onClick:()=>{a5(!1),localStorage.setItem("gitcity_welcome_seen","true"),nH()},className:"btn-press w-full max-w-60 py-2.5 text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`3px 3px 0 0 ${nb.shadow}`},children:"Sign in with GitHub"}),(0,s.jsx)("button",{onClick:()=>{a5(!1),localStorage.setItem("gitcity_welcome_seen","true"),setTimeout(()=>a3.current?.focus(),100)},className:"text-[9px] text-dim transition-colors hover:text-muted normal-case",children:"or type your username"})]}):(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ll()},className:"flex w-full max-w-md items-center gap-2",children:[(0,s.jsx)("input",{ref:a3,type:"text",value:tS,onChange:e=>{tC(e.target.value),t1?.type==="error"&&t2(null)},placeholder:si?"search any GitHub username":"type your GitHub username",className:"min-w-0 flex-1 border-[3px] border-border bg-bg-raised px-3 py-2 text-base sm:text-xs text-cream outline-none transition-colors placeholder:text-dim sm:px-4 sm:py-2.5",style:{borderColor:void 0},onFocus:e=>e.currentTarget.style.borderColor=nb.accent,onBlur:e=>e.currentTarget.style.borderColor=""}),(0,s.jsx)("button",{type:"submit",disabled:tX||!tS.trim(),className:"btn-press shrink-0 px-4 py-2 text-xs text-bg disabled:opacity-40 sm:px-5 sm:py-2.5",style:{backgroundColor:nb.accent,boxShadow:`4px 4px 0 0 ${nb.shadow}`},children:tX?(0,s.jsx)("span",{className:"blink-dot inline-block",children:"_"}):"Search"})]}),(0,s.jsx)(tj,{feedback:t1,accentColor:nb.accent,onDismiss:()=>t2(null),onRetry:ll}),5===($=new Date).getUTCDay()&&13===$.getUTCDate()&&(0,s.jsxs)("div",{className:"flex items-center gap-2 border-2 border-red-500/40 bg-red-950/30 px-3 py-1.5 sm:px-4 sm:py-2",children:[(0,s.jsx)("span",{className:"text-sm shrink-0",children:"\uD83D\uDC80"}),(0,s.jsx)("span",{className:"font-silkscreen text-[9px] sm:text-[10px] uppercase tracking-wider text-red-400 whitespace-nowrap",children:"Friday the 13th"}),(0,s.jsx)("span",{className:"text-[9px] text-red-400/40",children:"|"}),(0,s.jsx)("span",{className:"text-[9px] sm:text-[10px] text-orange-300/80 whitespace-nowrap",children:"Unlimited battles, no cooldowns"})]})]}),tT.length>0&&(0,s.jsxs)("div",{className:"pointer-events-auto flex flex-col items-center gap-2 sm:gap-3",children:[lh&&(0,s.jsx)("button",{onClick:lu,disabled:sg,className:"gift-cta btn-press px-7 py-3 text-xs sm:py-3.5 sm:text-sm text-bg disabled:opacity-60",style:{backgroundColor:nb.accent,"--gift-glow-color":nb.accent+"66","--gift-shadow-color":nb.shadow},children:sg?"Opening...":"\uD83C\uDF81 Open Free Gift!"}),(0,s.jsxs)("div",{className:"grid w-full max-w-md grid-cols-2 gap-3 sm:gap-4",children:[(0,s.jsxs)("button",{onClick:()=>ra(!0),className:"btn-press flex h-full w-full flex-col items-center justify-center px-4 py-3 text-center text-xs sm:py-3.5 sm:text-sm text-bg",style:{backgroundColor:nb.accent,boxShadow:`4px 4px 0 0 ${nb.shadow}`},children:["Explore City",(0,s.jsx)("span",{className:"block text-[8px] opacity-60 normal-case",children:"Browse Buildings"})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("button",{onClick:()=>{rZ(null),t3(!0),rD({score:0,earned:0,combo:0,collected:0,maxCombo:1}),rA.current=Date.now(),rO.current=0,rF.current=0,rH(0);try{rP(parseInt(localStorage.getItem("gitcity_fly_pb")||"0",10)||0)}catch{rP(0)}},className:"btn-press flex h-full w-full flex-col items-center justify-center px-4 py-3 text-center text-xs sm:py-3.5 sm:text-sm text-bg",style:{backgroundColor:nb.accent,boxShadow:`4px 4px 0 0 ${nb.shadow}`},children:["Fly",(0,s.jsx)("span",{className:"block text-[8px] opacity-60 normal-case",children:"Collect PX"})]}),(0,s.jsx)(J,{}),a9&&(0,s.jsx)("div",{className:"absolute bottom-full left-1/2 z-30 mb-3 -translate-x-1/2 animate-[fade-in_0.3s_ease-out]",children:(0,s.jsxs)("div",{className:"relative w-64 border-2 border-border bg-bg-raised px-4 py-3 text-center backdrop-blur-sm",style:{borderColor:nb.accent+"60"},children:[(0,s.jsx)("p",{className:"text-[10px] leading-relaxed text-cream normal-case",children:"Fly over your city. Collect coins. Compete on the daily leaderboard."}),(0,s.jsx)("button",{onClick:()=>{ne(!1),clearTimeout(na.current);try{localStorage.setItem("gitcity_fly_hint_seen","1")}catch{}},className:"mt-2 px-3 py-1 text-[9px] text-bg",style:{backgroundColor:nb.accent},children:"Got it"}),(0,s.jsx)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-x-[6px] border-t-[6px] border-x-trans
1parent",style:{borderTopColor:nb.accent+"60"}})]})})]})]}),a6&&(0,s.jsxs)("div",{className:"animate-[slide-up_0.3s_ease-out] flex items-center gap-2",children:[(0,s.jsxs)("button",{onClick:()=>{a7(!1),clearTimeout(ns.current),rZ(null),t3(!0),rD({score:0,earned:0,combo:0,collected:0,maxCombo:1}),rA.current=Date.now(),rO.current=0,rF.current=0,rH(0);try{rP(parseInt(localStorage.getItem("gitcity_fly_pb")||"0",10)||0)}catch{rP(0)}},className:"btn-press flex items-center gap-2 border-2 bg-bg/80 px-4 py-1.5 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",style:{borderColor:nb.accent+"60",color:nb.accent},children:[(0,s.jsx)("span",{className:"normal-case",children:"Today's challenge is live"}),(0,s.jsx)("span",{children:"Play →"})]}),(0,s.jsx)("button",{onClick:()=>{a7(!1),clearTimeout(ns.current)},className:"text-[10px] text-muted transition-colors hover:text-cream",children:"✕"})]}),(0,s.jsxs)("div",{className:"hidden sm:flex items-center justify-center gap-2",children:[(0,s.jsx)(_(),{href:lm,className:"btn-press border-[3px] border-border bg-bg/80 px-4 py-1.5 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",style:{color:nb.accent},children:"Shop"}),(0,s.jsx)(_(),{href:"/leaderboard",className:"btn-press border-[3px] border-border bg-bg/80 px-4 py-1.5 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",style:{color:nb.accent},children:"♛ Leaderboard"}),ej.S&&(0,s.jsx)(_(),{href:"/towns",className:"btn-press border-[3px] border-border bg-bg/80 px-4 py-1.5 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",style:{color:nb.accent},children:"⚑ Towns"})]}),(0,s.jsx)("div",{className:"hidden sm:flex items-center justify-center gap-2",children:si?(0,s.jsxs)(s.Fragment,{children:[lp&&(0,s.jsx)("button",{onClick:ld,disabled:sc,className:"btn-press px-3 py-1.5 text-[10px] text-bg disabled:opacity-40",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:sc?"...":"Claim"}),(0,s.jsxs)(_(),{href:`/dev/${ny}`,className:"flex items-center gap-1.5 border-[3px] border-border bg-bg/80 px-3 py-1.5 text-[10px] text-cream normal-case backdrop-blur-sm transition-colors hover:border-border-light",style:lb&&lb.streak>0&&lb.checked_in?{animation:"streak-pulse 1.5s ease-in-out 2"}:void 0,children:["@",ny,lb&&lb.streak>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5",style:{color:tN(lb.streak)},children:[(0,s.jsx)("span",{className:"text-[9px] leading-none",children:"\uD83D\uDD25"}),(0,s.jsx)("span",{className:"font-bold",children:lb.streak})]})]}),(0,s.jsx)("a",{href:"/settings",className:"border-2 border-border bg-bg/80 px-2 py-1 text-[9px] text-muted backdrop-blur-sm transition-colors hover:text-cream hover:border-border-light",children:"Settings"}),(0,s.jsx)("button",{onClick:lc,className:"border-2 border-border bg-bg/80 px-2 py-1 text-[9px] text-muted backdrop-blur-sm transition-colors hover:text-cream hover:border-border-light",children:"Sign Out"})]}):(0,s.jsxs)("button",{onClick:nH,className:"btn-press flex items-center gap-1.5 border-[3px] border-border bg-bg/80 px-3 py-1.5 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"G"}),(0,s.jsx)("span",{className:"text-cream",children:"Sign in"})]})})]}),(0,s.jsx)("div",{className:"pointer-events-auto flex w-full items-end justify-end",children:tT.length>0&&(0,s.jsx)(tk,{buildings:tT,accent:nb.accent})})]}),!t5&&!rs&&!t9&&!aA&&tT.length>0&&(0,s.jsxs)("nav",{className:"pointer-events-auto fixed inset-x-0 bottom-0 z-35 hidden items-center justify-around border-t-2 border-border bg-bg/95 px-1 py-2 backdrop-blur-md sm:hidden",children:[(0,s.jsx)(_(),{href:lm,className:"btn-press border-2 border-border px-3 py-1.5 text-[10px] transition-colors active:bg-white/5",style:{color:nb.accent},children:"Shop"}),(0,s.jsxs)("button",{onClick:()=>{si?window.location.href="/arcade":((0,ey.A5)(),aR(!0))},className:"btn-press relative border-2 border-border px-3 py-1.5 text-[10px] transition-colors active:bg-white/5",style:{color:nb.accent},children:["Lobby",aM>0&&(0,s.jsx)("span",{className:"absolute -top-1.5 -right-1.5 rounded-full px-1 py-px text-[7px] font-bold leading-none text-bg",style:{backgroundColor:nb.accent},children:aM})]}),(0,s.jsx)(_(),{href:"/leaderboard",className:"btn-press border-2 border-border px-3 py-1.5 text-[10px] transition-colors active:bg-white/5",style:{color:nb.accent},children:"♛ Rank"}),si?(0,s.jsxs)(s.Fragment,{children:[lp&&(0,s.jsx)("button",{onClick:ld,disabled:sc,className:"btn-press px-3 py-1.5 text-[10px] text-bg disabled:opacity-40",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:sc?"...":"Claim"}),(0,s.jsxs)(_(),{href:`/dev/${ny}`,className:"btn-press flex items-center gap-1 border-2 border-border px-3 py-1.5 text-[10px] text-cream normal-case transition-colors active:bg-white/5",children:["@",ny.length>8?ny.slice(0,7)+"…":ny,lb&&lb.streak>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5",style:{color:tN(lb.streak)},children:[(0,s.jsx)("span",{className:"text-[8px]",children:"\uD83D\uDD25"}),(0,s.jsx)("span",{className:"font-bold",children:lb.streak})]})]})]}):(0,s.jsxs)("button",{onClick:nH,className:"btn-press border-2 border-border px-3 py-1.5 text-[10px] transition-colors active:bg-white/5",children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"G"})," ",(0,s.jsx)("span",{className:"text-cream",children:"Sign in"})]})]}),su&&(0,s.jsx)("div",{className:"fixed top-16 left-1/2 z-50 -translate-x-1/2",children:(0,s.jsx)("div",{className:"border-[3px] px-5 py-2.5 text-[10px] text-bg",style:{backgroundColor:nb.accent,borderColor:nb.shadow},children:"Item purchased! Effect applied to your building."})}),ls&&(0,s.jsx)("div",{className:"fixed top-16 left-1/2 z-50 -translate-x-1/2",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 border-[3px] px-5 py-2.5 text-[10px] text-bg",style:{backgroundColor:nb.accent,borderColor:nb.shadow},children:[(0,s.jsx)("span",{className:"text-base",children:"\uD83C\uDF81"}),(0,s.jsxs)("span",{children:[E.fH[ls.item]??ls.item," sent to ",ls.to,"!"]})]})}),aq&&!si&&(0,s.jsx)("div",{className:"fixed top-20 left-1/2 z-50 -translate-x-1/2 w-[calc(100%-1.5rem)] max-w-xs animate-[slide-up_0.2s_ease-out]",children:(0,s.jsxs)("div",{className:"border-[3px] border-border bg-bg-raised/95 px-4 py-3 backdrop-blur-sm",children:[(0,s.jsx)("p",{className:"text-[10px] text-cream normal-case mb-2.5 leading-relaxed",children:"Sign in to give Kudos, battle buildings, and claim yours"}),(0,s.jsx)("button",{onClick:()=>{(0,ey.lM)(),aQ(!1),nH()},className:"btn-press w-full py-2 text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"Sign in with GitHub"}),(0,s.jsx)("button",{onClick:()=>aQ(!1),className:"mt-1.5 w-full py-1 text-[8px] text-dim transition-colors hover:text-muted",children:"Maybe later"})]})}),a0&&(0,s.jsx)("div",{className:"fixed top-16 left-1/2 z-50 -translate-x-1/2 animate-[fade-in_0.15s_ease-out]",children:(0,s.jsxs)("div",{className:"border-[3px] px-5 py-2.5 text-[10px] text-bg",style:{backgroundColor:nb.accent,borderColor:nb.shadow},children:["Opening ",a0,"→"]})}),ni&&(0,s.jsx)("div",{className:"fixed top-20 left-1/2 z-50 -translate-x-1/2 w-[calc(100%-1.5rem)] max-w-xs animate-[slide-up_0.2s_ease-out]",children:(0,s.jsxs)("div",{className:"border-[3px] bg-bg-raised/95 px-4 py-3 backdrop-blur-sm",style:{borderColor:nb.accent},children:[(0,s.jsx)("p",{className:"text-[10px] text-cream normal-case mb-2 leading-relaxed",children:"Unlock effects for your building"}),(0,s.jsx)("p",{className:"text-[8px] text-muted normal-case mb-2.5",children:"Neon Outline, Particle Aura, Spotlight, and more"}),(0,s.jsxs)(_(),{href:lx?.claimed?`/shop/${ni}/customize`:`/dev/${ni}`,onClick:()=>no(null),className:"btn-press block w-full py-2 text-center text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:[lx?.claimed?"Customize":"Claim & Customize","→"]}),(0,s.jsx)("button",{onClick:()=>no(null),className:"mt-1.5 w-full py-1 text-[8px] text-dim transition-colors hover:text-muted",children:"Dismiss"})]})}),lb?.streak_reward&&lb.checked_in&&(0,s.jsx)("div",{className:"fixed top-20 left-1/2 z-50 -translate-x-1/2 w-[calc(100%-1.5rem)] max-w-xs animate-[slide-up_0.2s_ease-out]",children:(0,s.jsxs)("div",{className:"border-[3px] bg-bg-raised/95 px-4 py-3 backdrop-blur-sm text-center",style:{borderColor:nb.accent},children:[(0,s.jsx)("p",{className:"text-lg mb-1",children:"\uD83C\uDF81"}),(0,s.jsxs)("p",{className:"text-[10px] text-cream normal-case mb-1 font-bold",children:[lb.streak_reward.milestone,"-day streak reward!"]}),(0,s.jsxs)("p",{className:"text-[9px] normal-case mb-2",style:{color:nb.accent},children:["You unlocked ",lb.streak_reward.item_name]}),(0,s.jsx)(_(),{href:`/shop/${ny}/customize`,className:"btn-press block w-full py-1.5 text-center text-[9px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"Equip now →"})]})}),sp&&(!t5||rN)&&!s7&&"idle"===nc.phase&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"pointer-events-none fixed bottom-6 right-6 z-30 hidden text-right text-[9px] leading-loose text-muted sm:block",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Drag"})," move"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Right-drag"})," rotate"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-cream",children:"Scroll"})," zoom"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"ESC"})," close"]})]}),(0,s.jsx)("div",{className:"pointer-events-auto fixed z-40 bottom-0 left-0 right-0 sm:bottom-auto sm:left-auto sm:right-5 sm:top-1/2 sm:-translate-y-1/2",children:(0,s.jsxs)("div",{className:"relative border-t-[3px] border-border bg-bg-raised/95 backdrop-blur-sm w-full max-h-[50vh] overflow-y-auto sm:w-[320px] sm:border-[3px] sm:max-h-[85vh] animate-[slide-up_0.2s_ease-out] sm:animate-none",children:[(0,s.jsx)("button",{onClick:()=>{sm(null),rZ(null)},className:"absolute top-2 right-3 text-[10px] text-muted transition-colors hover:text-cream z-10",children:"ESC"}),(0,s.jsx)("div",{className:"flex justify-center py-2 sm:hidden",children:(0,s.jsx)("div",{className:"h-1 w-10 rounded-full bg-border"})}),(P=(0,S.$P)(sp.xp_level??1),(0,s.jsxs)("div",{className:"relative px-4 pb-3 pt-3 sm:pt-4",style:{background:`linear-gradient(135deg, ${P.color}1c 0%, ${P.color}06 55%, transparent 100%)`}
1,children:[(0,s.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)",backgroundSize:"8px 8px"}}),(0,s.jsxs)("div",{className:"relative flex items-center gap-3",children:[sp.avatar_url&&(0,s.jsx)("div",{className:"shrink-0 border-2 p-0.5",style:{borderColor:P.color,backgroundColor:`${P.color}14`},children:(0,s.jsx)(k.default,{src:sp.avatar_url,alt:sp.login,width:44,height:44,className:"border border-border",style:{imageRendering:"pixelated"}})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[sp.name&&(0,s.jsx)("p",{className:"truncate text-sm text-cream",children:sp.name}),sp.claimed&&(0,s.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 border border-border-light bg-bg/40 px-1.5 py-0.5 text-[7px] text-muted",children:[(0,s.jsx)("span",{className:"h-1 w-1",style:{backgroundColor:nb.accent}}),"Claimed"]})]}),(0,s.jsxs)("p",{className:"truncate text-[10px] text-muted",children:["@",sp.login]}),sp.active_raid_tag&&(0,s.jsxs)("p",{className:"text-[8px] text-red-400",children:["Attacked by @",sp.active_raid_tag.attacker_login]})]})]})]})),(A=(0,S.$P)(sp.xp_level??1),O=(0,S.fI)(sp.xp_level??1),F=(0,S.KH)(sp.xp_total??0),U=(sp.xp_total??0)-(0,S.UU)(sp.xp_level??1),G=(0,S.UU)((sp.xp_level??1)+1)-(0,S.UU)(sp.xp_level??1),(0,s.jsxs)("div",{className:"mx-4 mb-2.5 mt-1 flex items-center gap-2.5",children:[(0,s.jsx)("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center border-2 text-xs font-bold",style:{borderColor:A.color,color:A.color,backgroundColor:`${A.color}10`},children:sp.xp_level??1}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,s.jsxs)("span",{className:"truncate text-[10px] font-bold text-cream",children:["Lv ",sp.xp_level??1," \xb7 ",O.title]}),(0,s.jsx)("span",{className:"shrink-0 px-1 py-px text-[7px] font-bold tracking-wider",style:{backgroundColor:A.color+"22",color:A.color},children:A.name.toUpperCase()})]}),(0,s.jsx)("div",{className:"mt-1 h-1.5 w-full bg-border",children:(0,s.jsx)("div",{className:"h-full",style:{width:`${Math.max(2,Math.round(100*F))}%`,backgroundColor:A.color}})}),(0,s.jsxs)("div",{className:"mt-0.5 text-[7px] text-dim",children:[U.toLocaleString()," / ",G.toLocaleString()," XP"]})]})]})),sp.district&&(0,s.jsx)("div",{className:"px-4 pb-2.5",children:(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 border border-border-light px-2 py-1 text-[8px] text-cream",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 shrink-0",style:{backgroundColor:w.KG[sp.district]??"#888"}}),w.O8[sp.district]??sp.district]})}),s5&&Q.dG.some(e=>s5[e])&&(0,s.jsxs)("div",{className:"mx-4 mb-3",children:[(0,s.jsx)("div",{className:"mb-1.5 text-[7px] tracking-widest text-dim",children:"LINKS"}),(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:Q.dG.map(e=>s5[e]?(0,s.jsx)(q.a4,{name:e,href:s5[e],size:24,hoverColor:nb.accent},e):null)})]}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-px bg-border/30 mx-4 mb-3 border border-border/50",children:[{label:"Rank",value:`#${sp.rank}`},{label:"Contribs",value:sp.contributions.toLocaleString()},{label:"Repos",value:sp.public_repos.toLocaleString()},{label:"Stars",value:sp.total_stars.toLocaleString()},{label:"+1s",value:(sp.kudos_count??0).toLocaleString()},{label:"Visits",value:(sp.visit_count??0).toLocaleString()}].map(e=>(0,s.jsxs)("div",{className:"bg-bg-card p-2 text-center",children:[(0,s.jsx)("div",{className:"text-xs",style:{color:nb.accent},children:e.value}),(0,s.jsx)("div",{className:"text-[8px] text-muted mt-0.5",children:e.label})]},e.label))}),sp.achievements&&sp.achievements.length>0&&(0,s.jsxs)("div",{className:"mx-4 mb-3",children:[(0,s.jsxs)("div",{className:"mb-1.5 text-[7px] tracking-widest text-dim",children:["TROPHIES \xb7 ",sp.achievements.length]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:[...sp.achievements].sort((e,t)=>
1{let r=["diamond","gold","silver","bronze"];return r.indexOf(to[e]??"bronze")-r.indexOf(to[t]??"bronze")}).slice(0,3).map(e=>{let t=to[e]??"bronze",r=ti[t]??"#a0a0b0";return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 border-2 bg-bg-card px-1.5 py-1 text-[8px] text-cream",style:{borderColor:`${r}55`},children:[(0,s.jsx)(L.A,{tier:t,size:11}),tc[e]??e.replace(/_/g," ")]},e)})})]}),sp.active_drop&&(H=sp.active_drop,W=(B={common:"#00ff88",rare:"#0088ff",epic:"#aa00ff",legendary:"#ffaa00"})[H.rarity]??B.common,Y=sR[H.id],Z=H.pull_count>=H.max_pulls,(0,s.jsxs)("div",{className:"mx-4 mb-3 border-2 p-3",style:{borderColor:W,backgroundColor:`${W}10`},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-[11px] font-bold",style:{color:W},children:"DROP FOUND!"}),(0,s.jsxs)("span",{className:"text-[9px] text-muted",children:[H.pull_count,"/",H.max_pulls," pulled"]})]}),(0,s.jsxs)("div",{className:"text-[10px] text-cream mb-2",children:["+",H.points," pts ",(0,s.jsxs)("span",{className:"text-muted capitalize",children:["(",H.rarity,")"]})]}),Y?(0,s.jsxs)("div",{className:"text-[10px] text-center py-1.5",style:{color:W},children:["Already pulled +",Y.points," pts"]}):Z?(0,s.jsxs)("div",{className:"text-[10px] text-center py-1.5 text-muted",children:["Fully pulled (",H.max_pulls,"/",H.max_pulls,")"]}):(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>nW(H.id),disabled:sL,className:"btn-press flex-1 py-1.5 text-[10px] text-bg",style:{backgroundColor:W,boxShadow:`2px 2px 0 0 ${W}66`},children:sL?"Pulling...":"Pull"}),(0,s.jsx)("a",{href:`https://x.com/intent/tweet?text=${encodeURIComponent(`just pulled a ${H.rarity} drop in Git City 👀 how many are you walking past?`)}&url=${encodeURIComponent("https://thegitcity.com")}`,target:"_blank",rel:"noopener noreferrer",className:"btn-press border-2 px-3 py-1.5 text-[10px] transition-colors hover:border-border-light",style:{borderColor:`${W}66`,color:W},children:"Share"})]})]})),sp.login.toLowerCase()!==ny&&(()=>{let e=[];for(let t of(sp.loadout?.crown&&e.push(sp.loadout.crown),sp.loadout?.roof&&e.push(sp.loadout.roof),sp.loadout?.aura&&e.push(sp.loadout.aura),["custom_color","billboard","led_banner"]))sp.owned_items.includes(t)&&e.push(t);if(0===e.length)return null;let t=e.slice(0,3),r=e.length-3;return(0,s.jsxs)("div",{className:"mx-4 mb-3 border-2 p-2.5",style:{borderColor:`${nb.accent}33`,backgroundColor:`${nb.accent}08`},children:[(0,s.jsx)("div",{className:"mb-1.5 text-[7px] tracking-widest text-dim",children:"EQUIPPED"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5",children:[t.map(e=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[9px] text-warm",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 shrink-0",style:{backgroundColor:nb.accent}}),E.fH[e]??e]},e)),r>0&&(0,s.jsxs)("span",{className:"text-[9px] text-muted",children:["+",r," more"]})]}),si&&(0,s.jsx)(_(),{href:"/shop",className:"btn-press mt-2 block w-full py-1.5 text-center text-[9px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"Get this look →"})]})})(),sp.login.toLowerCase()!==ny?(0,s.jsxs)("div",{className:"relative mx-4 mb-3",children:[sC&&(0,s.jsx)("div",{className:"pointer-events-none absolute inset-0 z-10 overflow-visible",children:Array.from({length:6}).map((e,t)=>(0,s.jsx)("span",{className:"kudos-float absolute h-2 w-2",style:{left:`${15+14*t}%`,animationDelay:`${.08*t}s`,backgroundColor:[nb.accent,"#ffd700","#4ade80","#e8dcc8",nb.accent,"#ffd700"][t]}},t))}),"idle"===nc.phase&&nc.error&&(0,s.jsx)("p",{className:"mb-1.5 text-center text-[10px] text-red-400",children:nc.error}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-1.5",children:[(0,s.jsxs)("button",{onClick:si?nB:()=>{(0,ey.jd)("kudos"),nH()},disabled:!!si&&(s_||sC||!!sT),title:"Free, 5 per day",className:"btn-press border-2 bg-bg-card p-2.5 text-center transition-colors",style:{borderColor:`${sC?"#39d353":nb.accent}66`},children:[(0,s.jsx)("div",{className:"flex items-center justify-center gap-1.5 text-xs font-bold",style:{color:sT?"#ff4444":sC?"#39d353":nb.accent},children:si&&s_?(0,s.jsx)("span",{className:"animate-pulse",children:"..."}):si&&sT?(0,s.jsx)("span",{className:"text-[9px]",children:sT}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(K,{filled:!0,size:14,color:sC?"#39d353":nb.accent}),(0,s.jsx)("span",{children:si&&sC?"+1 sent!":"+1"})]})}),(0,s.jsx)("div",{className:"mt-0.5 text-[7px] text-muted",children:si?"free \xb7 5/day":"sign in"})]}),(0,s.jsxs)("button",{onClick:si?()=>{ny&&sp&&nd.startPreview(sp.login,tT,ny)}:()=>{(0,ey.jd)("raid"),nH()},disabled:!!si&&nc.loading,className:"btn-press border-2 border-red-500/40 bg-bg-card p-2.5 text-center transition-colors hover:border-red-500/70 hover:bg-red-500/5",children:[(0,s.jsx)("div",{className:"text-xs font-bold text-red-400",children:si&&nc.loading?"...":"Battle"}),(0,s.jsx)("div",{className:"mt-0.5 text-[7px] text-muted",children:si?"win +50 XP":"sign in"})]}),(0,s.jsx)("button",{onClick:si?nX:()=>{(0,ey.jd)("gift"),nH()},className:`btn-press border-2 border-border bg-bg-card p-2.5 text-center text-[9px] transition-colors hover:border-border-light hover:text-cream ${si?"text-cream":"text-muted"} ${t5?"col-span-2":""}`,children:"Send Gift"}),!t5&&(0,s.jsx)("button",{onClick:()=>{s6(sp),sm(null),rs||ra(!0)},className:"btn-press border-2 border-border bg-bg-card p-2.5 text-center text-[9px] text-cream transition-colors hover:border-border-light",children:"Compare"})]})]}):(0,s.jsxs)("div",{className:"mx-4 mb-3 grid grid-cols-2 gap-1.5",children:[(0,s.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(`${window.location.origin}/?ref=${ny}`),rQ(!0),setTimeout(()=>rQ(!1),2e3)},className:`btn-press border-2 bg-bg-card p-2.5 text-center transition-colors ${t5?"col-span-2":""}`,style:{borderColor:`${nb.accent}66`},children:[(0,s.jsxs)("div",{className:"flex items-center justify-center gap-1.5 text-[10px] font-bold",style:{color:nb.accent},children:[(0,s.jsx)(V.A,{currency:"pixels",size:12}),rq?"Link copied!":"Invite"]}),(0,s.jsx)("div",{className:"mt-0.5 text-[7px] text-muted",children:"earn +25 PX"})]}),!t5&&(0,s.jsx)("button",{onClick:()=>{s6(sp),sm(null),rs||ra(!0)},className:"btn-press border-2 border-border bg-bg-card p-2.5 text-center text-[9px] text-cream transition-colors hover:border-border-light",children:"Compare"})]}),sA&&!sp.active_drop&&(0,s.jsx)("div",{className:"mx-4 mb-3",children:sF?(0,s.jsxs)("div",{className:"border-2 border-yellow-500/30 bg-yellow-500/5 p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(I.l,{value:String(sG),onChange:e=>sH(e),ariaLabel:"Drop rarity",className:"flex-1",options:[{value:"common",label:"Common 10pts"},{value:"rare",label:"Rare 50pts"},{value:"epic",label:"Epic 200pts"},{value:"legendary",label:"Legendary 500pts"}]}),(0,s.jsx)(I.l,{value:String(sB),onChange:e=>sW(Number(e)),ariaLabel:"Drop duration",className:"w-24",options:[{value:"24",label:"24h"},{value:"48",label:"48h"},{value:"72",label:"72h"}]})]}
1),(0,s.jsx)("input",{type:"number",value:sY,onChange:e=>sX(Number(e.target.value)),className:"w-full border border-border bg-bg px-2 py-1 text-[9px] text-cream outline-none",placeholder:"Max pulls",min:1,max:500}),"legendary"===sG&&(0,s.jsx)(I.l,{value:String(sJ),onChange:e=>sZ(e),placeholder:"Select item reward...",ariaLabel:"Item reward",className:"w-full",options:sK.map(e=>({value:e.id,label:e.name}))}),s0&&(0,s.jsx)("p",{className:`text-[9px] ${"Planted!"===s0?"text-lime":"text-red-400"}`,children:s0}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:nY,disabled:sq||"legendary"===sG&&!sJ,className:"btn-press flex-1 py-1.5 text-[9px] text-bg disabled:opacity-50",style:{backgroundColor:"#ffaa00"},children:sq?"...":"Plant"}),(0,s.jsx)("button",{onClick:()=>{sU(!1),s1(null)},className:"border border-border px-3 py-1.5 text-[9px] text-muted hover:text-cream",children:"Cancel"})]})]}):(0,s.jsx)("button",{onClick:()=>sU(!0),className:"btn-press w-full border-2 border-yellow-500/40 py-1.5 text-[9px] text-yellow-400 transition-colors hover:border-yellow-500/70 hover:bg-yellow-500/5",children:"Plant Drop"})}),(0,s.jsx)("div",{className:"flex gap-2 p-4 pt-0 pb-5 sm:pb-4",children:sp.login.toLowerCase()===ny?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_(),{href:`/shop/${sp.login}/customize`,className:"btn-press flex-1 py-2 text-center text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"Customize"}),(0,s.jsx)(_(),{href:`/dev/${sp.login}`,className:"btn-press flex-1 border-2 border-border py-2 text-center text-[10px] text-cream transition-colors hover:border-border-light",children:"Profile"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_(),{href:`/dev/${sp.login}`,className:"btn-press flex-1 py-2 text-center text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"View Profile"}),(0,s.jsx)("a",{href:`https://github.com/${sp.login}`,target:"_blank",rel:"noopener noreferrer",className:"btn-press flex-1 border-2 border-border py-2 text-center text-[10px] text-cream transition-colors hover:border-border-light",children:"GitHub"})]})})]})})]}),s8&&!s7&&!t5&&(0,s.jsx)("div",{className:"fixed top-3 left-1/2 z-40 -translate-x-1/2 w-[calc(100%-1.5rem)] max-w-sm sm:top-4 sm:w-auto",children:(0,s.jsxs)("div",{className:"border-[3px] border-border bg-bg-raised/95 px-4 py-2.5 backdrop-blur-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,s.jsx)("span",{className:"blink-dot h-2 w-2 shrink-0",style:{backgroundColor:nb.accent}}),(0,s.jsxs)("span",{className:"text-[10px] text-cream normal-case truncate min-w-0",children:["Comparing ",(0,s.jsxs)("span",{style:{color:nb.accent},children:["@",s8.login]})]}),(0,s.jsx)("button",{onClick:()=>{sm(s8),rZ(s8.login),s6(null)},className:"ml-1 shrink-0 text-[9px] text-muted transition-colors hover:text-cream",children:"Cancel"})]}),ar&&(0,s.jsx)("p",{className:"mt-1 text-[9px] normal-case",style:{color:"#f85149"},children:"Pick a different building to compare"}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),ll()},className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)("input",{type:"text",value:tS,onChange:e=>{tC(e.target.value),t1?.type==="error"&&t2(null)},placeholder:"search username to compare",className:"min-w-0 flex-1 border-2 border-border bg-bg px-2.5 py-1.5 text-base sm:text-[10px] text-cream outline-none transition-colors placeholder:text-dim",onFocus:e=>e.currentTarget.style.borderColor=nb.accent,onBlur:e=>e.currentTarget.style.borderColor="",autoFocus:!0}),(0,s.jsx)("button",{type:"submit",disabled:tX||!tS.trim(),className:"btn-press shrink-0 px-3 py-1.5 text-[10px] text-bg disabled:opacity-40",style:{backgroundColor:nb.accent},children:tX?"_":"Go"})]}),t1&&(0,s.jsx)("div",{className:"mt-1.5",children:(0,s.jsx)(tj,{feedback:t1,accentColor:nb.accent,onDismiss:()=>t2(null),onRetry:ll})})]})}),!ae&&s7&&(ea=0,en=0,el=[{label:"Rank",key:"rank",invert:!0},{label:"Contributions",key:"contributions"},{label:"Stars",key:"total_stars"},{label:"Repos",key:"public_repos"},{label:"+1s",key:"kudos_count"}].map(e=>{let t=s7[0][e.key]??0,r=s7[1][e.key]??0,s=!1,a=!1;return e.invert?(s=t>0&&(t<r||0===r),a=r>0&&(r<t||0===t)):(s=t>r,a=r>t),s&&ea++,a&&en++,{...e,a:t,b:r,aW:s,bW:a}}),ei=ea===en,ed=ea>en?s7[0].login:s7[1].login,ew=ei?`Tie ${ea}-${en}`:`@${ed} wins ${Math.max(ea,en)}-${Math.min(ea,en)}`,ek=()=>
1{sm(s7[0]),rZ(s7[0].login),s9(null),s6(null)},(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"pointer-events-auto fixed z-40 bottom-0 left-0 right-0 sm:bottom-auto sm:right-auto sm:left-1/2 sm:top-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2",children:(0,s.jsxs)("div",{className:"relative border-t-[3px] border-border bg-bg-raised/95 backdrop-blur-sm w-full sm:w-95 sm:border-[3px] sm:max-h-[85vh] sm:overflow-y-auto max-h-[45vh] overflow-y-auto animate-[slide-up_0.2s_ease-out] sm:animate-none",children:[(0,s.jsx)("div",{className:"flex justify-center py-2 sm:hidden",onTouchStart:e=>{e.currentTarget._touchY=e.touches[0].clientY},onTouchEnd:e=>{let t=e.currentTarget._touchY;null!=t&&e.changedTouches[0].clientY-t>50&&ek()},children:(0,s.jsx)("div",{className:"h-1 w-10 rounded-full bg-border"})}),(0,s.jsxs)("div",{className:"flex items-start justify-center gap-5 px-5 pt-1 pb-4 sm:pt-4",children:[(0,s.jsxs)(_(),{href:`/dev/${s7[0].login}`,className:"flex flex-col items-center gap-1.5 group w-27.5",children:[s7[0].avatar_url&&(0,s.jsx)(k.default,{src:s7[0].avatar_url,alt:s7[0].login,width:56,height:56,className:"border-[3px] transition-colors group-hover:brightness-110",style:{imageRendering:"pixelated",borderColor:ea>=en?nb.accent:"#3a3a40"}}),(0,s.jsxs)("p",{className:"truncate text-[10px] text-cream normal-case max-w-27.5 transition-colors group-hover:text-white",children:["@",s7[0].login]}),(0,s.jsx)("p",{className:"text-[8px] text-muted normal-case text-center",children:tu(s7[0].login)})]}),(0,s.jsx)("span",{className:"text-base shrink-0 pt-4",style:{color:nb.accent},children:"VS"}),(0,s.jsxs)(_(),{href:`/dev/${s7[1].login}`,className:"flex flex-col items-center gap-1.5 group w-27.5",children:[s7[1].avatar_url&&(0,s.jsx)(k.default,{src:s7[1].avatar_url,alt:s7[1].login,width:56,height:56,className:"border-[3px] transition-colors group-hover:brightness-110",style:{imageRendering:"pixelated",borderColor:en>=ea?nb.accent:"#3a3a40"}}),(0,s.jsxs)("p",{className:"truncate text-[10px] text-cream normal-case max-w-27.5 transition-colors group-hover:text-white",children:["@",s7[1].login]}),(0,s.jsx)("p",{className:"text-[8px] text-muted normal-case text-center",children:tu(s7[1].login)})]})]}),(0,s.jsx)("div",{className:"mx-4 border-[2px] border-border bg-bg-card",children:el.map((e,t)=>(0,s.jsxs)("div",{className:`flex items-center py-2 px-3 ${t<el.length-1?"border-b border-border/40":""}`,children:[(0,s.jsx)("span",{className:"w-[72px] text-right text-[11px] tabular-nums",style:{color:e.aW?nb.accent:e.bW?"#555":"#888"},children:"rank"===e.key?e.a>0?`#${e.a}`:"-":e.a.toLocaleString()}),(0,s.jsx)("span",{className:"flex-1 text-center text-[8px] text-muted uppercase tracking-wider",children:e.label}),(0,s.jsx)("span",{className:"w-[72px] text-left text-[11px] tabular-nums",style:{color:e.bW?nb.accent:e.aW?"#555":"#888"},children:"rank"===e.key?e.b>0?`#${e.b}`:"-":e.b.toLocaleString()})]},e.key))}),(0,s.jsx)("div",{className:"mx-4 mt-3 py-2.5 text-center text-[11px] uppercase tracking-wide",style:{backgroundColor:`${nb.accent}15`,border:`2px solid ${nb.accent}40`,color:nb.accent},children:ew}),(0,s.jsxs)("div",{className:"px-4 pt-3 pb-1 flex gap-2",children:[(0,s.jsx)("a",{href:`https://x.com/intent/tweet?text=${encodeURIComponent(`I just compared my building with ${s7[1].login}'s in Git City. It wasn't even close. What's yours?`)}&url=${encodeURIComponent(`${window.location.origin}/compare/${s7[0].login}/${s7[1].login}`)}`,target:"_blank",rel:"noopener noreferrer",className:"btn-press flex-1 py-2 text-center text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"Share on X"}),(0,s.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(`${window.location.origin}/compare/${s7[0].login}/${s7[1].login}`),ag(!0),setTimeout(()=>ag(!1),2e3)},className:"btn-press flex-1 border-[2px] border-border py-2 text-center text-[10px] text-cream transition-colors hover:border-border-light",children:ab?"Copied!":"Copy Link"})]}),(0,s.jsxs)("div",{className:"px-4 flex items-center gap-2 pb-1",children:[(0,s.jsx)("div",{className:"flex gap-0.5 shrink-0",children:["en","pt"].map(e=>(0,s.jsx)("button",{onClick:()=>ay(e),className:"px-2 py-0.5 text-[9px] uppercase transition-colors",style:{color:af===e?nb.accent:"#666",borderBottom:af===e?`2px solid ${nb.accent}
1`:"2px solid transparent"},children:e},e))}),(0,s.jsx)("button",{onClick:async()=>{let e=await fetch(`/api/compare-card/${s7[0].login}/${s7[1].login}?format=landscape&lang=${af}`);if(!e.ok)return;let t=await e.blob(),r=URL.createObjectURL(t),s=document.createElement("a");s.href=r,s.download=`gitcity-${s7[0].login}-vs-${s7[1].login}.png`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)},className:"btn-press flex-1 border-2 border-border py-1.5 text-center text-[9px] text-cream transition-colors hover:border-border-light",children:"Card"}),(0,s.jsx)("button",{onClick:async()=>{let e=await fetch(`/api/compare-card/${s7[0].login}/${s7[1].login}?format=stories&lang=${af}`);if(!e.ok)return;let t=await e.blob(),r=URL.createObjectURL(t),s=document.createElement("a");s.href=r,s.download=`gitcity-${s7[0].login}-vs-${s7[1].login}-stories.png`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(r)},className:"btn-press flex-1 border-[2px] border-border py-1.5 text-center text-[9px] text-cream transition-colors hover:border-border-light",children:"Stories"})]}),(0,s.jsxs)("div",{className:"flex gap-2 px-4 pt-1 pb-5 sm:pb-4",children:[(0,s.jsx)("button",{onClick:()=>{let e=s7[0];s9(null),s6(e),rZ(e.login)},className:"btn-press flex-1 border-[2px] border-border py-2 text-center text-[10px] text-cream transition-colors hover:border-border-light",children:"Compare Again"}),(0,s.jsx)("button",{onClick:ek,className:"btn-press flex-1 border-[2px] border-border py-2 text-center text-[10px] text-cream transition-colors hover:border-border-light",children:"Close"})]})]})})})),r0&&!t5&&(0,s.jsx)(es,{developer:r0,isLoggedIn:!!si,isAdmin:sA,onLogin:nH,onClose:()=>r1(null),onAdminAdd:sA?lo:void 0,accent:nb.accent,shadow:nb.shadow}),rK&&!t5&&!rs&&(0,s.jsxs)("div",{className:"fixed inset-0 z-40 flex items-center justify-center px-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-bg/70 backdrop-blur-sm",onClick:()=>{rV(null),sm(null),rZ(null)}}),(0,s.jsxs)("div",{className:"relative mx-3 border-[3px] border-border bg-bg-raised p-4 text-center sm:mx-0 sm:p-6",children:[(0,s.jsx)("button",{onClick:()=>{rV(null),sm(null),rZ(null)},className:"absolute top-2 right-3 text-[10px] text-muted transition-colors hover:text-cream",children:"✕"}),rK.avatar_url&&(0,s.jsx)(k.default,{src:rK.avatar_url,alt:rK.login,width:48,height:48,className:"mx-auto mb-3 border-2 border-border",style:{imageRendering:"pixelated"}}),(0,s.jsxs)("p",{className:"text-xs text-cream normal-case",children:[(0,s.jsxs)("span",{style:{color:nb.accent},children:["@",rK.login]})," joined the city!"]}),(0,s.jsxs)("p",{className:"mt-2 text-[10px] text-muted normal-case",children:["Rank ",(0,s.jsxs)("span",{style:{color:nb.accent},children:["#",rK.rank??"?"]})," \xb7 ",(0,s.jsx)("span",{style:{color:nb.accent},children:rK.contributions.toLocaleString()})," contributions"]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2 sm:mt-5 sm:flex-row sm:justify-center sm:gap-3",children:[(0,s.jsx)("button",{onClick:()=>{if(!sp&&rK){let e=tT.find(e=>e.login.toLowerCase()===rK.login.toLowerCase());e&&sm(e)}rV(null),ra(!0)},className:"btn-press px-4 py-2 text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`3px 3px 0 0 ${nb.shadow}`},children:"Explore Building"}),(0,s.jsx)("a",{href:`https://x.com/intent/tweet?text=${encodeURIComponent(`My GitHub just turned into a building. ${rK.contributions.toLocaleString()} contributions, Rank #${rK.rank??"?"}. What does yours look like?`)}&url=${encodeURIComponent(`${window.location.origin}/dev/${rK.login}`)}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,ey.Az)("x"),className:"btn-press border-[3px] border-border px-4 py-2 text-[10px] text-cream transition-colors hover:border-border-light",children:"Share on X"}),(0,s.jsx)("button",{onClick:()=>{(0,ey.Az)("copy_link"),navigator.clipboard.writeText(`${window.location.origin}/dev/${rK.login}`),rQ(!0),setTimeout(()=>rQ(!1),2e3)},className:"btn-press border-[3px] border-border px-4 py-2 text-[10px] text-cream transition-colors hover:border-border-light",children:rq?"Copied!":"Copy Link"})]}),(0,s.jsx)("a",{href:`/dev/${rK.login}`,className:"mt-4 inline-block text-[9px] text-muted transition-colors hover:text-cream normal-case",children:"View full profile →"})]})]}),av&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>aj(null),onKeyDown:e=>{"Escape"===e.key&&aj(null)},tabIndex:-1,ref:e=>e?.focus(),children:(0,s.jsx)("div",{className:"pointer-events-none flex h-full items-end sm:items-center sm:justify-center",children:(0,s.jsxs)("div",{className:"pointer-events-auto relative w-full border-t-[3px] border-border bg-bg-raised/95 backdrop-blur-sm sm:w-85 sm:mx-4 sm:border-[3px] animate-[slide-up_0.2s_ease-out] sm:animate-[fade-in_0.15s_ease-out]",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("button",{onClick:()=>aj(null),className:"absolute top-2 right-3 text-[10px] text-muted transition-colors hover:text-cream z-10 cursor-pointer",children:"ESC"}),(0,s.jsx)("div",{className:"flex justify-center py-2 sm:hidden",children:(0,s.jsx)("div",{className:"h-1 w-10 rounded-full bg-border"})}),(0,s.jsxs)("div",{className:"flex items-center gap-3 px-4 pb-3 sm:pt-4",children:[(0,s.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center border-2",style:{borderColor:av.color,color:av.color},children:(0,s.jsx)("span",{className:"text-sm",children:"blimp"===av.vehicle?"◆":"billboard"===av.vehicle?"\uD83D\uDCCB":"rooftop_sign"===av.vehicle?"\uD83D\uDD04":"led_wrap"===av.vehicle?"\uD83D\uDCA1":"✈"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[av.brand&&(0,s.jsx)("p",{className:"truncate text-sm text-cream",children:av.brand}),(0,s.jsx)("p",{className:"text-[9px] text-dim",children:"Sponsored"})]})]}),(0,s.jsx)("div",{className:"mx-4 mb-3 h-px bg-border"}),av.description&&(0,s.jsx)("p",{className:"mx-4 mb-4 text-xs text-cream normal-case leading-relaxed",children:av.description}),av.link&&(eN=(0,ef.Sn)(av)??av.link,e_=av.link.startsWith("mailto:"),(0,s.jsx)("div",{className:"px-4 pb-5 sm:pb-4",children:(0,s.jsx)("a",{href:eN,target:e_?void 0:"_blank",rel:e_?void 0:"noopener noreferrer",className:"btn-press block w-full py-2.5 text-center text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`4px 4px 0 0 ${nb.shadow}`},onClick:async e=>{e.preventDefault(),ty("sky_ad_click",{ad_id:av.id,vehicle:av.vehicle,brand:av.brand??""}),(0,ey.ME)(av.id,av.vehicle);let t=await (0,ef.Xm)(av.id,"cta_click",ny||void 0),r=t?(0,ef._v)(eN,t):eN;e_?window.location.href=r:window.open(r,"_blank","noopener,noreferrer")},children:e_?"Send Email →":`Visit ${new URL(av.link).hostname.replace("www.","")} \u2192`})}))]})})}),!t5&&!t9&&!aA&&!rs&&(0,s.jsxs)("div",{className:"pointer-events-auto fixed bottom-8 left-3 z-25 flex flex-col-reverse items-start gap-2 sm:bottom-10 sm:left-4 sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:nG,className:"btn-press flex items-center gap-1.5 border-[3px] border-border bg-bg/70 px-2.5 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"▶"}),(0,s.jsx)("span",{className:"text-cream",children:nb.name}),(0,s.jsxs)("span",{className:"text-dim",children:[rn+1,"/",tl.length]})]}),eY&&(0,s.jsx)("div",{id:"gc-radio-slot"}),(0,s.jsxs)("button",{onClick:n2,className:"btn-press flex items-center gap-1 border-[3px] border-border bg-bg/70 px-2 py-1 text-[10px] backdrop-blur-sm transition-colors hover:border-border-light",title:"Replay intro",children:[(0,s.jsx)("span",{style:{color:nb.accent},children:"▶"}),(0,s.jsx)("span",{className:"text-cream",children:"Intro"})]}),(0,s.jsx)(tv,{mode:ri,preference:ro,accent:nb.accent,onSelect:e=>{rx(!1),rc(e)}})]}),ru&&"high"===ri&&"done"===tZ&&!t9&&!t5&&!aA&&(0,s.jsx)("div",{className:"pointer-events-auto fixed bottom-14 left-1/2 z-60 -translate-x-1/2 animate-[fade-in_0.3s_ease-out]",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 border-2 border-border bg-bg-raised/95 px-4 py-2 text-[11px] text-cream backdrop-blur-sm",style:{borderColor:"#ffaa0044"},children:[(0,s.jsx)("span",{style:{color:"#ffaa00"},children:"⚠"}),(0,s.jsx)("span",{children:"Running heavy on this device"}),(0,s.jsx)("button",{onClick:()=>{rc("low"),rx(!1)},className:"btn-press border-2 px-2 py-0.5 text-[10px]",style:{borderColor:nb.accent,color:nb.accent},children:"SWITCH TO LOW"}),(0,s.jsx)("button",{onClick:()=>rx(!1),className:"text-muted transition-colors hover:text-cream",children:"✕"})]})}),si&&lx?.claimed&&!t5&&!t9&&!rs&&!aA&&(0,s.jsx)(e6,{data:lg,accent:nb.accent,shadow:nb.shadow,isMobile:nm,onClaim:ly,onRefresh:lv}),sM&&!t9&&"done"===tZ&&(0,s.jsx)("div",{className:"pointer-events-none fixed bottom-20 left-1/2 z-50 -translate-x-1/2 sm:bottom-24",children:(0,s.jsxs)("div",{className:"border-2 border-border bg-bg-raised/95 px-5 py-2.5 text-[11px] text-cream backdrop-blur-sm",style:{borderColor:"#ffaa0044",animation:"toastDrop 0.3s ease-out, toastOut 0.4s ease-in 4s forwards"},children:[(0,s.jsx)("span",{style:{color:"#ffaa00"},children:"●"})," ",nA]})}),lj.length>0&&(0,s.jsxs)("div",{className:"jsx-a5f2080a79ef41b6 pointer-events-none fixed left-1/2 top-4 z-60 flex -translate-x-1/2 flex-col items-center gap-1.5",children:[lj.map(e=>(0,s.jsxs)("div",{style:{animation:"toastDrop 0.3s ease-out, toastOut 0.4s ease-in 2s forwards",borderColor:e.done?nb.accent:void 0},className:"jsx-a5f2080a79ef41b6 pointer-events-none border-2 border-border bg-bg-raised/95 px-4 py-2 text-[11px] backdrop-blur-sm",children:[(0,s.jsx)("span",{style:{color:nb.accent},className:"jsx-a5f2080a79ef41b6",children:e.done?"✓":"☆"})," ",e.title,e.done?" — Complete!":""]},e.id)),(0,s.jsx)(n(),{id:"a5f2080a79ef41b6",children:"@keyframes toastDrop{from{opacity:0;transform:translatey(-16px)}to{opacity:1;transform:translatey(0)}}@keyframes toastOut{from{opacity:1}to{opacity:0;transform:translatey(-8px)}}"})]}),null!==a4&&(0,s.jsx)(tn,{level:a4,onDone:()=>a8(null)}),!t5&&!t9&&!aA&&sy.length>=1&&(0,s.jsx)(T,{events:sy,viewerLogin:ny||null,hasBottomBar:!1,hubOpen:sj,onOpenHub:()=>sw(e=>!e),onNavigate:li,onCounterAttack:li}),aa&&sp&&(eS=()=>{an(!1),ai(null),ap(null),au(null),ah(!1)},e$=null!==ax,eT=sp.loadout??{crown:null,roof:null,aura:null},eE=!!ax&&E.Yw.includes(ax.id),eL=[...E.Yw.filter(e=>sp.owned_items.includes(e)),...eE&&ax?[ax.id]:[]],eI={width:sp.width,height:sp.height,depth:sp.depth},ez=null!=(eR=ax?.price_pixels??null)?`${eR} PX`:"",eD=null==eR||null==az||az>=eR,eM=!!ax&&ao===ax.id,(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-bg/70 backdrop-blur-sm",onClick:eS}),(0,s.jsxs)("div",{className:`relative z-10 max-h-[90vh] w-full overflow-y-auto scrollbar-thin border-[3px] border-border bg-bg-raised ${e$?"max-w-sm sm:max-w-md":"max-w-70"}`,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e$&&!am&&(0,s.jsx)("button",{onClick:()=>{ap(null),au(null)},className:"text-xs text-muted hover:text-cream","aria-label":"Back",children:"←"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xs",style:{color:nb.accent},children:am?"Gift Sent":"Send Gift"}),(0,s.jsxs)("p",{className:"mt-0.5 text-[8px] text-muted normal-case",children:["to @",sp.login]})]})]}),(0,s.jsx)("button",{onClick:eS,className:"text-xs text-muted hover:text-cream",children:"✕"})]}),e$&&ax?(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(ts,{loadout:eT,ownedFacesItems:eL,customColor:sp.custom_color??null,billboardImages:sp.billboard_images??[],buildingDims:eI,highlightItemId:ax.id}),(0,s.jsxs)("div",{className:"mt-3 flex items-center gap-3 border-2 border-border bg-bg-card px-3 py-2.5",children:[(0,s.jsx)("span",{className:"text-xl shrink-0",children:E.ED[ax.id]??"\uD83C\uDF81"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-[11px] text-cream truncate",children:E.fH[ax.id]??ax.id}),(0,s.jsxs)("p",{className:"text-[8px] text-muted normal-case",children:["on @",sp.login,"'s building"]})]}),(0,s.jsx)("span",{className:"text-[11px] shrink-0",style:{color:nb.accent},children:ez})]}),am?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"mt-3 border-2 border-green-500/40 bg-green-500/10 px-3 py-3 text-center",children:[(0,s.jsxs)("p",{className:"text-[11px] text-green-400",children:["\uD83C\uDF81 Sent to @",sp.login,"!"]}),(0,s.jsx)("p",{className:"mt-1 text-[8px] text-muted normal-case",children:"We emailed them so they know it's waiting on their building."})]}),(0,s.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[(0,s.jsx)("button",{onClick:()=>{ap(null),ah(!1),au(null)},className:"btn-press border-2 border-border bg-bg-card py-2 text-[10px] text-cream hover:border-border-light",children:"Send another"}),(0,s.jsx)("button",{onClick:eS,className:"btn-press border-2 py-2 text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:"Done"})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"mt-2.5 text-center text-[8px] text-dim normal-case",children:["@",sp.login," gets an email when you send this."]}),ad&&(0,s.jsx)("p",{className:"mt-2 text-center text-[10px] text-red-400 normal-case",children:ad}),(0,s.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-2",children:[(0,s.jsx)("button",{onClick:()=>{ap(null),au(null)},disabled:eM,className:"btn-press border-2 border-border bg-bg-card py-2.5 text-[10px] text-cream hover:border-border-light disabled:opacity-40",children:"Back"}),eD?(0,s.jsx)("button",{onClick:()=>nJ(ax.id),disabled:eM,className:"btn-press border-2 py-2.5 text-[10px] text-bg disabled:opacity-60",style:{backgroundColor:nb.accent,boxShadow:`2px 2px 0 0 ${nb.shadow}`},children:eM?"Sending...":`Send for ${ez}`}):(0,s.jsx)(_(),{href:"/pixels",className:"btn-press border-2 border-border bg-bg-card py-2.5 text-center text-[10px] text-red-400 hover:border-border-light",children:"Not enough PX"})]})]})]}):(0,s.jsx)(s.Fragment,{children:null===al?(0,s.jsx)("p",{className:"py-8 text-center text-[9px] text-dim normal-case animate-pulse",children:"Loading..."}):0===al.length?(0,s.jsx)("p",{className:"py-8 text-center text-[9px] text-dim normal-case",children:"No items available"}):(0,s.jsx)("div",{className:"max-h-72 overflow-y-auto scrollbar-thin",children:al.map(e=>(0,s.jsxs)("button",{onClick:()=>{e.owned||(au(null),ap(e))},disabled:e.owned,className:`flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors ${e.owned?"opacity-35 cursor-not-allowed":"hover:bg-bg-card/80"}`,children:[(0,s.jsx)("span",{className:"text-base shrink-0",children:E.ED[e.id]??"\uD83C\uDF81"}),(0,s.jsx)("span",{className:"flex-1 text-[10px] text-cream",children:E.fH[e.id]??e.id}),(0,s.jsx)("span",{className:"text-[10px] shrink-0",style:{color:e.owned?void 0:nb.accent},children:e.owned?"Owned":`${e.price_pixels} PX`})]},e.id))})})]})]})),(0,s.jsx)(e8,{initialEvents:sy,open:sj,onClose:()=>sw(!1),viewerLogin:ny||null,onNavigate:li,onCounterAttack:li}),sk&&(0,s.jsx)("div",{className:"fixed left-1/2 top-16 z-[60] -translate-x-1/2 px-3",children:(0,s.jsx)("div",{className:"flex items-center gap-2.5 border border-border bg-bg-raised px-3 py-2 shadow-lg shadow-black/50",children:"loading"===sk.phase?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"blink-dot text-sm",style:{color:nb.accent},children:"_"}),(0,s.jsxs)("span",{className:"text-[10px] text-cream normal-case",children:["Finding @",sk.login," in the city..."]})]}):"pending"===sk.phase?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:nb.accent}}),(0,s.jsxs)("span",{className:"text-[10px] text-cream normal-case",children:["@",sk.login," just joined — their building appears after the next city refresh."]}),(0,s.jsx)("button",{onClick:()=>sN(null),className:"text-xs text-muted hover:text-cream","aria-label":"Dismiss",children:"✕"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-red-400"}),(0,s.jsxs)("s
1pan",{className:"text-[10px] text-cream normal-case",children:["Couldn't open @",sk.login]}),(0,s.jsx)("button",{onClick:()=>li(sk.login),className:"border border-border px-2 py-0.5 text-[9px] text-cream transition-colors hover:text-[#c8e64a]",children:"Retry"}),(0,s.jsx)("button",{onClick:()=>sN(null),className:"text-xs text-muted hover:text-cream","aria-label":"Dismiss",children:"✕"})]})})}),nt&&!t5&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-bg/70 backdrop-blur-sm",onClick:()=>{nr(null),clearTimeout(nn.current)}}),(0,s.jsxs)("div",{className:"relative mx-3 border-[3px] border-border bg-bg-raised p-5 text-center sm:mx-0 sm:p-7 animate-[gift-bounce_0.5s_ease-out]",style:{borderColor:nb.accent+"60",minWidth:280},children:[(0,s.jsx)("button",{onClick:()=>{nr(null),clearTimeout(nn.current)},className:"absolute top-2 right-3 text-[10px] text-muted transition-colors hover:text-cream",children:"ESC"}),(0,s.jsx)("p",{className:"text-[9px] tracking-widest text-muted mb-1",children:"FLIGHT COMPLETE"}),(0,s.jsx)("div",{className:"text-3xl sm:text-4xl font-bold",style:{color:nb.accent},children:nt.score}),(0,s.jsx)("p",{className:"text-[9px] text-muted mt-0.5",children:"points"}),nt.isNewPB&&(0,s.jsx)("div",{className:"mt-2 inline-block rounded-sm px-2.5 py-0.5 text-[9px] font-bold text-bg animate-pulse",style:{backgroundColor:nb.accent},children:"NEW PERSONAL BEST!"}),(0,s.jsxs)("div",{className:"mt-4 grid grid-cols-3 gap-3 text-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-bold text-cream",children:nt.collected}),(0,s.jsx)("div",{className:"text-[8px] text-muted",children:"Collected"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"text-sm font-bold text-cream",children:[nt.maxCombo,"x"]}),(0,s.jsx)("div",{className:"text-[8px] text-muted",children:"Max Combo"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"text-sm font-bold text-cream",children:["+",nt.timeBonus]}),(0,s.jsx)("div",{className:"text-[8px] text-muted",children:"Time Bonus"})]})]}),nt.rank>0&&(0,s.jsxs)("div",{className:"mt-3 border-t border-border/40 pt-3",children:[(0,s.jsx)("span",{className:"text-[9px] text-muted",children:"Rank "}),(0,s.jsxs)("span",{className:"text-sm font-bold",style:{color:nb.accent},children:["#",nt.rank]}),nt.totalPilots>0&&(0,s.jsxs)("span",{className:"text-[9px] text-muted",children:[" of ",nt.totalPilots]})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2 sm:flex-row sm:justify-center sm:gap-3",children:[(0,s.jsx)("button",{onClick:()=>{nr(null),clearTimeout(nn.current),rZ(null),t3(!0),rD({score:0,earned:0,combo:0,collected:0,maxCombo:1}),rA.current=Date.now(),rO.current=0,rF.current=0,rH(0);try{rP(parseInt(localStorage.getItem("gitcity_fly_pb")||"0",10)||0)}catch{rP(0)}},className:"btn-press px-5 py-2 text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`3px 3px 0 0 ${nb.shadow}`},children:"Fly Again"}),(0,s.jsx)(_(),{href:"/leaderboard?mode=game&tab=flight",onClick:()=>{nr(null),clearTimeout(nn.current)},className:"btn-press border-2 border-border px-5 py-2 text-[10px] transition-colors hover:border-border-light",style:{color:nb.accent},children:"See Leaderboard"}),(0,s.jsx)("button",{onClick:()=>{nr(null),clearTimeout(nn.current)},className:"text-[9px] text-muted transition-colors hover:text-cream",children:"Close"})]})]})]}),sh&&!t5&&!rs&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-bg/70 backdrop-blur-sm",onClick:()=>sb(!1)}),(0,s.jsxs)("div",{className:"relative mx-3 border-[3px] border-border bg-bg-raised p-5 text-center sm:mx-0 sm:p-7 animate-[gift-bounce_0.5s_ease-out]",style:{borderColor:nb.accent+"60"},children:[(0,s.jsx)("button",{onClick:()=>sb(!1),className:"absolute top-2 right-3 text-[10px] text-muted transition-colors hover:text-cream",children:"ESC"}),(0,s.jsx)("div",{className:"text-3xl sm:text-4xl mb-3",children:"\uD83C\uDF89"}),(0,s.jsx)("p",{className:"text-sm text-cream sm:text-base",children:"Gift Unlocked!"}),(0,s.jsxs)("div",{className:"mt-4 inline-flex items-center gap-3 border-2 border-border bg-bg-card px-5 py-3",children:[(0,s.jsx)("span",{className:"text-2xl",children:"\uD83C\uDFC1"}),(0,s.jsxs)("div",{className:"text-left",children:[(0,s.jsx)("p",{className:"text-xs text-cream",children:"Flag"}),(0,s.jsx)("p",{className:"text-[9px] text-muted normal-case",children:"A flag on top of your building"})]})]}),(0,s.jsxs)("div",{className:"mt-5 w-full max-w-70",children:[(0,s.jsx)("p",{className:"mb-2 text-[9px] tracking-widest text-muted uppercase",children:"Upgrade your building"}),(0,s.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[{emoji:"\uD83C\uDF3F",name:"Garden",price:"$0.75"},{emoji:"✨",name:"Neon",price:"$1.00"},{emoji:"\uD83D\uDD25",name:"Fire",price:"$1.00"}].map(e=>(0,s.jsxs)(_(),{href:lm,onClick:()=>sb(!1),className:"flex flex-col items-center gap-1 border-2 border-border bg-bg-card px-2 py-2.5 transition-colors hover:border-border-light",children:[(0,s.jsx)("span",{className:"text-xl",children:e.emoji}),(0,s.jsx)("span",{className:"text-[8px] text-cream leading-tight",children:e.name}),(0,s.jsx)("span",{className:"text-[9px] font-bold",style:{color:nb.accent},children:e.price})]},e.name))})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2 sm:flex-row sm:justify-center sm:gap-3",children:[(0,s.jsx)("button",{onClick:()=>{sb(!1),lx&&(rZ(lx.login),sm(lx),ra(!0))},className:"btn-press px-5 py-2.5 text-[10px] text-bg",style:{backgroundColor:nb.accent,boxShadow:`3px 3px 0 0 ${nb.shadow}`},children:"View in City"}),(0,s.jsxs)(_(),{href:lm,onClick:()=>sb(!1),className:"btn-press border-[3px] border-border px-5 py-2 text-[10px] text-cream transition-colors hover:border-border-light",children:["Visit Shop ","→"]})]})]})]}),"preview"===nc.phase&&nc.previewData&&(0,s.jsx)(e7,{preview:nc.previewData,loading:nc.loading,error:nc.error,onRaid:(e,t)=>nd.executeRaid(e,t),onCancel:nd.exitRaid}),"idle"!==nc.phase&&"preview"!==nc.phase&&(0,s.jsx)(e9,{phase:nc.phase,raidData:nc.raidData,onSkip:nd.skipToShare,onExit:nd.exitRaid}),a$&&(0,s.jsx)(te,{rabbitCompleted:aG>=5,onRedPill:()=>{aT(!1),aL(!0)},onBluePill:()=>{aT(!1),aG>=5||(aW(aG+1),aO(!0))},onClose:()=>aT(!1)}),aE&&(0,s.jsx)(tt,{onClose:()=>aL(!1),session:si,hasClaimed:!!lx?.claimed,onSignIn:nH}),aI&&(0,s.jsx)(tr,{onClose:()=>aR(!1),onEnter:()=>{window.location.href="/arcade"},session:si,onSignIn:nH}),tG&&!t5&&!t9&&(0,s.jsx)("a",{href:"https://www.openstreetmap.org/copyright",target:"_blank",rel:"noopener noreferrer",className:"pointer-events-auto fixed bottom-1 left-1.5 z-20 text-[9px] normal-case leading-none text-muted/60 hover:text-muted",children:tG.attribution}),aA&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 pointer-events-none",children:[(0,s.jsx)("div",{className:"absolute inset-x-0 top-0 origin-top bg-black/80 transition-transform duration-700",style:{height:"12%",transform:aF>=0?"scaleY(1)":"scaleY(0)"}}),(0,s.jsx)("div",{className:"absolute inset-x-0 bottom-0 origin-bottom bg-black/80 transition-transform duration-700",style:{height:"18%",transform:aF>=0?"scaleY(1)":"scaleY(0)"}}),(0,s.jsx)("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,255,65,0.08) 1px, rgba(0,255,65,0.08) 2px)",backgroundSize:"100% 2px"}}),(0,s.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",style:{height:"18%"},children:["Follow the white rabbit...","It hides among the parks..."].map((e,t)=>(0,s.jsx)("p",{className:"absolute text-center font-pixel normal-case px-4",style:{fontSize:"clamp(0.85rem, 3vw, 1.5rem)",letterSpacing:"0.08em",color:"#00ff41",textShadow:"0 0 20px rgba(0,255,65,0.5), 0 0 40px rgba(0,255,65,0.2)",opacity:+(aF===t),transition:"opacity 0.7s ease-in-out"},children:e},t))}),(0,s.jsx)("button",{className:"pointer-events-auto absolute top-4 right-4 z-60 font-pixel text-[10px] sm:text-[12px] tracking-wider border border-[#00ff41]/40 px-3 py-1.5 transition-colors hover:bg-[#00ff41]/10",style:{color:"#00ff41",textShadow:"0 0 8px rgba(0,255,65,0.3)"},onClick:nK,children:"SKIP"})]}),aJ&&(0,s.jsxs)("div",{style:{animation:"rabbitHintAnim 3s ease-in-out forwards"},className:"jsx-7ff66bf3f68f341c fixed inset-0 z-50 flex items-center justify-center pointer-events-none",children:[(0,s.jsx)("div",{className:"jsx-7ff66bf3f68f341c absolute inset-0 bg-black/60"}),(0,s.jsx)("p",{style:{color:"#00ff41",textShadow:"0 0 15px rgba(0,255,65,0.5), 0 0 30px rgba(0,255,65,0.2)"},className:"jsx-7ff66bf3f68f341c relative font-pixel text-[14px] sm:text-[16
1px] tracking-widest text-center px-4",children:aJ}),(0,s.jsx)(n(),{id:"7ff66bf3f68f341c",children:"@keyframes rabbitHintAnim{0%{opacity:0}15%{opacity:1}70%{opacity:1}100%{opacity:0}}"})]}),aY&&(0,s.jsx)(ta,{onComplete:()=>aX(!1)})]})}function tS({isAdmin:e,townOfWeek:t}){return(0,s.jsx)(l.Suspense,{children:(0,s.jsx)(t_,{serverIsAdmin:e,townOfWeek:t})})}},55479:(e,t,r)=>{"use strict";function s(){return window.himetrica??null}function a(e){s()?.identify({name:e.github_login,email:e.email,github_login:e.github_login,developer_id:e.developer_id,contributions:e.contributions,referrer:e.referrer})}function n(e){s()?.track("sign_in_clicked",{source:e})}function l(e){s()?.track("building_claimed",{github_login:e})}function i(){s()?.track("free_item_claimed")}function o(e,t,r){s()?.track("sky_ad_impression",{ad_id:e,ad_type:t,advertiser:r})}function c(e,t,r){s()?.track("sky_ad_click",{ad_id:e,ad_type:t,url:r})}function d(e,t){s()?.track("sky_ad_cta_click",{ad_id:e,ad_type:t})}function u(e){s()?.track("building_clicked",{target_login:e})}function x(e){s()?.track("kudos_sent",{target_login:e})}function p(e){s()?.track("search_used",{query:e})}function m(e){s()?.track("profile_viewed",{target_login:e})}function h(e){s()?.track("leaderboard_viewed",{tab:e})}function b(e){s()?.track("referral_link_landed",{referrer:e})}function g(e){s()?.track("share_clicked",{method:e})}function f(){s()?.track("sign_in_prompt_shown")}function y(){s()?.track("sign_in_prompt_clicked")}function v(e){s()?.track("disabled_button_clicked",{button_name:e})}function j(){s()?.track("earcade_clicked")}function w(){s()?.track("earcade_survey_started")}function k(){s()?.track("earcade_survey_completed")}r.d(t,{A5:()=>j,Az:()=>g,BE:()=>m,D0:()=>h,Iy:()=>w,Lp:()=>u,ME:()=>d,Vm:()=>o,WI:()=>c,ac:()=>x,fO:()=>n,fP:()=>b,fn:()=>l,gm:()=>a,iH:()=>i,jd:()=>v,jx:()=>f,lM:()=>y,uF:()=>k,v3:()=>p})},77649:(e,t,r)=>{"use strict";r.d(t,{l:()=>n});var s=r(95155),a=r(12115);function n({value:e,onChange:t,options:r,placeholder:l="Select…",className:i="",disabled:o=!1,ariaLabel:c,searchable:d=!1,searchPlaceholder:u="Search…"}){let[x,p]=(0,a.useState)(!1),[m,h]=(0,a.useState)(""),[b,g]=(0,a.useState)(-1),f=(0,a.useRef)(null),y=(0,a.useId)(),v=r.find(t=>t.value===e),j=m.trim().toLowerCase(),w=(j?r.filter(e=>e.label.toLowerCase().includes(j)):r).slice(0,100);function k(){h(""),g(Math.max(0,r.findIndex(t=>t.value===e))),p(!0)}function N(e){t(e),p(!1),h("")}function _(e){if(!o){if("Escape"===e.key)return void p(!1);if("Enter"===e.key||" "===e.key)return(e.preventDefault(),x)?void(b>=0&&b<w.length&&N(w[b].value)):void k();"ArrowDown"===e.key&&(e.preventDefault(),x?g(e=>Math.min(w.length-1,e+1)):k()),"ArrowUp"===e.key&&(e.preventDefault(),g(e=>Math.max(0,e-1)))}}return(0,a.useEffect)(()=>{if(!x)return;let e=e=>{f.current&&!f.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]),(0,s.jsxs)("div",{ref:f,className:`relative ${i}`,children:[(0,s.jsxs)("button",{type:"button",disabled:o,"aria-haspopup":"listbox","aria-expanded":x,"aria-label":c,onClick:()=>!o&&(x?p(!1):k()),onKeyDown:_,className:`flex w-full items-center justify-between gap-2 border bg-bg px-3 py-2 text-left text-xs outline-none transition-colors ${x?"border-lime":"border-border hover:border-border-light"} ${o?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[(0,s.jsx)("span",{className:`min-w-0 flex-1 truncate text-left ${v?"text-cream":"text-dim"}`,children:v?.label??l}),(0,s.jsx)("span",{className:`shrink-0 text-[8px] text-muted transition-transform ${x?"rotate-180":""}`,children:"▼"})]}),x&&(0,s.jsxs)("div",{className:"absolute left-0 right-0 top-full z-50 mt-1 border-[3px] border-border-light bg-bg-card shadow-[6px_6px_0_0_rgba(0,0,0,0.5)]",children:[d&&(0,s.jsx)("input",{autoFocus:!0,value:m,onChange:e=>{h(e.target.value),g(0)},onKeyDown:_,placeholder:u,"aria-label":u,autoComplete:"off",spellCheck:!1,className:"w-full border-b-[3px] border-border bg-bg px-3 py-2 text-base text-cream normal-case outline-none placeholder:text-dim sm:text-xs"}),(0,s.jsxs)("ul",{role:"listbox",id:y,className:"scrollbar-thin max-h-60 list-none overflow-auto",children:[d&&0===w.length&&(0,s.jsx)("li",{className:"px-3 py-2 text-[11px] text-dim normal-case",children:"No match."}),w.map((t,r)=>{let a=t.value===e;return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",role:"option","aria-selected":a,onMouseEnter:()=>g(r),onClick:()=>N(t.value),className:`flex w-full items-center justify-between gap-2 border-b border-border px-3 py-2 text-left text-[11px] transition-colors last:border-b-0 ${r===b?"bg-bg-raised":""} ${a?"text-lime":"text-cream"}`,children:[(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:`h-1.5 w-1.5 shrink-0 ${a?"bg-lime":"bg-transparent"}`}),t.label]}),t.hint&&(0,s.jsx)("span",{className:"shrink-0 text-[9px] text-dim",children:t.hint})]})},t.value)})]})]})]})}},97185:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(95155),a=r(30262);function n({setup:e}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"min-h-[1.9em]",children:[(0,s.jsx)("span",{style:{color:a.DQ},children:"$ "}),(0,s.jsx)("span",{className:"text-neutral-300",children:"gitcity login"})]}),e.lines.map(e=>(0,s.jsxs)("div",{className:"min-h-[1.9em] whitespace-pre-wrap break-words text-neutral-500",children:["remote: ",e.text,"pending"===e.status&&"...","pending"===e.status&&e.warned&&("github"===e.step?" GitHub is slow, hang tight":" still working"),"done"===e.status&&(0,s.jsx)("span",{style:{color:a.DQ},children:" done"}),"fail"===e.status&&(0,s.jsx)("span",{className:"text-[#e05252]",children:" failed"})]},e.id)),"failed"===e.status&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"min-h-[1.9em]"}),(0,s.jsx)("div",{className:"min-h-[1.9em] text-[#e05252]",children:"fatal: couldn't finish signing you in"}),(0,s.jsx)("div",{className:"min-h-[1.9em] text-[#e05252]",children:"hint: check your connection and try again"}),(0,s.jsx)("button",{onClick:e.retry,className:"btn-press mt-4 px-6 py-2 font-pixel text-xs text-bg",style:{backgroundColor:a.DQ},children:"RETRY"})]})]})}}},e=>{e.O(0,[1831,2274,9367,8500,4794,9304,8750,5646,6622,4987,8437,474,5316,1254,9014,6778,5768,6977,8855,8441,8229,3794,7358],()=>e(e.s=9555)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.