PageSourceSearch

https://easyquizehou.io.vn/assets/Game2048Page-Bl6VBoYr.js

js easyquizehou.io.vn collected 2026-10-02 01:11:43 UTC 21,083 bytes, 1 lines download raw bytes

1import{j as a}from"./vendor-editor-tiptap-DxFZQymd.js";import{u as Ue,r as l}from"./vendor-react-Ci3E8-6d.js";import{f as G,a2 as Fe,u as He,a as Ke,q as ge}from"./index-CMVZ1QIP.js";import{a0 as E,U as x,M as Ye,bq as qe,bd as Je,am as ue,br as he,bf as Xe,B as Ve,b2 as Qe,al as fe,au as Ze,D as et,a7 as tt}from"./vendor-antd-Osf0nwkm.js";import"./vendor-charts-Dq7xLlt_.js";const W="https://be.easyquizehou.io.vn/api/game/2048",P={saveScore:async e=>(await G(`${W}/score`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),getLeaderboard:async(e=20)=>(await G(`${W}/leaderboard?limit=${e}`)).json(),getMyStats:async()=>(await G(`${W}/stats`)).json(),getMyBestScore:async()=>(await G(`${W}/best-score`)).json()};function at(){return Array.from({length:4},()=>Array(4).fill(0))}function ee(e){return e.map(o=>[...o])}function nt(e){const o=[];for(let t=0;t<4;t++)for(let n=0;n<4;n++)e[t][n]===0&&o.push([t,n]);return o}function Z(e){const o=nt(e);if(o.length===0)return null;const[t,n]=o[Math.floor(Math.random()*o.length)],i=Math.random()<.9?2:4,c=ee(e);return c[t][n]=i,{board:c,position:[t,n],value:i}}function $(e){const o=e.filter(s=>s!==0),t=[],n=[!1,!1,!1,!1];let i=0,c=0;for(;c<o.length;)if(c+1<o.length&&o[c]===o[c+1]){const s=o[c]*2;t.push(s),n[t.length-1]=!0,i+=s,c+=2}else t.push(o[c]),c++;for(;t.length<4;)t.push(0);return{result:t,score:i,merged:n}}function ve(e,o){return[...e[o]]}function J(e,o){return[e[0][o],e[1][o],e[2][o],e[3][o]]}function Se(e,o,t){e[o]=t}function pe(e,o,t){for(let n=0;n<4;n++)e[n][o]=t[n]}function ot(e,o){const t=ee(e);let n=0,i=!1;const c=[];if(o==="left")for(let s=0;s<4;s++){const h=ve(t,s),{result:d,score:g,merged:S}=$(h);h.some((m,u)=>m!==d[u])&&(i=!0),n+=g,Se(t,s,d),S.forEach((m,u)=>{m&&c.push([s,u])})}else if(o==="right")for(let s=0;s<4;s++){const h=ve(t,s).reverse(),{result:d,score:g,merged:S}=$(h),m=d.reverse();e[s].some((u,p)=>u!==m[p])&&(i=!0),n+=g,Se(t,s,m),S.reverse().forEach((u,p)=>{u&&c.push([s,p])})}else if(o==="up")for(let s=0;s<4;s++){const h=J(t,s),{result:d,score:g,merged:S}=$(h);h.some((m,u)=>m!==d[u])&&(i=!0),n+=g,pe(t,s,d),S.forEach((m,u)=>{m&&c.push([u,s])})}else if(o==="down")for(let s=0;s<4;s++){const h=J(t,s).reverse(),{result:d,score:g,merged:S}=$(h),m=d.reverse();J(e,s).some((u,p)=>u!==m[p])&&(i=!0),n+=g,pe(t,s,m),S.reverse().forEach((u,p)=>{u&&c.push([p,s])})}return{board:t,score:n,moved:i,mergedPositions:c}}function X(e){let o=0;for(let t=0;t<4;t++)for(let n=0;n<4;n++)e[t][n]>o&&(o=e[t][n]);return o}function rt(e){for(let o=0;o<4;o++)for(let t=0;t<4;t++)if(e[o][t]===2048)return!0;return!1}function st(e){for(let o=0;o<4;o++)for(let t=0;t<4;t++)if(e[o][t]===0)return!0;for(let o=0;o<4;o++)for(let t=0;t<3;t++)if(e[o][t]===e[o][t+1])return!0;for(let o=0;o<3;o++)for(let t=0;t<4;t++)if(e[o][t]===e[o+1][t])return!0;return!1}function it(e){return!st(e)}function lt(){let e=at();const o=Z(e);o&&(e=o.board);const t=Z(e);return t&&(e=t.board),e}const D="game2048_state",xe="game2048_best",j=5,O=180,L=100;function V(){try{const e=localStorage.getItem(xe);return e&&parseInt(e,10)||0}catch{return 0}}function ye(e){try{localStorage.setItem(xe,String(e))}catch{}}const Q=Fe((e,o)=>({board:[],score:0,bestScore:V(),gameStatus:"playing",moveCount:0,highestTile:0,startTime:Date.now(),undoStack:[],undoScoreStack:[],undoMoveCountStack:[],undoRemaining:j,challengeMode:null,challengeTimeRemaining:O,challengeMovesRemaining:L,newTilePos:null,mergedPositions:[],lastScoreGain:0,initNewGame:(t=null)=>{const n=lt(),i=V();e({board:n,score:0,bestScore:i,gameStatus:"playing",moveCount:0,highestTile:X(n),startTime:Date.now(),undoStack:[],undoScoreStack:[],undoMoveCountStack:[],undoRemaining:j,challengeMode:t,challengeTimeRemaining:O,challengeMovesRemaining:L,newTilePos:null,mergedPositions:[],lastScoreGain:0});try{localStorage.removeItem(D)}catch{}},performMove:t=>{const n=o();if(n.gameStatus==="lost"||n.gameStatus==="won")return;const i=ot(n.board,t);if(!i.moved)return;const c=[...n.undoStack,ee(n.board)].slice(-j),s=[...n.undoScoreStack,n.score].slice(-j),h=[...n.undoMoveCountStack,n.moveCount].slice(-j),d=Z(i.board),g=d?d.board:i.board,S=d?d.position:null,m=n.score+i.score,u=Math.max(n.bestScore,m),p=n.moveCount+1,T=X(g);let b=n.gameStatus;n.gameStatus!=="continue_after_win"&&rt(g)?b="won":it(g)&&(b="lost");let w=n.challengeMovesRemaining;n.challengeMode==="move_limit"&&(w=n.challengeMovesRemaining-1,w<=0&&b==="playing"&&(b="lost")),u>n.bestScore&&ye(u),e({board:g,score:m,bestScore:u,gameStatus:b,moveCount:p,highe
1stTile:T,undoStack:c,undoScoreStack:s,undoMoveCountStack:h,newTilePos:S,mergedPositions:i.mergedPositions,lastScoreGain:i.score,challengeMovesRemaining:w}),o().saveToLocalStorage()},undo:()=>{const t=o();if(t.undoStack.length===0||t.undoRemaining<=0||t.gameStatus==="won"||t.gameStatus==="lost")return;const n=[...t.undoStack],i=[...t.undoScoreStack],c=[...t.undoMoveCountStack],s=n.pop(),h=i.pop(),d=c.pop();let g=t.challengeMovesRemaining;t.challengeMode==="move_limit"&&(g=Math.min(t.challengeMovesRemaining+1,L)),e({board:s,score:h,moveCount:d,highestTile:X(s),undoStack:n,undoScoreStack:i,undoMoveCountStack:c,undoRemaining:t.undoRemaining-1,newTilePos:null,mergedPositions:[],lastScoreGain:0,challengeMovesRemaining:g}),o().saveToLocalStorage()},continueAfterWin:()=>{e({gameStatus:"continue_after_win"}),o().saveToLocalStorage()},tickTimer:()=>{const t=o();if(t.challengeMode!=="time_limit"||t.gameStatus!=="playing"&&t.gameStatus!=="continue_after_win")return;const n=t.challengeTimeRemaining-1;n<=0?e({challengeTimeRemaining:0,gameStatus:"lost"}):e({challengeTimeRemaining:n})},saveToLocalStorage:()=>{const t=o();if(t.gameStatus==="lost"||t.board.length===0)return;const n={board:t.board,score:t.score,bestScore:t.bestScore,gameStatus:t.gameStatus,moveCount:t.moveCount,highestTile:t.highestTile,startTime:t.startTime,undoStack:t.undoStack,undoScoreStack:t.undoScoreStack,undoMoveCountStack:t.undoMoveCountStack,undoRemaining:t.undoRemaining,challengeMode:t.challengeMode,challengeTimeRemaining:t.challengeTimeRemaining,challengeMovesRemaining:t.challengeMovesRemaining};try{localStorage.setItem(D,JSON.stringify(n))}catch{}},loadFromLocalStorage:()=>{try{const t=localStorage.getItem(D);if(!t)return!1;const n=JSON.parse(t),i=n.board;if(!Array.isArray(i)||i.length!==4)return!1;for(const d of i)if(!Array.isArray(d)||d.length!==4||d.some(g=>typeof g!="number"||!Number.isFinite(g)))return!1;const c=(d,g,S)=>typeof d!="number"||!Number.isFinite(d)||d<0?g:S!==void 0?Math.min(d,S):d,h=["playing","won","lost","continue_after_win"].includes(n.gameStatus)?n.gameStatus:"playing";return e({board:i,score:c(n.score,0),bestScore:Math.max(c(n.bestScore,0),V()),gameStatus:h,moveCount:c(n.moveCount,0),highestTile:c(n.highestTile,0),startTime:c(n.startTime,Date.now()),undoStack:Array.isArray(n.undoStack)?n.undoStack:[],undoScoreStack:Array.isArray(n.undoScoreStack)?n.undoScoreStack:[],undoMoveCountStack:Array.isArray(n.undoMoveCountStack)?n.undoMoveCountStack:[],undoRemaining:c(n.undoRemaining,j,j),challengeMode:n.challengeMode==="time_limit"||n.challengeMode==="move_limit"?n.challengeMode:null,challengeTimeRemaining:c(n.challengeTimeRemaining,O,O),challengeMovesRemaining:c(n.challengeMovesRemaining,L,L),newTilePos:null,mergedPositions:[],lastScoreGain:0}),!0}catch{return!1}},clearSave:()=>{try{localStorage.removeItem(D)}catch{}},setBestScoreFromServer:t=>{const n=o().bestScore,i=Math.max(n,t);e({bestScore:i}),ye(i)}}));function ct(e){return e===0?"":e<=2048?`tile-${e}`:"tile-super"}function dt(e){const o=Math.floor(e/60),t=e%60;return`${o}:${t.toString().padStart(2,"0")}`}const vt=()=>{const{t:e}=He(),o=Ue(),{user:t}=Ke(),{board:n,score:i,bestScore:c,gameStatus:s,moveCount:h,highestTile:d,undoRemaining:g,undoStack:S,challengeMode:m,challengeTimeRemaining:u,challengeMovesRemaining:p,newTilePos:T,mergedPositions:b,lastScoreGain:w,initNewGame:M,performMove:R,undo:be,continueAfterWin:we,tickTimer:te,loadFromLocalStorage:je,saveToLocalStorage:ae,setBestScoreFromServer:_e}=Q(),[N,ke]=l.useState("challenge"),[Te,Me]=l.useState([]),[_,Re]=l.useState(null),[Ce,ne]=l.useState(!1),[Ee,oe]=l.useState(!1),[Le,U]=l.useState(!1),[re,Ne]=l.useState(!1),[F,B]=l.useState(!1),[Be,se]=l.useState([]),Ie=l.useRef(0),H=l.useRef(!1),C=l.useRef(null);l.useEffect(()=>{document.title=e("game2048.title","2048")+" | EHOU Easy Quiz"},[e]),l.useEffect(()=>{je()?U(!0):(M(),B(!0)),t&&P.getMyBestScore().then(f=>{f?.data!=null&&_e(f.data)}).catch(f=>{console.warn("Failed to load best score:",f)})},[]),l.useEffect(()=>{if(m!=="time_limit"||s!=="playing"&&s!=="continue_after_win")return;const r=setInterval(()=>te(),1e3);return()=>clearInterval(r)},[m,s,te]);const K=l.useCallback(r=>{const f={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"};f[r.key]&&(r.preventDefault(),R(f[r.key]))},[R]);l.useEffect(()=>(window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)),[K]),l.useEffect(()=>{const r=()=>ae();return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[ae]),l.useEffect(()=>{if(w<=0)return;const r=++Ie.current;se(v=>[...v,{id:r,value:w}]);const f=setTimeout(()=>{se(v=>v.filter(y=>y.id!==r))},600);return()=>clearTimeout(f)},[w,h]);const ie=l.useRef(Q.getState().startTime);l.useEffect(()=>{ie.current=Q.getState().startTime},[F]),l.useEffect(()=>{if((s==="lost"||s==="won")&&t&&F&&!H.current){H.current=!0;const r=Math.floor((Date.now()-ie.current)/1e3);P.saveScore({score:i,highestTile:d,moveCount:h,durationSeconds:r,result:s==="won"?"WIN":"LOSE",challengeMode:m}).catch(f=>{console.warn("Failed to save score:",f)})}s==="playing"&&(H.current=!1)},[s,i,d,h,t,F,m]);const Ae=l.useCallback(r=>{C.current={x:r.touches[0].clientX,y:r.touches[0].clientY}},[]),ze=l.useCallback(r=>
1{if(!C.current)return;const f=r.changedTouches[0].clientX-C.current.x,v=r.changedTouches[0].clientY-C.current.y,y=Math.abs(f),z=Math.abs(v);Math.max(y,z)<30||(y>z?R(f>0?"right":"left"):R(v>0?"down":"up"),C.current=null)},[R]),le=l.useCallback(async()=>{if(t){ne(!0);try{const r=await P.getLeaderboard(20);Me(r?.data||[])}catch(r){ge(r,e("error.default","Error loading data"))}finally{ne(!1)}}},[t,e]),ce=l.useCallback(async()=>{if(t){oe(!0);try{const r=await P.getMyStats();Re(r?.data||null)}catch(r){ge(r,e("error.default","Error loading data"))}finally{oe(!1)}}},[t,e]);l.useEffect(()=>{N==="leaderboard"&&le(),N==="stats"&&ce()},[N,le,ce]);const k=l.useCallback(r=>{M(r),B(!0)},[M]),Ge=l.useCallback(()=>{U(!1),B(!0)},[]),de=l.useCallback(()=>{U(!1),M(),B(!0)},[M]),Y=l.useCallback(()=>typeof window<"u"&&window.innerWidth<480?Math.min(window.innerWidth-32,360):380,[]),[I,We]=l.useState(Y);l.useEffect(()=>{const r=()=>We(Y());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[Y]);const A=l.useMemo(()=>(I-16-24)/4,[I]),Pe=l.useMemo(()=>[{title:e("game2048.rank","#"),dataIndex:"rank",key:"rank",width:50,render:(r,f,v)=>a.jsx("span",{style:{fontWeight:700,color:v<3?"#edc22e":"var(--text-secondary)"},children:v+1})},{title:e("game2048.player","Player"),dataIndex:"displayName",key:"displayName",ellipsis:!0,render:r=>a.jsx("span",{style:{fontWeight:500},children:r||"Unknown"})},{title:e("game2048.high_score","High Score"),dataIndex:"highScore",key:"highScore",width:100,render:r=>a.jsx("span",{style:{fontWeight:700,color:"#edc22e"},children:r?.toLocaleString()})},{title:e("game2048.highest_tile","Tile"),dataIndex:"highestTile",key:"highestTile",width:70,render:r=>a.jsx(E,{color:"orange",children:r})}],[e]),q=s==="playing"||s==="continue_after_win";return a.jsxs("div",{style:{maxWidth:520,margin:"0 auto",padding:"16px 16px 32px"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:16},children:[a.jsx(x,{type:"text",icon:a.jsx(Ye,{}),onClick:()=>o("/app/game"),style:{color:"var(--text-primary)"}}),a.jsx("h1",{style:{fontSize:28,fontWeight:800,color:"#edc22e",margin:0,flex:1},children:"2048"}),a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsxs("div",{className:"game-2048-score-box",children:[a.jsx("div",{className:"game-2048-score-label",children:e("game2048.score","SCORE")}),a.jsxs("div",{className:"game-2048-score-value",style:{position:"relative"},children:[i.toLocaleString(),Be.map(r=>a.jsxs("span",{className:"score-addition",children:["+",r.value]},r.id))]})]}),a.jsxs("div",{className:"game-2048-score-box",children:[a.jsx("div",{className:"game-2048-score-label",children:e("game2048.best","BEST")}),a.jsx("div",{className:"game-2048-score-value",children:c.toLocaleString()})]})]})]}),a.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,flexWrap:"wrap",alignItems:"center"},children:[a.jsx(x,{icon:a.jsx(qe,{}),onClick:()=>k(m),style:{fontWeight:600},children:e("game2048.new_game","New Game")}),a.jsxs(x,{icon:a.jsx(Je,{}),onClick:be,disabled:S.length===0||g<=0||!q,style:{fontWeight:600},children:[e("game2048.undo","Undo")," (",g,")"]}),m==="time_limit"&&q&&a.jsxs("div",{className:`challenge-timer ${u<=30?"warning":"normal"}`,children:[a.jsx(ue,{}),dt(u)]}),m==="move_limit"&&q&&a.jsxs("div",{className:`challenge-timer ${p<=10?"warning":"normal"}`,children:[a.jsx(he,{}),p," ",e("game2048.moves","moves")]}),a.jsxs("span",{style:{marginLeft:"auto",fontSize:13,color:"var(--text-secondary)"},children:[e("game2048.moves","Moves"),": ",h]})]}),a.jsxs("div",{className:"game-2048-board",style:{width:I,height:I,margin:"0 auto"},onTouchStart:Ae,onTouchEnd:ze,children:[n.length===4&&n.map((r,f)=>r.map((v,y)=>{const z=T&&T[0]===f&&T[1]===y,me=b.some(([De,Oe])=>De===f&&Oe===y),$e=z?"tile-new":me?"tile-merged":"";return a.jsx("div",{className:`game-2048-cell ${v>0?ct(v):""} ${$e}`,style:{width:A,height:A,fontSize:v>=1024?A*.28:A*.38},children:v>0?v:""},`${f}-${y}`)})),s==="lost"&&a.jsxs("div",{className:"game-2048-overlay game-over",children:[a.jsx("div",{className:"game-2048-overlay-text",children:e("game2048.game_over","Game Over!")}),a.jsxs("div",{style:{fontSize:16,color:"var(--text-secondary)",fontWeight:500}
1,children:[e("game2048.final_score","Score"),": ",i.toLocaleString()]}),a.jsx(x,{type:"primary",size:"large",onClick:()=>k(m),children:e("game2048.try_again","Try Again")})]}),s==="won"&&a.jsxs("div",{className:"game-2048-overlay game-won",children:[a.jsx("div",{className:"game-2048-overlay-text",children:e("game2048.you_win","You Win!")}),a.jsxs("div",{style:{display:"flex",gap:8},children:[a.jsx(x,{type:"primary",size:"large",onClick:we,children:e("game2048.continue_playing","Keep Going")}),a.jsx(x,{size:"large",onClick:()=>k(m),children:e("game2048.new_game","New Game")})]})]})]}),a.jsxs("div",{style:{marginTop:12,padding:"12px 16px",borderRadius:10,background:"var(--bg-elevated)",border:"1px solid var(--border-primary)"},children:[a.jsxs("div",{onClick:()=>Ne(r=>!r),style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"},children:[a.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:e("game2048.how_to_play","How to play")}),a.jsx("span",{style:{fontSize:12,color:"var(--text-secondary)",transition:"transform 0.2s",transform:re?"rotate(180deg)":"rotate(0)"},children:"▼"})]}),re&&a.jsxs("div",{style:{marginTop:10,fontSize:13,lineHeight:1.7,color:"var(--text-secondary)"},children:[a.jsxs("div",{style:{marginBottom:8},children:[a.jsx(E,{color:"blue",style:{marginBottom:4},children:"💻 PC"}),a.jsx("div",{style:{paddingLeft:4},children:e("game2048.guide_pc","Use arrow keys (← ↑ ↓ →) to slide all tiles in that direction.")})]}),a.jsxs("div",{style:{marginBottom:8},children:[a.jsx(E,{color:"green",style:{marginBottom:4},children:"📱 Mobile"}),a.jsx("div",{style:{paddingLeft:4},children:e("game2048.guide_mobile","Swipe on the board (left, right, up, down) to slide tiles.")})]}),a.jsxs("div",{style:{marginBottom:8},children:[a.jsxs(E,{color:"orange",style:{marginBottom:4},children:["🎯 ",e("game2048.guide_rules_title","Rules")]}),a.jsxs("ul",{style:{margin:"4px 0 0 16px",padding:0},children:[a.jsx("li",{children:e("game2048.guide_rule1","Tiles with the same number merge into one when they collide.")}),a.jsx("li",{children:e("game2048.guide_rule2","Each move spawns a new tile (2 or 4) at a random empty spot.")}),a.jsx("li",{children:e("game2048.guide_rule3","Reach the 2048 tile to win! You can keep playing for a higher score.")}),a.jsx("li",{children:e("game2048.guide_rule4","Game over when no more moves are possible.")})]})]}),a.jsxs("div",{children:[a.jsxs(E,{color:"purple",style:{marginBottom:4},children:["💡 ",e("game2048.guide_tips_title","Tips")]}),a.jsxs("ul",{style:{margin:"4px 0 0 16px",padding:0},children:[a.jsx("li",{children:e("game2048.guide_tip1","Keep your highest tile in a corner.")}),a.jsx("li",{children:e("game2048.guide_tip2","Build a chain of descending values along one edge.")}),a.jsx("li",{children:e("game2048.guide_tip3","Use Undo wisely — you only have 5 per game!")})]})]})]})]}),a.jsx("div",{style:{marginTop:20},children:a.jsx(Xe,{activeKey:N,onChange:ke,items:[{key:"challenge",label:a.jsxs("span",{children:[a.jsx(Ve,{})," ",e("game2048.challenge","Challenge")]}),children:a.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[a.jsxs("div",{onClick:()=>k(null),style:{flex:"1 1 140px",padding:16,borderRadius:12,cursor:"pointer",border:m===null?"2px solid #edc22e":"1px solid var(--border-primary)",background:"var(--bg-elevated)",transition:"all 0.2s"},children:[a.jsx("div",{style:{fontSize:24,marginBottom:4},children:"🎮"}),a.jsx("div",{style:{fontWeight:700,color:"var(--text-primary)",marginBottom:4},children:"Classic"}),a.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:e("game2048.classic_desc","No limits, reach 2048!")})]}),a.jsxs("div",{onClick:()=>k("time_limit"),style:{flex:"1 1 140px",padding:16,borderRadius:12,cursor:"pointer",border:m==="time_limit"?"2px solid #1677ff":"1px solid var(--border-primary)",background:"var(--bg-elevated)",transition:"all 0.2s"},children:[a.jsx("div",{style:{fontSize:24,marginBottom:4},children:a.jsx(ue,{style:{color:"#1677ff"}})}),a.jsx("div",{style:{fontWeight:700,color:"var(--text-primary)",marginBottom:4},children:e("game2048.challenge_time","Time Limit")}),a.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:e("game2048.challenge_time_desc","Best score in 3 minutes")})]}),a.jsxs("div",{onClick:()=>k("move_limit"),style:{flex:"1 1 140px",padding:16,borderRadius:12,cursor:"pointer",border:m==="move_limit"?"2px solid #52c41a":"1px solid var(--border-primary)",background:"var(--bg-elevated)",transition:"all 0.2s"},children:[a.jsx("div",{style:{fontSize:24,marginBottom:4},children:a.jsx(he,{style:{color:"#52c41a"}})}),a.jsx("div",{style:{fontWeight:700,color:"var(--text-primary)",marginBottom:4},children:e("game2048.challenge_moves","Move Limit")}),a.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:e("game2048.challenge_moves_desc","Best score in 100 moves")})]})]})},{key:"leaderboard",label:a.jsxs("span",{children:[a.jsx(Ze,{})," ",e("game2048.leaderboard","Leaderboard")]}),children:a.jsx(Qe,{dataSource:Te,columns:Pe,rowKey:"userId",loading:Ce,pagination:!1,size:"small",locale:{emptyText:a.jsx(fe,{description:e("game2048.no_data","No data yet")})},style:{background:"var(--bg-elevated)"}})},{key:"stats",label:a.jsxs("span",{children:[a.jsx(et,{})," ",e("game2048.statistics","Statistics")]}),children:_?a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(140px, 1fr))",gap:12},children:[{label:e("game2048.games_played","Games Played"),value:_.gamesPlayed},{label:e("game2048.win_rate","Win Rate"),value:`${(_.winRate*100).toFixed(1)}%`},{label:e("game2048.highest_tile","Highest Tile"),value:_.highestTile}
1,{label:e("game2048.high_score","High Score"),value:_.highestScore?.toLocaleString()},{label:e("game2048.avg_score","Average Score"),value:Math.round(_.averageScore)?.toLocaleString()}].map(r=>a.jsxs("div",{style:{padding:16,borderRadius:10,background:"var(--bg-elevated)",border:"1px solid var(--border-primary)",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginBottom:4},children:r.label}),a.jsx("div",{style:{fontSize:22,fontWeight:700,color:"var(--text-primary)"},children:r.value})]},r.label))}):a.jsx(fe,{description:Ee?e("game2048.loading","Loading..."):e("game2048.no_data","No data yet")})}]})}),a.jsxs(tt,{open:Le,title:e("game2048.resume_game","Resume Game"),onCancel:de,footer:[a.jsx(x,{onClick:de,children:e("game2048.new_game","New Game")},"new"),a.jsx(x,{type:"primary",onClick:Ge,children:e("game2048.resume_game","Resume")},"resume")],centered:!0,children:[a.jsx("p",{children:e("game2048.resume_confirm","You have a game in progress. Resume?")}),a.jsxs("p",{style:{color:"var(--text-secondary)"},children:[e("game2048.score","Score"),": ",a.jsx("strong",{children:i.toLocaleString()})," |"," ",e("game2048.highest_tile","Tile"),": ",a.jsx("strong",{children:d})]})]})]})};export{vt as default};

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.