diff --git a/.gitattributes b/.gitattributes
index a883f136758b1b299bc787bb6e669bfac810ab2d..0c1c86089bee2bd4281c6c60d8fe0dd06732c016 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -238,3 +238,17 @@ php2shell/dist/audio/stem_ambient.mp3 filter=lfs diff=lfs merge=lfs -text
php2shell/dist/audio/stem_qiannian.mp3 filter=lfs diff=lfs merge=lfs -text
php2shell/studio/music/qiannian_src.mp3 filter=lfs diff=lfs merge=lfs -text
奥德彪.MP4 filter=lfs diff=lfs merge=lfs -text
+fonts/brush.woff2 filter=lfs diff=lfs merge=lfs -text
+fonts/cursive.woff2 filter=lfs diff=lfs merge=lfs -text
+fonts/pop.woff2 filter=lfs diff=lfs merge=lfs -text
+fonts/sans-black.woff2 filter=lfs diff=lfs merge=lfs -text
+fonts/sans-light.woff2 filter=lfs diff=lfs merge=lfs -text
+fonts/serif-black.woff2 filter=lfs diff=lfs merge=lfs -text
+fonts/serif-medium.woff2 filter=lfs diff=lfs merge=lfs -text
+fonts/xiaowei.woff2 filter=lfs diff=lfs merge=lfs -text
+media/odb.mp4 filter=lfs diff=lfs merge=lfs -text
+media/stills/st0.jpg filter=lfs diff=lfs merge=lfs -text
+media/stills/st3.jpg filter=lfs diff=lfs merge=lfs -text
+media/stills/st5.jpg filter=lfs diff=lfs merge=lfs -text
+media/stills/st6.jpg filter=lfs diff=lfs merge=lfs -text
+media/voice/q01.mp3 filter=lfs diff=lfs merge=lfs -text
diff --git a/README.md b/README.md
index 2eb2445faa2ff41987b7b49ce346deb6faabc458..db42016822df3f41fbb51bf1fcfd0b8117bce58a 100644
--- a/README.md
+++ b/README.md
@@ -145,3 +145,8 @@ pinned: false
## 6. 进度日志
- **推送 #1**:写好项目计划、语录清单、导演阐述、技术方案和实施步骤。
+- **推送 #2(素材管线)**:
+ - 配音:43 条语录拆成 133 个分句,逐句合成(云健 · 语速 -12% · 音调 -5Hz),带逐字时间戳;经过均衡、压缩,再做两遍响度标准化到 -16 LUFS,存为 `media/voice/qNN.mp3`,时间轴写进 `voice.json`;
+ - 原片:`奥德彪.MP4` 镜头检测出 7 个镜头(切点 2.80 / 4.23 / 7.17 / 10.87 / 13.27 / 16.47 秒),按每 8 帧一个关键帧重新编码(方便网页逐帧精确取画面),并抽出 7 张剧照;
+ - 字体:思源宋体 Heavy / Medium、思源黑体 Black / Light、马善政毛笔、站酷小薇、智莽行、站酷庆科黄油体、Bebas Neue、Cormorant Garamond、VT323、Special Elite,按实际用到的字子集化,总共约 1.3 MB;
+ - 引擎初稿:自动分镜、WebGL 风格 / 转场着色器、12 种程序化场景、动态字幕排版(源码见 `project/`)。
diff --git a/fonts/bebas.woff2 b/fonts/bebas.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..e9ad52d6b7b10bc0b7d3769afe3c43d65cd30ee9
Binary files /dev/null and b/fonts/bebas.woff2 differ
diff --git a/fonts/brush.woff2 b/fonts/brush.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..fd8800a86d7a6440d9c35335f8c655a301facd79
--- /dev/null
+++ b/fonts/brush.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:289285ccc0aa5a38cfc8913f9550f8b3c924946462fa147f8eba5fc2bc74c89b
+size 228832
diff --git a/fonts/cursive.woff2 b/fonts/cursive.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..afba97dbc26f0b8580f968b6078d8eddd947f9c4
--- /dev/null
+++ b/fonts/cursive.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5e6c3f827ca50ec1e956433c52b9c43dfe76ca7d11b06175df90808e4903bd0d
+size 167704
diff --git a/fonts/garamond.woff2 b/fonts/garamond.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..fd831c47cfe157727606aaab39da961d5f1c777f
Binary files /dev/null and b/fonts/garamond.woff2 differ
diff --git a/fonts/pop.woff2 b/fonts/pop.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..30876315ee0d5f8f4f61fb1b83b2bf6189639e30
--- /dev/null
+++ b/fonts/pop.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:ae9cf9e555b82c6f31441e3cc6c70599740f7b303ea20981f669e6e3a739b373
+size 131836
diff --git a/fonts/sans-black.woff2 b/fonts/sans-black.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..5df2dbbb2a76a34bac5f81109676e23f1179a6f8
--- /dev/null
+++ b/fonts/sans-black.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5e5855d8622fcd16205bb08350d23a84957e0c5efce7105678ca558845c923ff
+size 105776
diff --git a/fonts/sans-light.woff2 b/fonts/sans-light.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..2fb4dbba85e85597fe3b0edaf4dc442a35e42f91
--- /dev/null
+++ b/fonts/sans-light.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:944ecf8fca87214323e4d9ba122e716a472f570d225a54d4ea013565946552d6
+size 103408
diff --git a/fonts/serif-black.woff2 b/fonts/serif-black.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..7916f90eef91b6e17041e5d558fb1082011a95c2
--- /dev/null
+++ b/fonts/serif-black.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8f410aaae9ea48753c56841542cad6a43123effafc45d748c707bd1e73cb386f
+size 138884
diff --git a/fonts/serif-medium.woff2 b/fonts/serif-medium.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..4f155fa4ae82068b9487794e6b73a52b8187c066
--- /dev/null
+++ b/fonts/serif-medium.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:844923e12121ddfca975606caad76911c0a25b11393739b10b541cd0a023087b
+size 138748
diff --git a/fonts/typewriter.woff2 b/fonts/typewriter.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..f7e4b5791eb00df34ebf1c49f49fd05ee9361872
Binary files /dev/null and b/fonts/typewriter.woff2 differ
diff --git a/fonts/vt323.woff2 b/fonts/vt323.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..96beeae5865981c3f89c626846dbc8b86ec7397f
Binary files /dev/null and b/fonts/vt323.woff2 differ
diff --git a/fonts/xiaowei.woff2 b/fonts/xiaowei.woff2
new file mode 100644
index 0000000000000000000000000000000000000000..a3190e9445158ed61402deebff40bd2722c736b8
--- /dev/null
+++ b/fonts/xiaowei.woff2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c50592fd955ef10916efa941601c3e9ea310742c0f2dc4bf8bab8d3510f77ddf
+size 190352
diff --git a/media/odb.mp4 b/media/odb.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..ec6f0c6fcb015a7eed9a0e1b70fc2acca4941a1a
--- /dev/null
+++ b/media/odb.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:59461dda528055e6e2ddeba704d3e7ccfd0d99536f4b75a06b74d5c80bdb5a6d
+size 10552324
diff --git a/media/stills/st0.jpg b/media/stills/st0.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..286b6b838e6bd7ceab1090e799d4b160a7720be3
--- /dev/null
+++ b/media/stills/st0.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3cd1865f760efdc778a7244dbaa79be3a86a37d9b980c62bf4bf936bdf234fc6
+size 102218
diff --git a/media/stills/st1.jpg b/media/stills/st1.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..568daf2c0080c128c728855de040e086d2084722
Binary files /dev/null and b/media/stills/st1.jpg differ
diff --git a/media/stills/st2.jpg b/media/stills/st2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..21aa837957f643f39c2977c99e65dfb2a39b8b1b
Binary files /dev/null and b/media/stills/st2.jpg differ
diff --git a/media/stills/st3.jpg b/media/stills/st3.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..0f2831eef3c79bf0a1e5b07c66c0cb665d0040fe
--- /dev/null
+++ b/media/stills/st3.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:44ecbb7d0ffaf7ab3fed9671372af9fadd8a758efbdbb455e0553c92ec292d84
+size 115788
diff --git a/media/stills/st4.jpg b/media/stills/st4.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..33892f4848f896c1df6c84e244534b8115bf1a47
Binary files /dev/null and b/media/stills/st4.jpg differ
diff --git a/media/stills/st5.jpg b/media/stills/st5.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a8dcfe749be530a38ef11ad58c27f18578b48ce8
--- /dev/null
+++ b/media/stills/st5.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:5c9d5682762ee48b0a23813320dea617caf3a7b15143a49ed9d5c415adec3aa5
+size 138120
diff --git a/media/stills/st6.jpg b/media/stills/st6.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..483e42374d3736b8552ebc99415720c7414273a0
--- /dev/null
+++ b/media/stills/st6.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f9103df0c42f52e54fba7fac0a685bf5aeb773e07595bfabec69541776e9f5d0
+size 118173
diff --git a/media/voice/q01.mp3 b/media/voice/q01.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..9cbfc4bfe2adae1adf4ccb513bc07301adb76890
Binary files /dev/null and b/media/voice/q01.mp3 differ
diff --git a/media/voice/q02.mp3 b/media/voice/q02.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..65acd703660c3979a964931d5885a72489b9d522
Binary files /dev/null and b/media/voice/q02.mp3 differ
diff --git a/media/voice/q03.mp3 b/media/voice/q03.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..31c8461e5f34394470275eb5dc20d6d8e76509c4
Binary files /dev/null and b/media/voice/q03.mp3 differ
diff --git a/media/voice/q04.mp3 b/media/voice/q04.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..0f6783b25d290b824031b8ebb2d3cfd3638826fb
Binary files /dev/null and b/media/voice/q04.mp3 differ
diff --git a/media/voice/q05.mp3 b/media/voice/q05.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..9292b4798bdca0439ceaf695015bc916854665e1
Binary files /dev/null and b/media/voice/q05.mp3 differ
diff --git a/media/voice/q06.mp3 b/media/voice/q06.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..b7ed2f31cf6ef4d6acdfc9bc2d02b9a540efad21
Binary files /dev/null and b/media/voice/q06.mp3 differ
diff --git a/media/voice/q07.mp3 b/media/voice/q07.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..ac4180d43a14db79d8110d5347fa4602b902d5a5
Binary files /dev/null and b/media/voice/q07.mp3 differ
diff --git a/media/voice/q08.mp3 b/media/voice/q08.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..0aaa9033e5ebdec90d0414976f6ff7c02908c20e
Binary files /dev/null and b/media/voice/q08.mp3 differ
diff --git a/media/voice/q09.mp3 b/media/voice/q09.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..8ae6dbfa35a712da4c58e9447d0d55eb637f1c42
Binary files /dev/null and b/media/voice/q09.mp3 differ
diff --git a/media/voice/q10.mp3 b/media/voice/q10.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..06bb3025a4c9d467f12bf3010b295746be45a882
Binary files /dev/null and b/media/voice/q10.mp3 differ
diff --git a/media/voice/q11.mp3 b/media/voice/q11.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..cc43a45212aba58c38627fbce43d904aef1089a9
Binary files /dev/null and b/media/voice/q11.mp3 differ
diff --git a/media/voice/q12.mp3 b/media/voice/q12.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..8e73b9dc43e78485e2aef7c2b036b673db7ca1be
Binary files /dev/null and b/media/voice/q12.mp3 differ
diff --git a/media/voice/q13.mp3 b/media/voice/q13.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..153a4495ee87302c39090f83960970cf983e3eec
Binary files /dev/null and b/media/voice/q13.mp3 differ
diff --git a/media/voice/q14.mp3 b/media/voice/q14.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..f69f6849bd0e7603943726438455bb46a813734d
Binary files /dev/null and b/media/voice/q14.mp3 differ
diff --git a/media/voice/q15.mp3 b/media/voice/q15.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..55ec9b2ddeb535ad1b9b1842b791074fec22c38d
Binary files /dev/null and b/media/voice/q15.mp3 differ
diff --git a/media/voice/q16.mp3 b/media/voice/q16.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..9ed2c15a4b14315f7518250d42b9d19617304a87
Binary files /dev/null and b/media/voice/q16.mp3 differ
diff --git a/media/voice/q17.mp3 b/media/voice/q17.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..aa236689f53753e96ecf8b728c31876f802b31f4
Binary files /dev/null and b/media/voice/q17.mp3 differ
diff --git a/media/voice/q18.mp3 b/media/voice/q18.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..5b2880b03711504a74463a3dd738476611754160
Binary files /dev/null and b/media/voice/q18.mp3 differ
diff --git a/media/voice/q19.mp3 b/media/voice/q19.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..89a67841862c7a1467b7217f62e3d00c4ebe40f6
Binary files /dev/null and b/media/voice/q19.mp3 differ
diff --git a/media/voice/q20.mp3 b/media/voice/q20.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..8f7e29d22232127bb5a8d032ab80509f987c1804
Binary files /dev/null and b/media/voice/q20.mp3 differ
diff --git a/media/voice/q21.mp3 b/media/voice/q21.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..9bbaca9287b043f342168f055da8d92041d5e428
Binary files /dev/null and b/media/voice/q21.mp3 differ
diff --git a/media/voice/q22.mp3 b/media/voice/q22.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..ac0a483bbd25b2a7477dfdb1e99c670b90ba7f82
Binary files /dev/null and b/media/voice/q22.mp3 differ
diff --git a/media/voice/q23.mp3 b/media/voice/q23.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..5ea0c1270a9cfa1b21be0edce8cde13d54069c3b
Binary files /dev/null and b/media/voice/q23.mp3 differ
diff --git a/media/voice/q24.mp3 b/media/voice/q24.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..3761e2ed405b0983c4448e3c8aff4ee3ca8a5a3c
Binary files /dev/null and b/media/voice/q24.mp3 differ
diff --git a/media/voice/q25.mp3 b/media/voice/q25.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..3e51c71f6567e5edd94c9a5d68b6f303e3a60065
Binary files /dev/null and b/media/voice/q25.mp3 differ
diff --git a/media/voice/q26.mp3 b/media/voice/q26.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..c75a9e28ea41e604f91385034f4c8e4fd163b44b
Binary files /dev/null and b/media/voice/q26.mp3 differ
diff --git a/media/voice/q27.mp3 b/media/voice/q27.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..9990b3fe22c5eaa0271fb41950b717981461cbbc
Binary files /dev/null and b/media/voice/q27.mp3 differ
diff --git a/media/voice/q28.mp3 b/media/voice/q28.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..0fe5e514d14959c2d569faa4a53298dc63be2af0
Binary files /dev/null and b/media/voice/q28.mp3 differ
diff --git a/media/voice/q29.mp3 b/media/voice/q29.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..3f1480dd2dbd370b33ce8d894b36e2ec7713aabd
Binary files /dev/null and b/media/voice/q29.mp3 differ
diff --git a/media/voice/q30.mp3 b/media/voice/q30.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..fe22e4291b5f2d6847d2e3d53d16c05c93604adf
Binary files /dev/null and b/media/voice/q30.mp3 differ
diff --git a/media/voice/q31.mp3 b/media/voice/q31.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..dac9e90656ca807ee06213ab3f73b0b1bdd4eae2
Binary files /dev/null and b/media/voice/q31.mp3 differ
diff --git a/media/voice/q32.mp3 b/media/voice/q32.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..032d487300d30c04e09e9d10dd5e87d2bd988cd3
Binary files /dev/null and b/media/voice/q32.mp3 differ
diff --git a/media/voice/q33.mp3 b/media/voice/q33.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..c80abb0f543da6ef8aa7ec3924fe5f73ddbca607
Binary files /dev/null and b/media/voice/q33.mp3 differ
diff --git a/media/voice/q34.mp3 b/media/voice/q34.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..2bd0a99106301f37ff02d2bba0d8286deabe1950
Binary files /dev/null and b/media/voice/q34.mp3 differ
diff --git a/media/voice/q35.mp3 b/media/voice/q35.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..1b10ae41f9ec053f7bb09d5e6424e287ac307a42
Binary files /dev/null and b/media/voice/q35.mp3 differ
diff --git a/media/voice/q36.mp3 b/media/voice/q36.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..daa05919949e5cd564f90d78687a5a30d9d1f9da
Binary files /dev/null and b/media/voice/q36.mp3 differ
diff --git a/media/voice/q37.mp3 b/media/voice/q37.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..3cd9ba462b84b9d30e9e9cef3099eb4dfccf6776
Binary files /dev/null and b/media/voice/q37.mp3 differ
diff --git a/media/voice/q38.mp3 b/media/voice/q38.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..89dd55c87b611796342d75aeb910525b585207e0
Binary files /dev/null and b/media/voice/q38.mp3 differ
diff --git a/media/voice/q39.mp3 b/media/voice/q39.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..74dbadc42ae6df0e48b352e6c28f88f8bd9b3962
Binary files /dev/null and b/media/voice/q39.mp3 differ
diff --git a/media/voice/q40.mp3 b/media/voice/q40.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..5dee35fea58586e3bade7787ad7a5a1123def429
Binary files /dev/null and b/media/voice/q40.mp3 differ
diff --git a/media/voice/q41.mp3 b/media/voice/q41.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..5a3df7c5d9d44568d18bb9a566bb7028f242eaae
Binary files /dev/null and b/media/voice/q41.mp3 differ
diff --git a/media/voice/q42.mp3 b/media/voice/q42.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..b88856e4a9506d7c4376ab93da652bc9fce07e31
Binary files /dev/null and b/media/voice/q42.mp3 differ
diff --git a/media/voice/q43.mp3 b/media/voice/q43.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..b91c1c0d4f6f90b9614fcdc83735d6667c9f6c25
Binary files /dev/null and b/media/voice/q43.mp3 differ
diff --git a/project/frontend/package.json b/project/frontend/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..97e40d6175fb8358346648ab13e57817a9ffffb2
--- /dev/null
+++ b/project/frontend/package.json
@@ -0,0 +1,85 @@
+{
+ "name": "frontend",
+ "private": true,
+ "version": "0.0.0",
+ "type": "module",
+ "scripts": {
+ "dev": "node scripts/check-env.cjs vite",
+ "build": "node scripts/check-env.cjs npm run build:client && npm run build:server",
+ "build:client": "vite build --outDir dist/client",
+ "build:server": "vite build --ssr src/entry-server.tsx --outDir dist/server",
+ "lint": "eslint .",
+ "preview": "vite preview",
+ "type-check": "tsc --noEmit --incremental"
+ },
+ "dependencies": {
+ "@hookform/resolvers": "5.2.2",
+ "@radix-ui/react-accordion": "1.2.12",
+ "@radix-ui/react-aspect-ratio": "1.1.8",
+ "@radix-ui/react-avatar": "1.1.11",
+ "@radix-ui/react-checkbox": "1.3.3",
+ "@radix-ui/react-collapsible": "1.1.12",
+ "@radix-ui/react-context-menu": "2.2.16",
+ "@radix-ui/react-dialog": "1.1.15",
+ "@radix-ui/react-dropdown-menu": "2.1.16",
+ "@radix-ui/react-hover-card": "1.1.15",
+ "@radix-ui/react-label": "2.1.8",
+ "@radix-ui/react-menubar": "1.1.16",
+ "@radix-ui/react-navigation-menu": "1.2.14",
+ "@radix-ui/react-popover": "1.1.15",
+ "@radix-ui/react-progress": "1.1.8",
+ "@radix-ui/react-radio-group": "1.3.8",
+ "@radix-ui/react-scroll-area": "1.2.10",
+ "@radix-ui/react-select": "2.2.6",
+ "@radix-ui/react-separator": "1.1.8",
+ "@radix-ui/react-slider": "1.3.6",
+ "@radix-ui/react-slot": "1.2.4",
+ "@radix-ui/react-switch": "1.2.6",
+ "@radix-ui/react-tabs": "1.1.13",
+ "@radix-ui/react-toast": "1.2.15",
+ "@radix-ui/react-toggle": "1.1.10",
+ "@radix-ui/react-toggle-group": "1.1.11",
+ "@radix-ui/react-tooltip": "1.2.8",
+ "@surf-ai/theme": "latest",
+ "@tanstack/query-core": "5.94.5",
+ "@tanstack/react-query": "5.94.5",
+ "class-variance-authority": "0.7.1",
+ "clsx": "2.1.1",
+ "cmdk": "1.1.1",
+ "date-fns": "4.1.0",
+ "echarts": "5.6.0",
+ "echarts-for-react": "3.0.6",
+ "embla-carousel-react": "8.6.0",
+ "fflate": "^0.8.3",
+ "lucide-react": "0.454.0",
+ "mp4-muxer": "^5.2.2",
+ "next-themes": "0.4.6",
+ "react": "19.2.4",
+ "react-day-picker": "9.14.0",
+ "react-dom": "19.2.4",
+ "react-hook-form": "7.72.0",
+ "react-resizable-panels": "4.7.6",
+ "scheduler": "0.27.0",
+ "sonner": "1.7.4",
+ "tailwind-merge": "2.6.1",
+ "vaul": "1.1.2",
+ "zod": "3.25.76"
+ },
+ "devDependencies": {
+ "@types/react": "19.2.14",
+ "@types/react-dom": "19.2.3",
+ "@types/node": "22.19.15",
+ "@eslint/js": "9.39.4",
+ "@vitejs/plugin-react": "4.7.0",
+ "@tailwindcss/vite": "4.2.2",
+ "eslint": "9.39.4",
+ "eslint-plugin-react-hooks": "5.2.0",
+ "eslint-plugin-react-refresh": "0.4.26",
+ "globals": "16.5.0",
+ "tailwindcss": "4.2.2",
+ "tw-animate-css": "1.4.0",
+ "typescript-eslint": "8.57.1",
+ "typescript": "5.9.3",
+ "vite": "6.4.2"
+ }
+}
diff --git a/project/frontend/src/App.tsx b/project/frontend/src/App.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..9f12606de706e7d27baae53e89f18955d586f3be
--- /dev/null
+++ b/project/frontend/src/App.tsx
@@ -0,0 +1,24 @@
+const SURF_LOGO_PATH = "M14.6875 13.333C15.0977 13.333 15.4859 13.5196 15.7422 13.8398L17.8721 16.502C17.9009 16.538 17.9308 16.5721 17.9619 16.6035C18.3091 16.9542 18.7529 17.3405 18.7529 17.834C18.7528 18.3399 18.3428 18.75 17.8369 18.75H17.5713C17.2123 18.75 16.8727 18.5869 16.6484 18.3066L15.4678 16.8311C14.761 15.9479 13.3369 16.4478 13.3369 17.5791V18.6494C13.3369 18.7062 13.2882 18.75 13.2314 18.75H11.3584C10.7127 18.75 10.1016 18.4564 9.69824 17.9521L8.80176 16.8311C8.09497 15.9477 6.66993 16.4478 6.66992 17.5791V18.6494C6.66991 18.7062 6.62124 18.75 6.56445 18.75H4.69141C4.04589 18.75 3.43548 18.4562 3.03223 17.9521L2.13477 16.8311C1.77885 16.3862 1.25293 15.931 1.25293 15.3613V13.4395C1.253 13.3822 1.29729 13.3331 1.35449 13.333C1.7646 13.3332 2.15295 13.5196 2.40918 13.8398L4.53809 16.502C5.24478 17.3853 6.66962 16.886 6.66992 15.7549V14.6836C6.67018 13.9379 7.27483 13.3332 8.02051 13.333C8.43065 13.333 8.81884 13.5197 9.0752 13.8398L11.2051 16.502C11.9097 17.3827 13.3282 16.8887 13.3369 15.7646V14.6836C13.3372 13.9378 13.9417 13.3331 14.6875 13.333ZM14.6875 6.66699C15.0978 6.66702 15.4859 6.85347 15.7422 7.17383L17.8721 9.83594C18.2276 10.2801 18.7526 10.7339 18.7529 11.3027V13.2266C18.7528 13.2833 18.7091 13.333 18.6523 13.333C18.2421 13.3329 17.8539 13.1465 17.5977 12.8262L15.4678 10.1641C14.7609 9.28113 13.3369 9.78089 13.3369 10.9121V11.9824C13.3369 12.7282 12.7321 13.3328 11.9863 13.333C11.5761 13.3329 11.187 13.1465 10.9307 12.8262L8.80176 10.1641C8.09497 9.28072 6.66993 9.78076 6.66992 10.9121V11.9824C6.66992 12.7284 6.06525 13.3329 5.31934 13.333C4.90908 13.3329 4.52094 13.1465 4.26465 12.8262L2.13477 10.1641C1.7788 9.71925 1.25293 9.26403 1.25293 8.69434V6.77344C1.253 6.71621 1.29728 6.6671 1.35449 6.66699C1.76461 6.66714 2.15295 6.85359 2.40918 7.17383L4.53809 9.83594C5.24487 10.7193 6.66989 10.2192 6.66992 9.08789V8.01758C6.66992 7.27168 7.27467 6.66722 8.02051 6.66699C8.43082 6.66699 8.81885 6.85345 9.0752 7.17383L11.2051 9.83594C11.9097 10.7163 13.3279 10.2223 13.3369 9.09863V8.01758C13.3369 7.27161 13.9416 6.6671 14.6875 6.66699ZM2.43555 1.25C2.79488 1.25 3.13499 1.41367 3.35938 1.69434L4.53809 3.16895C5.24485 4.05241 6.66991 3.55228 6.66992 2.4209V1.35059C6.66993 1.29391 6.71874 1.25017 6.77539 1.25H8.64844C9.29394 1.25 9.90438 1.5438 10.3076 2.04785L11.2051 3.16895C11.9097 4.04967 13.3282 3.55564 13.3369 2.43164V1.35059C13.3369 1.29391 13.3857 1.25017 13.4424 1.25H15.3154C15.9609 1.25 16.5714 1.5438 16.9746 2.04785L17.8721 3.16895C18.2275 3.61314 18.7526 4.06689 18.7529 4.63574V6.56055C18.7528 6.61728 18.7091 6.66699 18.6523 6.66699C18.2421 6.66688 17.8539 6.4795 17.5977 6.15918L15.4678 3.49805C14.761 2.61474 13.3371 3.11388 13.3369 4.24512V5.31543C13.3369 6.06126 12.7321 6.66673 11.9863 6.66699C11.5761 6.66693 11.187 6.47955 10.9307 6.15918L8.80176 3.49805C8.095 2.61474 6.67006 3.11388 6.66992 4.24512V5.31543C6.66992 6.06137 6.06525 6.66691 5.31934 6.66699C4.90908 6.66693 4.52094 6.47955 4.26465 6.15918L2.13477 3.49805C2.10558 3.46158 2.07543 3.42725 2.04395 3.39551C1.6966 3.04528 1.25293 2.6583 1.25293 2.16504C1.25317 1.65963 1.66348 1.25 2.16895 1.25H2.43555Z"
+
+function SurfLogo() {
+ return (
+
+ )
+}
+
+// Frontend API calls should use `src/lib/api.ts`, not absolute `/api/...` URLs.
+export default function App() {
+ return (
+
+
+
+ GM, Builder.
+
+
+ Start your crypto project here!
+
+
+ )
+}
diff --git a/project/frontend/src/ErrorBoundary.tsx b/project/frontend/src/ErrorBoundary.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..46b25fd85f8f22e4ff300deaa13e6f88cd82bd53
--- /dev/null
+++ b/project/frontend/src/ErrorBoundary.tsx
@@ -0,0 +1,106 @@
+import { Component, type ReactNode } from 'react'
+
+interface Props { children: ReactNode; fallback?: ReactNode }
+interface State { error: Error | null }
+
+// Auto-reload config for transient dep-optimization errors.
+// Shares the same key as entry-client's cold-start guard so reload
+// attempts are counted together, preventing double reload loops.
+const RELOAD_KEY = '__dep_reload'
+const MAX_RELOADS = 6
+// If the last reload was more than this many ms ago, reset the counter.
+// This prevents stale counters from blocking legitimate retries on a
+// later visit, while still capping rapid reload loops.
+const RELOAD_WINDOW_MS = 60_000
+
+// Patterns that indicate React modules loaded as stubs (dep optimization in progress)
+const DEP_OPT_PATTERNS = [
+ "reading 'useState'",
+ "reading 'useEffect'",
+ "reading 'useRef'",
+ "reading 'useCallback'",
+ "reading 'useMemo'",
+ "reading 'useContext'",
+ "reading 'useReducer'",
+]
+
+function isDepOptError(msg: string): boolean {
+ return DEP_OPT_PATTERNS.some((p) => msg.includes(p))
+}
+
+// Shared format with entry-client: { c: count, t: timestamp }
+function getReloadState(): { c: number; t: number } {
+ try {
+ const raw = sessionStorage.getItem(RELOAD_KEY)
+ if (raw) return JSON.parse(raw)
+ } catch { /* ignore parse errors */ }
+ return { c: 0, t: 0 }
+}
+
+export default class ErrorBoundary extends Component {
+ state: State = { error: null }
+
+ static getDerivedStateFromError(error: Error) {
+ return { error }
+ }
+
+ componentDidCatch(error: Error) {
+ if (!isDepOptError(error.message)) return
+ // Vite dep optimization may serve React stubs during cold start.
+ // Auto-reload so the browser fetches the real modules once ready.
+ const prev = getReloadState()
+ // Reset counter if outside the rapid-reload window (stale from earlier visit)
+ const count = (Date.now() - prev.t > RELOAD_WINDOW_MS) ? 0 : prev.c
+ if (count < MAX_RELOADS) {
+ sessionStorage.setItem(RELOAD_KEY, JSON.stringify({ c: count + 1, t: Date.now() }))
+ setTimeout(() => location.reload(), 3000)
+ }
+ }
+
+ render() {
+ if (this.state.error) {
+ if (this.props.fallback) return this.props.fallback
+
+ // Show a friendlier message for dep optimization errors that will auto-reload
+ if (isDepOptError(this.state.error.message)) {
+ const { c, t } = getReloadState()
+ const fresh = (Date.now() - t <= RELOAD_WINDOW_MS)
+ if (!fresh || c < MAX_RELOADS) {
+ return (
+
+
Loading dependencies...
+
Reloading automatically
+
+ )
+ }
+ }
+
+ return (
+
+
Component Error
+
{this.state.error.message}
+
+ )
+ }
+ return this.props.children
+ }
+}
diff --git a/project/frontend/src/components/ui/accordion.tsx b/project/frontend/src/components/ui/accordion.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..e1797c93458f3751a2e0f1189ff50d77f20ae3ed
--- /dev/null
+++ b/project/frontend/src/components/ui/accordion.tsx
@@ -0,0 +1,55 @@
+import * as React from "react"
+import * as AccordionPrimitive from "@radix-ui/react-accordion"
+import { ChevronDown } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Accordion = AccordionPrimitive.Root
+
+const AccordionItem = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AccordionItem.displayName = "AccordionItem"
+
+const AccordionTrigger = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+ svg]:rotate-180",
+ className
+ )}
+ {...props}
+ >
+ {children}
+
+
+
+))
+AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
+
+const AccordionContent = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, children, ...props }, ref) => (
+
+ {children}
+
+))
+AccordionContent.displayName = AccordionPrimitive.Content.displayName
+
+export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
diff --git a/project/frontend/src/components/ui/alert.tsx b/project/frontend/src/components/ui/alert.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..5afd41d142c95c74069ebb5460117e74ead3b9df
--- /dev/null
+++ b/project/frontend/src/components/ui/alert.tsx
@@ -0,0 +1,59 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const alertVariants = cva(
+ "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
+ {
+ variants: {
+ variant: {
+ default: "bg-background text-foreground",
+ destructive:
+ "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+const Alert = React.forwardRef<
+ HTMLDivElement,
+ React.HTMLAttributes & VariantProps
+>(({ className, variant, ...props }, ref) => (
+
+))
+Alert.displayName = "Alert"
+
+const AlertTitle = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+AlertTitle.displayName = "AlertTitle"
+
+const AlertDescription = React.forwardRef<
+ HTMLParagraphElement,
+ React.HTMLAttributes
+>(({ className, ...props }, ref) => (
+
+))
+AlertDescription.displayName = "AlertDescription"
+
+export { Alert, AlertTitle, AlertDescription }
diff --git a/project/frontend/src/components/ui/aspect-ratio.tsx b/project/frontend/src/components/ui/aspect-ratio.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..c4abbf37f217c715a0eaade7f45ac78600df419f
--- /dev/null
+++ b/project/frontend/src/components/ui/aspect-ratio.tsx
@@ -0,0 +1,5 @@
+import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
+
+const AspectRatio = AspectRatioPrimitive.Root
+
+export { AspectRatio }
diff --git a/project/frontend/src/components/ui/avatar.tsx b/project/frontend/src/components/ui/avatar.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..991f56ecb117e96284bf0f6cad3b14ea2fdf5264
--- /dev/null
+++ b/project/frontend/src/components/ui/avatar.tsx
@@ -0,0 +1,48 @@
+import * as React from "react"
+import * as AvatarPrimitive from "@radix-ui/react-avatar"
+
+import { cn } from "@/lib/utils"
+
+const Avatar = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+Avatar.displayName = AvatarPrimitive.Root.displayName
+
+const AvatarImage = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AvatarImage.displayName = AvatarPrimitive.Image.displayName
+
+const AvatarFallback = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(({ className, ...props }, ref) => (
+
+))
+AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
+
+export { Avatar, AvatarImage, AvatarFallback }
diff --git a/project/frontend/src/components/ui/badge.tsx b/project/frontend/src/components/ui/badge.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..e87d62bf1a2b2a0e1cf0b0dc94c2836525f40b67
--- /dev/null
+++ b/project/frontend/src/components/ui/badge.tsx
@@ -0,0 +1,36 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const badgeVariants = cva(
+ "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
+ {
+ variants: {
+ variant: {
+ default:
+ "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
+ secondary:
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ destructive:
+ "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
+ outline: "text-foreground",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+export interface BadgeProps
+ extends React.HTMLAttributes,
+ VariantProps {}
+
+function Badge({ className, variant, ...props }: BadgeProps) {
+ return (
+
+ )
+}
+
+export { Badge, badgeVariants }
diff --git a/project/frontend/src/components/ui/breadcrumb.tsx b/project/frontend/src/components/ui/breadcrumb.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..60e6c96f72f0350d08b47e4730cab8f3975dc853
--- /dev/null
+++ b/project/frontend/src/components/ui/breadcrumb.tsx
@@ -0,0 +1,115 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { ChevronRight, MoreHorizontal } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+
+const Breadcrumb = React.forwardRef<
+ HTMLElement,
+ React.ComponentPropsWithoutRef<"nav"> & {
+ separator?: React.ReactNode
+ }
+>(({ ...props }, ref) => )
+Breadcrumb.displayName = "Breadcrumb"
+
+const BreadcrumbList = React.forwardRef<
+ HTMLOListElement,
+ React.ComponentPropsWithoutRef<"ol">
+>(({ className, ...props }, ref) => (
+
+))
+BreadcrumbList.displayName = "BreadcrumbList"
+
+const BreadcrumbItem = React.forwardRef<
+ HTMLLIElement,
+ React.ComponentPropsWithoutRef<"li">
+>(({ className, ...props }, ref) => (
+
+))
+BreadcrumbItem.displayName = "BreadcrumbItem"
+
+const BreadcrumbLink = React.forwardRef<
+ HTMLAnchorElement,
+ React.ComponentPropsWithoutRef<"a"> & {
+ asChild?: boolean
+ }
+>(({ asChild, className, ...props }, ref) => {
+ const Comp = asChild ? Slot : "a"
+
+ return (
+
+ )
+})
+BreadcrumbLink.displayName = "BreadcrumbLink"
+
+const BreadcrumbPage = React.forwardRef<
+ HTMLSpanElement,
+ React.ComponentPropsWithoutRef<"span">
+>(({ className, ...props }, ref) => (
+
+))
+BreadcrumbPage.displayName = "BreadcrumbPage"
+
+const BreadcrumbSeparator = ({
+ children,
+ className,
+ ...props
+}: React.ComponentProps<"li">) => (
+ svg]:w-3.5 [&>svg]:h-3.5", className)}
+ {...props}
+ >
+ {children ?? }
+
+)
+BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
+
+const BreadcrumbEllipsis = ({
+ className,
+ ...props
+}: React.ComponentProps<"span">) => (
+
+
+ More
+
+)
+BreadcrumbEllipsis.displayName = "BreadcrumbElipssis"
+
+export {
+ Breadcrumb,
+ BreadcrumbList,
+ BreadcrumbItem,
+ BreadcrumbLink,
+ BreadcrumbPage,
+ BreadcrumbSeparator,
+ BreadcrumbEllipsis,
+}
diff --git a/project/frontend/src/components/ui/button.tsx b/project/frontend/src/components/ui/button.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..65d4fcd9ca74240125c5f72cf84c873781141fea
--- /dev/null
+++ b/project/frontend/src/components/ui/button.tsx
@@ -0,0 +1,57 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/lib/utils"
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ {
+ variants: {
+ variant: {
+ default:
+ "bg-primary text-primary-foreground shadow hover:bg-primary/90",
+ destructive:
+ "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
+ outline:
+ "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
+ secondary:
+ "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default: "h-9 px-4 py-2",
+ sm: "h-8 rounded-md px-3 text-xs",
+ lg: "h-10 rounded-md px-8",
+ icon: "h-9 w-9",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+export interface ButtonProps
+ extends React.ButtonHTMLAttributes,
+ VariantProps {
+ asChild?: boolean
+}
+
+const Button = React.forwardRef(
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button"
+ return (
+
+ )
+ }
+)
+Button.displayName = "Button"
+
+export { Button, buttonVariants }
diff --git a/project/frontend/src/components/ui/calendar.tsx b/project/frontend/src/components/ui/calendar.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..665b02995a6f9bb0abff2eb9bc9f8a0b5c4f1fc7
--- /dev/null
+++ b/project/frontend/src/components/ui/calendar.tsx
@@ -0,0 +1,211 @@
+import * as React from "react"
+import {
+ ChevronDownIcon,
+ ChevronLeftIcon,
+ ChevronRightIcon,
+} from "lucide-react"
+import { DayButton, DayPicker, getDefaultClassNames } from "react-day-picker"
+
+import { cn } from "@/lib/utils"
+import { Button, buttonVariants } from "@/components/ui/button"
+
+function Calendar({
+ className,
+ classNames,
+ showOutsideDays = true,
+ captionLayout = "label",
+ buttonVariant = "ghost",
+ formatters,
+ components,
+ ...props
+}: React.ComponentProps & {
+ buttonVariant?: React.ComponentProps["variant"]
+}) {
+ const defaultClassNames = getDefaultClassNames()
+
+ return (
+ svg]:rotate-180`,
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
+ className
+ )}
+ captionLayout={captionLayout}
+ formatters={{
+ formatMonthDropdown: (date) =>
+ date.toLocaleString("default", { month: "short" }),
+ ...formatters,
+ }}
+ classNames={{
+ root: cn("w-fit", defaultClassNames.root),
+ months: cn(
+ "relative flex flex-col gap-4 md:flex-row",
+ defaultClassNames.months
+ ),
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
+ nav: cn(
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
+ defaultClassNames.nav
+ ),
+ button_previous: cn(
+ buttonVariants({ variant: buttonVariant }),
+ "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
+ defaultClassNames.button_previous
+ ),
+ button_next: cn(
+ buttonVariants({ variant: buttonVariant }),
+ "h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",
+ defaultClassNames.button_next
+ ),
+ month_caption: cn(
+ "flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",
+ defaultClassNames.month_caption
+ ),
+ dropdowns: cn(
+ "flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",
+ defaultClassNames.dropdowns
+ ),
+ dropdown_root: cn(
+ "has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
+ defaultClassNames.dropdown_root
+ ),
+ dropdown: cn(
+ "bg-popover absolute inset-0 opacity-0",
+ defaultClassNames.dropdown
+ ),
+ caption_label: cn(
+ "select-none font-medium",
+ captionLayout === "label"
+ ? "text-sm"
+ : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",
+ defaultClassNames.caption_label
+ ),
+ table: "w-full border-collapse",
+ weekdays: cn("flex", defaultClassNames.weekdays),
+ weekday: cn(
+ "text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
+ defaultClassNames.weekday
+ ),
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
+ week_number_header: cn(
+ "w-[--cell-size] select-none",
+ defaultClassNames.week_number_header
+ ),
+ week_number: cn(
+ "text-muted-foreground select-none text-[0.8rem]",
+ defaultClassNames.week_number
+ ),
+ day: cn(
+ "group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",
+ defaultClassNames.day
+ ),
+ range_start: cn(
+ "bg-accent rounded-l-md",
+ defaultClassNames.range_start
+ ),
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
+ range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
+ today: cn(
+ "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
+ defaultClassNames.today
+ ),
+ outside: cn(
+ "text-muted-foreground aria-selected:text-muted-foreground",
+ defaultClassNames.outside
+ ),
+ disabled: cn(
+ "text-muted-foreground opacity-50",
+ defaultClassNames.disabled
+ ),
+ hidden: cn("invisible", defaultClassNames.hidden),
+ ...classNames,
+ }}
+ components={{
+ Root: ({ className, rootRef, ...props }) => {
+ return (
+
+ )
+ },
+ Chevron: ({ className, orientation, ...props }) => {
+ if (orientation === "left") {
+ return (
+
+ )
+ }
+
+ if (orientation === "right") {
+ return (
+
+ )
+ }
+
+ return (
+
+ )
+ },
+ DayButton: CalendarDayButton,
+ WeekNumber: ({ children, ...props }) => {
+ return (
+
+
+ {children}
+
+ |
+ )
+ },
+ ...components,
+ }}
+ {...props}
+ />
+ )
+}
+
+function CalendarDayButton({
+ className,
+ day,
+ modifiers,
+ ...props
+}: React.ComponentProps) {
+ const defaultClassNames = getDefaultClassNames()
+
+ const ref = React.useRef(null)
+ React.useEffect(() => {
+ if (modifiers.focused) ref.current?.focus()
+ }, [modifiers.focused])
+
+ return (
+