diff --git a/.gitattributes b/.gitattributes index 24cb23713311ea268c04b3bfd8a191c539ee610e..a6344aac8c09253b3b630fb776ae94478aa0275b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -33,7 +33,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text -frontend/images/vai-logo.png filter=lfs diff=lfs merge=lfs -text -frontend/images/vai-logo-carved.webp filter=lfs diff=lfs merge=lfs -text -frontend/images/vai-logo-carved@2x.webp filter=lfs diff=lfs merge=lfs -text -frontend/images/vai-logo-stone@2x.webp filter=lfs diff=lfs merge=lfs -text diff --git a/.rebuild-v101 b/.rebuild-v101 deleted file mode 100644 index f00a5bed2154cffea8cbf0c91c27aed49095c54e..0000000000000000000000000000000000000000 --- a/.rebuild-v101 +++ /dev/null @@ -1 +0,0 @@ -Force rebuild v101 — remove LegendRing + LegendWall — 2026-04-08 \ No newline at end of file diff --git a/.rebuild-v101b b/.rebuild-v101b deleted file mode 100644 index 755b0de2e8cd84f711850147e6c0847f73254048..0000000000000000000000000000000000000000 --- a/.rebuild-v101b +++ /dev/null @@ -1 +0,0 @@ -FORCE REBUILD v101b — LegendRing + LegendWall removal — 2026-11-23 \ No newline at end of file diff --git a/.rebuild-v101c b/.rebuild-v101c deleted file mode 100644 index 1912e995b276d282f97c466bdd2396fbfb5cb2f6..0000000000000000000000000000000000000000 --- a/.rebuild-v101c +++ /dev/null @@ -1 +0,0 @@ -FORCE REBUILD v101c — bump cache-bust to ?v=101 — 2026-11-23 \ No newline at end of file diff --git a/.rebuild-v108-exact b/.rebuild-v108-exact deleted file mode 100644 index 2476f5cbcaf1a4a14950ce227662ae5b790ae63b..0000000000000000000000000000000000000000 --- a/.rebuild-v108-exact +++ /dev/null @@ -1 +0,0 @@ -FORCE REBUILD v108-exact — restore e419952 build: pristine app.js (103478 B) + cave3d.js (75909 B) via curl, strict patch chain v32..v103, esbuild guard from e419952. Fixes React error #31 caused by truncated cave3d.js. — 2026-11-23 diff --git a/.rebuild-v109 b/.rebuild-v109 deleted file mode 100644 index 7faf13ef41eac9f3993fa5ac05ea3088bd8155c9..0000000000000000000000000000000000000000 --- a/.rebuild-v109 +++ /dev/null @@ -1 +0,0 @@ -Force rebuild v109 — ao vang + logo V.AI STUDIO sau ao + tay gon + dung yen khong chay + bo bang trong 3 bong den mai ban nguyet — 2026-11-23 diff --git a/.rebuild-v112 b/.rebuild-v112 deleted file mode 100644 index ffcf6e1a5567218e987774fae4c781de29707669..0000000000000000000000000000000000000000 --- a/.rebuild-v112 +++ /dev/null @@ -1 +0,0 @@ -v112: nhan vat (ao vang polo, ten + so ao khong nguoc, mat day du, thap hon) + giang sinh giua hang diff --git a/.rebuild-v113 b/.rebuild-v113 deleted file mode 100644 index 1ff1a4d6498e3c6d0fe520ce4ee54ee252d7dee6..0000000000000000000000000000000000000000 --- a/.rebuild-v113 +++ /dev/null @@ -1 +0,0 @@ -v113: tay lien khop vai (deltoid), so+logo het nguoc (mat cong 1 phia), bang ten mat TRUOC ao — verified bang render Chromium that diff --git a/.rebuild-v116 b/.rebuild-v116 deleted file mode 100644 index 23b3cef2140530d8cda978653bbde0405946bde0..0000000000000000000000000000000000000000 --- a/.rebuild-v116 +++ /dev/null @@ -1,107 +0,0 @@ -V116f — ROOT CAUSE FOUND (23/11/2026, tu log runtime THAT) - -Trieu chung trong log: - "Co loi xay ra" | vaiLogoTex is not defined - GET /static/app.bundle.js?v=115 <- v116 DA RESTORE (muc G chi chay khi - khong restore, va muc G dat ?v=116) - GET /images/vai-logo-stone.webp ... <- KHONG co /images/vai-logo.png - => loader poster chua bao gio chay - -Chuoi nhan qua nhan: - patch_v116.mjs CO top-level await: - const esbuild = await import('esbuild') (trong khoi `if`, module scope) - Buoc 8 cua patch_v116e validate file do bang target 'es2020'. - esbuild TU CHOI top-level await khi target < es2022 => nem loi - => buoc 8 that bai => v116e GHI LAI BAN GOC patch_v116.mjs - (anchor VaiSteleText CHET van con nguyen) - => v116 dung cutFn(s,'VaiSteleText') -> khong khop 'VaiSteleText2(' -> null - -> throw -> fatal -> RESTORE CA 5 FILE, exit 0, build XANH, ?v=115 - => patch_v116b VAN CHAY (no khong biet v116 da restore), tim thay - (co san tu v115) - va chen vao `{vaiLogoTex && ( ... )}` + `map={_v116NumTex(p.number)}` - — hai ten CHI do patch_v116 dinh nghia, gio khong ton tai - => ReferenceError khi PlayerAvatar render => ErrorBoundary => mat TOAN BO app - (te hon v115, truoc khi co v116) - -DA SUA (3 lop, phong thu doc lap): - - 1. patch_v116e.mjs buoc 8: target 'es2022' (va loi chi ve target/top-level - await duoc coi la DAT chu khong restore). <- SUA NGUYEN NHAN - 2. patch_v116d.mjs V116f: neu app.js KHONG co function useVaiLogoTex( / - _v116NumTex( (tuc la v116 da restore) thi VO HIEU HOA tham chieu mo coi - TRUOC khi ghi: - {vaiLogoTex && ( -> { false && ( - map={vaiLogoTex} -> map={null} - map={_v116NumTex(p.number)} -> map={_v115BackTex(p.number)} - (JSX element khong duoc tao vi && short-circuit nen cac map= ben trong - khong bao gio duoc danh gia). Guard: neu van con vaiLogoTex/_v116NumTex - thi KHONG ghi file. <- CHAN CRASH DU CO RESTORE LAN NUA - 3. Thu tu chay giu nguyen: v116e -> v116 -> v116a -> v116b -> v116c -> v116d, - nen v116d luon la lop don cuoi cung truoc khi bundle. - -VI SAO BUOC 7 CUA v116e VAN ON: no chi la "all-or-nothing" tren 4 anchor -(cut / signature / return shape / guard section-F) da kiem tra TUNG BYTE -trong patch_v116.mjs: - const cutV = cutFn(s, 'VaiSteleText') - function VaiSteleText({ width = 2.3 }) { - return (\n <>\n - if ((hom.match(/function VaiSteleText\(/g) || []).length !== 1) bad.push('VaiSteleText != 1') -=> ca 4 deu CO va khop. Chi buoc 8 (validate) la sai target, va do la thu da sua. - -CACH XAC NHAN SAU KHI REBUILD (1 request, khong can token): - GET https://bep40-hangmu-docker.hf.space/version.json - {"id":"v116"} => TOAN BO chuoi da ap dung (5 tinh nang dang chay) - {"id":"v115"} => van restore => doc tiep /api/logs (200 dong client - error gan nhat, khong can auth) de xem ten loi - Neu app crash: /api/logs se co entry "vaiLogoTex is not defined" hoac - tuong tu. Neu v116d lop 2 hoat dong thi app se KHONG crash ma chi thieu - tinh nang (log se co "[v116d] WARN: patch_v116 da RESTORE ..."). - --------------------------------------------------------------------------------- -NOI DUNG GOC (giu lai de tham khao) --------------------------------------------------------------------------------- -v116 gom 6 patch, chay trong build/esbuild.config.mjs truoc khi bundle: - -patch_v116.mjs - LOGO AO: VAI_LOGO_URL + _v116LoadLogoTex (TextureLoader, crossOrigin, - cache module) + useVaiLogoTex (state vi load bat dong bo) + _v116NumTex - - CHU V.AI STUDIO TRONG HANG -> drawImage anh poster: - cave3d makeBannerTex(), home3d drawRedPlaque() + VaiSteleText2() - - BINH CHON: POLL_QUESTIONS 4 cau MU -> 4 cau AI; hook vote -> - _att_bump(name,"votes"); nap "votes" vao _att_load/_att_pull - (VONG LAP quet moi khoi `_att_stats[str(k)[:60]] = {`, in ra so - khoi da sua — "2 khoi" moi la dung); _att_score +votes*3; - /api/attendance/top tra "votes"; cot thu 4 o BangVangDiemDanh - - VIDEO: thay effect tao iframe -> /api/video-proxy&loop=0, - nghe hangmu-ended (playerState===0) -> bai ke - - PLAYLIST: .board-playbar-toggle + panel an (.is-open) -patch_v116a.mjs - chon bai NGAU NHIEN luc vao hang (playIdx<0 -> Math.floor(random)) -patch_v116b.mjs - LUNG AO = poster that 0.36x0.32 (lon hon 0.26x0.244 cua - backPlateTex), boc trong guard vaiLogoTex de khong con mieng - TRANG khi map=null; texture du phong _v116FallbackTex khi 404 -patch_v116c.mjs - khoi phuc POLLING 60s cua BangVangDiemDanh; tra canvas ve - 1024x1180 + rotation -0.42 rad -patch_v116d.mjs - sua loi cat ham "React. React.useEffect" + (V116f) don tham - chieu mo coi khi v116 restore -patch_v116e.mjs - SUA ANCHOR CHET: cut + signature + return shape + guard - section-F cua patch_v116.mjs (v95 tao VaiSteleText, v97 XOA - va thay bang VaiSteleText2). Chay DAU TIEN. - -Da kiem tra TUNG BYTE trong repo (khong phai suy doan): - VaiSteleText v95 tao -> v97 XOA => anchor CHET - makeBannerTex patch_v114 TAO; v115 chi transform-syntax cave3d.js - (KHONG ghi), nen khong the lam lech - POLL_QUESTIONS = [ backend.py, khong patch nao xoa - vote handler 2 dong backend.py 46-54KB, byte-exact - _att_stats.setdefault KHONG co trong repo — patch_v83 tao luc build, v85 - viet lai, v86/v89 chi chen them; v116 la patch DUY NHAT - sua vung nay - patch_v115 tao - frontend/images/vai-logo.png CO THAT (417.7 KB, LFS) - RP_OLD / TX_OLD home3d.js la COPY (34.5KB, khong bi cat) - -Log build can doc (thu tu): - [v116e] OK: 1) ... 8) <- thieu muc nao = anchor do lech - [v116] patch_v116.mjs exit=0 - [v116b] DONE [v116c] DONE [v116d] DONE - [esbuild] v116 markers present: ... - "[v116] SKIPPED (restored)" => doc WARN ngay TREN do. diff --git a/.static-cache.json b/.static-cache.json deleted file mode 100644 index bec63dca57f0ae9a7fcdbe8aa34d6521f8c551bc..0000000000000000000000000000000000000000 --- a/.static-cache.json +++ /dev/null @@ -1 +0,0 @@ -{"files": {"version.json": "v120", "static/app.bundle.js": "v120", "static/editor.css": "v119", "styles/main.css": "v115", "styles/home.css": "v115", "styles/cavescreen.css": "v115", "styles/pachie.css": "v115", "styles/locate.css": "v115", "styles/heritage.css": "v115", "styles/modal.css": "v115", "styles/slab.css": "v116", "styles/playlist.css": "v116", "styles/chatgpt.css": "v117", "styles/rain.css": "v117", "styles/room-vote.css": "v117", "styles/invite.css": "v117", "styles/theme-picker.css": "v118", "styles/ai-news.css": "v118", "styles/donate.css": "v118", "styles/toolbar.css": "v118", "styles/portal.css": "v118", "styles/voice.css": "v119", "styles/pause-menu.css": "v119", "styles/pause-backdrops.css": "v119", "styles/cave-chat.css": "v119"}} \ No newline at end of file diff --git a/.v100-patch-marker b/.v100-patch-marker deleted file mode 100644 index a84f7e54bd1d33de8f93ed66249c234095c2de11..0000000000000000000000000000000000000000 --- a/.v100-patch-marker +++ /dev/null @@ -1 +0,0 @@ -PATCH_MARKER: remove LegendRing and LegendWall from CaveScene render - 2026-04-08 \ No newline at end of file diff --git a/Df92 b/Df92 deleted file mode 100644 index 6850b39871ddc4f6556ec7176263abe32f699506..0000000000000000000000000000000000000000 --- a/Df92 +++ /dev/null @@ -1,235 +0,0 @@ -FROM node:20-slim AS build -WORKDIR /build - -# Frontend build deps -COPY build/package.json build/package-lock.json* ./ -COPY frontend/app.js frontend/cave3d.js frontend/cavehelpers.js frontend/home3d.js frontend/store.js frontend/pwa.js frontend/scoreboard.js frontend/voice.js frontend/minigames.js frontend/env.js frontend/index.html ./frontend/ -COPY build/esbuild.config.mjs ./ -COPY backend.py . -COPY video_proxy.py . -COPY patch_boards.mjs . -COPY patch_v32.mjs . -COPY patch_v33.mjs . -COPY patch_v34.mjs . -COPY patch_v35.mjs . -COPY patch_v36.mjs . -COPY patch_v37.mjs . -COPY patch_v38.mjs . -COPY patch_v39.mjs . -COPY patch_v40.mjs . -COPY patch_v41.mjs . -COPY patch_v42.mjs . -COPY patch_v43.mjs . -COPY patch_v44.mjs . -COPY patch_v45.mjs . -COPY patch_v46.mjs . -COPY patch_v47.mjs . -COPY patch_v48.mjs . -COPY patch_v50.mjs . -COPY patch_v51.mjs . -COPY patch_v60.mjs . -COPY patch_v61.mjs . -COPY patch_v62.mjs . -COPY patch_v63.mjs . -COPY patch_v64.mjs . -COPY patch_v67.mjs . -COPY patch_v68.mjs . -COPY patch_v68a.mjs . -COPY patch_v69.mjs . -COPY patch_v70.mjs . -COPY patch_v71.mjs . -COPY patch_v72.mjs . -COPY patch_v73.mjs . -COPY patch_v74.mjs . -COPY patch_v75.mjs . -COPY patch_v76.mjs . -COPY patch_v77.mjs . -COPY patch_v78.mjs . -COPY patch_v82.mjs . -COPY patch_v83.mjs . -COPY patch_v84.mjs . -COPY patch_v85.mjs . -COPY patch_v86.mjs . -COPY patch_v87.mjs . -COPY patch_v88.mjs . -COPY patch_v89.mjs . -COPY patch_v90.mjs . -COPY patch_v91.mjs . -COPY patch_v92.mjs . - -# v26: patch_boards.mjs đưa 2 bảng TRẬN GẦN NHẤT / TRẬN SẮP TỚI về z=71 (2 bên lối vào) -# + bump VERSION_ID v25 -> v26 để khớp cache-bust ?v=26. -# v32: patch_v32.mjs — YouTube fallback canvas (màn hình không trống khi YT bị chặn) -# + các bảng TO & tách xa; VERSION_ID v31 -> v32. -# v33: patch_v33.mjs — bỏ bảng đỏ chắn cửa, cờ MU, bảng tỷ số gần lối vào; VERSION_ID v32 -> v33. -# v34: patch_v34.mjs — màn hình phát video QUA PROXY VNEWS; nhân vật quay mặt vào hang; VERSION_ID v33 -> v34. -# v35: patch_v35.mjs — PROXY THẬT VNEWS /s + hangmu-playing + Player.rotation=π; VERSION_ID v34 -> v35. -# v36: patch_v36.mjs — onMsg 'hangmu-playing' trung thực + embed youtube.com (xem ở VN); VERSION_ID v35 -> v36. -# v37: patch_v37.mjs — self-avatar quay mặt vào trong; mọi video qua proxy; _yt_meta chuẩn hoá; VERSION_ID v36 -> v37. -# v38: patch_v38.mjs — serve index.html Cache-Control no-store; VERSION_ID v37 -> v38. -# v39: patch_v39.mjs — _yt_meta chuẩn hoá ID/watch/embed/shorts; log "videos first"; VERSION_ID v38 -> v39. -# v40: patch_v40.mjs — LOG VERIFICATION-ONLY; VERSION_ID v39 -> v40. -# v41: patch_v41.mjs — bỏ gửi volume lúc load (video chạy muted); kéo slider mới unmute; VERSION_ID v40 -> v41. -# v42: patch_v42.mjs — camState.yaw π->0 (camera nhìn vào hang thấy board); VERSION_ID v41 -> v42. -# v43: patch_v43.mjs — /api/video-proxy nội bộ render embed www.youtube.com; VERSION_ID v42 -> v43. -# v44: patch_v44.mjs — homography CHUẨN acko.net (có scale bw×bh); VERSION_ID v43 -> v44. -# v45: patch_v45.mjs — FALLBACK CENTER khi board ngoài tầm nhìn + /api/diag; VERSION_ID v44 -> v45. -# v46: patch_v46.mjs — video TƯỜNG AI VNEWS (mp4 autoplay tuần tự) + billboard hết méo + /api/board/video; VERSION_ID v45 -> v46. -# v47: patch_v47.mjs — nguồn video FPT Bóng Đá (YouTube) từ Tường AI + HẾT MÉO 100% (luôn billboard) + chỉ hiển thị trên màn hình; VERSION_ID v46 -> v47. -# v48: patch_v48.mjs — playlist = YouTube RSS channel FPT Bóng Đá (UC4LvrpNXujjbGOS4RDvr41g) qua rss2json + cache TTL 10 phút + fix "t1 is not defined"; VERSION_ID v47 -> v48. -# v50: patch_v50.mjs — regex cache-bust ?v=NN -> ?v=50 + fix dứt điểm cleanup "t1 is not defined"; VERSION_ID -> v50. -# v51: patch_v51.mjs — SỬA LỖI IndentationError: unexpected indent (dòng "if out:") mà chuỗi -# v46->v47->v48 để lại (đuôi body bị dup + lệch thục lề). SPLICE LẠI vùng _board_vnews -# bằng khối sạch hợp lệ 100% + VERSION_ID -> v51 + cache-bust ?v=NN -> ?v=51. -# v52: patch_v52.mjs — ÉP BUỘC YouTube dùng /api/video-proxy (phát VN) + harden hangmu-playing -# (debounce playing:false, không ẩn khi miss probe) + video_proxy probe hardening. -# v53: patch_v53.mjs — SỬA video_proxy.py (SyntaxError từ v52 patch hỏng f-string). Thay TOÀN BỘ -# render_video_proxy bằng bản sạch: chỉ youtube.com, probe ngưỡng 8, tell guard played flag. -# v54: patch_v54.mjs — SỬA video_proxy.py (SyntaxError: f-string empty expression). Escape HOÀN CHỈNH -# tất cả brace JS `{{`/`}}` trong Python f-string triple-quoted. Chỉ youtube.com, probe 8, -# tell guard: played flag, không gửi false sau true. -# v55: patch_v55.mjs — XÓA fallback 6s (t3) ẩn iframe + probe 15s. LOGIC HIỂN THỊ: dùng -# homography CHÍNH XÁC (quadMatrix) khi board nhìn thẳng (tỷ lệ ~1) → video FULL -# khít board 24:14. Chỉ dùng billboard khi nghiêng mạnh (tỷ lệ > 1.3). -# v56: patch_v56.mjs — TRIỆT ĐỂ FIX VIDEO: Thay TOÀN BỘ effect video BoardVideoOverlay. -# - iframe.src = /api/video-proxy cho YouTube (phát VN) -# - onMsg: nghe hangmu-playing (playing:true/false) + onReady/infoDelivery -# - XÓA HẾT t1/t2/t3 fallback 6s — chỉ probe 15s interval -# - RAF loop: homography CHÍNH XÁC (quadMatrix) → video full khít board 24:14 -# v57: patch_v57.mjs — KHẮC PHỤC SURGICAL: iframe.src nocookie -> /api/video-proxy, -# onMsg thêm hangmu-playing handler, XÓA t3 6s fallback, probe 15s. -# v58: patch_v58.mjs — THAY THẾ HOÀN TOÀN EFFECT VIDEO (exact boundaries từ source hiện tại). -# - iframe.src = /api/video-proxy (www.youtube.com, phát VN) -# - onMsg: nghe hangmu-playing (true/false) + onReady/infoDelivery -# - KHÔNG có t1/t2/t3 fallback 6s -# - CHỈ probe interval 15000ms -# v59: patch_v59.mjs — FIX DEFINITIVE video_proxy.py: THAY TOÀN BỘ render_video_proxy. -# - Chỉ www.youtube.com (KHÔNG nocookie fallback) -# - Probe ngưỡng 8 (~10s) -# - tell() guard: played flag, không gửi false sau true -# - f-string escape HOÀN CHỈNH: JS braces = {{ }}, Python placeholders = {{var}} -# v61: patch_v61.mjs — BẢNG THƠ ngoài cửa hang: BILLBOARD ĐỘNG (luôn quay về -# người dùng, sửa lệch 56.8°), AUTO-FIT theo frustum (4 câu thơ luôn trọn -# khung, trước đây 2/4 góc ngoài khung trên mobile), texture 1600x680 font -# 84px (không ép ngang, không cắt chữ). MOBILE nhỏ hơn DESKTOP thật sự -# (prop `small` trước đây là dead code). VERSION_ID v60 -> v61. -# v62: patch_v62.mjs — DỌN TRANG HOME: bỏ dòng footer "Trang của người hâm mộ, -# không liên kết chính thức với Manchester United · Điều khoản & quyền riêng tư"; -# đổi slogan home-lede -> "Nơi học sĩ không biết AI vào hang và ra hang sau mỗi -# lần VIBE CODE"; dời bảng bia HANG TU TRÍ AI / AI V.AI STUDIO xuống dưới, nằm -# ngay TRÊN nhóm nút Group Zalo + Cài đặt app + Thông báo (home.css: bia hàng 2, -# nút hàng 3). VERSION_ID v61 -> v62, cache-bust ?v=62. -# v63: patch_v63.mjs — bảng thơ ngoài hang LÊN TRÊN CÙNG (depthTest=false + -# renderOrder cao), bảng logo V.AI STUDIO đứng trước dòng "Hang Tu Trí AI" -# trong DOM, bỏ áo vàng / nút ủng hộ / bảng nền video; VERSION_ID -> v63. -# v64: patch_v64.mjs — KHÔI PHỤC CỘT TREO LOGO "V.AI STUDIO" (patch v33 đã bỏ -# mount ) → dựng lại ở lề phải sân trước, phóng 1.25x, bảng -# logo nằm CAO hơn tấm bảng HTML .home-panel nên không bị che; bảng thơ -# ngoài hang -> "Thơ Hang AI"; bảng thơ trong hang -> "Thơ Nhẫn AI" + 4 câu -# mới (Thay đổi tư duy điều trước tiên / Vibe code AI đừng có nghiện / Tinh -# thần học hỏi cần cầu tiến / Đừng nghĩ làm app hiệu quả liền) + DỜI sang -# TRÁI xa màn hình lớn (-36, 5.0, -2); XOÁ "bảng trắng" trên màn hình lớn -# (watchdog 9s ẩn iframe không phát, cho lớp LED có nội dung lộ ra); dòng -# chữ bảng Hang Tu Trí AI -> "Tu học ở trong hang, ứng dụng ở ngoài hang". -# VERSION_ID v63 -> v64, cache-bust ?v=64. -# v67: patch_v67.mjs — 3 VIỆC: bỏ bảng "Thế hệ vàng", EPL→Tin AI, Ngày này năm xưa→Điểm danh. -# v68: patch_v68.mjs — 7 VIỆC: fix cột logo V.AI STUDIO [-6.5,0,62] scale 1.4, -# bỏ bảng "Thế hệ vàng", EPL→"Bảng tin AI hôm nay" (Google News RSS fallback), -# "Ngày này năm xưa"→"Bảng vàng điểm danh", backend /api/ai-news + /api/attendance/top, -# hook visits+chats, collapsible chat panel. VERSION_ID -> v68, cache-bust ?v=68. -# v68a: patch_v68a.mjs — fix ai-news fetch (gzip + Accept-Encoding: identity). -# v69: patch_v69.mjs — 5 VIỆC: fix cột logo V.AI STUDIO [-6.8,0,5.2] scale 2.0, -# v70: patch_v70.mjs — 5 VIỆC: fix logo V.AI STUDIO [-6.8,0,5.2] scale 2.0, -# v71: patch_v71.mjs — 5 VIỆC: logo V.AI STUDIO HTML overlay, -# v72: patch_v72.mjs — 5 VIỆC: logo V.AI STUDIO HTML overlay, -# v73: patch_v73.mjs — verify logo overlay, fix chat toggle CSS, -# v74: patch_v74.mjs — fix chat toggle CSS in correct location. -# v75: patch_v75.mjs — create cavescreen.css with chat toggle fix. -# v76: patch_v76.mjs — add chat toggle CSS to existing cavescreen.css. -# v77: patch_v77.mjs — fix index.html path, update cache-bust. -# v78: patch_v78.mjs — fix CSS path, add chat toggle CSS with !important. -# VERSION_ID -> v78, cache-bust ?v=92. -# VERSION_ID -> v77, cache-bust ?v=92. -# VERSION_ID -> v76, cache-bust ?v=92. -# VERSION_ID -> v75, cache-bust ?v=92. -# VERSION_ID -> v74, cache-bust ?v=92. -# verify AI news position, verify attendance hooks. -# VERSION_ID -> v73, cache-bust ?v=92. -# chat toggle CSS fix, AI news left wall, attendance hooks. -# VERSION_ID -> v72, cache-bust ?v=92. -# chat toggle floating button, AI news left wall + images, attendance hooks. -# VERSION_ID -> v71, cache-bust ?v=92. -# chat toggle visible, attendance hooks, AI news enhanced (VN datetime + -# real images + modal viewer), move board to left side. VERSION_ID -> v70, cache-bust ?v=92. -# chat toggle visible, attendance hooks fix, AI news enhanced (VN datetime + -# thumbnails + modal viewer). VERSION_ID -> v69, cache-bust ?v=92. -RUN npm install --no-audit --no-fund 2>&1 | tail -2 && \ - node patch_boards.mjs && \ - node patch_v32.mjs && \ - node patch_v33.mjs && \ - node patch_v34.mjs && \ - node patch_v35.mjs && \ - node patch_v36.mjs && \ - node patch_v37.mjs && \ - node patch_v38.mjs && \ - node patch_v39.mjs && \ - node patch_v40.mjs && \ - node patch_v41.mjs && \ - node patch_v42.mjs && \ - node patch_v43.mjs && \ - node patch_v44.mjs && \ - node patch_v45.mjs && \ - node patch_v46.mjs && \ - node patch_v47.mjs && \ - node patch_v48.mjs && \ - node patch_v50.mjs && \ - node patch_v51.mjs && \ - node patch_v60.mjs && \ - node patch_v61.mjs && \ - node patch_v62.mjs && \ - node patch_v63.mjs && \ - node patch_v64.mjs && \ - node patch_v67.mjs && \ - node patch_v68.mjs && \ - node patch_v68a.mjs && \ - node patch_v69.mjs && \ - node patch_v70.mjs && \ - node patch_v71.mjs && \ - node patch_v72.mjs && \ - node patch_v73.mjs && \ - node patch_v74.mjs && \ - node patch_v75.mjs && \ - node patch_v76.mjs && \ - node patch_v77.mjs && \ - node patch_v78.mjs && \ - node patch_v82.mjs && \ - node patch_v83.mjs && \ - node patch_v84.mjs && \ - node patch_v85.mjs && \ - node patch_v86.mjs && \ - node patch_v87.mjs && \ - node patch_v88.mjs && \ - node patch_v89.mjs && \ - node patch_v90.mjs && \ - node patch_v91.mjs && \ - node patch_v92.mjs && \ - node esbuild.config.mjs && \ - ls -la frontend/app.bundle.js - -# ============ Stage 2: Python runtime ============ -FROM python:3.11-slim -WORKDIR /app -# index.html TỪ BUILD (đã patch cache-bust ?v=92) — không COPY source -COPY --from=build /build/frontend/index.html ./frontend/index.html -COPY --from=build /build/backend.py . -# V51 FAIL-FAST: validate Python syntax NGAY — không cho IndexError/IndentError lọt ra runtime -RUN python -m py_compile backend.py -RUN pip install --no-cache-dir fastapi uvicorn[standard] huggingface_hub -COPY --from=build /build/video_proxy.py . -COPY --from=build /build/frontend/app.bundle.js ./frontend/app.bundle.js -COPY --from=build /build/frontend/env.js ./frontend/env.js -COPY frontend/images ./frontend/images -COPY frontend/styles ./frontend/styles -COPY frontend/fonts ./frontend/fonts -COPY frontend/pwa ./frontend/pwa -CMD ["python", "backend.py"] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5d4138774815f793e747eae5f4b24bc7d9515af8..2ff2cbc2a14ae1a351778eac4c4b530849a8394d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,285 +1,60 @@ FROM node:20-slim AS build WORKDIR /build -# curl + CA certs are needed to restore the pristine sources from the commit. -RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && rm -rf /var/lib/apt/lists/* - -# Build deps + every frontend module EXCEPT app.js and cave3d.js. -# Those two are larger than the Hub's per-file content-upload cap, so the copies -# currently committed to the repo are TRUNCATED (app.js 61.4KB vs 103.5KB, -# cave3d.js 71.4KB vs 75.9KB). A truncated cave3d.js loses ~4.5KB out of the -# MIDDLE of a block, so a meshStandardMaterial lands in a child slot -# instead of as a prop, and React throws error #31 ("objects are not valid as a -# React child", listing MeshStandardMaterial keys). esbuild cannot catch this -- -# it only validates syntax, never JSX semantics. These two files must therefore -# never be used as build input; they are re-downloaded and verified below. +# Frontend build deps COPY build/package.json build/package-lock.json* ./ -COPY frontend/cavehelpers.js frontend/home3d.js frontend/store.js frontend/pwa.js frontend/scoreboard.js frontend/voice.js frontend/minigames.js frontend/env.js frontend/index.html ./frontend/ +COPY frontend/app.js frontend/cave3d.js frontend/cavehelpers.js frontend/home3d.js frontend/store.js frontend/pwa.js frontend/scoreboard.js frontend/voice.js frontend/minigames.js frontend/env.js ./frontend/ COPY build/esbuild.config.mjs ./ COPY backend.py . -COPY video_proxy.py . -COPY patch_*.mjs . - -# Restore pristine app.js + cave3d.js from commit e419952, then VERIFY. -# A silent truncation is exactly what broke the last deploy, so assert on: -# 1) exact byte counts of the known-good commit -# 2) the anchors patch_v63.mjs needs in cave3d.js -# 3) the anchors patch_v98.mjs (logs as v100) needs in app.js -RUN curl -fsSL -o frontend/app.js "https://huggingface.co/spaces/bep40/hangmu-docker/raw/e419952b16af1e86df9c14df816d551861da17c5/frontend/app.js" && \ - curl -fsSL -o frontend/cave3d.js "https://huggingface.co/spaces/bep40/hangmu-docker/raw/e419952b16af1e86df9c14df816d551861da17c5/frontend/cave3d.js" && \ - ls -la frontend/app.js frontend/cave3d.js && \ - APP=$(stat -c%s frontend/app.js) && \ - CAVE=$(stat -c%s frontend/cave3d.js) && \ - echo "[restore] app.js=$APP bytes cave3d.js=$CAVE bytes" && \ - test "$APP" = "103478" || { echo "[restore] FATAL: app.js is $APP bytes, expected 103478 (truncated download)"; exit 1; } && \ - test "$CAVE" = "75909" || { echo "[restore] FATAL: cave3d.js is $CAVE bytes, expected 75909 (truncated download)"; exit 1; } && \ - grep -q "BOARD.w / 2 - 1.5" frontend/cave3d.js || { echo "[restore] FATAL: cave3d.js missing Board() anchor for patch_v63"; exit 1; } && \ - grep -q "intensity={30} distance={16} decay={1.8}" frontend/cave3d.js || { echo "[restore] FATAL: cave3d.js missing pointLight anchor for patch_v63"; exit 1; } && \ - grep -q "const isMuKit = (p.kit == null)" frontend/app.js || { echo "[restore] FATAL: app.js missing isMuKit anchor for patch_v98"; exit 1; } && \ - grep -q "map={isMuKit ? muKitTex() : null}" frontend/app.js || { echo "[restore] FATAL: app.js missing body material anchor for patch_v98"; exit 1; } && \ - echo "[restore] OK: exact byte counts + all patch anchors verified" - -RUN curl -fsSL -o frontend/vai-stele-poster.png "https://huggingface.co/spaces/bep40/VAIHOME/resolve/main/public/poster_1794291583927.png" || true - -# Patch chain identical to commit e419952 (boards, v32..v48, v50/51, v60..v64, -# v67..v78, v82..v98, v101..v103). STRICT -- no "|| true" masking: the pristine -# sources are restored and anchor-verified above, so every patch must apply. -# -# V109 (patch_v109.mjs) runs late because it must see the FINAL post-chain -# source. It: -# 1) flips the DEFAULT kit to yellow + V.AI STUDIO back logo (patch_v98 left -# the default red, so the yellow kit was only used if you picked it); -# 2) widens the shoulders to 0.335 so the arms leave the 0.3-radius torso -# (patch_v98's 0.285 sank them INTO the body) and slims arms/hands; -# 3) makes "standing still" truly static with a real position-delta guard -# (the server never re-sends 'idle', so remote avatars kept running); -# 4) removes the leftover blank plaque with the semicircular roof + 3 bulbs -# (, mounted at [0,-0.7,-22]) that patch_v91 put in -# front of the benches. -# -# V112 (patch_v112.mjs) runs after the main chain and FIXES the -# three defects V109 introduced (verified against the original source): -# 1) BACK TEXT WAS MIRRORED. V109 used a flat plane at z=-0.315 with -# side={THREE.DoubleSide}. The third-person camera sits at local -z -# (CameraRig: back = (sin yaw, cos yaw), yaw = PI), so it looked at the -# BACK face of that plane and every digit + "V.AI STUDIO" came out -# reversed. V112 replaces it with a curved SHELL (cylinderGeometry, one -# arc) that has a single outward face -- it cannot mirror. -# 2) THE FACE WAS INVISIBLE. The original face plane sits at z=-0.215 (behind -# the head, camera side) with a +z normal and FrontSide, so the camera was -# looking at its culled back face; and the hair cap (thetaLength 0.72 PI) -# covered the whole face anyway. V112 uses a curved cap on +z with a new -# texture (brows, whites, pupils, glints, nose, mouth) and cuts the hair to -# 0.30 PI so it sits on the crown. -# 3) NO NAME TAG. V112 adds a curved name plate on the back of the jersey. -# It also shortens the avatar (AVATAR_SCALE 0.94, head 0.24) for better -# proportions, restyles the kit (polo collar, piping, belt + buckle, cream -# socks, navy trousers) and replaces the fire pit + trophy in the centre of the -# cave with : a large decorated tree with blinking lights, a -# star, baubles, stockings and gifts, plus a snowman and Santa Claus. Warm -# lighting is preserved (the old fire pit was intensity 100). -# Like V109 it self-verifies and RESTORES the previous sources on any integrity -# failure, so a bad anchor can never take the Space down. -# -# V113 (patch_v113.mjs) runs LAST, immediately before esbuild. It fixes the -# three defects the user still saw on the v112 deploy (all reproduced in a real -# headless-Chromium render of this exact patch chain, then re-rendered to verify): -# 1) DETACHED ARMS. V109 moved the shoulders out to 0.335 and V112 slimmed the -# arm tube to r=0.058, but nothing ever bridged the shoulder gap. At the arm -# pivot height the torso radius is 0.2704 while the arm's inner edge sits at -# 0.2770 -- a 0.0066 slit that widens to 0.2424 at the top of the tube, so -# the arms visibly floated. V113 rebuilds each arm as one group pivoting at -# the shoulder joint (±0.315, 1.30) with a r=0.10 deltoid sphere centred -# exactly on the pivot: because the sphere's centre never moves when the -# group rotates, the socket stays sealed at every swing angle. Numeric check: -# distance from pivot to torso surface = 0.0408 < 0.10 deltoid radius, and the -# upper-arm tube overlaps the torso by 0.021..0.047 across -60..+60 degrees. -# 2) MIRRORED NUMBER + LOGO. The deploy still carried V109's flat plane at -# z=-0.315 with side={THREE.DoubleSide}. V112's curved-shell replacement was -# never applied: its idempotency guard tested for the literal string -# 'V112: BANG TEN', which is also present in the comment block V112 itself -# inserts, so the guard matched its own comment and skipped the insert. -# V113 removes that plane outright and re-adds the single-faced curved shell. -# Orientation verified numerically, not by eye: with an asymmetric test -# texture, canvas-left maps to screen-left for both plates, and all 130 -# sector vertices face the camera (nothing is culled). -# 3) NO NAME ON THE FRONT. V112 only ever placed the name on the BACK (and that -# insert was skipped too). V113 adds a curved name plate on the CHEST. -# Its guards test for real JSX geometry signatures, never for comment text, so it -# cannot repeat V112's self-matching bug. Verified idempotent (second run leaves -# app.js byte-identical) and it RESTORES both sources on any integrity failure. - -# V114 (patch_v114.mjs) runs after V113, immediately before esbuild. Five user -# requests, each verified by number or by a real headless-Chromium render: -# 1) LOWER BODY PROPORTIONS. The torso is capsule(0.30, 0.34) => 0.60 wide but -# the hips were capsule(0.24, 0.22) => only 0.48 wide, and the thighs at -# x=+-0.11 with r=0.088 spanned just 0.396. The character read "top heavy, -# bottom pinched". Hips are now a CYLINDER r=0.30 => exactly 0.60 wide, the -# same as the shirt, and SHORTER (height 0.35, was 0.70). Measured on a real -# render: hip/torso width ratio 0.725 -> 0.872, hips 187px -> 225px on screen. -# A capsule scaled down in Y was tried first and rejected: from the side it -# renders as a flattened ellipsoid disc (caught in a render, then replaced by -# a cylinder, which gives the exact width from every angle). -# 2) V.AI STUDIO LOGO ON THE SHIRT, ABOVE THE NUMBER, BIGGER. backPlateTex is -# rewritten on a 320x260 canvas: circular crest with the golden "V" and -# "STUDIO" on top (the same lockup as the carved plaque at the cave mouth), -# the shirt number large underneath. The curved back shell was resized to -# r=0.316, height 0.34, arc 2*0.662 rad so its geometry aspect (1.231) equals -# the canvas aspect (1.231) exactly -- no stretching. Verified numerically: -# v=1 sits at +H/2 (not flipped), u=0 maps to screen-left (not mirrored), and -# all 40 shell vertices face the camera. -# 3) YOUTUBE SCREEN PINNED TO THE CAVE WALL. The overlay used to recompute a -# BILLBOARD every frame: it took the projected centroid of the board and drew -# a max(width) x max(height) box there, so rotating the camera slid the video -# across the screen. It now uses a HOMOGRAPHY that maps the overlay onto the -# board's four projected corners, so the video is glued to the board in 3D -# and only scales/skews with perspective. The element size must equal the -# corner-derived |c1-c0| x |c3-c0| (a fixed 1280x720 left 3 corners off by up -# to 784px -- measured). quadMatrix() already existed in the file but was -# DEAD CODE and also mathematically wrong; it is replaced by a correct -# square->quad projective transform, verified to map 4/4 corners with 0.000px -# error and to bow the interior correctly (projective centre (688.6,255.9) -# vs the naive average (834.2,337.1)). An allFront guard hides the overlay -# when the board goes behind the camera so no flipped ghost is drawn. -# 4) ALL Hang MU / MANCHESTER UNITED TEXT IN THE CAVE -> V.AI STUDIO. The two -# vault banners ("GLORY GLORY", "MAN UNITED") are redrawn as the V.AI STUDIO -# lockup; the LED fallback poster that shows whenever YouTube is blocked (the -# normal case in VN) plus its scrolling ticker, the channel badges, the -# thumbnail caption and the away-kit chest crest ("* UNITED *") all move to -# V.AI STUDIO / HANG TU TRI AI. Hard-coded hero biographies were left alone: -# those are historical statements about real players, not branding. -# 5) MU QUIZ -> BASIC AI KNOWLEDGE. QUIZ_QUESTIONS goes from 5 football -# questions to 14 AI ones (Grok -> xAI, NVIDIA -> Jensen Huang, LLM, CUDA, -# AlphaGo, supervised learning, temperature, ...), and the right/wrong -# messages no longer talk about Sir Alex or the Red Devils. -# Guards test real JSX/Python signatures, never comment text. Verified idempotent -# (a second run leaves app.js, cave3d.js and backend.py byte-identical) and it -# RESTORES every source and exits 0 on any integrity failure, so a bad anchor can -# never take the Space down. - -# V115 (patch_v115.mjs) runs after V114, immediately before esbuild. The user -# still reported the SAME three defects after v114: -# (1) arms detached from the body, (2) number + logo still mirrored on the -# shirt, (3) name plate still not visible on the front of the shirt. -# Because it was the THIRD identical report, V115 changes the approach instead of -# re-doing the same reasoning: -# * NO MORE CYLINDER-ARC UV MATH. V112/V113/V114 all printed text on a -# cylinderGeometry arc and each argued "u=0 lands on screen-left" from -# x = r*sin(t), z = r*cos(t). That is a 4-5 step derivation and one wrong -# sign flips every digit -- exactly what happened three times. V115 uses a -# PLANE + ROTATION, whose orientation cannot be got wrong: a plane's normal -# is +z and its canvas reads correctly from +z; rotating PI about Y points -# the normal at -z, so a camera at local -z still sees the FRONT face. -# DoubleSide (the V109 bug) only makes a plane VISIBLE from behind; it never -# makes it READ correctly. -# * ORIENTATION RE-DERIVED FROM CameraRig, NOT GUESSED. back = (sin yaw, -# cos yaw) with the default yaw = PI gives (0,0,-1), so the camera sits at -# local -z. The original source agrees: the face plane is at z=-0.215 and -# the number plane at z=-0.31, both on the -z side. So the side of the shirt -# the player actually SEES is -z. V113 had put the name plate at z=+0.312, -# i.e. on the far side of the body, which is why it was never visible. -# V115 puts BOTH plates at -z, each rotated PI about Y. -# * ARMS are one group pivoting at the shoulder (+-0.30, 1.30) with a deltoid -# sphere centred exactly on the pivot, so the socket cannot open at any swing -# angle: distance from pivot to the torso surface is -# sqrt(0.30^2 + 0.13^2) - 0.30 = 0.0407 < 0.105 deltoid radius. The upper -# arm (r 0.068) has its inner edge at 0.232, inside the 0.299 torso radius at -# y=1.16, so the tube is embedded in the body with no slit. -# * STATE-INDEPENDENT CUTS. V113 died silently when V112 changed the geometry -# underneath it, which is why v114's own fixes then never applied either. -# V115 anchors on NOTHING that V112/V113/V114 created: it removes the -# original `{p.number != null && (...)}` block (brace-balanced, verified to -# contain useNumTex( before cutting), removes only LEAF elements that -# still reference the old plate textures, removes the two arm groups, and -# inserts its new block before , an anchor that has -# existed since the original source and is still used by useFrame. -# It never cuts a : contains the whole avatar. -# Self-verifying like V109..V114: it re-asserts the avatar is intact -# (rootRef == 1, torso material still present), validates all three JSX files -# with esbuild.transform, and RESTORES every source + exits 0 on any failure, so -# a bad anchor can never take the Space down. +COPY patch_boards.mjs . +COPY patch_v32.mjs . +COPY patch_v33.mjs . +COPY patch_v34.mjs . +COPY patch_v35.mjs . + +# v26: patch_boards.mjs đưa 2 bảng TRẬN GẦN NHẤT / TRẬN SẮP TỚI về z=71 (2 bên lối vào) +# + bump VERSION_ID v25 -> v26 để khớp cache-bust ?v=26. +# v32: patch_v32.mjs — YouTube fallback canvas (màn hình không trống khi YT bị chặn) +# + các bảng trong hang TO hơn & tách xa nhau; VERSION_ID v31 -> v32. +# v33: patch_v33.mjs — bỏ bảng đỏ chắn cửa hang, cờ MU vào khung gần cửa, bảng tỷ số +# gần lối vào; dàn các bảng trong hang quanh tường không chồng; VERSION_ID v32 -> v33. +# v34: patch_v34.mjs — màn hình lớn phát video QUA PROXY bep40-vnews (xem được ở VN; +# youtube-nocookie bị chặn); nhân vật quay mặt vào trong hang khi mới vào; +# VERSION_ID v33 -> v34. +# v35: patch_v35.mjs — PROXY THẬT: vnews /s render trang embed YouTube + gửi tín +# hiệu 'hangmu-playing' (màn hình không trống — nếu không phát thì fallback +# canvas LED hiện); backend Player.rotation mặc định = π (nhân vật mới vào +# quay mặt vào hang cho MỌI người chơi thấy); relay âm lượng TV -> iframe; +# VERSION_ID v34 -> v35. RUN npm install --no-audit --no-fund 2>&1 | tail -2 && \ node patch_boards.mjs && \ node patch_v32.mjs && \ node patch_v33.mjs && \ node patch_v34.mjs && \ node patch_v35.mjs && \ - node patch_v36.mjs && \ - node patch_v37.mjs && \ - node patch_v38.mjs && \ - node patch_v39.mjs && \ - node patch_v40.mjs && \ - node patch_v41.mjs && \ - node patch_v42.mjs && \ - node patch_v43.mjs && \ - node patch_v44.mjs && \ - node patch_v45.mjs && \ - node patch_v46.mjs && \ - node patch_v47.mjs && \ - node patch_v48.mjs && \ - node patch_v50.mjs && \ - node patch_v51.mjs && \ - node patch_v60.mjs && \ - node patch_v61.mjs && \ - node patch_v62.mjs && \ - node patch_v63.mjs && \ - node patch_v64.mjs && \ - node patch_v67.mjs && \ - node patch_v68.mjs && \ - node patch_v68a.mjs && \ - node patch_v69.mjs && \ - node patch_v70.mjs && \ - node patch_v71.mjs && \ - node patch_v72.mjs && \ - node patch_v73.mjs && \ - node patch_v74.mjs && \ - node patch_v75.mjs && \ - node patch_v76.mjs && \ - node patch_v77.mjs && \ - node patch_v78.mjs && \ - node patch_v82.mjs && \ - node patch_v83.mjs && \ - node patch_v84.mjs && \ - node patch_v85.mjs && \ - node patch_v86.mjs && \ - node patch_v87.mjs && \ - node patch_v88.mjs && \ - node patch_v89.mjs && \ - node patch_v90.mjs && \ - node patch_v91.mjs && \ - node patch_v92.mjs && \ - node patch_v93.mjs && \ - node patch_v94.mjs && \ - node patch_v95.mjs && \ - node patch_v96.mjs && \ - node patch_v97.mjs && \ - node patch_v98.mjs && \ - node patch_v101.mjs && \ - node patch_v102.mjs && \ - node patch_v103.mjs && \ - node patch_v109.mjs && \ - node patch_v112.mjs && \ - node patch_v113.mjs && \ - node patch_v114.mjs && \ - node patch_v115.mjs && \ node esbuild.config.mjs && \ ls -la frontend/app.bundle.js -# ============ Stage 2: Python runtime ============ +# ---- runtime ---- FROM python:3.11-slim + WORKDIR /app -COPY --from=build /build/frontend/index.html ./frontend/index.html + +RUN pip install --no-cache-dir fastapi uvicorn[standard] + +# backend.py patched (VERSION_ID=v35) trong build stage COPY --from=build /build/backend.py . -RUN python -m py_compile backend.py -RUN pip install --no-cache-dir fastapi uvicorn[standard] huggingface_hub -COPY --from=build /build/video_proxy.py . +COPY frontend/index.html ./frontend/index.html COPY --from=build /build/frontend/app.bundle.js ./frontend/app.bundle.js COPY --from=build /build/frontend/env.js ./frontend/env.js +# legend portraits (10 MU huyền thoại) phục vụ từ /images/legends/ COPY frontend/images ./frontend/images +# Design system + fonts COPY frontend/styles ./frontend/styles COPY frontend/fonts ./frontend/fonts +# PWA: manifest, service worker, icons COPY frontend/pwa ./frontend/pwa -RUN pip install --no-cache-dir beautifulsoup4 lxml requests \ - && echo "[V95] bs4/lxml/requests ok" -CMD ["python", "backend.py"] +EXPOSE 7860 + +CMD ["python", "backend.py"] \ No newline at end of file diff --git a/backend.py b/backend.py index 694d0c4ab6def7a78499fa6f4d6d0ad5894d937a..49d77dc225551b0507fabe675f9b59a2986e84a9 100644 --- a/backend.py +++ b/backend.py @@ -13,7 +13,6 @@ Tái hiện đầy đủ tính năng hangmu.online: """ import asyncio import json -import math import os import random import re @@ -26,9 +25,7 @@ from typing import Dict, List, Optional from fastapi import FastAPI, WebSocket, WebSocketDisconnect, HTTPException from fastapi.staticfiles import StaticFiles -from fastapi.responses import FileResponse, JSONResponse, HTMLResponse -import video_proxy # V43: /api/video-proxy — màn hình lớn tự render YouTube embed (không phụ thuộc VNEWS), HTMLResponse -import video_proxy # V43: /api/video-proxy — màn hình lớn tự render YouTube embed (không phụ thuộc VNEWS) +from fastapi.responses import FileResponse, JSONResponse from pydantic import BaseModel import uvicorn @@ -37,7 +34,7 @@ app = FastAPI(title="Hang MU Backend") # VERSION ổn định — khớp cache-bust ?v=10 của bundle. Không đổi ngẫu nhiên # theo uuid (trước đây uuid4().hex[:8] đổi mỗi lần restart → client tưởng # "Có bản mới" và tự reload liên tục). Chỉ đổi khi ta chủ động deploy bản mới. -VERSION_ID = "v117" +VERSION_ID = "v31" # ============ Client error log (từ ErrorBoundary / window.onerror) ============ _client_logs = [] @@ -56,14 +53,6 @@ async def api_logs(): return {"logs": _client_logs[-200:]} # ============ Attendance (chuyên cần bia đá) ============ -def _att_pick_thumb(item): - for tag in ("media:thumbnail", "media:content", "enclosure"): - m = re.search(rf"<{tag}[^>]*url=[\"']([^\"']+)[\"']", item) - if m: - return m.group(1) - return "" - - @app.get("/api/attendance") async def api_attendance(): plist = list(rooms.get("lobby", {}).values()) @@ -128,599 +117,6 @@ _ON_THIS_DAY = [ (12, 31, 1941, "Sir Alex Ferguson chào đời", "HLV vĩ đại nhất lịch sử bóng đá Anh, sinh ở Govan, Glasgow."), ] - -# ============ BẢNG TIN AI (Nguồn: bep40/VNEWS) — cache 8 giờ ============ -# V67: "Bảng tin AI hôm nay" — 10 tin mới nhất theo từ khoá AI / trí tuệ nhân tạo. -# Lấy từ Space bep40/VNEWS (endpoint công khai /api/hashtag/sources); server giữ -# cache 8 giờ để không gọi VNEWS liên tục (VNEWS cũng tự cache). -AI_NEWS_URL = "https://bep40-vnews.hf.space/api/hashtag/sources" -AI_NEWS_TOPIC = "AI trí tuệ nhân tạo" -AI_NEWS_TTL = 8 * 3600 # 8 giờ -_ai_news_cache = {"at": 0.0, "items": []} - -def _ai_news_fetch(): - """Gọi Google News RSS lấy 10 tin AI mới nhất. Trả list {title, url, via, pubDate, thumbnail}.""" - import xml.etree.ElementTree as ET - from urllib.parse import quote as _q - url = ("https://news.google.com/rss/search?q=" + _q(AI_NEWS_TOPIC) - + "&hl=vi&gl=VN&ceid=VN:vi") - req = urllib.request.Request(url, headers={ - "User-Agent": "Mozilla/5.0 (HangMU/1.0)", - "Accept": "application/rss+xml, application/xml, text/xml, */*", - "Accept-Encoding": "identity", - }) - with urllib.request.urlopen(req, timeout=15) as resp: - xml_data = resp.read() - # Dac biet: Google News co the tra ve gzip - thu giai nen neu can - if xml_data[:2] == b'\x1f\x8b': - import gzip - xml_data = gzip.decompress(xml_data) - # Parse XML - try: - root = ET.fromstring(xml_data) - except ET.ParseError: - text = xml_data.decode("utf-8", "ignore") - root = ET.fromstring(text) - out = [] - for item in root.iter("item"): - title_el = item.find("title") - link_el = item.find("link") - source_el = item.find("source") - pubdate_el = item.find("pubDate") - desc_el = item.find("description") - # Try to extract thumbnail from media:content or media:thumbnail - thumb = "" - for media in item.iter(): - tag = media.tag.split("}")[-1] if "}" in media.tag else media.tag - if tag in ("thumbnail", "content") and media.get("url"): - thumb = media.get("url") - break - title = (title_el.text or "").strip() if title_el is not None else "" - link = (link_el.text or "").strip() if link_el is not None else "" - via = (source_el.text or "").strip() if source_el is not None else "" - pubdate = (pubdate_el.text or "").strip() if pubdate_el is not None else "" - desc = (desc_el.text or "").strip() if desc_el is not None else "" - # Strip HTML tags from description - if desc: - import re as _re - desc = _re.sub(r'<[^>]+>', '', desc).strip()[:300] - if not title: - continue - out.append({"title": title[:200], "url": link, "via": via, - "pubDate": pubdate, "thumbnail": thumb, "description": desc}) - if len(out) >= 10: - break - return out - -# ============ V92: ẢNH THẬT CHO TIN AI ============ -# Google News RSS không kèm ảnh. BBC Vietnamese RSS có media:thumbnail thật -# → dùng làm nguồn ảnh. Nếu thiếu ảnh, sinh ảnh đại diện tại /api/ai-thumb. -_AI_IMG_URL = "https://feeds.bbci.co.uk/vietnamese/rss.xml" -_ai_img_cache = {"at": 0.0, "items": []} - -def _ai_img_fetch(): - """Lấy danh sách URL ảnh từ BBC Vietnamese RSS (media:thumbnail).""" - import re as _re - try: - r = urllib.request.Request(_AI_IMG_URL, headers={ - "User-Agent": "Mozilla/5.0 (HangMU/1.0)", - "Accept": "application/rss+xml, application/xml, text/xml", - }) - with urllib.request.urlopen(r, timeout=12) as resp: - xml = resp.read().decode("utf-8", "ignore") - except Exception: - return [] - urls = _re.findall(r']*url=["\']([^"\']+)["\']', xml) - if not urls: - urls = _re.findall(r']*url=["\']([^"\']+)["\']', xml) - return [u for u in urls if u.startswith("http")] - -def _ai_thumb_for(idx: int) -> str: - """Ảnh cho tin thứ idx: ảnh BBC cùng chỉ mục, hoặc ảnh đại diện.""" - imgs = _ai_img_cache.get("items") or [] - if idx < len(imgs): - return imgs[idx] - return "/api/ai-thumb?i=%d" % (idx % 12) - -@app.get("/api/ai-thumb") -async def api_ai_thumb(i: int = 0): - """Sinh ảnh đại diện (SVG) cho tin thứ i — luôn có ảnh, deterministic.""" - import html as _html - palette = [ - ("#0d1b2a", "#4fa3ff"), ("#1a0d24", "#b06bff"), ("#0a2418", "#3ddc97"), - ("#2a1206", "#ff9a4f"), ("#24060f", "#ff4f6d"), ("#06181f", "#4fd8e8"), - ] - bg, fg = palette[i % len(palette)] - label = "AI" - svg = ( - f'' - f'' - f'' - f'' - f'' - f'' - f'' - f'{_html.escape(label)}' - f'' - ) - from fastapi.responses import Response as _Resp - return _Resp(content=svg, media_type="image/svg+xml", - headers={"Cache-Control": "public, max-age=86400"}) - - -# ============ Tin AI (V95: bep40/VAINEWS, đầy đủ tiêu đề + mô tả + ảnh) ============ -import os as _os95 -import re as _re95 -import json as _json95 -import time as _time95 -import threading as _threading95 -import requests as _rq95 -from bs4 import BeautifulSoup as _BS95 - -_v95_ai_news = {"items": [], "at": 0.0} -_v95_lock = _threading95.Lock() -_v95_TTL = 30 * 60 # 30 phút -_v95_KEY = "AI trí tuệ nhân tạo" -_v95_VAINEWS = "https://bep40-vainews.hf.space" -_v95_UA = { - "User-Agent": ("Mozilla/5.0 (Windows NT 10.0; Win64; x64) " - "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120 Safari/537.36"), - "Accept-Language": "vi,en;q=0.8", -} -# từ khoá nhận diện tin AI -_v95_AIWORDS = ("ai", "trí tuệ nhân tạo", "tri tue nhan tao", "machine learning", - "học máy", "chatbot", "chatgpt", "openai", "gemini", "llm", - "mô hình", "thuật toán", "robot", "tự động hoá", "deepfake", - "generative", "anthropic", "claude", "midjourney", "stable diffusion", - "copilot", "nvidia", "gpu", "dữ liệu lớn", "tự hành") - - -def _v95_is_ai(text: str) -> bool: - t = (text or "").lower() - for w in _v95_AIWORDS: - if w in ("ai",): - # 'ai' phải đứng riêng, tránh khớp bừa trong 'hai','mai','phải' - if _re95.search(r"(? dict: - """Lấy mô tả + ảnh + vài đoạn nội dung từ trang gốc.""" - out = {"description": "", "image": "", "body": "", "site": ""} - try: - r = _rq95.get(url, headers=_v95_UA, timeout=15, allow_redirects=True) - if r.status_code != 200: - return out - r.encoding = r.apparent_encoding or "utf-8" - soup = _BS95(r.text, "lxml") - - def meta(*props): - for p in props: - el = soup.find("meta", property=p) or soup.find("meta", attrs={"name": p}) - if el and el.get("content"): - return el.get("content").strip() - return "" - - out["description"] = meta("og:description", "description", "twitter:description") - out["image"] = meta("og:image", "twitter:image") - out["site"] = meta("og:site_name") - - # các đoạn nội dung đầu - paras = [] - for sel in (".knc-content p", ".content p", "article p", - ".article-body p", ".detail-content p", "#mainContent p", - ".body-text p", "div.content-detail p"): - for p in soup.select(sel): - txt = p.get_text(" ", strip=True) - if len(txt) > 70 and txt not in paras: - paras.append(txt) - if len(paras) >= 4: - break - if not paras: - for p in soup.find_all("p"): - txt = p.get_text(" ", strip=True) - if len(txt) > 90: - paras.append(txt) - if len(paras) >= 4: - break - out["body"] = "\n\n".join(paras[:4]) - if not out["description"] and paras: - out["description"] = paras[0][:300] - except Exception as e: - print("[v95] deep fail", url[:60], e) - return out - - -def _v95_from_vainews(limit: int = 10): - """Tin AI từ Space bep40/VAINEWS (private -> cần token).""" - hdr = dict(_v95_UA) - tok = _os95.environ.get("HF_TOKEN") or "" - if tok: - hdr["Authorization"] = "Bearer " + tok - raw = [] - for attempt in (1, 2, 3): - try: - r = _rq95.get(_v95_VAINEWS + "/api/category/cong-nghe", - headers=hdr, timeout=60) - if r.status_code == 200: - raw = r.json() or [] - print("[v95] VAINEWS:", len(raw), "tin") - break - print("[v95] VAINEWS HTTP", r.status_code, "lan", attempt) - except Exception as e: - print("[v95] VAINEWS fail lan", attempt, ":", str(e)[:90]) - if attempt < 3: - _time95.sleep(4) - if not isinstance(raw, list): - raw = [] - - # ưu tiên tin có từ khoá AI - ai = [a for a in raw if _v95_is_ai((a.get("title") or "") + " " + (a.get("link") or ""))] - pool = ai if len(ai) >= 4 else raw - - items, seen = [], set() - for a in pool: - if len(items) >= limit: - break - title = (a.get("title") or "").strip() - link = (a.get("link") or "").strip() - if not title or not link or link in seen: - continue - seen.add(link) - items.append({ - "title": title, - "url": link, - "thumbnail": (a.get("img") or "").strip(), - "via": (a.get("source") or "VAINEWS").strip(), - "description": "", - "body": "", - "pubDate": "", - "site": "", - }) - return items - - -def _v95_refresh(limit: int = 10): - items = _v95_from_vainews(limit) - if not items: - return [] - # lấy mô tả + ảnh + nội dung song song - try: - from concurrent.futures import ThreadPoolExecutor - with ThreadPoolExecutor(max_workers=6) as ex: - deeps = list(ex.map(lambda it: _v95_deep(it["url"]), items)) - for it, d in zip(items, deeps): - if d.get("description"): - it["description"] = d["description"] - if not it["thumbnail"] and d.get("image"): - it["thumbnail"] = d["image"] - if d.get("body"): - it["body"] = d["body"] - if d.get("site"): - it["site"] = d["site"] - except Exception as e: - print("[v95] deep pool fail:", e) - - # điền mô tả dự phòng nếu vẫn trống - for it in items: - if not it["description"]: - it["description"] = it["title"] - return items - - -def _v95_get(): - now = _time95.time() - with _v95_lock: - if _v95_ai_news["items"] and now - _v95_ai_news["at"] < _v95_TTL: - return _v95_ai_news["items"] - items = _v95_refresh(10) - with _v95_lock: - if items: - _v95_ai_news["items"] = items - _v95_ai_news["at"] = now - return _v95_ai_news["items"] - - -def _v95_warm(): - try: - _v95_get() - print("[v95] warm tin AI:", len(_v95_ai_news["items"]), "tin") - except Exception as e: - print("[v95] warm fail", e) - - -try: - _threading95.Thread(target=_v95_warm, daemon=True).start() -except Exception: - pass - - -# ============ Tin AI (V95 end) ============ - - - -@app.get("/api/img-proxy") -async def api_img_proxy(url: str = ""): - """Proxy ảnh tin tức -> cùng origin nên canvas đọc được pixel (không CORS).""" - from fastapi.responses import Response as _Resp - if not url.startswith("http"): - return _Resp(status_code=400) - try: - hdr = {"User-Agent": _v95_UA["User-Agent"], - "Accept": "image/avif,image/webp,image/*,*/*;q=0.8", - "Referer": _re95.sub(r"^(https?://[^/]+)", r"\1/", url)} - r = _rq95.get(url, headers=hdr, timeout=15, stream=True) - if r.status_code != 200: - return _Resp(status_code=404) - ct = r.headers.get("content-type", "image/jpeg") - if not ct.startswith("image/"): - ct = "image/jpeg" - return _Resp(content=r.content, media_type=ct, - headers={"Cache-Control": "public, max-age=86400", - "Access-Control-Allow-Origin": "*"}) - except Exception as e: - print("[v96] img-proxy fail", e) - return _Resp(status_code=502) - -@app.get("/api/ai-news/item") -async def api_ai_news_item(url: str = ""): - """Chi tiết 1 tin cho modal: mô tả + nội dung + ảnh lớn.""" - if not url: - return {"ok": False, "error": "missing url"} - d = _v95_deep(url) - return {"ok": True, "url": url, "description": d.get("description", ""), - "body": d.get("body", ""), "image": d.get("image", ""), - "site": d.get("site", "")} - -@app.get("/api/ai-news") -async def api_ai_news(): - # V95: tin đầy đủ (tiêu đề + mô tả + ảnh thật) từ bep40/VAINEWS - try: - items = _v95_get() - except Exception as e: - print("[v95] handler fail", e) - items = [] - return {"items": items, "keyword": _v95_KEY, - "updated": int(_time95.time()), "source": "bep40/VAINEWS"} - - -# ============ BẢNG VÀNG ĐIỂM DANH ============ -# V67: user siêng vào hang nhất — tên · số lần ghé hang · số lần trò chuyện. -# Đếm trong RAM (không cần DB), giữ qua restart bằng /data nếu ghi được. -_att_stats: Dict[str, dict] = {} # name -> {"visits": int, "chats": int} -_att_lock = __import__("threading").Lock() - -# ---- V85: BỀN VỮNG — ghi xuống file để không mất khi restart ---- -# Space cpu-basic có filesystem ephemeral; ta vẫn thử /data (persistent volume -# nếu được gắn) rồi fallback /app, ./ — có file còn hơn mất sạch. -def _att_path() -> str: - for d in ("/data", "/app", "."): - try: - if os.path.isdir(d) and os.access(d, os.W_OK): - return os.path.join(d, "attendance.json") - except Exception: - continue - return "attendance.json" - -_ATT_FILE = _att_path() -_att_dirty = False - -def _att_save(): - """Ghi atomic: tmp -> os.replace, tránh hỏng file giữa chừng.""" - global _att_dirty - try: - tmp = _ATT_FILE + ".tmp" - with open(tmp, "w", encoding="utf-8") as f: - json.dump(_att_stats, f, ensure_ascii=False) - os.replace(tmp, _ATT_FILE) - _att_dirty = False - try: - _att_bg_push() # V86: mirror lên Hub (thread nền) - except NameError: - pass # hàm định nghĩa sau — bỏ qua, lần gọi sau sẽ đẩy - return True - except Exception as e: - print("[v85] _att_save loi:", e) - return False - -def _att_load(): - """Nạp lại số liệu đã lưu (nếu có).""" - try: - if os.path.isfile(_ATT_FILE): - with open(_ATT_FILE, "r", encoding="utf-8") as f: - d = json.load(f) - if isinstance(d, dict): - for k, v in d.items(): - if isinstance(v, dict): - _att_stats[str(k)[:60]] = { - "visits": int(v.get("visits", 0)), - "chats": int(v.get("chats", 0)), - "joins": int(v.get("joins", 0)), - - "votes": int(v.get("votes", 0)),} - print("[v85] _att_load: nạp", len(_att_stats), "user từ", _ATT_FILE) - except Exception as e: - print("[v85] _att_load loi:", e) - -_att_load() - -# ---- V86: MIRROR HUB — số liệu sống sót qua restart/rebuild ---- -# Space cpu-basic không có volume; ta mirror lên dataset private trên Hub. -# Ghi kiểu best-effort: lỗi mạng KHÔNG được làm hỏng request. -ATT_DATASET = os.environ.get("ATT_DATASET", "bep40/hangmu-attendance") -ATT_FILE_IN_REPO = "attendance.json" -_att_push_fail = 0 - -def _att_push(snapshot=None): - """Đẩy _att_stats (hoặc snapshot) lên Hub dataset (best-effort).""" - try: - from huggingface_hub import HfApi - api = HfApi(token=os.environ.get("HF_TOKEN")) - data = snapshot if snapshot is not None else _att_stats - api.upload_file( - path_or_fileobj=json.dumps(data, ensure_ascii=False).encode("utf-8"), - path_in_repo=ATT_FILE_IN_REPO, - repo_id=ATT_DATASET, - repo_type="dataset", - commit_message="attendance autosave", - ) - return True - except Exception as e: - global _att_push_fail - _att_push_fail += 1 - if _att_push_fail <= 3: - print("[v86] _att_push loi:", e) - return False - -def _att_pull(): - """Đọc _att_stats từ Hub dataset lúc khởi động.""" - try: - from huggingface_hub import hf_hub_download - p = hf_hub_download( - repo_id=ATT_DATASET, repo_type="dataset", - filename=ATT_FILE_IN_REPO, token=os.environ.get("HF_TOKEN"), - ) - with open(p, "r", encoding="utf-8") as f: - d = json.load(f) - if isinstance(d, dict): - for k, v in d.items(): - if isinstance(v, dict): - _att_stats[str(k)[:60]] = { - "visits": int(v.get("visits", 0)), - "chats": int(v.get("chats", 0)), - - "votes": int(v.get("votes", 0)),} - print("[v86] _att_pull: nạp", len(_att_stats), "user từ Hub") - # ghi bản địa phương luôn để cờ persisted=true + có fallback offline - try: - tmp = _ATT_FILE + ".tmp" - with open(tmp, "w", encoding="utf-8") as f: - json.dump(_att_stats, f, ensure_ascii=False) - os.replace(tmp, _ATT_FILE) - except Exception as _e: - print("[v86] _att_pull: không ghi được file local:", _e) - except Exception as e: - print("[v86] _att_pull: chưa có dữ liệu Hub (" + type(e).__name__ + ")") - -# nạp từ Hub lúc khởi động (file local là bản nháp) -_att_pull() - -# V86d: cố đẩy lần cuối khi Space tắt (nếu còn dirty) -try: - import atexit - atexit.register(lambda: _att_push() if _att_stats else None) -except Exception: - pass - -_att_push_lock = None # tạo trễ để tránh import-time phức tạp -_att_push_busy = {"v": False} - -def _att_bg_push(): - """Đẩy lên Hub ở thread nền, TUẦN TỰ — tránh 2 lần ghi đè nhau - (lần cũ đến sau sẽ ghi đè số liệu mới).""" - global _att_push_lock - import threading - if _att_push_lock is None: - _att_push_lock = threading.Lock() - if _att_push_busy["v"]: - _att_push_busy["again"] = True # đang đẩy dở → nhắc đẩy lại bản mới nhất - return - _att_push_busy["v"] = True - def _run(): - try: - with _att_push_lock: - # CHỤP SNAPSHOT muộn nhất ngay trước khi đẩy — tránh đẩy - # phải bản cũ (các bump sau đã vào _att_stats). - import copy - snap = copy.deepcopy(_att_stats) - _att_push(snap) - finally: - _att_push_busy["v"] = False - if _att_push_busy.get("again"): - _att_push_busy["again"] = False - _att_bg_push() # còn bump mới trong lúc đẩy → đẩy tiếp - threading.Thread(target=_run, daemon=True).start() - -# V89: "visits" = số NGÀY khác nhau ghé hang (công bằng với mạng chập chờn). -# "joins" = số lần vào thật. _att_seen_today reset theo ngày. -_att_seen_today: Dict[str, str] = {} # name -> "YYYY-MM-DD" đã viếng hôm nay - -def _att_day() -> str: - try: - return time.strftime("%Y-%m-%d", time.gmtime(time.time() + 7 * 3600)) # UTC+7 - except Exception: - return "1970-01-01" - -def _att_join(name: str): - """Gọi khi user join. Tính visits theo NGÀY, joins theo LẦN.""" - nm = (name or "").strip()[:60] - if not nm: - return - today = _att_day() - if _att_seen_today.get(nm) != today: - _att_seen_today[nm] = today - _att_bump(nm, "visits") # lần đầu trong ngày mới +1 visits - _att_bump(nm, "joins") # mỗi lần vào hang đều +1 - -def _att_bump(name: str, key: str): - nm = (name or "").strip()[:60] - if not nm: - return - global _att_dirty - with _att_lock: - e = _att_stats.setdefault(nm, {"visits": 0, "chats": 0, "joins": 0, "votes": 0}) - e[key] = int(e.get(key, 0)) + 1 - _att_dirty = True - # ghi ngay (lượng ghi nhỏ, an toàn khi process bị kill) - _att_save() - -def _att_bump_visit(name: str): - _att_bump(name, "visits") - -def _att_bump_chat(name: str): - _att_bump(name, "chats") - -def _att_score(r: dict) -> int: - """V90: điểm siêng = visits*20 + chats*2 + joins*1. - visits (số NGÀY) áp đảo → user vào đều mỗi ngày luôn xếp trên - user chỉ vào 1 ngày nhưng nhắn nhiều tin.""" - return int(r.get("visits", 0)) * 20 + int(r.get("chats", 0)) * 2 + int(r.get("joins", 0)) + int(r.get("votes", 0)) * 3 # V116: + binh chon - - -@app.get("/api/attendance/top") -async def api_attendance_top(): - """Top 10 user siêng vào hang nhất: tên, số lần ghé hang, số lần trò chuyện.""" - with _att_lock: - rows = sorted( - [{"name": k, "visits": int(v.get("visits", 0)), - "chats": int(v.get("chats", 0)), - "joins": int(v.get("joins", 0)), - "votes": int(v.get("votes", 0))} - for k, v in _att_stats.items()], - # V90: điểm = visits*20 + chats*2 + joins*1 (số NGÀY áp đảo) - key=lambda r: (-_att_score(r), -r["visits"], -r["chats"], r["name"].lower()), - )[:10] - for _r in rows: - _r["score"] = _att_score(_r) - return {"top": rows, "total": len(_att_stats), "updated": int(time.time()), "persisted": os.path.isfile(_ATT_FILE)} - - -@app.post("/api/attendance/reset") -async def api_attendance_reset(): - """Xoá sạch bảng điểm danh (cả RAM, file và Hub).""" - with _att_lock: - _att_stats.clear() - _att_save() - return {"ok": True, "top": [], "total": 0} - @app.get("/api/legends") async def api_legends(): return {"legends": _LEGENDS} @@ -764,7 +160,7 @@ class Player: number: Optional[int] = None sid: str = "" # mã ngẫu nhiên (hm_sid) position: Dict[str, float] = field(default_factory=lambda: {"x": 0.0, "y": 0.0, "z": 36.0}) - rotation: float = math.pi # V35: mới vào hang quay mặt VÀO TRONG (nhìn màn hình lớn/trung tâm) + rotation: float = 0.0 animation: str = "idle" connected: bool = True lastSeen: float = field(default_factory=time.time) @@ -812,10 +208,18 @@ GAME_TTL = 90.0 polls: Dict[str, dict] = {} POLL_INTERVAL_S = 180 # cứ 3 phút phát 1 poll nếu chưa có POLL_QUESTIONS = [ - {"question": "Mô hình ngôn ngữ lớn (LLM) viết tắt của cụm nào?", "options": [{"icon": "🧠", "text": "Large Language Model"}, {"icon": "📐", "text": "Logical Layer Model"}, {"icon": "⚡", "text": "Long Latency Memory"}, {"icon": "🔁", "text": "Linear Learning Machine"}]}, - {"question": "ChatGPT do công ty nào phát triển?", "options": [{"icon": "🤖", "text": "OpenAI"}, {"icon": "🔎", "text": "Google"}, {"icon": "🐦", "text": "xAI"}, {"icon": "🦙", "text": "Meta"}]}, - {"question": "CUDA — nền tảng tính toán song song cho AI — do ai tạo ra?", "options": [{"icon": "🟩", "text": "NVIDIA"}, {"icon": "🔴", "text": "AMD"}, {"icon": "🔵", "text": "Intel"}, {"icon": "🍎", "text": "Apple"}]}, - {"question": "Tham số \"temperature\" của một LLM điều chỉnh gì?", "options": [{"icon": "🎲", "text": "Mức ngẫu nhiên của câu trả lời"}, {"icon": "📏", "text": "Số token tối đa"}, {"icon": "🚀", "text": "Tốc độ sinh chữ"}, {"icon": "💾", "text": "Kích thước mô hình"}]}, + {"question": "Ai là huyền thoại vĩ đại nhất MU?", "options": [ + {"icon": "👑", "text": "Sir Alex"}, {"icon": "🥅", "text": "Rooney"}, + {"icon": "⚡", "text": "Ronaldo"}, {"icon": "🔥", "text": "Cantona"}]}, + {"question": "Mùa này MU về đích thứ mấy?", "options": [ + {"icon": "🥇", "text": "Top 4"}, {"icon": "🏆", "text": "Vô địch"}, + {"icon": "😅", "text": "Top 6"}, {"icon": "💀", "text": "Ngoài top 6"}]}, + {"question": "Đêm nay ai xem đá với nhau?", "options": [ + {"icon": "📺", "text": "Có tôi"}, {"icon": "😴", "text": "Ngủ sớm"}, + {"icon": "🍺", "text": "Nhậu xem luôn"}]}, + {"question": "MU nên mua ai hè này?", "options": [ + {"icon": "🦁", "text": "Tiền đạo"}, {"icon": "🧠", "text": "Tiền vệ"}, + {"icon": "🛡️", "text": "Hậu vệ"}, {"icon": "🧤", "text": "Thủ môn"}]}, ] def _make_poll(): @@ -828,137 +232,10 @@ def _make_poll(): # bongdaplus.vn (nguồn highlight bóng đá mở, không cần API key) để lấy # YouTube ID các clip Highlight MU / Premier League mới, đưa lên đầu playlist. # Nếu quét thất bại → GIỮ NGUYÊN playlist cũ (không làm trống màn hình). -def _yt_meta(vid, title=""): - """Chuẩn hoá YouTube ID / watch URL / embed URL / youtu.be -> object - {url, title, img}. Frontend phát qua proxy bep40-vnews.hf.space (xem được - tại VN; youtube-nocookie bị chặn nên trước đây màn hình lớn chỉ hiện - fallback, không có video).""" - s = str(vid or "").strip() - m = re.search(r'(?:youtube(?:-nocookie)?\.com/(?:watch\?[^#]*v=|embed/|shorts/)|youtu\.be/)([a-zA-Z0-9_-]{11})', s) - if m: - vid = m.group(1) - else: - vid = (s or "")[:11] - return {"url": "https://www.youtube.com/watch?v=" + vid, - "title": title or "Highlight MU", - "img": "https://i.ytimg.com/vi/" + vid + "/hqdefault.jpg"} - - BOARD = { - "videos": [ - _yt_meta("1LH4319g6Gw", "THẾ GIỚI NGOẠI HẠNG (9/11): MAN UNITED THOÁT HIỂM, MỘT HLV SẮP MẤT VIỆC"), - _yt_meta("JuRD8gSdmps"), - ], - "music": [_yt_meta("VKmVJKDoPwk", "Glory Glory Man United — bài hát chính thức của MU")], + "videos": ["JuRD8gSdmps"], # Highlight MU (kênh YouTube chính thức) + "music": ["VKmVJKDoPwk"], # "Glory Glory Man United" — bài hát chính thức của MU } -try: - from fastapi import Request as _Request -except Exception: - _Request = None - -# V51: playlist màn hình lớn = YouTube RSS channel FPT Bóng Đá (rss2json), realtime 10 phút. -_VNEWS_AI = "https://bep40-vnews.hf.space/api/fptplay/videos" # fallback 2 (không dùng trực tiếp) -_FPT_RSS_CHANNEL = "UC4LvrpNXujjbGOS4RDvr41g" # FPT Bóng Đá (YouTube) -_FPT_RSS_URL = None -_VNEWS_CACHE = {"at": 0.0, "posts": None} -_VNEWS_TTL = 600 # 10 phút -import urllib.request as _urq - - -def _http_get_json(url: str, timeout: int = 12): - """GET JSON bằng stdlib urllib.""" - try: - with _urq.urlopen(url, timeout=timeout) as r: - if r.status != 200: - return None - if "json" not in (r.headers.get("Content-Type") or ""): - return None - return json.loads(r.read().decode("utf-8", "replace")) - except Exception as e: - print(f"[board] vnews fetch error: {e}", flush=True) - return None - - -def _urllib_quote(s: str) -> str: - """URL-encode bằng stdlib (an toàn khi runtime thiếu urllib.parse).""" - try: - import urllib.parse as _up - return _up.quote(s, safe="") - except Exception: - return "".join(c if (c.isalnum() or c in "-_.~") else "%%%02X" % ord(c) for c in s) - - -def _fpt_rss_fetch(): - """Fetch YouTube RSS channel FPT Bóng Đá qua rss2json — 15 video mới nhất.""" - try: - global _FPT_RSS_URL - if _FPT_RSS_URL is None: - _FPT_RSS_URL = "https://api.rss2json.com/v1/api.json?rss_url=" + _urllib_quote( - "https://www.youtube.com/feeds/videos.xml?channel_id=" + _FPT_RSS_CHANNEL) - with _urq.urlopen(_FPT_RSS_URL, timeout=20) as r: - if r.status != 200: - print(f"[board] fpt rss HTTP {r.status}", flush=True) - return None - d = json.loads(r.read().decode("utf-8", "replace")) - items = d.get("items") or [] - out = [] - for it in items[:15]: - vid = (it.get("guid") or "").replace("yt:video:", "").strip() - if not vid or len(vid) != 11: - continue - title = (it.get("title") or "FPT Bóng Đá").strip() - thumb = (it.get("thumbnail") or ("https://i.ytimg.com/vi/" + vid + "/hqdefault.jpg")) - out.append({ - "url": "https://www.youtube.com/watch?v=" + vid, - "title": title[:200], - "img": thumb, - "yt": vid, - "published": (it.get("pubDate") or "")[:16], - }) - if out: - print(f"[board] fpt rss OK: {len(out)} videos, first={out[0][chr(116)+chr(105)+chr(116)+chr(108)+chr(101)]}", flush=True) - return out or None - except Exception as e: - print(f"[board] fpt rss error: {e}", flush=True) - return None - - -def _board_vnews(refresh: bool = False): - """Playlist màn hình: ưu tiên RSS FPT Bóng Đá -> fallback /api/fptplay/videos -> cache cũ.""" - now = time.time() - if not refresh and _VNEWS_CACHE["posts"] is not None and now - _VNEWS_CACHE["at"] < _VNEWS_TTL: - return _VNEWS_CACHE["posts"] - - out = _fpt_rss_fetch() - if not out: - data = _http_get_json(_VNEWS_AI, timeout=12) - if data: - try: - posts = data.get("videos", []) or [] - out = [] - for p in posts[:28]: - vid = (p.get("id") or "").strip() - if not vid: - continue - link = (p.get("link") or "").strip() - video_url = link if (link and link.startswith("http")) else ("https://www.youtube.com/watch?v=" + vid) - out.append({ - "url": video_url, - "title": (p.get("title") or "FPT Bóng Đá").strip(), - "img": (p.get("img") or ("https://i.ytimg.com/vi/" + vid + "/hqdefault.jpg")).strip(), - "yt": vid, - }) - if not out: - out = None - except Exception as e: - print(f"[board] fptplay fallback error: {e}", flush=True) - out = None - if out: - _VNEWS_CACHE["posts"] = out - _VNEWS_CACHE["at"] = now - return out - return _VNEWS_CACHE["posts"] - _BOARD_LOCK = asyncio.Lock() _BOARD_SCRAPE = {"at": 0.0, "last_refresh": 0, "error": ""} @@ -967,38 +244,6 @@ _BOARD_SCRAPE = {"at": 0.0, "last_refresh": 0, "error": ""} _BOARD_FILE = os.environ.get("BOARD_FILE", os.path.join(os.sep, "data", "board.json")) -def _yt_meta(vid, title=""): - """Chuẩn hoá YouTube ID / watch URL / embed URL / shorts / youtu.be -> - object {url, title, img} — frontend phát qua proxy bep40-vnews.hf.space - (xem được tại VN; youtube-nocookie bị chặn nên màn hình lớn không thể - iframe thẳng).""" - s = str(vid or "").strip() - m = re.search(r'(?:youtube(?:-nocookie)?\.com/(?:watch\?[^#]*v=|embed/|shorts/|live/)|youtu\.be/|m\.youtube\.com/(?:watch\?[^#]*v=|embed/|shorts/))([a-zA-Z0-9_-]{11})', s) - if m: - vid = m.group(1) - else: - vid = (s or "")[:11] - return {"url": "https://www.youtube.com/watch?v=" + vid, - "title": title or "Highlight MU", - "img": "https://i.ytimg.com/vi/" + vid + "/hqdefault.jpg"} - - -def _yt_meta(vid, title=""): - """Chuẩn hoá YouTube ID / watch URL / embed URL / shorts / youtu.be -> - object {url, title, img} — frontend phát qua proxy bep40-vnews.hf.space - (xem được tại VN; youtube-nocookie bị chặn nên màn hình lớn không thể - iframe thẳng).""" - s = str(vid or "").strip() - m = re.search(r'(?:youtube(?:-nocookie)?\.com/(?:watch\?[^#]*v=|embed/|shorts/|live/)|youtu\.be/|m\.youtube\.com/(?:watch\?[^#]*v=|embed/|shorts/))([a-zA-Z0-9_-]{11})', s) - if m: - vid = m.group(1) - else: - vid = (s or "")[:11] - return {"url": "https://www.youtube.com/watch?v=" + vid, - "title": title or "Highlight MU", - "img": "https://i.ytimg.com/vi/" + vid + "/hqdefault.jpg"} - - def _board_persist(): """Ghi playlist hiện tại xuống đĩa (fail-safe — không bao giờ ném lỗi).""" try: @@ -1018,13 +263,7 @@ def _board_load(): with open(_BOARD_FILE, "r", encoding="utf-8") as f: d = json.load(f) if isinstance(d.get("videos"), list) and d["videos"]: - def _norm(v): - if isinstance(v, str): - return _yt_meta(v) - if isinstance(v, dict) and v.get("url"): - return _yt_meta(v["url"], v.get("title") or "") - return None - BOARD["videos"] = [x for x in (_norm(v) for v in d["videos"]) if x][:12] + BOARD["videos"] = [v for v in d["videos"] if isinstance(v, str) and len(v) == 11][:12] _BOARD_SCRAPE["at"] = float(d.get("scraped", 0)) _BOARD_SCRAPE["last_refresh"] = int(d.get("last_refresh", 0)) print(f"[board] loaded {len(BOARD['videos'])} videos from {_BOARD_FILE}") @@ -1137,9 +376,8 @@ def _board_refresh_playlist() -> List[str]: break if not ids: raise RuntimeError("no youtube ids found") - # playlist cũ giữ ở cuối làm dự phòng độ dài (hỗ trợ cả string lẫn object) - base = [v if isinstance(v, str) else (v.get("url") or "") for v in BOARD["videos"]] - base = [v for v in base if v and v not in seen][:4] + # playlist cũ giữ ở cuối làm dự phòng độ dài + base = [v for v in BOARD["videos"] if v not in seen][:4] return (ids + base)[:12] except Exception as e: _BOARD_SCRAPE["error"] = str(e)[:200] @@ -1162,13 +400,9 @@ async def _board_loop(): _BOARD_SCRAPE["at"] = now if fresh and fresh != BOARD["videos"]: old = BOARD["videos"] - BOARD["videos"] = [_yt_meta(v) for v in fresh] + BOARD["videos"] = fresh _BOARD_SCRAPE["last_refresh"] = int(now) - print(f"[board] initial refresh: {len(old)} -> {len(fresh)} videos, first={_yt_meta(fresh[0])['url']}") - vn = await asyncio.get_event_loop().run_in_executor(None, _board_vnews) - if vn: - keep = [v for v in BOARD.get("videos", []) if not (v.get("mp4") or "").startswith("https://bep40-vnews.hf.space")][:12] - BOARD["videos"] = vn + keep + print(f"[board] initial refresh: {len(old)} -> {len(fresh)} ids, first={fresh[0]}") _board_persist() except Exception as e: print(f"[board] initial refresh error: {e}") @@ -1182,18 +416,11 @@ async def _board_loop(): _BOARD_SCRAPE["at"] = now if fresh and fresh != BOARD["videos"]: old = BOARD["videos"] - BOARD["videos"] = [_yt_meta(v) for v in fresh] + BOARD["videos"] = fresh _BOARD_SCRAPE["last_refresh"] = int(now) - print(f"[board] playlist refreshed: {len(old)} -> {len(fresh)} videos, first={_yt_meta(fresh[0])['url']}") - vn = await asyncio.get_event_loop().run_in_executor(None, _board_vnews) - if vn: - keep = [v for v in BOARD.get("videos", []) if not (v.get("mp4") or "").startswith("https://bep40-vnews.hf.space")][:12] - BOARD["videos"] = vn + keep - _board_persist() - try: + print(f"[board] playlist refreshed: {len(old)} -> {len(fresh)} ids, first={fresh[0]}") await broadcast("lobby", {"type": "board", "videos": BOARD["videos"], "music": BOARD["music"]}) - except Exception: - pass + _board_persist() except Exception as e: print(f"[board] loop error: {e}") await asyncio.sleep(5 * 60) @@ -1225,40 +452,27 @@ class PushUnsubscribeRequest(BaseModel): # ============ Quiz ============ QUIZ_QUESTIONS = [ - {"id": "q1", "q": "Model Grok thuộc về công ty nào?", - "answers": [{"id": "a1", "text": "xAI"}, {"id": "a2", "text": "OpenAI"}, {"id": "a3", "text": "Google DeepMind"}, {"id": "a4", "text": "Anthropic"}], "correct": "a1"}, - {"id": "q2", "q": "Ai là cha đẻ của NVIDIA?", - "answers": [{"id": "a1", "text": "Jensen Huang"}, {"id": "a2", "text": "Sam Altman"}, {"id": "a3", "text": "Elon Musk"}, {"id": "a4", "text": "Sundar Pichai"}], "correct": "a1"}, - {"id": "q3", "q": "ChatGPT do công ty nào phát triển?", - "answers": [{"id": "a1", "text": "OpenAI"}, {"id": "a2", "text": "Meta"}, {"id": "a3", "text": "Microsoft"}, {"id": "a4", "text": "xAI"}], "correct": "a1"}, - {"id": "q4", "q": "AlphaGo — hệ thống đánh bại kỳ thủ cờ vây Hàn Quốc Lee Sedol — do ai phát triển?", - "answers": [{"id": "a1", "text": "Google DeepMind"}, {"id": "a2", "text": "IBM"}, {"id": "a3", "text": "OpenAI"}, {"id": "a4", "text": "NVIDIA"}], "correct": "a1"}, - {"id": "q5", "q": "Google Gemini do công ty nào phát triển?", - "answers": [{"id": "a1", "text": "Google"}, {"id": "a2", "text": "OpenAI"}, {"id": "a3", "text": "Meta"}, {"id": "a4", "text": "Amazon"}], "correct": "a1"}, - {"id": "q6", "q": "Llama là dòng mô hình ngôn ngữ mở của công ty nào?", - "answers": [{"id": "a1", "text": "Meta"}, {"id": "a2", "text": "Google"}, {"id": "a3", "text": "Anthropic"}, {"id": "a4", "text": "Mistral"}], "correct": "a1"}, - {"id": "q7", "q": "Anthropic là công ty đứng sau dòng model AI nào?", - "answers": [{"id": "a1", "text": "Claude"}, {"id": "a2", "text": "Gemini"}, {"id": "a3", "text": "Grok"}, {"id": "a4", "text": "Copilot"}], "correct": "a1"}, - {"id": "q8", "q": "GPU là viết tắt của cụm từ nào?", - "answers": [{"id": "a1", "text": "Graphics Processing Unit"}, {"id": "a2", "text": "General Program Unit"}, {"id": "a3", "text": "Grid Power Unit"}, {"id": "a4", "text": "Global Processor Utility"}], "correct": "a1"}, - {"id": "q9", "q": "Deep Learning là một nhánh của lĩnh vực nào?", - "answers": [{"id": "a1", "text": "Machine Learning"}, {"id": "a2", "text": "Khoa học vật liệu"}, {"id": "a3", "text": "Cơ sở dữ liệu"}, {"id": "a4", "text": "Mạng máy tính"}], "correct": "a1"}, - {"id": "q10", "q": "Mô hình ngôn ngữ lớn (LLM) thường được viết tắt từ cụm nào?", - "answers": [{"id": "a1", "text": "Large Language Model"}, {"id": "a2", "text": "Linear Learning Machine"}, {"id": "a3", "text": "Logical Layer Model"}, {"id": "a4", "text": "Long Latency Memory"}], "correct": "a1"}, - {"id": "q11", "q": "Phát biểu nào mô tả đúng nhất về \"học có giám sát\" (supervised learning)?", - "answers": [{"id": "a1", "text": "Học từ dữ liệu đã có nhãn đúng"}, {"id": "a2", "text": "Học không cần dữ liệu"}, {"id": "a3", "text": "Học chỉ từ phần thưởng"}, {"id": "a4", "text": "Học bằng cách nén dữ liệu"}], "correct": "a1"}, - {"id": "q12", "q": "Tham số \"temperature\" của một LLM chủ yếu điều chỉnh điều gì?", - "answers": [{"id": "a1", "text": "Mức độ ngẫu nhiên / sáng tạo của câu trả lời"}, {"id": "a2", "text": "Số token tối đa"}, {"id": "a3", "text": "Tốc độ mạng"}, {"id": "a4", "text": "Kích thước mô hình"}], "correct": "a1"}, - {"id": "q13", "q": "Ai được mệnh danh là \"cha đẻ của trí tuệ nhân tạo\" với bài kiểm tra Turing?", - "answers": [{"id": "a1", "text": "Alan Turing"}, {"id": "a2", "text": "Geoffrey Hinton"}, {"id": "a3", "text": "Yann LeCun"}, {"id": "a4", "text": "John McCarthy"}], "correct": "a1"}, - {"id": "q14", "q": "CUDA — nền tảng tính toán song song phổ biến cho AI — do công ty nào tạo ra?", - "answers": [{"id": "a1", "text": "NVIDIA"}, {"id": "a2", "text": "AMD"}, {"id": "a3", "text": "Intel"}, {"id": "a4", "text": "Qualcomm"}], "correct": "a1"}, + {"id": "q1", "q": "Sân nhà của Manchester United tên là gì?", + "answers": [{"id": "a1", "text": "Anfield"}, {"id": "a2", "text": "Old Trafford"}, + {"id": "a3", "text": "Etihad Stadium"}, {"id": "a4", "text": "Stamford Bridge"}], "correct": "a2"}, + {"id": "q2", "q": "Huấn luyện viên thành công nhất lịch sử MU là ai?", + "answers": [{"id": "a1", "text": "José Mourinho"}, {"id": "a2", "text": "Ole Gunnar Solskjær"}, + {"id": "a3", "text": "Sir Alex Ferguson"}, {"id": "a4", "text": "Erik ten Hag"}], "correct": "a3"}, + {"id": "q3", "q": "MU lần đầu vô địch UEFA Champions League vào năm nào?", + "answers": [{"id": "a1", "text": "1968"}, {"id": "a2", "text": "1999"}, + {"id": "a3", "text": "2008"}, {"id": "a4", "text": "2011"}], "correct": "a1"}, + {"id": "q4", "q": "Biệt danh nổi tiếng của câu lạc bộ là gì?", + "answers": [{"id": "a1", "text": "The Gunners"}, {"id": "a2", "text": "The Blues"}, + {"id": "a3", "text": "The Citizens"}, {"id": "a4", "text": "Quỷ Đỏ (Red Devils)"}], "correct": "a4"}, + {"id": "q5", "q": "Huyền thoại nào khoác áo số 7 huyền thoại của MU?", + "answers": [{"id": "a1", "text": "David Beckham"}, {"id": "a2", "text": "Cristiano Ronaldo"}, + {"id": "a3", "text": "Eric Cantona"}, {"id": "a4", "text": "Tất cả đều đúng"}], "correct": "a4"}, ] -_right_messages = ["Chuẩn! Kiến thức AI của bạn vững thật.", "Chính xác! Mời vào hang cùng anh em.", - "Đúng rồi! Trí tuệ nhân tạo đang chờ bạn trong hang."] -_wrong_messages = ["Chưa đúng — không sao, vào hang anh em trao đổi thêm.", +_right_messages = ["Chuẩn fan Quỷ đỏ! Mời vào hang.", "Chính xác! Sir Alex mà biết chắc cũng gật gù.", + "Đúng rồi! Glory Glory Man United!"] +_wrong_messages = ["Trượt mất rồi! Không sao, vào hang anh em kể thêm cho.", "Sai một chút thôi, hang vẫn mở cửa chào bạn.", - "Hụt rồi! Đáp án đúng đang được tô xanh đó."] + "Hụt như sút phạt đền vọt xà! Đáp án đúng tô xanh đó."] def _rand_pick(arr): return arr[random.randrange(len(arr))] @@ -1329,7 +543,6 @@ async def join_room(req: JoinRequest): if number is not None and not (1 <= number <= 99): raise HTTPException(422, "Jersey number must be 1-99") player = Player(id=player_id, name=req.player_name, number=number, sid=uuid.uuid4().hex[:12]) - _att_join(req.player_name) # V89: visits theo ngày rooms[req.room_id][player_id] = player player_rooms[player_id] = req.room_id return {"player_id": player_id, "room": {"id": req.room_id, "name": "Hang chung"}, @@ -1346,76 +559,9 @@ async def leave_queue(req: JoinRequest): async def board(): return {"videos": BOARD["videos"], "music": BOARD["music"]} -@app.get("/api/diag") -async def api_diag(ok: str = "0", y: str = "0", px: str = "0", pz: str = "0", d: str = "", n: str = "0"): - print(f"[diag] boardPx.ok={ok} yaw={y} cam=({px},{pz}) disp={d} n={n}") - return {"ok": True} - - @app.get("/api/board") async def api_board(): - vids = list(BOARD.get("videos", [])) - # V46: cố lấy short AI Tường AI mới nhất (cache) — chèn đầu playlist - vn = await asyncio.get_event_loop().run_in_executor(None, _board_vnews) - if vn: - keep = [v for v in vids if not (v.get("mp4") or "").startswith("https://bep40-vnews.hf.space")][:12] - vids = vn + keep - return {"videos": vids, "music": BOARD["music"]} - -@app.get("/api/board/video") -async def api_board_video(url: str = "", request: _Request = None): - """V46: proxy stream mp4 short AI từ VNEWS — trình duyệt user chỉ tải từ - domain hangmu (tránh CORS + lệ thuộc + chặn mạng). Range supported.""" - if not url.startswith("https://bep40-vnews.hf.space/api/ai/short-file/"): - return JSONResponse({"error": "bad url"}, status_code=400) - try: - hdrs = {"User-Agent": "hangmu-board/1.0"} - if request is not None: - rg = request.headers.get("range") - if rg: - hdrs["Range"] = rg - req = _urq.Request(url, headers=hdrs) - resp = _urq.urlopen(req, timeout=30) - code = resp.status - if code not in (200, 206): - try: resp.close() - except Exception: pass - return JSONResponse({"error": "origin " + str(code)}, status_code=502) - ctype = resp.headers.get("Content-Type", "video/mp4") - out_h = {"Cache-Control": "public, max-age=3600", "Accept-Ranges": "bytes"} - if resp.headers.get("Content-Range"): - out_h["Content-Range"] = resp.headers["Content-Range"] - if resp.headers.get("Content-Length"): - out_h["Content-Length"] = resp.headers["Content-Length"] - - def _stream(): - try: - while True: - chunk = resp.read(65536) - if not chunk: - break - yield chunk - finally: - try: resp.close() - except Exception: pass - - from fastapi.responses import StreamingResponse - return StreamingResponse(_stream(), media_type=ctype, status_code=code, headers=out_h) - except Exception as e: - return JSONResponse({"error": str(e)[:160]}, status_code=502) - - -@app.get("/api/video-proxy") -async def api_video_proxy(url: str = "", title: str = "", img: str = "", loop: int = 1): - """V43: trang embed YouTube nội bộ (xem ở VN, gửi hangmu-playing trung - thực) — màn hình lớn không phụ thuộc VNEWS build.""" - return video_proxy.render_video_proxy(url, title, img, loop) - -@app.get("/api/video-proxy") -async def api_video_proxy(url: str = "", title: str = "", img: str = "", loop: int = 1): - """V43: trang embed YouTube nội bộ (xem ở VN, gửi hangmu-playing trung - thực) — màn hình lớn không phụ thuộc VNEWS build.""" - return video_proxy.render_video_proxy(url, title, img, loop) + return {"videos": BOARD["videos"], "music": BOARD["music"]} @app.get("/api/board/status") async def api_board_status(): @@ -1429,7 +575,7 @@ async def api_board_refresh(): fresh = await asyncio.get_event_loop().run_in_executor(None, _board_refresh_playlist) _BOARD_SCRAPE["at"] = time.time() if fresh and fresh != BOARD["videos"]: - BOARD["videos"] = [_yt_meta(v) for v in fresh] + BOARD["videos"] = fresh _BOARD_SCRAPE["last_refresh"] = int(time.time()) _board_persist() return {"ok": True, "videos": BOARD["videos"], "refreshed": bool(fresh)} @@ -1837,7 +983,6 @@ async def websocket_endpoint(ws: WebSocket, player_id: str): if not text.strip(): continue p.lastChatAt = now - _att_bump(p.name, "chats") await broadcast(room_id, {"type": "chat", "player_id": player_id, "player_name": p.name, "message": text, "timestamp": now}) @@ -1898,7 +1043,6 @@ async def websocket_endpoint(ws: WebSocket, player_id: str): if p and poll and not poll.get("voted", {}).get(player_id): poll["voted"][player_id] = True poll["counts"][int(msg.get("option", 0)) % len(poll["options"])] += 1 - _att_bump(p.name, "votes") # V116: diem danh theo luot binh chon await send(ws, {"type": "poll_result", "poll": poll}) elif t == "inviteAsk": @@ -2084,21 +1228,6 @@ async def websocket_endpoint(ws: WebSocket, player_id: str): elif t == "ping": await send(ws, {"type": "pong", "t": msg.get("t", 0)}) - elif t == "christmas_decor": - # Trang tri cay thong — broadcast cho tat ca trong phong - decor = { - "type": "christmas_decor", - "player_id": player_id, - "kind": str(msg.get("kind", ""))[:20], - "x": float(msg.get("x", 0)), - "y": float(msg.get("y", 0)), - "z": float(msg.get("z", 0)), - "color": str(msg.get("color", "#e8262b"))[:20], - } - await broadcast(room_id, decor) - # Gui lai cho nguoi gui de ho biet da nhan - await send(ws, {"type": "christmas_ack", "seq": msg.get("seq", 0)}) - except WebSocketDisconnect: pass finally: @@ -2186,10 +1315,7 @@ app.mount("/static", StaticFiles(directory="frontend"), name="static") @app.get("/") async def serve_index(): - # V38: no-store — cấm trình duyệt cache index.html (trước đây heuristic - # cache giữ bản HTML cũ nhiều giờ -> server v37 mà user vẫn chạy bundle v34 - # "màn hình vẫn y như cũ" dù đã fix). - return FileResponse("frontend/index.html", headers={"Cache-Control": "no-store"}) + return FileResponse("frontend/index.html") @app.get("/env.js") async def env_js(): @@ -2202,7 +1328,7 @@ _PWA_ROOT = ["manifest.json", "sw.js", "icon-192.png", "icon-512.png", async def serve_static(path: str): import os # không nuốt websocket / API routes - if path.startswith("ws/") or path.startswith("ext/") or path.startswith("push/") or path.startswith("api/"): + if path.startswith("ws/") or path.startswith("ext/") or path.startswith("push/"): raise HTTPException(404, "Not found") if path in _PWA_ROOT: pf = os.path.join("frontend", "pwa", path) @@ -2211,8 +1337,7 @@ async def serve_static(path: str): file_path = os.path.join("frontend", path) if os.path.exists(file_path) and os.path.isfile(file_path): return FileResponse(file_path) - # V38: fallback SPA cũng no-store (tránh cache HTML ở route ảo) - return FileResponse("frontend/index.html", headers={"Cache-Control": "no-store"}) + return FileResponse("frontend/index.html") if __name__ == "__main__": uvicorn.run(app, host="0.0.0.0", port=7860) diff --git a/build/esbuild.config.mjs b/build/esbuild.config.mjs index 36dc7538cba4e70e74e5e67717cded1284dea869..5cec285f7c6fd85588f1f6b9fc58e7a7644cf3c9 100644 --- a/build/esbuild.config.mjs +++ b/build/esbuild.config.mjs @@ -1,120 +1,10 @@ // esbuild bundle config: bundles app.js + all deps (react, three, zustand) into ONE file -// V83: FAIL FAST instead of shipping a stale/partial bundle. -// An earlier esbuild error left a half-written app.bundle.js in the image, -// so the Space kept serving a bundle without the new boards. -// V96: guard markers updated — the flat HTML logo overlay ('vai-logo-overlay') -// was REPLACED in v95 by the 3D rock stele. v95 creates VaiSteleRock, but -// patch_v97.mjs REPLACES it with VaiSteleRockV2 (rectangular stele) — so the -// name that actually exists in the final source is VaiSteleRockV2. -// V116: runs the v116 patches FIRST, before bundling, so everything V116 -// changes is what actually gets compiled. -// -// DELIBERATE DECISION — the V116 contract check below WARNS, it does NOT -// fail the build. Reason: the v116 patches restore their sources and exit 0 -// when an anchor drifts, so a failed V116 means "the Space still behaves -// exactly like v115". If this check threw, that same situation would instead -// FAIL the Docker build and take a working Space DOWN — strictly worse. A -// patch that already self-restored must never break the build. -// A hard failure is still correct for the pre-existing V83/V96 MUST list, -// because those markers have always been present. -// -// V116e: THREE FIXES, all found by reading this file / the patches, not by -// running them. -// (a) `src` WAS NEVER DEFINED. Sections 3, 3b, 3c and the final log all use -// `src.includes(...)`, but nothing in this file declared `src`. That is a -// ReferenceError thrown immediately after a successful bundle — i.e. the -// build dies AFTER esbuild did all the work, so the V83 fail-fast guard, -// the V116 contract report and the 3c hard check never ran at all. -// Now read once, right after the artifact is verified. -// (b) THE 'React.React' REPAIR HAD A WHITESPACE HOLE. Detector tested -// includes('React.React.useEffect') (NO space) and the repair used -// /React\.[ \t]+React\./ (tab/space, no newline) — while the comment right -// below writes the artifact as 'React. React.useEffect(' (WITH a space). -// If that whitespace is a newline (what a multi-line replacement produces) -// then detector, repair AND hard check all miss it: broken bundle, green -// build. All three now use \bReact\.\s+React\.(?=useEffect\(). -// (c) THE BUILD ORDER WAS WRONG. patch_v116.mjs anchors home3d's stele text -// with cutFn(s,'VaiSteleText'), but patch_v97 DELETES `function -// VaiSteleText(` (it slices [const VAI_ROCK_POS = .. function -// HomeForecourt(], which is where patch_v95 had put it) and defines -// `VaiSteleText2` instead. cutFn's /function\s+VaiSteleText\s*\(/ cannot -// match 'VaiSteleText2(', so it threw, `fatal` was set, and v116 restored -// ALL FIVE FILES and exited 0: every goal discarded, build green. -// patch_v116e.mjs now runs FIRST and repoints that anchor. import { build } from 'esbuild' -import { existsSync, rmSync, statSync, readFileSync, writeFileSync } from 'node:fs' -import { spawnSync } from 'node:child_process' -/* --------------------------------------------------------------------------- - V116 — apply the patches before bundling, IN THIS ORDER: - patch_v116e.mjs FIRST: repair patch_v116.mjs's dead VaiSteleText anchor - (patch_v97 deleted that name, creating VaiSteleText2). - Without it v116 restores itself and nothing ships. - patch_v116.mjs loaders/hook/textures, video effect, playlist, poll, board - patch_v116a.mjs pick a RANDOM track on cave entry (playIdx < 0) - patch_v116b.mjs replace the V115 back plate with the real poster, guarded - by vaiLogoTex so it can never render a WHITE patch - patch_v116c.mjs rebuild BangVangDiemDanh keeping the ORIGINAL 1024x1180 - canvas + geometry + rotation (-0.42 rad), adding the 4th - "BINH CHON" column, and KEEPING the 60s polling from - patch_v83 (v116 had dropped polling and resized the board) - patch_v116d.mjs repair v116's function cut ('React.' was left behind, so - the effect became React.React.useEffect -> TypeError) - Output goes straight to the Docker log, so the build tells us exactly which - items landed (and which anchor drifted). ---------------------------------------------------------------------------- */ -for (const script of ['patch_v116e.mjs', 'patch_v116.mjs', 'patch_v116a.mjs', 'patch_v116b.mjs', 'patch_v116c.mjs', 'patch_v116d.mjs', 'patch_v117.mjs', 'patch_v118.mjs', 'patch_v119.mjs', 'patch_v120.mjs', 'patch_v121.mjs', 'patch_v122.mjs', 'patch_v122b.mjs', 'patch_v123.mjs', 'patch_v123b.mjs', 'patch_v124.mjs', 'patch_v125.mjs', 'patch_v126.mjs', 'patch_v127.mjs', 'patch_v128.mjs', 'patch_v129.mjs', 'patch_v130.mjs', 'patch_v131.mjs', 'patch_v132.mjs', 'patch_v133.mjs', 'patch_v134.mjs', 'patch_v135.mjs', 'patch_v136.mjs', 'patch_v137.mjs', 'patch_v138.mjs', 'patch_v139.mjs']) { - if (!existsSync(script)) { - if (script === 'patch_v116e.mjs') console.warn('[v116] MISSING ' + script + ' — v116 will restore itself (VaiSteleText anchor is dead) unless patch_v116.mjs was fixed another way') - else console.warn('[v116] missing ' + script + ' — skip') - continue - } - const r = spawnSync(process.execPath, [script, '.'], { stdio: 'inherit', env: process.env }) - if (r.error) console.warn('[v116] could not run ' + script + ': ' + r.error.message) - else console.log('[v116] ' + script + ' exit=' + r.status) -} - -/* --------------------------------------------------------------------------- - V116 BELT AND BRACES — repair the dangling 'React.' directly here. - patch_v116 cuts the video effect by function NAME, and lastIndexOf('useEffect(') - lands INSIDE 'React.useEffect(' — so 6 chars ('React.') are left before the - replacement and the result reads 'React. React.useEffect(', i.e. - React.React.useEffect at runtime. That is a TypeError, but it is valid JS, so - esbuild accepts it and the failure would only show in the browser. - patch_v116d normally fixes this; doing it here as well means the source is - correct even if that patch skipped (e.g. a guard mismatch). Idempotent. - V116e: use \s+ so a NEWLINE between the two 'React.' is caught as well. ---------------------------------------------------------------------------- */ -// 'React.' + whitespace + 'React.useEffect(' -> 'React.useEffect(' -// Narrow on purpose: it only matches when followed by useEffect(, so a comment -// such as "React.ReactNode" can never be touched. -const BAD_REACT = /\bReact\.\s+React\.(?=useEffect\()/g -if (existsSync('frontend/app.js')) { - const a = readFileSync('frontend/app.js', 'utf8') - if (BAD_REACT.test(a)) { - const fixed = a.replace(BAD_REACT, 'React.') - if (!BAD_REACT.test(fixed)) { - writeFileSync('frontend/app.js', fixed) - console.log('[v116] repaired dangling "React." before bundling (would be a TypeError)') - } else { - console.warn('[v116] could NOT repair dangling "React." — bundle guard will fail') - } - } -} - -const OUT = 'frontend/app.bundle.js' - -// 1) remove any stale artifact first -if (existsSync(OUT)) { - rmSync(OUT, { force: true }) - console.log('[esbuild] removed stale', OUT) -} - -// 2) build; any error throws and fails the Docker build -const res = await build({ +await build({ entryPoints: ['frontend/app.js'], bundle: true, - outfile: OUT, + outfile: 'frontend/app.bundle.js', format: 'iife', platform: 'browser', target: ['es2020', 'chrome110', 'firefox115', 'safari14'], @@ -124,108 +14,5 @@ const res = await build({ define: { 'process.env.NODE_ENV': '"production"' }, external: [], logLevel: 'info', - write: true, }) - -if (res.errors && res.errors.length) { - throw new Error('esbuild failed with ' + res.errors.length + ' error(s)') -} -if (!existsSync(OUT)) { - throw new Error('esbuild reported success but ' + OUT + ' is missing') -} - -/* V116e: read the bundle ONCE. 'src' was referenced by every check below but - was never declared, so this whole file threw ReferenceError after a - successful bundle and no guard ever ran. */ -const src = readFileSync(OUT, 'utf8') - -/* 3) verify the artifacts we care about actually landed in the bundle. - NOTE: esbuild escapes non-ASCII, so match ASCII identifiers only. - Each name below was checked against the patch that CREATES it in the FINAL - source (i.e. after the whole chain, not just its first author): - VaiSteleRockV2 <- patch_v97.mjs. patch_v95 first creates VaiSteleRock, - then v97 replaces the whole block with VaiSteleRockV2 - (plus VaiSteleText2) and rewrites the JSX mounting it. - So VaiSteleRock is NOT in the final source; V2 is. - BangTinAI <- patch_v83.mjs - makeAiNewsTex <- patch_v83.mjs - BangVangDiemDanh <- patch_v83.mjs - AiNewsModal <- patch_v96.mjs - AiNewsModalHost <- patch_v98.mjs. CONFIRMED by reading v98 bytes 3..16KB: - it defines `function AiNewsModalHost(item, onClose)` - plus `function AiNewsModalBridge({ item, onClose })` - and inserts both before `const MU_POEM = [`. An earlier - note here said "see note below" and no note existed. -*/ -const MUST = ['VaiSteleRockV2', 'BangTinAI', 'makeAiNewsTex', 'BangVangDiemDanh', 'AiNewsModal', 'AiNewsModalHost'] -const missing = MUST.filter((m) => !src.includes(m)) -if (missing.length) { - throw new Error( - 'BUNDLE GUARD FAILED: missing ' + missing.join(', ') + - ' — a patch did not apply; refusing to ship a broken bundle' - ) -} - -/* 3b) V116 CONTRACT — report (do NOT fail) whether the five user requests are - really in the bundle. These are ASCII identifiers/strings, so esbuild cannot - mangle them. If v116 restored itself because an anchor drifted, this log is - loud and specific, but the build still succeeds and the Space keeps running - the previous behaviour instead of going down. */ -const V116 = [ - 'useVaiLogoTex', // (1) shirt logo = real image + async state - 'VAI_LOGO_URL', // (1) /images/vai-logo.png - '_v116NumTex', // (1) shirt number keeps its own plane - '_v116FallbackTex', // (1) canvas crest if the image 404s - 'vaiLogoTex &&', // (1) poster mesh guarded -> no WHITE patch - // (esbuild injects /* @__PURE__ */ before - // the JSX factory call, so 'vaiLogoTex && (' - // never appears verbatim in the bundle) - '_v116LoadVaiPoster', // (2) home3d poster loader - 'loadV116Logo', // (2) cave3d poster loader - 'hangmu-ended', // (4) auto-advance signal from the proxy - 'Math.floor(Math.random() * useIds.length)', // (4) random track on cave entry - 'playbarOpen', // (5) playlist panel is a toggle - 'board-playbar-toggle', // (5) the button itself - 'setInterval(pull,', // (3) attendance board still polls (60s, patch_v83 parity) - // (esbuild minifies 60000 -> 6e4) - 'width = 1024', // (3) board keeps its ORIGINAL size - // (two statements on one line get re-spaced) - '- 190, 164', // (3) 4th column header position: the TIN NHAN - // column sits at (W - 190, 164) and the votes - // column at (W - 54, 164). 'W' is RENAMED to 'W2' - // by esbuild, so anchor on the stable numeric - // offset instead of the variable name. -] -const v116Missing = V116.filter((m) => !src.includes(m)) -if (v116Missing.length) { - console.warn( - 'V116 WARN: bundle is missing ' + v116Missing.join(', ') + - ' — the v116 patches did not fully apply (see the [v116]/[v116a]/[v116b]/' + - '[v116c]/[v116d] WARN lines above). The Space still runs the previous' + - ' behaviour; NOT failing the build.' - ) -} else { - console.log('[esbuild] v116 markers present: ' + V116.join(', ')) -} - -/* 3c) HARD CHECK — a bundle containing a dangling 'React.' immediately before - 'React.useEffect(' always crashes in the browser (React.React is undefined), - yet esbuild accepts it because it is valid JS. The repair above should have - removed it, so if it is STILL here something is badly wrong and we refuse to - ship it. Kept deliberately NARROW (must be followed by useEffect() so a - comment such as "React.ReactNode" or a legitimate JSX type annotation can - never false-positive and take a working Space down). - V116e: test the same \s+ pattern the repair uses, not the space-less - substring — otherwise a newline-separated artifact passes every check. */ -if (src.includes('React.React.useEffect') || /\bReact\.\s+React\.(?=useEffect\()/.test(src)) { - throw new Error( - 'BUNDLE GUARD FAILED: bundle contains a dangling "React." before ' + - '"React.useEffect" — this is a runtime TypeError. Fix patch_v116.mjs ' + - 'cutCallContaining (it must prefer the LONGEST matching name, e.g. ' + - '"React.useEffect(") before shipping.' - ) -} - -const kb = (statSync(OUT).size / 1024).toFixed(1) -console.log('[esbuild] bundle OK -> ' + OUT + ' (' + kb + ' kB)') -console.log('[esbuild] guard markers present: ' + MUST.filter((m) => src.includes(m)).join(', ')) +console.log('bundle OK -> frontend/app.bundle.js') diff --git a/deploy-v37.txt b/deploy-v37.txt deleted file mode 100644 index 1c0864b9e2fb1c9e101d708e72f704a06718756b..0000000000000000000000000000000000000000 --- a/deploy-v37.txt +++ /dev/null @@ -1 +0,0 @@ -deploy-v37: self-avatar rot PI + proxy always + yt_meta normalize \ No newline at end of file diff --git a/esbuild.config.mjs b/esbuild.config.mjs deleted file mode 100644 index 1d095232703e9d021a4adaeb09d9b47fb96b6be5..0000000000000000000000000000000000000000 --- a/esbuild.config.mjs +++ /dev/null @@ -1,231 +0,0 @@ -// esbuild bundle config: bundles app.js + all deps (react, three, zustand) into ONE file -// V83: FAIL FAST instead of shipping a stale/partial bundle. -// An earlier esbuild error left a half-written app.bundle.js in the image, -// so the Space kept serving a bundle without the new boards. -// V96: guard markers updated — the flat HTML logo overlay ('vai-logo-overlay') -// was REPLACED in v95 by the 3D rock stele. v95 creates VaiSteleRock, but -// patch_v97.mjs REPLACES it with VaiSteleRockV2 (rectangular stele) — so the -// name that actually exists in the final source is VaiSteleRockV2. -// V116: runs the v116 patches FIRST, before bundling, so everything V116 -// changes is what actually gets compiled. -// -// DELIBERATE DECISION — the V116 contract check below WARNS, it does NOT -// fail the build. Reason: the v116 patches restore their sources and exit 0 -// when an anchor drifts, so a failed V116 means "the Space still behaves -// exactly like v115". If this check threw, that same situation would instead -// FAIL the Docker build and take a working Space DOWN — strictly worse. A -// patch that already self-restored must never break the build. -// A hard failure is still correct for the pre-existing V83/V96 MUST list, -// because those markers have always been present. -// -// V116e: THREE FIXES, all found by reading this file / the patches, not by -// running them. -// (a) `src` WAS NEVER DEFINED. Sections 3, 3b, 3c and the final log all use -// `src.includes(...)`, but nothing in this file declared `src`. That is a -// ReferenceError thrown immediately after a successful bundle — i.e. the -// build dies AFTER esbuild did all the work, so the V83 fail-fast guard, -// the V116 contract report and the 3c hard check never ran at all. -// Now read once, right after the artifact is verified. -// (b) THE 'React.React' REPAIR HAD A WHITESPACE HOLE. Detector tested -// includes('React.React.useEffect') (NO space) and the repair used -// /React\.[ \t]+React\./ (tab/space, no newline) — while the comment right -// below writes the artifact as 'React. React.useEffect(' (WITH a space). -// If that whitespace is a newline (what a multi-line replacement produces) -// then detector, repair AND hard check all miss it: broken bundle, green -// build. All three now use \bReact\.\s+React\.(?=useEffect\(). -// (c) THE BUILD ORDER WAS WRONG. patch_v116.mjs anchors home3d's stele text -// with cutFn(s,'VaiSteleText'), but patch_v97 DELETES `function -// VaiSteleText(` (it slices [const VAI_ROCK_POS = .. function -// HomeForecourt(], which is where patch_v95 had put it) and defines -// `VaiSteleText2` instead. cutFn's /function\s+VaiSteleText\s*\(/ cannot -// match 'VaiSteleText2(', so it threw, `fatal` was set, and v116 restored -// ALL FIVE FILES and exited 0: every goal discarded, build green. -// patch_v116e.mjs now runs FIRST and repoints that anchor. -import { build } from 'esbuild' -import { existsSync, rmSync, statSync, readFileSync, writeFileSync } from 'node:fs' -import { spawnSync } from 'node:child_process' - -/* --------------------------------------------------------------------------- - V116 — apply the patches before bundling, IN THIS ORDER: - patch_v116e.mjs FIRST: repair patch_v116.mjs's dead VaiSteleText anchor - (patch_v97 deleted that name, creating VaiSteleText2). - Without it v116 restores itself and nothing ships. - patch_v116.mjs loaders/hook/textures, video effect, playlist, poll, board - patch_v116a.mjs pick a RANDOM track on cave entry (playIdx < 0) - patch_v116b.mjs replace the V115 back plate with the real poster, guarded - by vaiLogoTex so it can never render a WHITE patch - patch_v116c.mjs rebuild BangVangDiemDanh keeping the ORIGINAL 1024x1180 - canvas + geometry + rotation (-0.42 rad), adding the 4th - "BINH CHON" column, and KEEPING the 60s polling from - patch_v83 (v116 had dropped polling and resized the board) - patch_v116d.mjs repair v116's function cut ('React.' was left behind, so - the effect became React.React.useEffect -> TypeError) - Output goes straight to the Docker log, so the build tells us exactly which - items landed (and which anchor drifted). ---------------------------------------------------------------------------- */ -for (const script of ['patch_v116e.mjs', 'patch_v116.mjs', 'patch_v116a.mjs', 'patch_v116b.mjs', 'patch_v116c.mjs', 'patch_v116d.mjs', 'patch_v117.mjs', 'patch_v118.mjs', 'patch_v119.mjs', 'patch_v120.mjs', 'patch_v121.mjs', 'patch_v122.mjs', 'patch_v122b.mjs', 'patch_v123.mjs', 'patch_v123b.mjs', 'patch_v124.mjs', 'patch_v125.mjs', 'patch_v126.mjs', 'patch_v127.mjs']) { - if (!existsSync(script)) { - if (script === 'patch_v116e.mjs') console.warn('[v116] MISSING ' + script + ' — v116 will restore itself (VaiSteleText anchor is dead) unless patch_v116.mjs was fixed another way') - else console.warn('[v116] missing ' + script + ' — skip') - continue - } - const r = spawnSync(process.execPath, [script, '.'], { stdio: 'inherit', env: process.env }) - if (r.error) console.warn('[v116] could not run ' + script + ': ' + r.error.message) - else console.log('[v116] ' + script + ' exit=' + r.status) -} - -/* --------------------------------------------------------------------------- - V116 BELT AND BRACES — repair the dangling 'React.' directly here. - patch_v116 cuts the video effect by function NAME, and lastIndexOf('useEffect(') - lands INSIDE 'React.useEffect(' — so 6 chars ('React.') are left before the - replacement and the result reads 'React. React.useEffect(', i.e. - React.React.useEffect at runtime. That is a TypeError, but it is valid JS, so - esbuild accepts it and the failure would only show in the browser. - patch_v116d normally fixes this; doing it here as well means the source is - correct even if that patch skipped (e.g. a guard mismatch). Idempotent. - V116e: use \s+ so a NEWLINE between the two 'React.' is caught as well. ---------------------------------------------------------------------------- */ -// 'React.' + whitespace + 'React.useEffect(' -> 'React.useEffect(' -// Narrow on purpose: it only matches when followed by useEffect(, so a comment -// such as "React.ReactNode" can never be touched. -const BAD_REACT = /\bReact\.\s+React\.(?=useEffect\()/g -if (existsSync('frontend/app.js')) { - const a = readFileSync('frontend/app.js', 'utf8') - if (BAD_REACT.test(a)) { - const fixed = a.replace(BAD_REACT, 'React.') - if (!BAD_REACT.test(fixed)) { - writeFileSync('frontend/app.js', fixed) - console.log('[v116] repaired dangling "React." before bundling (would be a TypeError)') - } else { - console.warn('[v116] could NOT repair dangling "React." — bundle guard will fail') - } - } -} - -const OUT = 'frontend/app.bundle.js' - -// 1) remove any stale artifact first -if (existsSync(OUT)) { - rmSync(OUT, { force: true }) - console.log('[esbuild] removed stale', OUT) -} - -// 2) build; any error throws and fails the Docker build -const res = await build({ - entryPoints: ['frontend/app.js'], - bundle: true, - outfile: OUT, - format: 'iife', - platform: 'browser', - target: ['es2020', 'chrome110', 'firefox115', 'safari14'], - minify: false, - sourcemap: false, - loader: { '.js': 'jsx' }, - define: { 'process.env.NODE_ENV': '"production"' }, - external: [], - logLevel: 'info', - write: true, -}) - -if (res.errors && res.errors.length) { - throw new Error('esbuild failed with ' + res.errors.length + ' error(s)') -} -if (!existsSync(OUT)) { - throw new Error('esbuild reported success but ' + OUT + ' is missing') -} - -/* V116e: read the bundle ONCE. 'src' was referenced by every check below but - was never declared, so this whole file threw ReferenceError after a - successful bundle and no guard ever ran. */ -const src = readFileSync(OUT, 'utf8') - -/* 3) verify the artifacts we care about actually landed in the bundle. - NOTE: esbuild escapes non-ASCII, so match ASCII identifiers only. - Each name below was checked against the patch that CREATES it in the FINAL - source (i.e. after the whole chain, not just its first author): - VaiSteleRockV2 <- patch_v97.mjs. patch_v95 first creates VaiSteleRock, - then v97 replaces the whole block with VaiSteleRockV2 - (plus VaiSteleText2) and rewrites the JSX mounting it. - So VaiSteleRock is NOT in the final source; V2 is. - BangTinAI <- patch_v83.mjs - makeAiNewsTex <- patch_v83.mjs - BangVangDiemDanh <- patch_v83.mjs - AiNewsModal <- patch_v96.mjs - AiNewsModalHost <- patch_v98.mjs. CONFIRMED by reading v98 bytes 3..16KB: - it defines `function AiNewsModalHost(item, onClose)` - plus `function AiNewsModalBridge({ item, onClose })` - and inserts both before `const MU_POEM = [`. An earlier - note here said "see note below" and no note existed. -*/ -const MUST = ['VaiSteleRockV2', 'BangTinAI', 'makeAiNewsTex', 'BangVangDiemDanh', 'AiNewsModal', 'AiNewsModalHost'] -const missing = MUST.filter((m) => !src.includes(m)) -if (missing.length) { - throw new Error( - 'BUNDLE GUARD FAILED: missing ' + missing.join(', ') + - ' — a patch did not apply; refusing to ship a broken bundle' - ) -} - -/* 3b) V116 CONTRACT — report (do NOT fail) whether the five user requests are - really in the bundle. These are ASCII identifiers/strings, so esbuild cannot - mangle them. If v116 restored itself because an anchor drifted, this log is - loud and specific, but the build still succeeds and the Space keeps running - the previous behaviour instead of going down. */ -const V116 = [ - 'useVaiLogoTex', // (1) shirt logo = real image + async state - 'VAI_LOGO_URL', // (1) /images/vai-logo.png - '_v116NumTex', // (1) shirt number keeps its own plane - '_v116FallbackTex', // (1) canvas crest if the image 404s - 'vaiLogoTex &&', // (1) poster mesh guarded -> no WHITE patch - // (esbuild injects /* @__PURE__ */ before - // the JSX factory call, so 'vaiLogoTex && (' - // never appears verbatim in the bundle) - '_v116LoadVaiPoster', // (2) home3d poster loader - 'loadV116Logo', // (2) cave3d poster loader - 'hangmu-ended', // (4) auto-advance signal from the proxy - 'Math.floor(Math.random() * useIds.length)', // (4) random track on cave entry - 'playbarOpen', // (5) playlist panel is a toggle - 'board-playbar-toggle', // (5) the button itself - 'setInterval(pull,', // (3) attendance board still polls (60s, patch_v83 parity) - // (esbuild minifies 60000 -> 6e4) - 'width = 1024', // (3) board keeps its ORIGINAL size - // (two statements on one line get re-spaced) - '- 190, 164', // (3) 4th column header position: the TIN NHAN - // column sits at (W - 190, 164) and the votes - // column at (W - 54, 164). 'W' is RENAMED to 'W2' - // by esbuild, so anchor on the stable numeric - // offset instead of the variable name. -] -const v116Missing = V116.filter((m) => !src.includes(m)) -if (v116Missing.length) { - console.warn( - 'V116 WARN: bundle is missing ' + v116Missing.join(', ') + - ' — the v116 patches did not fully apply (see the [v116]/[v116a]/[v116b]/' + - '[v116c]/[v116d] WARN lines above). The Space still runs the previous' + - ' behaviour; NOT failing the build.' - ) -} else { - console.log('[esbuild] v116 markers present: ' + V116.join(', ')) -} - -/* 3c) HARD CHECK — a bundle containing a dangling 'React.' immediately before - 'React.useEffect(' always crashes in the browser (React.React is undefined), - yet esbuild accepts it because it is valid JS. The repair above should have - removed it, so if it is STILL here something is badly wrong and we refuse to - ship it. Kept deliberately NARROW (must be followed by useEffect() so a - comment such as "React.ReactNode" or a legitimate JSX type annotation can - never false-positive and take a working Space down). - V116e: test the same \s+ pattern the repair uses, not the space-less - substring — otherwise a newline-separated artifact passes every check. */ -if (src.includes('React.React.useEffect') || /\bReact\.\s+React\.(?=useEffect\()/.test(src)) { - throw new Error( - 'BUNDLE GUARD FAILED: bundle contains a dangling "React." before ' + - '"React.useEffect" — this is a runtime TypeError. Fix patch_v116.mjs ' + - 'cutCallContaining (it must prefer the LONGEST matching name, e.g. ' + - '"React.useEffect(") before shipping.' - ) -} - -const kb = (statSync(OUT).size / 1024).toFixed(1) -console.log('[esbuild] bundle OK -> ' + OUT + ' (' + kb + ' kB)') -console.log('[esbuild] guard markers present: ' + MUST.filter((m) => src.includes(m)).join(', ')) diff --git a/frontend/app.bundle.js b/frontend/app.bundle.js deleted file mode 100644 index 8c3215e789d21529c2969d3d6ee7c0af2dc517fd..0000000000000000000000000000000000000000 --- a/frontend/app.bundle.js +++ /dev/null @@ -1,54038 +0,0 @@ -(() => { - var __create = Object.create; - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __getProtoOf = Object.getPrototypeOf; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; - }; - var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod - )); - - // node_modules/react/cjs/react.production.min.js - var require_react_production_min = __commonJS({ - "node_modules/react/cjs/react.production.min.js"(exports) { - "use strict"; - var l = Symbol.for("react.element"); - var n = Symbol.for("react.portal"); - var p = Symbol.for("react.fragment"); - var q = Symbol.for("react.strict_mode"); - var r = Symbol.for("react.profiler"); - var t = Symbol.for("react.provider"); - var u = Symbol.for("react.context"); - var v = Symbol.for("react.forward_ref"); - var w = Symbol.for("react.suspense"); - var x = Symbol.for("react.memo"); - var y = Symbol.for("react.lazy"); - var z = Symbol.iterator; - function A(a) { - if (null === a || "object" !== typeof a) return null; - a = z && a[z] || a["@@iterator"]; - return "function" === typeof a ? a : null; - } - var B = { isMounted: function() { - return false; - }, enqueueForceUpdate: function() { - }, enqueueReplaceState: function() { - }, enqueueSetState: function() { - } }; - var C = Object.assign; - var D = {}; - function E(a, b, e) { - this.props = a; - this.context = b; - this.refs = D; - this.updater = e || B; - } - E.prototype.isReactComponent = {}; - E.prototype.setState = function(a, b) { - if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables."); - this.updater.enqueueSetState(this, a, b, "setState"); - }; - E.prototype.forceUpdate = function(a) { - this.updater.enqueueForceUpdate(this, a, "forceUpdate"); - }; - function F() { - } - F.prototype = E.prototype; - function G(a, b, e) { - this.props = a; - this.context = b; - this.refs = D; - this.updater = e || B; - } - var H = G.prototype = new F(); - H.constructor = G; - C(H, E.prototype); - H.isPureReactComponent = true; - var I = Array.isArray; - var J = Object.prototype.hasOwnProperty; - var K = { current: null }; - var L = { key: true, ref: true, __self: true, __source: true }; - function M(a, b, e) { - var d, c = {}, k = null, h = null; - if (null != b) for (d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b) J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]); - var g = arguments.length - 2; - if (1 === g) c.children = e; - else if (1 < g) { - for (var f = Array(g), m = 0; m < g; m++) f[m] = arguments[m + 2]; - c.children = f; - } - if (a && a.defaultProps) for (d in g = a.defaultProps, g) void 0 === c[d] && (c[d] = g[d]); - return { $$typeof: l, type: a, key: k, ref: h, props: c, _owner: K.current }; - } - function N(a, b) { - return { $$typeof: l, type: a.type, key: b, ref: a.ref, props: a.props, _owner: a._owner }; - } - function O(a) { - return "object" === typeof a && null !== a && a.$$typeof === l; - } - function escape2(a) { - var b = { "=": "=0", ":": "=2" }; - return "$" + a.replace(/[=:]/g, function(a2) { - return b[a2]; - }); - } - var P = /\/+/g; - function Q(a, b) { - return "object" === typeof a && null !== a && null != a.key ? escape2("" + a.key) : b.toString(36); - } - function R2(a, b, e, d, c) { - var k = typeof a; - if ("undefined" === k || "boolean" === k) a = null; - var h = false; - if (null === a) h = true; - else switch (k) { - case "string": - case "number": - h = true; - break; - case "object": - switch (a.$$typeof) { - case l: - case n: - h = true; - } - } - if (h) return h = a, c = c(h), a = "" === d ? "." + Q(h, 0) : d, I(c) ? (e = "", null != a && (e = a.replace(P, "$&/") + "/"), R2(c, b, e, "", function(a2) { - return a2; - })) : null != c && (O(c) && (c = N(c, e + (!c.key || h && h.key === c.key ? "" : ("" + c.key).replace(P, "$&/") + "/") + a)), b.push(c)), 1; - h = 0; - d = "" === d ? "." : d + ":"; - if (I(a)) for (var g = 0; g < a.length; g++) { - k = a[g]; - var f = d + Q(k, g); - h += R2(k, b, e, f, c); - } - else if (f = A(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done; ) k = k.value, f = d + Q(k, g++), h += R2(k, b, e, f, c); - else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead."); - return h; - } - function S(a, b, e) { - if (null == a) return a; - var d = [], c = 0; - R2(a, d, "", "", function(a2) { - return b.call(e, a2, c++); - }); - return d; - } - function T(a) { - if (-1 === a._status) { - var b = a._result; - b = b(); - b.then(function(b2) { - if (0 === a._status || -1 === a._status) a._status = 1, a._result = b2; - }, function(b2) { - if (0 === a._status || -1 === a._status) a._status = 2, a._result = b2; - }); - -1 === a._status && (a._status = 0, a._result = b); - } - if (1 === a._status) return a._result.default; - throw a._result; - } - var U = { current: null }; - var V = { transition: null }; - var W = { ReactCurrentDispatcher: U, ReactCurrentBatchConfig: V, ReactCurrentOwner: K }; - function X() { - throw Error("act(...) is not supported in production builds of React."); - } - exports.Children = { map: S, forEach: function(a, b, e) { - S(a, function() { - b.apply(this, arguments); - }, e); - }, count: function(a) { - var b = 0; - S(a, function() { - b++; - }); - return b; - }, toArray: function(a) { - return S(a, function(a2) { - return a2; - }) || []; - }, only: function(a) { - if (!O(a)) throw Error("React.Children.only expected to receive a single React element child."); - return a; - } }; - exports.Component = E; - exports.Fragment = p; - exports.Profiler = r; - exports.PureComponent = G; - exports.StrictMode = q; - exports.Suspense = w; - exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = W; - exports.act = X; - exports.cloneElement = function(a, b, e) { - if (null === a || void 0 === a) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + a + "."); - var d = C({}, a.props), c = a.key, k = a.ref, h = a._owner; - if (null != b) { - void 0 !== b.ref && (k = b.ref, h = K.current); - void 0 !== b.key && (c = "" + b.key); - if (a.type && a.type.defaultProps) var g = a.type.defaultProps; - for (f in b) J.call(b, f) && !L.hasOwnProperty(f) && (d[f] = void 0 === b[f] && void 0 !== g ? g[f] : b[f]); - } - var f = arguments.length - 2; - if (1 === f) d.children = e; - else if (1 < f) { - g = Array(f); - for (var m = 0; m < f; m++) g[m] = arguments[m + 2]; - d.children = g; - } - return { $$typeof: l, type: a.type, key: c, ref: k, props: d, _owner: h }; - }; - exports.createContext = function(a) { - a = { $$typeof: u, _currentValue: a, _currentValue2: a, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }; - a.Provider = { $$typeof: t, _context: a }; - return a.Consumer = a; - }; - exports.createElement = M; - exports.createFactory = function(a) { - var b = M.bind(null, a); - b.type = a; - return b; - }; - exports.createRef = function() { - return { current: null }; - }; - exports.forwardRef = function(a) { - return { $$typeof: v, render: a }; - }; - exports.isValidElement = O; - exports.lazy = function(a) { - return { $$typeof: y, _payload: { _status: -1, _result: a }, _init: T }; - }; - exports.memo = function(a, b) { - return { $$typeof: x, type: a, compare: void 0 === b ? null : b }; - }; - exports.startTransition = function(a) { - var b = V.transition; - V.transition = {}; - try { - a(); - } finally { - V.transition = b; - } - }; - exports.unstable_act = X; - exports.useCallback = function(a, b) { - return U.current.useCallback(a, b); - }; - exports.useContext = function(a) { - return U.current.useContext(a); - }; - exports.useDebugValue = function() { - }; - exports.useDeferredValue = function(a) { - return U.current.useDeferredValue(a); - }; - exports.useEffect = function(a, b) { - return U.current.useEffect(a, b); - }; - exports.useId = function() { - return U.current.useId(); - }; - exports.useImperativeHandle = function(a, b, e) { - return U.current.useImperativeHandle(a, b, e); - }; - exports.useInsertionEffect = function(a, b) { - return U.current.useInsertionEffect(a, b); - }; - exports.useLayoutEffect = function(a, b) { - return U.current.useLayoutEffect(a, b); - }; - exports.useMemo = function(a, b) { - return U.current.useMemo(a, b); - }; - exports.useReducer = function(a, b, e) { - return U.current.useReducer(a, b, e); - }; - exports.useRef = function(a) { - return U.current.useRef(a); - }; - exports.useState = function(a) { - return U.current.useState(a); - }; - exports.useSyncExternalStore = function(a, b, e) { - return U.current.useSyncExternalStore(a, b, e); - }; - exports.useTransition = function() { - return U.current.useTransition(); - }; - exports.version = "18.3.1"; - } - }); - - // node_modules/react/index.js - var require_react = __commonJS({ - "node_modules/react/index.js"(exports, module) { - "use strict"; - if (true) { - module.exports = require_react_production_min(); - } else { - module.exports = null; - } - } - }); - - // node_modules/react-dom/node_modules/scheduler/cjs/scheduler.production.min.js - var require_scheduler_production_min = __commonJS({ - "node_modules/react-dom/node_modules/scheduler/cjs/scheduler.production.min.js"(exports) { - "use strict"; - function f(a, b) { - var c = a.length; - a.push(b); - a: for (; 0 < c; ) { - var d = c - 1 >>> 1, e = a[d]; - if (0 < g(e, b)) a[d] = b, a[c] = e, c = d; - else break a; - } - } - function h(a) { - return 0 === a.length ? null : a[0]; - } - function k(a) { - if (0 === a.length) return null; - var b = a[0], c = a.pop(); - if (c !== b) { - a[0] = c; - a: for (var d = 0, e = a.length, w = e >>> 1; d < w; ) { - var m = 2 * (d + 1) - 1, C = a[m], n = m + 1, x = a[n]; - if (0 > g(C, c)) n < e && 0 > g(x, C) ? (a[d] = x, a[n] = c, d = n) : (a[d] = C, a[m] = c, d = m); - else if (n < e && 0 > g(x, c)) a[d] = x, a[n] = c, d = n; - else break a; - } - } - return b; - } - function g(a, b) { - var c = a.sortIndex - b.sortIndex; - return 0 !== c ? c : a.id - b.id; - } - if ("object" === typeof performance && "function" === typeof performance.now) { - l = performance; - exports.unstable_now = function() { - return l.now(); - }; - } else { - p = Date, q = p.now(); - exports.unstable_now = function() { - return p.now() - q; - }; - } - var l; - var p; - var q; - var r = []; - var t = []; - var u = 1; - var v = null; - var y = 3; - var z = false; - var A = false; - var B = false; - var D = "function" === typeof setTimeout ? setTimeout : null; - var E = "function" === typeof clearTimeout ? clearTimeout : null; - var F = "undefined" !== typeof setImmediate ? setImmediate : null; - "undefined" !== typeof navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling); - function G(a) { - for (var b = h(t); null !== b; ) { - if (null === b.callback) k(t); - else if (b.startTime <= a) k(t), b.sortIndex = b.expirationTime, f(r, b); - else break; - b = h(t); - } - } - function H(a) { - B = false; - G(a); - if (!A) if (null !== h(r)) A = true, I(J); - else { - var b = h(t); - null !== b && K(H, b.startTime - a); - } - } - function J(a, b) { - A = false; - B && (B = false, E(L), L = -1); - z = true; - var c = y; - try { - G(b); - for (v = h(r); null !== v && (!(v.expirationTime > b) || a && !M()); ) { - var d = v.callback; - if ("function" === typeof d) { - v.callback = null; - y = v.priorityLevel; - var e = d(v.expirationTime <= b); - b = exports.unstable_now(); - "function" === typeof e ? v.callback = e : v === h(r) && k(r); - G(b); - } else k(r); - v = h(r); - } - if (null !== v) var w = true; - else { - var m = h(t); - null !== m && K(H, m.startTime - b); - w = false; - } - return w; - } finally { - v = null, y = c, z = false; - } - } - var N = false; - var O = null; - var L = -1; - var P = 5; - var Q = -1; - function M() { - return exports.unstable_now() - Q < P ? false : true; - } - function R2() { - if (null !== O) { - var a = exports.unstable_now(); - Q = a; - var b = true; - try { - b = O(true, a); - } finally { - b ? S() : (N = false, O = null); - } - } else N = false; - } - var S; - if ("function" === typeof F) S = function() { - F(R2); - }; - else if ("undefined" !== typeof MessageChannel) { - T = new MessageChannel(), U = T.port2; - T.port1.onmessage = R2; - S = function() { - U.postMessage(null); - }; - } else S = function() { - D(R2, 0); - }; - var T; - var U; - function I(a) { - O = a; - N || (N = true, S()); - } - function K(a, b) { - L = D(function() { - a(exports.unstable_now()); - }, b); - } - exports.unstable_IdlePriority = 5; - exports.unstable_ImmediatePriority = 1; - exports.unstable_LowPriority = 4; - exports.unstable_NormalPriority = 3; - exports.unstable_Profiling = null; - exports.unstable_UserBlockingPriority = 2; - exports.unstable_cancelCallback = function(a) { - a.callback = null; - }; - exports.unstable_continueExecution = function() { - A || z || (A = true, I(J)); - }; - exports.unstable_forceFrameRate = function(a) { - 0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P = 0 < a ? Math.floor(1e3 / a) : 5; - }; - exports.unstable_getCurrentPriorityLevel = function() { - return y; - }; - exports.unstable_getFirstCallbackNode = function() { - return h(r); - }; - exports.unstable_next = function(a) { - switch (y) { - case 1: - case 2: - case 3: - var b = 3; - break; - default: - b = y; - } - var c = y; - y = b; - try { - return a(); - } finally { - y = c; - } - }; - exports.unstable_pauseExecution = function() { - }; - exports.unstable_requestPaint = function() { - }; - exports.unstable_runWithPriority = function(a, b) { - switch (a) { - case 1: - case 2: - case 3: - case 4: - case 5: - break; - default: - a = 3; - } - var c = y; - y = a; - try { - return b(); - } finally { - y = c; - } - }; - exports.unstable_scheduleCallback = function(a, b, c) { - var d = exports.unstable_now(); - "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d; - switch (a) { - case 1: - var e = -1; - break; - case 2: - e = 250; - break; - case 5: - e = 1073741823; - break; - case 4: - e = 1e4; - break; - default: - e = 5e3; - } - e = c + e; - a = { id: u++, callback: b, priorityLevel: a, startTime: c, expirationTime: e, sortIndex: -1 }; - c > d ? (a.sortIndex = c, f(t, a), null === h(r) && a === h(t) && (B ? (E(L), L = -1) : B = true, K(H, c - d))) : (a.sortIndex = e, f(r, a), A || z || (A = true, I(J))); - return a; - }; - exports.unstable_shouldYield = M; - exports.unstable_wrapCallback = function(a) { - var b = y; - return function() { - var c = y; - y = b; - try { - return a.apply(this, arguments); - } finally { - y = c; - } - }; - }; - } - }); - - // node_modules/react-dom/node_modules/scheduler/index.js - var require_scheduler = __commonJS({ - "node_modules/react-dom/node_modules/scheduler/index.js"(exports, module) { - "use strict"; - if (true) { - module.exports = require_scheduler_production_min(); - } else { - module.exports = null; - } - } - }); - - // node_modules/react-dom/cjs/react-dom.production.min.js - var require_react_dom_production_min = __commonJS({ - "node_modules/react-dom/cjs/react-dom.production.min.js"(exports) { - "use strict"; - var aa = require_react(); - var ca = require_scheduler(); - function p(a) { - for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) b += "&args[]=" + encodeURIComponent(arguments[c]); - return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; - } - var da = /* @__PURE__ */ new Set(); - var ea = {}; - function fa(a, b) { - ha(a, b); - ha(a + "Capture", b); - } - function ha(a, b) { - ea[a] = b; - for (a = 0; a < b.length; a++) da.add(b[a]); - } - var ia = !("undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement); - var ja = Object.prototype.hasOwnProperty; - var ka = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/; - var la = {}; - var ma = {}; - function oa(a) { - if (ja.call(ma, a)) return true; - if (ja.call(la, a)) return false; - if (ka.test(a)) return ma[a] = true; - la[a] = true; - return false; - } - function pa(a, b, c, d) { - if (null !== c && 0 === c.type) return false; - switch (typeof b) { - case "function": - case "symbol": - return true; - case "boolean": - if (d) return false; - if (null !== c) return !c.acceptsBooleans; - a = a.toLowerCase().slice(0, 5); - return "data-" !== a && "aria-" !== a; - default: - return false; - } - } - function qa(a, b, c, d) { - if (null === b || "undefined" === typeof b || pa(a, b, c, d)) return true; - if (d) return false; - if (null !== c) switch (c.type) { - case 3: - return !b; - case 4: - return false === b; - case 5: - return isNaN(b); - case 6: - return isNaN(b) || 1 > b; - } - return false; - } - function v(a, b, c, d, e, f, g) { - this.acceptsBooleans = 2 === b || 3 === b || 4 === b; - this.attributeName = d; - this.attributeNamespace = e; - this.mustUseProperty = c; - this.propertyName = a; - this.type = b; - this.sanitizeURL = f; - this.removeEmptyString = g; - } - var z = {}; - "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a) { - z[a] = new v(a, 0, false, a, null, false, false); - }); - [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(a) { - var b = a[0]; - z[b] = new v(b, 1, false, a[1], null, false, false); - }); - ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(a) { - z[a] = new v(a, 2, false, a.toLowerCase(), null, false, false); - }); - ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(a) { - z[a] = new v(a, 2, false, a, null, false, false); - }); - "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a) { - z[a] = new v(a, 3, false, a.toLowerCase(), null, false, false); - }); - ["checked", "multiple", "muted", "selected"].forEach(function(a) { - z[a] = new v(a, 3, true, a, null, false, false); - }); - ["capture", "download"].forEach(function(a) { - z[a] = new v(a, 4, false, a, null, false, false); - }); - ["cols", "rows", "size", "span"].forEach(function(a) { - z[a] = new v(a, 6, false, a, null, false, false); - }); - ["rowSpan", "start"].forEach(function(a) { - z[a] = new v(a, 5, false, a.toLowerCase(), null, false, false); - }); - var ra = /[\-:]([a-z])/g; - function sa(a) { - return a[1].toUpperCase(); - } - "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a) { - var b = a.replace( - ra, - sa - ); - z[b] = new v(b, 1, false, a, null, false, false); - }); - "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a) { - var b = a.replace(ra, sa); - z[b] = new v(b, 1, false, a, "http://www.w3.org/1999/xlink", false, false); - }); - ["xml:base", "xml:lang", "xml:space"].forEach(function(a) { - var b = a.replace(ra, sa); - z[b] = new v(b, 1, false, a, "http://www.w3.org/XML/1998/namespace", false, false); - }); - ["tabIndex", "crossOrigin"].forEach(function(a) { - z[a] = new v(a, 1, false, a.toLowerCase(), null, false, false); - }); - z.xlinkHref = new v("xlinkHref", 1, false, "xlink:href", "http://www.w3.org/1999/xlink", true, false); - ["src", "href", "action", "formAction"].forEach(function(a) { - z[a] = new v(a, 1, false, a.toLowerCase(), null, true, true); - }); - function ta(a, b, c, d) { - var e = z.hasOwnProperty(b) ? z[b] : null; - if (null !== e ? 0 !== e.type : d || !(2 < b.length) || "o" !== b[0] && "O" !== b[0] || "n" !== b[1] && "N" !== b[1]) qa(b, c, e, d) && (c = null), d || null === e ? oa(b) && (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) : e.mustUseProperty ? a[e.propertyName] = null === c ? 3 === e.type ? false : "" : c : (b = e.attributeName, d = e.attributeNamespace, null === c ? a.removeAttribute(b) : (e = e.type, c = 3 === e || 4 === e && true === c ? "" : "" + c, d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c))); - } - var ua = aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - var va = Symbol.for("react.element"); - var wa = Symbol.for("react.portal"); - var ya = Symbol.for("react.fragment"); - var za = Symbol.for("react.strict_mode"); - var Aa = Symbol.for("react.profiler"); - var Ba = Symbol.for("react.provider"); - var Ca = Symbol.for("react.context"); - var Da = Symbol.for("react.forward_ref"); - var Ea = Symbol.for("react.suspense"); - var Fa = Symbol.for("react.suspense_list"); - var Ga = Symbol.for("react.memo"); - var Ha = Symbol.for("react.lazy"); - Symbol.for("react.scope"); - Symbol.for("react.debug_trace_mode"); - var Ia = Symbol.for("react.offscreen"); - Symbol.for("react.legacy_hidden"); - Symbol.for("react.cache"); - Symbol.for("react.tracing_marker"); - var Ja = Symbol.iterator; - function Ka(a) { - if (null === a || "object" !== typeof a) return null; - a = Ja && a[Ja] || a["@@iterator"]; - return "function" === typeof a ? a : null; - } - var A = Object.assign; - var La; - function Ma(a) { - if (void 0 === La) try { - throw Error(); - } catch (c) { - var b = c.stack.trim().match(/\n( *(at )?)/); - La = b && b[1] || ""; - } - return "\n" + La + a; - } - var Na = false; - function Oa(a, b) { - if (!a || Na) return ""; - Na = true; - var c = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - try { - if (b) if (b = function() { - throw Error(); - }, Object.defineProperty(b.prototype, "props", { set: function() { - throw Error(); - } }), "object" === typeof Reflect && Reflect.construct) { - try { - Reflect.construct(b, []); - } catch (l) { - var d = l; - } - Reflect.construct(a, [], b); - } else { - try { - b.call(); - } catch (l) { - d = l; - } - a.call(b.prototype); - } - else { - try { - throw Error(); - } catch (l) { - d = l; - } - a(); - } - } catch (l) { - if (l && d && "string" === typeof l.stack) { - for (var e = l.stack.split("\n"), f = d.stack.split("\n"), g = e.length - 1, h = f.length - 1; 1 <= g && 0 <= h && e[g] !== f[h]; ) h--; - for (; 1 <= g && 0 <= h; g--, h--) if (e[g] !== f[h]) { - if (1 !== g || 1 !== h) { - do - if (g--, h--, 0 > h || e[g] !== f[h]) { - var k = "\n" + e[g].replace(" at new ", " at "); - a.displayName && k.includes("") && (k = k.replace("", a.displayName)); - return k; - } - while (1 <= g && 0 <= h); - } - break; - } - } - } finally { - Na = false, Error.prepareStackTrace = c; - } - return (a = a ? a.displayName || a.name : "") ? Ma(a) : ""; - } - function Pa(a) { - switch (a.tag) { - case 5: - return Ma(a.type); - case 16: - return Ma("Lazy"); - case 13: - return Ma("Suspense"); - case 19: - return Ma("SuspenseList"); - case 0: - case 2: - case 15: - return a = Oa(a.type, false), a; - case 11: - return a = Oa(a.type.render, false), a; - case 1: - return a = Oa(a.type, true), a; - default: - return ""; - } - } - function Qa(a) { - if (null == a) return null; - if ("function" === typeof a) return a.displayName || a.name || null; - if ("string" === typeof a) return a; - switch (a) { - case ya: - return "Fragment"; - case wa: - return "Portal"; - case Aa: - return "Profiler"; - case za: - return "StrictMode"; - case Ea: - return "Suspense"; - case Fa: - return "SuspenseList"; - } - if ("object" === typeof a) switch (a.$$typeof) { - case Ca: - return (a.displayName || "Context") + ".Consumer"; - case Ba: - return (a._context.displayName || "Context") + ".Provider"; - case Da: - var b = a.render; - a = a.displayName; - a || (a = b.displayName || b.name || "", a = "" !== a ? "ForwardRef(" + a + ")" : "ForwardRef"); - return a; - case Ga: - return b = a.displayName || null, null !== b ? b : Qa(a.type) || "Memo"; - case Ha: - b = a._payload; - a = a._init; - try { - return Qa(a(b)); - } catch (c) { - } - } - return null; - } - function Ra(a) { - var b = a.type; - switch (a.tag) { - case 24: - return "Cache"; - case 9: - return (b.displayName || "Context") + ".Consumer"; - case 10: - return (b._context.displayName || "Context") + ".Provider"; - case 18: - return "DehydratedFragment"; - case 11: - return a = b.render, a = a.displayName || a.name || "", b.displayName || ("" !== a ? "ForwardRef(" + a + ")" : "ForwardRef"); - case 7: - return "Fragment"; - case 5: - return b; - case 4: - return "Portal"; - case 3: - return "Root"; - case 6: - return "Text"; - case 16: - return Qa(b); - case 8: - return b === za ? "StrictMode" : "Mode"; - case 22: - return "Offscreen"; - case 12: - return "Profiler"; - case 21: - return "Scope"; - case 13: - return "Suspense"; - case 19: - return "SuspenseList"; - case 25: - return "TracingMarker"; - case 1: - case 0: - case 17: - case 2: - case 14: - case 15: - if ("function" === typeof b) return b.displayName || b.name || null; - if ("string" === typeof b) return b; - } - return null; - } - function Sa(a) { - switch (typeof a) { - case "boolean": - case "number": - case "string": - case "undefined": - return a; - case "object": - return a; - default: - return ""; - } - } - function Ta(a) { - var b = a.type; - return (a = a.nodeName) && "input" === a.toLowerCase() && ("checkbox" === b || "radio" === b); - } - function Ua(a) { - var b = Ta(a) ? "checked" : "value", c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b), d = "" + a[b]; - if (!a.hasOwnProperty(b) && "undefined" !== typeof c && "function" === typeof c.get && "function" === typeof c.set) { - var e = c.get, f = c.set; - Object.defineProperty(a, b, { configurable: true, get: function() { - return e.call(this); - }, set: function(a2) { - d = "" + a2; - f.call(this, a2); - } }); - Object.defineProperty(a, b, { enumerable: c.enumerable }); - return { getValue: function() { - return d; - }, setValue: function(a2) { - d = "" + a2; - }, stopTracking: function() { - a._valueTracker = null; - delete a[b]; - } }; - } - } - function Va(a) { - a._valueTracker || (a._valueTracker = Ua(a)); - } - function Wa(a) { - if (!a) return false; - var b = a._valueTracker; - if (!b) return true; - var c = b.getValue(); - var d = ""; - a && (d = Ta(a) ? a.checked ? "true" : "false" : a.value); - a = d; - return a !== c ? (b.setValue(a), true) : false; - } - function Xa(a) { - a = a || ("undefined" !== typeof document ? document : void 0); - if ("undefined" === typeof a) return null; - try { - return a.activeElement || a.body; - } catch (b) { - return a.body; - } - } - function Ya(a, b) { - var c = b.checked; - return A({}, b, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: null != c ? c : a._wrapperState.initialChecked }); - } - function Za(a, b) { - var c = null == b.defaultValue ? "" : b.defaultValue, d = null != b.checked ? b.checked : b.defaultChecked; - c = Sa(null != b.value ? b.value : c); - a._wrapperState = { initialChecked: d, initialValue: c, controlled: "checkbox" === b.type || "radio" === b.type ? null != b.checked : null != b.value }; - } - function ab(a, b) { - b = b.checked; - null != b && ta(a, "checked", b, false); - } - function bb(a, b) { - ab(a, b); - var c = Sa(b.value), d = b.type; - if (null != c) if ("number" === d) { - if (0 === c && "" === a.value || a.value != c) a.value = "" + c; - } else a.value !== "" + c && (a.value = "" + c); - else if ("submit" === d || "reset" === d) { - a.removeAttribute("value"); - return; - } - b.hasOwnProperty("value") ? cb(a, b.type, c) : b.hasOwnProperty("defaultValue") && cb(a, b.type, Sa(b.defaultValue)); - null == b.checked && null != b.defaultChecked && (a.defaultChecked = !!b.defaultChecked); - } - function db(a, b, c) { - if (b.hasOwnProperty("value") || b.hasOwnProperty("defaultValue")) { - var d = b.type; - if (!("submit" !== d && "reset" !== d || void 0 !== b.value && null !== b.value)) return; - b = "" + a._wrapperState.initialValue; - c || b === a.value || (a.value = b); - a.defaultValue = b; - } - c = a.name; - "" !== c && (a.name = ""); - a.defaultChecked = !!a._wrapperState.initialChecked; - "" !== c && (a.name = c); - } - function cb(a, b, c) { - if ("number" !== b || Xa(a.ownerDocument) !== a) null == c ? a.defaultValue = "" + a._wrapperState.initialValue : a.defaultValue !== "" + c && (a.defaultValue = "" + c); - } - var eb = Array.isArray; - function fb(a, b, c, d) { - a = a.options; - if (b) { - b = {}; - for (var e = 0; e < c.length; e++) b["$" + c[e]] = true; - for (c = 0; c < a.length; c++) e = b.hasOwnProperty("$" + a[c].value), a[c].selected !== e && (a[c].selected = e), e && d && (a[c].defaultSelected = true); - } else { - c = "" + Sa(c); - b = null; - for (e = 0; e < a.length; e++) { - if (a[e].value === c) { - a[e].selected = true; - d && (a[e].defaultSelected = true); - return; - } - null !== b || a[e].disabled || (b = a[e]); - } - null !== b && (b.selected = true); - } - } - function gb(a, b) { - if (null != b.dangerouslySetInnerHTML) throw Error(p(91)); - return A({}, b, { value: void 0, defaultValue: void 0, children: "" + a._wrapperState.initialValue }); - } - function hb(a, b) { - var c = b.value; - if (null == c) { - c = b.children; - b = b.defaultValue; - if (null != c) { - if (null != b) throw Error(p(92)); - if (eb(c)) { - if (1 < c.length) throw Error(p(93)); - c = c[0]; - } - b = c; - } - null == b && (b = ""); - c = b; - } - a._wrapperState = { initialValue: Sa(c) }; - } - function ib(a, b) { - var c = Sa(b.value), d = Sa(b.defaultValue); - null != c && (c = "" + c, c !== a.value && (a.value = c), null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c)); - null != d && (a.defaultValue = "" + d); - } - function jb(a) { - var b = a.textContent; - b === a._wrapperState.initialValue && "" !== b && null !== b && (a.value = b); - } - function kb(a) { - switch (a) { - case "svg": - return "http://www.w3.org/2000/svg"; - case "math": - return "http://www.w3.org/1998/Math/MathML"; - default: - return "http://www.w3.org/1999/xhtml"; - } - } - function lb(a, b) { - return null == a || "http://www.w3.org/1999/xhtml" === a ? kb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a; - } - var mb; - var nb = function(a) { - return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) { - MSApp.execUnsafeLocalFunction(function() { - return a(b, c, d, e); - }); - } : a; - }(function(a, b) { - if ("http://www.w3.org/2000/svg" !== a.namespaceURI || "innerHTML" in a) a.innerHTML = b; - else { - mb = mb || document.createElement("div"); - mb.innerHTML = "" + b.valueOf().toString() + ""; - for (b = mb.firstChild; a.firstChild; ) a.removeChild(a.firstChild); - for (; b.firstChild; ) a.appendChild(b.firstChild); - } - }); - function ob(a, b) { - if (b) { - var c = a.firstChild; - if (c && c === a.lastChild && 3 === c.nodeType) { - c.nodeValue = b; - return; - } - } - a.textContent = b; - } - var pb = { - animationIterationCount: true, - aspectRatio: true, - borderImageOutset: true, - borderImageSlice: true, - borderImageWidth: true, - boxFlex: true, - boxFlexGroup: true, - boxOrdinalGroup: true, - columnCount: true, - columns: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - flexOrder: true, - gridArea: true, - gridRow: true, - gridRowEnd: true, - gridRowSpan: true, - gridRowStart: true, - gridColumn: true, - gridColumnEnd: true, - gridColumnSpan: true, - gridColumnStart: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeDasharray: true, - strokeDashoffset: true, - strokeMiterlimit: true, - strokeOpacity: true, - strokeWidth: true - }; - var qb = ["Webkit", "ms", "Moz", "O"]; - Object.keys(pb).forEach(function(a) { - qb.forEach(function(b) { - b = b + a.charAt(0).toUpperCase() + a.substring(1); - pb[b] = pb[a]; - }); - }); - function rb(a, b, c) { - return null == b || "boolean" === typeof b || "" === b ? "" : c || "number" !== typeof b || 0 === b || pb.hasOwnProperty(a) && pb[a] ? ("" + b).trim() : b + "px"; - } - function sb(a, b) { - a = a.style; - for (var c in b) if (b.hasOwnProperty(c)) { - var d = 0 === c.indexOf("--"), e = rb(c, b[c], d); - "float" === c && (c = "cssFloat"); - d ? a.setProperty(c, e) : a[c] = e; - } - } - var tb = A({ menuitem: true }, { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true }); - function ub(a, b) { - if (b) { - if (tb[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) throw Error(p(137, a)); - if (null != b.dangerouslySetInnerHTML) { - if (null != b.children) throw Error(p(60)); - if ("object" !== typeof b.dangerouslySetInnerHTML || !("__html" in b.dangerouslySetInnerHTML)) throw Error(p(61)); - } - if (null != b.style && "object" !== typeof b.style) throw Error(p(62)); - } - } - function vb(a, b) { - if (-1 === a.indexOf("-")) return "string" === typeof b.is; - switch (a) { - case "annotation-xml": - case "color-profile": - case "font-face": - case "font-face-src": - case "font-face-uri": - case "font-face-format": - case "font-face-name": - case "missing-glyph": - return false; - default: - return true; - } - } - var wb = null; - function xb(a) { - a = a.target || a.srcElement || window; - a.correspondingUseElement && (a = a.correspondingUseElement); - return 3 === a.nodeType ? a.parentNode : a; - } - var yb = null; - var zb = null; - var Ab = null; - function Bb(a) { - if (a = Cb(a)) { - if ("function" !== typeof yb) throw Error(p(280)); - var b = a.stateNode; - b && (b = Db(b), yb(a.stateNode, a.type, b)); - } - } - function Eb(a) { - zb ? Ab ? Ab.push(a) : Ab = [a] : zb = a; - } - function Fb() { - if (zb) { - var a = zb, b = Ab; - Ab = zb = null; - Bb(a); - if (b) for (a = 0; a < b.length; a++) Bb(b[a]); - } - } - function Gb(a, b) { - return a(b); - } - function Hb() { - } - var Ib = false; - function Jb(a, b, c) { - if (Ib) return a(b, c); - Ib = true; - try { - return Gb(a, b, c); - } finally { - if (Ib = false, null !== zb || null !== Ab) Hb(), Fb(); - } - } - function Kb(a, b) { - var c = a.stateNode; - if (null === c) return null; - var d = Db(c); - if (null === d) return null; - c = d[b]; - a: switch (b) { - case "onClick": - case "onClickCapture": - case "onDoubleClick": - case "onDoubleClickCapture": - case "onMouseDown": - case "onMouseDownCapture": - case "onMouseMove": - case "onMouseMoveCapture": - case "onMouseUp": - case "onMouseUpCapture": - case "onMouseEnter": - (d = !d.disabled) || (a = a.type, d = !("button" === a || "input" === a || "select" === a || "textarea" === a)); - a = !d; - break a; - default: - a = false; - } - if (a) return null; - if (c && "function" !== typeof c) throw Error(p(231, b, typeof c)); - return c; - } - var Lb = false; - if (ia) try { - Mb = {}; - Object.defineProperty(Mb, "passive", { get: function() { - Lb = true; - } }); - window.addEventListener("test", Mb, Mb); - window.removeEventListener("test", Mb, Mb); - } catch (a) { - Lb = false; - } - var Mb; - function Nb(a, b, c, d, e, f, g, h, k) { - var l = Array.prototype.slice.call(arguments, 3); - try { - b.apply(c, l); - } catch (m) { - this.onError(m); - } - } - var Ob = false; - var Pb = null; - var Qb = false; - var Rb = null; - var Sb = { onError: function(a) { - Ob = true; - Pb = a; - } }; - function Tb(a, b, c, d, e, f, g, h, k) { - Ob = false; - Pb = null; - Nb.apply(Sb, arguments); - } - function Ub(a, b, c, d, e, f, g, h, k) { - Tb.apply(this, arguments); - if (Ob) { - if (Ob) { - var l = Pb; - Ob = false; - Pb = null; - } else throw Error(p(198)); - Qb || (Qb = true, Rb = l); - } - } - function Vb(a) { - var b = a, c = a; - if (a.alternate) for (; b.return; ) b = b.return; - else { - a = b; - do - b = a, 0 !== (b.flags & 4098) && (c = b.return), a = b.return; - while (a); - } - return 3 === b.tag ? c : null; - } - function Wb(a) { - if (13 === a.tag) { - var b = a.memoizedState; - null === b && (a = a.alternate, null !== a && (b = a.memoizedState)); - if (null !== b) return b.dehydrated; - } - return null; - } - function Xb(a) { - if (Vb(a) !== a) throw Error(p(188)); - } - function Yb(a) { - var b = a.alternate; - if (!b) { - b = Vb(a); - if (null === b) throw Error(p(188)); - return b !== a ? null : a; - } - for (var c = a, d = b; ; ) { - var e = c.return; - if (null === e) break; - var f = e.alternate; - if (null === f) { - d = e.return; - if (null !== d) { - c = d; - continue; - } - break; - } - if (e.child === f.child) { - for (f = e.child; f; ) { - if (f === c) return Xb(e), a; - if (f === d) return Xb(e), b; - f = f.sibling; - } - throw Error(p(188)); - } - if (c.return !== d.return) c = e, d = f; - else { - for (var g = false, h = e.child; h; ) { - if (h === c) { - g = true; - c = e; - d = f; - break; - } - if (h === d) { - g = true; - d = e; - c = f; - break; - } - h = h.sibling; - } - if (!g) { - for (h = f.child; h; ) { - if (h === c) { - g = true; - c = f; - d = e; - break; - } - if (h === d) { - g = true; - d = f; - c = e; - break; - } - h = h.sibling; - } - if (!g) throw Error(p(189)); - } - } - if (c.alternate !== d) throw Error(p(190)); - } - if (3 !== c.tag) throw Error(p(188)); - return c.stateNode.current === c ? a : b; - } - function Zb(a) { - a = Yb(a); - return null !== a ? $b(a) : null; - } - function $b(a) { - if (5 === a.tag || 6 === a.tag) return a; - for (a = a.child; null !== a; ) { - var b = $b(a); - if (null !== b) return b; - a = a.sibling; - } - return null; - } - var ac = ca.unstable_scheduleCallback; - var bc = ca.unstable_cancelCallback; - var cc = ca.unstable_shouldYield; - var dc = ca.unstable_requestPaint; - var B = ca.unstable_now; - var ec = ca.unstable_getCurrentPriorityLevel; - var fc = ca.unstable_ImmediatePriority; - var gc = ca.unstable_UserBlockingPriority; - var hc = ca.unstable_NormalPriority; - var ic = ca.unstable_LowPriority; - var jc = ca.unstable_IdlePriority; - var kc = null; - var lc = null; - function mc(a) { - if (lc && "function" === typeof lc.onCommitFiberRoot) try { - lc.onCommitFiberRoot(kc, a, void 0, 128 === (a.current.flags & 128)); - } catch (b) { - } - } - var oc = Math.clz32 ? Math.clz32 : nc; - var pc = Math.log; - var qc = Math.LN2; - function nc(a) { - a >>>= 0; - return 0 === a ? 32 : 31 - (pc(a) / qc | 0) | 0; - } - var rc = 64; - var sc = 4194304; - function tc(a) { - switch (a & -a) { - case 1: - return 1; - case 2: - return 2; - case 4: - return 4; - case 8: - return 8; - case 16: - return 16; - case 32: - return 32; - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - return a & 4194240; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - return a & 130023424; - case 134217728: - return 134217728; - case 268435456: - return 268435456; - case 536870912: - return 536870912; - case 1073741824: - return 1073741824; - default: - return a; - } - } - function uc(a, b) { - var c = a.pendingLanes; - if (0 === c) return 0; - var d = 0, e = a.suspendedLanes, f = a.pingedLanes, g = c & 268435455; - if (0 !== g) { - var h = g & ~e; - 0 !== h ? d = tc(h) : (f &= g, 0 !== f && (d = tc(f))); - } else g = c & ~e, 0 !== g ? d = tc(g) : 0 !== f && (d = tc(f)); - if (0 === d) return 0; - if (0 !== b && b !== d && 0 === (b & e) && (e = d & -d, f = b & -b, e >= f || 16 === e && 0 !== (f & 4194240))) return b; - 0 !== (d & 4) && (d |= c & 16); - b = a.entangledLanes; - if (0 !== b) for (a = a.entanglements, b &= d; 0 < b; ) c = 31 - oc(b), e = 1 << c, d |= a[c], b &= ~e; - return d; - } - function vc(a, b) { - switch (a) { - case 1: - case 2: - case 4: - return b + 250; - case 8: - case 16: - case 32: - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - return b + 5e3; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - return -1; - case 134217728: - case 268435456: - case 536870912: - case 1073741824: - return -1; - default: - return -1; - } - } - function wc(a, b) { - for (var c = a.suspendedLanes, d = a.pingedLanes, e = a.expirationTimes, f = a.pendingLanes; 0 < f; ) { - var g = 31 - oc(f), h = 1 << g, k = e[g]; - if (-1 === k) { - if (0 === (h & c) || 0 !== (h & d)) e[g] = vc(h, b); - } else k <= b && (a.expiredLanes |= h); - f &= ~h; - } - } - function xc(a) { - a = a.pendingLanes & -1073741825; - return 0 !== a ? a : a & 1073741824 ? 1073741824 : 0; - } - function yc() { - var a = rc; - rc <<= 1; - 0 === (rc & 4194240) && (rc = 64); - return a; - } - function zc(a) { - for (var b = [], c = 0; 31 > c; c++) b.push(a); - return b; - } - function Ac(a, b, c) { - a.pendingLanes |= b; - 536870912 !== b && (a.suspendedLanes = 0, a.pingedLanes = 0); - a = a.eventTimes; - b = 31 - oc(b); - a[b] = c; - } - function Bc(a, b) { - var c = a.pendingLanes & ~b; - a.pendingLanes = b; - a.suspendedLanes = 0; - a.pingedLanes = 0; - a.expiredLanes &= b; - a.mutableReadLanes &= b; - a.entangledLanes &= b; - b = a.entanglements; - var d = a.eventTimes; - for (a = a.expirationTimes; 0 < c; ) { - var e = 31 - oc(c), f = 1 << e; - b[e] = 0; - d[e] = -1; - a[e] = -1; - c &= ~f; - } - } - function Cc(a, b) { - var c = a.entangledLanes |= b; - for (a = a.entanglements; c; ) { - var d = 31 - oc(c), e = 1 << d; - e & b | a[d] & b && (a[d] |= b); - c &= ~e; - } - } - var C = 0; - function Dc(a) { - a &= -a; - return 1 < a ? 4 < a ? 0 !== (a & 268435455) ? 16 : 536870912 : 4 : 1; - } - var Ec; - var Fc; - var Gc; - var Hc; - var Ic; - var Jc = false; - var Kc = []; - var Lc = null; - var Mc = null; - var Nc = null; - var Oc = /* @__PURE__ */ new Map(); - var Pc = /* @__PURE__ */ new Map(); - var Qc = []; - var Rc = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); - function Sc(a, b) { - switch (a) { - case "focusin": - case "focusout": - Lc = null; - break; - case "dragenter": - case "dragleave": - Mc = null; - break; - case "mouseover": - case "mouseout": - Nc = null; - break; - case "pointerover": - case "pointerout": - Oc.delete(b.pointerId); - break; - case "gotpointercapture": - case "lostpointercapture": - Pc.delete(b.pointerId); - } - } - function Tc(a, b, c, d, e, f) { - if (null === a || a.nativeEvent !== f) return a = { blockedOn: b, domEventName: c, eventSystemFlags: d, nativeEvent: f, targetContainers: [e] }, null !== b && (b = Cb(b), null !== b && Fc(b)), a; - a.eventSystemFlags |= d; - b = a.targetContainers; - null !== e && -1 === b.indexOf(e) && b.push(e); - return a; - } - function Uc(a, b, c, d, e) { - switch (b) { - case "focusin": - return Lc = Tc(Lc, a, b, c, d, e), true; - case "dragenter": - return Mc = Tc(Mc, a, b, c, d, e), true; - case "mouseover": - return Nc = Tc(Nc, a, b, c, d, e), true; - case "pointerover": - var f = e.pointerId; - Oc.set(f, Tc(Oc.get(f) || null, a, b, c, d, e)); - return true; - case "gotpointercapture": - return f = e.pointerId, Pc.set(f, Tc(Pc.get(f) || null, a, b, c, d, e)), true; - } - return false; - } - function Vc(a) { - var b = Wc(a.target); - if (null !== b) { - var c = Vb(b); - if (null !== c) { - if (b = c.tag, 13 === b) { - if (b = Wb(c), null !== b) { - a.blockedOn = b; - Ic(a.priority, function() { - Gc(c); - }); - return; - } - } else if (3 === b && c.stateNode.current.memoizedState.isDehydrated) { - a.blockedOn = 3 === c.tag ? c.stateNode.containerInfo : null; - return; - } - } - } - a.blockedOn = null; - } - function Xc(a) { - if (null !== a.blockedOn) return false; - for (var b = a.targetContainers; 0 < b.length; ) { - var c = Yc(a.domEventName, a.eventSystemFlags, b[0], a.nativeEvent); - if (null === c) { - c = a.nativeEvent; - var d = new c.constructor(c.type, c); - wb = d; - c.target.dispatchEvent(d); - wb = null; - } else return b = Cb(c), null !== b && Fc(b), a.blockedOn = c, false; - b.shift(); - } - return true; - } - function Zc(a, b, c) { - Xc(a) && c.delete(b); - } - function $c() { - Jc = false; - null !== Lc && Xc(Lc) && (Lc = null); - null !== Mc && Xc(Mc) && (Mc = null); - null !== Nc && Xc(Nc) && (Nc = null); - Oc.forEach(Zc); - Pc.forEach(Zc); - } - function ad(a, b) { - a.blockedOn === b && (a.blockedOn = null, Jc || (Jc = true, ca.unstable_scheduleCallback(ca.unstable_NormalPriority, $c))); - } - function bd(a) { - function b(b2) { - return ad(b2, a); - } - if (0 < Kc.length) { - ad(Kc[0], a); - for (var c = 1; c < Kc.length; c++) { - var d = Kc[c]; - d.blockedOn === a && (d.blockedOn = null); - } - } - null !== Lc && ad(Lc, a); - null !== Mc && ad(Mc, a); - null !== Nc && ad(Nc, a); - Oc.forEach(b); - Pc.forEach(b); - for (c = 0; c < Qc.length; c++) d = Qc[c], d.blockedOn === a && (d.blockedOn = null); - for (; 0 < Qc.length && (c = Qc[0], null === c.blockedOn); ) Vc(c), null === c.blockedOn && Qc.shift(); - } - var cd = ua.ReactCurrentBatchConfig; - var dd = true; - function ed(a, b, c, d) { - var e = C, f = cd.transition; - cd.transition = null; - try { - C = 1, fd(a, b, c, d); - } finally { - C = e, cd.transition = f; - } - } - function gd(a, b, c, d) { - var e = C, f = cd.transition; - cd.transition = null; - try { - C = 4, fd(a, b, c, d); - } finally { - C = e, cd.transition = f; - } - } - function fd(a, b, c, d) { - if (dd) { - var e = Yc(a, b, c, d); - if (null === e) hd(a, b, d, id, c), Sc(a, d); - else if (Uc(e, a, b, c, d)) d.stopPropagation(); - else if (Sc(a, d), b & 4 && -1 < Rc.indexOf(a)) { - for (; null !== e; ) { - var f = Cb(e); - null !== f && Ec(f); - f = Yc(a, b, c, d); - null === f && hd(a, b, d, id, c); - if (f === e) break; - e = f; - } - null !== e && d.stopPropagation(); - } else hd(a, b, d, null, c); - } - } - var id = null; - function Yc(a, b, c, d) { - id = null; - a = xb(d); - a = Wc(a); - if (null !== a) if (b = Vb(a), null === b) a = null; - else if (c = b.tag, 13 === c) { - a = Wb(b); - if (null !== a) return a; - a = null; - } else if (3 === c) { - if (b.stateNode.current.memoizedState.isDehydrated) return 3 === b.tag ? b.stateNode.containerInfo : null; - a = null; - } else b !== a && (a = null); - id = a; - return null; - } - function jd(a) { - switch (a) { - case "cancel": - case "click": - case "close": - case "contextmenu": - case "copy": - case "cut": - case "auxclick": - case "dblclick": - case "dragend": - case "dragstart": - case "drop": - case "focusin": - case "focusout": - case "input": - case "invalid": - case "keydown": - case "keypress": - case "keyup": - case "mousedown": - case "mouseup": - case "paste": - case "pause": - case "play": - case "pointercancel": - case "pointerdown": - case "pointerup": - case "ratechange": - case "reset": - case "resize": - case "seeked": - case "submit": - case "touchcancel": - case "touchend": - case "touchstart": - case "volumechange": - case "change": - case "selectionchange": - case "textInput": - case "compositionstart": - case "compositionend": - case "compositionupdate": - case "beforeblur": - case "afterblur": - case "beforeinput": - case "blur": - case "fullscreenchange": - case "focus": - case "hashchange": - case "popstate": - case "select": - case "selectstart": - return 1; - case "drag": - case "dragenter": - case "dragexit": - case "dragleave": - case "dragover": - case "mousemove": - case "mouseout": - case "mouseover": - case "pointermove": - case "pointerout": - case "pointerover": - case "scroll": - case "toggle": - case "touchmove": - case "wheel": - case "mouseenter": - case "mouseleave": - case "pointerenter": - case "pointerleave": - return 4; - case "message": - switch (ec()) { - case fc: - return 1; - case gc: - return 4; - case hc: - case ic: - return 16; - case jc: - return 536870912; - default: - return 16; - } - default: - return 16; - } - } - var kd = null; - var ld = null; - var md = null; - function nd() { - if (md) return md; - var a, b = ld, c = b.length, d, e = "value" in kd ? kd.value : kd.textContent, f = e.length; - for (a = 0; a < c && b[a] === e[a]; a++) ; - var g = c - a; - for (d = 1; d <= g && b[c - d] === e[f - d]; d++) ; - return md = e.slice(a, 1 < d ? 1 - d : void 0); - } - function od(a) { - var b = a.keyCode; - "charCode" in a ? (a = a.charCode, 0 === a && 13 === b && (a = 13)) : a = b; - 10 === a && (a = 13); - return 32 <= a || 13 === a ? a : 0; - } - function pd() { - return true; - } - function qd() { - return false; - } - function rd(a) { - function b(b2, d, e, f, g) { - this._reactName = b2; - this._targetInst = e; - this.type = d; - this.nativeEvent = f; - this.target = g; - this.currentTarget = null; - for (var c in a) a.hasOwnProperty(c) && (b2 = a[c], this[c] = b2 ? b2(f) : f[c]); - this.isDefaultPrevented = (null != f.defaultPrevented ? f.defaultPrevented : false === f.returnValue) ? pd : qd; - this.isPropagationStopped = qd; - return this; - } - A(b.prototype, { preventDefault: function() { - this.defaultPrevented = true; - var a2 = this.nativeEvent; - a2 && (a2.preventDefault ? a2.preventDefault() : "unknown" !== typeof a2.returnValue && (a2.returnValue = false), this.isDefaultPrevented = pd); - }, stopPropagation: function() { - var a2 = this.nativeEvent; - a2 && (a2.stopPropagation ? a2.stopPropagation() : "unknown" !== typeof a2.cancelBubble && (a2.cancelBubble = true), this.isPropagationStopped = pd); - }, persist: function() { - }, isPersistent: pd }); - return b; - } - var sd = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(a) { - return a.timeStamp || Date.now(); - }, defaultPrevented: 0, isTrusted: 0 }; - var td = rd(sd); - var ud = A({}, sd, { view: 0, detail: 0 }); - var vd = rd(ud); - var wd; - var xd; - var yd; - var Ad = A({}, ud, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: zd, button: 0, buttons: 0, relatedTarget: function(a) { - return void 0 === a.relatedTarget ? a.fromElement === a.srcElement ? a.toElement : a.fromElement : a.relatedTarget; - }, movementX: function(a) { - if ("movementX" in a) return a.movementX; - a !== yd && (yd && "mousemove" === a.type ? (wd = a.screenX - yd.screenX, xd = a.screenY - yd.screenY) : xd = wd = 0, yd = a); - return wd; - }, movementY: function(a) { - return "movementY" in a ? a.movementY : xd; - } }); - var Bd = rd(Ad); - var Cd = A({}, Ad, { dataTransfer: 0 }); - var Dd = rd(Cd); - var Ed = A({}, ud, { relatedTarget: 0 }); - var Fd = rd(Ed); - var Gd = A({}, sd, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }); - var Hd = rd(Gd); - var Id = A({}, sd, { clipboardData: function(a) { - return "clipboardData" in a ? a.clipboardData : window.clipboardData; - } }); - var Jd = rd(Id); - var Kd = A({}, sd, { data: 0 }); - var Ld = rd(Kd); - var Md = { - Esc: "Escape", - Spacebar: " ", - Left: "ArrowLeft", - Up: "ArrowUp", - Right: "ArrowRight", - Down: "ArrowDown", - Del: "Delete", - Win: "OS", - Menu: "ContextMenu", - Apps: "ContextMenu", - Scroll: "ScrollLock", - MozPrintableKey: "Unidentified" - }; - var Nd = { - 8: "Backspace", - 9: "Tab", - 12: "Clear", - 13: "Enter", - 16: "Shift", - 17: "Control", - 18: "Alt", - 19: "Pause", - 20: "CapsLock", - 27: "Escape", - 32: " ", - 33: "PageUp", - 34: "PageDown", - 35: "End", - 36: "Home", - 37: "ArrowLeft", - 38: "ArrowUp", - 39: "ArrowRight", - 40: "ArrowDown", - 45: "Insert", - 46: "Delete", - 112: "F1", - 113: "F2", - 114: "F3", - 115: "F4", - 116: "F5", - 117: "F6", - 118: "F7", - 119: "F8", - 120: "F9", - 121: "F10", - 122: "F11", - 123: "F12", - 144: "NumLock", - 145: "ScrollLock", - 224: "Meta" - }; - var Od = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; - function Pd(a) { - var b = this.nativeEvent; - return b.getModifierState ? b.getModifierState(a) : (a = Od[a]) ? !!b[a] : false; - } - function zd() { - return Pd; - } - var Qd = A({}, ud, { key: function(a) { - if (a.key) { - var b = Md[a.key] || a.key; - if ("Unidentified" !== b) return b; - } - return "keypress" === a.type ? (a = od(a), 13 === a ? "Enter" : String.fromCharCode(a)) : "keydown" === a.type || "keyup" === a.type ? Nd[a.keyCode] || "Unidentified" : ""; - }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: zd, charCode: function(a) { - return "keypress" === a.type ? od(a) : 0; - }, keyCode: function(a) { - return "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; - }, which: function(a) { - return "keypress" === a.type ? od(a) : "keydown" === a.type || "keyup" === a.type ? a.keyCode : 0; - } }); - var Rd = rd(Qd); - var Sd = A({}, Ad, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }); - var Td = rd(Sd); - var Ud = A({}, ud, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: zd }); - var Vd = rd(Ud); - var Wd = A({}, sd, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }); - var Xd = rd(Wd); - var Yd = A({}, Ad, { - deltaX: function(a) { - return "deltaX" in a ? a.deltaX : "wheelDeltaX" in a ? -a.wheelDeltaX : 0; - }, - deltaY: function(a) { - return "deltaY" in a ? a.deltaY : "wheelDeltaY" in a ? -a.wheelDeltaY : "wheelDelta" in a ? -a.wheelDelta : 0; - }, - deltaZ: 0, - deltaMode: 0 - }); - var Zd = rd(Yd); - var $d = [9, 13, 27, 32]; - var ae = ia && "CompositionEvent" in window; - var be = null; - ia && "documentMode" in document && (be = document.documentMode); - var ce = ia && "TextEvent" in window && !be; - var de = ia && (!ae || be && 8 < be && 11 >= be); - var ee = String.fromCharCode(32); - var fe = false; - function ge(a, b) { - switch (a) { - case "keyup": - return -1 !== $d.indexOf(b.keyCode); - case "keydown": - return 229 !== b.keyCode; - case "keypress": - case "mousedown": - case "focusout": - return true; - default: - return false; - } - } - function he(a) { - a = a.detail; - return "object" === typeof a && "data" in a ? a.data : null; - } - var ie = false; - function je(a, b) { - switch (a) { - case "compositionend": - return he(b); - case "keypress": - if (32 !== b.which) return null; - fe = true; - return ee; - case "textInput": - return a = b.data, a === ee && fe ? null : a; - default: - return null; - } - } - function ke(a, b) { - if (ie) return "compositionend" === a || !ae && ge(a, b) ? (a = nd(), md = ld = kd = null, ie = false, a) : null; - switch (a) { - case "paste": - return null; - case "keypress": - if (!(b.ctrlKey || b.altKey || b.metaKey) || b.ctrlKey && b.altKey) { - if (b.char && 1 < b.char.length) return b.char; - if (b.which) return String.fromCharCode(b.which); - } - return null; - case "compositionend": - return de && "ko" !== b.locale ? null : b.data; - default: - return null; - } - } - var le = { color: true, date: true, datetime: true, "datetime-local": true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; - function me(a) { - var b = a && a.nodeName && a.nodeName.toLowerCase(); - return "input" === b ? !!le[a.type] : "textarea" === b ? true : false; - } - function ne(a, b, c, d) { - Eb(d); - b = oe(b, "onChange"); - 0 < b.length && (c = new td("onChange", "change", null, c, d), a.push({ event: c, listeners: b })); - } - var pe = null; - var qe = null; - function re(a) { - se(a, 0); - } - function te(a) { - var b = ue(a); - if (Wa(b)) return a; - } - function ve(a, b) { - if ("change" === a) return b; - } - var we = false; - if (ia) { - if (ia) { - ye = "oninput" in document; - if (!ye) { - ze = document.createElement("div"); - ze.setAttribute("oninput", "return;"); - ye = "function" === typeof ze.oninput; - } - xe = ye; - } else xe = false; - we = xe && (!document.documentMode || 9 < document.documentMode); - } - var xe; - var ye; - var ze; - function Ae() { - pe && (pe.detachEvent("onpropertychange", Be), qe = pe = null); - } - function Be(a) { - if ("value" === a.propertyName && te(qe)) { - var b = []; - ne(b, qe, a, xb(a)); - Jb(re, b); - } - } - function Ce(a, b, c) { - "focusin" === a ? (Ae(), pe = b, qe = c, pe.attachEvent("onpropertychange", Be)) : "focusout" === a && Ae(); - } - function De(a) { - if ("selectionchange" === a || "keyup" === a || "keydown" === a) return te(qe); - } - function Ee(a, b) { - if ("click" === a) return te(b); - } - function Fe(a, b) { - if ("input" === a || "change" === a) return te(b); - } - function Ge(a, b) { - return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b; - } - var He = "function" === typeof Object.is ? Object.is : Ge; - function Ie(a, b) { - if (He(a, b)) return true; - if ("object" !== typeof a || null === a || "object" !== typeof b || null === b) return false; - var c = Object.keys(a), d = Object.keys(b); - if (c.length !== d.length) return false; - for (d = 0; d < c.length; d++) { - var e = c[d]; - if (!ja.call(b, e) || !He(a[e], b[e])) return false; - } - return true; - } - function Je(a) { - for (; a && a.firstChild; ) a = a.firstChild; - return a; - } - function Ke(a, b) { - var c = Je(a); - a = 0; - for (var d; c; ) { - if (3 === c.nodeType) { - d = a + c.textContent.length; - if (a <= b && d >= b) return { node: c, offset: b - a }; - a = d; - } - a: { - for (; c; ) { - if (c.nextSibling) { - c = c.nextSibling; - break a; - } - c = c.parentNode; - } - c = void 0; - } - c = Je(c); - } - } - function Le(a, b) { - return a && b ? a === b ? true : a && 3 === a.nodeType ? false : b && 3 === b.nodeType ? Le(a, b.parentNode) : "contains" in a ? a.contains(b) : a.compareDocumentPosition ? !!(a.compareDocumentPosition(b) & 16) : false : false; - } - function Me() { - for (var a = window, b = Xa(); b instanceof a.HTMLIFrameElement; ) { - try { - var c = "string" === typeof b.contentWindow.location.href; - } catch (d) { - c = false; - } - if (c) a = b.contentWindow; - else break; - b = Xa(a.document); - } - return b; - } - function Ne(a) { - var b = a && a.nodeName && a.nodeName.toLowerCase(); - return b && ("input" === b && ("text" === a.type || "search" === a.type || "tel" === a.type || "url" === a.type || "password" === a.type) || "textarea" === b || "true" === a.contentEditable); - } - function Oe(a) { - var b = Me(), c = a.focusedElem, d = a.selectionRange; - if (b !== c && c && c.ownerDocument && Le(c.ownerDocument.documentElement, c)) { - if (null !== d && Ne(c)) { - if (b = d.start, a = d.end, void 0 === a && (a = b), "selectionStart" in c) c.selectionStart = b, c.selectionEnd = Math.min(a, c.value.length); - else if (a = (b = c.ownerDocument || document) && b.defaultView || window, a.getSelection) { - a = a.getSelection(); - var e = c.textContent.length, f = Math.min(d.start, e); - d = void 0 === d.end ? f : Math.min(d.end, e); - !a.extend && f > d && (e = d, d = f, f = e); - e = Ke(c, f); - var g = Ke( - c, - d - ); - e && g && (1 !== a.rangeCount || a.anchorNode !== e.node || a.anchorOffset !== e.offset || a.focusNode !== g.node || a.focusOffset !== g.offset) && (b = b.createRange(), b.setStart(e.node, e.offset), a.removeAllRanges(), f > d ? (a.addRange(b), a.extend(g.node, g.offset)) : (b.setEnd(g.node, g.offset), a.addRange(b))); - } - } - b = []; - for (a = c; a = a.parentNode; ) 1 === a.nodeType && b.push({ element: a, left: a.scrollLeft, top: a.scrollTop }); - "function" === typeof c.focus && c.focus(); - for (c = 0; c < b.length; c++) a = b[c], a.element.scrollLeft = a.left, a.element.scrollTop = a.top; - } - } - var Pe = ia && "documentMode" in document && 11 >= document.documentMode; - var Qe = null; - var Re = null; - var Se = null; - var Te = false; - function Ue(a, b, c) { - var d = c.window === c ? c.document : 9 === c.nodeType ? c : c.ownerDocument; - Te || null == Qe || Qe !== Xa(d) || (d = Qe, "selectionStart" in d && Ne(d) ? d = { start: d.selectionStart, end: d.selectionEnd } : (d = (d.ownerDocument && d.ownerDocument.defaultView || window).getSelection(), d = { anchorNode: d.anchorNode, anchorOffset: d.anchorOffset, focusNode: d.focusNode, focusOffset: d.focusOffset }), Se && Ie(Se, d) || (Se = d, d = oe(Re, "onSelect"), 0 < d.length && (b = new td("onSelect", "select", null, b, c), a.push({ event: b, listeners: d }), b.target = Qe))); - } - function Ve(a, b) { - var c = {}; - c[a.toLowerCase()] = b.toLowerCase(); - c["Webkit" + a] = "webkit" + b; - c["Moz" + a] = "moz" + b; - return c; - } - var We = { animationend: Ve("Animation", "AnimationEnd"), animationiteration: Ve("Animation", "AnimationIteration"), animationstart: Ve("Animation", "AnimationStart"), transitionend: Ve("Transition", "TransitionEnd") }; - var Xe = {}; - var Ye = {}; - ia && (Ye = document.createElement("div").style, "AnimationEvent" in window || (delete We.animationend.animation, delete We.animationiteration.animation, delete We.animationstart.animation), "TransitionEvent" in window || delete We.transitionend.transition); - function Ze(a) { - if (Xe[a]) return Xe[a]; - if (!We[a]) return a; - var b = We[a], c; - for (c in b) if (b.hasOwnProperty(c) && c in Ye) return Xe[a] = b[c]; - return a; - } - var $e = Ze("animationend"); - var af = Ze("animationiteration"); - var bf = Ze("animationstart"); - var cf = Ze("transitionend"); - var df = /* @__PURE__ */ new Map(); - var ef = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); - function ff(a, b) { - df.set(a, b); - fa(b, [a]); - } - for (gf = 0; gf < ef.length; gf++) { - hf = ef[gf], jf = hf.toLowerCase(), kf = hf[0].toUpperCase() + hf.slice(1); - ff(jf, "on" + kf); - } - var hf; - var jf; - var kf; - var gf; - ff($e, "onAnimationEnd"); - ff(af, "onAnimationIteration"); - ff(bf, "onAnimationStart"); - ff("dblclick", "onDoubleClick"); - ff("focusin", "onFocus"); - ff("focusout", "onBlur"); - ff(cf, "onTransitionEnd"); - ha("onMouseEnter", ["mouseout", "mouseover"]); - ha("onMouseLeave", ["mouseout", "mouseover"]); - ha("onPointerEnter", ["pointerout", "pointerover"]); - ha("onPointerLeave", ["pointerout", "pointerover"]); - fa("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); - fa("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); - fa("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); - fa("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); - fa("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); - fa("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); - var lf = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "); - var mf = new Set("cancel close invalid load scroll toggle".split(" ").concat(lf)); - function nf(a, b, c) { - var d = a.type || "unknown-event"; - a.currentTarget = c; - Ub(d, b, void 0, a); - a.currentTarget = null; - } - function se(a, b) { - b = 0 !== (b & 4); - for (var c = 0; c < a.length; c++) { - var d = a[c], e = d.event; - d = d.listeners; - a: { - var f = void 0; - if (b) for (var g = d.length - 1; 0 <= g; g--) { - var h = d[g], k = h.instance, l = h.currentTarget; - h = h.listener; - if (k !== f && e.isPropagationStopped()) break a; - nf(e, h, l); - f = k; - } - else for (g = 0; g < d.length; g++) { - h = d[g]; - k = h.instance; - l = h.currentTarget; - h = h.listener; - if (k !== f && e.isPropagationStopped()) break a; - nf(e, h, l); - f = k; - } - } - } - if (Qb) throw a = Rb, Qb = false, Rb = null, a; - } - function D(a, b) { - var c = b[of]; - void 0 === c && (c = b[of] = /* @__PURE__ */ new Set()); - var d = a + "__bubble"; - c.has(d) || (pf(b, a, 2, false), c.add(d)); - } - function qf(a, b, c) { - var d = 0; - b && (d |= 4); - pf(c, a, d, b); - } - var rf = "_reactListening" + Math.random().toString(36).slice(2); - function sf(a) { - if (!a[rf]) { - a[rf] = true; - da.forEach(function(b2) { - "selectionchange" !== b2 && (mf.has(b2) || qf(b2, false, a), qf(b2, true, a)); - }); - var b = 9 === a.nodeType ? a : a.ownerDocument; - null === b || b[rf] || (b[rf] = true, qf("selectionchange", false, b)); - } - } - function pf(a, b, c, d) { - switch (jd(b)) { - case 1: - var e = ed; - break; - case 4: - e = gd; - break; - default: - e = fd; - } - c = e.bind(null, b, c, a); - e = void 0; - !Lb || "touchstart" !== b && "touchmove" !== b && "wheel" !== b || (e = true); - d ? void 0 !== e ? a.addEventListener(b, c, { capture: true, passive: e }) : a.addEventListener(b, c, true) : void 0 !== e ? a.addEventListener(b, c, { passive: e }) : a.addEventListener(b, c, false); - } - function hd(a, b, c, d, e) { - var f = d; - if (0 === (b & 1) && 0 === (b & 2) && null !== d) a: for (; ; ) { - if (null === d) return; - var g = d.tag; - if (3 === g || 4 === g) { - var h = d.stateNode.containerInfo; - if (h === e || 8 === h.nodeType && h.parentNode === e) break; - if (4 === g) for (g = d.return; null !== g; ) { - var k = g.tag; - if (3 === k || 4 === k) { - if (k = g.stateNode.containerInfo, k === e || 8 === k.nodeType && k.parentNode === e) return; - } - g = g.return; - } - for (; null !== h; ) { - g = Wc(h); - if (null === g) return; - k = g.tag; - if (5 === k || 6 === k) { - d = f = g; - continue a; - } - h = h.parentNode; - } - } - d = d.return; - } - Jb(function() { - var d2 = f, e2 = xb(c), g2 = []; - a: { - var h2 = df.get(a); - if (void 0 !== h2) { - var k2 = td, n = a; - switch (a) { - case "keypress": - if (0 === od(c)) break a; - case "keydown": - case "keyup": - k2 = Rd; - break; - case "focusin": - n = "focus"; - k2 = Fd; - break; - case "focusout": - n = "blur"; - k2 = Fd; - break; - case "beforeblur": - case "afterblur": - k2 = Fd; - break; - case "click": - if (2 === c.button) break a; - case "auxclick": - case "dblclick": - case "mousedown": - case "mousemove": - case "mouseup": - case "mouseout": - case "mouseover": - case "contextmenu": - k2 = Bd; - break; - case "drag": - case "dragend": - case "dragenter": - case "dragexit": - case "dragleave": - case "dragover": - case "dragstart": - case "drop": - k2 = Dd; - break; - case "touchcancel": - case "touchend": - case "touchmove": - case "touchstart": - k2 = Vd; - break; - case $e: - case af: - case bf: - k2 = Hd; - break; - case cf: - k2 = Xd; - break; - case "scroll": - k2 = vd; - break; - case "wheel": - k2 = Zd; - break; - case "copy": - case "cut": - case "paste": - k2 = Jd; - break; - case "gotpointercapture": - case "lostpointercapture": - case "pointercancel": - case "pointerdown": - case "pointermove": - case "pointerout": - case "pointerover": - case "pointerup": - k2 = Td; - } - var t = 0 !== (b & 4), J = !t && "scroll" === a, x = t ? null !== h2 ? h2 + "Capture" : null : h2; - t = []; - for (var w = d2, u; null !== w; ) { - u = w; - var F = u.stateNode; - 5 === u.tag && null !== F && (u = F, null !== x && (F = Kb(w, x), null != F && t.push(tf(w, F, u)))); - if (J) break; - w = w.return; - } - 0 < t.length && (h2 = new k2(h2, n, null, c, e2), g2.push({ event: h2, listeners: t })); - } - } - if (0 === (b & 7)) { - a: { - h2 = "mouseover" === a || "pointerover" === a; - k2 = "mouseout" === a || "pointerout" === a; - if (h2 && c !== wb && (n = c.relatedTarget || c.fromElement) && (Wc(n) || n[uf])) break a; - if (k2 || h2) { - h2 = e2.window === e2 ? e2 : (h2 = e2.ownerDocument) ? h2.defaultView || h2.parentWindow : window; - if (k2) { - if (n = c.relatedTarget || c.toElement, k2 = d2, n = n ? Wc(n) : null, null !== n && (J = Vb(n), n !== J || 5 !== n.tag && 6 !== n.tag)) n = null; - } else k2 = null, n = d2; - if (k2 !== n) { - t = Bd; - F = "onMouseLeave"; - x = "onMouseEnter"; - w = "mouse"; - if ("pointerout" === a || "pointerover" === a) t = Td, F = "onPointerLeave", x = "onPointerEnter", w = "pointer"; - J = null == k2 ? h2 : ue(k2); - u = null == n ? h2 : ue(n); - h2 = new t(F, w + "leave", k2, c, e2); - h2.target = J; - h2.relatedTarget = u; - F = null; - Wc(e2) === d2 && (t = new t(x, w + "enter", n, c, e2), t.target = u, t.relatedTarget = J, F = t); - J = F; - if (k2 && n) b: { - t = k2; - x = n; - w = 0; - for (u = t; u; u = vf(u)) w++; - u = 0; - for (F = x; F; F = vf(F)) u++; - for (; 0 < w - u; ) t = vf(t), w--; - for (; 0 < u - w; ) x = vf(x), u--; - for (; w--; ) { - if (t === x || null !== x && t === x.alternate) break b; - t = vf(t); - x = vf(x); - } - t = null; - } - else t = null; - null !== k2 && wf(g2, h2, k2, t, false); - null !== n && null !== J && wf(g2, J, n, t, true); - } - } - } - a: { - h2 = d2 ? ue(d2) : window; - k2 = h2.nodeName && h2.nodeName.toLowerCase(); - if ("select" === k2 || "input" === k2 && "file" === h2.type) var na = ve; - else if (me(h2)) if (we) na = Fe; - else { - na = De; - var xa = Ce; - } - else (k2 = h2.nodeName) && "input" === k2.toLowerCase() && ("checkbox" === h2.type || "radio" === h2.type) && (na = Ee); - if (na && (na = na(a, d2))) { - ne(g2, na, c, e2); - break a; - } - xa && xa(a, h2, d2); - "focusout" === a && (xa = h2._wrapperState) && xa.controlled && "number" === h2.type && cb(h2, "number", h2.value); - } - xa = d2 ? ue(d2) : window; - switch (a) { - case "focusin": - if (me(xa) || "true" === xa.contentEditable) Qe = xa, Re = d2, Se = null; - break; - case "focusout": - Se = Re = Qe = null; - break; - case "mousedown": - Te = true; - break; - case "contextmenu": - case "mouseup": - case "dragend": - Te = false; - Ue(g2, c, e2); - break; - case "selectionchange": - if (Pe) break; - case "keydown": - case "keyup": - Ue(g2, c, e2); - } - var $a; - if (ae) b: { - switch (a) { - case "compositionstart": - var ba = "onCompositionStart"; - break b; - case "compositionend": - ba = "onCompositionEnd"; - break b; - case "compositionupdate": - ba = "onCompositionUpdate"; - break b; - } - ba = void 0; - } - else ie ? ge(a, c) && (ba = "onCompositionEnd") : "keydown" === a && 229 === c.keyCode && (ba = "onCompositionStart"); - ba && (de && "ko" !== c.locale && (ie || "onCompositionStart" !== ba ? "onCompositionEnd" === ba && ie && ($a = nd()) : (kd = e2, ld = "value" in kd ? kd.value : kd.textContent, ie = true)), xa = oe(d2, ba), 0 < xa.length && (ba = new Ld(ba, a, null, c, e2), g2.push({ event: ba, listeners: xa }), $a ? ba.data = $a : ($a = he(c), null !== $a && (ba.data = $a)))); - if ($a = ce ? je(a, c) : ke(a, c)) d2 = oe(d2, "onBeforeInput"), 0 < d2.length && (e2 = new Ld("onBeforeInput", "beforeinput", null, c, e2), g2.push({ event: e2, listeners: d2 }), e2.data = $a); - } - se(g2, b); - }); - } - function tf(a, b, c) { - return { instance: a, listener: b, currentTarget: c }; - } - function oe(a, b) { - for (var c = b + "Capture", d = []; null !== a; ) { - var e = a, f = e.stateNode; - 5 === e.tag && null !== f && (e = f, f = Kb(a, c), null != f && d.unshift(tf(a, f, e)), f = Kb(a, b), null != f && d.push(tf(a, f, e))); - a = a.return; - } - return d; - } - function vf(a) { - if (null === a) return null; - do - a = a.return; - while (a && 5 !== a.tag); - return a ? a : null; - } - function wf(a, b, c, d, e) { - for (var f = b._reactName, g = []; null !== c && c !== d; ) { - var h = c, k = h.alternate, l = h.stateNode; - if (null !== k && k === d) break; - 5 === h.tag && null !== l && (h = l, e ? (k = Kb(c, f), null != k && g.unshift(tf(c, k, h))) : e || (k = Kb(c, f), null != k && g.push(tf(c, k, h)))); - c = c.return; - } - 0 !== g.length && a.push({ event: b, listeners: g }); - } - var xf = /\r\n?/g; - var yf = /\u0000|\uFFFD/g; - function zf(a) { - return ("string" === typeof a ? a : "" + a).replace(xf, "\n").replace(yf, ""); - } - function Af(a, b, c) { - b = zf(b); - if (zf(a) !== b && c) throw Error(p(425)); - } - function Bf() { - } - var Cf = null; - var Df = null; - function Ef(a, b) { - return "textarea" === a || "noscript" === a || "string" === typeof b.children || "number" === typeof b.children || "object" === typeof b.dangerouslySetInnerHTML && null !== b.dangerouslySetInnerHTML && null != b.dangerouslySetInnerHTML.__html; - } - var Ff = "function" === typeof setTimeout ? setTimeout : void 0; - var Gf = "function" === typeof clearTimeout ? clearTimeout : void 0; - var Hf = "function" === typeof Promise ? Promise : void 0; - var Jf = "function" === typeof queueMicrotask ? queueMicrotask : "undefined" !== typeof Hf ? function(a) { - return Hf.resolve(null).then(a).catch(If); - } : Ff; - function If(a) { - setTimeout(function() { - throw a; - }); - } - function Kf(a, b) { - var c = b, d = 0; - do { - var e = c.nextSibling; - a.removeChild(c); - if (e && 8 === e.nodeType) if (c = e.data, "/$" === c) { - if (0 === d) { - a.removeChild(e); - bd(b); - return; - } - d--; - } else "$" !== c && "$?" !== c && "$!" !== c || d++; - c = e; - } while (c); - bd(b); - } - function Lf(a) { - for (; null != a; a = a.nextSibling) { - var b = a.nodeType; - if (1 === b || 3 === b) break; - if (8 === b) { - b = a.data; - if ("$" === b || "$!" === b || "$?" === b) break; - if ("/$" === b) return null; - } - } - return a; - } - function Mf(a) { - a = a.previousSibling; - for (var b = 0; a; ) { - if (8 === a.nodeType) { - var c = a.data; - if ("$" === c || "$!" === c || "$?" === c) { - if (0 === b) return a; - b--; - } else "/$" === c && b++; - } - a = a.previousSibling; - } - return null; - } - var Nf = Math.random().toString(36).slice(2); - var Of = "__reactFiber$" + Nf; - var Pf = "__reactProps$" + Nf; - var uf = "__reactContainer$" + Nf; - var of = "__reactEvents$" + Nf; - var Qf = "__reactListeners$" + Nf; - var Rf = "__reactHandles$" + Nf; - function Wc(a) { - var b = a[Of]; - if (b) return b; - for (var c = a.parentNode; c; ) { - if (b = c[uf] || c[Of]) { - c = b.alternate; - if (null !== b.child || null !== c && null !== c.child) for (a = Mf(a); null !== a; ) { - if (c = a[Of]) return c; - a = Mf(a); - } - return b; - } - a = c; - c = a.parentNode; - } - return null; - } - function Cb(a) { - a = a[Of] || a[uf]; - return !a || 5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag ? null : a; - } - function ue(a) { - if (5 === a.tag || 6 === a.tag) return a.stateNode; - throw Error(p(33)); - } - function Db(a) { - return a[Pf] || null; - } - var Sf = []; - var Tf = -1; - function Uf(a) { - return { current: a }; - } - function E(a) { - 0 > Tf || (a.current = Sf[Tf], Sf[Tf] = null, Tf--); - } - function G(a, b) { - Tf++; - Sf[Tf] = a.current; - a.current = b; - } - var Vf = {}; - var H = Uf(Vf); - var Wf = Uf(false); - var Xf = Vf; - function Yf(a, b) { - var c = a.type.contextTypes; - if (!c) return Vf; - var d = a.stateNode; - if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) return d.__reactInternalMemoizedMaskedChildContext; - var e = {}, f; - for (f in c) e[f] = b[f]; - d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = b, a.__reactInternalMemoizedMaskedChildContext = e); - return e; - } - function Zf(a) { - a = a.childContextTypes; - return null !== a && void 0 !== a; - } - function $f() { - E(Wf); - E(H); - } - function ag(a, b, c) { - if (H.current !== Vf) throw Error(p(168)); - G(H, b); - G(Wf, c); - } - function bg(a, b, c) { - var d = a.stateNode; - b = b.childContextTypes; - if ("function" !== typeof d.getChildContext) return c; - d = d.getChildContext(); - for (var e in d) if (!(e in b)) throw Error(p(108, Ra(a) || "Unknown", e)); - return A({}, c, d); - } - function cg(a) { - a = (a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext || Vf; - Xf = H.current; - G(H, a); - G(Wf, Wf.current); - return true; - } - function dg(a, b, c) { - var d = a.stateNode; - if (!d) throw Error(p(169)); - c ? (a = bg(a, b, Xf), d.__reactInternalMemoizedMergedChildContext = a, E(Wf), E(H), G(H, a)) : E(Wf); - G(Wf, c); - } - var eg = null; - var fg = false; - var gg = false; - function hg(a) { - null === eg ? eg = [a] : eg.push(a); - } - function ig(a) { - fg = true; - hg(a); - } - function jg() { - if (!gg && null !== eg) { - gg = true; - var a = 0, b = C; - try { - var c = eg; - for (C = 1; a < c.length; a++) { - var d = c[a]; - do - d = d(true); - while (null !== d); - } - eg = null; - fg = false; - } catch (e) { - throw null !== eg && (eg = eg.slice(a + 1)), ac(fc, jg), e; - } finally { - C = b, gg = false; - } - } - return null; - } - var kg = []; - var lg = 0; - var mg = null; - var ng = 0; - var og = []; - var pg = 0; - var qg = null; - var rg = 1; - var sg = ""; - function tg(a, b) { - kg[lg++] = ng; - kg[lg++] = mg; - mg = a; - ng = b; - } - function ug(a, b, c) { - og[pg++] = rg; - og[pg++] = sg; - og[pg++] = qg; - qg = a; - var d = rg; - a = sg; - var e = 32 - oc(d) - 1; - d &= ~(1 << e); - c += 1; - var f = 32 - oc(b) + e; - if (30 < f) { - var g = e - e % 5; - f = (d & (1 << g) - 1).toString(32); - d >>= g; - e -= g; - rg = 1 << 32 - oc(b) + e | c << e | d; - sg = f + a; - } else rg = 1 << f | c << e | d, sg = a; - } - function vg(a) { - null !== a.return && (tg(a, 1), ug(a, 1, 0)); - } - function wg(a) { - for (; a === mg; ) mg = kg[--lg], kg[lg] = null, ng = kg[--lg], kg[lg] = null; - for (; a === qg; ) qg = og[--pg], og[pg] = null, sg = og[--pg], og[pg] = null, rg = og[--pg], og[pg] = null; - } - var xg = null; - var yg = null; - var I = false; - var zg = null; - function Ag(a, b) { - var c = Bg(5, null, null, 0); - c.elementType = "DELETED"; - c.stateNode = b; - c.return = a; - b = a.deletions; - null === b ? (a.deletions = [c], a.flags |= 16) : b.push(c); - } - function Cg(a, b) { - switch (a.tag) { - case 5: - var c = a.type; - b = 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() ? null : b; - return null !== b ? (a.stateNode = b, xg = a, yg = Lf(b.firstChild), true) : false; - case 6: - return b = "" === a.pendingProps || 3 !== b.nodeType ? null : b, null !== b ? (a.stateNode = b, xg = a, yg = null, true) : false; - case 13: - return b = 8 !== b.nodeType ? null : b, null !== b ? (c = null !== qg ? { id: rg, overflow: sg } : null, a.memoizedState = { dehydrated: b, treeContext: c, retryLane: 1073741824 }, c = Bg(18, null, null, 0), c.stateNode = b, c.return = a, a.child = c, xg = a, yg = null, true) : false; - default: - return false; - } - } - function Dg(a) { - return 0 !== (a.mode & 1) && 0 === (a.flags & 128); - } - function Eg(a) { - if (I) { - var b = yg; - if (b) { - var c = b; - if (!Cg(a, b)) { - if (Dg(a)) throw Error(p(418)); - b = Lf(c.nextSibling); - var d = xg; - b && Cg(a, b) ? Ag(d, c) : (a.flags = a.flags & -4097 | 2, I = false, xg = a); - } - } else { - if (Dg(a)) throw Error(p(418)); - a.flags = a.flags & -4097 | 2; - I = false; - xg = a; - } - } - } - function Fg(a) { - for (a = a.return; null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; ) a = a.return; - xg = a; - } - function Gg(a) { - if (a !== xg) return false; - if (!I) return Fg(a), I = true, false; - var b; - (b = 3 !== a.tag) && !(b = 5 !== a.tag) && (b = a.type, b = "head" !== b && "body" !== b && !Ef(a.type, a.memoizedProps)); - if (b && (b = yg)) { - if (Dg(a)) throw Hg(), Error(p(418)); - for (; b; ) Ag(a, b), b = Lf(b.nextSibling); - } - Fg(a); - if (13 === a.tag) { - a = a.memoizedState; - a = null !== a ? a.dehydrated : null; - if (!a) throw Error(p(317)); - a: { - a = a.nextSibling; - for (b = 0; a; ) { - if (8 === a.nodeType) { - var c = a.data; - if ("/$" === c) { - if (0 === b) { - yg = Lf(a.nextSibling); - break a; - } - b--; - } else "$" !== c && "$!" !== c && "$?" !== c || b++; - } - a = a.nextSibling; - } - yg = null; - } - } else yg = xg ? Lf(a.stateNode.nextSibling) : null; - return true; - } - function Hg() { - for (var a = yg; a; ) a = Lf(a.nextSibling); - } - function Ig() { - yg = xg = null; - I = false; - } - function Jg(a) { - null === zg ? zg = [a] : zg.push(a); - } - var Kg = ua.ReactCurrentBatchConfig; - function Lg(a, b, c) { - a = c.ref; - if (null !== a && "function" !== typeof a && "object" !== typeof a) { - if (c._owner) { - c = c._owner; - if (c) { - if (1 !== c.tag) throw Error(p(309)); - var d = c.stateNode; - } - if (!d) throw Error(p(147, a)); - var e = d, f = "" + a; - if (null !== b && null !== b.ref && "function" === typeof b.ref && b.ref._stringRef === f) return b.ref; - b = function(a2) { - var b2 = e.refs; - null === a2 ? delete b2[f] : b2[f] = a2; - }; - b._stringRef = f; - return b; - } - if ("string" !== typeof a) throw Error(p(284)); - if (!c._owner) throw Error(p(290, a)); - } - return a; - } - function Mg(a, b) { - a = Object.prototype.toString.call(b); - throw Error(p(31, "[object Object]" === a ? "object with keys {" + Object.keys(b).join(", ") + "}" : a)); - } - function Ng(a) { - var b = a._init; - return b(a._payload); - } - function Og(a) { - function b(b2, c2) { - if (a) { - var d2 = b2.deletions; - null === d2 ? (b2.deletions = [c2], b2.flags |= 16) : d2.push(c2); - } - } - function c(c2, d2) { - if (!a) return null; - for (; null !== d2; ) b(c2, d2), d2 = d2.sibling; - return null; - } - function d(a2, b2) { - for (a2 = /* @__PURE__ */ new Map(); null !== b2; ) null !== b2.key ? a2.set(b2.key, b2) : a2.set(b2.index, b2), b2 = b2.sibling; - return a2; - } - function e(a2, b2) { - a2 = Pg(a2, b2); - a2.index = 0; - a2.sibling = null; - return a2; - } - function f(b2, c2, d2) { - b2.index = d2; - if (!a) return b2.flags |= 1048576, c2; - d2 = b2.alternate; - if (null !== d2) return d2 = d2.index, d2 < c2 ? (b2.flags |= 2, c2) : d2; - b2.flags |= 2; - return c2; - } - function g(b2) { - a && null === b2.alternate && (b2.flags |= 2); - return b2; - } - function h(a2, b2, c2, d2) { - if (null === b2 || 6 !== b2.tag) return b2 = Qg(c2, a2.mode, d2), b2.return = a2, b2; - b2 = e(b2, c2); - b2.return = a2; - return b2; - } - function k(a2, b2, c2, d2) { - var f2 = c2.type; - if (f2 === ya) return m(a2, b2, c2.props.children, d2, c2.key); - if (null !== b2 && (b2.elementType === f2 || "object" === typeof f2 && null !== f2 && f2.$$typeof === Ha && Ng(f2) === b2.type)) return d2 = e(b2, c2.props), d2.ref = Lg(a2, b2, c2), d2.return = a2, d2; - d2 = Rg(c2.type, c2.key, c2.props, null, a2.mode, d2); - d2.ref = Lg(a2, b2, c2); - d2.return = a2; - return d2; - } - function l(a2, b2, c2, d2) { - if (null === b2 || 4 !== b2.tag || b2.stateNode.containerInfo !== c2.containerInfo || b2.stateNode.implementation !== c2.implementation) return b2 = Sg(c2, a2.mode, d2), b2.return = a2, b2; - b2 = e(b2, c2.children || []); - b2.return = a2; - return b2; - } - function m(a2, b2, c2, d2, f2) { - if (null === b2 || 7 !== b2.tag) return b2 = Tg(c2, a2.mode, d2, f2), b2.return = a2, b2; - b2 = e(b2, c2); - b2.return = a2; - return b2; - } - function q(a2, b2, c2) { - if ("string" === typeof b2 && "" !== b2 || "number" === typeof b2) return b2 = Qg("" + b2, a2.mode, c2), b2.return = a2, b2; - if ("object" === typeof b2 && null !== b2) { - switch (b2.$$typeof) { - case va: - return c2 = Rg(b2.type, b2.key, b2.props, null, a2.mode, c2), c2.ref = Lg(a2, null, b2), c2.return = a2, c2; - case wa: - return b2 = Sg(b2, a2.mode, c2), b2.return = a2, b2; - case Ha: - var d2 = b2._init; - return q(a2, d2(b2._payload), c2); - } - if (eb(b2) || Ka(b2)) return b2 = Tg(b2, a2.mode, c2, null), b2.return = a2, b2; - Mg(a2, b2); - } - return null; - } - function r(a2, b2, c2, d2) { - var e2 = null !== b2 ? b2.key : null; - if ("string" === typeof c2 && "" !== c2 || "number" === typeof c2) return null !== e2 ? null : h(a2, b2, "" + c2, d2); - if ("object" === typeof c2 && null !== c2) { - switch (c2.$$typeof) { - case va: - return c2.key === e2 ? k(a2, b2, c2, d2) : null; - case wa: - return c2.key === e2 ? l(a2, b2, c2, d2) : null; - case Ha: - return e2 = c2._init, r( - a2, - b2, - e2(c2._payload), - d2 - ); - } - if (eb(c2) || Ka(c2)) return null !== e2 ? null : m(a2, b2, c2, d2, null); - Mg(a2, c2); - } - return null; - } - function y(a2, b2, c2, d2, e2) { - if ("string" === typeof d2 && "" !== d2 || "number" === typeof d2) return a2 = a2.get(c2) || null, h(b2, a2, "" + d2, e2); - if ("object" === typeof d2 && null !== d2) { - switch (d2.$$typeof) { - case va: - return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, k(b2, a2, d2, e2); - case wa: - return a2 = a2.get(null === d2.key ? c2 : d2.key) || null, l(b2, a2, d2, e2); - case Ha: - var f2 = d2._init; - return y(a2, b2, c2, f2(d2._payload), e2); - } - if (eb(d2) || Ka(d2)) return a2 = a2.get(c2) || null, m(b2, a2, d2, e2, null); - Mg(b2, d2); - } - return null; - } - function n(e2, g2, h2, k2) { - for (var l2 = null, m2 = null, u = g2, w = g2 = 0, x = null; null !== u && w < h2.length; w++) { - u.index > w ? (x = u, u = null) : x = u.sibling; - var n2 = r(e2, u, h2[w], k2); - if (null === n2) { - null === u && (u = x); - break; - } - a && u && null === n2.alternate && b(e2, u); - g2 = f(n2, g2, w); - null === m2 ? l2 = n2 : m2.sibling = n2; - m2 = n2; - u = x; - } - if (w === h2.length) return c(e2, u), I && tg(e2, w), l2; - if (null === u) { - for (; w < h2.length; w++) u = q(e2, h2[w], k2), null !== u && (g2 = f(u, g2, w), null === m2 ? l2 = u : m2.sibling = u, m2 = u); - I && tg(e2, w); - return l2; - } - for (u = d(e2, u); w < h2.length; w++) x = y(u, e2, w, h2[w], k2), null !== x && (a && null !== x.alternate && u.delete(null === x.key ? w : x.key), g2 = f(x, g2, w), null === m2 ? l2 = x : m2.sibling = x, m2 = x); - a && u.forEach(function(a2) { - return b(e2, a2); - }); - I && tg(e2, w); - return l2; - } - function t(e2, g2, h2, k2) { - var l2 = Ka(h2); - if ("function" !== typeof l2) throw Error(p(150)); - h2 = l2.call(h2); - if (null == h2) throw Error(p(151)); - for (var u = l2 = null, m2 = g2, w = g2 = 0, x = null, n2 = h2.next(); null !== m2 && !n2.done; w++, n2 = h2.next()) { - m2.index > w ? (x = m2, m2 = null) : x = m2.sibling; - var t2 = r(e2, m2, n2.value, k2); - if (null === t2) { - null === m2 && (m2 = x); - break; - } - a && m2 && null === t2.alternate && b(e2, m2); - g2 = f(t2, g2, w); - null === u ? l2 = t2 : u.sibling = t2; - u = t2; - m2 = x; - } - if (n2.done) return c( - e2, - m2 - ), I && tg(e2, w), l2; - if (null === m2) { - for (; !n2.done; w++, n2 = h2.next()) n2 = q(e2, n2.value, k2), null !== n2 && (g2 = f(n2, g2, w), null === u ? l2 = n2 : u.sibling = n2, u = n2); - I && tg(e2, w); - return l2; - } - for (m2 = d(e2, m2); !n2.done; w++, n2 = h2.next()) n2 = y(m2, e2, w, n2.value, k2), null !== n2 && (a && null !== n2.alternate && m2.delete(null === n2.key ? w : n2.key), g2 = f(n2, g2, w), null === u ? l2 = n2 : u.sibling = n2, u = n2); - a && m2.forEach(function(a2) { - return b(e2, a2); - }); - I && tg(e2, w); - return l2; - } - function J(a2, d2, f2, h2) { - "object" === typeof f2 && null !== f2 && f2.type === ya && null === f2.key && (f2 = f2.props.children); - if ("object" === typeof f2 && null !== f2) { - switch (f2.$$typeof) { - case va: - a: { - for (var k2 = f2.key, l2 = d2; null !== l2; ) { - if (l2.key === k2) { - k2 = f2.type; - if (k2 === ya) { - if (7 === l2.tag) { - c(a2, l2.sibling); - d2 = e(l2, f2.props.children); - d2.return = a2; - a2 = d2; - break a; - } - } else if (l2.elementType === k2 || "object" === typeof k2 && null !== k2 && k2.$$typeof === Ha && Ng(k2) === l2.type) { - c(a2, l2.sibling); - d2 = e(l2, f2.props); - d2.ref = Lg(a2, l2, f2); - d2.return = a2; - a2 = d2; - break a; - } - c(a2, l2); - break; - } else b(a2, l2); - l2 = l2.sibling; - } - f2.type === ya ? (d2 = Tg(f2.props.children, a2.mode, h2, f2.key), d2.return = a2, a2 = d2) : (h2 = Rg(f2.type, f2.key, f2.props, null, a2.mode, h2), h2.ref = Lg(a2, d2, f2), h2.return = a2, a2 = h2); - } - return g(a2); - case wa: - a: { - for (l2 = f2.key; null !== d2; ) { - if (d2.key === l2) if (4 === d2.tag && d2.stateNode.containerInfo === f2.containerInfo && d2.stateNode.implementation === f2.implementation) { - c(a2, d2.sibling); - d2 = e(d2, f2.children || []); - d2.return = a2; - a2 = d2; - break a; - } else { - c(a2, d2); - break; - } - else b(a2, d2); - d2 = d2.sibling; - } - d2 = Sg(f2, a2.mode, h2); - d2.return = a2; - a2 = d2; - } - return g(a2); - case Ha: - return l2 = f2._init, J(a2, d2, l2(f2._payload), h2); - } - if (eb(f2)) return n(a2, d2, f2, h2); - if (Ka(f2)) return t(a2, d2, f2, h2); - Mg(a2, f2); - } - return "string" === typeof f2 && "" !== f2 || "number" === typeof f2 ? (f2 = "" + f2, null !== d2 && 6 === d2.tag ? (c(a2, d2.sibling), d2 = e(d2, f2), d2.return = a2, a2 = d2) : (c(a2, d2), d2 = Qg(f2, a2.mode, h2), d2.return = a2, a2 = d2), g(a2)) : c(a2, d2); - } - return J; - } - var Ug = Og(true); - var Vg = Og(false); - var Wg = Uf(null); - var Xg = null; - var Yg = null; - var Zg = null; - function $g() { - Zg = Yg = Xg = null; - } - function ah(a) { - var b = Wg.current; - E(Wg); - a._currentValue = b; - } - function bh(a, b, c) { - for (; null !== a; ) { - var d = a.alternate; - (a.childLanes & b) !== b ? (a.childLanes |= b, null !== d && (d.childLanes |= b)) : null !== d && (d.childLanes & b) !== b && (d.childLanes |= b); - if (a === c) break; - a = a.return; - } - } - function ch(a, b) { - Xg = a; - Zg = Yg = null; - a = a.dependencies; - null !== a && null !== a.firstContext && (0 !== (a.lanes & b) && (dh = true), a.firstContext = null); - } - function eh(a) { - var b = a._currentValue; - if (Zg !== a) if (a = { context: a, memoizedValue: b, next: null }, null === Yg) { - if (null === Xg) throw Error(p(308)); - Yg = a; - Xg.dependencies = { lanes: 0, firstContext: a }; - } else Yg = Yg.next = a; - return b; - } - var fh = null; - function gh(a) { - null === fh ? fh = [a] : fh.push(a); - } - function hh(a, b, c, d) { - var e = b.interleaved; - null === e ? (c.next = c, gh(b)) : (c.next = e.next, e.next = c); - b.interleaved = c; - return ih(a, d); - } - function ih(a, b) { - a.lanes |= b; - var c = a.alternate; - null !== c && (c.lanes |= b); - c = a; - for (a = a.return; null !== a; ) a.childLanes |= b, c = a.alternate, null !== c && (c.childLanes |= b), c = a, a = a.return; - return 3 === c.tag ? c.stateNode : null; - } - var jh = false; - function kh(a) { - a.updateQueue = { baseState: a.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; - } - function lh(a, b) { - a = a.updateQueue; - b.updateQueue === a && (b.updateQueue = { baseState: a.baseState, firstBaseUpdate: a.firstBaseUpdate, lastBaseUpdate: a.lastBaseUpdate, shared: a.shared, effects: a.effects }); - } - function mh(a, b) { - return { eventTime: a, lane: b, tag: 0, payload: null, callback: null, next: null }; - } - function nh(a, b, c) { - var d = a.updateQueue; - if (null === d) return null; - d = d.shared; - if (0 !== (K & 2)) { - var e = d.pending; - null === e ? b.next = b : (b.next = e.next, e.next = b); - d.pending = b; - return ih(a, c); - } - e = d.interleaved; - null === e ? (b.next = b, gh(d)) : (b.next = e.next, e.next = b); - d.interleaved = b; - return ih(a, c); - } - function oh(a, b, c) { - b = b.updateQueue; - if (null !== b && (b = b.shared, 0 !== (c & 4194240))) { - var d = b.lanes; - d &= a.pendingLanes; - c |= d; - b.lanes = c; - Cc(a, c); - } - } - function ph(a, b) { - var c = a.updateQueue, d = a.alternate; - if (null !== d && (d = d.updateQueue, c === d)) { - var e = null, f = null; - c = c.firstBaseUpdate; - if (null !== c) { - do { - var g = { eventTime: c.eventTime, lane: c.lane, tag: c.tag, payload: c.payload, callback: c.callback, next: null }; - null === f ? e = f = g : f = f.next = g; - c = c.next; - } while (null !== c); - null === f ? e = f = b : f = f.next = b; - } else e = f = b; - c = { baseState: d.baseState, firstBaseUpdate: e, lastBaseUpdate: f, shared: d.shared, effects: d.effects }; - a.updateQueue = c; - return; - } - a = c.lastBaseUpdate; - null === a ? c.firstBaseUpdate = b : a.next = b; - c.lastBaseUpdate = b; - } - function qh(a, b, c, d) { - var e = a.updateQueue; - jh = false; - var f = e.firstBaseUpdate, g = e.lastBaseUpdate, h = e.shared.pending; - if (null !== h) { - e.shared.pending = null; - var k = h, l = k.next; - k.next = null; - null === g ? f = l : g.next = l; - g = k; - var m = a.alternate; - null !== m && (m = m.updateQueue, h = m.lastBaseUpdate, h !== g && (null === h ? m.firstBaseUpdate = l : h.next = l, m.lastBaseUpdate = k)); - } - if (null !== f) { - var q = e.baseState; - g = 0; - m = l = k = null; - h = f; - do { - var r = h.lane, y = h.eventTime; - if ((d & r) === r) { - null !== m && (m = m.next = { - eventTime: y, - lane: 0, - tag: h.tag, - payload: h.payload, - callback: h.callback, - next: null - }); - a: { - var n = a, t = h; - r = b; - y = c; - switch (t.tag) { - case 1: - n = t.payload; - if ("function" === typeof n) { - q = n.call(y, q, r); - break a; - } - q = n; - break a; - case 3: - n.flags = n.flags & -65537 | 128; - case 0: - n = t.payload; - r = "function" === typeof n ? n.call(y, q, r) : n; - if (null === r || void 0 === r) break a; - q = A({}, q, r); - break a; - case 2: - jh = true; - } - } - null !== h.callback && 0 !== h.lane && (a.flags |= 64, r = e.effects, null === r ? e.effects = [h] : r.push(h)); - } else y = { eventTime: y, lane: r, tag: h.tag, payload: h.payload, callback: h.callback, next: null }, null === m ? (l = m = y, k = q) : m = m.next = y, g |= r; - h = h.next; - if (null === h) if (h = e.shared.pending, null === h) break; - else r = h, h = r.next, r.next = null, e.lastBaseUpdate = r, e.shared.pending = null; - } while (1); - null === m && (k = q); - e.baseState = k; - e.firstBaseUpdate = l; - e.lastBaseUpdate = m; - b = e.shared.interleaved; - if (null !== b) { - e = b; - do - g |= e.lane, e = e.next; - while (e !== b); - } else null === f && (e.shared.lanes = 0); - rh |= g; - a.lanes = g; - a.memoizedState = q; - } - } - function sh(a, b, c) { - a = b.effects; - b.effects = null; - if (null !== a) for (b = 0; b < a.length; b++) { - var d = a[b], e = d.callback; - if (null !== e) { - d.callback = null; - d = c; - if ("function" !== typeof e) throw Error(p(191, e)); - e.call(d); - } - } - } - var th = {}; - var uh = Uf(th); - var vh = Uf(th); - var wh = Uf(th); - function xh(a) { - if (a === th) throw Error(p(174)); - return a; - } - function yh(a, b) { - G(wh, b); - G(vh, a); - G(uh, th); - a = b.nodeType; - switch (a) { - case 9: - case 11: - b = (b = b.documentElement) ? b.namespaceURI : lb(null, ""); - break; - default: - a = 8 === a ? b.parentNode : b, b = a.namespaceURI || null, a = a.tagName, b = lb(b, a); - } - E(uh); - G(uh, b); - } - function zh() { - E(uh); - E(vh); - E(wh); - } - function Ah(a) { - xh(wh.current); - var b = xh(uh.current); - var c = lb(b, a.type); - b !== c && (G(vh, a), G(uh, c)); - } - function Bh(a) { - vh.current === a && (E(uh), E(vh)); - } - var L = Uf(0); - function Ch(a) { - for (var b = a; null !== b; ) { - if (13 === b.tag) { - var c = b.memoizedState; - if (null !== c && (c = c.dehydrated, null === c || "$?" === c.data || "$!" === c.data)) return b; - } else if (19 === b.tag && void 0 !== b.memoizedProps.revealOrder) { - if (0 !== (b.flags & 128)) return b; - } else if (null !== b.child) { - b.child.return = b; - b = b.child; - continue; - } - if (b === a) break; - for (; null === b.sibling; ) { - if (null === b.return || b.return === a) return null; - b = b.return; - } - b.sibling.return = b.return; - b = b.sibling; - } - return null; - } - var Dh = []; - function Eh() { - for (var a = 0; a < Dh.length; a++) Dh[a]._workInProgressVersionPrimary = null; - Dh.length = 0; - } - var Fh = ua.ReactCurrentDispatcher; - var Gh = ua.ReactCurrentBatchConfig; - var Hh = 0; - var M = null; - var N = null; - var O = null; - var Ih = false; - var Jh = false; - var Kh = 0; - var Lh = 0; - function P() { - throw Error(p(321)); - } - function Mh(a, b) { - if (null === b) return false; - for (var c = 0; c < b.length && c < a.length; c++) if (!He(a[c], b[c])) return false; - return true; - } - function Nh(a, b, c, d, e, f) { - Hh = f; - M = b; - b.memoizedState = null; - b.updateQueue = null; - b.lanes = 0; - Fh.current = null === a || null === a.memoizedState ? Oh : Ph; - a = c(d, e); - if (Jh) { - f = 0; - do { - Jh = false; - Kh = 0; - if (25 <= f) throw Error(p(301)); - f += 1; - O = N = null; - b.updateQueue = null; - Fh.current = Qh; - a = c(d, e); - } while (Jh); - } - Fh.current = Rh; - b = null !== N && null !== N.next; - Hh = 0; - O = N = M = null; - Ih = false; - if (b) throw Error(p(300)); - return a; - } - function Sh() { - var a = 0 !== Kh; - Kh = 0; - return a; - } - function Th() { - var a = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; - null === O ? M.memoizedState = O = a : O = O.next = a; - return O; - } - function Uh() { - if (null === N) { - var a = M.alternate; - a = null !== a ? a.memoizedState : null; - } else a = N.next; - var b = null === O ? M.memoizedState : O.next; - if (null !== b) O = b, N = a; - else { - if (null === a) throw Error(p(310)); - N = a; - a = { memoizedState: N.memoizedState, baseState: N.baseState, baseQueue: N.baseQueue, queue: N.queue, next: null }; - null === O ? M.memoizedState = O = a : O = O.next = a; - } - return O; - } - function Vh(a, b) { - return "function" === typeof b ? b(a) : b; - } - function Wh(a) { - var b = Uh(), c = b.queue; - if (null === c) throw Error(p(311)); - c.lastRenderedReducer = a; - var d = N, e = d.baseQueue, f = c.pending; - if (null !== f) { - if (null !== e) { - var g = e.next; - e.next = f.next; - f.next = g; - } - d.baseQueue = e = f; - c.pending = null; - } - if (null !== e) { - f = e.next; - d = d.baseState; - var h = g = null, k = null, l = f; - do { - var m = l.lane; - if ((Hh & m) === m) null !== k && (k = k.next = { lane: 0, action: l.action, hasEagerState: l.hasEagerState, eagerState: l.eagerState, next: null }), d = l.hasEagerState ? l.eagerState : a(d, l.action); - else { - var q = { - lane: m, - action: l.action, - hasEagerState: l.hasEagerState, - eagerState: l.eagerState, - next: null - }; - null === k ? (h = k = q, g = d) : k = k.next = q; - M.lanes |= m; - rh |= m; - } - l = l.next; - } while (null !== l && l !== f); - null === k ? g = d : k.next = h; - He(d, b.memoizedState) || (dh = true); - b.memoizedState = d; - b.baseState = g; - b.baseQueue = k; - c.lastRenderedState = d; - } - a = c.interleaved; - if (null !== a) { - e = a; - do - f = e.lane, M.lanes |= f, rh |= f, e = e.next; - while (e !== a); - } else null === e && (c.lanes = 0); - return [b.memoizedState, c.dispatch]; - } - function Xh(a) { - var b = Uh(), c = b.queue; - if (null === c) throw Error(p(311)); - c.lastRenderedReducer = a; - var d = c.dispatch, e = c.pending, f = b.memoizedState; - if (null !== e) { - c.pending = null; - var g = e = e.next; - do - f = a(f, g.action), g = g.next; - while (g !== e); - He(f, b.memoizedState) || (dh = true); - b.memoizedState = f; - null === b.baseQueue && (b.baseState = f); - c.lastRenderedState = f; - } - return [f, d]; - } - function Yh() { - } - function Zh(a, b) { - var c = M, d = Uh(), e = b(), f = !He(d.memoizedState, e); - f && (d.memoizedState = e, dh = true); - d = d.queue; - $h(ai.bind(null, c, d, a), [a]); - if (d.getSnapshot !== b || f || null !== O && O.memoizedState.tag & 1) { - c.flags |= 2048; - bi(9, ci.bind(null, c, d, e, b), void 0, null); - if (null === Q) throw Error(p(349)); - 0 !== (Hh & 30) || di(c, b, e); - } - return e; - } - function di(a, b, c) { - a.flags |= 16384; - a = { getSnapshot: b, value: c }; - b = M.updateQueue; - null === b ? (b = { lastEffect: null, stores: null }, M.updateQueue = b, b.stores = [a]) : (c = b.stores, null === c ? b.stores = [a] : c.push(a)); - } - function ci(a, b, c, d) { - b.value = c; - b.getSnapshot = d; - ei(b) && fi(a); - } - function ai(a, b, c) { - return c(function() { - ei(b) && fi(a); - }); - } - function ei(a) { - var b = a.getSnapshot; - a = a.value; - try { - var c = b(); - return !He(a, c); - } catch (d) { - return true; - } - } - function fi(a) { - var b = ih(a, 1); - null !== b && gi(b, a, 1, -1); - } - function hi(a) { - var b = Th(); - "function" === typeof a && (a = a()); - b.memoizedState = b.baseState = a; - a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: Vh, lastRenderedState: a }; - b.queue = a; - a = a.dispatch = ii.bind(null, M, a); - return [b.memoizedState, a]; - } - function bi(a, b, c, d) { - a = { tag: a, create: b, destroy: c, deps: d, next: null }; - b = M.updateQueue; - null === b ? (b = { lastEffect: null, stores: null }, M.updateQueue = b, b.lastEffect = a.next = a) : (c = b.lastEffect, null === c ? b.lastEffect = a.next = a : (d = c.next, c.next = a, a.next = d, b.lastEffect = a)); - return a; - } - function ji() { - return Uh().memoizedState; - } - function ki(a, b, c, d) { - var e = Th(); - M.flags |= a; - e.memoizedState = bi(1 | b, c, void 0, void 0 === d ? null : d); - } - function li(a, b, c, d) { - var e = Uh(); - d = void 0 === d ? null : d; - var f = void 0; - if (null !== N) { - var g = N.memoizedState; - f = g.destroy; - if (null !== d && Mh(d, g.deps)) { - e.memoizedState = bi(b, c, f, d); - return; - } - } - M.flags |= a; - e.memoizedState = bi(1 | b, c, f, d); - } - function mi(a, b) { - return ki(8390656, 8, a, b); - } - function $h(a, b) { - return li(2048, 8, a, b); - } - function ni(a, b) { - return li(4, 2, a, b); - } - function oi(a, b) { - return li(4, 4, a, b); - } - function pi(a, b) { - if ("function" === typeof b) return a = a(), b(a), function() { - b(null); - }; - if (null !== b && void 0 !== b) return a = a(), b.current = a, function() { - b.current = null; - }; - } - function qi(a, b, c) { - c = null !== c && void 0 !== c ? c.concat([a]) : null; - return li(4, 4, pi.bind(null, b, a), c); - } - function ri() { - } - function si(a, b) { - var c = Uh(); - b = void 0 === b ? null : b; - var d = c.memoizedState; - if (null !== d && null !== b && Mh(b, d[1])) return d[0]; - c.memoizedState = [a, b]; - return a; - } - function ti(a, b) { - var c = Uh(); - b = void 0 === b ? null : b; - var d = c.memoizedState; - if (null !== d && null !== b && Mh(b, d[1])) return d[0]; - a = a(); - c.memoizedState = [a, b]; - return a; - } - function ui(a, b, c) { - if (0 === (Hh & 21)) return a.baseState && (a.baseState = false, dh = true), a.memoizedState = c; - He(c, b) || (c = yc(), M.lanes |= c, rh |= c, a.baseState = true); - return b; - } - function vi(a, b) { - var c = C; - C = 0 !== c && 4 > c ? c : 4; - a(true); - var d = Gh.transition; - Gh.transition = {}; - try { - a(false), b(); - } finally { - C = c, Gh.transition = d; - } - } - function wi() { - return Uh().memoizedState; - } - function xi(a, b, c) { - var d = yi(a); - c = { lane: d, action: c, hasEagerState: false, eagerState: null, next: null }; - if (zi(a)) Ai(b, c); - else if (c = hh(a, b, c, d), null !== c) { - var e = R2(); - gi(c, a, d, e); - Bi(c, b, d); - } - } - function ii(a, b, c) { - var d = yi(a), e = { lane: d, action: c, hasEagerState: false, eagerState: null, next: null }; - if (zi(a)) Ai(b, e); - else { - var f = a.alternate; - if (0 === a.lanes && (null === f || 0 === f.lanes) && (f = b.lastRenderedReducer, null !== f)) try { - var g = b.lastRenderedState, h = f(g, c); - e.hasEagerState = true; - e.eagerState = h; - if (He(h, g)) { - var k = b.interleaved; - null === k ? (e.next = e, gh(b)) : (e.next = k.next, k.next = e); - b.interleaved = e; - return; - } - } catch (l) { - } finally { - } - c = hh(a, b, e, d); - null !== c && (e = R2(), gi(c, a, d, e), Bi(c, b, d)); - } - } - function zi(a) { - var b = a.alternate; - return a === M || null !== b && b === M; - } - function Ai(a, b) { - Jh = Ih = true; - var c = a.pending; - null === c ? b.next = b : (b.next = c.next, c.next = b); - a.pending = b; - } - function Bi(a, b, c) { - if (0 !== (c & 4194240)) { - var d = b.lanes; - d &= a.pendingLanes; - c |= d; - b.lanes = c; - Cc(a, c); - } - } - var Rh = { readContext: eh, useCallback: P, useContext: P, useEffect: P, useImperativeHandle: P, useInsertionEffect: P, useLayoutEffect: P, useMemo: P, useReducer: P, useRef: P, useState: P, useDebugValue: P, useDeferredValue: P, useTransition: P, useMutableSource: P, useSyncExternalStore: P, useId: P, unstable_isNewReconciler: false }; - var Oh = { readContext: eh, useCallback: function(a, b) { - Th().memoizedState = [a, void 0 === b ? null : b]; - return a; - }, useContext: eh, useEffect: mi, useImperativeHandle: function(a, b, c) { - c = null !== c && void 0 !== c ? c.concat([a]) : null; - return ki( - 4194308, - 4, - pi.bind(null, b, a), - c - ); - }, useLayoutEffect: function(a, b) { - return ki(4194308, 4, a, b); - }, useInsertionEffect: function(a, b) { - return ki(4, 2, a, b); - }, useMemo: function(a, b) { - var c = Th(); - b = void 0 === b ? null : b; - a = a(); - c.memoizedState = [a, b]; - return a; - }, useReducer: function(a, b, c) { - var d = Th(); - b = void 0 !== c ? c(b) : b; - d.memoizedState = d.baseState = b; - a = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: a, lastRenderedState: b }; - d.queue = a; - a = a.dispatch = xi.bind(null, M, a); - return [d.memoizedState, a]; - }, useRef: function(a) { - var b = Th(); - a = { current: a }; - return b.memoizedState = a; - }, useState: hi, useDebugValue: ri, useDeferredValue: function(a) { - return Th().memoizedState = a; - }, useTransition: function() { - var a = hi(false), b = a[0]; - a = vi.bind(null, a[1]); - Th().memoizedState = a; - return [b, a]; - }, useMutableSource: function() { - }, useSyncExternalStore: function(a, b, c) { - var d = M, e = Th(); - if (I) { - if (void 0 === c) throw Error(p(407)); - c = c(); - } else { - c = b(); - if (null === Q) throw Error(p(349)); - 0 !== (Hh & 30) || di(d, b, c); - } - e.memoizedState = c; - var f = { value: c, getSnapshot: b }; - e.queue = f; - mi(ai.bind( - null, - d, - f, - a - ), [a]); - d.flags |= 2048; - bi(9, ci.bind(null, d, f, c, b), void 0, null); - return c; - }, useId: function() { - var a = Th(), b = Q.identifierPrefix; - if (I) { - var c = sg; - var d = rg; - c = (d & ~(1 << 32 - oc(d) - 1)).toString(32) + c; - b = ":" + b + "R" + c; - c = Kh++; - 0 < c && (b += "H" + c.toString(32)); - b += ":"; - } else c = Lh++, b = ":" + b + "r" + c.toString(32) + ":"; - return a.memoizedState = b; - }, unstable_isNewReconciler: false }; - var Ph = { - readContext: eh, - useCallback: si, - useContext: eh, - useEffect: $h, - useImperativeHandle: qi, - useInsertionEffect: ni, - useLayoutEffect: oi, - useMemo: ti, - useReducer: Wh, - useRef: ji, - useState: function() { - return Wh(Vh); - }, - useDebugValue: ri, - useDeferredValue: function(a) { - var b = Uh(); - return ui(b, N.memoizedState, a); - }, - useTransition: function() { - var a = Wh(Vh)[0], b = Uh().memoizedState; - return [a, b]; - }, - useMutableSource: Yh, - useSyncExternalStore: Zh, - useId: wi, - unstable_isNewReconciler: false - }; - var Qh = { readContext: eh, useCallback: si, useContext: eh, useEffect: $h, useImperativeHandle: qi, useInsertionEffect: ni, useLayoutEffect: oi, useMemo: ti, useReducer: Xh, useRef: ji, useState: function() { - return Xh(Vh); - }, useDebugValue: ri, useDeferredValue: function(a) { - var b = Uh(); - return null === N ? b.memoizedState = a : ui(b, N.memoizedState, a); - }, useTransition: function() { - var a = Xh(Vh)[0], b = Uh().memoizedState; - return [a, b]; - }, useMutableSource: Yh, useSyncExternalStore: Zh, useId: wi, unstable_isNewReconciler: false }; - function Ci(a, b) { - if (a && a.defaultProps) { - b = A({}, b); - a = a.defaultProps; - for (var c in a) void 0 === b[c] && (b[c] = a[c]); - return b; - } - return b; - } - function Di(a, b, c, d) { - b = a.memoizedState; - c = c(d, b); - c = null === c || void 0 === c ? b : A({}, b, c); - a.memoizedState = c; - 0 === a.lanes && (a.updateQueue.baseState = c); - } - var Ei = { isMounted: function(a) { - return (a = a._reactInternals) ? Vb(a) === a : false; - }, enqueueSetState: function(a, b, c) { - a = a._reactInternals; - var d = R2(), e = yi(a), f = mh(d, e); - f.payload = b; - void 0 !== c && null !== c && (f.callback = c); - b = nh(a, f, e); - null !== b && (gi(b, a, e, d), oh(b, a, e)); - }, enqueueReplaceState: function(a, b, c) { - a = a._reactInternals; - var d = R2(), e = yi(a), f = mh(d, e); - f.tag = 1; - f.payload = b; - void 0 !== c && null !== c && (f.callback = c); - b = nh(a, f, e); - null !== b && (gi(b, a, e, d), oh(b, a, e)); - }, enqueueForceUpdate: function(a, b) { - a = a._reactInternals; - var c = R2(), d = yi(a), e = mh(c, d); - e.tag = 2; - void 0 !== b && null !== b && (e.callback = b); - b = nh(a, e, d); - null !== b && (gi(b, a, d, c), oh(b, a, d)); - } }; - function Fi(a, b, c, d, e, f, g) { - a = a.stateNode; - return "function" === typeof a.shouldComponentUpdate ? a.shouldComponentUpdate(d, f, g) : b.prototype && b.prototype.isPureReactComponent ? !Ie(c, d) || !Ie(e, f) : true; - } - function Gi(a, b, c) { - var d = false, e = Vf; - var f = b.contextType; - "object" === typeof f && null !== f ? f = eh(f) : (e = Zf(b) ? Xf : H.current, d = b.contextTypes, f = (d = null !== d && void 0 !== d) ? Yf(a, e) : Vf); - b = new b(c, f); - a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null; - b.updater = Ei; - a.stateNode = b; - b._reactInternals = a; - d && (a = a.stateNode, a.__reactInternalMemoizedUnmaskedChildContext = e, a.__reactInternalMemoizedMaskedChildContext = f); - return b; - } - function Hi(a, b, c, d) { - a = b.state; - "function" === typeof b.componentWillReceiveProps && b.componentWillReceiveProps(c, d); - "function" === typeof b.UNSAFE_componentWillReceiveProps && b.UNSAFE_componentWillReceiveProps(c, d); - b.state !== a && Ei.enqueueReplaceState(b, b.state, null); - } - function Ii(a, b, c, d) { - var e = a.stateNode; - e.props = c; - e.state = a.memoizedState; - e.refs = {}; - kh(a); - var f = b.contextType; - "object" === typeof f && null !== f ? e.context = eh(f) : (f = Zf(b) ? Xf : H.current, e.context = Yf(a, f)); - e.state = a.memoizedState; - f = b.getDerivedStateFromProps; - "function" === typeof f && (Di(a, b, f, c), e.state = a.memoizedState); - "function" === typeof b.getDerivedStateFromProps || "function" === typeof e.getSnapshotBeforeUpdate || "function" !== typeof e.UNSAFE_componentWillMount && "function" !== typeof e.componentWillMount || (b = e.state, "function" === typeof e.componentWillMount && e.componentWillMount(), "function" === typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount(), b !== e.state && Ei.enqueueReplaceState(e, e.state, null), qh(a, c, e, d), e.state = a.memoizedState); - "function" === typeof e.componentDidMount && (a.flags |= 4194308); - } - function Ji(a, b) { - try { - var c = "", d = b; - do - c += Pa(d), d = d.return; - while (d); - var e = c; - } catch (f) { - e = "\nError generating stack: " + f.message + "\n" + f.stack; - } - return { value: a, source: b, stack: e, digest: null }; - } - function Ki(a, b, c) { - return { value: a, source: null, stack: null != c ? c : null, digest: null != b ? b : null }; - } - function Li(a, b) { - try { - console.error(b.value); - } catch (c) { - setTimeout(function() { - throw c; - }); - } - } - var Mi = "function" === typeof WeakMap ? WeakMap : Map; - function Ni(a, b, c) { - c = mh(-1, c); - c.tag = 3; - c.payload = { element: null }; - var d = b.value; - c.callback = function() { - Oi || (Oi = true, Pi = d); - Li(a, b); - }; - return c; - } - function Qi(a, b, c) { - c = mh(-1, c); - c.tag = 3; - var d = a.type.getDerivedStateFromError; - if ("function" === typeof d) { - var e = b.value; - c.payload = function() { - return d(e); - }; - c.callback = function() { - Li(a, b); - }; - } - var f = a.stateNode; - null !== f && "function" === typeof f.componentDidCatch && (c.callback = function() { - Li(a, b); - "function" !== typeof d && (null === Ri ? Ri = /* @__PURE__ */ new Set([this]) : Ri.add(this)); - var c2 = b.stack; - this.componentDidCatch(b.value, { componentStack: null !== c2 ? c2 : "" }); - }); - return c; - } - function Si(a, b, c) { - var d = a.pingCache; - if (null === d) { - d = a.pingCache = new Mi(); - var e = /* @__PURE__ */ new Set(); - d.set(b, e); - } else e = d.get(b), void 0 === e && (e = /* @__PURE__ */ new Set(), d.set(b, e)); - e.has(c) || (e.add(c), a = Ti.bind(null, a, b, c), b.then(a, a)); - } - function Ui(a) { - do { - var b; - if (b = 13 === a.tag) b = a.memoizedState, b = null !== b ? null !== b.dehydrated ? true : false : true; - if (b) return a; - a = a.return; - } while (null !== a); - return null; - } - function Vi(a, b, c, d, e) { - if (0 === (a.mode & 1)) return a === b ? a.flags |= 65536 : (a.flags |= 128, c.flags |= 131072, c.flags &= -52805, 1 === c.tag && (null === c.alternate ? c.tag = 17 : (b = mh(-1, 1), b.tag = 2, nh(c, b, 1))), c.lanes |= 1), a; - a.flags |= 65536; - a.lanes = e; - return a; - } - var Wi = ua.ReactCurrentOwner; - var dh = false; - function Xi(a, b, c, d) { - b.child = null === a ? Vg(b, null, c, d) : Ug(b, a.child, c, d); - } - function Yi(a, b, c, d, e) { - c = c.render; - var f = b.ref; - ch(b, e); - d = Nh(a, b, c, d, f, e); - c = Sh(); - if (null !== a && !dh) return b.updateQueue = a.updateQueue, b.flags &= -2053, a.lanes &= ~e, Zi(a, b, e); - I && c && vg(b); - b.flags |= 1; - Xi(a, b, d, e); - return b.child; - } - function $i(a, b, c, d, e) { - if (null === a) { - var f = c.type; - if ("function" === typeof f && !aj(f) && void 0 === f.defaultProps && null === c.compare && void 0 === c.defaultProps) return b.tag = 15, b.type = f, bj(a, b, f, d, e); - a = Rg(c.type, null, d, b, b.mode, e); - a.ref = b.ref; - a.return = b; - return b.child = a; - } - f = a.child; - if (0 === (a.lanes & e)) { - var g = f.memoizedProps; - c = c.compare; - c = null !== c ? c : Ie; - if (c(g, d) && a.ref === b.ref) return Zi(a, b, e); - } - b.flags |= 1; - a = Pg(f, d); - a.ref = b.ref; - a.return = b; - return b.child = a; - } - function bj(a, b, c, d, e) { - if (null !== a) { - var f = a.memoizedProps; - if (Ie(f, d) && a.ref === b.ref) if (dh = false, b.pendingProps = d = f, 0 !== (a.lanes & e)) 0 !== (a.flags & 131072) && (dh = true); - else return b.lanes = a.lanes, Zi(a, b, e); - } - return cj(a, b, c, d, e); - } - function dj(a, b, c) { - var d = b.pendingProps, e = d.children, f = null !== a ? a.memoizedState : null; - if ("hidden" === d.mode) if (0 === (b.mode & 1)) b.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, G(ej, fj), fj |= c; - else { - if (0 === (c & 1073741824)) return a = null !== f ? f.baseLanes | c : c, b.lanes = b.childLanes = 1073741824, b.memoizedState = { baseLanes: a, cachePool: null, transitions: null }, b.updateQueue = null, G(ej, fj), fj |= a, null; - b.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }; - d = null !== f ? f.baseLanes : c; - G(ej, fj); - fj |= d; - } - else null !== f ? (d = f.baseLanes | c, b.memoizedState = null) : d = c, G(ej, fj), fj |= d; - Xi(a, b, e, c); - return b.child; - } - function gj(a, b) { - var c = b.ref; - if (null === a && null !== c || null !== a && a.ref !== c) b.flags |= 512, b.flags |= 2097152; - } - function cj(a, b, c, d, e) { - var f = Zf(c) ? Xf : H.current; - f = Yf(b, f); - ch(b, e); - c = Nh(a, b, c, d, f, e); - d = Sh(); - if (null !== a && !dh) return b.updateQueue = a.updateQueue, b.flags &= -2053, a.lanes &= ~e, Zi(a, b, e); - I && d && vg(b); - b.flags |= 1; - Xi(a, b, c, e); - return b.child; - } - function hj(a, b, c, d, e) { - if (Zf(c)) { - var f = true; - cg(b); - } else f = false; - ch(b, e); - if (null === b.stateNode) ij(a, b), Gi(b, c, d), Ii(b, c, d, e), d = true; - else if (null === a) { - var g = b.stateNode, h = b.memoizedProps; - g.props = h; - var k = g.context, l = c.contextType; - "object" === typeof l && null !== l ? l = eh(l) : (l = Zf(c) ? Xf : H.current, l = Yf(b, l)); - var m = c.getDerivedStateFromProps, q = "function" === typeof m || "function" === typeof g.getSnapshotBeforeUpdate; - q || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== d || k !== l) && Hi(b, g, d, l); - jh = false; - var r = b.memoizedState; - g.state = r; - qh(b, d, g, e); - k = b.memoizedState; - h !== d || r !== k || Wf.current || jh ? ("function" === typeof m && (Di(b, c, m, d), k = b.memoizedState), (h = jh || Fi(b, c, h, d, r, k, l)) ? (q || "function" !== typeof g.UNSAFE_componentWillMount && "function" !== typeof g.componentWillMount || ("function" === typeof g.componentWillMount && g.componentWillMount(), "function" === typeof g.UNSAFE_componentWillMount && g.UNSAFE_componentWillMount()), "function" === typeof g.componentDidMount && (b.flags |= 4194308)) : ("function" === typeof g.componentDidMount && (b.flags |= 4194308), b.memoizedProps = d, b.memoizedState = k), g.props = d, g.state = k, g.context = l, d = h) : ("function" === typeof g.componentDidMount && (b.flags |= 4194308), d = false); - } else { - g = b.stateNode; - lh(a, b); - h = b.memoizedProps; - l = b.type === b.elementType ? h : Ci(b.type, h); - g.props = l; - q = b.pendingProps; - r = g.context; - k = c.contextType; - "object" === typeof k && null !== k ? k = eh(k) : (k = Zf(c) ? Xf : H.current, k = Yf(b, k)); - var y = c.getDerivedStateFromProps; - (m = "function" === typeof y || "function" === typeof g.getSnapshotBeforeUpdate) || "function" !== typeof g.UNSAFE_componentWillReceiveProps && "function" !== typeof g.componentWillReceiveProps || (h !== q || r !== k) && Hi(b, g, d, k); - jh = false; - r = b.memoizedState; - g.state = r; - qh(b, d, g, e); - var n = b.memoizedState; - h !== q || r !== n || Wf.current || jh ? ("function" === typeof y && (Di(b, c, y, d), n = b.memoizedState), (l = jh || Fi(b, c, l, d, r, n, k) || false) ? (m || "function" !== typeof g.UNSAFE_componentWillUpdate && "function" !== typeof g.componentWillUpdate || ("function" === typeof g.componentWillUpdate && g.componentWillUpdate(d, n, k), "function" === typeof g.UNSAFE_componentWillUpdate && g.UNSAFE_componentWillUpdate(d, n, k)), "function" === typeof g.componentDidUpdate && (b.flags |= 4), "function" === typeof g.getSnapshotBeforeUpdate && (b.flags |= 1024)) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && r === a.memoizedState || (b.flags |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && r === a.memoizedState || (b.flags |= 1024), b.memoizedProps = d, b.memoizedState = n), g.props = d, g.state = n, g.context = k, d = l) : ("function" !== typeof g.componentDidUpdate || h === a.memoizedProps && r === a.memoizedState || (b.flags |= 4), "function" !== typeof g.getSnapshotBeforeUpdate || h === a.memoizedProps && r === a.memoizedState || (b.flags |= 1024), d = false); - } - return jj(a, b, c, d, f, e); - } - function jj(a, b, c, d, e, f) { - gj(a, b); - var g = 0 !== (b.flags & 128); - if (!d && !g) return e && dg(b, c, false), Zi(a, b, f); - d = b.stateNode; - Wi.current = b; - var h = g && "function" !== typeof c.getDerivedStateFromError ? null : d.render(); - b.flags |= 1; - null !== a && g ? (b.child = Ug(b, a.child, null, f), b.child = Ug(b, null, h, f)) : Xi(a, b, h, f); - b.memoizedState = d.state; - e && dg(b, c, true); - return b.child; - } - function kj(a) { - var b = a.stateNode; - b.pendingContext ? ag(a, b.pendingContext, b.pendingContext !== b.context) : b.context && ag(a, b.context, false); - yh(a, b.containerInfo); - } - function lj(a, b, c, d, e) { - Ig(); - Jg(e); - b.flags |= 256; - Xi(a, b, c, d); - return b.child; - } - var mj = { dehydrated: null, treeContext: null, retryLane: 0 }; - function nj(a) { - return { baseLanes: a, cachePool: null, transitions: null }; - } - function oj(a, b, c) { - var d = b.pendingProps, e = L.current, f = false, g = 0 !== (b.flags & 128), h; - (h = g) || (h = null !== a && null === a.memoizedState ? false : 0 !== (e & 2)); - if (h) f = true, b.flags &= -129; - else if (null === a || null !== a.memoizedState) e |= 1; - G(L, e & 1); - if (null === a) { - Eg(b); - a = b.memoizedState; - if (null !== a && (a = a.dehydrated, null !== a)) return 0 === (b.mode & 1) ? b.lanes = 1 : "$!" === a.data ? b.lanes = 8 : b.lanes = 1073741824, null; - g = d.children; - a = d.fallback; - return f ? (d = b.mode, f = b.child, g = { mode: "hidden", children: g }, 0 === (d & 1) && null !== f ? (f.childLanes = 0, f.pendingProps = g) : f = pj(g, d, 0, null), a = Tg(a, d, c, null), f.return = b, a.return = b, f.sibling = a, b.child = f, b.child.memoizedState = nj(c), b.memoizedState = mj, a) : qj(b, g); - } - e = a.memoizedState; - if (null !== e && (h = e.dehydrated, null !== h)) return rj(a, b, g, d, h, e, c); - if (f) { - f = d.fallback; - g = b.mode; - e = a.child; - h = e.sibling; - var k = { mode: "hidden", children: d.children }; - 0 === (g & 1) && b.child !== e ? (d = b.child, d.childLanes = 0, d.pendingProps = k, b.deletions = null) : (d = Pg(e, k), d.subtreeFlags = e.subtreeFlags & 14680064); - null !== h ? f = Pg(h, f) : (f = Tg(f, g, c, null), f.flags |= 2); - f.return = b; - d.return = b; - d.sibling = f; - b.child = d; - d = f; - f = b.child; - g = a.child.memoizedState; - g = null === g ? nj(c) : { baseLanes: g.baseLanes | c, cachePool: null, transitions: g.transitions }; - f.memoizedState = g; - f.childLanes = a.childLanes & ~c; - b.memoizedState = mj; - return d; - } - f = a.child; - a = f.sibling; - d = Pg(f, { mode: "visible", children: d.children }); - 0 === (b.mode & 1) && (d.lanes = c); - d.return = b; - d.sibling = null; - null !== a && (c = b.deletions, null === c ? (b.deletions = [a], b.flags |= 16) : c.push(a)); - b.child = d; - b.memoizedState = null; - return d; - } - function qj(a, b) { - b = pj({ mode: "visible", children: b }, a.mode, 0, null); - b.return = a; - return a.child = b; - } - function sj(a, b, c, d) { - null !== d && Jg(d); - Ug(b, a.child, null, c); - a = qj(b, b.pendingProps.children); - a.flags |= 2; - b.memoizedState = null; - return a; - } - function rj(a, b, c, d, e, f, g) { - if (c) { - if (b.flags & 256) return b.flags &= -257, d = Ki(Error(p(422))), sj(a, b, g, d); - if (null !== b.memoizedState) return b.child = a.child, b.flags |= 128, null; - f = d.fallback; - e = b.mode; - d = pj({ mode: "visible", children: d.children }, e, 0, null); - f = Tg(f, e, g, null); - f.flags |= 2; - d.return = b; - f.return = b; - d.sibling = f; - b.child = d; - 0 !== (b.mode & 1) && Ug(b, a.child, null, g); - b.child.memoizedState = nj(g); - b.memoizedState = mj; - return f; - } - if (0 === (b.mode & 1)) return sj(a, b, g, null); - if ("$!" === e.data) { - d = e.nextSibling && e.nextSibling.dataset; - if (d) var h = d.dgst; - d = h; - f = Error(p(419)); - d = Ki(f, d, void 0); - return sj(a, b, g, d); - } - h = 0 !== (g & a.childLanes); - if (dh || h) { - d = Q; - if (null !== d) { - switch (g & -g) { - case 4: - e = 2; - break; - case 16: - e = 8; - break; - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - e = 32; - break; - case 536870912: - e = 268435456; - break; - default: - e = 0; - } - e = 0 !== (e & (d.suspendedLanes | g)) ? 0 : e; - 0 !== e && e !== f.retryLane && (f.retryLane = e, ih(a, e), gi(d, a, e, -1)); - } - tj(); - d = Ki(Error(p(421))); - return sj(a, b, g, d); - } - if ("$?" === e.data) return b.flags |= 128, b.child = a.child, b = uj.bind(null, a), e._reactRetry = b, null; - a = f.treeContext; - yg = Lf(e.nextSibling); - xg = b; - I = true; - zg = null; - null !== a && (og[pg++] = rg, og[pg++] = sg, og[pg++] = qg, rg = a.id, sg = a.overflow, qg = b); - b = qj(b, d.children); - b.flags |= 4096; - return b; - } - function vj(a, b, c) { - a.lanes |= b; - var d = a.alternate; - null !== d && (d.lanes |= b); - bh(a.return, b, c); - } - function wj(a, b, c, d, e) { - var f = a.memoizedState; - null === f ? a.memoizedState = { isBackwards: b, rendering: null, renderingStartTime: 0, last: d, tail: c, tailMode: e } : (f.isBackwards = b, f.rendering = null, f.renderingStartTime = 0, f.last = d, f.tail = c, f.tailMode = e); - } - function xj(a, b, c) { - var d = b.pendingProps, e = d.revealOrder, f = d.tail; - Xi(a, b, d.children, c); - d = L.current; - if (0 !== (d & 2)) d = d & 1 | 2, b.flags |= 128; - else { - if (null !== a && 0 !== (a.flags & 128)) a: for (a = b.child; null !== a; ) { - if (13 === a.tag) null !== a.memoizedState && vj(a, c, b); - else if (19 === a.tag) vj(a, c, b); - else if (null !== a.child) { - a.child.return = a; - a = a.child; - continue; - } - if (a === b) break a; - for (; null === a.sibling; ) { - if (null === a.return || a.return === b) break a; - a = a.return; - } - a.sibling.return = a.return; - a = a.sibling; - } - d &= 1; - } - G(L, d); - if (0 === (b.mode & 1)) b.memoizedState = null; - else switch (e) { - case "forwards": - c = b.child; - for (e = null; null !== c; ) a = c.alternate, null !== a && null === Ch(a) && (e = c), c = c.sibling; - c = e; - null === c ? (e = b.child, b.child = null) : (e = c.sibling, c.sibling = null); - wj(b, false, e, c, f); - break; - case "backwards": - c = null; - e = b.child; - for (b.child = null; null !== e; ) { - a = e.alternate; - if (null !== a && null === Ch(a)) { - b.child = e; - break; - } - a = e.sibling; - e.sibling = c; - c = e; - e = a; - } - wj(b, true, c, null, f); - break; - case "together": - wj(b, false, null, null, void 0); - break; - default: - b.memoizedState = null; - } - return b.child; - } - function ij(a, b) { - 0 === (b.mode & 1) && null !== a && (a.alternate = null, b.alternate = null, b.flags |= 2); - } - function Zi(a, b, c) { - null !== a && (b.dependencies = a.dependencies); - rh |= b.lanes; - if (0 === (c & b.childLanes)) return null; - if (null !== a && b.child !== a.child) throw Error(p(153)); - if (null !== b.child) { - a = b.child; - c = Pg(a, a.pendingProps); - b.child = c; - for (c.return = b; null !== a.sibling; ) a = a.sibling, c = c.sibling = Pg(a, a.pendingProps), c.return = b; - c.sibling = null; - } - return b.child; - } - function yj(a, b, c) { - switch (b.tag) { - case 3: - kj(b); - Ig(); - break; - case 5: - Ah(b); - break; - case 1: - Zf(b.type) && cg(b); - break; - case 4: - yh(b, b.stateNode.containerInfo); - break; - case 10: - var d = b.type._context, e = b.memoizedProps.value; - G(Wg, d._currentValue); - d._currentValue = e; - break; - case 13: - d = b.memoizedState; - if (null !== d) { - if (null !== d.dehydrated) return G(L, L.current & 1), b.flags |= 128, null; - if (0 !== (c & b.child.childLanes)) return oj(a, b, c); - G(L, L.current & 1); - a = Zi(a, b, c); - return null !== a ? a.sibling : null; - } - G(L, L.current & 1); - break; - case 19: - d = 0 !== (c & b.childLanes); - if (0 !== (a.flags & 128)) { - if (d) return xj(a, b, c); - b.flags |= 128; - } - e = b.memoizedState; - null !== e && (e.rendering = null, e.tail = null, e.lastEffect = null); - G(L, L.current); - if (d) break; - else return null; - case 22: - case 23: - return b.lanes = 0, dj(a, b, c); - } - return Zi(a, b, c); - } - var zj; - var Aj; - var Bj; - var Cj; - zj = function(a, b) { - for (var c = b.child; null !== c; ) { - if (5 === c.tag || 6 === c.tag) a.appendChild(c.stateNode); - else if (4 !== c.tag && null !== c.child) { - c.child.return = c; - c = c.child; - continue; - } - if (c === b) break; - for (; null === c.sibling; ) { - if (null === c.return || c.return === b) return; - c = c.return; - } - c.sibling.return = c.return; - c = c.sibling; - } - }; - Aj = function() { - }; - Bj = function(a, b, c, d) { - var e = a.memoizedProps; - if (e !== d) { - a = b.stateNode; - xh(uh.current); - var f = null; - switch (c) { - case "input": - e = Ya(a, e); - d = Ya(a, d); - f = []; - break; - case "select": - e = A({}, e, { value: void 0 }); - d = A({}, d, { value: void 0 }); - f = []; - break; - case "textarea": - e = gb(a, e); - d = gb(a, d); - f = []; - break; - default: - "function" !== typeof e.onClick && "function" === typeof d.onClick && (a.onclick = Bf); - } - ub(c, d); - var g; - c = null; - for (l in e) if (!d.hasOwnProperty(l) && e.hasOwnProperty(l) && null != e[l]) if ("style" === l) { - var h = e[l]; - for (g in h) h.hasOwnProperty(g) && (c || (c = {}), c[g] = ""); - } else "dangerouslySetInnerHTML" !== l && "children" !== l && "suppressContentEditableWarning" !== l && "suppressHydrationWarning" !== l && "autoFocus" !== l && (ea.hasOwnProperty(l) ? f || (f = []) : (f = f || []).push(l, null)); - for (l in d) { - var k = d[l]; - h = null != e ? e[l] : void 0; - if (d.hasOwnProperty(l) && k !== h && (null != k || null != h)) if ("style" === l) if (h) { - for (g in h) !h.hasOwnProperty(g) || k && k.hasOwnProperty(g) || (c || (c = {}), c[g] = ""); - for (g in k) k.hasOwnProperty(g) && h[g] !== k[g] && (c || (c = {}), c[g] = k[g]); - } else c || (f || (f = []), f.push( - l, - c - )), c = k; - else "dangerouslySetInnerHTML" === l ? (k = k ? k.__html : void 0, h = h ? h.__html : void 0, null != k && h !== k && (f = f || []).push(l, k)) : "children" === l ? "string" !== typeof k && "number" !== typeof k || (f = f || []).push(l, "" + k) : "suppressContentEditableWarning" !== l && "suppressHydrationWarning" !== l && (ea.hasOwnProperty(l) ? (null != k && "onScroll" === l && D("scroll", a), f || h === k || (f = [])) : (f = f || []).push(l, k)); - } - c && (f = f || []).push("style", c); - var l = f; - if (b.updateQueue = l) b.flags |= 4; - } - }; - Cj = function(a, b, c, d) { - c !== d && (b.flags |= 4); - }; - function Dj(a, b) { - if (!I) switch (a.tailMode) { - case "hidden": - b = a.tail; - for (var c = null; null !== b; ) null !== b.alternate && (c = b), b = b.sibling; - null === c ? a.tail = null : c.sibling = null; - break; - case "collapsed": - c = a.tail; - for (var d = null; null !== c; ) null !== c.alternate && (d = c), c = c.sibling; - null === d ? b || null === a.tail ? a.tail = null : a.tail.sibling = null : d.sibling = null; - } - } - function S(a) { - var b = null !== a.alternate && a.alternate.child === a.child, c = 0, d = 0; - if (b) for (var e = a.child; null !== e; ) c |= e.lanes | e.childLanes, d |= e.subtreeFlags & 14680064, d |= e.flags & 14680064, e.return = a, e = e.sibling; - else for (e = a.child; null !== e; ) c |= e.lanes | e.childLanes, d |= e.subtreeFlags, d |= e.flags, e.return = a, e = e.sibling; - a.subtreeFlags |= d; - a.childLanes = c; - return b; - } - function Ej(a, b, c) { - var d = b.pendingProps; - wg(b); - switch (b.tag) { - case 2: - case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return S(b), null; - case 1: - return Zf(b.type) && $f(), S(b), null; - case 3: - d = b.stateNode; - zh(); - E(Wf); - E(H); - Eh(); - d.pendingContext && (d.context = d.pendingContext, d.pendingContext = null); - if (null === a || null === a.child) Gg(b) ? b.flags |= 4 : null === a || a.memoizedState.isDehydrated && 0 === (b.flags & 256) || (b.flags |= 1024, null !== zg && (Fj(zg), zg = null)); - Aj(a, b); - S(b); - return null; - case 5: - Bh(b); - var e = xh(wh.current); - c = b.type; - if (null !== a && null != b.stateNode) Bj(a, b, c, d, e), a.ref !== b.ref && (b.flags |= 512, b.flags |= 2097152); - else { - if (!d) { - if (null === b.stateNode) throw Error(p(166)); - S(b); - return null; - } - a = xh(uh.current); - if (Gg(b)) { - d = b.stateNode; - c = b.type; - var f = b.memoizedProps; - d[Of] = b; - d[Pf] = f; - a = 0 !== (b.mode & 1); - switch (c) { - case "dialog": - D("cancel", d); - D("close", d); - break; - case "iframe": - case "object": - case "embed": - D("load", d); - break; - case "video": - case "audio": - for (e = 0; e < lf.length; e++) D(lf[e], d); - break; - case "source": - D("error", d); - break; - case "img": - case "image": - case "link": - D( - "error", - d - ); - D("load", d); - break; - case "details": - D("toggle", d); - break; - case "input": - Za(d, f); - D("invalid", d); - break; - case "select": - d._wrapperState = { wasMultiple: !!f.multiple }; - D("invalid", d); - break; - case "textarea": - hb(d, f), D("invalid", d); - } - ub(c, f); - e = null; - for (var g in f) if (f.hasOwnProperty(g)) { - var h = f[g]; - "children" === g ? "string" === typeof h ? d.textContent !== h && (true !== f.suppressHydrationWarning && Af(d.textContent, h, a), e = ["children", h]) : "number" === typeof h && d.textContent !== "" + h && (true !== f.suppressHydrationWarning && Af( - d.textContent, - h, - a - ), e = ["children", "" + h]) : ea.hasOwnProperty(g) && null != h && "onScroll" === g && D("scroll", d); - } - switch (c) { - case "input": - Va(d); - db(d, f, true); - break; - case "textarea": - Va(d); - jb(d); - break; - case "select": - case "option": - break; - default: - "function" === typeof f.onClick && (d.onclick = Bf); - } - d = e; - b.updateQueue = d; - null !== d && (b.flags |= 4); - } else { - g = 9 === e.nodeType ? e : e.ownerDocument; - "http://www.w3.org/1999/xhtml" === a && (a = kb(c)); - "http://www.w3.org/1999/xhtml" === a ? "script" === c ? (a = g.createElement("div"), a.innerHTML = " - - - - - - - + + + + + +
- - + + \ No newline at end of file diff --git a/frontend/store.js b/frontend/store.js index 40a2fcc8247d51b248f58611bb3ec34bb3d079d0..dfb2eeddfceec4715e59f4986b08f491767fc333 100644 --- a/frontend/store.js +++ b/frontend/store.js @@ -105,7 +105,6 @@ export const useGame = create((set, get) => ({ voice: makeVoice(), notice: makeNotice(), rage: makeRage(), - christmas: makeChristmas(), set(partial) { set(partial) }, })) @@ -210,6 +209,7 @@ function makeRage() { set(p) { Object.assign(state, p); emit() }, } } + /* ---- hooks ---- useSyncExternalStore(subscribe, getSnapshot) — phải truyền ĐÚNG 2 hàm. Trước đây gọi `useSync(c)` (thiếu getSnapshot) → React gọi getSnapshot() @@ -399,7 +399,7 @@ function handleServer(data) { name: g.me?.name || 'Bạn', number: g.me?.number ?? null, pos: new THREE.Vector3(sp.x, sp.y, sp.z), - rot: Math.PI, // V34: mới vào hang quay mặt VÀO TRONG (hướng -z, nhìn màn hình lớn/trung tâm) + rot: 0, anim: 'idle', lastSeen: Date.now(), }) @@ -587,21 +587,6 @@ function handleServer(data) { break } case 'pong': break - case 'christmas_decor': { - /* Nguoi khac vua trang tri — them vao cay cua minh */ - const ch = g.christmas - ch.addOrnament({ - kind: data.kind, - x: data.x, y: data.y, z: data.z, - color: data.color, - by: data.player_id, - }) - break - } - case 'christmas_ack': { - /* Xac nhan da gui — khong can lam gi */ - break - } default: break } } diff --git a/frontend/styles/cavescreen.css b/frontend/styles/cavescreen.css index eb2ebaf1cd8a6a6f9900b7cbf92f029ad83122f4..665eb267f303b4a58e4a71996717e2e167c4fa16 100644 --- a/frontend/styles/cavescreen.css +++ b/frontend/styles/cavescreen.css @@ -1,827 +1 @@ - -/* cavescreen.css - Chat toggle fix */ -.cave-chat-toggle { - display: inline-flex !important; - z-index: 100 !important; - position: relative; - pointer-events: auto !important; -} - -.cave[data-activity="tug"] .cave-chat-toggle, -.cave[data-activity="ball"] .cave-chat-toggle, -.cave[data-activity="rage"] .cave-chat-toggle { - display: inline-flex !important; - z-index: 100 !important; -} - -/* v76: force chat toggle always visible */ -.cave-chat-toggle { - display: inline-flex !important; - z-index: 100 !important; - position: relative; - pointer-events: auto !important; -} - -.cave[data-activity="tug"] .cave-chat-toggle, -.cave[data-activity="ball"] .cave-chat-toggle, -.cave[data-activity="rage"] .cave-chat-toggle { - display: inline-flex !important; - z-index: 100 !important; -} - -/* v78: force chat toggle always visible */ -.cave-chat-toggle { - display: inline-flex !important; - z-index: 100 !important; - position: relative; - pointer-events: auto !important; -} - -.cave[data-activity="tug"] .cave-chat-toggle, -.cave[data-activity="ball"] .cave-chat-toggle, -.cave[data-activity="rage"] .cave-chat-toggle { - display: inline-flex !important; - z-index: 100 !important; -} - - -/* ===== V83 SERVED OVERRIDES ===== */ -/* ---- NUT CHAT: LUON HIEN, LUON BAM DUOC ---- */ -.cave-chat-toggle, .cave-chat-toggle-btn, button.cave-chat-toggle, .v71-chat-toggle { - display: inline-flex !important; visibility: visible !important; opacity: 1 !important; - pointer-events: auto !important; position: fixed !important; - right: max(18px, env(safe-area-inset-right)) !important; - bottom: max(98px, calc(env(safe-area-inset-bottom) + 90px)) !important; - z-index: 9000 !important; width: 58px !important; height: 58px !important; - min-width: 58px !important; padding: 0 !important; margin: 0 !important; - border-radius: 50% !important; align-items: center !important; - justify-content: center !important; gap: 0 !important; font-size: 1.5rem !important; - line-height: 1 !important; color: #fff4e6 !important; - background: linear-gradient(180deg, #4fa3ff, #1a5c9e) !important; - border: 3px solid #fff6ec !important; - box-shadow: 0 6px 18px -6px #000c, 0 0 0 2px #0000008c !important; - cursor: pointer !important; transform: none !important; - transition: transform .15s ease !important; -} -.cave-chat-toggle:hover, .cave-chat-toggle-btn:hover { transform: scale(1.08) !important; } -.cave-chat-toggle:active, .cave-chat-toggle-btn:active { transform: scale(.94) !important; } -.cave-chat-badge { - position: absolute !important; top: -5px !important; right: -5px !important; - min-width: 20px !important; height: 20px !important; padding: 0 5px !important; - border-radius: 999px !important; background: #c8102e !important; color: #fff !important; - font: 800 .6875rem/20px "Be Vietnam Pro", sans-serif !important; - text-align: center !important; z-index: 1 !important; -} -/* ---- NUT DONG / MO BANG CHAT ---- */ -.cave-chat-hide, .cave-chat-close, .cave-chat .cave-chat-hide { - display: inline-flex !important; visibility: visible !important; - pointer-events: auto !important; cursor: pointer !important; - min-width: 34px !important; min-height: 34px !important; z-index: 2 !important; -} -/* ---- dọn CSS nền vàng cũ nếu còn (an toàn, idempotent) ---- */ - -@media (width <= 640px) { - .cave-chat-toggle, .cave-chat-toggle-btn, .v71-chat-toggle { - right: max(12px, env(safe-area-inset-right)) !important; - bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px)) !important; - width: 52px !important; height: 52px !important; min-width: 52px !important; - font-size: 1.3rem !important; - } -} - -/* ===== V97 CAVE UI (đầy đủ) ===== */ -/* Toàn bộ class component trong hang. Trước V97 các class này KHÔNG có - định nghĩa nào -> chat không cuộn được, nút mất dạng, mobile vỡ. */ -.cave-scene { - position: fixed; inset: 0; width: 100%; height: 100%; - overflow: hidden; background: #120b07; touch-action: none; -} -.cave-canvas-wrap { position: absolute; inset: 0; } -.cave-canvas-wrap canvas { display: block; width: 100% !important; height: 100% !important; } - -/* ---- thanh trên ---- */ -.cave-bar { - position: absolute; top: 0; left: 0; right: 0; z-index: 40; - display: flex; align-items: flex-start; justify-content: space-between; - gap: 10px; padding: max(10px, env(safe-area-inset-top)) 14px 10px; - pointer-events: none; -} -.cave-bar > * { pointer-events: auto; } -.cave-bar-left, .cave-bar-right { - display: flex; align-items: center; gap: 8px; flex-wrap: wrap; - min-width: 0; -} -.cave-bar-right { justify-content: flex-end; } -.cave-leave { - display: inline-flex; align-items: center; gap: 6px; - padding: 8px 13px; border-radius: 10px; cursor: pointer; - font: 700 .8rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #ffe6c2; text-decoration: none; - background: linear-gradient(180deg, rgba(58,32,18,.92), rgba(30,16,9,.94)); - border: 1px solid rgba(201,162,78,.42); - box-shadow: 0 4px 14px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,220,160,.16); - backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); -} -.cave-leave:hover { border-color: rgba(224,186,104,.72); color: #fff3dd; } - -/* ---- phòng / số người ---- */ -.cave-room { - padding: 8px 13px; border-radius: 10px; - background: rgba(24,13,7,.82); border: 1px solid rgba(201,162,78,.26); - box-shadow: 0 4px 14px rgba(0,0,0,.42); - backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); - text-align: right; line-height: 1.2; -} -.cave-room-name { - margin: 0; font: 800 .78rem/1.2 "Be Vietnam Pro", system-ui, sans-serif; - color: #e6c98f; letter-spacing: .04em; -} -.cave-room-meta { - margin: 2px 0 0; font: 600 .7rem/1.25 "Be Vietnam Pro", system-ui, sans-serif; - color: #b9a98d; -} -.cave-room-num { color: #ffd479; font-weight: 900; font-size: .92rem; } -.cave-room-unit, .cave-room-extra { color: #a8967a; } - -/* ---- âm lượng ---- */ -.cave-sound { - display: inline-flex; align-items: center; gap: 7px; - padding: 7px 10px; border-radius: 10px; - background: rgba(24,13,7,.82); border: 1px solid rgba(201,162,78,.26); - box-shadow: 0 4px 14px rgba(0,0,0,.42); - backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); -} -.cave-sound-btn { - width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; - background: rgba(201,162,78,.16); color: #ffe0a8; cursor: pointer; - font-size: .92rem; line-height: 1; display: grid; place-items: center; -} -.cave-sound-btn:hover { background: rgba(201,162,78,.3); } -.cave-sound[data-muted] .cave-sound-range { opacity: .38; } -.cave-sound-range { - -webkit-appearance: none; appearance: none; - width: 84px; height: 4px; border-radius: 99px; cursor: pointer; - background: linear-gradient(90deg, #e0ba68 var(--fill, 60%), rgba(201,162,78,.24) var(--fill, 60%)); - outline: none; -} -.cave-sound-range::-webkit-slider-thumb { - -webkit-appearance: none; appearance: none; - width: 13px; height: 13px; border-radius: 50%; - background: #ffe0a8; border: 1px solid #8a6a2e; - box-shadow: 0 1px 4px rgba(0,0,0,.6); cursor: pointer; -} -.cave-sound-range::-moz-range-thumb { - width: 13px; height: 13px; border-radius: 50%; - background: #ffe0a8; border: 1px solid #8a6a2e; cursor: pointer; -} - -/* ---- TV / màn hình lớn ---- */ -.cave-tv { - position: absolute; top: 64px; left: 50%; transform: translateX(-50%); - z-index: 38; display: flex; align-items: center; gap: 6px; - padding: 6px 8px; border-radius: 12px; - background: rgba(24,13,7,.82); border: 1px solid rgba(201,162,78,.26); - box-shadow: 0 6px 18px rgba(0,0,0,.5); - backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); -} -.cave-tv-seg { display: flex; gap: 4px; } -.cave-tv-ch { - padding: 6px 11px; border-radius: 8px; cursor: pointer; - font: 700 .74rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #f0dcbb; background: rgba(201,162,78,.12); - border: 1px solid rgba(201,162,78,.3); white-space: nowrap; -} -.cave-tv-ch:hover:not(:disabled) { background: rgba(201,162,78,.26); color: #fff3dd; } -.cave-tv-ch:disabled { - background: linear-gradient(180deg, #b8352a, #8d2018); - border-color: rgba(255,140,120,.5); color: #fff; cursor: default; - box-shadow: 0 0 12px rgba(218,41,28,.45); -} -.cave-tv-vol-btn { - width: 30px; height: 30px; padding: 0; border-radius: 8px; - border: 1px solid rgba(201,162,78,.3); background: rgba(201,162,78,.12); - color: #ffe0a8; cursor: pointer; font-size: .9rem; display: grid; place-items: center; -} -.cave-tv-vol-btn:hover { background: rgba(201,162,78,.26); } -.cave-tv-pop { - position: absolute; top: calc(100% + 8px); right: 0; - min-width: 208px; padding: 13px 14px; border-radius: 12px; z-index: 60; - background: linear-gradient(180deg, #2a1a0e, #180d06); - border: 1px solid rgba(201,162,78,.4); - box-shadow: 0 12px 34px rgba(0,0,0,.72); -} -.cave-tv-title { - margin: 0 0 9px; font: 700 .76rem/1.3 "Be Vietnam Pro", system-ui, sans-serif; - color: #e6c98f; -} -.cave-tv-range { width: 100%; } - -/* ---- chat ---- */ -.cave-chat { - position: absolute; right: 14px; bottom: 82px; z-index: 45; - width: min(340px, calc(100vw - 28px)); - display: flex; flex-direction: column; - border-radius: 14px; overflow: hidden; - background: linear-gradient(180deg, rgba(34,20,11,.97), rgba(18,10,5,.98)); - border: 1px solid rgba(201,162,78,.4); - box-shadow: 0 18px 48px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,220,160,.12); - backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); -} -.cave-chat-head { - display: flex; align-items: center; gap: 6px; flex-wrap: wrap; - padding: 9px 10px; background: rgba(201,162,78,.1); - border-bottom: 1px solid rgba(201,162,78,.22); -} -.cave-chat-tabs { display: flex; gap: 5px; flex: 1; min-width: 0; flex-wrap: wrap; } -.cave-chat-tab { - padding: 5px 10px; border-radius: 8px; cursor: pointer; - font: 700 .72rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #cbb597; background: rgba(255,255,255,.05); - border: 1px solid rgba(201,162,78,.22); max-width: 130px; - overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -} -.cave-chat-tab:hover { background: rgba(201,162,78,.2); color: #ffe9c6; } -.cave-chat-tab.is-active { - background: linear-gradient(180deg, #b8352a, #8d2018); - border-color: rgba(255,140,120,.5); color: #fff; -} -.cave-chat-hide { - width: 28px; height: 28px; padding: 0; flex-shrink: 0; - border-radius: 8px; cursor: pointer; - border: 1px solid rgba(201,162,78,.3); background: rgba(201,162,78,.12); - color: #ffe0a8; font-size: .9rem; line-height: 1; display: grid; place-items: center; -} -.cave-chat-hide:hover { background: rgba(201,162,78,.28); } - -/* LOG CUỘN ĐƯỢC — trước V97 hoàn toàn không có height/overflow */ -.cave-chat-log { - flex: 1 1 auto; min-height: 132px; max-height: 46vh; - overflow-y: auto; overscroll-behavior: contain; - padding: 10px 11px; display: flex; flex-direction: column; gap: 7px; - scrollbar-width: thin; scrollbar-color: rgba(201,162,78,.5) transparent; -} -.cave-chat-log::-webkit-scrollbar { width: 7px; } -.cave-chat-log::-webkit-scrollbar-thumb { - background: rgba(201,162,78,.44); border-radius: 99px; -} -.cave-chat-log::-webkit-scrollbar-track { background: transparent; } - -.cave-chat-msg { - font: 500 .8rem/1.45 "Be Vietnam Pro", system-ui, sans-serif; - color: #dccbb2; word-break: break-word; -} -.cave-chat-msg.is-system { - color: #c9a24e; font-style: italic; font-size: .74rem; - opacity: .92; -} -.cave-chat-msg.is-mine .cave-chat-text { color: #ffe9c6; } -.cave-chat-name { - font-weight: 800; color: #e6c98f; margin-right: 3px; -} -.cave-chat-msg.is-mine .cave-chat-name { color: #ff9d7a; } -.cave-chat-text { color: #d9c9b2; } -.cave-chat-time { - margin-left: 5px; font-size: .64rem; color: #8d7b62; white-space: nowrap; -} -.cave-chat-empty { - margin: 14px 4px; text-align: center; font-size: .76rem; - color: #8d7b62; font-style: italic; -} - -.cave-chat-form { - display: flex; gap: 7px; padding: 9px 10px; - border-top: 1px solid rgba(201,162,78,.22); - background: rgba(0,0,0,.26); -} -.cave-chat-input { - flex: 1; min-width: 0; padding: 9px 11px; border-radius: 9px; - font: 500 .8rem/1.3 "Be Vietnam Pro", system-ui, sans-serif; - color: #f2e6d4; background: rgba(255,255,255,.06); - border: 1px solid rgba(201,162,78,.28); outline: none; -} -.cave-chat-input::placeholder { color: #8d7b62; } -.cave-chat-input:focus { - border-color: rgba(224,186,104,.7); - box-shadow: 0 0 0 2px rgba(201,162,78,.16); -} -.cave-chat-send { - width: 38px; flex-shrink: 0; border-radius: 9px; cursor: pointer; - border: 1px solid rgba(255,140,120,.42); - background: linear-gradient(180deg, #b8352a, #8d2018); - color: #fff; font-size: .92rem; line-height: 1; display: grid; place-items: center; -} -.cave-chat-send:hover { filter: brightness(1.12); } -.cave-chat-send:active { transform: translateY(1px); } - -/* nút mở/đóng chat nổi */ -.cave-chat-toggle, .cave-chat-toggle-btn { - position: fixed; right: 16px; bottom: 16px; z-index: 46; - width: 54px; height: 54px; padding: 0; border-radius: 50%; - display: inline-flex; align-items: center; justify-content: center; - cursor: pointer; font-size: 1.36rem; line-height: 1; - color: #fff5e6; - background: linear-gradient(180deg, #c03a2c, #8d2018); - border: 2px solid rgba(255,190,150,.42); - box-shadow: 0 8px 24px rgba(0,0,0,.62), 0 0 0 1px rgba(0,0,0,.4), - inset 0 1px 0 rgba(255,255,255,.22); -} -.cave-chat-toggle:hover, .cave-chat-toggle-btn:hover { filter: brightness(1.12); } -.cave-chat-toggle:active, .cave-chat-toggle-btn:active { transform: scale(.96); } -.cave-chat-toggle.is-active, .cave-chat-toggle-btn.is-active { - background: linear-gradient(180deg, #6d4a22, #3d2812); - border-color: rgba(224,186,104,.6); -} -.cave-chat-badge { - position: absolute; top: -3px; right: -3px; - min-width: 19px; height: 19px; padding: 0 4px; border-radius: 99px; - display: grid; place-items: center; - font: 800 .62rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #fff; background: #e0301e; - border: 1.5px solid #1a0e06; - box-shadow: 0 2px 8px rgba(224,48,30,.6); -} -.cave-chat-dot { - display: inline-block; width: 7px; height: 7px; border-radius: 50%; - background: #56d364; box-shadow: 0 0 7px rgba(86,211,100,.85); -} - -/* ---- feed sự kiện ---- */ -.cave-feed { - margin-top: 9px; padding-top: 9px; - border-top: 1px dashed rgba(201,162,78,.24); -} -.cave-feed-title { - margin: 0 0 6px; font: 800 .62rem/1.2 "Be Vietnam Pro", system-ui, sans-serif; - color: #a8906a; letter-spacing: .13em; text-transform: uppercase; -} -.cave-feed-log { - list-style: none; margin: 0; padding: 0; - display: flex; flex-direction: column; gap: 4px; -} -.cave-feed-item { - font: 500 .71rem/1.4 "Be Vietnam Pro", system-ui, sans-serif; - color: #a8967a; padding-left: 11px; position: relative; -} -.cave-feed-item::before { - content: "•"; position: absolute; left: 0; color: #c9a24e; opacity: .8; -} -.cave-feed-log.is-compact .cave-feed-item { font-size: .67rem; } - -/* ---- bình chọn ---- */ -/* V132: nang len tren can dieu khien. - Do hinh hoc: .cave-stick chiem x 22..130, y(bottom) 24..132, z-index 44, - VA ve SAU .cave-poll trong DOM => phu len day poll, che 2 dap an cuoi. - Poll cao ~274px => dat bottom 148 de day poll (148) cao hon dinh stick - (132) 16px. */ -.cave-poll { - position: absolute; left: 14px; bottom: 148px; z-index: 46; - width: min(272px, calc(100vw - 28px)); padding: 13px 14px; - border-radius: 13px; - background: linear-gradient(180deg, rgba(34,20,11,.97), rgba(18,10,5,.98)); - border: 1px solid rgba(201,162,78,.36); - box-shadow: 0 14px 38px rgba(0,0,0,.66); - backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); -} -/* V125: tieu de + cau hoi trac nghiem ro rang hon */ -.cave-poll-head { - display: inline-block; margin: 0 0 7px; padding: 2px 9px; - border-radius: 999px; background: rgba(201,162,78,.18); - border: 1px solid rgba(201,162,78,.42); - font: 800 .62rem/1.5 "Be Vietnam Pro", system-ui, sans-serif; - letter-spacing: .04em; text-transform: uppercase; color: #ffd76a; -} -.cave-poll-q { - margin: 0 0 10px; font: 800 .88rem/1.4 "Be Vietnam Pro", system-ui, sans-serif; - color: #ffe9c6; -} -.cave-poll-options { display: flex; flex-direction: column; gap: 6px; } -.cave-poll-option { - padding: 10px 12px; border-radius: 9px; cursor: pointer; text-align: left; - font: 700 .84rem/1.35 "Be Vietnam Pro", system-ui, sans-serif; - color: #ecdcc2; background: rgba(255,255,255,.06); - border: 1px solid rgba(201,162,78,.26); - display: flex; align-items: center; gap: 7px; - transition: background .15s, border-color .15s, transform .12s; -} -.cave-poll-option:active { transform: scale(.98); } -.cave-poll-key { - flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; - display: grid; place-items: center; - background: rgba(201,162,78,.22); color: #ffd76a; - font: 800 .72rem/1 "Be Vietnam Pro", system-ui, sans-serif; -} -.cave-poll-option:hover { - background: rgba(201,162,78,.2); color: #ffe9c6; - border-color: rgba(224,186,104,.5); -} -/* __V137CSS: goi y dap an dung sau khi binh chon — GIONG het QuizDialog - ngoai hang (dap an dung xanh, dap an chon sai do). */ -.cave-poll-option.is-locked { cursor: default; opacity: .92; } -.cave-poll-option.is-locked:hover { - background: rgba(255,255,255,.06); color: #ecdcc2; - border-color: rgba(201,162,78,.26); -} -.cave-poll-option.is-right, -.cave-poll-option.is-right:hover { - background: rgba(60,180,110,.28); color: #eafff2; - border-color: rgba(90,220,140,.85); - box-shadow: inset 0 0 0 1px rgba(120,255,180,.35); -} -.cave-poll-option.is-right .cave-poll-key { background: rgba(90,220,140,.45); color: #eafff2; } -.cave-poll-option.is-wrong, -.cave-poll-option.is-wrong:hover { - background: rgba(200,60,60,.26); color: #ffecec; - border-color: rgba(235,95,95,.85); -} -.cave-poll-option.is-wrong .cave-poll-key { background: rgba(235,95,95,.45); color: #ffecec; } -.cave-poll-result { - margin: 9px 0 0; font: 800 .8rem/1.4 "Be Vietnam Pro", system-ui, sans-serif; - padding: 7px 10px; border-radius: 8px; -} -.cave-poll-result.is-right { color: #b6ffd2; background: rgba(60,180,110,.2); border: 1px solid rgba(90,220,140,.55); } -.cave-poll-result.is-wrong { color: #ffd0d0; background: rgba(200,60,60,.2); border: 1px solid rgba(235,95,95,.55); } - -/* ---- trợ giúp ---- */ -.cave-help-btn { - width: 38px; height: 38px; padding: 0; border-radius: 50%; - cursor: pointer; display: grid; place-items: center; - font: 800 1rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #ffe0a8; background: rgba(24,13,7,.82); - border: 1px solid rgba(201,162,78,.34); - box-shadow: 0 4px 14px rgba(0,0,0,.46); - backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); -} -.cave-help-btn:hover { background: rgba(201,162,78,.24); } -.cave-help-card { - position: absolute; top: 50%; left: 50%; - transform: translate(-50%, -50%); z-index: 70; - width: min(430px, calc(100vw - 32px)); max-height: 84vh; overflow-y: auto; - padding: 20px 22px; border-radius: 16px; - background: linear-gradient(180deg, #25170c, #120a05); - border: 1px solid rgba(201,162,78,.44); - box-shadow: 0 26px 70px rgba(0,0,0,.82); -} -.cave-help-title { - margin: 0 0 13px; font: 900 1.05rem/1.3 Bitter, Georgia, serif; - color: #e6c98f; -} -.cave-help-list { - list-style: none; margin: 0 0 16px; padding: 0; - display: flex; flex-direction: column; gap: 8px; -} -.cave-help-row { - display: flex; align-items: flex-start; gap: 9px; - font: 500 .8rem/1.5 "Be Vietnam Pro", system-ui, sans-serif; - color: #d4c3a8; -} -.cave-help-ok { - margin-top: 4px; padding: 10px 20px; border-radius: 10px; cursor: pointer; - font: 700 .82rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #fff; background: linear-gradient(180deg, #b8352a, #8d2018); - border: 1px solid rgba(255,140,120,.44); - box-shadow: 0 6px 18px rgba(141,32,24,.5); -} -.cave-help-ok:hover { filter: brightness(1.12); } - -/* ---- credits ---- */ -.cave-credits { - position: absolute; top: 50%; left: 50%; - transform: translate(-50%, -50%); z-index: 70; - width: min(430px, calc(100vw - 32px)); max-height: 84vh; overflow-y: auto; - padding: 20px 22px; border-radius: 16px; - background: linear-gradient(180deg, #25170c, #120a05); - border: 1px solid rgba(201,162,78,.44); - box-shadow: 0 26px 70px rgba(0,0,0,.82); -} -.cave-credits-title { - margin: 0 0 12px; font: 900 1.02rem/1.3 Bitter, Georgia, serif; - color: #e6c98f; -} -.cave-credits-body { - font: 500 .8rem/1.6 "Be Vietnam Pro", system-ui, sans-serif; - color: #d4c3a8; -} - -/* ---- mất kết nối ---- */ -.cave-reconnect { - position: absolute; inset: 0; z-index: 80; - display: grid; place-items: center; - background: rgba(8,4,2,.86); - backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); -} -.cave-reconnect-box { - padding: 26px 30px; border-radius: 16px; text-align: center; - background: linear-gradient(180deg, #25170c, #120a05); - border: 1px solid rgba(201,162,78,.4); - box-shadow: 0 22px 60px rgba(0,0,0,.8); -} -.cave-reconnect-title { - margin: 0 0 7px; font: 900 1rem/1.3 Bitter, Georgia, serif; - color: #e6c98f; -} -.cave-reconnect-sub { - margin: 0 0 15px; font: 500 .78rem/1.4 "Be Vietnam Pro", system-ui, sans-serif; - color: #a8967a; -} -.cave-reconnect-spin { - width: 30px; height: 30px; margin: 0 auto; border-radius: 50%; - border: 3px solid rgba(201,162,78,.22); border-top-color: #e0ba68; - animation: v97-spin .85s linear infinite; -} -@keyframes v97-spin { to { transform: rotate(360deg); } } - -/* ---- đấm (mobile) ---- */ -.cave-punch { - position: fixed; right: 20px; bottom: 84px; z-index: 44; - width: 66px; height: 66px; padding: 0; border-radius: 50%; - display: grid; place-items: center; gap: 0; cursor: pointer; - color: #fff5e6; touch-action: manipulation; - background: radial-gradient(circle at 34% 28%, #d0452f, #8d2018 72%); - border: 2px solid rgba(255,190,150,.46); - box-shadow: 0 8px 24px rgba(0,0,0,.66), inset 0 2px 0 rgba(255,255,255,.2); -} -.cave-punch:active { transform: scale(.93); } -.cave-punch-icon { font-size: 1.6rem; line-height: 1; } -.cave-punch-label { - font: 800 .54rem/1 "Be Vietnam Pro", system-ui, sans-serif; - letter-spacing: .08em; text-transform: uppercase; opacity: .92; -} -.cave-punch-flash { - position: absolute; inset: 0; z-index: 75; pointer-events: none; - background: radial-gradient(circle, rgba(255,90,60,.42), transparent 68%); - animation: v97-flash .34s ease-out forwards; -} -@keyframes v97-flash { from { opacity: 1; } to { opacity: 0; } } - -/* ---- joystick (mobile) ---- */ -.cave-stick { - position: fixed; left: 22px; bottom: 24px; z-index: 44; - width: 108px; height: 108px; border-radius: 50%; - background: radial-gradient(circle, rgba(201,162,78,.12), rgba(0,0,0,.34)); - border: 2px solid rgba(201,162,78,.3); - touch-action: none; display: grid; place-items: center; - box-shadow: inset 0 2px 12px rgba(0,0,0,.6); -} -.cave-stick-knob { - width: 46px; height: 46px; border-radius: 50%; - background: radial-gradient(circle at 34% 28%, #e8cf9a, #8a6a2e 74%); - border: 1px solid rgba(255,235,190,.5); - box-shadow: 0 4px 14px rgba(0,0,0,.66), inset 0 1px 0 rgba(255,255,255,.4); - pointer-events: none; -} - -/* ---- điện thoại / teleport ---- */ -.cave-tele-wrap { - position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); - z-index: 44; -} -.cave-tele { - padding: 10px 18px; border-radius: 12px; cursor: pointer; - font: 700 .8rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #ffe6c2; background: rgba(24,13,7,.88); - border: 1px solid rgba(201,162,78,.38); - box-shadow: 0 6px 20px rgba(0,0,0,.56); - backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); -} -.cave-tele:hover { background: rgba(201,162,78,.24); color: #fff3dd; } - -/* ---- ăn mừng / ngắm ---- */ -.cave-celebrate { - position: absolute; inset: 0; z-index: 72; pointer-events: none; - display: grid; place-items: center; - animation: v97-celebrate 1.15s ease-out forwards; -} -.cave-celebrate-key { - font: 900 clamp(2rem, 8vw, 4.4rem)/1 Bitter, Georgia, serif; - color: #ffd479; - text-shadow: 0 0 28px rgba(255,180,60,.9), 0 4px 0 rgba(120,40,10,.85); -} -@keyframes v97-celebrate { - 0% { opacity: 0; transform: scale(.7); } - 22% { opacity: 1; transform: scale(1.06); } - 72% { opacity: 1; transform: scale(1); } - 100% { opacity: 0; transform: scale(1.14); } -} -.cave-crosshair { - position: absolute; top: 50%; left: 50%; - width: 18px; height: 18px; margin: -9px 0 0 -9px; - z-index: 42; pointer-events: none; opacity: .76; - background: - linear-gradient(#e0ba68, #e0ba68) center/2px 100% no-repeat, - linear-gradient(#e0ba68, #e0ba68) center/100% 2px no-repeat; - filter: drop-shadow(0 0 3px rgba(0,0,0,.9)); -} -.cave-net { - position: absolute; top: 8px; right: 10px; z-index: 50; - padding: 3px 8px; border-radius: 7px; - font: 700 .62rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: #ffb4a4; background: rgba(140,30,20,.8); - border: 1px solid rgba(255,140,120,.4); -} - -/* ---- mobile ---- */ -@media (max-width: 640px) { - .cave-bar { padding: max(8px, env(safe-area-inset-top)) 9px 8px; gap: 6px; } - .cave-bar-left, .cave-bar-right { gap: 5px; } - .cave-leave { padding: 6px 10px; font-size: .72rem; } - .cave-room { padding: 6px 9px; } - .cave-room-name { font-size: .7rem; } - .cave-room-meta { font-size: .64rem; } - .cave-sound { padding: 5px 7px; gap: 5px; } - .cave-sound-range { width: 58px; } - .cave-tv { - top: auto; bottom: calc(env(safe-area-inset-bottom) + 100px); - left: 50%; padding: 5px 6px; gap: 4px; - } - .cave-tv-ch { padding: 5px 8px; font-size: .66rem; } - .cave-tv-pop { min-width: 176px; right: -6px; } - .cave-chat { - right: 8px; left: 8px; bottom: calc(env(safe-area-inset-bottom) + 76px); - width: auto; - } - .cave-chat-log { max-height: 40vh; min-height: 108px; } - .cave-chat-toggle, .cave-chat-toggle-btn { - right: max(12px, env(safe-area-inset-right)); - bottom: max(14px, env(safe-area-inset-bottom)); - width: 52px; height: 52px; font-size: 1.24rem; - } - .cave-punch { - right: max(14px, env(safe-area-inset-right)); - bottom: calc(env(safe-area-inset-bottom) + 78px); - width: 60px; height: 60px; - } - .cave-stick { - left: max(14px, env(safe-area-inset-left)); - bottom: calc(env(safe-area-inset-bottom) + 12px); - width: 96px; height: 96px; - } - .cave-stick-knob { width: 42px; height: 42px; } - /* V132: mobile — stick 96px o bottom safe+12 => dinh safe+108. - Poll phai cao hon: safe+136 (du 28px). */ - .cave-poll { left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 136px); width: auto; z-index: 46; } - .cave-tele-wrap { bottom: calc(env(safe-area-inset-bottom) + 12px); } - .cave-help-card, .cave-credits { padding: 17px 16px; } -} -@media (prefers-reduced-motion: reduce) { - .cave-celebrate, .cave-punch-flash, .cave-reconnect-spin { animation: none; } -} -/* ===== hết V97 CAVE UI ===== */ - -/* ===== V132: BANG NHAT KY BANG DA — nut noi + modal ===== */ -.cave-diary-btn { - position: fixed; right: 20px; bottom: 168px; z-index: 47; - width: 56px; height: 56px; border-radius: 999px; padding: 0; - display: grid; place-items: center; font-size: 24px; - background: linear-gradient(180deg, #4a6db8, #2b4680); - color: #fff; border: 2px solid #ffd76a; cursor: pointer; - box-shadow: 0 8px 22px rgba(0,0,0,.55); - touch-action: manipulation; -webkit-tap-highlight-color: transparent; -} -.cave-diary-btn:active { transform: scale(.94); } -.cave-diary-backdrop { - position: fixed; inset: 0; z-index: 60; - background: rgba(6,8,14,.72); backdrop-filter: blur(4px); - display: grid; place-items: end center; - padding: 0 12px calc(16px + env(safe-area-inset-bottom)); -} -.cave-diary-card { - width: min(560px, 100%); border-radius: 16px; - background: linear-gradient(180deg, rgba(34,24,16,.99), rgba(18,12,8,.99)); - border: 1px solid rgba(201,162,78,.45); - box-shadow: 0 20px 50px rgba(0,0,0,.7); - padding: 16px 16px 14px; -} -.cave-diary-head { - display: inline-block; margin: 0 0 8px; padding: 3px 11px; border-radius: 999px; - background: rgba(201,162,78,.18); border: 1px solid rgba(201,162,78,.42); - font: 800 .66rem/1.5 "Be Vietnam Pro", system-ui, sans-serif; - letter-spacing: .04em; color: #ffd76a; -} -.cave-diary-hint { - margin: 0 0 10px; font: 700 .92rem/1.45 "Be Vietnam Pro", system-ui, sans-serif; - color: #ffe9c6; -} -.cave-diary-ta { - width: 100%; box-sizing: border-box; resize: vertical; - border-radius: 11px; padding: 11px 12px; - background: rgba(255,255,255,.06); color: #ecdcc2; - border: 1px solid rgba(201,162,78,.3); - font: 500 .9rem/1.45 "Be Vietnam Pro", system-ui, sans-serif; -} -.cave-diary-ta:focus { outline: none; border-color: rgba(224,186,104,.7); } -.cave-diary-foot { - display: flex; align-items: center; justify-content: space-between; - margin-top: 10px; gap: 10px; -} -.cave-diary-count { - font: 600 .72rem/1 "Be Vietnam Pro", system-ui, sans-serif; - color: rgba(255,215,106,.6); -} -.cave-diary-cancel, .cave-diary-send { - border-radius: 999px; padding: 9px 18px; cursor: pointer; - font: 800 .82rem/1 "Be Vietnam Pro", system-ui, sans-serif; - touch-action: manipulation; -} -.cave-diary-cancel { - background: rgba(255,255,255,.07); color: #ecdcc2; - border: 1px solid rgba(201,162,78,.28); -} -.cave-diary-send { - background: linear-gradient(180deg, #c8102e, #8a0a1e); color: #fff; - border: 2px solid #ffd76a; -} -.cave-diary-send:disabled { opacity: .45; cursor: not-allowed; } -@media (max-width: 720px) { - .cave-diary-btn { right: 14px; bottom: calc(env(safe-area-inset-bottom) + 174px); width: 50px; height: 50px; font-size: 21px; } -} -/* ===== het V132 ===== */ - -/* ===== V128: NANG HOP CHAT LEN TREN NUT TOGGLE ===== */ -/* Van de (do bang hinh hoc, khong doan): - .cave-chat-toggle right 18-76px / bottom 98-156px (V83 override, 58px) - .cave-chat-send right 24-62px / bottom 91-126px - (panel .cave-chat bottom 82px + form padding 9px => nut Gui tu 91; - cao ~35px => toi 126; right 14+10=24; rong 38 => toi 62) - => HAI HINH CHU NHAT GIAO NHAU => nut Gui bi nut toggle de len. - FIX: giu nut toggle o goc phai-duoi (dung thoi quen nguoi dung, khong - dung vao joystick ben trai), NANG hop chat len tren no. - toggle top = 98 + 58 = 156 => panel bottom = 160 (chua 4px khe) - Mobile (media <=640px): toggle bottom = safe+80, cao 52 => top = safe+132 - => panel bottom = safe + 140. - Truoc day panel o bottom 82 (desktop) / safe+76 (mobile) — dung de len. */ -.cave-chat { - bottom: 160px !important; -} -@media (width <= 640px) { - .cave-chat { - right: 8px !important; left: 8px !important; - width: auto !important; - bottom: calc(env(safe-area-inset-bottom) + 140px) !important; - } - .cave-chat-log { max-height: 34vh; } -} - - -/* ===== V128: BO .cave-punch ===== */ -/* Nguoi dung khong muon nut noi "Dam". An o moi kich thuoc man hinh, - moi trang thai. Phim tat F van hoat dong (xu ly trong JS). */ -.cave-punch { display: none !important; visibility: hidden !important; } - - -/* __V139EMOJI: hop emoji dong trong DiaryComposer */ -.cave-emoji-toggle { - width: 40px; height: 40px; flex: 0 0 auto; - border-radius: 12px; border: 1px solid rgba(255,225,150,.28); - background: rgba(28,22,14,.55); color: #ffe9c2; - font-size: 21px; line-height: 1; cursor: pointer; - display: inline-flex; align-items: center; justify-content: center; - transition: transform .12s ease, background .16s ease, border-color .16s ease; -} -.cave-emoji-toggle:hover { background: rgba(60,46,24,.72); border-color: rgba(255,215,106,.55); } -.cave-emoji-toggle.is-on { - background: linear-gradient(180deg, rgba(255,215,106,.34), rgba(120,84,20,.45)); - border-color: rgba(255,215,106,.78); - box-shadow: 0 0 12px rgba(255,205,90,.45); -} -.cave-emoji-toggle:active { transform: scale(.93); } - -.cave-emoji-box { - margin: 10px 0 4px; - padding: 10px 10px 6px; - border-radius: 14px; - border: 1px solid rgba(255,225,150,.22); - background: linear-gradient(180deg, rgba(38,30,20,.92), rgba(20,16,11,.92)); - box-shadow: inset 0 1px 0 rgba(255,240,200,.14), 0 8px 22px rgba(0,0,0,.45); - max-height: 232px; overflow-y: auto; - animation: cave-emoji-in .16s ease-out; -} -@keyframes cave-emoji-in { - from { opacity: 0; transform: translateY(6px) scale(.97); } - to { opacity: 1; transform: none; } -} -.cave-emoji-row { - display: flex; gap: 4px; justify-content: space-between; - margin-bottom: 4px; -} -.cave-emoji { - flex: 1 1 0; min-width: 0; - aspect-ratio: 1 / 1; - border: 0; border-radius: 10px; - background: rgba(255,240,210,.05); - font-size: 22px; line-height: 1; cursor: pointer; - display: inline-flex; align-items: center; justify-content: center; - transition: transform .12s ease, background .14s ease, box-shadow .14s ease; -} -.cave-emoji:hover { - background: rgba(255,215,106,.20); - box-shadow: 0 0 10px rgba(255,205,90,.35); - transform: translateY(-2px) scale(1.14); -} -.cave-emoji:active { - transform: scale(1.28) rotate(-6deg); - background: rgba(255,215,106,.36); -} -@media (max-width: 620px) { - .cave-emoji { font-size: 19px; border-radius: 8px; } - .cave-emoji-box { max-height: 196px; padding: 8px 8px 4px; } -} +.cave-talk-hint{z-index:4;left:50%;bottom:max(184px, calc(env(safe-area-inset-bottom) + 172px));color:#fff6ec;white-space:nowrap;pointer-events:none;background:#080e14bf;border:1px solid #6fd3ffb3;border-radius:999px;align-items:center;gap:8px;margin:0;padding:7px 14px;font-size:.9375rem;font-weight:600;display:flex;position:absolute;transform:translate(-50%)}.cave-talk-hint kbd,.talk-btn kbd{border:1px solid #fff9;border-radius:5px;padding:1px 7px;font:700 .8125rem/1.3 Be Vietnam Pro,system-ui,sans-serif}.cave-talk-hint strong{color:#a8e4ff;text-overflow:ellipsis;max-width:220px;overflow:hidden}.cave-talk{z-index:5;right:calc(max(16px, env(safe-area-inset-right)) + 84px);bottom:max(80px, calc(env(safe-area-inset-bottom) + 68px));color:#fff6ec;cursor:pointer;touch-action:manipulation;background:#2b7fd8;border:0;border-radius:50%;align-content:center;place-items:center;width:72px;height:72px;padding:0 4px;display:grid;position:absolute;box-shadow:0 0 0 2px #fff6ec,0 0 16px 2px #6fd3ff99}.cave-talk:active{transform:scale(.92)}.cave-talk-icon{font-size:1.5rem;line-height:1}.cave-talk-label{text-overflow:ellipsis;white-space:nowrap;max-width:64px;font:700 .6875rem/1.3 Be Vietnam Pro,system-ui,sans-serif;overflow:hidden}.cave-talk[data-wait]{background:#140c099e;box-shadow:0 0 0 2px #fff6ec47}.cave-talk.is-duel{bottom:max(164px, calc(env(safe-area-inset-bottom) + 152px));background:#c8102e;box-shadow:0 0 0 2px #fff6ec,0 0 16px 2px #ff5c708c}.cave-talk-who{color:#fff6ecbf;font-weight:500}.cave-talk-act{border-left:1px solid #fff6ec33;align-items:center;gap:6px;padding-left:12px;display:inline-flex}@media (width<=640px){.cave-talk{bottom:max(116px, calc(env(safe-area-inset-bottom) + 104px))}.cave-talk.is-duel{bottom:max(200px, calc(env(safe-area-inset-bottom) + 188px))}}.talk-btn{appearance:none;color:#fff6ec;white-space:nowrap;cursor:pointer;touch-action:manipulation;background:#f3e7d824;border:0;border-radius:999px;justify-content:center;align-items:center;gap:8px;padding:8px 16px;font:700 .9375rem/1.2 Be Vietnam Pro,system-ui,sans-serif;display:inline-flex}.talk-btn:hover{background:#f3e7d838}.talk-btn:focus-visible,.talk-form input:focus-visible{outline:2px solid var(--hm-torch);outline-offset:2px}.talk-btn.is-ok{color:#07150c;background:#3fb36b}.talk-btn.is-ok kbd{border-color:#07150c80}.talk-btn.is-danger{background:#c8102e}.talk-btn:disabled{opacity:.45;cursor:default}.talk-bar{background:#f3e7d826;border-radius:3px;height:3px;display:block;overflow:hidden}.talk-bar i{transform-origin:0;background:#f3e7d8;height:100%;animation:linear forwards talk-countdown;display:block}@keyframes talk-countdown{to{transform:scaleX(0)}}.talk-asking{z-index:6;left:50%;bottom:max(184px, calc(env(safe-area-inset-bottom) + 172px));color:#fff6ec;background:#0c0806c7;border:1px solid #f3e7d82e;border-radius:14px;gap:8px;width:min(480px,100vw - 32px);padding:10px 14px 12px;display:grid;position:absolute;transform:translate(-50%)}.talk-asking-row{justify-content:space-between;align-items:center;gap:12px;font-size:.9375rem;display:flex}.talk-invite{z-index:8;left:50%;top:max(84px, calc(env(safe-area-inset-top) + 72px));color:#fff6ec;background:#140d0ae6;border:1px solid #f3e7d840;border-radius:16px;gap:10px;width:min(420px,100vw - 32px);padding:14px 16px 12px;animation:.22s ease-out talk-in;display:grid;position:absolute;transform:translate(-50%);box-shadow:0 12px 36px #00000080}.talk-invite-who{align-items:center;gap:12px;display:flex}.talk-invite-who strong{font-size:1.0625rem}.talk-invite-who p{color:#f3e7d8b8;margin:2px 0 0;font-size:.8125rem}.talk-invite-acts{gap:8px;display:flex}.talk-invite-acts .talk-btn{flex:1}.talk-face{background:#f1c9a5;border:3px solid #c8102e;border-radius:50%;flex:none;width:40px;height:40px}.talk-toast{z-index:7;left:50%;bottom:max(240px, calc(env(safe-area-inset-bottom) + 228px));color:#fff6ec;pointer-events:none;background:#0c0806d1;border:1px solid #f3e7d82e;border-radius:999px;max-width:calc(100vw - 32px);margin:0;padding:8px 16px;font-size:.9375rem;font-weight:600;position:absolute;transform:translate(-50%)}@media (width<=640px){.talk-asking,.talk-toast{bottom:max(370px, calc(env(safe-area-inset-bottom) + 358px))}}.talk-overlay{z-index:1000;padding:max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));-webkit-backdrop-filter:blur(8px);color:#fff6ec;background:#0a0604d1;place-items:center;font-family:Be Vietnam Pro,system-ui,sans-serif;animation:.18s ease-out talk-fade;display:grid;position:fixed;inset:0}.talk-box{background:#18100cf7;border:1px solid #f3e7d833;border-radius:20px;grid-template-rows:auto auto 1fr auto;gap:10px;width:min(680px,100%);height:min(760px,100%);min-height:0;padding:16px 18px;display:grid}.talk-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.talk-who{align-items:center;gap:12px;min-width:0;display:flex}.talk-who strong{text-overflow:ellipsis;white-space:nowrap;font-size:1.125rem;display:block;overflow:hidden}.talk-who span{color:#f3e7d8b3;font-size:.8125rem}.talk-state{text-align:center;color:#f3e7d8b3;border-block:1px solid #f3e7d824;margin:0;padding:6px 0;font-size:.8125rem}.talk-msgs{overscroll-behavior:contain;flex-direction:column;gap:6px;min-height:0;margin:0;padding:4px 2px;list-style:none;display:flex;overflow-y:auto}.talk-msgs>:first-child{margin-top:auto}.talk-msg{overflow-wrap:anywhere;white-space:pre-wrap;background:#f3e7d81f;border-radius:16px;align-self:flex-start;max-width:78%;padding:7px 12px;line-height:1.4}.talk-msg.is-mine{background:#c8102e;align-self:flex-end}.talk-msg.is-pending{opacity:.7}.talk-msg.is-failed{opacity:.55}.talk-fail{font-size:.8125rem}.talk-sys{text-align:center;color:#f3e7d899;align-self:center;font-size:.8125rem}.talk-form{gap:8px;display:flex}.talk-form input{color:#fff6ec;background:#00000073;border:1px solid #f3e7d833;border-radius:12px;flex:1;min-width:0;padding:10px 14px;font:400 1rem/1.3 Be Vietnam Pro,system-ui,sans-serif}.talk-form input::placeholder{color:#f3e7d880}.talk-btn.is-send{background:#c8102e}.talk-close{justify-self:center;padding:10px 22px}.talk-confirm-dim{background:#00000080;place-items:center;padding:16px;display:grid;position:absolute;inset:0}.talk-confirm-dim.is-fixed{z-index:1000;position:fixed}.talk-confirm{text-align:center;background:#2a1d16;border:1px solid #f3e7d84d;border-radius:16px;gap:10px;width:min(380px,100%);padding:18px 18px 16px;display:grid;box-shadow:0 16px 48px #000000b3}.talk-confirm strong{font-size:1.125rem}.talk-confirm p{color:#f3e7d8b8;margin:0;font-size:.875rem}.talk-confirm-acts{gap:8px;margin-top:4px;display:flex}.talk-confirm-acts .talk-btn{flex:1}@media (width<=640px){.talk-overlay{padding:0}.talk-box{width:100%;height:100%;padding:max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));border:0;border-radius:0}}@keyframes talk-fade{0%{opacity:0}}@keyframes talk-in{0%{opacity:0;transform:translate(-50%,-8px)}}@media (prefers-reduced-motion:reduce){.talk-overlay,.talk-invite{animation:none}.talk-bar i{animation-name:none}}.challenge{z-index:9;left:50%;bottom:max(232px, calc(env(safe-area-inset-bottom) + 220px));width:min(460px,100vw - 32px);color:var(--hm-chalk);background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel));box-shadow:inset 0 0 0 2px var(--hm-gilt), inset 0 0 0 5px var(--hm-enamel), inset 0 0 0 6px #ecd08c73, var(--hm-drop);border-radius:12px;gap:8px;padding:10px 12px;animation:.18s ease-out challenge-in;display:grid;position:absolute;transform:translate(-50%)}.challenge.is-sheet{z-index:60;left:max(10px, env(safe-area-inset-left));right:max(10px, env(safe-area-inset-right));bottom:max(10px, env(safe-area-inset-bottom));border-radius:16px;width:auto;padding:14px;animation-name:challenge-up;position:fixed;transform:none}@keyframes challenge-in{0%{opacity:0;transform:translate(-50%,8px)}}@keyframes challenge-up{0%{opacity:0;transform:translateY(40px)}}.challenge-head{justify-content:space-between;align-items:baseline;gap:8px;display:flex}.challenge-head strong{font:900 1rem/1.2 var(--hm-f-carve);text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.challenge-head small{color:var(--hm-gilt-hi);font-size:.75rem;font-weight:600}.challenge-games{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;display:grid}.is-sheet .challenge-games{grid-template-columns:minmax(0,1fr)}.challenge-game{appearance:none;text-align:left;color:var(--hm-chalk);font:inherit;cursor:pointer;background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-deep));background-blend-mode:overlay, normal;touch-action:manipulation;border:0;border-radius:10px;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:2px 8px;padding:9px 10px;display:grid;position:relative;box-shadow:inset 0 0 0 1px #ecd08c59}.is-sheet .challenge-game{padding:13px 12px}.challenge-game:hover,.challenge-game.is-last{box-shadow:inset 0 0 0 2px var(--hm-gilt-hi)}.challenge-game:focus-visible,.challenge-close:focus-visible{outline:2px solid var(--hm-torch);outline-offset:2px}.challenge-game:active{transform:scale(.97)}.challenge-game kbd{position:absolute;top:-8px;left:-6px}.challenge-icon{grid-row:span 2;font-size:1.5rem;line-height:1}.challenge-game b{font:800 .875rem/1.2 var(--hm-f-carve)}.challenge-game small{color:var(--hm-chalk-dim);font-size:.6875rem;line-height:1.3}.challenge-foot{text-align:center;color:#efe9ddd1;margin:0;font-size:.75rem}.challenge-close{justify-self:center}@media (prefers-reduced-motion:reduce){.challenge{animation:none}}.voice-prompt{border-color:#f2c14ebf}.voice-hud{z-index:3;pointer-events:none;color:#fff6ec;font-family:Be Vietnam Pro,system-ui,sans-serif;position:absolute;inset:0}.voice-hud>*{pointer-events:auto}.voice-top{top:max(12px, env(safe-area-inset-top));pointer-events:none;align-items:center;gap:8px;max-width:calc(100vw - 32px);display:flex;position:absolute;left:50%;transform:translate(-50%)}.voice-top>*{pointer-events:auto}.voice-title{white-space:nowrap;background:#0e0a08b3;border:1px solid #f2c14e73;border-radius:999px;padding:5px 12px;font-size:.875rem;font-weight:700}.voice-chip{white-space:nowrap;background:#0e0a08b3;border:1px solid #ffffff24;border-radius:999px;align-items:center;gap:6px;padding:4px 10px;font-size:.8125rem;font-weight:600;display:inline-flex}.voice-err{text-overflow:ellipsis;white-space:nowrap;color:#f3e7d899;max-width:220px;font-size:.6875rem;font-weight:400;overflow:hidden}.voice-chip.is-bad{border-color:#ef5a4c}.voice-chip i{background:#4cc38a;border-radius:50%;width:8px;height:8px}.voice-chip i.is-warn{background:#e8b04a;animation:1s infinite voice-blink}.voice-chip i.is-bad{background:#ef5a4c}@keyframes voice-blink{50%{opacity:.25}}.voice-speaking{left:max(12px, env(safe-area-inset-left));background:#0e0a08a8;border:1px solid #ffffff1a;border-radius:12px;width:220px;max-width:46vw;padding:8px 10px;font-size:.8125rem;position:absolute;top:110px}.voice-speaking-h{letter-spacing:.04em;text-transform:uppercase;color:#f3e7d8a6;margin-bottom:4px;font-size:.6875rem;font-weight:700}.voice-row{align-items:center;gap:8px;min-width:0;padding:2px 0;display:flex}.voice-row.is-out{color:#f3e7d873}.voice-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.voice-dim{color:#f3e7d880;margin-top:2px;font-size:.75rem}.voice-bars{flex:none;align-items:flex-end;gap:2px;height:12px;display:inline-flex}.voice-bars b{background:#4cc38a;border-radius:1px;width:3px}.voice-bars.is-muted b{background:#f3e7d859}.voice-onair{left:50%;bottom:calc(max(16px, env(safe-area-inset-bottom)) + 66px);white-space:nowrap;background:#da291c;border-radius:999px;padding:4px 12px;font-size:.8125rem;font-weight:700;position:absolute;transform:translate(-50%)}.voice-bar{left:50%;bottom:max(16px, env(safe-area-inset-bottom));background:#0e0a08db;border:1px solid #ffffff1f;border-radius:16px;align-items:center;gap:8px;max-width:calc(100vw - 24px);padding:8px;display:flex;position:absolute;transform:translate(-50%)}.voice-btn{appearance:none;color:inherit;white-space:nowrap;cursor:pointer;background:#f3e7d81f;border:1px solid #ffffff14;border-radius:11px;justify-content:center;align-items:center;gap:4px;padding:8px 12px;font:600 .8125rem/1.2 Be Vietnam Pro,system-ui,sans-serif;display:inline-flex}.voice-btn:hover{background:#f3e7d833}.voice-btn:focus-visible{outline:2px solid var(--hm-torch,#f2c14e);outline-offset:2px}.voice-btn:disabled{opacity:.5;cursor:default}.voice-btn.is-static{cursor:default}.voice-btn.is-static:hover{background:#f3e7d81f}.voice-btn.is-red{color:#fff;background:#c8102e;border-color:#c8102e}.voice-btn.is-small{padding:2px 9px;font-size:.75rem}.voice-ptt{-webkit-user-select:none;user-select:none;touch-action:none;background:#3b2a20;border-color:#6b4a35;min-width:150px}.voice-ptt.is-on{color:#fff;background:#da291c;border-color:#da291c;box-shadow:0 0 0 4px #da291c4d}.voice-ptt.is-off{color:#ffb4a8;background:#4a1d1a;border-color:#8a2a22}.voice-ptt.is-denied{color:#f3e7d899}.voice-toast{z-index:8;left:50%;top:calc(max(12px, env(safe-area-inset-top)) + 44px);color:#fff6ec;text-align:center;background:#2a1d16;border:1px solid #f3e7d840;border-radius:10px;max-width:calc(100vw - 32px);padding:6px 12px;font-size:.8125rem;position:absolute;transform:translate(-50%)}.voice-rejoin{text-align:center;background:#0e0a08db;border:1px solid #f2c14e;border-radius:16px;justify-items:center;gap:10px;max-width:calc(100vw - 48px);padding:16px 18px;display:grid;position:absolute;top:42%;left:50%;transform:translate(-50%,-50%)}.voice-mic-help{z-index:9;background:#2a1d16;border:1px solid #f2c14e;border-radius:16px;gap:8px;width:min(420px,100vw - 32px);max-height:calc(100% - 180px);padding:16px 18px;display:grid;position:absolute;top:46%;left:50%;overflow:auto;transform:translate(-50%,-50%);box-shadow:0 16px 48px #0009}.voice-mic-help strong{font-size:1.0625rem}.voice-mic-help p{margin:0}.voice-mic-help ol{gap:6px;margin:0;padding-left:1.2em;font-size:.875rem;line-height:1.45;display:grid}.voice-mic-help-acts{flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:4px;display:flex}.voice-grid{z-index:-1;padding:calc(max(12px, env(safe-area-inset-top)) + 100px) 16px 96px;background:radial-gradient(120% 90% at 50% 0,#2b2019 0%,#140f0c 70%);grid-template-columns:repeat(auto-fill,minmax(116px,1fr));align-content:start;gap:10px;display:grid;position:absolute;inset:0;overflow:auto}.voice-hud.is-grid .voice-speaking{display:none}.voice-tile{aspect-ratio:4/3;background:#221a15;border:2px solid #33291f;border-radius:12px;flex-direction:column;justify-content:center;align-items:center;gap:6px;min-width:0;display:flex}.voice-tile.is-talk{border-color:#4cc38a;box-shadow:0 0 0 3px #4cc38a40}.voice-av{color:#fff;background:#da291c;border-radius:50%;place-items:center;width:42px;height:42px;font-weight:800;display:grid}.voice-tile-name{text-overflow:ellipsis;white-space:nowrap;max-width:92%;font-size:.8125rem;overflow:hidden}.voice-paused{text-align:center;color:#f3e7d873;grid-column:1/-1;font-size:.75rem}@media (width>=900px){.voice-grid{padding-right:330px}}@media (width<=640px){.voice-bar{left:max(12px, env(safe-area-inset-left));right:max(12px, env(safe-area-inset-right));justify-content:center;gap:6px;padding:6px;transform:none}.voice-btn-txt{display:none}.voice-ptt{right:max(12px, env(safe-area-inset-right));bottom:calc(max(16px, env(safe-area-inset-bottom)) + 76px);border-radius:50%;width:72px;min-width:0;height:72px;font-size:1.5rem;position:fixed}.voice-top{top:auto;bottom:calc(max(16px, env(safe-area-inset-bottom)) + 66px);left:max(12px, env(safe-area-inset-left));flex-wrap:wrap;max-width:none;right:96px;transform:none}.voice-title,.voice-chip{font-size:.75rem}.voice-speaking{top:auto;bottom:calc(max(16px, env(safe-area-inset-bottom)) + 132px);left:max(12px, env(safe-area-inset-left));width:auto;max-width:none;padding:6px 9px;right:96px}.voice-toast{top:auto;bottom:calc(max(16px, env(safe-area-inset-bottom)) + 224px);left:max(12px, env(safe-area-inset-left));max-width:none;right:96px;transform:none}.voice-onair{bottom:calc(max(16px, env(safe-area-inset-bottom)) + 156px);left:auto;right:max(12px, env(safe-area-inset-right));transform:none}.voice-grid{grid-template-columns:repeat(3,minmax(0,1fr));padding-bottom:230px}}@media (prefers-reduced-motion:reduce){.voice-chip i.is-warn{animation:none}}.cave[data-activity=voice] .cave-bar-left{z-index:4}.voice-btn.is-active{background:#f2c14e47;border-color:#f2c14e99}.voice-icon-btn{appearance:none;width:32px;height:32px;color:inherit;cursor:pointer;background:#f3e7d81a;border:1px solid #ffffff1a;border-radius:9px;flex:none;place-items:center;font-size:.9375rem;line-height:1;display:inline-grid}.voice-icon-btn:hover{background:#f3e7d833}.voice-icon-btn:focus-visible{outline:2px solid var(--hm-torch,#f2c14e);outline-offset:1px}.voice-icon-btn:disabled{opacity:.35;cursor:default}.voice-icon-btn.is-on{background:#c8102e59;border-color:#c8102eb3}.voice-row .voice-icon-btn{width:26px;height:26px;margin-left:auto;font-size:.8125rem}.voice-people{z-index:7;right:max(12px, env(safe-area-inset-right));bottom:calc(max(16px, env(safe-area-inset-bottom)) + 70px);background:#2a1d16;border:1px solid #f2c14e8c;border-radius:16px;flex-direction:column;width:min(340px,100vw - 24px);max-height:min(60vh,100% - 200px);display:flex;position:absolute;overflow:hidden;box-shadow:0 16px 48px #0000008c}.voice-people-h{justify-content:space-between;align-items:center;gap:8px;padding:10px 10px 4px 14px;font-size:.9375rem;display:flex}.voice-people-note{border-bottom:1px solid #ffffff14;margin:0;padding:0 14px 8px;line-height:1.4}.voice-people-list{overscroll-behavior:contain;margin:0;padding:6px 8px 10px;list-style:none;overflow-y:auto}.voice-person{border-radius:10px;align-items:center;gap:8px;min-width:0;padding:5px 6px;font-size:.875rem;display:flex}.voice-person:hover{background:#f3e7d80f}.voice-person .voice-name{flex:1}.voice-person.is-muted .voice-name{opacity:.55;-webkit-text-decoration:line-through #f3e7d859;text-decoration:line-through #f3e7d859}.voice-av.is-small{flex:none;width:28px;height:28px;font-size:.6875rem}.voice-mic{white-space:nowrap;color:#b5a491;background:#f3e7d80f;border-radius:999px;flex:none;align-items:center;gap:4px;padding:1px 8px;font-size:.75rem;font-weight:600;display:inline-flex}.voice-mic.is-talk{color:#8fe388;background:#4cc38a29}.voice-mic.is-off{color:#ff8a7a;background:#c8102e2e}.voice-mic-ic{display:inline-block;position:relative}.voice-mic.is-off .voice-mic-ic:after{content:"";background:#ff5a48;border-radius:1px;height:2px;position:absolute;top:50%;left:-2px;right:-2px;transform:rotate(-45deg)}.voice-mic.is-none{color:#d9c8b4}.voice-mic.is-wait{opacity:.75}.voice-tile{position:relative}.voice-tile.is-off .voice-av{opacity:.55}.voice-tile-mic{position:absolute;top:6px;right:6px}.voice-votes{font-variant-numeric:tabular-nums;background:#c8102e4d;border-radius:999px;flex:none;padding:1px 7px;font-weight:700}@media (width<=640px){.voice-people{left:max(12px, env(safe-area-inset-left));right:max(12px, env(safe-area-inset-right));width:auto;bottom:calc(max(16px, env(safe-area-inset-bottom)) + 62px);z-index:9;max-height:min(58vh,100% - 150px)}.voice-icon-btn{width:38px;height:38px}}.voice-vote{z-index:70;left:50%;top:calc(max(12px, env(safe-area-inset-top)) + 64px);background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-deep));background-blend-mode:overlay, normal;border:1px solid var(--hm-red);width:min(420px,100vw - 32px);box-shadow:var(--hm-drop);color:var(--hm-chalk);border-radius:12px;gap:8px;padding:14px 16px;font-size:.875rem;line-height:1.45;display:grid;position:fixed;transform:translate(-50%)}.voice-vote strong{font-size:.95rem}.voice-vote p{color:var(--hm-chalk-dim);margin:0}.voice-vote-acts{justify-content:flex-end;gap:8px;display:flex}.tug-toast{z-index:8;left:50%;top:calc(max(12px, env(safe-area-inset-top)) + 44px);background:var(--hm-slab-solid);border:1px solid color-mix(in srgb, var(--hm-chalk) 25%, transparent);max-width:calc(100vw - 32px);color:var(--hm-chalk);pointer-events:none;border-radius:10px;padding:6px 12px;font-size:.8125rem;position:absolute;transform:translate(-50%)}.tug-pill{z-index:7;left:50%;top:calc(max(12px, env(safe-area-inset-top)) + 48px);border:1px solid color-mix(in srgb, var(--hm-gilt-hi) 70%, transparent);background:color-mix(in srgb, var(--hm-night) 85%, transparent);box-shadow:0 6px 18px -8px var(--hm-shade);color:var(--hm-chalk);white-space:nowrap;border-radius:999px;align-items:center;gap:8px;padding:4px 4px 4px 12px;font-size:.8125rem;font-weight:600;display:flex;position:absolute;transform:translate(-50%)}.tug-pill b{font-family:var(--hm-f-carve);color:var(--hm-gilt-hi)}.tug-pill small{color:color-mix(in srgb, var(--hm-chalk) 60%, transparent)}.tug-pill-key kbd{margin-right:3px}.tug-pill-x{appearance:none;background:color-mix(in srgb, var(--hm-chalk) 10%, transparent);width:26px;height:26px;color:var(--hm-chalk);cursor:pointer;border:0;border-radius:50%;font-size:.75rem}.tug-pill-x:focus-visible{outline:2px solid var(--hm-torch)}@media (width<=700px){.tug-pill{top:calc(max(12px, env(safe-area-inset-top)) + 96px)}.tug-toast{top:auto;bottom:calc(env(safe-area-inset-bottom) + 210px)}}.cave[data-activity=tug] .cave-bar,.cave[data-activity=tug] .cave-chat{display:none}body:has(.cave[data-activity=tug]) .fps-badge{display:none}.tug{z-index:900;pointer-events:none;color:var(--hm-chalk);font-family:var(--hm-f-body);-webkit-user-select:none;user-select:none;position:fixed;inset:0;container-type:inline-size}.tug>*{pointer-events:auto}.tug-top{padding:max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));background:linear-gradient(180deg, color-mix(in srgb, var(--hm-night) 85%, transparent), color-mix(in srgb, var(--hm-night) 50%, transparent) 70%, transparent);grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:6px 10px;display:grid;position:absolute;top:0;left:0;right:0}.tug-team{gap:1px;min-width:0;display:grid}.tug-team b{font:900 clamp(.9rem, 2.4cqi, 1.15rem) / 1.1 var(--hm-f-carve)}.tug-team b small{font:600 .7rem var(--hm-f-body);color:var(--hm-gilt-hi)}.tug-team>small{color:color-mix(in srgb, var(--hm-chalk) 72%, transparent);white-space:nowrap;text-overflow:ellipsis;font-size:clamp(.66rem,1.6cqi,.8rem);overflow:hidden}.tug-team .is-out{opacity:.6;text-decoration:line-through}.tug-team.is-red b{color:var(--hm-team-red)}.tug-team.is-white{text-align:right}.tug-team.is-white b{color:var(--hm-team-white)}.tug-timer{font:900 clamp(1.4rem, 4.4cqi, 2.2rem) / 1 var(--hm-f-carve);font-variant-numeric:tabular-nums;background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel));border:2px solid var(--hm-gilt);text-align:center;border-top:0;border-radius:0 0 9px 9px;min-width:3.6em;padding:3px 14px 5px}.tug-timer small{font:700 .58rem var(--hm-f-body);color:var(--hm-gilt-hi);letter-spacing:.04em;display:block}.tug-timer.is-sprint{border-color:var(--hm-bad);animation:.45s ease-in-out infinite alternate tug-thump}@keyframes tug-thump{to{transform:scale(1.07)}}.tug-bar{border:2px solid color-mix(in srgb, var(--hm-gilt-hi) 55%, transparent);background:linear-gradient(90deg, var(--hm-red) 0 8%, var(--hm-slab-hi) 8% 92%, var(--hm-team-white) 92%);border-radius:99px;grid-column:1/-1;height:14px;position:relative}.tug-bar:after{content:"";background:color-mix(in srgb, var(--hm-chalk) 60%, transparent);width:2px;margin-left:-1px;position:absolute;top:-4px;bottom:-4px;left:50%}.tug-bar i{background:linear-gradient(135deg, var(--hm-chalk) 0 50%, var(--hm-red) 50%);border:2px solid var(--hm-gilt-hi);width:18px;height:18px;box-shadow:0 0 10px color-mix(in srgb, var(--hm-shade) 60%, transparent);z-index:1;border-radius:3px;margin:-9px 0 0 -9px;position:absolute;top:50%;left:50%;transform:rotate(45deg)}.tug-count{font:900 clamp(2.4rem, 10cqi, 5rem) / 1 var(--hm-f-carve);color:var(--hm-gilt-hi);text-shadow:0 4px 0 color-mix(in srgb, var(--hm-shade) 55%, transparent);pointer-events:none;position:absolute;top:38%;left:50%;transform:translate(-50%,-50%)}.tug-count.is-go{color:var(--hm-bad)}.tug-ctrl{padding:18px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));background:linear-gradient(180deg, transparent, color-mix(in srgb, var(--hm-night) 88%, transparent) 35%);grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;display:grid;position:absolute;bottom:0;left:0;right:0}.tug-meter-box{justify-self:center;gap:5px;width:100%;min-width:0;max-width:760px;display:grid}.tug-meter-top{align-items:center;gap:8px;font-size:clamp(.7rem,1.8cqi,.85rem);font-weight:700;display:flex}.tug-combo{color:var(--hm-gilt-hi)}.tug-mate{color:color-mix(in srgb, var(--hm-chalk) 65%, transparent);white-space:nowrap;text-overflow:ellipsis;min-width:0;margin-left:auto;overflow:hidden}.tug-meter{background:var(--hm-slab-solid);height:clamp(28px,5.5cqi,40px);box-shadow:inset 0 0 0 2px var(--hm-gilt), inset 0 4px 10px color-mix(in srgb, var(--hm-shade) 60%, transparent);border-radius:10px;position:relative;overflow:hidden}.tug-meter.is-slip{filter:grayscale()brightness(.6)}.tug-zone{background:color-mix(in srgb, var(--hm-ok) 55%, transparent);box-shadow:inset 0 0 0 2px var(--hm-ok);transition:left .18s ease-out;position:absolute;top:0;bottom:0}.tug-zone b{background:color-mix(in srgb, var(--hm-perfect) 88%, transparent);position:absolute;top:0;bottom:0;left:50%;transform:translate(-50%)}.tug-needle{background:var(--hm-chalk);width:5px;box-shadow:0 0 10px var(--hm-chalk);border-radius:3px;margin-left:-2.5px;position:absolute;top:-3px;bottom:-3px}.tug-fb{text-align:center;min-height:1.3em;font:900 clamp(.85rem, 2.2cqi, 1.05rem) var(--hm-f-carve);margin:0}.tug-fb.is-perfect{color:var(--hm-perfect)}.tug-fb.is-good{color:var(--hm-ok)}.tug-fb.is-miss,.tug-fb.is-warn{color:var(--hm-bad)}.tug-fb.is-sync{color:var(--hm-torch)}.tug-pull{appearance:none;cursor:pointer;color:var(--hm-chalk);font:900 clamp(1rem, 2.8cqi, 1.35rem) / 1 var(--hm-f-carve);aspect-ratio:1;background:radial-gradient(circle at 50% 35%, var(--hm-red-hi), var(--hm-red-deep) 70%);width:clamp(88px,12cqi,120px);box-shadow:inset 0 0 0 3px var(--hm-gilt), 0 5px 0 var(--hm-enamel-deep), 0 8px 20px color-mix(in srgb, var(--hm-shade) 50%, transparent);touch-action:manipulation;border:0;border-radius:50%;place-content:center;gap:4px;display:grid}.tug-pull small{font:700 .62rem var(--hm-f-body);color:var(--hm-gilt-hi)}.tug-pull:active{box-shadow:inset 0 0 0 3px var(--hm-gilt-hi), 0 2px 0 var(--hm-enamel-deep);transform:translateY(3px)}.tug-pull:focus-visible{outline:3px solid var(--hm-torch);outline-offset:3px}.tug-mute{align-self:end}.tug.is-touch .tug-ctrl{grid-template-columns:minmax(0,1fr) auto}.tug.is-touch .tug-pull{width:120px;font-size:1.4rem}@container (width<=520px){.tug-ctrl{grid-template-columns:minmax(0,1fr) auto}.tug-meter-box{grid-column:1/-1}.tug-pull{justify-self:center}}.tug-card-wrap{background:color-mix(in srgb, var(--hm-night) 45%, transparent);place-items:center;padding:16px;display:grid;position:absolute;inset:0;overflow:auto}.tug-card{text-align:center;background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel));width:min(560px,100%);box-shadow:inset 0 0 0 2px var(--hm-gilt), inset 0 0 0 5px var(--hm-enamel), inset 0 0 0 6px var(--hm-gilt), 0 14px 40px color-mix(in srgb, var(--hm-shade) 60%, transparent);border-radius:14px;justify-items:center;gap:10px;padding:16px;display:grid}.tug-card h2{font:900 clamp(1.1rem, 3.6cqi, 1.6rem) / 1.15 var(--hm-f-carve);text-wrap:balance;margin:0}.tug-card p{color:var(--hm-chalk);margin:0;font-size:.875rem;line-height:1.45}.tug-card .tug-small{color:var(--hm-gilt-hi);font-size:.75rem}.tug-call-n{font:900 clamp(2.4rem, 9cqi, 3.6rem) / 1 var(--hm-f-carve)!important;color:var(--hm-gilt-hi)!important}.tug-red{color:var(--hm-team-red)}.tug-white{color:var(--hm-team-white)}.tug-btn{appearance:none;font:800 .9rem var(--hm-f-body);color:var(--hm-chalk);cursor:pointer;background:linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-solid));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--hm-gilt-hi) 45%, transparent), 0 3px 0 var(--hm-ink);border:0;border-radius:9px;padding:9px 14px}.tug-btn.is-ghost{background:color-mix(in srgb, var(--hm-shade) 25%, transparent)}.tug-btn:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.tug-stats-wrap{width:100%;overflow-x:auto}.tug-stats{border-collapse:collapse;width:100%;font-size:.78rem}.tug-stats th,.tug-stats td{text-align:right;border-bottom:1px solid color-mix(in srgb, var(--hm-gilt-hi) 20%, transparent);white-space:nowrap;padding:5px 6px}.tug-stats th:first-child,.tug-stats td:first-child{text-align:left;white-space:normal}.tug-stats thead th{color:var(--hm-gilt-hi);font-weight:700}.tug-stats tr.is-me td{color:var(--hm-gilt-hi);font-weight:800}.tug-stats .is-plus{color:var(--hm-ok);font-weight:900}.tug-out{color:var(--hm-team-red)}.tug-gain{background:color-mix(in srgb, var(--hm-shade) 30%, transparent);border-radius:9px;padding:7px 10px}@container (width<=520px){.tug-stats{font-size:.7rem}.tug-stats th,.tug-stats td{padding:4px 3px}}@media (prefers-reduced-motion:reduce){.tug-timer.is-sprint{animation:none}.tug-zone{transition:none}}.ball-toast{z-index:8;left:50%;top:calc(max(12px, env(safe-area-inset-top)) + 84px);background:var(--hm-slab-solid);border:1px solid color-mix(in srgb, var(--hm-chalk) 25%, transparent);max-width:calc(100vw - 32px);color:var(--hm-chalk);pointer-events:none;border-radius:10px;padding:6px 12px;font-size:.8125rem;position:absolute;transform:translate(-50%)}.ball-pill{top:calc(max(12px, env(safe-area-inset-top)) + 88px)}@media (width<=700px){.ball-pill{top:calc(max(12px, env(safe-area-inset-top)) + 136px)}.ball-toast{top:auto;bottom:calc(env(safe-area-inset-bottom) + 250px)}}.ball{z-index:900;background:var(--hm-night);color:var(--hm-chalk);font-family:var(--hm-f-body);-webkit-user-select:none;user-select:none;touch-action:none;position:fixed;inset:0;overflow:hidden;container-type:inline-size}.ball-canvas{inset:0;position:absolute!important}.ball-tags{pointer-events:none;position:absolute;inset:0}.ball-tag{border-bottom:3px solid var(--c);background:color-mix(in srgb, var(--hm-night) 55%, transparent);font:800 clamp(.62rem, 1.4cqi, .78rem) var(--hm-f-body);white-space:nowrap;text-shadow:0 1px 2px var(--hm-shade);will-change:transform;border-radius:6px;padding:1px 6px;position:absolute;top:0;left:0}.ball-tag.is-me{color:var(--hm-gilt-hi)}.ball-tag.is-hold{background:color-mix(in srgb, var(--hm-enamel) 85%, transparent);box-shadow:0 0 0 1px var(--hm-gilt)}.ball-tag.is-out{display:none}.ball-top{padding:0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));pointer-events:none;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:start;gap:8px;display:grid;position:absolute;top:0;left:0;right:0}.ball-timer{min-width:3.6em;padding:calc(env(safe-area-inset-top) + 4px) 16px 6px;border:2px solid var(--hm-gilt);background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel));text-align:center;font:900 clamp(1.4rem, 4.6cqi, 2.2rem) / 1 var(--hm-f-carve);font-variant-numeric:tabular-nums;border-top:0;border-radius:0 0 10px 10px;grid-column:2}.ball-timer small{font:700 .6rem var(--hm-f-body);color:var(--hm-gilt-hi);letter-spacing:.04em;display:block}.ball-timer.is-double{border-color:var(--hm-bad);animation:.45s ease-in-out infinite alternate ball-thump}@keyframes ball-thump{to{transform:scale(1.07)}}.ball-board{margin:calc(env(safe-area-inset-top) + 8px) 0 0;background:color-mix(in srgb, var(--hm-shade) 55%, transparent);min-width:clamp(130px,22cqi,190px);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--hm-gilt-hi) 22%, transparent);border-radius:10px;grid-column:3;justify-self:end;gap:3px;padding:6px 8px;font-size:clamp(.66rem,1.5cqi,.8rem);list-style:none;display:grid}.ball-board li{border-left:3px solid var(--c);grid-template-columns:1.2em minmax(0,1fr) auto;align-items:center;gap:5px;padding-left:4px;display:grid}.ball-board li span:nth-child(2){white-space:nowrap;text-overflow:ellipsis;font-weight:700;overflow:hidden}.ball-board li b{font:900 1em var(--hm-f-carve);font-variant-numeric:tabular-nums}.ball-board li.is-me span:nth-child(2){text-underline-offset:2px;text-decoration:underline}.ball-board li.is-hold{color:var(--hm-gilt-hi)}.ball-board li.is-out{opacity:.45;text-decoration:line-through}.ball-banner{text-align:center;width:90%;font:900 clamp(2rem, 9cqi, 4rem) / 1.05 var(--hm-f-carve);color:var(--hm-gilt-hi);text-shadow:0 4px 0 color-mix(in srgb, var(--hm-shade) 55%, transparent);pointer-events:none;animation:.3s cubic-bezier(.2,1.6,.4,1) ball-pop;position:absolute;top:38%;left:50%;transform:translate(-50%,-50%)}.ball-banner.is-go,.ball-banner.is-steal{font-size:clamp(1.4rem,6cqi,2.8rem)}.ball-banner.is-steal{color:var(--hm-bad)}.ball-banner small{font:700 clamp(.75rem, 2cqi, .95rem) var(--hm-f-body);color:var(--hm-chalk);text-shadow:0 2px 4px var(--hm-shade);margin-top:4px;display:block}@keyframes ball-pop{0%{opacity:0;transform:translate(-50%,-50%)scale(.6)}}.ball-warn{background:color-mix(in srgb, var(--hm-red-deep) 85%, transparent);box-shadow:inset 0 0 0 1px var(--hm-bad);white-space:nowrap;pointer-events:none;border-radius:99px;margin:0;padding:6px 14px;font-weight:800;position:absolute;top:62%;left:50%;transform:translate(-50%)}.ball-hint{left:50%;bottom:calc(env(safe-area-inset-bottom) + 12px);background:color-mix(in srgb, var(--hm-shade) 50%, transparent);color:var(--hm-chalk-dim);white-space:nowrap;pointer-events:none;border-radius:99px;margin:0;padding:4px 10px;font-size:clamp(.68rem,1.6cqi,.82rem);position:absolute;transform:translate(-50%)}.ball-mute{left:max(12px, env(safe-area-inset-left));top:calc(env(safe-area-inset-top) + 10px);appearance:none;font:700 .78rem var(--hm-f-body);color:var(--hm-chalk);cursor:pointer;background:color-mix(in srgb, var(--hm-shade) 50%, transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--hm-gilt-hi) 30%, transparent);border:0;border-radius:9px;padding:6px 10px;position:absolute}.ball-mute:focus-visible,.ball-dash:focus-visible,.ball-btn:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.ball-stick{left:max(20px, env(safe-area-inset-left));bottom:calc(env(safe-area-inset-bottom) + 24px);background:color-mix(in srgb, var(--hm-shade) 35%, transparent);width:128px;height:128px;box-shadow:inset 0 0 0 2px color-mix(in srgb, var(--hm-gilt-hi) 35%, transparent);touch-action:none;border-radius:50%;position:absolute}.ball-stick i{background:color-mix(in srgb, var(--hm-gilt-hi) 55%, transparent);pointer-events:none;border-radius:50%;width:54px;height:54px;margin:-27px 0 0 -27px;position:absolute;top:50%;left:50%}.ball-dash{right:max(20px, env(safe-area-inset-right));bottom:calc(env(safe-area-inset-bottom) + 30px);aspect-ratio:1;appearance:none;cursor:pointer;width:96px;color:var(--hm-chalk);font:900 1.1rem / 1 var(--hm-f-carve);background:radial-gradient(circle at 50% 35%, var(--hm-red-hi), var(--hm-red-deep) 70%);box-shadow:inset 0 0 0 3px var(--hm-gilt), 0 4px 0 var(--hm-enamel-deep);touch-action:none;border:0;border-radius:50%;position:absolute}.ball-dash:after{content:"";background:conic-gradient(color-mix(in srgb, var(--hm-shade) 60%, transparent) var(--cd,0%), transparent 0);pointer-events:none;border-radius:50%;position:absolute;inset:0}.ball-card-wrap{background:color-mix(in srgb, var(--hm-night) 55%, transparent);place-items:center;padding:16px;display:grid;position:absolute;inset:0;overflow:auto}.ball-card{text-align:center;background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel));width:min(560px,100%);box-shadow:inset 0 0 0 2px var(--hm-gilt), inset 0 0 0 5px var(--hm-enamel), inset 0 0 0 6px var(--hm-gilt), 0 14px 40px color-mix(in srgb, var(--hm-shade) 60%, transparent);border-radius:14px;justify-items:center;gap:10px;padding:16px;display:grid}.ball-card h2{font:900 clamp(1.1rem, 3.6cqi, 1.6rem) / 1.15 var(--hm-f-carve);text-wrap:balance;margin:0}.ball-card p{margin:0;font-size:.875rem;line-height:1.45}.ball-call-n{color:var(--hm-gilt-hi);font:900 clamp(2.4rem, 9cqi, 3.6rem) / 1 var(--hm-f-carve)!important}.ball-roster{flex-wrap:wrap;justify-content:center;gap:6px;margin:0;padding:0;list-style:none;display:flex}.ball-roster li{border:2px solid var(--c);border-radius:99px;padding:2px 8px;font-size:.8rem;font-weight:700}.ball-btn{appearance:none;font:800 .9rem var(--hm-f-body);color:var(--hm-chalk);cursor:pointer;background:linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-solid));box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--hm-gilt-hi) 45%, transparent), 0 3px 0 var(--hm-ink);border:0;border-radius:9px;padding:9px 14px}.ball-btn.is-ghost{background:color-mix(in srgb, var(--hm-shade) 25%, transparent)}.ball-stats-wrap{width:100%;overflow-x:auto}.ball-stats{border-collapse:collapse;width:100%;font-size:.8rem}.ball-stats th,.ball-stats td{text-align:right;white-space:nowrap;border-bottom:1px solid color-mix(in srgb, var(--hm-gilt-hi) 20%, transparent);padding:5px 6px}.ball-stats th:first-child,.ball-stats td:first-child{text-align:left;white-space:normal}.ball-stats thead th{color:var(--hm-gilt-hi);font-weight:700}.ball-stats tr.is-me td{color:var(--hm-gilt-hi);font-weight:800}.ball-stats .is-plus{color:var(--hm-ok);font-weight:900}.ball-out{color:var(--hm-chalk-dim)}.ball-gain{color:var(--hm-gilt-hi);font-size:.8rem!important}@container (width<=640px){.ball-top{grid-template-columns:minmax(0,1fr);justify-items:center}.ball-timer{grid-column:1}.ball-board{grid-column:1;grid-template-columns:repeat(3,minmax(0,1fr));justify-self:stretch;column-gap:8px;margin-top:6px}.ball-mute{top:calc(env(safe-area-inset-top) + 8px);padding:5px 8px}}@media (prefers-reduced-motion:reduce){.ball-timer.is-double,.ball-banner{animation:none}}.cave[data-activity=ball] .cave-bar,.cave[data-activity=ball] .cave-chat{display:none}body:has(.cave[data-activity=ball]) .fps-badge{display:none}.cave{color:#f3e7d8;background:#120b08;height:100dvh;font-family:Be Vietnam Pro,system-ui,sans-serif;position:relative;overflow:hidden}.cave-scene{isolation:isolate;touch-action:none;cursor:default;-webkit-user-select:none;user-select:none;position:absolute;inset:0}.cave-bar{top:max(16px, env(safe-area-inset-top));pointer-events:none;justify-content:space-between;align-items:center;gap:16px;display:flex;position:absolute;left:16px;right:16px}.cave-bar>*{pointer-events:auto}.cave-leave{appearance:none;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:inherit;cursor:pointer;background:#140d0a99;border:1px solid #f3e7d847;border-radius:6px 6px 18px;padding:10px 20px;font:600 .9375rem/1 Be Vietnam Pro,system-ui,sans-serif}.cave-leave:focus-visible{outline-offset:3px;outline:3px solid #da291c}.cave-bar-left{align-items:center;gap:8px;display:flex}.cave-sound{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#140d0a99;border:1px solid #f3e7d847;border-radius:20px;align-items:center;gap:4px;height:40px;padding:0 12px 0 0;display:flex}.cave-sound-btn{appearance:none;width:38px;height:38px;color:inherit;cursor:pointer;background:0 0;border:0;border-radius:50%;place-items:center;padding:0;display:grid}.cave-sound-btn:hover{background:#f3e7d81f}.cave-sound[data-muted] .cave-sound-btn{color:#da291c}.cave-sound-btn:focus-visible,.cave-sound-range:focus-visible{outline-offset:2px;outline:3px solid #da291c}.cave-sound-range{appearance:none;cursor:pointer;touch-action:none;background:0 0;width:88px;height:20px;margin:0}.cave-sound-range::-webkit-slider-runnable-track{background:linear-gradient(to right, #da291c 0 var(--fill), #f3e7d840 var(--fill) 100%);border-radius:2px;height:4px}.cave-sound-range::-moz-range-track{background:#f3e7d840;border-radius:2px;height:4px}.cave-sound-range::-moz-range-progress{background:#da291c;border-radius:2px;height:4px}.cave-sound-range::-webkit-slider-thumb{-webkit-appearance:none;background:#f3e7d8;border:0;border-radius:50%;width:14px;height:14px;margin-top:-5px}.cave-sound-range::-moz-range-thumb{background:#f3e7d8;border:0;border-radius:50%;width:14px;height:14px}.cave-tv{align-items:center;gap:4px;height:40px;padding:0 10px 0 3px;display:flex;position:relative}.cave-tv-seg{border-radius:7px;gap:2px;height:32px;padding:2px;display:flex}.cave-tv-ch{appearance:none;font:700 .8125rem var(--hm-f-body);white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:5px;align-items:center;gap:5px;padding:0 10px;display:flex}.cave-tv-ch:disabled{opacity:.45;cursor:not-allowed}.cave-tv-vol-btn{appearance:none;cursor:pointer;background:0 0;border:0;border-radius:50%;place-items:center;width:32px;height:32px;padding:0;font-size:1rem;display:grid}.cave-tv-range{width:76px}.cave-tv-ch:focus-visible,.cave-tv-vol-btn:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.cave-tv-pop{z-index:70;gap:8px;width:260px;padding:12px 14px 14px;display:grid;position:absolute;top:calc(100% + 8px);left:0}.cave-tv-title{font:800 .9375rem var(--hm-f-carve);margin:0}.cave-tv-vol{align-items:center;gap:8px;display:flex}.cave-tv-pop .cave-tv-range{flex:1;width:auto}.cave-tv-pct{text-align:right;min-width:3.2em;font:600 .8125rem var(--hm-f-body);font-variant-numeric:tabular-nums}.cave-tv-note{margin:0;font-size:.75rem}@media (width<=900px){.cave-tv-inline{display:none}.cave-tv{padding-right:3px}}@media (width<=700px){.cave-tv-ch-label{display:none}.cave-tv-ch{padding:0 8px}}@media (width<=480px){.cave-bar{gap:10px}.cave-leave{white-space:nowrap;padding:10px 14px}.cave-room-extra{display:none}.cave-bar-left{gap:6px;min-width:0}.cave-sound{justify-content:center;width:40px;padding:0}.cave-sound-range{display:none}.cave-tv-pop .cave-sound-range{display:block}.cave-tv-pop{top:calc(env(safe-area-inset-top,0px) + 100px);width:auto;position:fixed;left:12px;right:12px}.cave-tv{gap:1px;padding:0 2px}.cave-tv-ch{justify-content:center;width:30px;padding:0}.cave-tv-vol-btn{width:28px}.cave-room-name{display:none}.cave-room{flex:none}.cave-room-meta{white-space:nowrap;font-size:.75rem}}@media (width<=420px){.cave-room-unit{display:none}.cave-room-meta:before{content:"👥 "}}@media (width<=360px){.cave-bar{gap:8px}.cave-leave{padding:10px 11px}.cave-room-meta{color:inherit;font-size:.8125rem;font-weight:600}}.board-video{pointer-events:none;background:#000;overflow:hidden}.board-video iframe{pointer-events:none;border:0;width:100%;height:100%;display:block}.board-video{position:relative}.board-video>:not(.board-score){transition:filter .6s;position:absolute;inset:0}.board-video[data-live]>:not(.board-score){filter:brightness(.3)saturate(.6)}.board-score{z-index:2;opacity:0;pointer-events:none;place-items:center;transition:opacity .6s;display:grid;position:absolute;inset:0}.board-score--on{opacity:1}.board-score-card{text-align:center;width:740px;color:var(--hm-chalk);border:5px solid var(--hm-gilt);outline-offset:-14px;background:linear-gradient(#7a1424eb,#460a16eb);outline:2px solid #ecd08ca6;padding:26px 34px 24px;transition:transform .6s;transform:translateY(14px)scale(.96);box-shadow:0 18px 60px #0009}.board-score--on .board-score-card{transform:none}.board-score-status{color:#fff6ec;background:var(--hm-red);border-radius:6px;padding:4px 18px;font:800 26px/1.3 Bitter,Georgia,serif;display:inline-block}.board-score-status--ht{background:#8a6a10}.board-score-comp{color:#efe9ddb3;margin-top:8px;font:600 20px/1.3 Be Vietnam Pro,system-ui,sans-serif}.board-score-row{grid-template-columns:1fr auto 1fr;align-items:center;gap:18px;margin-top:14px;display:grid}.board-score-team{justify-items:center;gap:4px;min-width:0;display:grid}.board-score-logo{object-fit:contain;width:64px;height:64px}.board-score-logo[hidden]{display:none}.board-score-short{color:#fff6ec;font:900 64px/1 Bitter,Georgia,serif}.board-score-name{text-overflow:ellipsis;white-space:nowrap;color:#efe9ddcc;max-width:100%;font:600 20px/1.3 Be Vietnam Pro,system-ui,sans-serif;overflow:hidden}.board-score-num{color:var(--hm-gilt-hi,#ecd08c);white-space:nowrap;text-shadow:0 4px #00000059;font:900 110px/1 Bitter,Georgia,serif}.board-score-goals{grid-template-columns:1fr 1fr;gap:24px;margin-top:12px;display:grid}.board-score-goals-side{text-align:left;color:#efe9dde0;margin:0;padding:0;font:500 19px/1.45 Be Vietnam Pro,system-ui,sans-serif;list-style:none}.board-score-goals-side--away{text-align:right}.board-score-goals-side li{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.board-score-goal{text-align:center;color:#fff6ec;opacity:0;background:#c8102ee6;place-content:center;transition:opacity .3s;display:grid;position:absolute;inset:0}.board-score-goal--on{opacity:1;animation:.76s step-end infinite board-goal-flash}.board-score-goal-big{font:900 150px/1 Bitter,Georgia,serif}.board-score-goal-who{margin-top:10px;font:700 40px/1.2 Be Vietnam Pro,system-ui,sans-serif}@keyframes board-goal-flash{50%{color:var(--hm-red);background:#fff6eceb}}@media (prefers-reduced-motion:reduce){.board-video>:not(.board-score),.board-score,.board-score-card{transition:none}.board-score-goal--on{animation:none}}.cave-room{text-align:right}.cave-room p{margin:0}.cave-room-name{font-size:1rem;font-weight:600}.cave-room-meta{color:#f3e7d8b3;font-size:.8125rem}.cave-help-btn{z-index:6;left:calc(max(12px, env(safe-area-inset-left)) + 36px);bottom:max(12px, env(safe-area-inset-bottom));-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);color:#f3e7d8e6;cursor:pointer;background:#140d0a9e;border:1px solid #f3e7d84d;border-radius:999px;height:28px;padding:0 11px;font:600 .8125rem Be Vietnam Pro,system-ui,sans-serif;position:absolute}.cave-help-btn:hover,.cave-help-btn[aria-expanded=true]{color:#fff6ec;background:#140d0ad9}.cave-help-btn:focus-visible,.cave-help-ok:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.cave-help-card{z-index:7;left:max(12px, env(safe-area-inset-left));bottom:calc(max(12px, env(safe-area-inset-bottom)) + 38px);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);color:#fff6ec;background:#140c09e6;border:1px solid #f3e7d829;border-radius:14px;gap:12px;width:min(360px,100vw - 24px);padding:16px;display:grid;position:absolute;box-shadow:0 18px 40px -16px #000000d9}.cave-help-title{margin:0;font:800 1.0625rem/1.2 Bitter,Georgia,serif}.cave-help-list{grid-template-columns:max-content 1fr;align-items:center;gap:8px 12px;margin:0;display:grid}.cave-help-row{display:contents}.cave-help-row dt{justify-self:start}.cave-help-row dd{color:#f3e7d8e0;margin:0;font-size:.875rem;line-height:1.35}.cave-help-row kbd{white-space:nowrap;border:1px solid #f3e7d866;border-bottom-width:2px;border-radius:6px;padding:2px 8px;font:600 .8125rem/1.4 Be Vietnam Pro,system-ui,sans-serif;display:inline-block}.cave-help-ok{color:#fff;cursor:pointer;background:#c8102e;border:0;border-radius:8px;justify-self:end;padding:8px 16px;font:700 .875rem Be Vietnam Pro,system-ui,sans-serif}.cave-lock-hint{z-index:2;left:50%;bottom:max(16px, env(safe-area-inset-bottom));color:#f3e7d8cc;white-space:nowrap;pointer-events:none;background:#140d0a80;border-radius:999px;margin:0;padding:5px 12px;font-size:.8125rem;position:absolute;transform:translate(-50%)}.cave-credits{z-index:6;left:max(12px, env(safe-area-inset-left));bottom:max(12px, env(safe-area-inset-bottom));color:#f3e7d8cc;font-size:.75rem;line-height:1.5;position:absolute}.cave-credits summary{cursor:pointer;background:#140d0a99;border:1px solid #f3e7d840;border-radius:50%;place-items:center;width:26px;height:26px;font-size:.875rem;list-style:none;display:grid}.cave-credits summary::-webkit-details-marker{display:none}.cave-credits summary:focus-visible{outline-offset:2px;outline:2px solid #ffd166}.cave-credits-body{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#140d0ae6;border-radius:10px;width:min(420px,100vw - 32px);padding:10px 12px;position:absolute;bottom:34px;left:0}.cave-credits-title{font-weight:600}.cave-credits ul{margin:6px 0;padding-left:18px}.cave-credits p{margin:0}.cave-credits a{color:#f6c9a8}.cave-donate{left:max(12px, env(safe-area-inset-left));bottom:calc(max(12px, env(safe-area-inset-bottom)) + 34px)}.cave-stick{z-index:5;left:max(24px, env(safe-area-inset-left));bottom:max(104px, calc(env(safe-area-inset-bottom) + 88px));-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);touch-action:none;-webkit-user-select:none;user-select:none;background:#140d0a73;border:2px solid #f3e7d84d;border-radius:50%;width:132px;height:132px;position:absolute}.cave-stick-knob{pointer-events:none;background:#da291c;border:2px solid #fff6ecd9;border-radius:50%;width:58px;height:58px;margin:-29px 0 0 -29px;position:absolute;top:50%;left:50%;box-shadow:0 4px 14px #00000073}.cave-ime{top:max(72px, calc(env(safe-area-inset-top) + 56px));color:#f3e7d8;text-align:center;pointer-events:none;background:#140d0ad9;border:1px solid #da291c99;border-radius:8px;width:min(500px,100% - 32px);margin:0;padding:10px 14px;font-size:.875rem;line-height:1.45;position:absolute;left:50%;transform:translate(-50%)}.cave-crosshair{pointer-events:none;border:2px solid #fff6ecd9;border-radius:50%;width:22px;height:22px;margin:-11px 0 0 -11px;position:absolute;top:50%;left:50%;box-shadow:0 0 0 1px #00000073,inset 0 0 0 1px #00000059}.cave-crosshair:after{content:"";background:#fff6ec;border-radius:50%;width:4px;height:4px;margin:-2px 0 0 -2px;position:absolute;top:50%;left:50%;box-shadow:0 0 0 1px #00000073}.cave-chat{z-index:4;top:max(68px, calc(env(safe-area-inset-top) + 52px));right:max(16px, env(safe-area-inset-right));background:linear-gradient(270deg,#140d0a61,#140d0a29 70%,#140d0a00);border-radius:12px;flex-direction:column;gap:8px;width:clamp(250px,23vw,340px);padding:8px 10px 10px;font-size:.8125rem;line-height:1.38;transition:background-color .2s;display:flex;position:absolute}.cave-chat:hover,.cave-chat:focus-within,.cave-chat.is-open{background-color:#140d0a59}.cave-chat.is-touch{top:max(96px, calc(env(safe-area-inset-top) + 80px));background:linear-gradient(270deg,#140d0ab8,#140d0a99 70%,#140d0a73);border-radius:10px;gap:4px;width:min(196px,100vw - 160px);padding:5px 7px 7px;font-size:.6875rem;line-height:1.35}.cave-chat.is-touch.is-open{z-index:7;left:max(16px, env(safe-area-inset-left));width:auto;font-size:.8125rem}.cave-chat.is-touch .cave-chat-title{display:none}.cave-chat.is-touch .cave-chat-head{justify-content:space-between}.cave-chat.is-touch .cave-chat-hide{padding:0 9px;font-size:.6875rem}.cave-chat.is-touch .cave-chat-msg{padding:1px 0}.cave-chat.is-touch .cave-chat-compose{padding:4px 9px;font-size:.75rem}.cave-chat.is-touch .cave-chat-notice{padding:4px 8px;font-size:.8125rem}.cave-chat.is-hidden{background:0 0;width:auto;padding:0}.cave-chat-head{justify-content:space-between;align-items:center;gap:8px;display:flex}.cave-chat-title{color:#f3e7d8bf;margin:0;font-size:.875rem;font-weight:600}.cave-chat-hide,.cave-chat-toggle{color:#f3e7d8;font:inherit;cursor:pointer;background:#140d0ab3;border:1px solid #f3e7d84d;border-radius:999px;font-size:.875rem;font-weight:600}.cave-chat-hide{padding:3px 12px}.cave-chat-toggle{align-items:center;gap:8px;padding:7px 14px;display:inline-flex}.cave-chat-badge{color:#fff6ec;text-align:center;font-variant-numeric:tabular-nums;background:#c8102e;border-radius:999px;min-width:1.5em;padding:0 6px;font-size:.8125rem}.cave-chat-log{overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#f3e7d84d transparent;max-height:min(34dvh,300px);margin:0;padding:0 2px 0 0;list-style:none;overflow-y:auto}.cave-chat-log.is-overflow{-webkit-mask-image:linear-gradient(#0000,#000 48px);mask-image:linear-gradient(#0000,#000 48px)}.cave-chat.is-touch .cave-chat-log{max-height:16dvh}.cave-chat.is-touch .cave-chat-log.is-overflow{-webkit-mask-image:linear-gradient(#0000,#000 28px);mask-image:linear-gradient(#0000,#000 28px)}.cave-chat.is-touch.is-open .cave-chat-log{max-height:26dvh}.cave-chat-msg,.cave-chat-empty,.cave-feed-item{color:#f3e7d8;overflow-wrap:anywhere;text-shadow:-1px -1px #0009,1px -1px #0009,-1px 1px #0009,1px 1px #0009,0 1px 3px #000000e6,0 0 10px #0000008c;padding:2px 0;font-weight:500}.cave-feed{border-top:1px solid #c9a24e47;flex-direction:column;gap:2px;padding-top:5px;display:flex}.cave-feed-title{text-shadow:0 1px 2px #000000e6;margin:0;font-size:.6875rem;font-weight:700}.cave-feed-log{overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#f3e7d84d transparent;max-height:16dvh;margin:0;padding:0 2px 0 0;list-style:none;overflow-y:auto}.cave-feed-log.is-compact{max-height:5.8em}.cave-feed-log.is-overflow{-webkit-mask-image:linear-gradient(#0000,#000 1.6em);mask-image:linear-gradient(#0000,#000 1.6em)}.cave-feed-item{padding:1px 0;font-size:.75rem}.cave-chat.is-touch.is-open .cave-feed-log{max-height:26dvh}.cave-chat-tabs{gap:2px;min-width:0;display:flex}.cave-chat-tab{font:inherit;white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:999px;padding:2px 8px;font-size:.6875rem;font-weight:600;position:relative}.cave-chat-dot{border-radius:50%;width:6px;height:6px;position:absolute;top:1px;right:1px}.cave-chat-tab:focus-visible{outline-offset:1px;outline:2px solid #ffd166}.cave-chat-empty{color:#f3e7d899}.cave-chat-msg.is-pending{opacity:.65}.cave-chat-name{color:#f2b98c;font-weight:600}.cave-chat-failed{color:#ff9b8a;font-size:.8125rem}.cave-chat-notice{color:#fff6ec;background:#c8102ee6;border-radius:8px;margin:0;padding:5px 10px;font-size:.875rem}.cave-chat-compose{color:#f3e7d8a6;font:inherit;text-align:left;cursor:text;background:0 0;border:1px dashed #f3e7d84d;border-radius:999px;padding:8px 12px}.cave-chat-compose kbd{font:inherit;color:#fff6ec;border:1px solid #f3e7d866;border-bottom-width:2px;border-radius:5px;padding:0 6px;font-size:.8125rem;font-weight:600}.cave-chat-form{background:#140d0ae6;border:1px solid #ffd166;border-radius:999px;align-items:center;gap:6px;padding:4px 4px 4px 12px;display:flex}.cave-chat-input{color:#fff6ec;min-width:0;font:inherit;background:0 0;border:0;outline:0;flex:1;padding:4px 0;font-size:.875rem}.cave-chat-count{color:#f3e7d899;font-variant-numeric:tabular-nums;font-size:.8125rem}.cave-chat-send{color:#fff6ec;font:inherit;cursor:pointer;background:#c8102e;border:0;border-radius:999px;padding:7px 16px;font-weight:600}.cave-chat-hide:focus-visible,.cave-chat-toggle:focus-visible,.cave-chat-compose:focus-visible,.cave-chat-send:focus-visible{outline-offset:2px;outline:2px solid #ffd166}.cave-net{z-index:7;top:max(72px, calc(env(safe-area-inset-top) + 56px));color:#fff6ec;text-align:center;background:#c8102eeb;border-radius:999px;width:max-content;max-width:calc(100vw - 32px);margin:0;padding:8px 16px;font-size:.9375rem;font-weight:600;position:absolute;left:50%;transform:translate(-50%)}.cave-reconnect{z-index:70;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:#0a06048c;place-items:center;padding:16px;display:grid;position:absolute;inset:0}.cave-reconnect-box{text-align:center;background:#140d0ae0;border:1px solid #f3e7d838;border-radius:14px;flex-direction:column;align-items:center;gap:8px;max-width:320px;padding:22px 26px;display:flex}.cave-reconnect-box p{margin:0}.cave-reconnect-title{font-size:1.0625rem;font-weight:700}.cave-reconnect-sub{color:#f3e7d8bf;font-variant-numeric:tabular-nums;font-size:.9375rem;margin-bottom:8px!important}.cave-reconnect-spin{border:3px solid #f3e7d833;border-top-color:#da291c;border-radius:50%;width:30px;height:30px;margin-bottom:4px;animation:.9s linear infinite cave-reconnect-spin}@keyframes cave-reconnect-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.cave-reconnect-spin{animation-duration:2.4s}}.goal-overlay{z-index:3;pointer-events:none;place-items:center;animation:9s linear forwards goal-out;display:grid;position:absolute;inset:0}.goal-vignette{opacity:.35;background:radial-gradient(#0000 45%,#da291c8c 100%);animation:.76s ease-in-out 6 alternate goal-pulse;position:absolute;inset:0}.goal-card{text-align:center;justify-items:center;gap:4px;padding:0 16px;display:grid;position:relative;transform:translateY(-14vh)}.goal-word{letter-spacing:-.02em;color:#fff;text-shadow:0 0 2px #7a0d06,0 6px #c8102e,0 10px 30px #0000008c;white-space:nowrap;margin:0;font:800 clamp(3rem,12vw,8rem)/1 Bitter,Georgia,serif;animation:.5s ease-in-out .6s 3 goal-shake}.goal-word span{animation:goal-pop .55s calc(var(--i) * 70ms) cubic-bezier(.2, 1.6, .4, 1) both;display:inline-block}.goal-who,.goal-score{color:#fff6ec;text-shadow:0 2px 10px #000000b3;margin:0;animation:.5s ease-out .55s both goal-rise}.goal-who{font-size:clamp(1rem,3.4vw,1.75rem);font-weight:600}.goal-score{color:var(--hm-gilt-hi);font:800 clamp(1.25rem,4vw,2.25rem)/1.2 Bitter,Georgia,serif}@keyframes goal-pop{0%{opacity:0;transform:translateY(40%)scale(.2)rotate(-12deg)}to{opacity:1;transform:none}}@keyframes goal-rise{0%{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}@keyframes goal-shake{0%,to{transform:none}25%{transform:translate(-6px)rotate(-1.5deg)}75%{transform:translate(6px)rotate(1.5deg)}}@keyframes goal-pulse{to{opacity:1}}@keyframes goal-out{0%,66%{opacity:1}to{opacity:0}}@media (prefers-reduced-motion:reduce){.cave-chat{transition:none}.goal-word,.goal-word span,.goal-who,.goal-score,.goal-vignette{animation:none}}.cave-celebrate{z-index:5;right:max(16px, env(safe-area-inset-right));bottom:max(16px, env(safe-area-inset-bottom));appearance:none;color:#fff;cursor:pointer;touch-action:manipulation;background:#c8102e;border:0;border-radius:999px;padding:12px 20px;font:700 1rem Be Vietnam Pro,system-ui,sans-serif;transition:transform .12s;position:absolute;box-shadow:0 8px 22px -8px #000000b3}.cave-celebrate:hover{background:#da291c}.cave-celebrate:active{transform:scale(.95)}.cave-celebrate:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.cave-celebrate-key{border:1px solid #ffffff8c;border-radius:5px;margin-left:8px;padding:1px 7px;font:700 .8125rem/1.3 Be Vietnam Pro,system-ui,sans-serif}.cave-poll{z-index:5;left:50%;bottom:max(64px, calc(env(safe-area-inset-bottom) + 52px));color:#fff6ec;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#140c09db;border:1px solid #da291c8c;border-radius:14px;gap:10px;width:min(460px,100% - 32px);padding:14px 16px;display:grid;position:absolute;transform:translate(-50%);box-shadow:0 14px 36px -14px #000c}.cave-poll-q{text-align:center;margin:0;font-size:1rem;font-weight:700;line-height:1.35}.cave-poll-options{grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:8px;display:grid}.cave-poll-option{appearance:none;white-space:nowrap;min-height:44px;color:inherit;cursor:pointer;touch-action:manipulation;background:#fff6ec14;border:1px solid #fff6ec40;border-radius:10px;justify-content:center;align-items:center;gap:8px;padding:8px 10px;font:600 .9375rem Be Vietnam Pro,system-ui,sans-serif;display:inline-flex}.cave-poll-option:hover{background:#c8102e;border-color:#c8102e}.cave-poll-option:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.cave-poll-option kbd{border:1px solid #ffffff80;border-radius:5px;padding:0 6px;font:700 .75rem/1.4 Be Vietnam Pro,system-ui,sans-serif}@media (width<=640px){.cave-poll{bottom:max(250px, calc(env(safe-area-inset-bottom) + 236px))}}.punched{z-index:3;pointer-events:none;place-items:center;animation:2.2s ease-in forwards punched-out;display:grid;position:absolute;inset:0}.punched-daze{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:radial-gradient(#c8102e1f 35%,#c8102eb3 100%);animation:1s ease-out both punched-wobble;position:absolute;inset:0}.punched-text{color:#fff6ec;text-align:center;background:#140808b8;border-radius:12px;margin:0;padding:10px 18px;font-size:clamp(1.125rem,4vw,1.75rem);font-weight:600;animation:.35s cubic-bezier(.2,1.6,.4,1) both punched-pop;position:relative;transform:translateY(-16vh)}.punched-text strong{color:#ffb4a8}@keyframes punched-out{0%,55%{opacity:1}to{opacity:0}}@keyframes punched-wobble{0%{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transform:none}20%{transform:rotate(-1.2deg)scale(1.02)}45%{transform:rotate(1deg)scale(1.01)}to{-webkit-backdrop-filter:blur();backdrop-filter:blur();transform:none}}@keyframes punched-pop{0%{opacity:0;transform:translateY(-16vh)scale(.6)}to{opacity:1;transform:translateY(-16vh)}}@media (prefers-reduced-motion:reduce){.punched-daze,.punched-text{-webkit-backdrop-filter:none;backdrop-filter:none;animation:none}}.cave-punch{z-index:5;right:max(16px, env(safe-area-inset-right));bottom:max(80px, calc(env(safe-area-inset-bottom) + 68px));color:#fff6ec;cursor:pointer;touch-action:manipulation;background:#140c099e;border:0;border-radius:50%;align-content:center;place-items:center;gap:0;width:72px;height:72px;padding:0 4px;transition:background .15s,box-shadow .15s;display:grid;position:absolute;box-shadow:0 0 0 2px #fff6ec47}.cave-punch-icon{opacity:.7;font-size:1.6rem;line-height:1}.cave-punch-label{text-overflow:ellipsis;white-space:nowrap;max-width:64px;font:700 .6875rem/1.3 Be Vietnam Pro,system-ui,sans-serif;overflow:hidden}.cave-punch[data-ready]{background:#c8102e;animation:.9s ease-in-out infinite alternate punch-ready;box-shadow:0 0 0 2px #fff6ec,0 0 18px 2px #ff3a24b3}.cave-punch[data-ready] .cave-punch-icon{opacity:1}.cave-punch:active{transform:scale(.92)}@keyframes punch-ready{to{box-shadow:0 0 0 2px #fff6ec,0 0 26px 6px #ff3a24d9}}.cave-punch-hint{z-index:4;left:50%;bottom:max(52px, calc(env(safe-area-inset-bottom) + 40px));color:#fff6ec;white-space:nowrap;pointer-events:none;background:#140808bf;border:1px solid #ff3a24b3;border-radius:999px;align-items:center;gap:8px;margin:0;padding:7px 14px;font-size:.9375rem;font-weight:600;display:flex;position:absolute;transform:translate(-50%)}.cave-punch-hint kbd{border:1px solid #fff9;border-radius:5px;padding:1px 7px;font:700 .8125rem/1.3 Be Vietnam Pro,system-ui,sans-serif}.cave-punch-hint strong{color:#ffb4a8;text-overflow:ellipsis;max-width:220px;overflow:hidden}@media (prefers-reduced-motion:reduce){.cave-punch[data-ready]{animation:none}}@media (width<=640px){.cave-punch{bottom:max(116px, calc(env(safe-area-inset-bottom) + 104px))}.cave-poll{bottom:max(250px, calc(env(safe-area-inset-bottom) + 238px))}}.punch-intro{z-index:5;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);color:#fff6ec;pointer-events:none;width:min(400px,100vw - 32px);animation:punch-intro-in .35s ease-out both, punch-intro-out .5s ease-in calc(var(--intro-ms) - .5s) forwards;background:#140a088c;border:1px solid #ff3a248c;border-radius:12px;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:10px 8px 13px 14px;display:grid;position:absolute;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%);box-shadow:0 12px 30px -16px #000c}.punch-intro-icon{font-size:1.875rem;line-height:1}.punch-intro-body{gap:6px;display:grid}.punch-intro-title{margin:0;font:800 1.0625rem/1.25 Bitter,Georgia,serif}.punch-intro-text{color:#f3e7d8eb;margin:0;font-size:.8125rem;line-height:1.45}.punch-intro-red{color:#ff5a44}.punch-intro-text kbd{color:#fff;border:1px solid #f3e7d880;border-bottom-width:3px;border-radius:6px;padding:1px 8px;font:700 .95em/1.4 Be Vietnam Pro,system-ui,sans-serif}.punch-intro-close{pointer-events:auto;color:#fff6ec;cursor:pointer;background:#ffffff14;border:0;border-radius:50%;align-self:start;width:28px;height:28px;font-size:1.125rem;line-height:1}.punch-intro-close:hover{background:#ffffff2e}.punch-intro-close:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.punch-intro-timer{transform-origin:0;width:100%;height:3px;animation:punch-intro-timer var(--intro-ms) linear forwards;background:#c8102e;position:absolute;bottom:0;left:0}@keyframes punch-intro-in{0%{opacity:0;transform:translate(-50%,-50%)scale(.85)}}@keyframes punch-intro-out{to{opacity:0}}@keyframes punch-intro-timer{to{transform:scaleX(0)}}@media (prefers-reduced-motion:reduce){.punch-intro{animation:none}}@media (width<=640px){.punch-intro{grid-template-columns:1fr auto;gap:6px 10px;padding:10px 8px 12px 12px;top:41%}.punch-intro-icon{grid-column:1}.punch-intro-body{grid-area:2/1/auto/-1}.punch-intro-close{grid-area:1/2}}.cave-tele-wrap{display:flex;position:relative}.cave-tele{color:#fff;white-space:nowrap;background:linear-gradient(#2aabee,#1b8bc2);border-radius:20px;align-items:center;gap:7px;height:40px;padding:0 16px 0 13px;font:700 .9375rem Be Vietnam Pro,system-ui,sans-serif;text-decoration:none;transition:filter .15s;display:inline-flex;position:relative;overflow:hidden;box-shadow:inset 0 0 0 1px #ffffff40,0 6px 18px -6px #229ed9cc}.cave-tele:hover{filter:brightness(1.08)}.cave-tele:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}.cave-tele svg{flex:none}.cave-tele[data-attn]:after{content:"";pointer-events:none;background:linear-gradient(105deg,#0000 35%,#ffffff8c 50%,#0000 65%);animation:9s ease-in-out 2s infinite tele-shine;position:absolute;inset:0;transform:translate(-120%)}.cave-tele[data-attn] svg{animation:9s ease-in-out 2s infinite tele-fly}@keyframes tele-shine{0%{transform:translate(-120%)}12%,to{transform:translate(120%)}}@keyframes tele-fly{0%,14%,to{transform:none}5%{transform:translate(2px,-3px)rotate(-12deg)}9%{transform:translate(-1px,1px)rotate(4deg)}}.cave-tele[data-nudge]{animation:1.1s ease-out 4 tele-pulse}@keyframes tele-pulse{0%{box-shadow:inset 0 0 0 1px #ffffff40,0 0 #2aabeed9}to{box-shadow:inset 0 0 0 1px #ffffff40,0 0 0 16px #2aabee00}}.cave-tele[data-touch]{justify-content:center;width:40px;padding:0}.cave-tele-nudge{z-index:60;color:#14212b;white-space:normal;background:#fff;border-radius:12px;align-items:flex-start;gap:8px;width:max-content;max-width:min(280px,100vw - 32px);padding:9px 8px 9px 12px;font-size:.8125rem;line-height:1.4;animation:.3s ease-out both tele-nudge-in;display:flex;position:fixed;top:64px;left:16px;box-shadow:0 12px 28px -12px #000c}.cave-tele-nudge b{color:#1b8bc2}.cave-tele-nudge:before{content:"";left:var(--arrow-x,16px);background:#fff;width:12px;height:12px;position:absolute;top:-6px;transform:rotate(45deg)}.cave-tele-nudge-close{color:#14212b;cursor:pointer;background:#14212b14;border:0;border-radius:50%;flex:none;width:22px;height:22px;font-size:.9375rem;line-height:1}@keyframes tele-nudge-in{0%{opacity:0;transform:translateY(-6px)}}@media (prefers-reduced-motion:reduce){.cave-tele[data-nudge],.cave-tele[data-attn]:after,.cave-tele[data-attn] svg,.cave-tele-nudge{animation:none}.cave-tele[data-attn]:after{display:none}}.notice{z-index:8;color:#fff;text-align:center;pointer-events:none;width:min(580px,100%);animation:notice-in .3s ease-out both, notice-out .4s ease-in calc(var(--notice-ms) - .4s) forwards;background:linear-gradient(90deg,#0000 0%,#00000080 20% 80%,#0000 100%);justify-items:center;gap:2px;padding:16px 56px 18px;display:grid;position:absolute;top:24%;left:50%;transform:translate(-50%,-50%);-webkit-mask-image:linear-gradient(#0000 0%,#000 12% 88%,#0000 100%);mask-image:linear-gradient(#0000 0%,#000 12% 88%,#0000 100%)}.notice-main{text-shadow:0 1px 2px #000000e6,0 2px 12px #000c;margin:0;font-size:clamp(1.25rem,3.4vw,1.9rem);font-weight:600;line-height:1.3}.notice-main strong{font-weight:800}.notice-icon{vertical-align:.05em;width:1.4em;height:1.4em;text-shadow:none;background:#229ed9;border-radius:50%;place-items:center;margin-right:.4em;font-size:.85em;display:inline-grid}.notice-sub{color:#ffffffc7;text-shadow:0 1px 6px #000000bf;margin:0;font-size:clamp(.8125rem,2.2vw,.9375rem)}.notice[data-kind=room_join] .notice-icon{background:0 0;font-size:1.05em}.notice[data-wave] .notice-main{font-size:clamp(1.5rem,4.4vw,2.4rem)}.notice[data-wave] .notice-main strong{color:var(--hm-gilt-hi)}@keyframes notice-in{0%{opacity:0;transform:translate(-50%,-30%)}}@keyframes notice-out{to{opacity:0}}@media (prefers-reduced-motion:reduce){.notice{animation:notice-out .4s ease-in calc(var(--notice-ms) - .4s) forwards}}@media (width<=640px){.notice{width:100%;padding:12px 28px 14px;top:31%}.notice-main{font-size:1.125rem}.notice[data-wave] .notice-main{font-size:1.4rem}}.cave[data-activity] .cave-celebrate,.cave[data-activity] .cave-poll,.cave[data-activity] .cave-punch,.cave[data-activity] .cave-punch-hint,.cave[data-activity] .cave-stick,.cave[data-activity] .cave-help-btn,.cave[data-activity] .cave-help-card,.cave[data-activity] .cave-lock-hint,.cave[data-activity] .cave-crosshair,.cave[data-activity] .cave-credits,.cave[data-activity] .cave-donate,.cave[data-activity] .punch-intro{display:none}.rage-prompt{z-index:6;left:50%;bottom:max(292px, calc(env(safe-area-inset-bottom) + 280px));color:#fff6ec;white-space:nowrap;background:#140d0ad1;border:1px solid #ecd08cb3;border-radius:999px;align-items:center;gap:8px;width:max-content;max-width:calc(100vw - 32px);padding:6px 8px 6px 14px;font-size:.875rem;font-weight:600;display:flex;position:absolute;overflow:hidden;transform:translate(-50%);box-shadow:0 6px 18px -8px #000}.rage-prompt-title,.rage-prompt-sub{text-overflow:ellipsis;min-width:0;overflow:hidden}.rage-prompt-act{flex-shrink:0}.rage-prompt kbd{min-width:22px;height:22px;font:inherit;border:1px solid #f3e7d880;border-bottom-width:2px;border-radius:5px;place-items:center;padding:0 5px;font-size:.75rem;display:inline-grid}.rage-item kbd{min-width:26px;height:26px;font:inherit;border:1px solid #f3e7d880;border-bottom-width:3px;border-radius:6px;place-items:center;padding:0 6px;font-size:.875rem;display:inline-grid}.rage-prompt-sub{color:#f3e7d8a6;font-size:.75rem;font-weight:400}@media (width<=640px){.rage-prompt{bottom:max(284px, calc(env(safe-area-inset-bottom) + 272px))}.rage-prompt-sub,.cave-poll~.rage-prompt{display:none}}@media (height<=500px){.rage-prompt{bottom:max(16px, env(safe-area-inset-bottom))}.rage-prompt-sub{display:none}}.rage-enter{appearance:none;color:#fff;font:inherit;cursor:pointer;background:#c8102e;border:0;border-radius:999px;padding:5px 12px;font-weight:700}.rage-aim{z-index:3;cursor:none;touch-action:none;position:absolute;inset:0}.rage-cross{pointer-events:none;width:34px;height:34px;position:absolute;transform:translate(-50%,-50%)}.rage-cross:before,.rage-cross:after{content:"";background:#fff;position:absolute;box-shadow:0 0 4px #000}.rage-cross:before{width:2px;height:34px;top:0;left:16px}.rage-cross:after{width:34px;height:2px;top:16px;left:0}.rage-turn{z-index:6;color:#fff6ec;cursor:pointer;background:#140d0a99;border:1px solid #f3e7d859;border-radius:50%;width:52px;height:52px;font-size:1.25rem;position:absolute;top:46%}.rage-turn.is-prev{left:max(360px, calc(env(safe-area-inset-left) + 344px))}.rage-turn.is-next{right:max(360px, calc(env(safe-area-inset-right) + 344px))}.rage-turn:hover{background:#140d0ad9}.rage-turn:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}@media (width<=1100px){.rage-turn.is-prev{left:max(12px, env(safe-area-inset-left));top:56%}.rage-turn.is-next{right:max(12px, env(safe-area-inset-right));top:56%}}.rage-exit{z-index:6;top:max(96px, calc(env(safe-area-inset-top) + 88px));left:max(16px, env(safe-area-inset-left));color:#fff6ec;height:38px;font:inherit;cursor:pointer;background:#140d0abf;border:1px solid #f3e7d859;border-radius:10px;padding:0 14px;font-size:.9375rem;font-weight:700;position:absolute}.rage-disclaimer{z-index:5;top:max(144px, calc(env(safe-area-inset-top) + 136px));left:max(16px, env(safe-area-inset-left));color:#f3e7d8e0;pointer-events:none;background:#140d0aa6;border-radius:10px;max-width:min(340px,100vw - 32px);margin:0;padding:8px 12px;font-size:.8125rem;line-height:1.4;position:absolute}.rage-counter{z-index:5;bottom:max(150px, calc(env(safe-area-inset-bottom) + 138px));white-space:nowrap;pointer-events:none;background:#140d0ab3;border-radius:999px;margin:0;padding:7px 14px;font-size:.875rem;position:absolute;left:50%;transform:translate(-50%)}.rage-items{z-index:6;left:50%;bottom:max(52px, calc(env(safe-area-inset-bottom) + 40px));gap:8px;display:flex;position:absolute;transform:translate(-50%)}.rage-item{appearance:none;color:#f3e7d8;width:92px;font:inherit;cursor:pointer;background:#140d0ad1;border:2px solid #f3e7d833;border-radius:12px;justify-items:center;gap:3px;padding:8px 6px;font-size:.75rem;font-weight:600;display:grid}.rage-item-icon{font-size:1.75rem;line-height:1.1}.rage-item.is-on{border-color:var(--hm-gilt-hi);background:#3c1e0eeb}.rage-power{z-index:6;left:50%;bottom:max(20px, calc(env(safe-area-inset-bottom) + 10px));pointer-events:none;background:#140d0acc;border:1px solid #f3e7d84d;border-radius:999px;width:min(360px,100vw - 32px);height:12px;position:absolute;transform:translate(-50%)}.rage-power i{background:linear-gradient(90deg, var(--hm-gilt-hi), #c8102e);border-radius:999px;position:absolute;top:0;bottom:0;left:0}.rage-power span{color:#f3e7d8bf;white-space:nowrap;font-size:.75rem;position:absolute;bottom:16px;left:50%;transform:translate(-50%)}.rage-power[data-on] span{visibility:hidden}.rage-picker{z-index:6;left:max(16px, env(safe-area-inset-left));bottom:max(16px, env(safe-area-inset-bottom));background:#140d0ae6;border:1px solid #f3e7d833;border-radius:14px;width:min(330px,100vw - 32px);max-height:min(56dvh,460px);padding:12px;position:absolute;overflow-y:auto}.rage-picker-head{justify-content:space-between;align-items:center;display:flex}.rage-picker h2{margin:0;font-size:.9375rem}.rage-picker-head button{appearance:none;color:#f3e7d8;cursor:pointer;background:0 0;border:0;font-size:1.375rem}.rage-picker>p{color:#f3e7d8b3;margin:2px 0 8px;font-size:.75rem}.rage-slots{flex-wrap:wrap;gap:5px;margin-bottom:4px;display:flex}.rage-slot,.rage-chip{appearance:none;color:#f3e7d8;font:inherit;cursor:pointer;background:0 0;border:1px solid #f3e7d84d;border-radius:999px;padding:4px 9px;font-size:.75rem;font-weight:600}.rage-slot.is-on{border-color:var(--hm-gilt-hi);color:#ffe9a8}.rage-chip.is-on{color:#fff;background:#c8102e;border-color:#c8102e}.rage-group{letter-spacing:.02em;color:#f2b98c;margin:8px 0 4px;font-size:.6875rem;font-weight:700}.rage-chips{flex-wrap:wrap;gap:5px;display:flex}.rage-random{margin-top:10px}.rage-picker-toggle{z-index:6;left:max(14px, env(safe-area-inset-left));bottom:max(16px, env(safe-area-inset-bottom));color:#f3e7d8;font:inherit;background:#140d0ad9;border:1px solid #f3e7d84d;border-radius:999px;padding:9px 14px;font-size:.8125rem;font-weight:600;position:absolute}.rage-exit:focus-visible,.rage-item:focus-visible,.rage-slot:focus-visible,.rage-chip:focus-visible,.rage-enter:focus-visible,.rage-picker-toggle:focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}@media (width<=700px){.rage-items{bottom:max(56px, calc(env(safe-area-inset-bottom) + 44px));gap:6px}.rage-item{width:70px;font-size:.6875rem}.rage-item-icon{font-size:1.375rem}.cave[data-activity=rage] .cave-chat{display:none}.rage-exit{top:max(100px, calc(env(safe-area-inset-top) + 84px))}.rage-counter{bottom:auto;top:max(104px, calc(env(safe-area-inset-top) + 88px));font-size:.75rem;left:auto;right:14px;transform:none}.rage-disclaimer{top:max(150px, calc(env(safe-area-inset-top) + 134px));max-width:none;font-size:.75rem;right:16px}.rage-picker{max-height:48dvh}.rage-picker-toggle{bottom:max(156px, calc(env(safe-area-inset-bottom) + 144px))}}.cave :is(.cave-talk-hint,.cave-punch-hint,.rage-prompt,.talk-invite,.talk-asking,.challenge) kbd{background:linear-gradient(180deg, #f6e2a6, var(--hm-gilt) 62%, #a88438);min-width:1.8em;height:1.8em;color:var(--hm-ink);border:0;border-radius:6px;place-items:center;padding:0 .45em;font:900 .875rem/1 Be Vietnam Pro,system-ui,sans-serif;display:inline-grid;transform:translateY(-1px);box-shadow:0 3px #5e4719,inset 0 1px #fffae6bf,0 0 12px #ecd08c59}@media (width<=340px){.cave-bar,.cave-bar-left{gap:4px}.cave-leave{padding:10px 8px}.cave-sound{width:36px}.cave-tv-ch{width:26px}.cave-tv-vol-btn{width:24px}.cave-tele{width:36px}.cave-room-meta:before{content:none}}.duel-rank{z-index:4;left:max(16px, env(safe-area-inset-left));top:max(96px, calc(env(safe-area-inset-top) + 88px));border-radius:12px;gap:6px;width:clamp(250px,20vw,300px);padding:8px 10px 10px;font-size:.8125rem;line-height:1.35;display:grid;position:absolute}.duel-rank.is-collapsed{width:auto;padding:0}.duel-rank-head{justify-content:space-between;align-items:flex-start;gap:8px;display:flex}.duel-rank-title{margin:0;font-size:.9375rem;line-height:1.2}.duel-rank-sub{margin:2px 0 0;font-size:.6875rem}.duel-rank-board{gap:2px;display:grid}.duel-rank-board+.duel-rank-board{padding-top:6px}.duel-rank-board-title{justify-content:space-between;align-items:baseline;gap:6px;margin:0;font-size:.8125rem;display:flex}.duel-rank-board-title small{font-size:.625rem}.duel-rank-board-toggle{appearance:none;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;padding:0}.duel-rank-board-toggle small{opacity:.7}.duel-rank-board-toggle:focus-visible{outline:2px solid var(--hm-torch);outline-offset:2px;border-radius:4px}.duel-rank-list{gap:2px;margin:0;padding:0;list-style:none;display:grid}.duel-rank-row{border-radius:6px;grid-template-columns:1.6em minmax(0,1fr) auto;align-items:center;gap:6px;padding:2px 4px;display:grid}.duel-rank-pos{text-align:center;font-variant-numeric:tabular-nums}.duel-rank-name,.duel-rank-chip-name{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.duel-rank-wins{font-variant-numeric:tabular-nums;white-space:nowrap}.duel-rank-empty{margin:0}.duel-rank-chip{cursor:pointer;max-width:min(360px,100vw - 32px);font:inherit;border-radius:999px;align-items:center;gap:0;padding:5px 12px 5px 10px;font-weight:700;display:inline-flex}.duel-rank-chip-wins{font-variant-numeric:tabular-nums}.duel-rank-seg{align-items:center;gap:5px;min-width:0;padding:0 6px;display:inline-flex}.duel-rank-seg .duel-rank-chip-name{max-width:10ch}.cave[data-activity] .duel-rank{display:none}.cave:has(.cave-chat.is-touch.is-open) .duel-rank{display:none}@media (width<=640px){.duel-rank{z-index:6;width:min(300px,100vw - 32px);font-size:.75rem}.duel-rank-sub{display:none}.duel-rank.is-collapsed{z-index:4}.duel-rank-chip{border-radius:12px;flex-direction:column;align-items:stretch;gap:2px;max-width:calc(100vw + -1*min(196px,100vw - 160px) - 40px);font-size:.75rem}.duel-rank-seg{-webkit-line-clamp:3;line-clamp:3;text-align:left;overflow-wrap:anywhere;-webkit-box-orient:vertical;padding:3px 6px;line-height:1.3;display:-webkit-box;overflow:hidden}.duel-rank-seg .duel-rank-chip-name{white-space:normal;max-width:none;margin:0 4px;display:inline;overflow:visible}.duel-rank-seg .duel-rank-chip-wins{display:inline-block}}.cave-sound,.cave-tv,.cave-help-btn,.cave-chat-toggle,.cave-chat-compose,.rage-exit,.rage-picker-toggle,.rage-counter,.cave-credits summary{color:var(--hm-chalk);background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-deep));background-blend-mode:overlay, normal;border:1px solid #0000008c;border-radius:7px 5px 9px 6px;box-shadow:inset 0 1px #fff0dc24,0 6px 14px -8px #000000bf}.cave-sound[data-muted]{color:var(--hm-chalk-dim)}.cave-leave{color:var(--hm-ink);font-family:var(--hm-f-carve);background:var(--hm-grain), linear-gradient(180deg, var(--hm-limestone-hi), var(--hm-limestone) 55%, var(--hm-limestone-lo));background-blend-mode:multiply, normal;text-shadow:0 1px #ffffff80;border:0;border-radius:4px 4px 12px;font-weight:800;box-shadow:inset 0 1px #fff9,inset 0 -3px #503c2859,0 6px 14px -8px #000000b3}.cave-leave:hover{background:var(--hm-grain), linear-gradient(180deg, #f0e9db, var(--hm-limestone-hi) 55%, var(--hm-limestone))}.cave-sound-range{accent-color:var(--hm-gilt)}.cave-room{border:1px solid var(--hm-gilt);background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel-deep));box-shadow:inset 0 0 0 3px var(--hm-enamel-deep), inset 0 0 0 4px #ecd08c73, var(--hm-drop);text-align:right;border-radius:4px;padding:6px 12px 7px}.cave-room-name{font-family:var(--hm-f-carve);color:var(--hm-gilt-hi);text-shadow:0 1px #00000080;font-weight:900}.cave-room-meta{color:var(--hm-chalk)}.cave-room-num{font:900 1.05rem/1 var(--hm-f-carve);color:var(--hm-gilt-hi);font-variant-numeric:tabular-nums}.cave-help-card,.cave-poll,.cave-reconnect-box,.cave-ime,.rage-picker,.rage-disclaimer,.cave-credits-body,.talk-asking,.talk-toast,.punch-intro{color:var(--hm-chalk);background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab) 45%, var(--hm-slab-deep));background-blend-mode:overlay, normal;box-shadow:inset 0 1px 0 #fff0dc1f, inset 0 -2px 0 #0000004d, var(--hm-drop);border:1px solid #0000008c;border-radius:10px 7px 12px 8px}.cave-talk-hint,.cave-punch-hint,.rage-prompt{color:var(--hm-chalk);background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-deep));background-blend-mode:overlay, normal;box-shadow:inset 0 1px 0 #fff0dc24, 0 0 0 3px #00000040, var(--hm-drop);border:1px solid #ecd08c8c;border-radius:8px 5px 10px 6px}.cave-talk-hint strong,.cave-punch-hint strong{color:var(--hm-gilt-hi)}.cave-talk-hint.is-wait{color:var(--hm-chalk-dim);border-color:#efe9dd4d}.cave-talk-act{border-left-color:#ecd08c4d}.cave-talk-who{color:var(--hm-chalk-dim)}.cave-punch-hint{border-color:#e0234199}.cave :is(.cave-talk-hint,.cave-punch-hint,.rage-prompt,.talk-invite,.talk-asking,.cave-celebrate,.cave-poll,.challenge) kbd{background:linear-gradient(180deg, #f6e2a6, var(--hm-gilt) 62%, #a88438);color:var(--hm-ink);font-family:var(--hm-f-carve);border:0;font-weight:900;box-shadow:0 3px #5e4719,inset 0 1px #fffae6bf,0 0 12px #ecd08c59}.cave-help-card kbd{background:linear-gradient(180deg, var(--hm-limestone-hi), var(--hm-limestone-lo));color:var(--hm-ink);font-family:var(--hm-f-carve);border:0;border-radius:3px 3px 6px;font-weight:800;box-shadow:0 2px #00000080,inset 0 1px #ffffff8c}.cave-help-ok,.cave-help-ok:hover{background:linear-gradient(180deg, var(--hm-red-hi), var(--hm-red-deep));box-shadow:inset 0 0 0 1px var(--hm-gilt);font-family:var(--hm-f-carve)}.cave-chat-title{font-family:var(--hm-f-carve);color:var(--hm-gilt-hi);font-weight:800}.cave-chat-hide{color:var(--hm-chalk-dim)}.cave-chat-name{color:var(--hm-gilt-hi)}.cave-chat-name.is-self{color:#f3b48a}.cave-chat-msg,.cave-chat-empty{color:var(--hm-chalk)}.cave-chat-notice{color:var(--hm-chalk-dim)}.cave-feed-title{font-family:var(--hm-f-carve);color:#ecd08ccc}.cave-feed-item{color:#efe9ddd1}.cave-chat-tab{color:var(--hm-chalk-dim);text-shadow:0 1px 2px #000000e6}.cave-chat-tab[aria-selected=true]{color:var(--hm-gilt-hi);background:#00000073;box-shadow:inset 0 1px 2px #0009}.cave-chat-dot{background:var(--hm-red);box-shadow:0 0 0 1.5px var(--hm-gilt)}.cave-chat-form{background:#00000038;border:0;border-radius:6px;box-shadow:inset 0 2px 4px #0000008c,inset 0 -1px #fff0dc14}.cave-chat-input{color:var(--hm-chalk)}.cave-chat-input::placeholder{color:#efe9dd73}.cave-chat-send{background:linear-gradient(180deg, var(--hm-red-hi), var(--hm-red-deep));box-shadow:inset 0 0 0 1px var(--hm-gilt);color:#fff4e6;font-family:var(--hm-f-carve);border-radius:3px 3px 8px;font-weight:800}.cave-chat-badge{background:var(--hm-red);box-shadow:0 0 0 2px var(--hm-gilt)}.cave-help-title,.cave-poll-q,.cave-reconnect-title,.punch-intro-title,.cave-credits-title{font-family:var(--hm-f-carve);color:var(--hm-gilt-hi)}.cave-poll-option,.rage-chip{color:var(--hm-chalk);background:#00000040;border:1px solid #ecd08c59;border-radius:4px 4px 9px}.cave-poll-option:hover,.rage-chip:hover{border-color:var(--hm-gilt)}.rage-chip.is-on{background:var(--hm-enamel);border-color:var(--hm-gilt);color:var(--hm-gilt-hi)}.rage-item{color:var(--hm-chalk);background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-deep));background-blend-mode:overlay, normal;border:2px solid #00000080;border-radius:8px 6px 10px 7px}.rage-item.is-on{border-color:var(--hm-gilt);box-shadow:0 0 14px #ecd08c66}.cave-reconnect-box{border-color:#ffb46073}.cave-reconnect-spin{border-color:#ffb46040;border-top-color:var(--hm-torch)}.cave-net{border:1px solid var(--hm-gilt);background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel-deep));color:var(--hm-chalk);border-radius:4px}.cave-ime{border-color:#ecd08c73}.punch-intro{border-color:#e023418c}.talk-invite,.talk-confirm{color:var(--hm-chalk);background:var(--hm-grain), radial-gradient(130% 100% at 28% 0%, var(--hm-enamel-hi), var(--hm-enamel) 46%, var(--hm-enamel-deep));background-blend-mode:soft-light, normal;border:2px solid var(--hm-gilt);box-shadow:inset 0 0 0 5px var(--hm-enamel-deep), inset 0 0 0 6px #ecd08c80, var(--hm-drop);border-radius:5px}.talk-invite-who strong,.talk-confirm strong{font-family:var(--hm-f-carve);color:var(--hm-gilt-hi)}.talk-invite-who p,.talk-confirm p{color:var(--hm-chalk-dim)}.talk-btn{color:var(--hm-chalk);font-family:var(--hm-f-body);background:#00000038;border:0;border-radius:3px 3px 9px;box-shadow:inset 0 0 0 1px #efe9dd59}.talk-btn.is-ok,.talk-btn.is-send{color:#fff4e6;background:linear-gradient(180deg, var(--hm-red-hi), var(--hm-red) 55%, var(--hm-red-deep));box-shadow:inset 0 0 0 1px var(--hm-gilt), 0 6px 14px -8px #5a000fbf;font-family:var(--hm-f-carve);font-weight:800}.talk-btn.is-danger{color:var(--hm-enamel-deep);background:linear-gradient(180deg, var(--hm-limestone-hi), var(--hm-limestone));font-weight:800;box-shadow:inset 0 -2px #503c2859}.talk-bar{background:#00000059}.talk-bar i{background:var(--hm-gilt)}.talk-box{color:var(--hm-chalk);background:var(--hm-grain), linear-gradient(180deg, #2e241d, var(--hm-slab-solid) 40%, #18120e);background-blend-mode:overlay, normal;box-shadow:inset 0 1px 0 #fff0dc1a, var(--hm-drop);border:1px solid #0009;border-radius:12px 8px 14px 9px}.talk-head{border:2px solid var(--hm-gilt);background:linear-gradient(180deg, var(--hm-enamel-hi), var(--hm-enamel-deep));box-shadow:inset 0 0 0 3px var(--hm-enamel-deep), inset 0 0 0 4px #ecd08c66;border-radius:5px;padding:10px 12px}.talk-who strong{font-family:var(--hm-f-carve);color:var(--hm-gilt-hi);font-weight:900}.talk-state{border-block-color:#ecd08c40}.talk-msg{background:#efe9dd1a}.talk-msg.is-mine{background:linear-gradient(180deg, var(--hm-red-hi), var(--hm-red-deep))}.talk-form input{background:#00000061;border:0;box-shadow:inset 0 2px 4px #0009,inset 0 -1px #fff0dc14}.talk-confirm{text-align:center}.cave-celebrate{color:#fff4e6;font-family:var(--hm-f-carve);background:var(--hm-grain), linear-gradient(180deg, var(--hm-red-hi), var(--hm-red) 55%, var(--hm-red-deep));background-blend-mode:soft-light, normal;box-shadow:inset 0 0 0 2px var(--hm-gilt), inset 0 0 0 3px #00000040, 0 10px 22px -10px #5a000fcc;border:0;border-radius:4px 4px 14px;font-weight:800}.notice{border-block:1px solid #ecd08c73}.notice-main strong{color:var(--hm-gilt-hi)}.notice[data-kind=duel_result]{border-block-color:var(--hm-gilt);background:linear-gradient(90deg,#0000,#7a1424eb 16% 84%,#0000)}.cave-punch,.cave-talk{color:var(--hm-chalk);background:var(--hm-grain), radial-gradient(circle at 38% 30%, #4a3d32, var(--hm-slab-solid) 70%);background-blend-mode:overlay, normal}.cave-talk{box-shadow:0 0 0 3px #3d7fb8,0 0 0 5px #00000073,0 8px 18px -8px #000c}.cave-talk.is-duel{box-shadow:0 0 0 3px var(--hm-red), 0 0 0 5px #00000073, 0 8px 18px -8px #000c}.cave-stick{background:var(--hm-grain), radial-gradient(circle, #2a221c8c, #18130fb3);background-blend-mode:overlay, normal;border-color:#ecd08c59}.cave-stick-knob{background:radial-gradient(circle at 38% 32%, var(--hm-red-hi), var(--hm-red-deep));border-color:var(--hm-gilt-hi)}.cave :is(button,input,summary,a):focus-visible{outline:3px solid var(--hm-torch);outline-offset:2px}@media (width<=640px){.cave-room{padding:4px 9px 5px}}.cave-chat-msg.is-system{border-left:3px solid var(--hm-gilt-hi);white-space:pre-wrap;background:#00000073;padding:2px 6px}.cave-chat-msg.is-system .cave-chat-name{color:var(--hm-gilt-hi)}.cave-tv-seg{background:#00000059;box-shadow:inset 0 1px 2px #0009}.cave-tv-ch{color:var(--hm-chalk-dim)}.cave-tv-ch:hover:not(:disabled,[aria-checked=true]){color:var(--hm-chalk);background:#fff0dc14}.cave-tv-ch[aria-checked=true]{color:#fff;background:linear-gradient(180deg, var(--hm-red-hi), var(--hm-red) 55%, var(--hm-red-deep));box-shadow:inset 0 0 0 1px var(--hm-gilt), 0 1px 3px #00000080}.cave-tv-vol-btn{color:inherit}.cave-tv[data-silent] .cave-tv-vol-btn{opacity:.7}.cave-tv-pop{color:var(--hm-chalk);background:var(--hm-grain), linear-gradient(180deg, #3a3029, var(--hm-slab-solid));background-blend-mode:overlay, normal;box-shadow:inset 0 1px 0 #fff0dc24, var(--hm-drop);border:1px solid #0009;border-radius:10px 8px 12px 9px}.cave-tv-title{color:var(--hm-gilt-hi)}.cave-tv-pct,.cave-tv-note{color:var(--hm-chalk-dim)}.duel-rank{color:var(--hm-chalk);background:linear-gradient(90deg,#140d0a9e,#140d0a61 70%,#140d0a1f)}.duel-rank.is-collapsed{background:0 0}.duel-rank-title{font-family:var(--hm-f-carve);color:var(--hm-gilt-hi);text-shadow:0 1px 2px #000000b3;font-weight:900}.duel-rank-sub,.duel-rank-empty,.duel-rank-wins small{color:var(--hm-chalk-dim)}.duel-rank-row{text-shadow:0 1px 2px #000000bf}.duel-rank-row.is-top{background:#ecd08c1f;box-shadow:inset 0 0 0 1px #ecd08c73}.duel-rank-board+.duel-rank-board{border-top:1px dashed #ecd08c40}.duel-rank-board-title{font-family:var(--hm-f-carve);color:var(--hm-chalk);text-shadow:0 1px 2px #000000b3;font-weight:800}.duel-rank-board-title small,.duel-rank-name small{font-family:var(--hm-f-body);color:var(--hm-chalk-dim);font-weight:500}.duel-rank-seg+.duel-rank-seg{border-left:1px solid #ecd08c4d}.duel-rank-row.is-top .duel-rank-name{color:var(--hm-gilt-hi);font-weight:800}.duel-rank-wins{font-family:var(--hm-f-carve);font-weight:800}.duel-rank-hide{color:var(--hm-chalk-dim);font:inherit;cursor:pointer;background:#140d0a80;border:1px solid #efe9dd40;border-radius:999px;flex:none;padding:2px 10px;font-size:.75rem}.duel-rank-chip{background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-deep));background-blend-mode:overlay, normal;color:var(--hm-chalk);box-shadow:var(--hm-drop);border:1px solid #ecd08c8c}.duel-rank-chip-wins{background:var(--hm-gilt);color:var(--hm-ink);font-family:var(--hm-f-carve);border-radius:999px;padding:0 6px}.duel-rank-chip:focus-visible,.duel-rank-hide:focus-visible{outline:2px solid var(--hm-torch);outline-offset:2px}@media (width<=640px){.duel-rank:not(.is-collapsed){background:var(--hm-grain), linear-gradient(180deg, var(--hm-slab-hi), var(--hm-slab-deep));background-blend-mode:overlay, normal;box-shadow:var(--hm-drop);border:1px solid #ecd08c66}.duel-rank-seg+.duel-rank-seg{border-top:1px solid #ecd08c4d;border-left:0}} diff --git a/frontend/styles/home.css b/frontend/styles/home.css index 12f3433fb6b7099ea2d813575bbc8c249d741372..c622d1523fadb41100076ba03123800b1f7e4d51 100644 --- a/frontend/styles/home.css +++ b/frontend/styles/home.css @@ -74,7 +74,7 @@ html, body { position: relative; min-height: 100dvh; display: grid; - grid-template-rows: 1fr auto auto; + grid-template-rows: auto 1fr auto auto; align-items: start; justify-items: center; gap: 10px; @@ -84,11 +84,6 @@ html, body { radial-gradient(120% 90% at 50% 0%, #2b1d12 0%, #140f0c 70%), #120b08; } -/* Khuôn hình: hàng 1 (1fr) là khoảng trống đàn hồi đẩy bảng bia XUỐNG DƯỚI; - bảng bia (HANG TU TRÍ AI / AI V.AI STUDIO) nằm ngay TRÊN nhóm nút - (Group Zalo + Cài đặt app + Thông báo). Dòng footer disclaimer đã bỏ. */ -.home-panel { grid-column: 1; grid-row: 2; } -.home-links { grid-column: 1; grid-row: 3; align-self: end; } .home-scene { position: absolute; inset: 0; @@ -239,11 +234,11 @@ html, body { gap: 8px; color: #fff; text-decoration: none; - background: linear-gradient(#0068ff, #0052cc); + background: linear-gradient(#2aabee, #1b8bc2); border-radius: 999px; padding: 9px 16px; font: 700 .9rem var(--hm-f-body); - box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 6px 18px -6px #0068ffcc; + box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 6px 18px -6px #229ed9cc; } .home-tele:hover { filter: brightness(1.08); } .home-install, .home-push { flex: none; } @@ -271,6 +266,22 @@ html, body { } .pwa-glyph { flex: none; } +/* ============ HOME FOOTER ============ */ +.home-footer { + z-index: 1; + text-align: center; + color: rgba(243,231,216,.55); + font-size: .78rem; + line-height: 1.5; + padding: 0 12px; +} +.home-footer .legal-link { + color: rgba(243,231,216,.75); + text-decoration: underline; + background: none; border: 0; cursor: pointer; + font: inherit; +} + /* ============ TALLY (đếm trong hang) ============ */ .tally { display: inline-flex; diff --git a/frontend/styles/playlist.css b/frontend/styles/playlist.css deleted file mode 100644 index e308d1aa48afce4cb66f4e9cee9ff0adce115a03..0000000000000000000000000000000000000000 --- a/frontend/styles/playlist.css +++ /dev/null @@ -1,176 +0,0 @@ -/* ========================================================================= - V116 — CSS cho PLAYLIST MÀN HÌNH LỚN (nút mở/đóng danh sách video) - ------------------------------------------------------------------------- - VÌ SAO CẦN FILE NÀY: - Trước V116, BoardVideoOverlay render
- nhưng KHÔNG có một dòng CSS nào cho .board-playbar trong cả 5 file - stylesheet được phục vụ (heritage, main, cavescreen, home, slab). - Hệ quả: danh sách video LUÔN hiện, không style, đè lên màn hình 3D. - - V116 đổi thành: một NÚT .board-playbar-toggle, danh sách là PANEL ẨN chỉ - hiện khi có class .is-open (React state playbarOpen trong app.js). - - LƯU Ý KIẾN TRÚC (quan trọng, đừng sửa lại): - frontend/styles/* được COPY THẲNG từ source repo vào image runtime - (`COPY frontend/styles ./frontend/styles`), KHÔNG đi qua build stage. - Vì vậy CSS phải nằm ở FILE TRONG REPO (như file này), không được sinh - ra lúc build — xem lại bài học v82. - ========================================================================= */ - -/* ---------------- NÚT MỞ / ĐÓNG ---------------- */ -.board-playbar-toggle { - position: fixed; - left: max(14px, env(safe-area-inset-left)); - bottom: max(14px, env(safe-area-inset-bottom)); - z-index: 900; - display: inline-flex; - align-items: center; - gap: 7px; - appearance: none; - cursor: pointer; - color: #fff4e6; - background: linear-gradient(180deg, rgba(38, 24, 14, .96), rgba(20, 13, 8, .96)); - border: 1px solid rgba(236, 208, 140, .55); - border-radius: 999px; - padding: 9px 15px; - font: 700 .8rem/1 "Be Vietnam Pro", system-ui, sans-serif; - box-shadow: 0 8px 22px -10px #000c, inset 0 1px rgba(255, 255, 255, .09); - transition: background .15s ease, transform .12s ease, border-color .15s ease; -} -.board-playbar-toggle:hover { - background: linear-gradient(180deg, rgba(52, 33, 18, .98), rgba(28, 18, 11, .98)); - border-color: rgba(236, 208, 140, .9); -} -.board-playbar-toggle:active { transform: scale(.96); } -.board-playbar-toggle:focus-visible { - outline: 2px solid #ffd76a; - outline-offset: 3px; -} -.board-playbar-toggle.is-active { - border-color: #ffd76a; - background: linear-gradient(180deg, rgba(200, 16, 46, .96), rgba(120, 8, 26, .96)); -} -.board-playbar-toggle-label { - white-space: nowrap; -} -/* trên máy nhỏ, chữ "Playlist" thu lại, chỉ còn icon cho gọn */ -@media (max-width: 420px) { - .board-playbar-toggle { padding: 9px 12px; } - .board-playbar-toggle-label { display: none; } -} - -/* ---------------- PANEL DANH SÁCH (ẨN mặc định) ---------------- */ -.board-playbar { - /* ẨN HOÀN TOÀN khi chưa bấm nút — đây chính là yêu cầu (5). */ - display: none; - position: fixed; - left: max(14px, env(safe-area-inset-left)); - /* nằm NGAY TRÊN nút, không đè joystick ở đáy màn hình */ - bottom: calc(max(14px, env(safe-area-inset-bottom)) + 52px); - z-index: 899; - width: min(340px, calc(100vw - 28px)); - max-height: min(52vh, 380px); - overflow-y: auto; - overscroll-behavior: contain; - -webkit-overflow-scrolling: touch; - padding: 10px; - color: #efe9dd; - background: rgba(14, 10, 8, .96); - border: 1px solid rgba(236, 208, 140, .45); - border-radius: 14px; - box-shadow: 0 18px 50px -14px #000, inset 0 1px rgba(255, 255, 255, .06); - -webkit-backdrop-filter: blur(8px); - backdrop-filter: blur(8px); - animation: board-playbar-in .16s ease-out both; -} -.board-playbar.is-open { display: block; } - -@keyframes board-playbar-in { - from { opacity: 0; transform: translateY(8px); } - to { opacity: 1; transform: translateY(0); } -} -@media (prefers-reduced-motion: reduce) { - .board-playbar { animation: none; } -} - -.board-playbar-label { - display: block; - margin: 0 0 8px 2px; - color: #ffd76a; - font: 800 .72rem/1.2 "Be Vietnam Pro", system-ui, sans-serif; - letter-spacing: .06em; - text-transform: uppercase; -} - -/* ---------------- TỪNG THẺ VIDEO ---------------- */ -.board-playbar-btns { - display: flex; - flex-direction: column; - gap: 7px; -} -.board-playbar-card { - appearance: none; - cursor: pointer; - display: flex; - align-items: center; - gap: 9px; - width: 100%; - padding: 6px 8px; - text-align: left; - color: #efe9dd; - background: rgba(255, 255, 255, .055); - border: 1px solid rgba(236, 208, 140, .16); - border-radius: 10px; - font: 600 .78rem/1.3 "Be Vietnam Pro", system-ui, sans-serif; - transition: background .14s ease, border-color .14s ease; -} -.board-playbar-card:hover { - background: rgba(255, 255, 255, .11); - border-color: rgba(236, 208, 140, .45); -} -.board-playbar-card:focus-visible { - outline: 2px solid #ffd76a; - outline-offset: 2px; -} -/* bài ĐANG phát — cùng tông vàng với bảng vàng điểm danh */ -.board-playbar-card.is-playing { - background: rgba(255, 215, 106, .16); - border-color: #ffd76a; -} -.board-playbar-card.is-playing .board-playbar-title { color: #fff6d8; } - -.board-playbar-thumb { - flex: 0 0 auto; - width: 64px; - height: 36px; - border-radius: 6px; - background-color: rgba(0, 0, 0, .55); - background-position: center; - background-size: cover; - background-repeat: no-repeat; - display: inline-flex; - align-items: center; - justify-content: center; - color: #ffd76a; - font: 800 .8rem/1 "Be Vietnam Pro", system-ui, sans-serif; -} - -.board-playbar-title { - flex: 1 1 auto; - min-width: 0; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - color: #efe9dd; -} - -/* ---------------- MÀN HÌNH NHỎ ---------------- */ -@media (max-width: 640px) { - .board-playbar { - width: min(300px, calc(100vw - 20px)); - max-height: 44vh; - bottom: calc(max(14px, env(safe-area-inset-bottom)) + 110px); - } - .board-playbar-thumb { width: 56px; height: 32px; } -} diff --git a/patch_v101.mjs b/patch_v101.mjs deleted file mode 100644 index 82cbb1e171074cd022c2ef13e543f9dcce83dff6..0000000000000000000000000000000000000000 --- a/patch_v101.mjs +++ /dev/null @@ -1,76 +0,0 @@ -/* patch_v101.mjs — FORCE REMOVE + + BUMP VERSION - Chạy sau patch_v98, trước esbuild. - Phiên bản 3: dùng string replace trực tiếp, không regex. */ -import fs from 'node:fs'; -import path from 'node:path'; - -const ROOT = process.argv[2] || '.'; -let n = 0; -const ok = (m) => { n++; console.log('[v101] OK: ' + m); }; -const warn = (m) => console.warn('[v101] WARN: ' + m); -const read = (f) => fs.readFileSync(path.join(ROOT, f), 'utf8'); -const save = (f, s) => fs.writeFileSync(path.join(ROOT, f), s); -const has = (f) => fs.existsSync(path.join(ROOT, f)); - -const F_CAVE = 'frontend/cave3d.js'; - -// === 1) GỠ — dùng string replace trực tiếp === -try { - let s = read(F_CAVE); - const before = s.length; - - // Thử nhiều cách xóa - // Cách 1: xóa dòng " \n" - s = s.replace(' \n', ''); - s = s.replace(' \n', ''); - s = s.replace(' \r\n', ''); - s = s.replace(' \r\n', ''); - // Cách 2: xóa với indent khác - s = s.replace(/\n\s*/g, ''); - // Cách 3: xóa mọi - s = s.replace(/]*\/>/g, ''); - // Cách 4: xóa - s = s.replace(/]*>[\s\S]*?<\/LegendRing>/g, ''); - - if (s.length < before) { save(F_CAVE, s); ok('GỠ (giảm ' + (before - s.length) + ' bytes)'); } - if (!read(F_CAVE).includes('LegendRing')) ok('Xác nhận: đã xóa hoàn toàn'); - else warn(' VẪN CÒN!'); -} catch (e) { warn('LegendRing: ' + e.message); } - -// === 2) GỠ === -try { - let s = read(F_CAVE); - const before = s.length; - - s = s.replace(' \n', ''); - s = s.replace(' \n', ''); - s = s.replace(' \r\n', ''); - s = s.replace(' \r\n', ''); - s = s.replace(/\n\s*/g, ''); - s = s.replace(/]*\/>/g, ''); - s = s.replace(/]*>[\s\S]*?<\/LegendWall>/g, ''); - - if (s.length < before) { save(F_CAVE, s); ok('GỠ (giảm ' + (before - s.length) + ' bytes)'); } - if (!read(F_CAVE).includes('LegendWall')) ok('Xác nhận: đã xóa hoàn toàn'); - else warn(' VẪN CÒN!'); -} catch (e) { warn('LegendWall: ' + e.message); } - -// === 3) BUMP VERSION → v101 + cache-bust ?v=101 === -try { - const b = read('backend.py'); - const nb = b.replace(/VERSION_ID = "v\d+"/, 'VERSION_ID = "v101"'); - if (nb !== b) { save('backend.py', nb); ok('backend.py: VERSION_ID -> v101'); } - else ok('backend.py: VERSION_ID đã là v101 (idem)'); -} catch (e) { warn('version: ' + e.message); } - -for (const ip of ['frontend/index.html', 'index.html']) { - if (!has(ip)) continue; - try { - const h = read(ip); - const nh = h.replace(/\?v=\d+/g, '?v=101'); - if (nh !== h) { save(ip, nh); ok(ip + ': cache-bust ?v=101'); } - else ok(ip + ': cache-bust đã là ?v=101 (idem)'); - } catch (e) { warn(ip + ': ' + e.message); } -} - -console.log('[v101] DONE: ' + n + ' muc'); \ No newline at end of file diff --git a/patch_v102.mjs b/patch_v102.mjs deleted file mode 100644 index 258dc9ed4d868b6b31edba1be68e6582bf75ae32..0000000000000000000000000000000000000000 --- a/patch_v102.mjs +++ /dev/null @@ -1,170 +0,0 @@ -/* patch_v102.mjs — DEFINITIVE FIX: xóa và - Chạy CUỐI CÙNG sau patch_v101, trước esbuild. - Phiên bản 4: đọc file, tìm chính xác chuỗi, xóa, ghi lại. */ -import fs from 'node:fs'; -import path from 'node:path'; - -const ROOT = process.argv[2] || '.'; -const read = (f) => fs.readFileSync(path.join(ROOT, f), 'utf8'); -const save = (f, s) => fs.writeFileSync(path.join(ROOT, f), s); -const log = (m) => console.log('[v102] ' + m); - -const F_CAVE = 'frontend/cave3d.js'; - -let s = read(F_CAVE); -const origLen = s.length; -log('File length before: ' + origLen); - -// === XÓA === -// Tìm tất cả vị trí -let idx = 0; -let removed = 0; -while ((idx = s.indexOf(' đóng thẻ - let end = idx + 1; - let depth = 0; - let inQuote = false; - let quoteChar = ''; - for (; end < s.length; end++) { - const ch = s[end]; - if (inQuote) { - if (ch === quoteChar && s[end-1] !== '\\') inQuote = false; - } else { - if (ch === '"' || ch === "'") { inQuote = true; quoteChar = ch; } - else if (ch === '>') { - // Check if self-closing (previous non-whitespace char is /) - let prev = end - 1; - while (prev > idx && (s[prev] === ' ' || s[prev] === '\t' || s[prev] === '\n' || s[prev] === '\r')) prev--; - if (s[prev] === '/') { - // Self-closing: - // Also remove trailing newline - let removeEnd = end + 1; - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - s = s.substring(0, idx) + s.substring(removeEnd); - removed++; - log('Removed self-closing '); - break; - } else { - // Opening tag: - // Find matching - const closeIdx = s.indexOf('', end + 1); - if (closeIdx !== -1) { - let removeEnd = closeIdx + ''.length; - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - s = s.substring(0, idx) + s.substring(removeEnd); - removed++; - log('Removed ...'); - break; - } else { - // No closing tag found, skip past this tag - end++; - break; - } - } - } - } - } - if (end >= s.length) break; -} - -if (removed > 0) { - save(F_CAVE, s); - log('Removed ' + removed + ' occurrences'); -} - -// === XÓA === -idx = 0; -removed = 0; -while ((idx = s.indexOf('') { - let prev = end - 1; - while (prev > idx && (s[prev] === ' ' || s[prev] === '\t' || s[prev] === '\n' || s[prev] === '\r')) prev--; - if (s[prev] === '/') { - let removeEnd = end + 1; - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - s = s.substring(0, idx) + s.substring(removeEnd); - removed++; - log('Removed self-closing '); - break; - } else { - const closeIdx = s.indexOf('', end + 1); - if (closeIdx !== -1) { - let removeEnd = closeIdx + ''.length; - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - s = s.substring(0, idx) + s.substring(removeEnd); - removed++; - log('Removed ...'); - break; - } else { - end++; - break; - } - } - } - } - } - if (end >= s.length) break; -} - -if (removed > 0) { - save(F_CAVE, s); - log('Removed ' + removed + ' occurrences'); -} - -// === VERIFY === -s = read(F_CAVE); -const hasRing = s.includes('LegendRing'); -const hasWall = s.includes('LegendWall'); -log('After patch: hasLegendRing=' + hasRing + ', hasLegendWall=' + hasWall); -log('File length after: ' + s.length + ' (delta: ' + (origLen - s.length) + ' bytes)'); - -if (!hasRing && !hasWall) { - log('✅ SUCCESS: LegendRing and LegendWall completely removed'); -} else { - log('❌ WARNING: LegendRing or LegendWall still present!'); - // Debug: show context - if (hasRing) { - const i = s.indexOf(' v102'); } - else log('backend.py: VERSION_ID already v102'); -} catch (e) { log('version: ' + e.message); } - -for (const ip of ['frontend/index.html', 'index.html']) { - if (!fs.existsSync(path.join(ROOT, ip))) continue; - try { - const h = read(ip); - const nh = h.replace(/\?v=\d+/g, '?v=102'); - if (nh !== h) { save(ip, nh); log(ip + ': cache-bust ?v=102'); } - else log(ip + ': cache-bust already ?v=102'); - } catch (e) { log(ip + ': ' + e.message); } -} - -log('DONE'); \ No newline at end of file diff --git a/patch_v103.mjs b/patch_v103.mjs deleted file mode 100644 index 604a087b267808df3b42611d6f5291d16d93eee4..0000000000000000000000000000000000000000 --- a/patch_v103.mjs +++ /dev/null @@ -1,187 +0,0 @@ -/* patch_v103.mjs — BYTE-LEVEL FIX: xóa và - Chạy CUỐI CÙNG sau patch_v102, trước esbuild. - Đọc file dưới dạng buffer, tìm byte chính xác, xóa, ghi lại. */ -import fs from 'node:fs'; -import path from 'node:path'; - -const ROOT = process.argv[2] || '.'; -const log = (m) => console.log('[v103] ' + m); - -const F_CAVE = 'frontend/cave3d.js'; -const filePath = path.join(ROOT, F_CAVE); - -// Read as buffer -const buf = fs.readFileSync(filePath); -log('File size: ' + buf.length + ' bytes'); - -// Convert to string (utf8) -let s = buf.toString('utf8'); -const origLen = s.length; - -// === TÌM VÀ XÓA đóng thẻ, xử lý cả trường hợp có dấu / trước > - let end = idx + 1; - let inQuote = false; - let quoteChar = ''; - let foundEnd = false; - for (; end < s.length; end++) { - const ch = s[end]; - if (inQuote) { - if (ch === quoteChar && s[end - 1] !== '\\') inQuote = false; - } else { - if (ch === '"' || ch === "'") { inQuote = true; quoteChar = ch; } - else if (ch === '>') { - // Check nếu là self-closing (có / trước >, bỏ qua whitespace) - let prev = end - 1; - while (prev > idx && /\s/.test(s[prev])) prev--; - if (s[prev] === '/') { - // Self-closing: - let removeEnd = end + 1; - // Xóa cả newline phía sau - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - log('Self-closing at ' + idx + '..' + removeEnd + ', removing'); - s = s.substring(0, idx) + s.substring(removeEnd); - count++; - foundEnd = true; - break; - } else { - // Opening tag: — tìm - const closeIdx = s.indexOf('', end + 1); - if (closeIdx !== -1) { - let removeEnd = closeIdx + ''.length; - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - log('Block at ' + idx + '..' + removeEnd + ', removing'); - s = s.substring(0, idx) + s.substring(removeEnd); - count++; - foundEnd = true; - break; - } else { - // Không tìm thấy closing tag — bỏ qua - log('No closing tag found for 0) { - fs.writeFileSync(filePath, s, 'utf8'); - log('Removed ' + count + ' occurrences'); -} - -// === TÌM VÀ XÓA ') { - let prev = end - 1; - while (prev > idx && /\s/.test(s[prev])) prev--; - if (s[prev] === '/') { - let removeEnd = end + 1; - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - log('Self-closing at ' + idx + '..' + removeEnd + ', removing'); - s = s.substring(0, idx) + s.substring(removeEnd); - count++; - foundEnd = true; - break; - } else { - const closeIdx = s.indexOf('', end + 1); - if (closeIdx !== -1) { - let removeEnd = closeIdx + ''.length; - if (s[removeEnd] === '\r') removeEnd++; - if (s[removeEnd] === '\n') removeEnd++; - log('Block at ' + idx + '..' + removeEnd + ', removing'); - s = s.substring(0, idx) + s.substring(removeEnd); - count++; - foundEnd = true; - break; - } else { - log('No closing tag found for 0) { - fs.writeFileSync(filePath, s, 'utf8'); - log('Removed ' + count + ' occurrences'); -} - -// === VERIFY === -const final = fs.readFileSync(filePath, 'utf8'); -const hasRing = final.includes('LegendRing'); -const hasWall = final.includes('LegendWall'); -log('After: hasLegendRing=' + hasRing + ', hasLegendWall=' + hasWall); -log('Char length: ' + origLen + ' -> ' + final.length + ' (delta: ' + (origLen - final.length) + ')'); - -if (!hasRing && !hasWall) { - log('✅ SUCCESS: LegendRing and LegendWall completely removed'); -} else { - log('❌ WARNING: Still present!'); - // Show context - if (hasRing) { - const i = final.indexOf(' v103'); } - else log('backend.py: VERSION_ID already v103'); -} catch (e) { log('version: ' + e.message); } - -for (const ip of ['frontend/index.html', 'index.html']) { - const fp = path.join(ROOT, ip); - if (!fs.existsSync(fp)) continue; - try { - const h = fs.readFileSync(fp, 'utf8'); - const nh = h.replace(/\?v=\d+/g, '?v=103'); - if (nh !== h) { fs.writeFileSync(fp, nh, 'utf8'); log(ip + ': cache-bust ?v=103'); } - else log(ip + ': cache-bust already ?v=103'); - } catch (e) { log(ip + ': ' + e.message); } -} - -log('DONE'); \ No newline at end of file diff --git a/patch_v108.mjs b/patch_v108.mjs deleted file mode 100644 index 9f69133d63a2c517a612f2334ae75da8b36aa78a..0000000000000000000000000000000000000000 --- a/patch_v108.mjs +++ /dev/null @@ -1,6 +0,0 @@ -// V108: NO-OP. patch_v100 da lam tat ca 4 thay doi: -// 1) Ao vang + logo V.AI STUDIO (yellowKitTex + isYellowKit) -// 2) Tay gon + lich su (9 muc) -// 3) Dung yen khong chay (moving guard) -// File nay giu lai de Docker build khong fail khi goi node patch_v108.mjs. -console.log('[V108] SKIP: patch_v100 da ap dung 4 thay doi (ao vang + tay gon + dung yen). Khong can lam gi them.') \ No newline at end of file diff --git a/patch_v109.mjs b/patch_v109.mjs deleted file mode 100644 index 28b99753982bcb367f83c564ca0b056ee920f856..0000000000000000000000000000000000000000 --- a/patch_v109.mjs +++ /dev/null @@ -1,324 +0,0 @@ -/* patch_v109.mjs — V109. Chay TRONG Docker build: SAU patch_v103.mjs, TRUOC esbuild. - ------------------------------------------------------------------------- - (1) NHAN VAT: AO VANG + LOGO "V.AI STUDIO" SAU AO. - patch_v98 de MAC DINH la ao DO MU: - isMuKit = (p.kit == null) || color === '#c8102e' -> muKitTex() (do) - isYellowKit = color === '#fdbd10' -> chi khi tu chon kit - => mac dinh KHONG BAO GIO thay ao vang. V109: p.kit == null -> VANG. - Logo KHONG the ve trong texture than ao: UV capsule trai u quanh CHU VI, - nen mot hinh tron o "nua duoi canvas" thanh VANH quanh BUNG, khong phai - sau lung. V109 dan MOT MAT PHANG rieng, dat CUNG CHO va CUNG PHIA voi - "so ao sau lung" cua chinh repo nay (plane z = -0.31 trong PlayerAvatar, - phia huong ve camera third-person), va GOP so ao + logo vao 1 texture de - khong de len nhau. - - (2) TAY GON, LICH SU. patch_v98 thu vai 0.34 -> 0.285 trong khi ban kinh than - ao = 0.30 nen tay LAN VAO THAN, mat ranh gioi tay/ao. V109 dat vai 0.335: - o cao do ban kinh than ~0.27, tay r 0.058 => mep trong 0.277 sat vai, mep - ngoai 0.393 lo ra ro rang. Bap tay / cang tay / ban tay thu nho them. - - (3) DUNG YEN = KHONG CO DONG TAC CHAY. patch_v98 chi dua vao p.anim. Nhung - p.anim cua nguoi KHAC do server gui, va Movement chi goi Net.update khi - pos/rot/anim DOI -> dung yen thi server KHONG gui lai 'idle' -> avatar ho - dung yen van chay tay chan mai. V109 do DICH CHUYEN THAT cua p.pos moi - khung hinh: <= 0.012 world => A = 0 => tay/chan ve 0, khong nhun. - Dung cho ca minh va nguoi khac. - - (4) BO TAM BANG TRONG + 3 BONG DEN + MAI BAN NGUYET truoc bang ghe. - Do la (patch_v91) dat [0,-0.7,-22] — NGAY TRUOC bang - ghe (BENCHES: z = -37 .. -26.6) — co MAI VOM BAN NGUYET - torusGeometry args={[W_/2 + 0.35, 0.34, 8, 24, Math.PI]} va 3 BONG DEN - (2 sphere lamp hai ben + 1 pointLight hat mat bia). patch_v93/95 chi sua - BIA NGOAI SAN (home3d.js) chu KHONG go cho mount trong hang -> no van nam - do. V109 go han cho MOUNT , giu lai dinh nghia - component de khong vo tham chieu nao. - KHONG dong toi (man hinh lon phat video) — co guard rieng. - - AN TOAN: backup app.js + cave3d.js; sau khi sua thi VALIDATE bang chinh - esbuild (loader jsx) + guard bundle markers. Neu bat ky loi -> RESTORE ban - truoc va exit 0. Nghia la anchor lech KHONG BAO GIO lam sap Space. - ------------------------------------------------------------------------- */ -import fs from 'node:fs' -import path from 'node:path' - -const ROOT = process.argv[2] || '.' -let n = 0 -const ok = (m) => { n++; console.log('[v109] OK: ' + m) } -const warn = (m) => console.warn('[v109] WARN: ' + m) -const P = (...a) => path.join(ROOT, ...a) -const has = (f) => fs.existsSync(P(f)) -const read = (f) => fs.readFileSync(P(f), 'utf8') -const save = (f, s) => fs.writeFileSync(P(f), s) -const Q = String.fromCharCode(34) - -const BAK = {} -for (const f of ['frontend/app.js', 'frontend/cave3d.js']) if (has(f)) BAK[f] = read(f) - -function cutFn(src, name) { - const m = new RegExp('function\\s+' + name + '\\s*\\([^)]*\\)\\s*\\{').exec(src) - if (!m) return null - const start = src.indexOf('{', m.index) - let d = 0 - for (let k = start; k < src.length; k++) { - if (src[k] === '{') d++ - else if (src[k] === '}') { d--; if (d === 0) return [m.index, k + 1] } - } - return null -} - -/* ============ 1) AO VANG MAC DINH + LOGO SAU AO ============ */ -try { - const f = 'frontend/app.js' - if (!has(f)) throw new Error('app.js missing') - let s = read(f) - let hit = 0 - - const U1 = " const isMuKit = (p.kit == null) || color === '#c8102e'\n const isYellowKit = color === '#fdbd10'" - const U1N = [ - ' /* V109: MAC DINH = AO VANG V.AI STUDIO (khong con ao do MU). */', - " const isYellowKit = (p.kit == null) || color === '#fdbd10'", - " const isMuKit = (p.kit != null) && color === '#c8102e'", - ].join('\n') - if (s.includes('V109: MAC DINH = AO VANG')) ok('app.js: mac dinh ao vang (idem)') - else if (s.includes(U1)) { s = s.replace(U1, U1N); hit++; ok('app.js: MAC DINH -> AO VANG') } - else warn('app.js: KHONG THAY khoi isMuKit/isYellowKit') - - const MAPO = 'map={isMuKit ? muKitTex() : (isYellowKit ? yellowKitTex() : null)}' - const MAPN = 'map={isYellowKit ? yellowKitTex() : (isMuKit ? muKitTex() : null)}' - if (s.includes(MAPO)) { s = s.split(MAPO).join(MAPN); hit++; ok('app.js: than ao -> yellowKitTex uu tien') } - else if (s.includes(MAPN)) ok('app.js: than ao uu tien yellowKitTex (idem)') - else warn('app.js: KHONG THAY map than ao') - - /* CHI doi color THAN AO (material co metalness={0.08}). Tay ao la material - khac, KHONG co metalness — doi ca tay sang trang se lam tay bi trang. */ - const CO = "color={isMuKit ? '#c8102e' : (isYellowKit ? '#f5c518' : color)} roughness={0.72} metalness={0.08}" - const CN = "color={isYellowKit ? '#ffffff' : (isMuKit ? '#c8102e' : color)} roughness={0.72} metalness={0.08}" - if (s.includes(CO)) { s = s.split(CO).join(CN); hit++; ok('app.js: than ao color -> #ffffff (khong nhan doi mau)') } - else if (s.includes(CN)) ok('app.js: than ao color da la #ffffff (idem)') - else warn('app.js: KHONG THAY color than ao') - - if (s.includes('const _YKit = { _tex: null }')) { - s = s.replace(/^[ \t]*const _YKit = \{ _tex: null \}[ \t]*\r?\n/gm, '') - hit++ - ok('app.js: go khai bao _YKit cu (tranh trung lap const)') - } - - const YK = [ - '/* V109: AO VANG V.AI STUDIO — texture than ao. Capsule UV: u trai quanh', - ' CHU VI, v theo CHIEU CAO => CHI ve dai NGANG (co ao tren, gau ao duoi)', - ' + van doc lap lai deu. Khong ve hinh tron / chu dat lech: se thanh vanh', - ' quanh BUNG chu khong phai sau lung. Logo nam o backPlateTex (duoi). */', - 'const _YKit = { _tex: null }', - 'function yellowKitTex() {', - ' if (_YKit._tex) return _YKit._tex', - ' const c = document.createElement(' + Q + 'canvas' + Q + '); c.width = 256; c.height = 320', - ' const g = c.getContext(' + Q + '2d' + Q + ')', - ' const gr = g.createLinearGradient(0, 0, 0, 320)', - ' gr.addColorStop(0, ' + Q + '#ffdf4f' + Q + '); gr.addColorStop(0.5, ' + Q + '#f5c518' + Q + '); gr.addColorStop(1, ' + Q + '#d9a800' + Q + ')', - ' g.fillStyle = gr; g.fillRect(0, 0, 256, 320)', - ' g.fillStyle = ' + Q + 'rgba(255,255,255,0.07)' + Q, - ' for (let xi = 0; xi < 256; xi += 32) g.fillRect(xi, 0, 14, 320)', - ' g.fillStyle = ' + Q + '#1f2937' + Q + '; g.fillRect(0, 0, 256, 26)', - ' g.fillStyle = ' + Q + '#f7f4ec' + Q + '; g.fillRect(0, 26, 256, 7)', - ' g.fillStyle = ' + Q + '#1f2937' + Q + '; g.fillRect(0, 306, 256, 14)', - ' g.fillStyle = ' + Q + '#f7f4ec' + Q + '; g.fillRect(0, 298, 256, 7)', - ' const t = new THREE.CanvasTexture(c)', - ' t.colorSpace = THREE.SRGBColorSpace', - ' t.anisotropy = 8; t.needsUpdate = true', - ' _YKit._tex = t', - ' return t', - '}', - '', - '/* V109: MAT SAU AO — GOP "so ao" + logo "V.AI STUDIO" vao MOT texture de', - ' khong de len nhau. Cung toa do z (-0.31) va cung phia voi plane so ao cu', - ' trong PlayerAvatar (phia huong ve camera third-person). */', - 'const _backTexCache = {}', - 'function backPlateTex(number) {', - ' const key = number == null ? ' + Q + 'none' + Q + ' : String(number)', - ' if (_backTexCache[key]) return _backTexCache[key]', - ' const c = document.createElement(' + Q + 'canvas' + Q + '); c.width = 256; c.height = 256', - ' const g = c.getContext(' + Q + '2d' + Q + ')', - ' g.clearRect(0, 0, 256, 256)', - ' g.fillStyle = ' + Q + 'rgba(20,24,30,0.92)' + Q, - ' g.beginPath()', - ' if (g.roundRect) { g.roundRect(16, 16, 224, 224, 34); g.fill() }', - ' else { g.rect(16, 16, 224, 224); g.fill() }', - ' g.strokeStyle = ' + Q + '#ffe863' + Q + '; g.lineWidth = 7', - ' g.beginPath()', - ' if (g.roundRect) { g.roundRect(16, 16, 224, 224, 34); g.stroke() }', - ' else { g.rect(16, 16, 224, 224); g.stroke() }', - ' g.textAlign = ' + Q + 'center' + Q + '; g.textBaseline = ' + Q + 'middle' + Q, - ' if (number != null && String(number) !== ' + Q + Q + ') {', - ' g.font = ' + Q + '900 116px Arial, sans-serif' + Q, - ' g.lineWidth = 12; g.strokeStyle = ' + Q + '#0b0f14' + Q, - ' g.strokeText(String(number), 128, 104)', - ' g.fillStyle = ' + Q + '#ffffff' + Q, - ' g.fillText(String(number), 128, 104)', - ' g.fillStyle = ' + Q + '#ffe863' + Q, - ' g.font = ' + Q + '900 40px sans-serif' + Q, - ' g.fillText(' + Q + 'V.AI' + Q + ', 128, 180)', - ' g.fillStyle = ' + Q + '#f7f4ec' + Q, - ' g.font = ' + Q + '800 20px sans-serif' + Q, - ' g.fillText(' + Q + 'STUDIO' + Q + ', 128, 210)', - ' } else {', - ' g.fillStyle = ' + Q + '#ffe863' + Q, - ' g.font = ' + Q + '900 76px sans-serif' + Q, - ' g.fillText(' + Q + 'V.AI' + Q + ', 128, 108)', - ' g.fillStyle = ' + Q + '#f7f4ec' + Q, - ' g.font = ' + Q + '800 34px sans-serif' + Q, - ' g.fillText(' + Q + 'STUDIO' + Q + ', 128, 162)', - ' }', - ' const t = new THREE.CanvasTexture(c)', - ' t.colorSpace = THREE.SRGBColorSpace', - ' t.anisotropy = 8; t.needsUpdate = true', - ' _backTexCache[key] = t', - ' return t', - '}', - '', - ].join('\n') - - if (s.includes('function backPlateTex')) ok('app.js: yellowKitTex/backPlateTex (idem)') - else { - const cut = cutFn(s, 'yellowKitTex') - if (!cut) throw new Error('KHONG THAY function yellowKitTex()') - s = s.slice(0, cut[0]) + YK + s.slice(cut[1]) - hit++ - ok('app.js: yellowKitTex viet lai + them backPlateTex') - } - - const NRE = /[ \t]*\{p\.number != null && \(\r?\n[ \t]*\r?\n[ \t]*\r?\n[ \t]*\r?\n[ \t]*<\/mesh>\r?\n[ \t]*\)\}/ - const NN = [ - ' {/* V109: MAT SAU AO — logo "V.AI STUDIO" (+ so ao neu co) trong MOT', - ' texture. Dung toa do va phia cua plane so ao cu (z=-0.31).', - ' DoubleSide de nhin duoc ca khi camera xoay vong. */}', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - if (s.includes('map={backPlateTex(p.number)}')) ok('app.js: mat sau ao (idem)') - else if (NRE.test(s)) { s = s.replace(NRE, NN); hit++; ok('app.js: mat sau ao -> logo + so ao') } - else warn('app.js: KHONG THAY khoi {p.number != null && (...)}') - - let arm = 0 - for (const pr of [ - ['position={[-0.285, 1.3, 0]}', 'position={[-0.335, 1.3, 0]}'], - ['position={[0.285, 1.3, 0]}', 'position={[0.335, 1.3, 0]}'], - ['args={[0.062, 0.22, 4, 8]}', 'args={[0.058, 0.22, 4, 8]}'], - ['args={[0.048, 0.2, 4, 8]}', 'args={[0.045, 0.2, 4, 8]}'], - ['args={[0.05, 8, 8]}', 'args={[0.048, 8, 8]}'], - ]) if (s.includes(pr[0])) { s = s.split(pr[0]).join(pr[1]); arm++ } - if (arm) { hit++; ok('app.js: TAY gon — vai 0.335 + tay nho (' + arm + ' muc)') } - else ok('app.js: tay da gon (idem)') - - const SOCK = '' - if (s.includes(SOCK)) { - s = s.split(SOCK).join('') - hit++ - ok('app.js: tat -> vang cho dong bo voi ao') - } - - if (hit) save(f, s) -} catch (e) { warn('app.js: ' + String((e && e.message) || e)) } - -/* ============ 2) DUNG YEN = KHONG CHAY ============ */ -try { - const f = 'frontend/app.js' - let s = read(f) - let hit = 0 - - if (!s.includes('_vaiLastPos')) { - const R = ' const bob = React.useRef(0)' - if (!s.includes(R)) throw new Error('KHONG THAY const bob = React.useRef(0)') - s = s.replace(R, R + '\n const _vaiLastPos = React.useRef(null)') - hit++ - ok('app.js: them _vaiLastPos') - } else ok('app.js: _vaiLastPos (idem)') - - const AO = "const A = p.anim === 'run' ? 14 : (p.anim === 'walk' ? 8 : 0)" - const AN = [ - '/* V109: DUNG YEN = KHONG CHAY. Do DICH CHUYEN THAT cua p.pos thay vi tin', - ' p.anim — server chi gui anim khi CO THAY DOI, nen nguoi dung yen khong', - ' bao gio nhan lai idle va tay chan chay mai. */', - ' const _vx = p.pos.x, _vz = p.pos.z', - ' const _vp = _vaiLastPos.current', - ' const _vMoved = !_vp || Math.hypot(_vx - _vp.x, _vz - _vp.z) > 0.012', - ' _vaiLastPos.current = { x: _vx, z: _vz }', - " const A = !_vMoved ? 0 : (p.anim === 'run' ? 14 : (p.anim === 'walk' ? 8 : 0))", - ].join('\n') - if (s.includes(AO)) { s = s.split(AO).join(AN); hit++; ok('app.js: DUNG YEN -> A=0') } - else if (s.includes('const A = !_vMoved ? 0')) ok('app.js: guard dung yen (idem)') - else warn('app.js: KHONG THAY dong tinh A') - - if (hit) save(f, s) -} catch (e) { warn('app.js anim: ' + String((e && e.message) || e)) } - -/* ============ 3) BO TAM BANG TRONG + 3 BONG DEN + MAI BAN NGUYET ============ */ -try { - const f = 'frontend/cave3d.js' - if (!has(f)) throw new Error('cave3d.js missing') - let s = read(f) - const b = s.length - s = s.replace(/^[ \t]*]*?\/>[ \t]*\r?\n/gm, '') - s = s.replace(/^[ \t]*]*>[\s\S]*?<\/VaiEntranceStele>[ \t]*\r?\n/gm, '') - if (s.length < b) { save(f, s); ok('cave3d: GO (' + (b - s.length) + 'B)') } - else ok('cave3d: khong con cho mount VaiEntranceStele (idem)') -} catch (e) { warn('cave3d stele: ' + String((e && e.message) || e)) } - -/* ============ 4) GUARD + VALIDATE BANG ESBUILD, loi thi RESTORE ============ */ -let restored = false -try { - const bad = [] - for (const sp of [ - ['frontend/app.js', ['function PlayerAvatar(', '', 'function Benches(', 'function LegendRing(']], - ]) { - const f = sp[0] - if (!has(f)) continue - const t = read(f) - for (const m of sp[1]) if (!t.includes(m)) bad.push(f + ' thieu: ' + m) - } - const app = read('frontend/app.js') - const cave = read('frontend/cave3d.js') - if ((app.match(/function yellowKitTex\(/g) || []).length !== 1) bad.push('app.js: yellowKitTex != 1 lan') - if ((app.match(/const _YKit = /g) || []).length !== 1) bad.push('app.js: _YKit != 1 lan') - - /* Chi chan cho MOUNT ( hoac >), KHONG chan dinh nghia - "function VaiEntranceStele(" — ta co y giu lai dinh nghia. */ - if (/]/.test(cave)) bad.push('cave3d: van con cho mount v109') } - } - for (const ip of ['frontend/index.html', 'index.html']) { - if (!has(ip)) continue - const h = read(ip) - const nh = h.replace(/\?v=\d+/g, '?v=109') - if (nh !== h) { save(ip, nh); ok(ip + ': cache-bust -> ?v=109') } - } -} catch (e) { warn('version: ' + String((e && e.message) || e)) } - -console.log('[v109] DONE: ' + n + ' muc ap dung') -process.exit(0) diff --git a/patch_v112.mjs b/patch_v112.mjs deleted file mode 100644 index 53e5f3a0940e43f7ab1060f06798985b3c7f1555..0000000000000000000000000000000000000000 --- a/patch_v112.mjs +++ /dev/null @@ -1,844 +0,0 @@ -/* patch_v112.mjs — V112. Chay TRONG Docker build: SAU patch_v109.mjs, TRUOC esbuild. - ========================================================================= - HUONG NHAN VAT / CAMERA — chung minh TU CODE, khong phai doan: - - (1) NHAN VAT QUAY MAT VE +z: - app.js, Movement loop: - rot = Math.atan2(mx, mz) - nx = pos.x + Math.sin(rot) * speed * 0.016 - nz = pos.z + Math.cos(rot) * speed * 0.016 - => huong "tien" cua nhan vat = (sin rot, cos rot) = +z khi rot = 0. - => MAT huong +z, LUNG huong -z. - - (2) CAMERA O PHIA -z (sau lung): - CameraRig: back = (sin(yaw), 0, cos(yaw)); ideal = target + back*dist - camState.yaw = Math.PI (mac dinh) => back = (0, 0, -1) - => camera dat o target + (0,0,-1)*9 = phia -z, nhin ve +z. - => camera thay LUNG nhan vat. Khop (1). - - (3) XAC NHAN LOI CHU NGUOC: - patch_v109 dat plane so ao + logo o z = -0.315, side = DoubleSide. - Camera o -z nhin vao MAT SAU plane => chu lat nguoc. Dung loi user bao. - - (4) XAC NHAN LOI "KHONG CO MAT": - plane mat goc o z = -0.215 (sau dau, phia camera) nhung material KHONG - co DoubleSide (FrontSide, phap tuyen +z) => camera o -z nhin vao mat sau - => bi cull => VO HINH. Ngoai ra toc goc thetaLength 0.72 PI phu kin tu - dinh xuong QUA duong xich (129.6 do) o moi phi => trum kin ca mat. - - => KET LUAN: so ao / logo / ten (in tren LUNG ao) phai o -z, huong ra -z. - Mat (truoc dau) phai o +z, huong ra +z. - - LOI 1 — CHU BI NGUOC (so ao + "V.AI STUDIO"). - => Thay plane phang + DoubleSide bang MAT CONG (cylinderGeometry mot cung - tru) quanh theta = PI. - CylinderGeometry: x = r*sin(theta), z = r*cos(theta) - theta = PI => (0, -r) tuc -z ; phap tuyen huong ra ngoai (-z). - UV: u tang theo theta, tu +x sang -x. - Camera o -z nhin ve +z: right = cross(viewDir, up) - = cross((0,0,1),(0,1,0)) = (-1,0,0) => screen-right = -x - => x duong (u=0) nam ben TRAI khung hinh => chu doc DUNG chieu. - Chi mot mat => khong the lat du xoay kieu gi. - - LOI 2 — KHONG CO MAT. - => Mat = MAT CAU CAT (sphereGeometry) o +z. - SphereGeometry: x = -r*cos(phi)*sin(th), y = r*cos(th), - z = r*sin(phi)*sin(th) - phi = 0.5*PI => +z . th do tu +Y xuong. - Lay phi 0.28..0.72 PI (tam 0.5 PI) va th 0.34..0.64 PI. - => TOC: doi tu cap 0.72 PI (trum kin mat, xuong qua duong xich) thanh cap - 0.30 PI (54 do) chi phu DINH dau, chua lo chan may. - - NOI DUNG V112: - (1) So ao + logo "V.AI STUDIO" tren LUNG ao — mat cong, doc dung chieu. - (2) Bang ten nhan vat in tren LUNG ao, ngay TREN so — mat cong, doc dung. - (3) Mat: long may + long trang + long den + diem sang + MUI + MIENG - (cuoi / noi / chop mat). - (4) CAO THAP CAN DOI: AVATAR_SCALE 1 -> 0.94, dau 0.25 -> 0.24. - Cao 1.91 -> ~1.79 world. KHONG doi Y cua than/co/vai: capsule co chieu - cao tong = length + 2*radius nen giam length khong ha duoc dinh than, - chi lam dau lun vao than hoac ho ra co. - (5) QUAN AO LICH SU: ao polo vang co co ao nau + vien trang + gau ao; quan - nau dam (thay quan den bong); that lung + khoa kim loai; tat kem. - (6) GIANG SINH: thay ngon lua (FirePit) va cup (Trophy) giua hang bang - : cay thong lon co DEN NHAP NHAY, ngoi sao, bong trang - tri, tat, qua; nguoi tuyet; ong gia Noel. Van giu anh sang am. - - BAN KINH MAT CONG — tinh theo hinh hoc that cua than ao: - than = capsuleGeometry(0.30, 0.26) o y = 1.0 - => tong cao 0.26 + 2*0.30 = 0.86 => y 0.57 .. 1.43 - => tru y 0.87 .. 1.13, chop cau tam 1.13 ban kinh 0.30 - ban kinh than tai y : 0.99 -> 0.300 ; 1.21 -> 0.289 - => so ao r = 0.312 tai y = 0.99 (cach 0.012) - ten r = 0.298 tai y = 1.21 (cach 0.009) - Khong dat sat 0.300/0.289 (z-fight); khong dat xa (thanh tam bia lo lung — - dung loi cua v109 voi plane phang rong 0.46 o z = -0.315). - - GUARD: chi dem DONG MOUNT JSX that (^[ \t]* tu restore. - - AN TOAN: backup + validate bang esbuild (loader jsx) + guard marker; loi thi - RESTORE ca 2 file va exit 0 => khong bao gio lam sap Space. - ========================================================================= */ -import fs from 'node:fs' -import path from 'node:path' - -const ROOT = process.argv[2] || '.' -let n = 0 -const ok = (m) => { n++; console.log('[v112] OK: ' + m) } -const warn = (m) => console.warn('[v112] WARN: ' + m) -const P = (...a) => path.join(ROOT, ...a) -const has = (f) => fs.existsSync(P(f)) -const read = (f) => fs.readFileSync(P(f), 'utf8') -const save = (f, s) => fs.writeFileSync(P(f), s) - -const BAK = {} -for (const f of ['frontend/app.js', 'frontend/cave3d.js']) if (has(f)) BAK[f] = read(f) - -function cutFn(src, name) { - const m = new RegExp('function\\s+' + name + '\\s*\\([^)]*\\)\\s*\\{').exec(src) - if (!m) return null - const start = src.indexOf('{', m.index) - let d = 0 - for (let k = start; k < src.length; k++) { - if (src[k] === '{') d++ - else if (src[k] === '}') { d--; if (d === 0) return [m.index, k + 1] } - } - return null -} - -/* ===================================================================== - A) app.js — nhan vat - ===================================================================== */ -try { - const f = 'frontend/app.js' - if (!has(f)) throw new Error('app.js missing') - let s = read(f) - let hit = 0 - - /* ---------- A1. QUAN AO LICH SU: quan den -> nau dam ---------- */ - let pn = 0 - for (const pr of [ - ['', - ''], - ['', - ''], - ]) if (s.includes(pr[0])) { s = s.split(pr[0]).join(pr[1]); pn++ } - if (pn) { hit++; ok('app.js: quan den -> nau dam (' + pn + ' muc, lich su hon)') } - else if (s.includes('color={0x2b3a55}')) ok('app.js: quan nau dam (idem)') - else warn('app.js: KHONG THAY mau quan 0x14141f') - - /* tat: v109 doi 0xc8102e -> 0xf2c200 ; V112 -> kem */ - if (s.includes('')) { - s = s.split('') - .join('') - hit++; ok('app.js: tat vang choi -> tat kem (lich su)') - } else if (s.includes('color={0xf0ede6}')) ok('app.js: tat kem (idem)') - else warn('app.js: KHONG THAY tat 0xf2c200') - - /* ---------- A2. THAT LUNG + KHOA KIM LOAI ---------- - y = 0.78 nam trong chop cau DUOI cua than ao (tam 0.87, r 0.30) - => ban kinh than tai do = sqrt(0.30^2 - 0.09^2) = 0.2863 - dai rong 0.302 => cach 0.016, om sat ma khong z-fight. - khoa o z = -0.301 (phia camera) nen nhin thay ro. */ - const HIPKEY = ' \n ' - const BELT = HIPKEY + [ - '', - '', - ' {/* V112: THAT LUNG + KHOA KIM LOAI — quan ao lich su hon. */}', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - if (s.includes('V112: THAT LUNG')) ok('app.js: that lung (idem)') - else if (s.includes(HIPKEY)) { s = s.replace(HIPKEY, BELT); hit++; ok('app.js: them that lung + khoa kim loai') } - else warn('app.js: KHONG THAY khoi HONG de chen that lung') - - /* ---------- A3. TAY AO mau vai polo ---------- */ - const SLV = '' - if (s.includes(SLV)) { - s = s.split(SLV).join("") - hit++; ok('app.js: tay ao -> vang polo (khong con mau tuy chon)') - } else if (s.includes("isYellowKit ? '#f5c518' : color")) ok('app.js: tay ao vang polo (idem)') - else warn('app.js: KHONG THAY tay ao color={color}') - - /* ---------- A4. CAO THAP CAN DOI ---------- */ - if (s.includes('const AVATAR_SCALE = 1\n')) { - s = s.replace('const AVATAR_SCALE = 1\n', 'const AVATAR_SCALE = 0.94\n') - hit++; ok('app.js: AVATAR_SCALE 1 -> 0.94 (cao 1.91 -> 1.79)') - } else if (s.includes('const AVATAR_SCALE = 0.94')) ok('app.js: AVATAR_SCALE 0.94 (idem)') - else warn('app.js: KHONG THAY const AVATAR_SCALE = 1') - - const HEADOLD = [ - ' ', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - const HEADNEW = [ - ' ', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - if (s.includes('args={[0.24, 22, 20]}')) ok('app.js: dau 0.24 (idem)') - else if (s.includes(HEADOLD)) { s = s.replace(HEADOLD, HEADNEW); hit++; ok('app.js: dau 0.25 -> 0.24 (can doi hon voi than)') } - else warn('app.js: KHONG THAY khoi DAU') - - /* ---------- A5. AO POLO VANG ---------- */ - if (s.includes('const _YKit = { _tex: null }')) { - s = s.replace(/^[ \t]*const _YKit = \{ _tex: null \}[ \t]*\r?\n/gm, '') - } - const YK = `/* V112: AO POLO VANG V.AI STUDIO — lich su, gon gang. - Capsule UV: u trai quanh CHU VI, v theo CHIEU CAO => CHI ve dai NGANG - (co ao tren cung, vien trang, gau ao duoi). Ten + so ao la mat cong rieng. */ -const _YKit = { _tex: null } -function yellowKitTex() { - if (_YKit._tex) return _YKit._tex - const c = document.createElement('canvas'); c.width = 256; c.height = 320 - const g = c.getContext('2d') - const gr = g.createLinearGradient(0, 0, 0, 320) - gr.addColorStop(0, '#ffe15a'); gr.addColorStop(0.55, '#f5c518'); gr.addColorStop(1, '#e0ad00') - g.fillStyle = gr; g.fillRect(0, 0, 256, 320) - g.fillStyle = 'rgba(255,255,255,0.06)' - for (let xi = 0; xi < 256; xi += 32) g.fillRect(xi, 0, 10, 320) - g.fillStyle = '#22304d'; g.fillRect(0, 0, 256, 34) - g.fillStyle = '#f7f4ec'; g.fillRect(0, 34, 256, 6) - g.fillStyle = 'rgba(255,255,255,0.30)'; g.fillRect(0, 40, 256, 3) - g.fillStyle = '#f7f4ec'; g.fillRect(0, 296, 256, 6) - g.fillStyle = '#22304d'; g.fillRect(0, 302, 256, 18) - const t = new THREE.CanvasTexture(c) - t.colorSpace = THREE.SRGBColorSpace - t.anisotropy = 8; t.needsUpdate = true - _YKit._tex = t - return t -} -` - if (s.includes('V112: AO POLO VANG')) ok('app.js: ao polo vang (idem)') - else { - const cut = cutFn(s, 'yellowKitTex') - if (!cut) { - const anchor = 'function PlayerAvatar({ id, p, isLocal }) {' - if (!s.includes(anchor)) throw new Error('KHONG THAY yellowKitTex / PlayerAvatar') - s = s.replace(anchor, YK + anchor); hit++; ok('app.js: them ao polo vang') - } else { s = s.slice(0, cut[0]) + YK + s.slice(cut[1]); hit++; ok('app.js: ao polo vang (co ao + vien + gau)') } - } - - /* ---------- A6. BANG TEN + SO AO: mat cong o -z (lung ao) ---------- */ - const TAG = `/* V112: BANG TEN + SO AO — MAT CONG (cat mot cung tru), KHONG DoubleSide. - Camera third-person o local -z (CameraRig: back = (sin yaw, cos yaw) voi - yaw = PI => camera o -z). CylinderGeometry: x = r*sin(t), z = r*cos(t); - cung quanh t = PI => z < 0 (phia camera), phap tuyen huong ra ngoai. - u tang theo t tu +x sang -x. Camera o -z nhin ve +z co screen-right = -x, - nen x > 0 (u = 0) o ben TRAI khung hinh => chu doc DUNG chieu. */ -const _tagCache = {} -function nameTagTex(name) { - const key = 'n|' + String(name || '') - if (_tagCache[key]) return _tagCache[key] - const c = document.createElement('canvas'); c.width = 512; c.height = 128 - const g = c.getContext('2d') - g.clearRect(0, 0, 512, 128) - g.fillStyle = 'rgba(22,28,40,0.92)' - g.beginPath() - if (g.roundRect) { g.roundRect(8, 28, 496, 72, 16); g.fill() } else { g.rect(8, 28, 496, 72); g.fill() } - g.strokeStyle = '#ffe863'; g.lineWidth = 5 - g.beginPath() - if (g.roundRect) { g.roundRect(8, 28, 496, 72, 16); g.stroke() } else { g.rect(8, 28, 496, 72); g.stroke() } - g.textAlign = 'center'; g.textBaseline = 'middle' - let label = String(name || 'ANH EM') - if (label.length > 16) label = label.slice(0, 15) + String.fromCharCode(8230) - let fs = 52 - for (; fs > 20; fs -= 2) { g.font = '800 ' + fs + 'px sans-serif'; if (g.measureText(label).width < 440) break } - g.fillStyle = '#ffffff' - g.fillText(label, 256, 65) - const t = new THREE.CanvasTexture(c) - t.colorSpace = THREE.SRGBColorSpace - t.anisotropy = 8; t.needsUpdate = true - _tagCache[key] = t - return t -} -/* Canvas 320x200 (ti le 1.6) khop cung tru rong r*1.7 = 0.53 x cao 0.33 => - chu so khong bi keo gian doc. */ -function backTagTex(number) { - const key = 'b|' + String(number == null ? '' : number) - if (_tagCache[key]) return _tagCache[key] - const c = document.createElement('canvas'); c.width = 320; c.height = 200 - const g = c.getContext('2d') - g.clearRect(0, 0, 320, 200) - g.textAlign = 'center'; g.textBaseline = 'middle' - const got = number != null && String(number) !== '' - if (got) { - g.font = '900 112px Arial, sans-serif' - g.lineWidth = 14; g.strokeStyle = 'rgba(20,26,38,0.5)' - g.strokeText(String(number), 160, 74) - g.fillStyle = '#ffffff' - g.fillText(String(number), 160, 74) - } - g.fillStyle = '#22304d' - g.font = '900 40px sans-serif' - g.fillText('V.AI', 160, got ? 148 : 82) - g.fillStyle = 'rgba(34,48,77,0.92)' - g.font = '800 24px sans-serif' - g.fillText('STUDIO', 160, got ? 176 : 122) - const t = new THREE.CanvasTexture(c) - t.colorSpace = THREE.SRGBColorSpace - t.anisotropy = 8; t.needsUpdate = true - _tagCache[key] = t - return t -} -` - if (s.includes('function nameTagTex(')) ok('app.js: nameTagTex/backTagTex (idem)') - else { - const a1 = 'const _faceTexCache = {}' - const a2 = 'function PlayerAvatar({ id, p, isLocal }) {' - if (s.includes(a1)) { s = s.replace(a1, TAG + a1); hit++; ok('app.js: them nameTagTex + backTagTex') } - else if (s.includes(a2)) { s = s.replace(a2, TAG + a2); hit++; ok('app.js: them nameTagTex + backTagTex') } - else throw new Error('KHONG THAY anchor de chen nameTagTex') - } - - const CONE = ` {/* V112: BANG TEN nhan vat in tren LUNG ao, ngay TREN so — mat cong - quanh theta = PI (-z, phia camera). y = 1.21, ban kinh than 0.289 - => dat 0.298. */} - - - - - {/* V112: SO AO + "V.AI STUDIO" in tren LUNG ao — mat cong quanh theta = PI - (-z). y = 0.99, ban kinh than dung 0.300 => dat 0.312. - Chi mot mat huong ra ngoai nen KHONG the lat nguoc (khac plane phang - + DoubleSide cua v109). */} - - - - -` - if (s.includes('V112: BANG TEN')) ok('app.js: 2 mat cong ten/so (idem)') - else { - let done = false - const RE109 = /[ \t]*\{\/\* V109: MAT SAU AO[\s\S]*?<\/mesh>\r?\n/ - if (RE109.test(s)) { s = s.replace(RE109, CONE); done = true } - if (!done) { - const RE0 = /[ \t]*\{p\.number != null && \(\r?\n[ \t]* y tu +0.118 den -0.105 so voi tam dau (vung mat). */ - const FACEMESH = ` {/* V112: MAT — mat CAU CAT o phia +z (TRUOC dau). Plane cu o z=-0.215 - huong +z nen camera o -z nhin vao MAT SAU => bi cull => vo hinh. - Sphere: z = r*sin(phi)*sin(th); phi 0.28..0.72 PI (tam 0.5 PI = +z) - => z > 0, phap tuyen huong +z => hien khi nhin tu truoc. - r = 0.2455 (dau 0.24) => noi ra 0.0055, du chong z-fight. */} - - - - ` - if (s.includes('V112: MAT — mat CAU CAT')) ok('app.js: mat cau cat (idem)') - else { - const RE = /[ \t]*\{\/\* mặt: plane trước đầu[\s\S]*?<\/mesh>/ - const RE2 = /[\s\S]*?<\/mesh>/ - if (RE.test(s)) { s = s.replace(RE, FACEMESH); hit++; ok('app.js: mat -> cau cat +z (hien duoc)') } - else if (RE2.test(s)) { s = s.replace(RE2, FACEMESH); hit++; ok('app.js: mat -> cau cat +z (hien duoc)') } - else warn('app.js: KHONG THAY khoi mat dau') - } - - /* ---------- A8. TOC ---------- - Goc: sphereGeometry(0.25, 16, 12, 0, 2PI, 0, 0.72PI) + scale [1.06,0.82,1.06] - thetaLength 0.72 PI = 129.6 do tinh tu dinh => phu tu dinh xuong QUA - duong xich o MOI phi => trum kin ca mat. - V112: cap 0.30 PI = 54 do, chi phu DINH dau. - r = 0.2465 x scaleXZ 1.035 = 0.2551 ; truc y 0.2465 + offset 0.015 - => dinh toc y = 0.2615 > dinh dau 0.24 (doi ra ngoai, dung). - mep duoi toc y = 0.2465*cos(54 do) + 0.015 = 0.1599 - dinh mat y = 0.118 => chua 0.042 lam TRAN. - Toc phu kin mat => vung da lo ra moi thay long may / mat / mui / mieng. */ - const HAIRNEW = [ - ' {/* V112: TOC — cap ngan tren DINH dau. Ban goc thetaLength 0.72 PI', - ' phu tu dinh xuong qua duong xich o moi phi => trum kin ca mat.', - ' 0.30 PI (54 do) => chi phu dinh, chua lo chan may / mat / mui. */}', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - const HAIRBLOCK = [ - ' {/* tóc đen ngắn kiểu cầu thủ */}', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - if (s.includes('V112: TOC')) ok('app.js: toc cap ngan (idem)') - else if (s.includes(HAIRBLOCK)) { s = s.replace(HAIRBLOCK, HAIRNEW); hit++; ok('app.js: toc cap ngan lai, lo mat') } - else { - const HR = /[ \t]*\{\/\* tóc đen ngắn kiểu cầu thủ \*\/\}\r?\n[ \t]*[\s\S]*?<\/mesh>/ - if (HR.test(s)) { s = s.replace(HR, HAIRNEW); hit++; ok('app.js: toc cap ngan lai (regex)') } - else { - const H2 = '' - if (s.includes(H2)) { - s = s.split(H2).join('') - hit++; ok('app.js: toc cap ngan lai (fallback tham so)') - } else warn('app.js: KHONG THAY toc') - } - } - - /* ---------- A9. KHUON MAT ---------- - Mat cau cat: rong cung = r * phiLength = 0.2455 * 0.44PI = 0.339 - cao cung = r * thetaLength = 0.2455 * 0.30PI = 0.2314 - => ti le 1.465, canvas 256 x 168 = 1.524 (gan nhat, khong keo gian ro). */ - if (s.includes('V112: KHUON MAT')) ok('app.js: makeFaceTex moi (idem)') - else { - const cut = cutFn(s, 'makeFaceTex') - if (!cut) throw new Error('KHONG THAY makeFaceTex') - let start = cut[0] - const pre = s.slice(Math.max(0, start - 120), start) - const mpre = /const _faceTexCache = \{\}\r?\n[ \t]*$/.exec(pre) - if (mpre) start = start - mpre[0].length - const FACE = `/* V112: KHUON MAT — long may + long trang + long den + diem sang + - MUI + MIENG. Ban goc chi co 2 cham mat + 1 cung mieng, khong co mui. - Canvas 256x168 (ti le 1.52) khop cung cau phi 0.44 PI x th 0.30 PI cua dau - r 0.2455 (rong 0.339 x cao 0.231) => khong bi keo gian ro. - Goc toa do o tam (128, 84); moi net nam trong y 20..150. */ -const _faceTexCache = {} -function makeFaceTex(seed, mood) { - const key = seed + '|' + mood - if (_faceTexCache[key]) return _faceTexCache[key] - const c = document.createElement('canvas'); c.width = 256; c.height = 168 - const g = c.getContext('2d') - g.clearRect(0, 0, 256, 168) - g.translate(128, 84) - const ink = '#20150c' - const rng = mulberry(seed * 1000 + 7) - const dx = (rng() - 0.5) * 12 - const ey = -26 + (rng() - 0.5) * 6 - g.lineCap = 'round' - /* LONG MAY */ - g.strokeStyle = ink; g.lineWidth = 7 - g.beginPath(); g.moveTo(-52 + dx, ey - 15); g.quadraticCurveTo(-35 + dx, ey - 23, -16 + dx, ey - 14); g.stroke() - g.beginPath(); g.moveTo(16 + dx, ey - 14); g.quadraticCurveTo(35 + dx, ey - 23, 52 + dx, ey - 15); g.stroke() - if (mood === 'blink') { - g.strokeStyle = ink; g.lineWidth = 9 - g.beginPath(); g.moveTo(-44 + dx, ey); g.lineTo(-16 + dx, ey); g.stroke() - g.beginPath(); g.moveTo(16 + dx, ey); g.lineTo(44 + dx, ey); g.stroke() - } else { - /* LONG TRANG */ - g.fillStyle = '#ffffff' - g.beginPath(); g.ellipse(-30 + dx, ey, 13, 15, 0, 0, Math.PI * 2); g.fill() - g.beginPath(); g.ellipse(30 + dx, ey, 13, 15, 0, 0, Math.PI * 2); g.fill() - /* LONG DEN */ - g.fillStyle = '#2b1c10' - g.beginPath(); g.arc(-28 + dx, ey + 1, 7.4, 0, Math.PI * 2); g.fill() - g.beginPath(); g.arc(32 + dx, ey + 1, 7.4, 0, Math.PI * 2); g.fill() - /* DIEM SANG */ - g.fillStyle = '#ffffff' - g.beginPath(); g.arc(-30.8 + dx, ey - 2.4, 3.2, 0, Math.PI * 2); g.fill() - g.beginPath(); g.arc(29.2 + dx, ey - 2.4, 3.2, 0, Math.PI * 2); g.fill() - } - /* MUI — net cong nhe */ - g.strokeStyle = 'rgba(154,99,68,0.9)'; g.lineWidth = 5 - g.beginPath(); g.moveTo(0 + dx, ey + 6); g.quadraticCurveTo(8 + dx, ey + 20, -3 + dx, ey + 23); g.stroke() - /* MIENG */ - g.strokeStyle = ink; g.lineWidth = 8 - if (mood === 'talk') { - g.fillStyle = '#5d2a22' - g.beginPath(); g.ellipse(0 + dx, ey + 50, 13, 17, 0, 0, Math.PI * 2); g.fill() - } else if (mood === 'happy') { - g.beginPath(); g.arc(0 + dx, ey + 36, 23, 0.10 * Math.PI, 0.90 * Math.PI); g.stroke() - } else { - g.beginPath(); g.arc(0 + dx, ey + 40, 16, 0.16 * Math.PI, 0.84 * Math.PI); g.stroke() - } - const tex = new THREE.CanvasTexture(c) - tex.colorSpace = THREE.SRGBColorSpace - _faceTexCache[key] = tex - return tex -} -` - s = s.slice(0, start) + FACE + s.slice(cut[1]) - hit++; ok('app.js: mat co long may + long den + mui + mieng') - } - - save(f, s) -} catch (e) { warn('app.js: ' + String((e && e.message) || e)) } - -/* ===================================================================== - B) cave3d.js — GIANG SINH thay ngon lua + cup - ===================================================================== */ -try { - const f = 'frontend/cave3d.js' - if (!has(f)) throw new Error('cave3d.js missing') - let s = read(f) - let hit = 0 - - const XMAS = `/* ========================================================================= - V112: GIANG SINH GIUA HANG — thay ngon lua (FirePit) va cup (Trophy). - Cay thong lon co DEN NHAP NHAY, ngoi sao, bong trang tri, tat, qua; nguoi - tuyet; ong gia Noel. Giu anh sang am (FirePit cu intensity 100) de hang - khong bi toi. Tat ca nam trong long ho (ban kinh ho CAVE.pitRadius = 7, - mat ho -CAVE.pitDepth = -2.4) nen khong de len bac thang / bang ghe. - ========================================================================= */ -function ChristmasGrove() { - const pitY = -CAVE.pitDepth - const bulbGroup = useRef(null) - const treeRef = useRef(null) - const rand = useMemo(() => mulberry(4242), []) - - /* Ban kinh tan cay tai do cao y (local cua cay). Tan = 5 hinh non xep tang, - moi non cao 3.3 => nua chieu cao 1.65. Ban kinh giam tuyen tinh tu day - (r0) len dinh (0): tai do cao y, t = (dinh - y) / 3.3. Lay MAX qua cac - non vi be mat ngoai la non rong nhat. */ - const treeR = (y) => { - let best = 0.05 - for (let i = 0; i < 5; i++) { - const cy = 1.5 + i * 2.5 - const r0 = 4.7 - i * 0.88 - const t = (cy + 1.65 - y) / 3.3 - if (t > 0 && t <= 1) best = Math.max(best, r0 * t) - } - return best - } - - /* DEN NHAP NHAY: xoan oc tu goc len ngon, bam sat mat tan */ - const bulbs = useMemo(() => { - const out = [] - const N = 108 - for (let i = 0; i < N; i++) { - const t = i / N - const y = 0.95 + t * 12.1 - const r = treeR(y) + 0.13 - const a = i * 2.399963 - out.push({ x: Math.cos(a) * r, y, z: Math.sin(a) * r, c: i % 4 }) - } - return out - }, [rand]) - - /* BONG TRANG TRI */ - const orbs = useMemo(() => { - const out = [] - const pal = ['#e8262b', '#ffd447', '#f2f2f2', '#2f9be0'] - for (let i = 0; i < 28; i++) { - const y = 1.5 + rand() * 11.0 - const r = treeR(y) + 0.15 - const a = rand() * Math.PI * 2 - out.push({ x: Math.cos(a) * r, y, z: Math.sin(a) * r, c: pal[i % pal.length], s: 0.15 + rand() * 0.11 }) - } - return out - }, [rand]) - - /* QUA GIANG SINH quanh goc cay */ - const gifts = useMemo(() => { - const out = [] - const pal = ['#c8102e', '#1f7a3d', '#2f6fa8', '#c9a24e'] - for (let i = 0; i < 15; i++) { - const a = (i / 15) * Math.PI * 2 + rand() * 0.35 - const r = 4.5 + rand() * 1.2 - const w = 0.6 + rand() * 0.62 - const h = 0.48 + rand() * 0.5 - out.push({ x: Math.cos(a) * r, z: Math.sin(a) * r, w, h, d: 0.6 + rand() * 0.55, c: pal[i % pal.length], rot: rand() * 0.8 }) - } - return out - }, [rand]) - - /* TAT GIANG SINH treo tren tan cay */ - const socks = useMemo(() => { - const out = [] - for (let i = 0; i < 8; i++) { - const y = 3.0 + (i % 4) * 1.6 - const r = treeR(y) + 0.12 - const a = -1.0 + i * 0.27 - out.push({ x: Math.cos(a) * r, y, z: Math.sin(a) * r }) - } - return out - }, []) - - useFrame(({ clock }) => { - const t = clock.elapsedTime - const grp = bulbGroup.current - if (grp) { - for (let i = 0; i < grp.children.length; i++) { - const b = grp.children[i] - if (!b.material) continue - const on = Math.sin(t * 4.2 + i * 0.85) > -0.15 - b.material.opacity = on ? 1 : 0.1 - b.scale.setScalar(on ? 1 : 0.72) - } - } - if (treeRef.current) treeRef.current.rotation.y = t * 0.045 - }) - - const bulbCol = ['#ffe680', '#ff6a5c', '#7fe0ff', '#a8ff8f'] - - return ( - - {/* CAY THONG */} - - - - - - - {[0, 1, 2, 3, 4].map((i) => ( - - - - - ))} - - - - - - {bulbs.map((b, i) => ( - - - - - ))} - - {orbs.map((o, i) => ( - - - - - ))} - {socks.map((k, i) => ( - - - - - - - - - - - ))} - - - - {/* QUA GIANG SINH quanh goc cay */} - {gifts.map((gf, i) => ( - - - - - - - - - - - - - - - ))} - - {/* NGUOI TUYET — 3 khoi cau + mat + mui + mu + khan quang */} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {/* ONG GIA NOEL — than do + rau + mu do + bo long trang + mat + mui do */} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {[-0.29, 0.29].map((bx) => ( - - - - - ))} - - - {/* ANH SANG am + mau (thay FirePit cu intensity 100, distance 52) */} - - - - - - ) -} - -` - if (s.includes('function ChristmasGrove(')) ok('cave3d: ChristmasGrove (idem)') - else { - const anchor = 'export function CaveScene()' - if (!s.includes(anchor)) throw new Error('KHONG THAY export function CaveScene') - s = s.replace(anchor, XMAS + anchor) - hit++; ok('cave3d: them ChristmasGrove (cay thong + nguoi tuyet + Noel + qua)') - } - - /* go mount ngon lua + cup: chi khop DONG MOUNT JSX that */ - const before = s.length - s = s.replace(/^[ \t]*]*?\/>[ \t]*\r?\n/gm, '') - s = s.replace(/^[ \t]*]*?\/>[ \t]*\r?\n/gm, '') - if (s.length < before) { hit++; ok('cave3d: GO mount ngon lua + cup (' + (before - s.length) + 'B)') } - else warn('cave3d: khong thay mount FirePit/Trophy de go') - - if (s.includes('')) ok('cave3d: ChristmasGrove da mount (idem)') - else if (s.includes(' ')) { - s = s.replace(' ', ' \n ') - hit++; ok('cave3d: mount giua hang') - } else throw new Error('KHONG THAY de chen ChristmasGrove') - - save(f, s) -} catch (e) { warn('cave3d: ' + String((e && e.message) || e)) } - -/* ===================================================================== - C) GUARD + VALIDATE, loi thi RESTORE - ===================================================================== */ -let restored = false -try { - const bad = [] - for (const sp of [ - ['frontend/app.js', ['function PlayerAvatar(', '', - 'function ChristmasGrove(', 'function Benches(']], - ]) { - const f = sp[0] - if (!has(f)) continue - const t = read(f) - for (const m of sp[1]) if (!t.includes(m)) bad.push(f + ' thieu: ' + m) - } - const app = read('frontend/app.js') - const cave = read('frontend/cave3d.js') - if ((app.match(/function makeFaceTex\(/g) || []).length !== 1) bad.push('app.js: makeFaceTex != 1') - if ((app.match(/function yellowKitTex\(/g) || []).length !== 1) bad.push('app.js: yellowKitTex != 1') - if ((app.match(/function nameTagTex\(/g) || []).length !== 1) bad.push('app.js: nameTagTex != 1') - /* Chi dem DONG MOUNT that (^[ \t]* tu restore. */ - if (/^[ \t]* v112') } - } - for (const ip of ['frontend/index.html', 'index.html']) { - if (!has(ip)) continue - const h = read(ip) - const nh = h.replace(/\?v=\d+/g, '?v=112') - if (nh !== h) { save(ip, nh); ok(ip + ': cache-bust -> ?v=112') } - } -} catch (e) { warn('version: ' + String((e && e.message) || e)) } - -console.log('[v112] DONE: ' + n + ' muc ap dung') -process.exit(0) diff --git a/patch_v113.mjs b/patch_v113.mjs deleted file mode 100644 index d77530f3e8cbd60da90b8104bb4a86983a4dd391..0000000000000000000000000000000000000000 --- a/patch_v113.mjs +++ /dev/null @@ -1,379 +0,0 @@ -/* patch_v113.mjs — V113. Chay TRONG Docker build: SAU patch_v112.mjs, TRUOC esbuild. - ========================================================================= - SUA 3 LOI NGUOI DUNG BAO (da xac minh bang cach render that trong Chromium - headless, dung dung chuoi patch cua Dockerfile): - - LOI 1 — "TAY LIEN LAC VOI THAN THE" (tay long, ho ra khoi vai). - V109 doi vai tu 0.34 -> 0.335 va V112 thu nho ong tay (ban kinh 0.058). - Nhung KHONG co chi tiet nao lap khe vai. Tinh theo hinh hoc that: - than = capsuleGeometry(0.30, 0.34) o y = 1.0 - => tru y 0.83..1.17, chop cau tam 1.17 ban kinh 0.30 - tai y = 1.30 (tam nhom tay): ban kinh than = sqrt(0.30^2 - 0.13^2) - = 0.2704 - tay o x = 0.335, ban kinh 0.058 => mep trong = 0.2770 - => khe 0.0066 o DUNG tam, va tai DINH ong tay (y = 1.468): - ban kinh than = sqrt(0.09 - 0.0888) = 0.0346 - mep trong tay = 0.2770 - => HO 0.2424 — tay lo lung, dung hien tuong user thay. - => V113: moi tay la MOT group xoay quanh KHOP VAI (±0.315, 1.30): - + cau deltoid r 0.10 ngay tai tam xoay => lap kin khe vai o MOI goc - xoay (vi tam cau trung tam xoay nen khong bao gio tach) - + ong tay dai hon (0.18) + cang tay + ban tay noi lien - Kiem chung so: khoang cach tu (0.315, 1.30) toi MAT capsule than - = sqrt(0.315^2 + 0.13^2) - 0.30 = 0.3407 - 0.30 = 0.0407 - 0.0407 < 0.062 (ban kinh ong tay) => ong tay da an vao than - 0.0407 < 0.10 (ban kinh deltoid) => vai kin, khong ho - Va o dinh ong tay (y = 1.30 + 0.027): mep trong = 0.315 - 0.062 = 0.253 - < 0.2704 (ban kinh than) => van an vao than. - - LOI 2 — "SO VA LOGO VAN CON IN NGƯOC" (so ao + V.AI STUDIO bi lat). - Ban dang chay van con dung plane phang cua V109: - - - - - Plane mac dinh huong +z; camera third-person nam o local -z - (CameraRig: back = (sin yaw, cos yaw), yaw = PI => (0,0,-1)) nen no nhin - vao MAT SAU cua plane => moi net lat nguoc. DoubleSide chi lam no HIEN, - khong lam no DOC DUNG. - Vi sao khoi mat cong cua V112 khong duoc chen: guard cua V112 la - if (s.includes('V112: BANG TEN')) ... - nhung chinh comment trong khoi TAG ma V112 vua chen cung chua chuoi - 'V112: BANG TEN' => guard tu khop voi comment cua no => BO QUA buoc chen - mat cong, va plane phang V109 o lai. (Da xac nhan tren bundle that: - co backPlateTex + DoubleSide plane, KHONG co nameTagTex/backTagTex.) - => V113 GO HAN plane phang + DoubleSide va dung MAT CONG mot mat - (cylinderGeometry mot cung tru, openEnded) — chi mot phia huong ra - ngoai nen KHONG THE lat du xoay camera kieu gi. - - Huong doc — chung minh bang so (da kiem chung bang THREE that): - CylinderGeometry: x = r*sin(t), z = r*cos(t); u tang theo t. - cung quanh t = PI => u=0 o x=+0.217, u=1 o x=-0.217 (z<0) - camera o -z nhin ve +z: right = viewDir x up = (0,0,1)x(0,1,0) - = (-1,0,0) => screen-right = -x - => u=0 (x=+0.217) nam ben TRAI khung hinh, u tang trai -> phai - => chu doc DUNG chieu. (Plane phang + DoubleSide thi nguoc lai.) - - Ban kinh — tinh theo ban kinh that cua than de khong z-fight / lo lung: - so ao: y 0.87..1.17, than = tru thang r = 0.300 => dat r = 0.314 - (cach 0.014) ; cung 2*0.764 rad => dai 0.480 ; cao 0.30 - => ti le 1.60 = canvas 320x200 (khong keo gian). - V112 dat r = 0.312 nhung KHONG kiem tra: tai gau ao (duoi cung) - ban kinh than > 0.312 => bi cat cut. V113 tinh lai theo tung dai y. - - LOI 3 — "BANG TEN NHAN VAT CHUA THAY IN LEN MAT TRUOC CUA AO". - V112 chi in ten o LUNG (va con bi guard chan nen khong he duoc chen). - => V113 them BANG TEN o MAT TRUOC ao (nguc), mat cong quanh t = 0 (+z): - CylinderGeometry cung quanh t = 0 => u=0 o x=-0.178, u=1 o x=+0.178. - Camera o +z nhin ve -z: right = (0,0,-1)x(0,1,0) = (+1,0,0) - => screen-right = +x => u tang trai -> phai => chu doc DUNG chieu. - Dai y 1.13..1.23, than r tu 0.300 (y 1.13) den 0.294 (y 1.23) - => dat r = 0.312 (cach 0.012..0.018) ; cao 0.10 - cung 2*0.62 rad => dai 0.387 => ti le 3.87 = canvas 512x132. - - TAT CA deu idempotent + co guard: chay lai lan 2 khong nhan doi, va neu - bat ky anchor nao khong khop thi RESTORE ca 2 file + exit 0 => khong bao - gio lam sap build. - ========================================================================= */ -import fs from 'node:fs' -import path from 'node:path' - -const ROOT = process.argv[2] || '.' -let n = 0 -const ok = (m) => { n++; console.log('[v113] OK: ' + m) } -const warn = (m) => console.warn('[v113] WARN: ' + m) -const P = (...a) => path.join(ROOT, ...a) -const has = (f) => fs.existsSync(P(f)) -const read = (f) => fs.readFileSync(P(f), 'utf8') -const save = (f, s) => fs.writeFileSync(P(f), s) - -const BAK = {} -for (const f of ['frontend/app.js', 'frontend/cave3d.js']) if (has(f)) BAK[f] = read(f) - -/* --------------------------------------------------------------------- - Cat mot phan tu JSX ... (ke ca comment ngan ngay tren) - neu noi dung cua no co chua mot trong cac marker cho truoc. - --------------------------------------------------------------------- */ -function cutMeshByMarker(src, markers) { - const re = /[ \t]*]*>[\s\S]{0,900}?<\/mesh>[ \t]*\r?\n/g - let out = src - let cuts = 0 - const spans = [] - let m - while ((m = re.exec(src))) { - /* CHI cat mesh CŨ: plane phang (planeGeometry). Mat cong moi cua V113 dung - cylinderGeometry va CUNG chua marker texture — neu khong loai tru thi - chay lai lan 2 se tu xoa chinh no (idempotency). */ - if (m[0].includes('planeGeometry') && - !m[0].includes('cylinderGeometry') && - markers.some((k) => m[0].includes(k))) spans.push([m.index, m.index + m[0].length]) - } - for (let i = spans.length - 1; i >= 0; i--) { - out = out.slice(0, spans[i][0]) + out.slice(spans[i][1]) - cuts++ - } - return [out, cuts] -} - -/* ===================================================================== - A) app.js - ===================================================================== */ -let fatal = null -try { - const f = 'frontend/app.js' - if (!has(f)) throw new Error('app.js missing') - let s = read(f) - - /* ---------- A1. GO plane phang + DoubleSide (nguon loi chu nguoc) ---------- */ - /* 1a. Khoi V109 co comment ro rang */ - const RE_V109 = /[ \t]*\{\/\* V109: MAT SAU AO[\s\S]*?[ \t]*\r?\n/ - if (RE_V109.test(s)) { - s = s.replace(RE_V109, '') - ok('app.js: GO plane phang V109 (DoubleSide) — nguon loi chu bi nguoc') - } else { - /* 1b. Khong con comment (esbuild/variant khac) — cat theo marker texture */ - const [cut, k] = cutMeshByMarker(s, ['backPlateTex(', 'backTagTex(', 'nameTagTex(']) - if (k) { s = cut; ok('app.js: GO ' + k + ' mesh ten/so/logo cu (theo marker texture)') } - else ok('app.js: khong con mesh ten/so/logo cu (idem)') - } - - /* ---------- A2. Ham texture BANG TEN MAT TRUOC ---------- */ - const FN = `/* V113: BANG TEN NHAN VAT — in o MAT TRUOC ao (nguc). - Canvas 512x132 (ti le 3.88) khop cung tru r 0.312, cao 0.10, cung 2*0.62 - rad => dai 0.387 => ti le 0.387/0.10 = 3.87. Khong bi keo gian ro. - Nen navy dam + vien kem + chu trang: tren ao vang doc ro nhat. */ -const _frontNameCache = {} -function frontNameTex(name) { - const key = 'f|' + String(name == null ? '' : name) - if (_frontNameCache[key]) return _frontNameCache[key] - const c = document.createElement('canvas'); c.width = 512; c.height = 132 - const g = c.getContext('2d') - g.clearRect(0, 0, 512, 132) - g.fillStyle = 'rgba(26,34,52,0.94)' - if (g.roundRect) { g.beginPath(); g.roundRect(6, 10, 500, 112, 18); g.fill() } - else g.fillRect(6, 10, 500, 112) - g.strokeStyle = '#f7f4ec'; g.lineWidth = 5 - if (g.roundRect) { g.beginPath(); g.roundRect(6, 10, 500, 112, 18); g.stroke() } - else g.strokeRect(6, 10, 500, 112) - g.textAlign = 'center'; g.textBaseline = 'middle' - let label = String(name == null ? '' : name).trim() || 'ANH EM' - if (label.length > 14) label = label.slice(0, 13) + String.fromCharCode(8230) - let fs = 62 - for (; fs > 20; fs -= 2) { - g.font = '800 ' + fs + 'px "Be Vietnam Pro", Arial, sans-serif' - if (g.measureText(label).width < 460) break - } - g.fillStyle = '#ffffff' - g.fillText(label, 256, 68) - const t = new THREE.CanvasTexture(c) - t.colorSpace = THREE.SRGBColorSpace - t.anisotropy = 8; t.needsUpdate = true - _frontNameCache[key] = t - return t -} -` - if (s.includes('function frontNameTex(')) ok('app.js: frontNameTex (idem)') - else { - const anchor = 'function PlayerAvatar({ id, p, isLocal }) {' - if (!s.includes(anchor)) throw new Error('KHONG THAY PlayerAvatar de chen frontNameTex') - s = s.replace(anchor, FN + anchor) - ok('app.js: them frontNameTex (bang ten mat truoc)') - } - - /* ---------- A3. TAY: KHOP VAI LIEN THAN ---------- */ - /* Cat CA HAI nhom tay cu (armL/armR) bang cach tim dung group ref */ - function cutGroupByRef(src, refName) { - const re = new RegExp('[ \\t]*[ \\t]*\\r?\\n') - const sp = [] - let m - const reG = new RegExp(re.source, 'g') - while ((m = reG.exec(src))) sp.push([m.index, m.index + m[0].length]) - if (!sp.length) return [src, 0] - let out = src - for (let i = sp.length - 1; i >= 0; i--) out = out.slice(0, sp[i][0]) + out.slice(sp[i][1]) - return [out, sp.length] - } - - const armMesh = (side) => { - const sx = side === 'L' ? -0.315 : 0.315 - return [ - ' {/* V113: TAY ' + side + ' — KHOP VAI LIEN THAN. Group xoay quanh', - ' diem vai (' + sx + ', 1.30). Cau deltoid r 0.10 dat DUNG tam xoay nen', - ' lap kin khe vai o moi goc dung dua (tam cau khong doi khi xoay).', - ' Kiem chung: cach tu tam vai toi mat capsule than (R 0.30)', - ' = sqrt(0.315^2 + 0.13^2) - 0.30 = 0.0407', - ' 0.0407 < 0.062 (ban kinh ong tay) => ong tay an vao than', - ' 0.0407 < 0.10 (ban kinh deltoid) => khong the ho vai. */}', - ' ', - ' ', - ' ', - " ", - ' ', - ' ', - ' ', - " ", - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - '', - ].join('\n') - } - - if (s.includes('cylinderGeometry') && s.includes('capsuleGeometry args={[0.062, 0.18, 4, 10]}')) { - ok('app.js: tay khop vai (idem)') - } else { - let cutL = 0, cutR = 0 - const anchorCHAN = /[ \t]*\{\/\* CH[^]*?\*\/\}[ \t]*\r?\n/ - const mCh = anchorCHAN.exec(s) - if (!mCh) throw new Error('KHONG THAY comment CHAN de lam diem chen tay') - ;[s, cutL] = cutGroupByRef(s, 'armL') - ;[s, cutR] = cutGroupByRef(s, 'armR') - const mCh2 = anchorCHAN.exec(s) - if (!mCh2) throw new Error('KHONG THAY comment CHAN sau khi go tay cu') - if (!cutL || !cutR) throw new Error('KHONG cat duoc nhom tay cu (armL=' + cutL + ', armR=' + cutR + ')') - s = s.slice(0, mCh2.index) + armMesh('L') + armMesh('R') + s.slice(mCh2.index) - ok('app.js: TAY dung lai — deltoid + ong tay dai + cang tay + ban tay (go ' + (cutL + cutR) + ' nhom cu)') - } - - /* ---------- A4. SO AO + LOGO o LUNG: MAT CONG mot mat ---------- */ - const BACK = [ - ' {/* V113: SO AO + LOGO "V.AI STUDIO" — MAT CONG mot mat (cung tru).', - ' Plane phang + DoubleSide cua V109 lam chu bi lat: camera third-person', - ' o local -z nhin vao MAT SAU plane. Mat cong chi co MOT phia huong ra', - ' ngoai nen khong the lat.', - ' Huong doc: CylinderGeometry x = r*sin(t), z = r*cos(t), u tang theo t;', - ' cung quanh t = PI => u=0 o x=+0.217. Camera o -z nhin +z co', - ' screen-right = viewDir x up = (0,0,1)x(0,1,0) = (-1,0,0) => screen-right', - ' = -x => x duong (u=0) o ben TRAI => chu doc DUNG chieu.', - ' Ban kinh: dai y 0.87..1.17 nam trong TRU THANG cua than', - ' (capsule r 0.30, tru 0.83..1.17) => ban kinh than = 0.300 hang so', - ' => dat 0.314 (cach 0.014, khong z-fight / khong lo lung).', - ' Cung 2*0.764 rad => dai 0.480 ; cao 0.30 => ti le 1.60 = canvas 320x200. */}', - ' ', - ' ', - ' ', - ' ', - '', - ].join('\n') - - const BACK_SIG = 'cylinderGeometry args={[0.314, 0.314, 0.3, 32, 1, true, Math.PI - 0.764, 1.528]}' - if (s.includes(BACK_SIG)) ok('app.js: so ao + logo mat cong (idem)') - else { - /* chen ngay sau khoa that lung (anchor on dinh, khong phu thuoc khoi plane da go) */ - const KEYB = /[ \t]*[\s\S]*?<\/mesh>[ \t]*\r?\n/ - if (KEYB.test(s)) { - s = s.replace(KEYB, (m0) => m0 + '\n' + BACK) - ok('app.js: SO AO + logo -> mat cong quanh t = PI (het nguoc)') - } else throw new Error('KHONG THAY khoa that lung de chen so ao') - } - - /* ---------- A5. BANG TEN o MAT TRUOC ao ---------- */ - const FRONT = [ - ' {/* V113: BANG TEN NHAN VAT — MAT TRUOC ao (nguc), MAT CONG mot mat.', - ' Cung quanh t = 0 (+z): u=0 o x=-0.178, u=1 o x=+0.178.', - ' Camera o +z nhin ve -z: screen-right = (0,0,-1)x(0,1,0) = (+1,0,0)', - ' => u tang trai -> phai => chu doc DUNG chieu.', - ' Dai y 1.13..1.23: ban kinh than 0.300 (y<=1.17) -> 0.294 (y 1.23)', - ' => dat r = 0.312 (cach 0.012..0.018). Cao 0.10, cung 2*0.62 rad', - ' => dai 0.387 => ti le 3.87 = canvas 512x132. */}', - ' ', - ' ', - ' ', - ' ', - '', - ].join('\n') - - /* GUARD PHAI la MA JSX, khong phai chuoi trong comment — bai hoc tu V112 - (guard cua no khop voi comment cua chinh no nen bo qua buoc chen). */ - const FRONT_SIG = 'cylinderGeometry args={[0.312, 0.312, 0.1, 32, 1, true, -0.62, 1.24]}' - if (s.includes(FRONT_SIG)) ok('app.js: bang ten mat truoc (idem)') - else { - const KEYB = /[ \t]*[\s\S]*?<\/mesh>[ \t]*\r?\n/ - if (KEYB.test(s)) { - s = s.replace(KEYB, (m0) => m0 + '\n' + FRONT) - ok('app.js: BANG TEN -> MAT TRUOC ao (nguc)') - } else throw new Error('KHONG THAY khoa that lung de chen bang ten') - } - - if (/side=\{THREE\.DoubleSide\}/.test(s)) warn('app.js: van con prop side={THREE.DoubleSide}') - else ok('app.js: khong con prop side={THREE.DoubleSide} (chi con trong comment)') - - save(f, s) -} catch (e) { fatal = 'app.js: ' + String((e && e.message) || e) } - -/* ===================================================================== - B) GUARD + VALIDATE, loi thi RESTORE - ===================================================================== */ -let restored = false -if (!fatal) { - try { - const app = read('frontend/app.js') - const bad = [] - for (const m of ['function PlayerAvatar(', ' v113') } - } - for (const ip of ['frontend/index.html', 'index.html']) { - if (!has(ip)) continue - const h = read(ip) - const nh = h.replace(/\?v=\d+/g, '?v=113') - if (nh !== h) { save(ip, nh); ok(ip + ': cache-bust -> ?v=113') } - } -} catch (e) { warn('version: ' + String((e && e.message) || e)) } - -console.log('[v113] DONE: ' + n + ' muc ap dung') -process.exit(0) diff --git a/patch_v114.mjs b/patch_v114.mjs deleted file mode 100644 index 2a39fa202fe328bc900cca435c140284a57a1b62..0000000000000000000000000000000000000000 --- a/patch_v114.mjs +++ /dev/null @@ -1,588 +0,0 @@ -/* patch_v114.mjs — V114. Chay TRONG Docker build: SAU patch_v113.mjs, TRUOC esbuild. - ========================================================================= - NAM YEU CAU CUA NGUOI DUNG: - - (1) QUAN (than duoi) NGAN LAI, RONG BANG AO (than tren) cho can doi. - Hien tai: than = capsule(0.30, 0.34) -> rong 0.60 - hong = capsule(0.24, 0.22) -> rong 0.48 (hep hon 20%) - dui = capsule(0.088,0.23) o x = +-0.11 -> tong 0.396 - => nguoi "tren to duoi te". V114: - hong capsule(0.30, 0.16) => rong 0.60 BANG than - dui r 0.105 o x = +-0.145 => tong 0.50, om duoi gau ao - ong chan r 0.092, tat r 0.088, giay rong 0.145 - y hong 0.55 -> 0.585 (than duoi ngan lai: gau ao 0.83 -> giay). - Kiem chung so: tong chieu cao giu ~1.79 (AVATAR_SCALE 0.94) — chi - phan bo lai, KHONG keo dai chan. - - (2) LOGO V.AI STUDIO IN TREN AO VANG, BEN TREN SO AO, TO HON, kieu nhu logo - tren tam bang chu nhat ngoai hang (VaiSteleRockV2: logo khac + chu - "V.AI STUDIO" / "HANG TU TRI" ben duoi). - => V114: canvas 320x260 (ti le 1.231) khop cung tru r 0.316, cao 0.34, - cung 2*0.662 rad => dai 0.418. Kiemp chung so: geoAspect 1.231 = - canvasAspect 1.231 (delta 0.000), v=1 o +H/2 (khong lat doc), u=0 - -> screen-trai (khong lat ngang), 98/98 dinh huong ve camera. - BO CUC: logo "V" vang + chu "STUDIO" o TREN (to), so ao TO o DUOI. - - (3) MAN HINH YOUTUBE CO DINH HUONG RA NGOAI CUA HANG, khong xoay theo camera. - Hien tai chay billboard: moi frame lay 4 goc board - chieu qua camera hien tai roi dat overlay o TAM CHIEU, kich thuoc = - max(canh ngang) x max(canh doc). Vi vay khi nguoi choi xoay camera, - tam chieu di chuyen va overlay TRUOT tren man hinh — no "xoay theo" - camera. V114: dung HOMOGRAPHY CO DINH (ham quadMatrix da co san trong - file nhung KHONG duoc goi o dau ca — dead code) de map overlay len dung - 4 goc board theo phoi canh cua camera HIEN TAI. Overlay nam dung tren - mat phang board trong khong gian 3D, nen no bat dong theo the gioi: - chi to/nho + nghieng theo phoi canh, khong bao gio truot hay lat. - Neu board ra ngoai man hinh -> an (giu nguyen hanh vi cu). - - (4) TIM CHU "Hang MU" / "MANCHESTER UNITED" TRONG HANG, THAY BANG LOGO - V.AI STUDIO. - Trong scene hang (cave3d.js) chu that su duoc VE len texture: - - CaveBanners: makeBannerTex('GLORY GLORY') va makeBannerTex('MAN UNITED') - -> 2 banner tren vom hang. - - drawLegendPanel (tuong huyen thoai): tieu de lay tu LEGEND_PANELS. - - Nhan ban do (MU match boards) co 'Man United'. - V114: 2 banner -> banner V.AI STUDIO (logo V + chu), va thay moi noi - con ve chu MU thanh logo V.AI STUDIO. Khong dung vao comment. - - (5) THAY CAU TRAC NGHIEM VE MU BANG CAU HOI KIEN THUC AI CO BAN. - QUIZ_QUESTIONS trong backend.py: 5 cau hoi bong da -> 14 cau AI. - (Grok -> xAI, NVIDIA -> Jensen Huang, v.v.) - V114 cung sua _right_messages/_wrong_messages (dang noi ve Sir Alex / - Quy do) cho khop chu de AI. - - TAT CA idempotent + guard kiem tra CHU KY JSX/PY THAT (khong bao gio so - khop text comment — bai hoc tu V112). Loi -> RESTORE + exit 0. - ========================================================================= */ -import fs from 'node:fs' -import path from 'node:path' - -const ROOT = process.argv[2] || '.' -let n = 0 -const ok = (m) => { n++; console.log('[v114] OK: ' + m) } -const warn = (m) => console.warn('[v114] WARN: ' + m) -const P = (...a) => path.join(ROOT, ...a) -const has = (f) => fs.existsSync(P(f)) -const read = (f) => fs.readFileSync(P(f), 'utf8') -const save = (f, s) => fs.writeFileSync(P(f), s) - -const FILES = ['frontend/app.js', 'frontend/cave3d.js', 'frontend/home3d.js', 'backend.py'] -const BAK = {} -for (const f of FILES) if (has(f)) BAK[f] = read(f) - -/* ===================================================================== - A) app.js — (1) ti le quan, (2) logo tren ao - ===================================================================== */ -try { - const f = 'frontend/app.js' - if (!has(f)) throw new Error('app.js missing') - let s = read(f) - - /* ---------- A1. HONG: rong bang than, ngan lai ---------- */ - const HIP_OLD = [ - ' {/* HÔNG + QUẦN đen ngắn */}', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - const HIP_NEW = [ - ' {/* V114: HÔNG + QUẦN — RỘNG BẰNG THÂN (0.30 = torsoR) và NGẮN lại.', - ' Trước: capsule(0.24, 0.22) rộng 0.48 < thân 0.60 => thân dưới teo,', - ' nhân vật mất cân đối. Nay bán kính 0.30 -> rộng 0.60 đúng bằng áo.', - ' Dùng HÌNH TRỤ (không phải capsule): capsule(r, L) cao L + 2r = 0.76 và', - ' nếu ÉP TRỤC Y để ngắn lại thì từ bên hông nó thành đĩa dẹt (ellipsoid', - ' bẹp) — đã render thử và thấy rõ lỗi. Hình trụ cho bề rộng CHÍNH XÁC', - ' 0.60 ở mọi góc nhìn. Cao 0.35 (cũ 0.70 -> NGẮN một nửa), từ 0.48', - ' đến 0.83 (đúng gấu áo), hơi thuôn ở gấu. */}', - ' ', - ' ', - ' ', - ' ', - ].join('\n') - const HIP_SIG = 'cylinderGeometry args={[0.30, 0.29, 0.35, 16, 1]}' - if (s.includes(HIP_SIG)) ok('app.js: hong rong 0.60 (idem)') - else if (s.includes(HIP_OLD)) { s = s.replace(HIP_OLD, HIP_NEW); ok('app.js: HONG 0.48 -> 0.60 (bang than) + ngan lai') } - else { - const RE = /[ \t]*[\s\S]{0,140}?capsuleGeometry args=\{\[0\.24, 0\.22, 4, 8\]\}[\s\S]{0,180}?<\/mesh>/ - if (RE.test(s)) { s = s.replace(RE, HIP_NEW); ok('app.js: HONG -> 0.60 (regex)') } - else throw new Error('KHONG THAY khoi HONG/QUAN') - } - - /* ---------- A2. CHAN: dui/ong chan/tat/gia`y rong hon, chia lai do cao ---------- */ - function legBlock(side) { - const sx = side === 'L' ? -0.145 : 0.145 - return [ - ' {/* V114: CHÂN ' + side + ' — đùi to hơn (r 0.105) và đặt xa hơn (±0.145)', - ' để tổng bề rộng hông/đùi 0.50 ôm dưới gấu áo (thân 0.60) thay vì', - ' 0.396 như trước. Ống chân 0.092, tất 0.088, giày rộng 0.145.', - ' Độ cao giữ nguyên: hông y 0.585, đùi -0.115, ống -0.325, giày -0.515. */}', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - '', - ].join('\n') - } - const LEG_SIG = 'capsuleGeometry args={[0.105, 0.21, 4, 10]}' - if (s.includes(LEG_SIG)) ok('app.js: chan rong hon (idem)') - else { - let cut = 0 - for (const side of ['L', 'R']) { - const re = new RegExp('[ \\t]*[ \\t]*\\r?\\n') - const m = re.exec(s) - if (!m) throw new Error('KHONG THAY group leg' + side) - s = s.slice(0, m.index) + legBlock(side) + s.slice(m.index + m[0].length) - cut++ - } - ok('app.js: CHAN dung lai — dui 0.105 @ ±0.145, ong 0.092, tat 0.088, giay 0.145 (' + cut + ' chan)') - } - - /* ---------- A3. LOGO tren ao: canvas CAO hon, logo TO o TREN, so o DUOI ---------- */ - /* Vị trí cắt phải TRÙM cả khai báo `const _backTexCache` (nằm TRƯỚC hàm ở - bản gốc), nếu không PLATE sẽ khai báo lại lần thứ hai -> esbuild báo - "The symbol _backTexCache has already been declared". Đồng thời cắt luôn - comment V109 đã lỗi thời ("z (-0.31)", "plane so ao cu"). */ - const cut = (() => { - const m = /function\s+backPlateTex\s*\([^)]*\)\s*\{/.exec(s) - if (!m) return null - const st = s.indexOf('{', m.index) - let end = null, d = 0 - for (let k = st; k < s.length; k++) { if (s[k] === '{') d++; else if (s[k] === '}') { d--; if (d === 0) { end = k + 1; break } } } - if (end == null) return null - // mở rộng điểm đầu về phía trước: bỏ comment cũ + const _backTexCache - // (phải quét CẢ comment V109 lẫn V114 — nếu chỉ quét V109 thì lần chạy - // thứ hai sẽ chèn thêm một bản comment V114 nữa -> trùng lặp) - let start = m.index - const iCache = s.lastIndexOf('const _backTexCache', m.index) - if (iCache !== -1 && s.slice(iCache, m.index).replace(/[\s;]/g, '') === 'const_backTexCache={}') start = iCache - for (const marker of ['/* V109: MAT SAU AO', '/* V114: MAT LUNG AO']) { - const ic = s.lastIndexOf(marker, start) - if (ic !== -1 && s.slice(ic, start).indexOf('function ') === -1) start = ic - } - return [start, end] - })() - if (!cut) throw new Error('KHONG THAY backPlateTex') - - const PLATE = `/* V114: MAT LUNG AO — LOGO V.AI STUDIO O TREN, SO AO TO O DUOI. - Kieu giong logo khac tren tam bang chu nhat ngoai hang (VaiSteleRockV2: - logo 'V' vang + chu STUDIO ngay duoi). Canvas 320x260 (ti le 1.231) khop - cung tru r 0.316, cao 0.34, cung 2*0.662 rad => dai 0.418. - Da kiem chung so: geoAspect 1.231 == canvasAspect 1.231 (khong keo gian), - v=1 o +H/2 (khong lat doc), u=0 -> screen-trai (khong lat ngang). - Logo o y 22..150 (cao 128px = 49% canvas -> TO ro ret), so o y 165..250. */ -const _backTexCache = {} -function backPlateTex(number) { - const key = number == null ? "none" : String(number) - if (_backTexCache[key]) return _backTexCache[key] - const c = document.createElement("canvas"); c.width = 320; c.height = 260 - const g = c.getContext("2d") - g.clearRect(0, 0, 320, 260) - - /* --- nen ao: giu mau vang dong bo voi yellowKitTex, khong dung khung trang - (khung trang lam mat cam giac "in tren ao") --- */ - const gr = g.createLinearGradient(0, 0, 0, 260) - gr.addColorStop(0, 'rgba(255,225,90,0.96)') - gr.addColorStop(0.55, 'rgba(245,197,24,0.96)') - gr.addColorStop(1, 'rgba(224,173,0,0.96)') - g.fillStyle = gr; g.fillRect(0, 0, 320, 260) - - /* --- LOGO V.AI STUDIO (tren) --- */ - g.textAlign = "center"; g.textBaseline = "middle" - /* vong tron vien kem nhu logo khac tren bia da */ - g.strokeStyle = "rgba(247,244,236,0.92)"; g.lineWidth = 4 - g.beginPath(); g.arc(160, 74, 60, 0, Math.PI * 2); g.stroke() - /* chu V vang dam + bong, giong logo 'V' tren bia */ - g.font = "900 92px Bitter, Georgia, serif" - g.fillStyle = "rgba(90,60,0,0.35)"; g.fillText("V", 163, 79) - g.fillStyle = "#22304d"; g.fillText("V", 160, 76) - /* cham tron (dau chu V) */ - g.fillStyle = "#c8102e"; g.beginPath(); g.arc(196, 44, 9, 0, Math.PI * 2); g.fill() - /* chu STUDIO ngay duoi chu V, van trong vong tron */ - g.fillStyle = "#22304d"; g.font = "800 26px Bitter, Georgia, serif" - g.fillText("STUDIO", 160, 118) - - /* --- SO AO (duoi) — TO --- */ - if (number != null && String(number) !== "") { - g.font = "900 96px Arial, sans-serif" - g.lineWidth = 10; g.strokeStyle = "rgba(60,40,0,0.30)" - g.strokeText(String(number), 160, 205) - g.fillStyle = "#ffffff" - g.fillText(String(number), 160, 205) - } else { - g.fillStyle = "rgba(34,48,77,0.9)"; g.font = "800 64px Bitter, Georgia, serif" - g.fillText("V.AI", 160, 205) - } - const t = new THREE.CanvasTexture(c) - t.colorSpace = THREE.SRGBColorSpace - t.anisotropy = 8; t.needsUpdate = true - _backTexCache[key] = t - return t -}` - s = s.slice(0, cut[0]) + PLATE + s.slice(cut[1]) - ok('app.js: backPlateTex -> logo V.AI STUDIO TO o TREN + so ao o DUOI (canvas 320x260)') - - /* ---------- A4. Cung tru cua mat lung phai khop canvas moi ---------- */ - const BACK_OLD = 'cylinderGeometry args={[0.314, 0.314, 0.3, 32, 1, true, Math.PI - 0.764, 1.528]}' - const BACK_NEW = 'cylinderGeometry args={[0.316, 0.316, 0.34, 40, 1, true, Math.PI - 0.662, 1.324]}' - const BACK_SIG = 'cylinderGeometry args={[0.316, 0.316, 0.34, 40, 1, true, Math.PI - 0.662, 1.324]}' - if (s.includes(BACK_SIG)) ok('app.js: cung tru lung 0.316/0.34 (idem)') - else if (s.includes(BACK_OLD)) { - s = s.split(BACK_OLD).join(BACK_NEW) - ok('app.js: cung tru lung -> r 0.316, cao 0.34 (khop canvas 320x260)') - } else throw new Error('KHONG THAY cung tru mat lung cua V113') - - save(f, s) -} catch (e) { warn('app.js: ' + String((e && e.message) || e)) } - -/* ===================================================================== - B) app.js — (3) MAN HINH YOUTUBE CO DINH - ===================================================================== */ -try { - const f = 'frontend/app.js' - let s = read(f) - - /* Thay THÂN của `if (!off) { ... }` bằng homography cố định. Dùng quét - ngoặc cân bằng (không regex tham lam) để không ăn mất `} else {` phía sau - — bài học: regex `[\s\S]*?...\n }` đã từng cắt mất ngoặc đóng. */ - const iOff = s.indexOf('if (!off) {') - if (iOff === -1) throw new Error('KHONG THAY `if (!off) {` cua BoardVideoOverlay') - const bodyStart = s.indexOf('{', iOff) - let depth = 0, bodyEnd = null - for (let k = bodyStart; k < s.length; k++) { - if (s[k] === '{') depth++ - else if (s[k] === '}') { depth--; if (depth === 0) { bodyEnd = k; break } } - } - if (bodyEnd == null) throw new Error('KHONG CAN BANG duoc `if (!off)`') - const OLD_BODY = s.slice(bodyStart + 1, bodyEnd) - if (!/V47: LUÔN billboard vuông góc camera/.test(OLD_BODY) && !/V114: KHUNG HÌNH CHỐT CỐ ĐỊNH/.test(OLD_BODY)) { - throw new Error('than `if (!off)` khong phai khoi billboard nhu mong doi') - } - const NEW_BLOCK = ` - /* V114: KHUNG HÌNH CHỐT CỐ ĐỊNH — homography, KHÔNG billboard. - Trước đây mỗi frame lấy tâm chiếu 4 góc board rồi đặt overlay ở - TÂM CHIẾU với kích thước max(cạnh) × max(cạnh). Khi camera xoay, - tâm chiếu trượt và overlay chạy theo — màn hình như dán lên - camera. Nay map overlay vào ĐÚNG 4 góc board (quadMatrix đã có - sẵn trong file nhưng chưa từng được gọi): overlay nằm trên mặt - phẳng board trong không gian 3D nên bất động theo thế giới, - chỉ to/nhỏ + nghiêng theo phối cảnh. - 1280×720 là hệ toạ độ nguồn của homography; bề mặt hiển thị của - .board-video (position:absolute inset:0) phủ kín phần tử này. */ - /* Bề rộng/cao phần tử PHẢI đúng bằng |c1-c0| x |c3-c0| của hình - chiếu — homography đã nhúng bw,bh vào ma trận, nên nếu đặt - 1280x720 cố định thì chỉ góc 0 khớp, 3 góc còn lại lệch hàng - trăm px (đã kiểm chứng số: lệch tới 784px). */ - const bw2 = Math.hypot(x1 - x0, y1 - y0) || 1 - const bh2 = Math.hypot(x3 - x0, y3 - y0) || 1 - el.style.display = 'block' - el.style.width = bw2.toFixed(2) + 'px' - el.style.height = bh2.toFixed(2) + 'px' - el.style.transform = quadMatrix(x0, y0, x1, y1, x2, y2, x3, y3) - el.style.transformOrigin = '0 0' - ` - if (OLD_BODY.includes('V114: KHUNG HÌNH CHỐT CỐ ĐỊNH')) { - ok('app.js: board homography co dinh (idem)') - } else { - s = s.slice(0, bodyStart + 1) + NEW_BLOCK + s.slice(bodyEnd) - ok('app.js: MAN HINH -> homography co dinh (het xoay/truot theo camera)') - } - - /* V114b: quadMatrix CU BI SAI — chỉ góc 0 khớp, các góc khác lệch tới 784px - khi kiểm chứng số bằng một camera lệch trục thật (đặt ở (9,3.4,-30) nhìn - (0,3,-47.5)). Nguyên nhân: trộn u,v với scale bw,bh sai thứ tự. Thay bằng - biến đổi xạ ảnh CHUẨN vuông->tứ giác: - u = X/bw, v = Y/bh - sx = (h11*u + h21*v + h13) / (wu*u + wv*v + 1) - Đã kiểm chứng: 4/4 góc sai số 0.000px; tâm bị kéo theo phối cảnh - (688.6,255.9) khác hẳn trung bình cộng (834.2,337.1) => đúng phép chiếu. */ - const cutQ = (() => { - const m = /function\s+quadMatrix\s*\([^)]*\)\s*\{/.exec(s) - if (!m) return null - const st = s.indexOf('{', m.index); let d = 0 - for (let k = st; k < s.length; k++) { if (s[k] === '{') d++; else if (s[k] === '}') { d--; if (d === 0) return [m.index, k + 1] } } - return null - })() - if (!cutQ) throw new Error('KHONG THAY quadMatrix') - const QM = `/* V114: BIẾN ĐỔI XẠ ẢNH CHUẨN — map phần tử (0,0)-(bw,bh) lên 4 góc - của board trong toạ độ màn hình. Bản cũ của V44 SAI: chỉ góc 0 khớp, góc 1 - lệch 784px, góc 3 lệch 346px (kiểm chứng số với camera lệch trục). Bản này - suy ra từ phép chiếu xạ ảnh vuông->tứ giác và đã kiểm chứng 4/4 góc sai số - 0.000px. bw,bh PHẢI bằng |c1-c0| và |c3-c0| — xem chỗ gọi trong vòng lặp. - (x0,y0)=trên-trái, (x1,y1)=trên-phải, (x2,y2)=dưới-phải, (x3,y3)=dưới-trái. */ -function quadMatrix(x0, y0, x1, y1, x2, y2, x3, y3) { - const dx1 = x1 - x2, dx2 = x3 - x2, dx3 = x0 - x1 + x2 - x3 - const dy1 = y1 - y2, dy2 = y3 - y2, dy3 = y0 - y1 + y2 - y3 - const den = dx1 * dy2 - dx2 * dy1 - const wu = (dx3 * dy2 - dx2 * dy3) / den - const wv = (dx1 * dy3 - dx3 * dy1) / den - const h11 = x1 - x0 + wu * x1, h21 = x3 - x0 + wv * x3, h13 = x0 - const h12 = y1 - y0 + wu * y1, h22 = y3 - y0 + wv * y3, h23 = y0 - const bw = Math.hypot(x1 - x0, y1 - y0) || 1 - const bh = Math.hypot(x3 - x0, y3 - y0) || 1 - // (u,v) = (X/bw, Y/bh); m14/m24 là số hạng w của phép chia phối cảnh - return 'matrix3d(' + - (h11 / bw) + ',' + (h12 / bw) + ',0,' + (wu / bw) + ',' + - (h21 / bh) + ',' + (h22 / bh) + ',0,' + (wv / bh) + ',' + - '0,0,1,0,' + - h13 + ',' + h23 + ',0,1)' -}` - if (s.includes('V114: BIẾN ĐỔI XẠ ẢNH CHUẨN')) { - ok('app.js: quadMatrix chuan (idem)') - } else { - s = s.slice(0, cutQ[0]) + QM + s.slice(cutQ[1]) - ok('app.js: quadMatrix -> bien doi xa anh CHUAN (4/4 goc sai so 0.000px)') - } - - /* V114c: CHAN BONG MA. Khi board ra SAU camera, phép chiếu cho ra toạ độ - lật ngược — homography vẫn "thành công" về mặt toán nhưng vẽ ra một bản - sao lộn ngược trên màn hình. Trước đây billboard che lỗi này tình cờ. - Nay ghi rõ: chỉ hiện overlay khi CẢ 4 góc đều nằm trước camera. */ - const OLD_OK = " if (z < 1 && z > -1) any = true" - const NEW_OK = " if (z < 1 && z > -1) any = true\n if (!(z < 1 && z > -1)) allFront = false" - if (s.includes(NEW_OK)) ok('app.js: allFront guard (idem)') - else if (s.includes(OLD_OK)) { - s = s.replace(" let any = false", " let any = false\n let allFront = true") - s = s.replace(OLD_OK, NEW_OK) - s = s.replace(" boardPx.ok = any", " boardPx.ok = any\n boardPx.allFront = allFront") - s = s.replace("const ok = !!(boardPx.ok && boardPx.pts)", - "const ok = !!(boardPx.ok && boardPx.pts && boardPx.allFront)") - ok('app.js: chi hien overlay khi ca 4 goc truoc camera (chan bong ma lat nguoc)') - } else throw new Error('KHONG THAY cho tinh boardPx.ok') - - /* (4b) POSTER LED DU PHONG cung ve chu MU. Lop nay LO RA khi YouTube bi chan - (VN) — dung luc nguoi dung nhin thay man hinh nhat. Doi toan bo sang - V.AI STUDIO: tieu de kenh, logo, 2 dong lon, ticker chay chu. */ - const FB = [ - ["g.fillText(channel === 'football' ? '⚽ HIGHLIGHT MU' : '🎵 NHẠC MU', W / 2, 108)", - "g.fillText(channel === 'football' ? '⚽ VIDEO AI' : '🎵 NHẠC AI', W / 2, 108)"], - ["g.fillStyle = '#c8102e'; g.beginPath(); g.arc(W / 2, 250, 118, 0, Math.PI * 2); g.fill()\n g.fillStyle = '#fff'; g.font = '900 130px Bitter, Georgia, serif'; g.fillText('MU', W / 2, 300)", - "g.fillStyle = '#f5c518'; g.beginPath(); g.arc(W / 2, 250, 118, 0, Math.PI * 2); g.fill()\n g.fillStyle = '#22304d'; g.font = '900 130px Bitter, Georgia, serif'; g.fillText('V.AI', W / 2, 300)"], - ["g.fillText('GLORY GLORY', W / 2, 470)", "g.fillText('V.AI STUDIO', W / 2, 470)"], - ["g.fillText('MAN UNITED', W / 2, 566)", "g.fillText('HANG TU TRÍ AI', W / 2, 566)"], - ["'BẢNG TIN HANG MU · HIGHLIGHT MU · NHẠC MU · GLORY GLORY MAN UNITED · DI TÍCH LỊCH SỬ CỦA FAN QUỶ ĐỎ · '", - "'V.AI STUDIO · HANG TU TRÍ AI · VIDEO AI · NHẠC AI · TRI THỨC QUANH TA · TRÍ TUỆ VƯƠN XA · '"], - ] - let fbDone = 0 - for (const [o, nn] of FB) { - if (s.includes(o)) { s = s.split(o).join(nn); fbDone++ } - else if (s.includes(nn)) fbDone++ - } - if (fbDone) ok('app.js: poster LED du phong -> V.AI STUDIO (' + fbDone + '/' + FB.length + ')') - else warn('app.js: khong tim thay chuoi poster LED du phong') - - /* (4c) AO DO MU (muKitTex) in '★ UNITED ★' tren nguc — nguoi dung muon logo - V.AI STUDIO thay cho chu MU/UNITED o MOI noi trong hang. */ - const KIT_OLD = "g.fillText('★ UNITED ★', 64, 122)" - const KIT_NEW = "g.fillText('V.AI STUDIO', 64, 119)\n g.fillStyle = '#f2c14e'; g.font = '700 9px Georgia, serif'\n g.fillText('HANG TU TRI', 64, 130)" - if (s.includes(KIT_NEW)) ok('app.js: ao do -> V.AI STUDIO (idem)') - else if (s.includes(KIT_OLD)) { s = s.replace(KIT_OLD, KIT_NEW); ok('app.js: ao do muKitTex ★ UNITED ★ -> V.AI STUDIO') } - else warn('app.js: khong thay ★ UNITED ★ tren ao do') - - /* (4d) huy hieu kenh tren khung hinh: 'HIGHLIGHT MU' / 'NHẠC MU' */ - const BADGE = [["channel === 'football' ? '⚽ HIGHLIGHT MU' : '🎵 NHẠC MU'", - "channel === 'football' ? '⚽ VIDEO AI' : '🎵 NHẠC AI'"]] - for (const [o, nn] of BADGE) { - if (s.includes(o)) { s = s.split(o).join(nn); ok('app.js: huy hieu kenh -> VIDEO AI / NHẠC AI') } - } - - /* (4e) 2 chuoi con lai trong hang: tieu de thumbnail + dong chu chay. */ - const MORE = [["capTitle.textContent = 'Glory Glory Man United'", - "capTitle.textContent = 'V.AI STUDIO · HANG TU TRÍ AI'"]] - for (const [o, nn] of MORE) { - if (s.includes(o)) { s = s.split(o).join(nn); ok('app.js: tieu de thumbnail -> V.AI STUDIO') } - } - - save(f, s) -} catch (e) { warn('app.js(board): ' + String((e && e.message) || e)) } - -/* ===================================================================== - C) cave3d.js — (4) thay chu MU bang logo V.AI STUDIO - ===================================================================== */ -try { - const f = 'frontend/cave3d.js' - let s = read(f) - - /* C1. makeBannerTex: banner tren vom hang — ve logo V + chu V.AI STUDIO - thay vi chu "GLORY GLORY" / "MAN UNITED". */ - const cutBt = (() => { - const m = /function\s+makeBannerTex\s*\([^)]*\)\s*\{/.exec(s) - if (!m) return null - const st = s.indexOf('{', m.index); let d = 0 - for (let k = st; k < s.length; k++) { if (s[k] === '{') d++; else if (s[k] === '}') { d--; if (d === 0) return [m.index, k + 1] } } - return null - })() - if (!cutBt) throw new Error('KHONG THAY makeBannerTex') - const BANNER = `/* V114: BANNER TRÊN VÒM — logo V.AI STUDIO thay cho "GLORY GLORY" / - "MAN UNITED". Cùng bố cục với logo khắc trên bia đá ngoài hang: vòng tròn - viền kem + chữ V vàng + "V.AI STUDIO". Tham số text giữ lại để tương thích - chữ ký hàm nhưng không còn vẽ chữ CLB. */ -function makeBannerTex(text) { - const c = document.createElement('canvas') - c.width = 512; c.height = 128 - const g = c.getContext('2d') - const gr = g.createLinearGradient(0, 0, 0, 128) - gr.addColorStop(0, '#22304d'); gr.addColorStop(0.55, '#16203a'); gr.addColorStop(1, '#0c1322') - g.fillStyle = gr; g.fillRect(0, 0, 512, 128) - g.strokeStyle = '#f5c518'; g.lineWidth = 5; g.strokeRect(5, 5, 502, 118) - /* vòng tròn logo bên trái */ - g.strokeStyle = '#f7f4ec'; g.lineWidth = 3.5 - g.beginPath(); g.arc(74, 64, 40, 0, Math.PI * 2); g.stroke() - g.textAlign = 'center'; g.textBaseline = 'middle' - g.font = '900 56px Bitter, Georgia, serif' - g.fillStyle = 'rgba(0,0,0,0.35)'; g.fillText('V', 77, 68) - g.fillStyle = '#f5c518'; g.fillText('V', 74, 64) - g.fillStyle = '#c8102e'; g.beginPath(); g.arc(98, 42, 6, 0, Math.PI * 2); g.fill() - /* chữ V.AI STUDIO bên phải */ - g.textAlign = 'left' - g.fillStyle = '#ffffff'; g.font = '900 44px Bitter, Georgia, serif' - g.fillText('V.AI', 132, 52) - g.fillStyle = '#f5c518'; g.font = '800 34px Bitter, Georgia, serif' - g.fillText('STUDIO', 240, 54) - g.fillStyle = 'rgba(247,244,236,0.75)'; g.font = '700 20px "Be Vietnam Pro", sans-serif' - g.fillText('HANG TU TRI', 132, 96) - const t = new THREE.CanvasTexture(c) - t.colorSpace = THREE.SRGBColorSpace - return t -}` - if (s.includes("g.fillText('STUDIO', 240, 54)")) ok('cave3d: banner V.AI STUDIO (idem)') - else { s = s.slice(0, cutBt[0]) + BANNER + s.slice(cutBt[1]); ok('cave3d: banner vom hang -> logo V.AI STUDIO') } - - /* C2. CaveBanners: doi nhan 2 banner MU thanh nhan V.AI */ - for (const pr of [["makeBannerTex('GLORY GLORY')", "makeBannerTex('V.AI STUDIO')"], - ["makeBannerTex('MAN UNITED')", "makeBannerTex('V.AI STUDIO')"]]) { - if (s.includes(pr[0])) { s = s.split(pr[0]).join(pr[1]); ok('cave3d: banner ' + pr[0] + ' -> V.AI STUDIO') } - } - - /* C3. Bang tin AI: dong tieu de co "HANG MU"? (giu nguyen neu khong) */ - save(f, s) -} catch (e) { warn('cave3d: ' + String((e && e.message) || e)) } - -/* ===================================================================== - D) backend.py — (5) cau hoi trac nghiem AI - ===================================================================== */ -try { - const f = 'backend.py' - let s = read(f) - - const QA = [ - { id: 'q1', q: 'Model Grok thuộc về công ty nào?', - a: ['xAI', 'OpenAI', 'Google DeepMind', 'Anthropic'], c: 'a1' }, - { id: 'q2', q: 'Ai là cha đẻ của NVIDIA?', - a: ['Jensen Huang', 'Sam Altman', 'Elon Musk', 'Sundar Pichai'], c: 'a1' }, - { id: 'q3', q: 'ChatGPT do công ty nào phát triển?', - a: ['OpenAI', 'Meta', 'Microsoft', 'xAI'], c: 'a1' }, - { id: 'q4', q: 'AlphaGo — hệ thống đánh bại kỳ thủ cờ vây Hàn Quốc Lee Sedol — do ai phát triển?', - a: ['Google DeepMind', 'IBM', 'OpenAI', 'NVIDIA'], c: 'a1' }, - { id: 'q5', q: 'Google Gemini do công ty nào phát triển?', - a: ['Google', 'OpenAI', 'Meta', 'Amazon'], c: 'a1' }, - { id: 'q6', q: 'Llama là dòng mô hình ngôn ngữ mở của công ty nào?', - a: ['Meta', 'Google', 'Anthropic', 'Mistral'], c: 'a1' }, - { id: 'q7', q: 'Anthropic là công ty đứng sau dòng model AI nào?', - a: ['Claude', 'Gemini', 'Grok', 'Copilot'], c: 'a1' }, - { id: 'q8', q: 'GPU là viết tắt của cụm từ nào?', - a: ['Graphics Processing Unit', 'General Program Unit', 'Grid Power Unit', 'Global Processor Utility'], c: 'a1' }, - { id: 'q9', q: 'Deep Learning là một nhánh của lĩnh vực nào?', - a: ['Machine Learning', 'Khoa học vật liệu', 'Cơ sở dữ liệu', 'Mạng máy tính'], c: 'a1' }, - { id: 'q10', q: 'Mô hình ngôn ngữ lớn (LLM) thường được viết tắt từ cụm nào?', - a: ['Large Language Model', 'Linear Learning Machine', 'Logical Layer Model', 'Long Latency Memory'], c: 'a1' }, - { id: 'q11', q: 'Phát biểu nào mô tả đúng nhất về "học có giám sát" (supervised learning)?', - a: ['Học từ dữ liệu đã có nhãn đúng', 'Học không cần dữ liệu', 'Học chỉ từ phần thưởng', 'Học bằng cách nén dữ liệu'], c: 'a1' }, - { id: 'q12', q: 'Tham số "temperature" của một LLM chủ yếu điều chỉnh điều gì?', - a: ['Mức độ ngẫu nhiên / sáng tạo của câu trả lời', 'Số token tối đa', 'Tốc độ mạng', 'Kích thước mô hình'], c: 'a1' }, - { id: 'q13', q: 'Ai được mệnh danh là "cha đẻ của trí tuệ nhân tạo" với bài kiểm tra Turing?', - a: ['Alan Turing', 'Geoffrey Hinton', 'Yann LeCun', 'John McCarthy'], c: 'a1' }, - { id: 'q14', q: 'CUDA — nền tảng tính toán song song phổ biến cho AI — do công ty nào tạo ra?', - a: ['NVIDIA', 'AMD', 'Intel', 'Qualcomm'], c: 'a1' }, - ] - const py = (arr) => arr.map((x) => `'${x.replace(/'/g, "\\'")}'`).join(', ') - const body = QA.map((q) => { - const ans = q.a.map((t, i) => `{"id": "a${i + 1}", "text": ${JSON.stringify(t)}}`).join(', ') - return ` {"id": "${q.id}", "q": ${JSON.stringify(q.q)},\n "answers": [${ans}], "correct": "${q.c}"},` - }).join('\n') - const NEWQ = `QUIZ_QUESTIONS = [ -${body} -] -_right_messages = ["Chuẩn! Kiến thức AI của bạn vững thật.", "Chính xác! Mời vào hang cùng anh em.", - "Đúng rồi! Trí tuệ nhân tạo đang chờ bạn trong hang."] -_wrong_messages = ["Chưa đúng — không sao, vào hang anh em trao đổi thêm.", - "Sai một chút thôi, hang vẫn mở cửa chào bạn.", - "Hụt rồi! Đáp án đúng đang được tô xanh đó."]` - - const RE_Q = /QUIZ_QUESTIONS = \[[\s\S]*?\n\][\s\S]*?_wrong_messages = \[[\s\S]*?\]/ - const Q_SIG = `"q": "Model Grok thuộc về công ty nào?"` - if (s.includes(Q_SIG)) ok('backend.py: cau hoi AI (idem)') - else if (RE_Q.test(s)) { - s = s.replace(RE_Q, NEWQ) - ok('backend.py: 5 cau MU -> ' + QA.length + ' cau kien thuc AI (Grok/NVIDIA/LLM...)') - } else throw new Error('KHONG THAY khoi QUIZ_QUESTIONS') - - save(f, s) -} catch (e) { warn('backend.py: ' + String((e && e.message) || e)) } - -/* ===================================================================== - E) GUARD + VALIDATE, loi thi RESTORE - ===================================================================== */ -let badrun = false -try { - const bad = [] - const app = has('frontend/app.js') ? read('frontend/app.js') : '' - const cav = has('frontend/cave3d.js') ? read('frontend/cave3d.js') : '' - const bek = has('backend.py') ? read('backend.py') : '' - for (const m of ['cylinderGeometry args={[0.30, 0.29, 0.35, 16, 1]}', - 'capsuleGeometry args={[0.105, 0.21, 4, 10]}', - 'cylinderGeometry args={[0.316, 0.316, 0.34, 40, 1, true, Math.PI - 0.662, 1.324]}', - 'V114: KHUNG HÌNH CHỐT CỐ ĐỊNH', - 'V114: BIẾN ĐỔI XẠ ẢNH CHUẨN', - 'boardPx.allFront = allFront', - 'function backPlateTex(']) if (!app.includes(m)) bad.push('app.js thieu: ' + m) - if ((app.match(/function backPlateTex\(/g) || []).length !== 1) bad.push('backPlateTex != 1') - for (const m of ['g.fillText(\'STUDIO\', 240, 54)', "makeBannerTex('V.AI STUDIO')"]) if (!cav.includes(m)) bad.push('cave3d thieu: ' + m) - if (/makeBannerTex\('(GLORY GLORY|MAN UNITED)'\)/.test(cav)) bad.push('cave3d: van con banner MU') - for (const m of ['Model Grok thuộc về công ty nào?', 'Ai là cha đẻ của NVIDIA?', 'Large Language Model']) if (!bek.includes(m)) bad.push('backend thieu: ' + m) - if (bad.length) throw new Error('marker: ' + bad.join(' | ')) - - const esbuild = await import('esbuild') - for (const p of ['frontend/app.js', 'frontend/cave3d.js', 'frontend/home3d.js']) { - if (!has(p)) continue - try { await esbuild.transform(read(p), { loader: 'jsx', format: 'esm', target: 'es2020' }) } - catch (err) { throw new Error(p + ' KHONG HOP LE: ' + String((err && err.message) || err).split('\n').slice(0, 3).join(' ')) } - } - ok('esbuild transform OK: app.js + cave3d.js + home3d.js hop le') -} catch (e) { - warn('VALIDATE THAT BAI: ' + String((e && e.message) || e)) - for (const k of Object.keys(BAK)) save(k, BAK[k]) - badrun = true - warn('DA RESTORE ve ban truoc V114') -} -if (badrun) { console.log('[v114] SKIPPED (restored)'); process.exit(0) } - -/* ===================================================================== - F) VERSION + cache-bust - ===================================================================== */ -try { - if (has('backend.py')) { - const b = read('backend.py') - const nb = b.replace(/VERSION_ID = "v\d+"/, 'VERSION_ID = "v114"') - if (nb !== b) { save('backend.py', nb); ok('backend.py: VERSION_ID -> v114') } - } - for (const ip of ['frontend/index.html', 'index.html']) { - if (!has(ip)) continue - const h = read(ip) - const nh = h.replace(/\?v=\d+/g, '?v=114') - if (nh !== h) { save(ip, nh); ok(ip + ': cache-bust -> ?v=114') } - } -} catch (e) { warn('version: ' + String((e && e.message) || e)) } - -console.log('[v114] DONE: ' + n + ' muc ap dung') -process.exit(0) diff --git a/patch_v115.mjs b/patch_v115.mjs deleted file mode 100644 index 695becb3de6ec65096f4c450d7553b304c5385ea..0000000000000000000000000000000000000000 --- a/patch_v115.mjs +++ /dev/null @@ -1,437 +0,0 @@ -/* patch_v115.mjs — V115. Chay TRONG Docker build, SAU patch_v114.mjs, TRUOC esbuild. - ========================================================================= - SUA 3 LOI NGUOI DUNG VAN CON THAY sau v114: - (1) "TAY LIEN LAC VOI THAN THE" - (2) "SO VA LOGO VAN CON IN NGƯOC TREN AO" - (3) "BANG TEN NHAN VAT CHUA THAY IN LEN MAT TRC CUA AO" - - --------------------------------------------------------------------- - HE TOA DO — TINH TU NGUON, KHONG DOAN - --------------------------------------------------------------------- - Avatar QUAY MAT VE +z (rot = atan2(mx, mz)). Bang chung trong source: - v112 ghi ro "face ... curved cap on +z", tuc MAT o phia +z. - - CameraRig (nguon goc, khong patch nao doi): - const back = new THREE.Vector3(Math.sin(yaw), 0, Math.cos(yaw)) - ideal = target + back * dist ; yaw mac dinh = Math.PI - => back = (0, 0, -1) => CAMERA NAM O LOCAL -z - => Camera mac dinh NHIN VAO LUNG nhan vat (phia -z). Nguoi choi co the - keo chuot de quay camera (rot.current doi) nen van xem duoc mat truoc. - - VI TRI DAT (giong ao dau that): - - SO AO + LOGO V.AI STUDIO : LUNG = z AM (phia camera mac dinh) - - BANG TEN NHAN VAT : NGUC = z DUONG (mat truoc ao, dung yEU cau 3) - - --------------------------------------------------------------------- - VI SAO "IN NGUOC" (loi 2) — va V115 khac gi - --------------------------------------------------------------------- - Plane mac dinh co phap tuyen +z; chu ve tren canvas doc DUNG khi nhin tu - phia +z (tuc tu phia TRUOC mat phang, huong nguoc chieu phap tuyen... noi - chinh xac: meshBasicMaterial hien texture theo huong phap tuyen, va u tang - theo +x nen tu phia +z chu doc trai->phai DUNG). - - Plane SO AO goc nam o z=-0.31 (phia camera) NHUNG KHONG XOAY => phap tuyen - van +z, tuc huong RA XA camera. Camera o -z nhin vao MAT SAU cua plane => - moi net bi lat nguoc. Do chinh la loi (2). V109 "sua" bang DoubleSide — - SAI: DoubleSide chi lam plane HIEN ra khi nhin tu sau, KHONG lam no doc - dung. V112/V113/V114 thay bang cylinderGeometry mot cung va lap luan - "u=0 nam ben trai" qua chuoi x = r*sin(t), z = r*cos(t) => screen-right; - chuoi 4-5 buoc, sai dau o MOT buoc la lat ca so lan logo — dung nhu nguoi - dung bao 3 lan lien. - - V115 dung PLANE + PHEP XOAY, thu khong the sai: - lung (z=-0.306): XOAY PI quanh Y => phap tuyen thanh -z => huong ve - camera => ta nhin MAT TRUOC plane => chu DUNG. - nguc (z=+0.300): KHONG XOAY => phap tuyen +z => huong ra truoc - mat => nguoi doi dien doc DUNG. - Khong co u, khong co t, khong co sin/cos. - - --------------------------------------------------------------------- - (1) TAY: nhom xoay quanh khop vai, cau deltoid dat DUNG tam xoay. Vi tam - cau khong doi khi group xoay, khe vai kin o MOI goc dung dua: - vai = (+-0.30, 1.30) ; tru than r 0.30 (capsule 0.30/0.34) - mat than cach tam vai = sqrt(0.30^2 + 0.13^2) - 0.30 = 0.0407 - deltoid r 0.105 > 0.0407 => cau an sau vao than, khong the ho. - ong tay r 0.068 tai y 1.16..1.44: mep trong 0.232 < 0.299 (ban kinh - than tai y 1.16) => an vao than, khong con khe. - - --------------------------------------------------------------------- - CACH LAM — KHONG PHU THUOC BAN DANG CHAY - --------------------------------------------------------------------- - a) go TRON bieu thuc JSX `{p.number != null && ( )}` - cua ban goc (plane so ao phang). Quet ngoac CAN BANG, kiem tra noi - dung THAT SU chua useNumTex(, va an CA dau `}` dong; - b) go moi LA con con tham chieu texture danh dau cu - (backPlateTex( / frontNameTex( / backTagTex( / nameTagTex( ). - CHI mesh la — KHONG BAO GIO cat , vi - CHUA toan bo nhan vat nen cat no se xoa sach nhan vat; - c) go 2 va ; - d) chen khoi MOI truoc { n++; console.log('[v115] OK: ' + m) } -const warn = (m) => console.warn('[v115] WARN: ' + m) -const P = (...a) => path.join(ROOT, ...a) -const has = (f) => fs.existsSync(P(f)) -const read = (f) => fs.readFileSync(P(f), 'utf8') -const save = (f, s) => fs.writeFileSync(P(f), s) - -const FILES = ['frontend/app.js', 'frontend/cave3d.js', 'frontend/home3d.js', 'backend.py'] -const BAK = {} -for (const f of FILES) if (has(f)) BAK[f] = read(f) - -/* Cat cac ... LA (leaf) co chua marker. Chi mesh, khong group. */ -function leafMeshSpans(src, markers) { - const spans = [] - const re = /', m.index) - if (openEnd === -1) break - if (src[openEnd - 1] === '/') { re.lastIndex = openEnd + 1; continue } - let depth = 1 - let closeAt = -1 - const scan = /<(\/?)mesh\b/g - scan.lastIndex = openEnd + 1 - let s2 - while ((s2 = scan.exec(src))) { - if (s2[1] === '/') { - depth-- - if (depth === 0) { closeAt = src.indexOf('>', s2.index); break } - } else depth++ - } - if (closeAt === -1) { re.lastIndex = openEnd + 1; continue } - const body = src.slice(m.index, closeAt + 1) - if (markers.some((k) => body.includes(k))) spans.push([m.index, closeAt + 1]) - re.lastIndex = openEnd + 1 - } - if (!spans.length) return [] - const kept = spans.filter((sp) => !spans.some((o) => - (o[0] !== sp[0] || o[1] !== sp[1]) && o[0] <= sp[0] && o[1] >= sp[1])) - const uniq = [] - for (const sp of kept) if (!uniq.some((u) => u[0] === sp[0] && u[1] === sp[1])) uniq.push(sp) - return uniq -} - -function applyCuts(src, spans) { - if (!spans.length) return src - const sorted = spans.slice().sort((a, b) => a[0] - b[0]) - const merged = [] - for (const sp of sorted) { - if (merged.length && sp[0] <= merged[merged.length - 1][1]) { - merged[merged.length - 1][1] = Math.max(merged[merged.length - 1][1], sp[1]) - } else merged.push([sp[0], sp[1]]) - } - let out = src - for (let i = merged.length - 1; i >= 0; i--) out = out.slice(0, merged[i][0]) + out.slice(merged[i][1]) - return out -} - -/* ===================================================================== - A) app.js - ===================================================================== */ -let fatal = null -try { - const f = 'frontend/app.js' - if (!has(f)) throw new Error('app.js missing') - let s = read(f) - - /* ---------- A0. Texture MOI. Ten rieng _v115* nen KHONG BAO GIO trung - khai bao voi backPlateTex/frontNameTex cu du chung con hay khong. ---------- */ - const FNS = [ - '/* V115: TEXTURE DANH DAU — ve TRONG SUOT (clearRect, khong to nen) de mau', - ' ao lo ra, giong chu that in tren vai. Chu TRANG vien NAVY doc duoc tren', - ' ca ao vang lan ao do. */', - 'const _v115TexCache = {}', - 'function _v115BackTex(number) {', - ' const key = "b|" + (number == null ? "-" : String(number))', - ' if (_v115TexCache[key]) return _v115TexCache[key]', - ' const c = document.createElement("canvas"); c.width = 320; c.height = 300', - ' const g = c.getContext("2d")', - ' g.clearRect(0, 0, 320, 300)', - ' g.textAlign = "center"; g.textBaseline = "middle"', - ' g.strokeStyle = "rgba(34,48,77,0.55)"; g.lineWidth = 5', - ' g.beginPath(); g.arc(160, 84, 62, 0, Math.PI * 2); g.stroke()', - ' g.lineWidth = 11; g.strokeStyle = "rgba(34,48,77,0.85)"; g.fillStyle = "#ffffff"', - ' g.font = "900 94px Bitter, Georgia, serif"', - ' g.strokeText("V", 160, 86); g.fillText("V", 160, 86)', - ' g.font = "800 27px Bitter, Georgia, serif"', - ' g.strokeText("STUDIO", 160, 140); g.fillText("STUDIO", 160, 140)', - ' if (number != null && String(number) !== "") {', - ' g.font = "900 110px Arial, sans-serif"', - ' g.lineWidth = 13; g.strokeStyle = "rgba(34,48,77,0.85)"; g.fillStyle = "#ffffff"', - ' g.strokeText(String(number), 160, 236); g.fillText(String(number), 160, 236)', - ' }', - ' const t = new THREE.CanvasTexture(c)', - ' t.colorSpace = THREE.SRGBColorSpace; t.anisotropy = 8; t.needsUpdate = true', - ' _v115TexCache[key] = t', - ' return t', - '}', - 'function _v115NameTex(name) {', - ' const key = "n|" + (name == null ? "" : String(name))', - ' if (_v115TexCache[key]) return _v115TexCache[key]', - ' const c = document.createElement("canvas"); c.width = 512; c.height = 132', - ' const g = c.getContext("2d")', - ' g.clearRect(0, 0, 512, 132)', - ' g.fillStyle = "rgba(20,28,45,0.92)"', - ' if (g.roundRect) { g.beginPath(); g.roundRect(4, 8, 504, 116, 16); g.fill() }', - ' else g.fillRect(4, 8, 504, 116)', - ' g.strokeStyle = "#f7f4ec"; g.lineWidth = 5', - ' if (g.roundRect) { g.beginPath(); g.roundRect(4, 8, 504, 116, 16); g.stroke() }', - ' else g.strokeRect(4, 8, 504, 116)', - ' g.textAlign = "center"; g.textBaseline = "middle"', - ' let label = String(name == null ? "" : name).trim() || "ANH EM"', - ' if (label.length > 14) label = label.slice(0, 13) + "\\u2026"', - ' let fs = 64', - ' for (; fs > 20; fs -= 2) {', - ' g.font = "800 " + fs + "px \\"Be Vietnam Pro\\", Arial, sans-serif"', - ' if (g.measureText(label).width < 456) break', - ' }', - ' g.fillStyle = "#ffffff"', - ' g.fillText(label, 256, 68)', - ' const t = new THREE.CanvasTexture(c)', - ' t.colorSpace = THREE.SRGBColorSpace; t.anisotropy = 8; t.needsUpdate = true', - ' _v115TexCache[key] = t', - ' return t', - '}', - '', - ].join('\n') - - if (s.includes('function _v115BackTex(')) ok('app.js: _v115BackTex/_v115NameTex da co (idem)') - else { - const anchor = 'function PlayerAvatar({ id, p, isLocal }) {' - if (!s.includes(anchor)) throw new Error('KHONG THAY PlayerAvatar') - s = s.replace(anchor, FNS + anchor) - ok('app.js: them _v115BackTex + _v115NameTex (nen trong suot)') - } - - /* ---------- A1. Go TRON bieu thuc JSX `{p.number != null && ( ... )}` - cua ban goc (plane so ao phang o z=-0.31, KHONG xoay => in nguoc). - Phai an CA dau `}` dong bieu thuc, neu khong se con `}` thua. ---------- */ - { - const NEEDLE = 'p.number != null && (' - let removed = 0, guard = 0, ambiguous = 0 - for (;;) { - if (++guard > 8) break - const i = s.indexOf(NEEDLE) - if (i === -1) break - const parenStart = i + NEEDLE.length - 1 - let depth = 0, pEnd = -1 - for (let k = parenStart; k < s.length; k++) { - if (s[k] === '(') depth++ - else if (s[k] === ')') { depth--; if (depth === 0) { pEnd = k; break } } - } - if (pEnd === -1) throw new Error('KHONG CAN BANG duoc bieu thuc so ao ban goc') - const inner = s.slice(parenStart + 1, pEnd) - /* chi cat khi noi dung THAT SU la khoi so ao cu */ - if (!inner.includes('useNumTex(')) { ambiguous++; break } - if (s[i - 1] !== '{') throw new Error('bieu thuc so ao khong nam trong { } JSX') - let j = pEnd + 1 - while (j < s.length && (s[j] === ' ' || s[j] === '\t' || s[j] === '\r' || s[j] === '\n')) j++ - if (s[j] !== '}') throw new Error('KHONG THAY `}` dong bieu thuc so ao') - const closeBrace = j - let st = i - 1 - while (st > 0 && (s[st - 1] === ' ' || s[st - 1] === '\t')) st-- - if (s[st - 1] === '\n') st-- - let en = closeBrace + 1 - while (en < s.length && (s[en] === ' ' || s[en] === '\t')) en++ - if (s[en] === '\r') en++ - if (s[en] === '\n') en++ - s = s.slice(0, st) + s.slice(en) - removed++ - } - if (removed > 0) ok('app.js: GO ' + removed + ' bieu thuc plane so ao PHANG ban goc (ca dau } dong)') - else if (ambiguous) ok('app.js: khoi `p.number` con lai KHONG phai plane so ao -> giu nguyen') - else ok('app.js: khong con bieu thuc plane so ao ban goc (idem)') - } - - /* ---------- A2. Go moi LA con tham chieu texture danh dau CU ---------- */ - { - const MARKERS = ['backPlateTex(', 'frontNameTex(', 'backTagTex(', 'nameTagTex('] - const sp = leafMeshSpans(s, MARKERS) - if (sp.length) { s = applyCuts(s, sp); ok('app.js: GO ' + sp.length + ' mesh danh dau CU (V109..V114)') } - else ok('app.js: khong con mesh danh dau cu (idem)') - } - - /* ---------- A3. Go 2 nhom tay cu ---------- */ - { - let cuts = 0 - for (const ref of ['armL', 'armR']) { - const re = new RegExp('[ \\t]*[ \\t]*\\r?\\n') - const m = re.exec(s) - if (m) { s = s.slice(0, m.index) + s.slice(m.index + m[0].length); cuts++ } - } - if (cuts) ok('app.js: GO ' + cuts + ' nhom tay cu') - else ok('app.js: khong con nhom tay cu (idem)') - } - - /* ---------- A4. Chen khoi V115 truoc cau an sau vao than, khong the ho.', - ' Ong tay r 0.068 tai y 1.16..1.44: mep trong 0.232 < 0.299 (ban', - ' kinh than tai y 1.16) => an vao than, khong con khe. */}', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' {/* (3) BANG TEN NHAN VAT — MAT TRUOC AO (NGUC, z DUONG vi nhan vat', - ' quay mat ve +z). Plane KHONG xoay => phap tuyen +z huong ra truoc', - ' mat => nguoi doi dien doc DUNG chieu. Day la yEU CAU (3) cua nguoi', - ' dung: bang ten in len MAT TRUOC cua ao.', - ' Ban kinh than tai y 1.22 (chop tren capsule r 0.30 tam 1.17)', - ' = sqrt(0.30^2 - 0.05^2) = 0.2958 => dat z 0.300 (lo ra 0.004).', - ' Rong 0.30 < 0.5916 (be rong than). Ti le canvas 512x132 = 3.879;', - ' plane 0.30/0.0774 = 3.876 => khong keo gian. */}', - ' ', - ' ', - ' ', - ' ', - ' {/* (2) SO AO + LOGO V.AI STUDIO — LUNG (z AM = phia camera mac dinh,', - ' nen ban tu thay ngay khi vao hang). XOAY PI quanh Y: phap tuyen', - ' +z -> -z, tuc huong VE camera => ta nhin MAT TRUOC cua plane nen', - ' chu doc DUNG. Plane goc o z=-0.31 KHONG xoay la nguon loi "in', - ' nguoc"; DoubleSide cua V109 chi lam no HIEN, khong lam no DUNG.', - ' Than la tru thang r 0.30 tai y 0.83..1.17 nen dat z -0.306 =>', - ' cach mat ao 0.006 (khong z-fight, khong tut vao trong than).', - ' Rong 0.26 = 43% be rong ao 0.60. */}', - ' ', - ' ', - ' ', - ' ', - '', - ].join('\n') - - const SIG = 'planeGeometry args={[0.30, 0.0774]}' - if (s.includes(SIG) && s.includes('planeGeometry args={[0.26, 0.244]}')) ok('app.js: khoi V115 da co (idem)') - else { - if (!s.includes(HEAD_ANCHOR)) throw new Error('KHONG THAY ', - '', - ' v115') } - } - for (const ip of ['frontend/index.html', 'index.html']) { - if (!has(ip)) continue - const h = read(ip) - const nh = h.replace(/\?v=\d+/g, '?v=115') - if (nh !== h) { save(ip, nh); ok(ip + ': cache-bust -> ?v=115') } - } -} catch (e) { warn('version: ' + String((e && e.message) || e)) } - -console.log('[v115] DONE: ' + n + ' muc ap dung') -process.exit(0) diff --git a/patch_v116.mjs b/patch_v116.mjs deleted file mode 100644 index dc2aae5b9522abf48cb007d0af70916cfdb9dac7..0000000000000000000000000000000000000000 --- a/patch_v116.mjs +++ /dev/null @@ -1,1176 +0,0 @@ -/* patch_v116.mjs — V116. Chay trong Docker build (hook cuoi o build/esbuild.config.mjs). - ========================================================================= - NAM YEU CAU CUA NGUOI DUNG: - - (1) LOGO TREN AO = ANH POSTER THAT, VA LON HON backPlateTex(). - -> VIEC NAY DO patch_v116b.mjs LAM. Xem ghi chu o phan (A) ben duoi: - ban dau V116 tu thay mieng lung o day, nhung doi chieu voi source - GOC (commit e419952) cho thay cach cat do de lai mot mesh co - map=null o lan render dau => meshBasicMaterial ve MIENG TRANG. - v116b cat TRON theo anchor position={[0, 0.99, -0.306]} do - chinh patch_v115 dat vao, va boc moi thu trong guard vaiLogoTex. - Phan con lai o day (vaiLogoTex hook + _v116NumTex) van can. - - (2) CHU "V.AI STUDIO" TRONG HANG -> ANH POSTER (drawImage, khong fillText): - - cave3d makeBannerTex() : banner vom hang - - home3d drawRedPlaque() : bia do ngoai cua hang - - home3d VaiSteleText2() : chu khac tren tang da VaiSteleRock - (ten THAT trong cay nguon la VaiSteleText2: patch_v95 tao VaiSteleText, roi - patch_v97 CAT doan [const VAI_ROCK_POS = .. function HomeForecourt(] va - thay bang VaiSteleText2. V116e sua anchor cho dung ten nay — truoc do - anchor tro VaiSteleText nen cutFn tra null va v116 RESTORE ca 5 file.) - drawRedPlaque con mot loi an: loadPlateImg().then(...) ve SAU khi texture - da tao nhung KHONG bat needsUpdate => logo do khong bao gio hien. V116 bat. - - (3) BINH CHON THEO KIEN THUC AI + COT "LUOT BINH CHON": - - POLL_QUESTIONS: 4 cau bong da -> 4 cau AI - - handler websocket 'vote' -> _att_bump(name, "votes") - - "votes" nap trong _att_load/_att_pull, tinh votes*3 trong _att_score, - tra ra o /api/attendance/top, ve thanh COT 4 o BangVangDiemDanh. - - (4) VIDEO RANDOM KHI VAO HANG + TU NHAY BAI KHI HET: - Effect tao iframe luon phat useIds[0] VA video_proxy.py cu hardcode - `loop=1&playlist=...` => video LAP MAI, khong bao gio ket thuc nen khong - the "tu nhay bai". V116: - - THAY TOAN BO effect do (cat can bang ngoac, KHONG phu thuoc chuoi - anchor ben trong — trong chain co nhieu bien the effect khac nhau) - - ten ref container DUOC DOC TU CHINH doan bi cat (khong doan bua) - - KHONG dung loop nua; iframe qua /api/video-proxy&loop=0 - - nghe 'hangmu-ended' (proxy ban khi playerState===0 ENDED) -> bai ke - - nghe 'hangmu-play' (nut playlist) -> nhay dung bai - - timer an toan 20 phut neu YouTube khong ban gi - Chon bai NGAU NHIEN luc mount do patch_v116a.mjs dam nhan. - video_proxy.py da sua trong cung commit nay. - - (5) NUT PLAYLIST MO/DOANH DANH SACH: - .board-playbar truoc day LUON hien va KHONG co CSS nao trong 5 stylesheet - duoc phuc vu. Nay co nut .board-playbar-toggle; panel chi hien khi co - class .is-open. CSS nam trong frontend/styles/playlist.css vi - `COPY frontend/styles` lay tu SOURCE TREE, khong qua build stage (bai hoc - v82). index.html thi lay tu build stage nen V116 chi chen the . - - AN TOAN: backup 5 file; validate marker + esbuild.transform; bat ky loi -> - RESTORE tat ca va exit 0. Anchor lech KHONG BAO GIO lam sap Space. - ========================================================================= */ -import fs from 'node:fs' -import path from 'node:path' - -const ROOT = process.argv[2] || '.' -let n = 0 -const ok = (m) => { n++; console.log('[v116] OK: ' + m) } -const warn = (m) => console.warn('[v116] WARN: ' + m) -const P = (...a) => path.join(ROOT, ...a) -const has = (f) => fs.existsSync(P(f)) -const read = (f) => fs.readFileSync(P(f), 'utf8') -const save = (f, s) => fs.writeFileSync(P(f), s) - -const BAK = {} -for (const f of ['frontend/app.js', 'frontend/cave3d.js', 'frontend/home3d.js', 'backend.py', 'frontend/index.html', 'video_proxy.py']) { - if (has(f)) BAK[f] = read(f) -} - -/* cat khoi function theo TEN, can bang ngoac { } */ -function cutFn(src, name) { - const m = new RegExp('function\\s+' + name + '\\s*\\([^)]*\\)\\s*\\{').exec(src) - if (!m) return null - /* V116f: start at the BRACE THE REGEX MATCHED (the function body), not at - src.indexOf('{'). With a destructured signature such as - function VaiSteleText2({ y, z, width }) { indexOf('{') lands on the - PARAM brace, so the cut began mid-signature and left "}) {" plus a stray - ')' -> esbuild 'Unexpected ")"'. The regex's \s*\{ is the body brace. */ - const start = m.index + m[0].length - 1 - let d = 0 - for (let k = start; k < src.length; k++) { - if (src[k] === '{') d++ - else if (src[k] === '}') { d--; if (d === 0) return [m.index, k + 1] } - } - return null -} -/* cat khoi [ ... ] can bang ngoac vuong */ -function cutBracket(src, needle) { - const i = src.indexOf(needle) - if (i === -1) return null - const start = src.indexOf('[', i) - if (start === -1) return null - let d = 0 - for (let k = start; k < src.length; k++) { - if (src[k] === '[') d++ - else if (src[k] === ']') { d--; if (d === 0) return [i, k + 1] } - } - return null -} -/* cat TOAN BO loi goi fnName(...) chua `marker`, can bang ( ) — bo qua string - literal va comment. Tra ve [start, end] hoac null. */ -function cutCallContaining(src, marker, names) { - const mi = src.indexOf(marker) - if (mi === -1) return null - let ci = -1, fnLen = 0 - for (const nm of names) { - const j = src.lastIndexOf(nm + '(', mi) - if (j > ci) { ci = j; fnLen = nm.length } - } - if (ci === -1) return null - const open = ci + fnLen - let par = 0, q = null, line = false, blk = false - for (let k = open; k < src.length; k++) { - const ch = src[k], nx = src[k + 1] - if (line) { if (ch === '\n') line = false; continue } - if (blk) { if (ch === '*' && nx === '/') { blk = false; k++ } continue } - if (q) { - if (ch === '\\') { k++; continue } - if (ch === q) q = null - continue - } - if (ch === '/' && nx === '/') { line = true; k++; continue } - if (ch === '/' && nx === '*') { blk = true; k++; continue } - if (ch === '"' || ch === "'" || ch === '`') { q = ch; continue } - if (ch === '(') par++ - else if (ch === ')') { par--; if (par === 0) return [ci, k + 1] } - } - return null -} - -let fatal = null - -/* ===================================================================== - A) app.js — LOGO AO: chi them loader + hook + texture so ao. - VIEC THAY MIENG LUNG DO patch_v116b.mjs LAM (xem ghi chu dau file). - ===================================================================== */ -try { - const f = 'frontend/app.js' - if (!has(f)) throw new Error('app.js missing') - let s = read(f) - - const LOADER = ` -/* ===== V116: LOGO TREN AO = ANH POSTER THAT (/images/vai-logo.png) ===== - CanvasTexture ve DONG BO nen cac ban truoc phai "ve chu" thay vi dung anh. - TextureLoader la BAT DONG BO => PlayerAvatar phai giu STATE cho den khi anh - load xong, neu khong lan render dau map=null se ra mieng dan TRANG tren lung. - Cache o pham vi module: ca hang chi tai MOT lan, moi avatar dung chung. - crossOrigin = anonymous BAT BUOC: thieu no texture nap vao GPU bi coi la - "tainted". - Anh loi / mat mang -> texture DU PHONG (huy hieu canvas) de ao khong bao gio - trong. patch_v116b noi phan du phong do vao day. */ -const VAI_LOGO_URL = '/images/vai-logo.png' -const _v116Logo = { tex: null, promise: null, done: false } -function _v116LoadLogoTex() { - if (_v116Logo.done) return Promise.resolve(_v116Logo.tex) - if (_v116Logo.promise) return _v116Logo.promise - _v116Logo.promise = new Promise((resolve) => { - if (typeof THREE === 'undefined' || !THREE.TextureLoader) { _v116Logo.done = true; resolve(null); return } - try { - const loader = new THREE.TextureLoader() - loader.setCrossOrigin('anonymous') - loader.load(VAI_LOGO_URL, (t) => { - t.colorSpace = THREE.SRGBColorSpace - t.anisotropy = 8 - t.needsUpdate = true - _v116Logo.tex = t - _v116Logo.done = true - resolve(t) - }, undefined, () => { _v116Logo.done = true; resolve(null) }) - } catch (e) { _v116Logo.done = true; resolve(null) } - }) - return _v116Logo.promise -} -function useVaiLogoTex() { - const [tex, setTex] = React.useState(_v116Logo.tex) - React.useEffect(() => { - let alive = true - _v116LoadLogoTex().then((t) => { if (alive) setTex(t) }) - return () => { alive = false } - }, []) - return tex -} -/* So ao — CANVAS rieng, nen TRONG SUOT, dat TRUOC mat poster nen doc duoc tren - moi nen. Chi ve CHU SO (logo da la anh that o tren). */ -const _v116NumCache = {} -function _v116NumTex(number) { - const key = number == null ? 'none' : String(number) - if (_v116NumCache[key]) return _v116NumCache[key] - const c = document.createElement('canvas'); c.width = 160; c.height = 160 - const g = c.getContext('2d') - g.clearRect(0, 0, 160, 160) - g.textAlign = 'center'; g.textBaseline = 'middle' - const label = String(number == null ? '' : number) - if (label) { - g.font = '900 108px Arial, sans-serif' - g.lineWidth = 12; g.strokeStyle = 'rgba(20,26,42,0.92)' - g.strokeText(label, 80, 84) - g.fillStyle = '#ffffff' - g.fillText(label, 80, 84) - } - const t = new THREE.CanvasTexture(c) - t.colorSpace = THREE.SRGBColorSpace - t.anisotropy = 8; t.needsUpdate = true - _v116NumCache[key] = t - return t -} - -` - /* Anchor bang REGEX (khong phu thuoc danh sach prop chinh xac). */ - const AV_RE = /function\s+PlayerAvatar\s*\([^)]*\)\s*\{/ - const av = AV_RE.exec(s) - if (!av) throw new Error('KHONG THAY PlayerAvatar') - - if (s.includes('function useVaiLogoTex(')) ok('app.js: useVaiLogoTex (idem)') - else { - s = s.replace(AV_RE, LOADER + '$&') - ok('app.js: them VAI_LOGO_URL + _v116LoadLogoTex + useVaiLogoTex + _v116NumTex') - } - - if (s.includes('const vaiLogoTex = useVaiLogoTex()')) ok('app.js: hook vaiLogoTex (idem)') - else { - s = s.replace(AV_RE, (m0) => m0 + '\n const vaiLogoTex = useVaiLogoTex()') - ok('app.js: PlayerAvatar -> state cho anh poster (const vaiLogoTex)') - } - - /* KHONG thay mieng lung o day — patch_v116b.mjs lam, bang cach cat TRON - do patch_v115 dat vao. Xem ghi chu - dau file ve loi "mieng dan TRANG". */ - if (s.includes('_v115BackTex(p.number)')) ok('app.js: mieng lung V115 con nguyen (v116b se thay)') - else if (s.includes('planeGeometry args={[0.36, 0.32]}')) ok('app.js: mieng lung da la poster (idem)') - else warn('app.js: khong thay mieng lung V115 — v116b se bao ro') - - save(f, s) -} catch (e) { fatal = 'app.js(logo): ' + String((e && e.message) || e) } - -/* ===================================================================== - B) app.js — (4) RANDOM + TU NHAY BAI ; (5) NUT PLAYLIST - ===================================================================== */ -if (!fatal) { - try { - const f = 'frontend/app.js' - let s = read(f) - - /* ---- B1. state + nghe nut playlist (CHI mot anchor) ---- */ - const ST_OLD = ' const idxRef = React.useRef(0)' - const ST_NEW = ` const idxRef = React.useRef(0) - /* V116: (4) random khi vao hang + tu nhay bai. -1 = chua chon. */ - const [playIdx, setPlayIdx] = React.useState(-1) - /* V116: (5) danh sach video la PANEL AN, chi hien khi bam nut. */ - const [playbarOpen, setPlaybarOpen] = React.useState(false) - /* V116: (5) nut trong playlist phat bai tuong ung. Truoc day pick() ban - hangmu-play nhung KHONG AI nghe => nut vo dung. */ - React.useEffect(() => { - const onPlay = (ev) => { - const i = ev && ev.detail ? ev.detail.index : null - if (typeof i !== 'number') return - setPlayIdx(i) - } - window.addEventListener('hangmu-play', onPlay) - return () => window.removeEventListener('hangmu-play', onPlay) - }, [])` - if (s.includes('const [playIdx, setPlayIdx]')) ok('app.js: state + hangmu-play (idem)') - else if (s.includes(ST_OLD)) { s = s.replace(ST_OLD, ST_NEW); ok('app.js: them playIdx + playbarOpen + nghe hangmu-play') } - else throw new Error('KHONG THAY const idxRef = React.useRef(0)') - - /* ---- B3. THAY TOAN BO EFFECT tao iframe ---- - Ten ref container DOC TU chinh doan bi cat (khong doan bua) — neu dung - sai ten thi `if (!wrap) return` se lam video KHONG BAO GIO hien. - Nguon goc (commit e419952) dung `const ref = React.useRef(null)`, cac - bien the sau do co the doi ten, nen phai doc dong. */ - const cutFx = cutCallContaining(s, "document.createElement('iframe')", ['React.useEffect', 'useEffect']) - if (!cutFx) throw new Error('KHONG THAY effect tao iframe cua BoardVideoOverlay') - const origFx = s.slice(cutFx[0], cutFx[1]) - let refName = '' - const mRef = origFx.match(/([A-Za-z_$][\w$]*)\.current/) - if (mRef && mRef[1] !== 'iframe') refName = mRef[1] - if (!refName) throw new Error('KHONG DOC DUOC ten ref container trong effect cu') - ok('app.js: ref container cua BoardVideoOverlay = ' + refName) - - const NEW_FX = ` React.useEffect(() => { - /* ===== V116: (4) VIDEO RANDOM + TU NHAY BAI KHI HET ===== - - phat BAI playIdx (ngau nhien khi vao hang, hoac bai da chon) - - iframe qua /api/video-proxy (xem duoc o VN) va loop=0 => video KET - THUC that; proxy ban hangmu-ended khi playerState === 0 (ENDED) - - nghe hangmu-ended => bai ke tiep - - timer an toan 20 phut neu YouTube khong ban gi */ - if (!useIds || !useIds.length) return - const wrap = ${refName}.current - if (!wrap) return - let cancelled = false - const _idx = playIdx < 0 ? 0 : playIdx % useIds.length - /* item co the la string hoac {url,title,img,yt,mp4} */ - const _norm = (it) => { - if (!it) return { url: '', title: '', img: '', vid: '' } - if (typeof it === 'string') { - const m = it.match(/(?:v=|\\/embed\\/|youtu\\.be\\/|shorts\\/)([A-Za-z0-9_-]{6,})/) - return { - url: /^https?:/i.test(it) ? it : ('https://www.youtube.com/watch?v=' + (m ? m[1] : it)), - title: '', img: '', vid: m ? m[1] : '', - } - } - const raw = it.url || it.mp4 || '' - const m = String(raw).match(/(?:v=|\\/embed\\/|youtu\\.be\\/|shorts\\/)([A-Za-z0-9_-]{6,})/) - return { url: raw, title: it.title || '', img: it.img || '', vid: it.yt || (m ? m[1] : '') } - } - const cur = _norm(useIds[_idx]) - /* Tang 1 — poster nen, luon co nen man hinh khong bao gio trong */ - const poster = document.createElement('div') - poster.style.cssText = 'position:absolute;inset:0;z-index:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 30%, #5c0e1b, #1b0508);color:#ffd76a;font:700 20px/1.3 "Be Vietnam Pro",sans-serif;text-align:center;padding:6px;gap:4px' - poster.innerHTML = '🔴⚪BẢNG TIN V.AI STUDIOHANG TU TRI AI' - wrap.appendChild(poster) - /* Tang 2 — thumbnail (nen TRONG SUOT de poster lo ra khi anh loi) */ - const thumb = document.createElement('div') - thumb.style.cssText = 'position:absolute;inset:0;z-index:2;background:transparent;overflow:hidden;display:block;opacity:0' - const img = document.createElement('img') - img.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.95' - img.alt = '' - img.onerror = () => { if (!cancelled) thumb.style.opacity = '0' } - img.onload = () => { if (!cancelled) thumb.style.opacity = '1' } - const cap = document.createElement('div') - cap.style.cssText = 'position:absolute;left:0;right:0;bottom:0;z-index:2;padding:5px 8px 6px;background:linear-gradient(180deg,transparent,rgba(0,0,0,.82));color:#ffd76a;font:700 13px/1.2 "Be Vietnam Pro",sans-serif;text-align:left;display:flex;align-items:center;gap:6px' - cap.innerHTML = 'YOUTUBEV.AI STUDIO · HANG TU TRÍ AI' - thumb.appendChild(img) - thumb.appendChild(cap) - const badge = document.createElement('div') - badge.style.cssText = 'position:absolute;left:6px;top:5px;z-index:3;background:rgba(0,0,0,.55);color:#fff;border-radius:999px;padding:2px 8px;font:800 12px/1.2 "Be Vietnam Pro",sans-serif' - badge.textContent = (typeof channel !== 'undefined' && channel === 'football') ? '⚽ VIDEO AI' : '🎵 NHẠC AI' - thumb.appendChild(badge) - const setThumb = (i) => { - const it = _norm(useIds[i % useIds.length]) - let src = it.img - if (!src && it.vid) src = 'https://i.ytimg.com/vi/' + it.vid + '/hqdefault.jpg' - if (!src) { thumb.style.opacity = '0'; return } - img.src = src - img.style.transition = 'opacity .4s' - img.style.opacity = '0.3' - requestAnimationFrame(() => { requestAnimationFrame(() => { if (!cancelled && img.complete) img.style.opacity = '.95' }) }) - } - setThumb(_idx) - wrap.appendChild(thumb) - /* Tang 3 — iframe QUA /api/video-proxy, KHONG loop => video ket thuc that */ - const iframe = document.createElement('iframe') - iframe.setAttribute('allow', 'autoplay; encrypted-media; picture-in-picture; fullscreen') - iframe.setAttribute('allowfullscreen', '') - iframe.setAttribute('referrerpolicy', 'no-referrer-when-downgrade') - iframe.setAttribute('title', 'Video AI') - iframe.style.cssText = 'position:absolute;inset:0;z-index:5;width:100%;height:100%;border:0;background:#000' - if (cur.vid) { - iframe.src = '/api/video-proxy?url=' + encodeURIComponent('https://www.youtube.com/watch?v=' + cur.vid) + - '&title=' + encodeURIComponent(cur.title || 'Hang MU') + - '&img=' + encodeURIComponent(cur.img || ('https://i.ytimg.com/vi/' + cur.vid + '/hqdefault.jpg')) + - '&loop=0' - } else if (cur.url) { - iframe.src = cur.url - } else { - iframe.src = 'about:blank' - iframe.style.display = 'none' - } - wrap.appendChild(iframe) - /* Con song hay bi chan: nghe postMessage cua proxy + YouTube native */ - let ytAlive = false - let endedOnce = false - const probe = () => { - if (cancelled) return - try { - if (iframe.contentWindow) iframe.contentWindow.postMessage(JSON.stringify({ event: 'listening', id: 'hangmu-probe' }), '*') - } catch (e) {} - } - const nextTrack = () => { - if (cancelled || endedOnce) return - endedOnce = true - setPlayIdx((c2) => ((c2 < 0 ? 0 : c2) + 1) % useIds.length) - } - const onMsg = (ev) => { - if (!ev || ev.source !== iframe.contentWindow) return - let d = null - try { d = JSON.parse(typeof ev.data === 'string' ? ev.data : '') } catch (e) { return } - if (!d) return - if (d.event === 'hangmu-playing') { - if (d.playing === true) { ytAlive = true; if (!cancelled) iframe.style.display = '' } - return - } - if (d.event === 'onReady' || d.event === 'infoDelivery') { - ytAlive = true - if (!cancelled) iframe.style.display = '' - } - /* V116: (4) TU NHAY BAI KHI HET — proxy bao khi playerState === 0 */ - if (d.event === 'hangmu-ended') { nextTrack(); return } - if (d.event === 'infoDelivery' && d.info && d.info.playerState === 0) { nextTrack() } - } - window.addEventListener('message', onMsg) - const syncVis = () => { if (!cancelled) iframe.style.display = ytAlive ? '' : 'none' } - const probeSync = () => { probe(); setTimeout(syncVis, 1200) } - iframe.addEventListener('load', () => { setTimeout(probeSync, 300) }) - const t1 = setTimeout(probeSync, 500) - const t2 = setTimeout(probeSync, 2000) - const t3 = setTimeout(() => { if (!cancelled && !ytAlive) iframe.style.display = 'none' }, 6000) - const iv = setInterval(probeSync, 10000) - /* Luoi an toan: YouTube khong bao gi thi van sang bai sau 20 phut */ - const tEnd = setTimeout(() => { nextTrack() }, 20 * 60 * 1000) - try { window.dispatchEvent(new CustomEvent('hangmu-board-ready', { detail: { videoIds: useIds, iframe } })) } catch (e) {} - wrap._setThumb = setThumb - return () => { - cancelled = true - clearTimeout(t1); clearTimeout(t2); clearTimeout(t3); clearTimeout(tEnd); clearInterval(iv) - window.removeEventListener('message', onMsg) - try { wrap.innerHTML = '' } catch (e) {} - } - }, [useIds?.join(','), playIdx])` - - if (s.includes('V116: (4) VIDEO RANDOM + TU NHAY BAI KHI HET')) ok('app.js: effect video V116 (idem)') - else { - s = s.slice(0, cutFx[0]) + NEW_FX + s.slice(cutFx[1]) - ok('app.js: THAY effect video -> random + tu nhay bai (proxy loop=0 + hangmu-ended)') - } - - /* ---- B4. (5) PLAYLIST -> NUT BAM, PANEL AN ---- */ - const PB_CLS = '
setPlaybarOpen((v) => !v)} - aria-expanded={playbarOpen} aria-controls="board-playlist" - title={playbarOpen ? 'Đóng danh sách video' : 'Mở danh sách video'}> - - {typeof channel !== 'undefined' && channel === 'football' ? '⚽' : '🎵'} Playlist - -