@microcosmmoney/portal-react 3.12.7 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (399) hide show
  1. package/dist/components/mcd/mcd-page.js +3 -5
  2. package/dist/components/wallet/wallet-page.js +1 -1
  3. package/dist/index.d.ts +22 -0
  4. package/dist/index.js +48 -1
  5. package/dist/main-portal/components/auctions/AuctionsPage.d.ts +1 -0
  6. package/dist/main-portal/components/auctions/AuctionsPage.js +218 -0
  7. package/dist/main-portal/components/data/asset-stats.d.ts +1 -0
  8. package/dist/main-portal/components/data/asset-stats.js +33 -0
  9. package/dist/main-portal/components/data/charts/MCCSupplyChart.d.ts +7 -0
  10. package/dist/main-portal/components/data/charts/MCCSupplyChart.js +27 -0
  11. package/dist/main-portal/components/data/charts/MiningTrendChart.d.ts +7 -0
  12. package/dist/main-portal/components/data/charts/MiningTrendChart.js +39 -0
  13. package/dist/main-portal/components/data/charts/PriceChart.d.ts +5 -0
  14. package/dist/main-portal/components/data/charts/PriceChart.js +99 -0
  15. package/dist/main-portal/components/data/charts/TeamWalletChart.d.ts +7 -0
  16. package/dist/main-portal/components/data/charts/TeamWalletChart.js +33 -0
  17. package/dist/main-portal/components/data/charts/TerritoryProgressChart.d.ts +7 -0
  18. package/dist/main-portal/components/data/charts/TerritoryProgressChart.js +35 -0
  19. package/dist/main-portal/components/data/charts/UserLevelPieChart.d.ts +7 -0
  20. package/dist/main-portal/components/data/charts/UserLevelPieChart.js +34 -0
  21. package/dist/main-portal/components/data/charts/index.d.ts +5 -0
  22. package/dist/main-portal/components/data/charts/index.js +14 -0
  23. package/dist/main-portal/components/data/data-hero.d.ts +1 -0
  24. package/dist/main-portal/components/data/data-hero.js +81 -0
  25. package/dist/main-portal/components/data/mining-history-stats.d.ts +1 -0
  26. package/dist/main-portal/components/data/mining-history-stats.js +44 -0
  27. package/dist/main-portal/components/data/team-wallet-stats.d.ts +1 -0
  28. package/dist/main-portal/components/data/team-wallet-stats.js +34 -0
  29. package/dist/main-portal/components/data/territory-stats.d.ts +1 -0
  30. package/dist/main-portal/components/data/territory-stats.js +48 -0
  31. package/dist/main-portal/components/data/user-level-stats.d.ts +1 -0
  32. package/dist/main-portal/components/data/user-level-stats.js +36 -0
  33. package/dist/main-portal/components/fragment/FragmentPage.d.ts +1 -0
  34. package/dist/main-portal/components/fragment/FragmentPage.js +13 -0
  35. package/dist/main-portal/components/income/ManagerIncomePage.d.ts +1 -0
  36. package/dist/main-portal/components/income/ManagerIncomePage.js +147 -0
  37. package/dist/main-portal/components/layout/AppSidebar.d.ts +3 -0
  38. package/dist/main-portal/components/layout/AppSidebar.js +88 -0
  39. package/dist/main-portal/components/layout/DashboardHeader.d.ts +1 -0
  40. package/dist/main-portal/components/layout/DashboardHeader.js +121 -0
  41. package/dist/main-portal/components/layout/LocaleSwitcher.d.ts +1 -0
  42. package/dist/main-portal/components/layout/LocaleSwitcher.js +30 -0
  43. package/dist/main-portal/components/layout/MainFooter.d.ts +2 -0
  44. package/dist/main-portal/components/layout/MainFooter.js +50 -0
  45. package/dist/main-portal/components/layout/ShadcnNavbar.d.ts +1 -0
  46. package/dist/main-portal/components/layout/ShadcnNavbar.js +155 -0
  47. package/dist/main-portal/components/layout/TerminalSidebar.d.ts +1 -0
  48. package/dist/main-portal/components/layout/TerminalSidebar.js +110 -0
  49. package/dist/main-portal/components/lending/LendingPage.d.ts +1 -0
  50. package/dist/main-portal/components/lending/LendingPage.js +20 -0
  51. package/dist/main-portal/components/mcd/MCDPage.d.ts +1 -0
  52. package/dist/main-portal/components/mcd/MCDPage.js +125 -0
  53. package/dist/main-portal/components/messages/MessagesPage.d.ts +1 -0
  54. package/dist/main-portal/components/messages/MessagesPage.js +13 -0
  55. package/dist/main-portal/components/mining/MiningDistributionHistory.d.ts +11 -0
  56. package/dist/main-portal/components/mining/MiningDistributionHistory.js +84 -0
  57. package/dist/main-portal/components/mining/MiningModal.d.ts +12 -0
  58. package/dist/main-portal/components/mining/MiningModal.js +302 -0
  59. package/dist/main-portal/components/mining/MiningPage.d.ts +1 -0
  60. package/dist/main-portal/components/mining/MiningPage.js +237 -0
  61. package/dist/main-portal/components/mining/index.d.ts +1 -0
  62. package/dist/main-portal/components/mining/index.js +6 -0
  63. package/dist/main-portal/components/notifications/NotificationsPage.d.ts +1 -0
  64. package/dist/main-portal/components/notifications/NotificationsPage.js +13 -0
  65. package/dist/main-portal/components/organization/OrganizationPage.d.ts +1 -0
  66. package/dist/main-portal/components/organization/OrganizationPage.js +235 -0
  67. package/dist/main-portal/components/organization/connection-line.d.ts +12 -0
  68. package/dist/main-portal/components/organization/connection-line.js +38 -0
  69. package/dist/main-portal/components/organization/diagram-node.d.ts +17 -0
  70. package/dist/main-portal/components/organization/diagram-node.js +105 -0
  71. package/dist/main-portal/components/organization/system-panel.d.ts +11 -0
  72. package/dist/main-portal/components/organization/system-panel.js +72 -0
  73. package/dist/main-portal/components/profile/EmailChangeCard.d.ts +1 -0
  74. package/dist/main-portal/components/profile/EmailChangeCard.js +58 -0
  75. package/dist/main-portal/components/profile/ProfilePage.d.ts +1 -0
  76. package/dist/main-portal/components/profile/ProfilePage.js +263 -0
  77. package/dist/main-portal/components/profile/TwoFactorSettings.d.ts +1 -0
  78. package/dist/main-portal/components/profile/TwoFactorSettings.js +99 -0
  79. package/dist/main-portal/components/providers/ClientProviders.d.ts +6 -0
  80. package/dist/main-portal/components/providers/ClientProviders.js +17 -0
  81. package/dist/main-portal/components/providers/SolanaWalletProvider.d.ts +7 -0
  82. package/dist/main-portal/components/providers/SolanaWalletProvider.js +17 -0
  83. package/dist/main-portal/components/providers/theme-provider.d.ts +5 -0
  84. package/dist/main-portal/components/providers/theme-provider.js +10 -0
  85. package/dist/main-portal/components/queue/QueueStatusPage.d.ts +1 -0
  86. package/dist/main-portal/components/queue/QueueStatusPage.js +245 -0
  87. package/dist/main-portal/components/reincarnation/ReincarnationPage.d.ts +1 -0
  88. package/dist/main-portal/components/reincarnation/ReincarnationPage.js +87 -0
  89. package/dist/main-portal/components/resources/mcc-stats-section.d.ts +1 -0
  90. package/dist/main-portal/components/resources/mcc-stats-section.js +199 -0
  91. package/dist/main-portal/components/resources/mcd-stats-section.d.ts +1 -0
  92. package/dist/main-portal/components/resources/mcd-stats-section.js +76 -0
  93. package/dist/main-portal/components/resources/minting-entry-section.d.ts +1 -0
  94. package/dist/main-portal/components/resources/minting-entry-section.js +70 -0
  95. package/dist/main-portal/components/resources/public-mining-modal.d.ts +7 -0
  96. package/dist/main-portal/components/resources/public-mining-modal.js +239 -0
  97. package/dist/main-portal/components/resources/recycle-pool-section.d.ts +1 -0
  98. package/dist/main-portal/components/resources/recycle-pool-section.js +82 -0
  99. package/dist/main-portal/components/resources/registration-prompt.d.ts +8 -0
  100. package/dist/main-portal/components/resources/registration-prompt.js +13 -0
  101. package/dist/main-portal/components/rewards/RewardsPage.d.ts +1 -0
  102. package/dist/main-portal/components/rewards/RewardsPage.js +149 -0
  103. package/dist/main-portal/components/security/domain-verification-bar.d.ts +1 -0
  104. package/dist/main-portal/components/security/domain-verification-bar.js +32 -0
  105. package/dist/main-portal/components/stations/StationDetailPage.d.ts +5 -0
  106. package/dist/main-portal/components/stations/StationDetailPage.js +232 -0
  107. package/dist/main-portal/components/stations/StationIncomeChart.d.ts +11 -0
  108. package/dist/main-portal/components/stations/StationIncomeChart.js +57 -0
  109. package/dist/main-portal/components/stations/StationKPIHistory.d.ts +1 -0
  110. package/dist/main-portal/components/stations/StationKPIHistory.js +7 -0
  111. package/dist/main-portal/components/stations/StationListPage.d.ts +1 -0
  112. package/dist/main-portal/components/stations/StationListPage.js +341 -0
  113. package/dist/main-portal/components/stations/StationMemberRanking.d.ts +13 -0
  114. package/dist/main-portal/components/stations/StationMemberRanking.js +64 -0
  115. package/dist/main-portal/components/stations/StationSummaryCards.d.ts +13 -0
  116. package/dist/main-portal/components/stations/StationSummaryCards.js +30 -0
  117. package/dist/main-portal/components/stations/StationsPage.d.ts +1 -0
  118. package/dist/main-portal/components/stations/StationsPage.js +239 -0
  119. package/dist/main-portal/components/territory/TerritoryNFTBrowser.d.ts +1 -0
  120. package/dist/main-portal/components/territory/TerritoryNFTBrowser.js +147 -0
  121. package/dist/main-portal/components/ui/accordion.d.ts +7 -0
  122. package/dist/main-portal/components/ui/accordion.js +57 -0
  123. package/dist/main-portal/components/ui/alert-dialog.d.ts +14 -0
  124. package/dist/main-portal/components/ui/alert-dialog.js +85 -0
  125. package/dist/main-portal/components/ui/alert.d.ts +9 -0
  126. package/dist/main-portal/components/ui/alert.js +28 -0
  127. package/dist/main-portal/components/ui/aspect-ratio.d.ts +3 -0
  128. package/dist/main-portal/components/ui/aspect-ratio.js +43 -0
  129. package/dist/main-portal/components/ui/avatar.d.ts +6 -0
  130. package/dist/main-portal/components/ui/avatar.js +52 -0
  131. package/dist/main-portal/components/ui/badge.d.ts +9 -0
  132. package/dist/main-portal/components/ui/badge.js +26 -0
  133. package/dist/main-portal/components/ui/breadcrumb.d.ts +11 -0
  134. package/dist/main-portal/components/ui/breadcrumb.js +35 -0
  135. package/dist/main-portal/components/ui/button-group.d.ts +11 -0
  136. package/dist/main-portal/components/ui/button-group.js +34 -0
  137. package/dist/main-portal/components/ui/button.d.ts +10 -0
  138. package/dist/main-portal/components/ui/button.js +35 -0
  139. package/dist/main-portal/components/ui/calendar.d.ts +8 -0
  140. package/dist/main-portal/components/ui/calendar.js +111 -0
  141. package/dist/main-portal/components/ui/card.d.ts +17 -0
  142. package/dist/main-portal/components/ui/card.js +41 -0
  143. package/dist/main-portal/components/ui/carousel.d.ts +19 -0
  144. package/dist/main-portal/components/ui/carousel.js +134 -0
  145. package/dist/main-portal/components/ui/chart.d.ts +40 -0
  146. package/dist/main-portal/components/ui/chart.js +168 -0
  147. package/dist/main-portal/components/ui/checkbox.d.ts +4 -0
  148. package/dist/main-portal/components/ui/checkbox.js +45 -0
  149. package/dist/main-portal/components/ui/collapsible.d.ts +5 -0
  150. package/dist/main-portal/components/ui/collapsible.js +51 -0
  151. package/dist/main-portal/components/ui/command.d.ts +18 -0
  152. package/dist/main-portal/components/ui/command.js +45 -0
  153. package/dist/main-portal/components/ui/context-menu.d.ts +25 -0
  154. package/dist/main-portal/components/ui/context-menu.js +101 -0
  155. package/dist/main-portal/components/ui/dialog.d.ts +15 -0
  156. package/dist/main-portal/components/ui/dialog.js +81 -0
  157. package/dist/main-portal/components/ui/drawer.d.ts +13 -0
  158. package/dist/main-portal/components/ui/drawer.js +47 -0
  159. package/dist/main-portal/components/ui/dropdown-menu.d.ts +25 -0
  160. package/dist/main-portal/components/ui/dropdown-menu.js +101 -0
  161. package/dist/main-portal/components/ui/empty.d.ts +11 -0
  162. package/dist/main-portal/components/ui/empty.js +41 -0
  163. package/dist/main-portal/components/ui/field.d.ts +24 -0
  164. package/dist/main-portal/components/ui/field.js +85 -0
  165. package/dist/main-portal/components/ui/form.d.ts +24 -0
  166. package/dist/main-portal/components/ui/form.js +103 -0
  167. package/dist/main-portal/components/ui/hover-avatar.d.ts +10 -0
  168. package/dist/main-portal/components/ui/hover-avatar.js +70 -0
  169. package/dist/main-portal/components/ui/hover-card.d.ts +6 -0
  170. package/dist/main-portal/components/ui/hover-card.js +52 -0
  171. package/dist/main-portal/components/ui/input-group.d.ts +15 -0
  172. package/dist/main-portal/components/ui/input-group.js +65 -0
  173. package/dist/main-portal/components/ui/input-otp.d.ts +11 -0
  174. package/dist/main-portal/components/ui/input-otp.js +60 -0
  175. package/dist/main-portal/components/ui/input.d.ts +3 -0
  176. package/dist/main-portal/components/ui/input.js +8 -0
  177. package/dist/main-portal/components/ui/item.d.ts +23 -0
  178. package/dist/main-portal/components/ui/item.js +77 -0
  179. package/dist/main-portal/components/ui/kbd.d.ts +3 -0
  180. package/dist/main-portal/components/ui/kbd.js +13 -0
  181. package/dist/main-portal/components/ui/label.d.ts +4 -0
  182. package/dist/main-portal/components/ui/label.js +44 -0
  183. package/dist/main-portal/components/ui/menubar.d.ts +26 -0
  184. package/dist/main-portal/components/ui/menubar.js +105 -0
  185. package/dist/main-portal/components/ui/navigation-menu.d.ts +14 -0
  186. package/dist/main-portal/components/ui/navigation-menu.js +75 -0
  187. package/dist/main-portal/components/ui/pagination.d.ts +13 -0
  188. package/dist/main-portal/components/ui/pagination.js +37 -0
  189. package/dist/main-portal/components/ui/popover.d.ts +7 -0
  190. package/dist/main-portal/components/ui/popover.js +56 -0
  191. package/dist/main-portal/components/ui/progress.d.ts +4 -0
  192. package/dist/main-portal/components/ui/progress.js +44 -0
  193. package/dist/main-portal/components/ui/radio-group.d.ts +5 -0
  194. package/dist/main-portal/components/ui/radio-group.js +49 -0
  195. package/dist/main-portal/components/ui/resizable.d.ts +8 -0
  196. package/dist/main-portal/components/ui/resizable.js +53 -0
  197. package/dist/main-portal/components/ui/scroll-area.d.ts +5 -0
  198. package/dist/main-portal/components/ui/scroll-area.js +50 -0
  199. package/dist/main-portal/components/ui/select.d.ts +15 -0
  200. package/dist/main-portal/components/ui/select.js +83 -0
  201. package/dist/main-portal/components/ui/separator.d.ts +4 -0
  202. package/dist/main-portal/components/ui/separator.js +44 -0
  203. package/dist/main-portal/components/ui/sheet.d.ts +13 -0
  204. package/dist/main-portal/components/ui/sheet.js +83 -0
  205. package/dist/main-portal/components/ui/sidebar.d.ts +69 -0
  206. package/dist/main-portal/components/ui/sidebar.js +258 -0
  207. package/dist/main-portal/components/ui/skeleton.d.ts +2 -0
  208. package/dist/main-portal/components/ui/skeleton.js +9 -0
  209. package/dist/main-portal/components/ui/slider.d.ts +4 -0
  210. package/dist/main-portal/components/ui/slider.js +50 -0
  211. package/dist/main-portal/components/ui/sonner.d.ts +3 -0
  212. package/dist/main-portal/components/ui/sonner.js +17 -0
  213. package/dist/main-portal/components/ui/spinner.d.ts +2 -0
  214. package/dist/main-portal/components/ui/spinner.js +10 -0
  215. package/dist/main-portal/components/ui/switch.d.ts +4 -0
  216. package/dist/main-portal/components/ui/switch.js +44 -0
  217. package/dist/main-portal/components/ui/table.d.ts +10 -0
  218. package/dist/main-portal/components/ui/table.js +38 -0
  219. package/dist/main-portal/components/ui/tabs.d.ts +7 -0
  220. package/dist/main-portal/components/ui/tabs.js +53 -0
  221. package/dist/main-portal/components/ui/terminal.d.ts +49 -0
  222. package/dist/main-portal/components/ui/terminal.js +56 -0
  223. package/dist/main-portal/components/ui/textarea.d.ts +3 -0
  224. package/dist/main-portal/components/ui/textarea.js +8 -0
  225. package/dist/main-portal/components/ui/time-remaining.d.ts +54 -0
  226. package/dist/main-portal/components/ui/time-remaining.js +223 -0
  227. package/dist/main-portal/components/ui/toast.d.ts +15 -0
  228. package/dist/main-portal/components/ui/toast.js +77 -0
  229. package/dist/main-portal/components/ui/toaster.d.ts +1 -0
  230. package/dist/main-portal/components/ui/toaster.js +14 -0
  231. package/dist/main-portal/components/ui/toggle-group.d.ts +7 -0
  232. package/dist/main-portal/components/ui/toggle-group.js +58 -0
  233. package/dist/main-portal/components/ui/toggle.d.ts +9 -0
  234. package/dist/main-portal/components/ui/toggle.js +64 -0
  235. package/dist/main-portal/components/ui/tooltip.d.ts +7 -0
  236. package/dist/main-portal/components/ui/tooltip.js +56 -0
  237. package/dist/main-portal/components/ui/use-mobile.d.ts +1 -0
  238. package/dist/main-portal/components/ui/use-mobile.js +53 -0
  239. package/dist/main-portal/components/voting/VotingPage.d.ts +1 -0
  240. package/dist/main-portal/components/voting/VotingPage.js +14 -0
  241. package/dist/main-portal/components/wallet/MCCHistory.d.ts +9 -0
  242. package/dist/main-portal/components/wallet/MCCHistory.js +100 -0
  243. package/dist/main-portal/components/wallet/WalletManagement.d.ts +5 -0
  244. package/dist/main-portal/components/wallet/WalletManagement.js +144 -0
  245. package/dist/main-portal/components/wallet/WalletPage.d.ts +1 -0
  246. package/dist/main-portal/components/wallet/WalletPage.js +130 -0
  247. package/dist/main-portal/config/menu-config.d.ts +22 -0
  248. package/dist/main-portal/config/menu-config.js +167 -0
  249. package/dist/main-portal/contexts/MCCPriceContext.d.ts +38 -0
  250. package/dist/main-portal/contexts/MCCPriceContext.js +70 -0
  251. package/dist/main-portal/contexts/WalletContext.d.ts +48 -0
  252. package/dist/main-portal/contexts/WalletContext.js +94 -0
  253. package/dist/main-portal/hooks/index.d.ts +4 -0
  254. package/dist/main-portal/hooks/index.js +11 -0
  255. package/dist/main-portal/hooks/use-breakpoint.d.ts +45 -0
  256. package/dist/main-portal/hooks/use-breakpoint.js +91 -0
  257. package/dist/main-portal/hooks/use-mobile.d.ts +1 -0
  258. package/dist/main-portal/hooks/use-mobile.js +55 -0
  259. package/dist/main-portal/hooks/use-toast.d.ts +44 -0
  260. package/dist/main-portal/hooks/use-toast.js +164 -0
  261. package/dist/main-portal/hooks/useAuth.d.ts +30 -0
  262. package/dist/main-portal/hooks/useAuth.js +135 -0
  263. package/dist/main-portal/hooks/useMCC.d.ts +26 -0
  264. package/dist/main-portal/hooks/useMCC.js +148 -0
  265. package/dist/main-portal/hooks/useMCD.d.ts +17 -0
  266. package/dist/main-portal/hooks/useMCD.js +114 -0
  267. package/dist/main-portal/hooks/useMarketData.d.ts +9 -0
  268. package/dist/main-portal/hooks/useMarketData.js +32 -0
  269. package/dist/main-portal/hooks/useMultiWalletBalance.d.ts +31 -0
  270. package/dist/main-portal/hooks/useMultiWalletBalance.js +65 -0
  271. package/dist/main-portal/hooks/usePriceHistory.d.ts +9 -0
  272. package/dist/main-portal/hooks/usePriceHistory.js +36 -0
  273. package/dist/main-portal/hooks/useSolanaBalance.d.ts +21 -0
  274. package/dist/main-portal/hooks/useSolanaBalance.js +58 -0
  275. package/dist/main-portal/hooks/useSpeechRecognition.d.ts +6 -0
  276. package/dist/main-portal/hooks/useSpeechRecognition.js +82 -0
  277. package/dist/main-portal/hooks/useStats.d.ts +131 -0
  278. package/dist/main-portal/hooks/useStats.js +161 -0
  279. package/dist/main-portal/hooks/useStrategies.d.ts +134 -0
  280. package/dist/main-portal/hooks/useStrategies.js +28 -0
  281. package/dist/main-portal/hooks/useUserRank.d.ts +16 -0
  282. package/dist/main-portal/hooks/useUserRank.js +61 -0
  283. package/dist/main-portal/hooks/useWalletTokenBalances.d.ts +29 -0
  284. package/dist/main-portal/hooks/useWalletTokenBalances.js +106 -0
  285. package/dist/main-portal/i18n/navigation.d.ts +341 -0
  286. package/dist/main-portal/i18n/navigation.js +7 -0
  287. package/dist/main-portal/i18n/request.d.ts +2 -0
  288. package/dist/main-portal/i18n/request.js +47 -0
  289. package/dist/main-portal/i18n/routing.d.ts +18 -0
  290. package/dist/main-portal/i18n/routing.js +10 -0
  291. package/dist/main-portal/lib/ai-chat-config.d.ts +8 -0
  292. package/dist/main-portal/lib/ai-chat-config.js +144 -0
  293. package/dist/main-portal/lib/analytics/hooks.d.ts +139 -0
  294. package/dist/main-portal/lib/analytics/hooks.js +277 -0
  295. package/dist/main-portal/lib/analytics/index.d.ts +2 -0
  296. package/dist/main-portal/lib/analytics/index.js +19 -0
  297. package/dist/main-portal/lib/analytics/types.d.ts +611 -0
  298. package/dist/main-portal/lib/analytics/types.js +2 -0
  299. package/dist/main-portal/lib/api/account.d.ts +39 -0
  300. package/dist/main-portal/lib/api/account.js +86 -0
  301. package/dist/main-portal/lib/api/admin.d.ts +78 -0
  302. package/dist/main-portal/lib/api/admin.js +195 -0
  303. package/dist/main-portal/lib/api/analytics.d.ts +217 -0
  304. package/dist/main-portal/lib/api/analytics.js +55 -0
  305. package/dist/main-portal/lib/api/blockchain.d.ts +178 -0
  306. package/dist/main-portal/lib/api/blockchain.js +302 -0
  307. package/dist/main-portal/lib/api/core.d.ts +3 -0
  308. package/dist/main-portal/lib/api/core.js +47 -0
  309. package/dist/main-portal/lib/api/dexscreener.d.ts +126 -0
  310. package/dist/main-portal/lib/api/dexscreener.js +139 -0
  311. package/dist/main-portal/lib/api/geckoterminal.d.ts +10 -0
  312. package/dist/main-portal/lib/api/geckoterminal.js +43 -0
  313. package/dist/main-portal/lib/api/index.d.ts +16 -0
  314. package/dist/main-portal/lib/api/index.js +230 -0
  315. package/dist/main-portal/lib/api/mcc-holders.d.ts +130 -0
  316. package/dist/main-portal/lib/api/mcc-holders.js +47 -0
  317. package/dist/main-portal/lib/api/org-service-proxy.d.ts +7 -0
  318. package/dist/main-portal/lib/api/org-service-proxy.js +55 -0
  319. package/dist/main-portal/lib/api/services/ai.d.ts +139 -0
  320. package/dist/main-portal/lib/api/services/ai.js +214 -0
  321. package/dist/main-portal/lib/api/services/finance.d.ts +37 -0
  322. package/dist/main-portal/lib/api/services/finance.js +144 -0
  323. package/dist/main-portal/lib/api/services/index.d.ts +5 -0
  324. package/dist/main-portal/lib/api/services/index.js +21 -0
  325. package/dist/main-portal/lib/api/services/mining.d.ts +68 -0
  326. package/dist/main-portal/lib/api/services/mining.js +76 -0
  327. package/dist/main-portal/lib/api/services/organization.d.ts +161 -0
  328. package/dist/main-portal/lib/api/services/organization.js +139 -0
  329. package/dist/main-portal/lib/api/services/user.d.ts +90 -0
  330. package/dist/main-portal/lib/api/services/user.js +78 -0
  331. package/dist/main-portal/lib/api/services.d.ts +1 -0
  332. package/dist/main-portal/lib/api/services.js +17 -0
  333. package/dist/main-portal/lib/api/strategies.d.ts +101 -0
  334. package/dist/main-portal/lib/api/strategies.js +87 -0
  335. package/dist/main-portal/lib/api-service.d.ts +1 -0
  336. package/dist/main-portal/lib/api-service.js +18 -0
  337. package/dist/main-portal/lib/auth-service.d.ts +65 -0
  338. package/dist/main-portal/lib/auth-service.js +382 -0
  339. package/dist/main-portal/lib/config/mainstream-tokens.d.ts +13 -0
  340. package/dist/main-portal/lib/config/mainstream-tokens.js +88 -0
  341. package/dist/main-portal/lib/docs-data.d.ts +36 -0
  342. package/dist/main-portal/lib/docs-data.js +108 -0
  343. package/dist/main-portal/lib/exchanges/config.d.ts +34 -0
  344. package/dist/main-portal/lib/exchanges/config.js +185 -0
  345. package/dist/main-portal/lib/exchanges/hooks/index.d.ts +5 -0
  346. package/dist/main-portal/lib/exchanges/hooks/index.js +10 -0
  347. package/dist/main-portal/lib/exchanges/hooks/useBinanceData.d.ts +15 -0
  348. package/dist/main-portal/lib/exchanges/hooks/useBinanceData.js +216 -0
  349. package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.d.ts +32 -0
  350. package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.js +395 -0
  351. package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.d.ts +15 -0
  352. package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.js +51 -0
  353. package/dist/main-portal/lib/exchanges/index.d.ts +4 -0
  354. package/dist/main-portal/lib/exchanges/index.js +21 -0
  355. package/dist/main-portal/lib/exchanges/types.d.ts +102 -0
  356. package/dist/main-portal/lib/exchanges/types.js +2 -0
  357. package/dist/main-portal/lib/exchanges/utils.d.ts +1 -0
  358. package/dist/main-portal/lib/exchanges/utils.js +10 -0
  359. package/dist/main-portal/lib/gcp-secrets.d.ts +7 -0
  360. package/dist/main-portal/lib/gcp-secrets.js +45 -0
  361. package/dist/main-portal/lib/mockWallet.d.ts +130 -0
  362. package/dist/main-portal/lib/mockWallet.js +284 -0
  363. package/dist/main-portal/lib/oauth-config.d.ts +12 -0
  364. package/dist/main-portal/lib/oauth-config.js +48 -0
  365. package/dist/main-portal/lib/order-id-generator.d.ts +19 -0
  366. package/dist/main-portal/lib/order-id-generator.js +97 -0
  367. package/dist/main-portal/lib/solana/reincarnation-client.d.ts +28 -0
  368. package/dist/main-portal/lib/solana/reincarnation-client.js +39 -0
  369. package/dist/main-portal/lib/solana/solana-pay.d.ts +31 -0
  370. package/dist/main-portal/lib/solana/solana-pay.js +85 -0
  371. package/dist/main-portal/lib/strategy/defaults.d.ts +2 -0
  372. package/dist/main-portal/lib/strategy/defaults.js +58 -0
  373. package/dist/main-portal/lib/strategy/index.d.ts +3 -0
  374. package/dist/main-portal/lib/strategy/index.js +20 -0
  375. package/dist/main-portal/lib/strategy/tooltips.d.ts +1 -0
  376. package/dist/main-portal/lib/strategy/tooltips.js +50 -0
  377. package/dist/main-portal/lib/strategy/types.d.ts +74 -0
  378. package/dist/main-portal/lib/strategy/types.js +2 -0
  379. package/dist/main-portal/lib/types/ai.types.d.ts +111 -0
  380. package/dist/main-portal/lib/types/ai.types.js +2 -0
  381. package/dist/main-portal/lib/types/api.d.ts +5 -0
  382. package/dist/main-portal/lib/types/api.js +21 -0
  383. package/dist/main-portal/lib/types/common.types.d.ts +168 -0
  384. package/dist/main-portal/lib/types/common.types.js +24 -0
  385. package/dist/main-portal/lib/types/finance.types.d.ts +267 -0
  386. package/dist/main-portal/lib/types/finance.types.js +2 -0
  387. package/dist/main-portal/lib/types/protocol.types.d.ts +216 -0
  388. package/dist/main-portal/lib/types/protocol.types.js +2 -0
  389. package/dist/main-portal/lib/types/user.types.d.ts +243 -0
  390. package/dist/main-portal/lib/types/user.types.js +12 -0
  391. package/dist/main-portal/lib/utils/territoryId.d.ts +75 -0
  392. package/dist/main-portal/lib/utils/territoryId.js +241 -0
  393. package/dist/main-portal/lib/utils.d.ts +4 -0
  394. package/dist/main-portal/lib/utils.js +24 -0
  395. package/dist/main-portal/lib/wallet-auth/api.d.ts +13 -0
  396. package/dist/main-portal/lib/wallet-auth/api.js +132 -0
  397. package/dist/main-portal/lib/wallet-auth/types.d.ts +87 -0
  398. package/dist/main-portal/lib/wallet-auth/types.js +58 -0
  399. package/package.json +55 -5
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.TerritoryStats = TerritoryStats;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const useStats_1 = require("../../hooks/useStats");
8
+ const next_intl_1 = require("next-intl");
9
+ const recharts_1 = require("recharts");
10
+ const TerritoryIcons = {
11
+ System: ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", className: "text-[#5EEAD4]", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "1.5" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "6", stroke: "currentColor", strokeWidth: "1.5" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "2", fill: "currentColor" })] })),
12
+ Sector: ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", className: "text-[#5EEAD4]", children: [(0, jsx_runtime_1.jsx)("path", { d: "M12 2L22 8.5V15.5L12 22L2 15.5V8.5L12 2Z", stroke: "currentColor", strokeWidth: "1.5" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 8L17 11V17L12 20L7 17V11L12 8Z", stroke: "currentColor", strokeWidth: "1.5" })] })),
13
+ Matrix: ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", className: "text-[#5EBCD4]", children: [(0, jsx_runtime_1.jsx)("rect", { x: "3", y: "3", width: "7", height: "7", stroke: "currentColor", strokeWidth: "1.5", rx: "1" }), (0, jsx_runtime_1.jsx)("rect", { x: "14", y: "3", width: "7", height: "7", stroke: "currentColor", strokeWidth: "1.5", rx: "1" }), (0, jsx_runtime_1.jsx)("rect", { x: "3", y: "14", width: "7", height: "7", stroke: "currentColor", strokeWidth: "1.5", rx: "1" }), (0, jsx_runtime_1.jsx)("rect", { x: "14", y: "14", width: "7", height: "7", stroke: "currentColor", strokeWidth: "1.5", rx: "1" })] })),
14
+ Station: ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", className: "text-[#5EBCD4]", children: [(0, jsx_runtime_1.jsx)("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", stroke: "currentColor", strokeWidth: "1.5" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "3", stroke: "currentColor", strokeWidth: "1.5" })] }))
15
+ };
16
+ const compactFormatter = new Intl.NumberFormat("zh-CN", {
17
+ notation: "compact",
18
+ compactDisplay: "short",
19
+ maximumFractionDigits: 2,
20
+ });
21
+ function TerritoryStats() {
22
+ const { data: stats, loading, error } = (0, useStats_1.useTerritoryStats)();
23
+ const { data: mccData } = (0, useStats_1.useMCCStats)();
24
+ const { data: mcdData } = (0, useStats_1.useMCDStats)();
25
+ const { data: growthData } = (0, useStats_1.useUserGrowth)(30);
26
+ const t = (0, next_intl_1.useTranslations)("data");
27
+ const getIcon = (type) => {
28
+ return TerritoryIcons[type] || TerritoryIcons.Station;
29
+ };
30
+ return ((0, jsx_runtime_1.jsx)("section", { className: "py-20 md:py-24 px-4 sm:px-6", "aria-labelledby": "territory-title", children: (0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto", children: [(0, jsx_runtime_1.jsxs)("header", { className: "text-center mb-12 md:mb-16", children: [(0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs sm:text-sm uppercase tracking-widest text-[#5EEAD4] mb-3 md:mb-4", children: "TERRITORY HIERARCHY" }), (0, jsx_runtime_1.jsx)("h2", { id: "territory-title", className: "font-sans font-bold text-3xl sm:text-4xl md:text-5xl text-foreground mb-4 md:mb-5 text-balance", children: t('territoryHierarchy') }), (0, jsx_runtime_1.jsxs)("div", { className: "max-w-3xl mx-auto space-y-2", children: [(0, jsx_runtime_1.jsx)("p", { className: "font-mono text-sm sm:text-base text-foreground/60 text-balance", children: t('territoryHierarchyDesc') }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs sm:text-sm text-foreground/40 text-balance", children: t('territoryHierarchySubDesc') })] })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-6", children: (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3 md:gap-4", children: [...Array(6)].map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-3 w-16 bg-muted animate-pulse rounded mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "h-7 w-24 bg-muted animate-pulse rounded mb-1" }), (0, jsx_runtime_1.jsx)("div", { className: "h-3 w-12 bg-muted animate-pulse rounded" })] }, i))) }) })) : error ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center text-red-400 py-12 font-mono text-sm", children: [t('loadFailed'), ": ", error] })) : stats ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3 md:gap-4 mb-8", role: "list", "aria-label": t('territoryHierarchy'), children: [(0, jsx_runtime_1.jsx)(StatCard, { label: t('currentUsers'), value: stats.total_users_in_territories.toLocaleString(), sub: t('onchainRegistered'), highlight: true }), (0, jsx_runtime_1.jsx)(StatCard, { label: t('inTerritory'), value: stats.territories.reduce((a, tr) => a + (tr.population ?? 0), 0).toLocaleString(), sub: t('assignedTerritory'), highlight: true }), (0, jsx_runtime_1.jsx)(StatCard, { label: t('totalMinted'), value: compactFormatter.format(mccData?.circulating_supply ?? 0), sub: "MCC", highlightColor: "blue" }), (0, jsx_runtime_1.jsx)(StatCard, { label: t('mintCount'), value: (mccData?.total_mining_count ?? 0).toLocaleString(), sub: t('onchainRecords') }), (0, jsx_runtime_1.jsx)(StatCard, { label: t('vaultBalance'), value: compactFormatter.format(mcdData?.total_vault_balance ?? 0), sub: "MCD", highlightColor: "blue" }), (0, jsx_runtime_1.jsx)(StatCard, { label: t('territoryTotal'), value: stats.territories.reduce((a, tr) => a + tr.total, 0).toString(), sub: t('activeTerritory') })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 md:gap-5 mb-8", children: stats.territories.map((territory) => ((0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-5 transition-colors duration-200 hover:bg-background/70 hover:border-border/50", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 mb-4", children: [getIcon(territory.type), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-sans font-medium text-base text-foreground", children: territory.type }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs text-foreground/40", children: territory.name })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm text-foreground/50", children: t('totalCount') }), (0, jsx_runtime_1.jsx)("span", { className: "font-sans font-bold text-xl text-foreground tabular-nums", children: territory.total })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm text-foreground/50", children: t('activeCount') }), (0, jsx_runtime_1.jsx)("span", { className: "font-sans font-bold text-xl text-[#5EEAD4] tabular-nums", children: territory.active })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm text-foreground/50", children: t('population') }), (0, jsx_runtime_1.jsx)("span", { className: "font-sans font-medium text-base text-foreground tabular-nums", children: territory.population?.toLocaleString() || 0 })] })] })] }, territory.type))) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6 mb-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4 sm:p-6 flex flex-col", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-baseline mb-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-sans font-medium text-base sm:text-lg text-foreground", children: t('userGrowthTrend') }), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm text-[#5EEAD4] font-bold tabular-nums", children: (growthData?.total_users ?? stats.total_users_in_territories).toLocaleString() })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 min-h-[260px]", children: growthData && growthData.history.length > 0 ? ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: 260, children: (0, jsx_runtime_1.jsxs)(recharts_1.AreaChart, { data: growthData.history, margin: { top: 10, right: 10, bottom: 0, left: 0 }, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: "fillGrowth", x1: "0", y1: "0", x2: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "5%", stopColor: "#5EEAD4", stopOpacity: 0.6 }), (0, jsx_runtime_1.jsx)("stop", { offset: "95%", stopColor: "#5EEAD4", stopOpacity: 0.05 })] }) }), (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { strokeDasharray: "3 3", stroke: "rgba(255,255,255,0.05)", vertical: false }), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: "date", tick: { fontSize: 10, fill: "rgba(255,255,255,0.4)" }, tickLine: false, axisLine: false, minTickGap: 24, tickFormatter: (v) => {
31
+ const d = new Date(v);
32
+ return `${d.getMonth() + 1}/${d.getDate()}`;
33
+ } }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { tick: { fontSize: 10, fill: "rgba(255,255,255,0.4)" }, tickLine: false, axisLine: false, width: 32 }), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { contentStyle: {
34
+ backgroundColor: "rgba(23,23,23,0.95)",
35
+ border: "1px solid rgba(94,234,212,0.2)",
36
+ borderRadius: "6px",
37
+ fontSize: "12px",
38
+ fontFamily: "monospace",
39
+ }, labelFormatter: (v) => `${v}`, formatter: (value) => [value.toLocaleString(), t('currentOnchainUsers')] }), (0, jsx_runtime_1.jsx)(recharts_1.Area, { type: "monotone", dataKey: "total_users", stroke: "#5EEAD4", strokeWidth: 2, fill: "url(#fillGrowth)" })] }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "h-full flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-3xl text-[#5EEAD4] font-bold tabular-nums", children: (stats.total_users_in_territories ?? 0).toLocaleString() }) })) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4 sm:p-6", children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-sans font-medium text-base sm:text-lg text-foreground mb-6", children: t('mcdEcoData') }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "border border-border/30 bg-background/30 rounded-lg p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm text-foreground/50", children: t('mcdUsage') }), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-xs text-foreground/30", children: t('userToWhitelist') })] }), (0, jsx_runtime_1.jsx)("p", { className: "font-sans font-bold text-2xl text-[#5EBCD4] tabular-nums", children: compactFormatter.format(mcdData?.total_spent ?? 0) }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs text-foreground/40 mt-1", children: t('spentToDeveloper') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "border border-border/30 bg-background/30 rounded-lg p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm text-foreground/50", children: t('mcdAllocation') }), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-xs text-foreground/30", children: t('vaultToUser') })] }), (0, jsx_runtime_1.jsx)("p", { className: "font-sans font-bold text-2xl text-[#5EEAD4] tabular-nums", children: compactFormatter.format(mcdData?.user_balance ?? 0) }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs text-foreground/40 mt-1", children: t('dailyAutoAllocation') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "border border-border/30 bg-background/30 rounded-lg p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm text-foreground/50", children: t('vaultMcdBalance') }), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-xs text-foreground/30", children: t('allStationVaults') })] }), (0, jsx_runtime_1.jsx)("p", { className: "font-sans font-bold text-2xl text-foreground tabular-nums", children: compactFormatter.format(mcdData?.total_vault_balance ?? 0) }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs text-foreground/40 mt-1", children: t('companionYieldInjection') })] })] })] })] })] })) : null] }) }));
40
+ }
41
+ function StatCard({ label, value, sub, highlight = false, highlightColor, }) {
42
+ const colorClass = highlightColor === "blue"
43
+ ? "text-[#5EBCD4]"
44
+ : highlight
45
+ ? "text-[#5EEAD4]"
46
+ : "text-foreground";
47
+ return ((0, jsx_runtime_1.jsxs)("div", { role: "listitem", className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4 transition-colors duration-200 hover:bg-background/70 hover:border-border/50", children: [(0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs sm:text-sm uppercase tracking-widest text-foreground/50 mb-1", children: label }), (0, jsx_runtime_1.jsx)("p", { className: `font-sans font-bold text-2xl sm:text-3xl tabular-nums ${colorClass}`, children: value }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs sm:text-sm text-foreground/40 mt-0.5 tabular-nums", children: sub })] }));
48
+ }
@@ -0,0 +1 @@
1
+ export declare function UserLevelStats(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.UserLevelStats = UserLevelStats;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const useStats_1 = require("../../hooks/useStats");
8
+ const charts_1 = require("./charts");
9
+ const next_intl_1 = require("next-intl");
10
+ const LEVEL_COLORS = {
11
+ 1: "#2DD4BF",
12
+ 2: "#14B8A6",
13
+ 3: "#0D9488",
14
+ 4: "#0F766E",
15
+ 5: "#115E59",
16
+ };
17
+ function UserLevelStats() {
18
+ const { data: stats, loading, error } = (0, useStats_1.useUserLevelStats)();
19
+ const t = (0, next_intl_1.useTranslations)("data");
20
+ const getLevelDescription = (level) => {
21
+ const key = `levelDesc${level}`;
22
+ return t(key);
23
+ };
24
+ return ((0, jsx_runtime_1.jsx)("section", { className: "bg-muted/30 py-20 md:py-24 px-4 sm:px-6", "aria-labelledby": "user-level-title", children: (0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto", children: [(0, jsx_runtime_1.jsxs)("header", { className: "text-center mb-12 md:mb-16", children: [(0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs sm:text-sm uppercase tracking-widest text-[#5EEAD4] mb-3 md:mb-4", children: "USER DISTRIBUTION" }), (0, jsx_runtime_1.jsx)("h2", { id: "user-level-title", className: "font-sans font-bold text-3xl sm:text-4xl md:text-5xl text-foreground mb-4 md:mb-5 text-balance", children: t('userLevelDist') }), (0, jsx_runtime_1.jsxs)("div", { className: "max-w-3xl mx-auto space-y-2", children: [(0, jsx_runtime_1.jsx)("p", { className: "font-mono text-sm sm:text-base text-foreground/60 text-balance", children: t('userLevelDesc') }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs sm:text-sm text-foreground/40 text-balance", children: t('userLevelSubDesc') })] })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "space-y-4", children: (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3 md:gap-4 mb-8", children: [...Array(4)].map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-3 w-16 bg-muted animate-pulse rounded mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "h-7 w-24 bg-muted animate-pulse rounded" })] }, i))) }) })) : error ? ((0, jsx_runtime_1.jsxs)("div", { className: "text-center text-red-400 py-12 font-mono text-sm", children: [t('loadFailed'), ": ", error] })) : stats ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-3 md:gap-4 mb-8", children: [(0, jsx_runtime_1.jsx)(OverviewCard, { label: t('totalUsers'), value: stats.total_users.toLocaleString(), highlight: true }), (0, jsx_runtime_1.jsx)(OverviewCard, { label: t('minerAndAbove'), value: stats.miners_and_above.toLocaleString(), highlightColor: "blue" }), (0, jsx_runtime_1.jsx)(OverviewCard, { label: t('newToday'), value: `+${stats.new_users_today}`, highlight: true }), (0, jsx_runtime_1.jsx)(OverviewCard, { label: t('monthlyActiveRate'), value: `${stats.monthly_active_rate}%` })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6 mb-8", children: [(0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4 sm:p-6", children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-sans font-medium text-base sm:text-lg text-foreground mb-4 text-center", children: t('userLevelDistChart') }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center h-[280px]", children: (0, jsx_runtime_1.jsx)(charts_1.UserLevelPieChart, { data: stats.levels, className: "w-full h-full" }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4 sm:p-6", children: [(0, jsx_runtime_1.jsx)("h3", { className: "font-sans font-medium text-base sm:text-lg text-foreground mb-4", children: t('upgradeSystem') }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-1", children: stats.levels.map((level) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2.5 rounded-lg hover:bg-background/70 transition-colors", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-8 h-8 rounded-md flex items-center justify-center flex-shrink-0", style: { backgroundColor: `${LEVEL_COLORS[level.level] || '#5EEAD4'}15`, border: `1px solid ${LEVEL_COLORS[level.level] || '#5EEAD4'}25` }, children: (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm font-bold", style: { color: LEVEL_COLORS[level.level] || '#5EEAD4' }, children: level.level }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1 min-w-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-sans font-medium text-base text-foreground", children: level.name }), (0, jsx_runtime_1.jsxs)("span", { className: "font-mono text-xs text-foreground/40", children: ["(", level.chinese, ")"] })] }), (0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs text-foreground/40 truncate", children: getLevelDescription(level.level) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 flex-shrink-0", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-16 h-1.5 bg-border/30 rounded-full overflow-hidden hidden sm:block", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full rounded-full", style: {
25
+ width: `${Math.max(level.percentage, 2)}%`,
26
+ backgroundColor: LEVEL_COLORS[level.level] || '#5EEAD4'
27
+ } }) }), (0, jsx_runtime_1.jsx)("span", { className: "font-sans font-bold text-base text-foreground tabular-nums w-14 text-right", children: level.count.toLocaleString() }), (0, jsx_runtime_1.jsxs)("span", { className: "font-mono text-xs text-foreground/40 w-12 text-right tabular-nums", children: [level.percentage, "%"] })] })] }, level.level))) }), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 p-3 bg-[#5EEAD4]/5 border border-[#5EEAD4]/15 rounded-lg", children: (0, jsx_runtime_1.jsxs)("p", { className: "font-mono text-xs sm:text-sm text-foreground/50", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-[#5EEAD4] font-medium", children: t('onchainVerification') }), t('onchainVerificationDesc')] }) })] })] })] })) : null] }) }));
28
+ }
29
+ function OverviewCard({ label, value, highlight = false, highlightColor, }) {
30
+ const colorClass = highlightColor === "blue"
31
+ ? "text-[#5EBCD4]"
32
+ : highlight
33
+ ? "text-[#5EEAD4]"
34
+ : "text-foreground";
35
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "blockchain-card border border-border/30 bg-background/50 rounded-lg p-4 transition-colors duration-200 hover:bg-background/70 hover:border-border/50", children: [(0, jsx_runtime_1.jsx)("p", { className: "font-mono text-xs sm:text-sm uppercase tracking-widest text-foreground/50 mb-1", children: label }), (0, jsx_runtime_1.jsx)("p", { className: `font-sans font-bold text-2xl sm:text-3xl tabular-nums ${colorClass}`, children: value })] }));
36
+ }
@@ -0,0 +1 @@
1
+ export default function FragmentPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = FragmentPage;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const lucide_react_1 = require("lucide-react");
8
+ const card_1 = require("../ui/card");
9
+ const next_intl_1 = require("next-intl");
10
+ function FragmentPage() {
11
+ const t = (0, next_intl_1.useTranslations)('fragmentDash');
12
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: t('myHoldings') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8 text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Puzzle, { className: "w-12 h-12 mx-auto mb-2 opacity-50" }), (0, jsx_runtime_1.jsx)("p", { children: t('noHoldings') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm mt-1", children: t('noHoldingsHint') })] })] }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ImageIcon, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: t('fragmentVaults') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8 text-neutral-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ImageIcon, { className: "w-12 h-12 mx-auto mb-2 opacity-50" }), (0, jsx_runtime_1.jsx)("p", { children: t('noVaults') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm mt-1", children: t('noVaultsHint') })] })] }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Info, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: t('protocolInfo') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-4 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-white mb-2", children: t('whatIsFragmentation') }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400", children: t('fragmentationDesc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-white mb-2", children: t('fragmentRights') }), (0, jsx_runtime_1.jsxs)("ul", { className: "list-disc list-inside space-y-1 text-neutral-400", children: [(0, jsx_runtime_1.jsx)("li", { children: t('fragmentRight1') }), (0, jsx_runtime_1.jsx)("li", { children: t('fragmentRight2') }), (0, jsx_runtime_1.jsx)("li", { children: t('fragmentRight3') })] })] })] })] }) })] }));
13
+ }
@@ -0,0 +1 @@
1
+ export default function ManagerIncomePage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = ManagerIncomePage;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const card_1 = require("../ui/card");
9
+ const badge_1 = require("../ui/badge");
10
+ const button_1 = require("../ui/button");
11
+ const input_1 = require("../ui/input");
12
+ const label_1 = require("../ui/label");
13
+ const sonner_1 = require("sonner");
14
+ const useAuth_1 = require("../../hooks/useAuth");
15
+ const api_service_1 = require("../../lib/api-service");
16
+ const api_1 = require("../../lib/types/api");
17
+ const utils_1 = require("../../lib/utils");
18
+ const lucide_react_1 = require("lucide-react");
19
+ const MiningDistributionHistory_1 = require("../mining/MiningDistributionHistory");
20
+ const next_intl_1 = require("next-intl");
21
+ const getLevelIcon = (level) => {
22
+ switch (level) {
23
+ case 'station': return (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-5 h-5" });
24
+ case 'matrix': return (0, jsx_runtime_1.jsx)(lucide_react_1.Grid3x3, { className: "w-5 h-5" });
25
+ case 'sector': return (0, jsx_runtime_1.jsx)(lucide_react_1.Map, { className: "w-5 h-5" });
26
+ case 'system': return (0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { className: "w-5 h-5" });
27
+ }
28
+ };
29
+ const getLevelColor = (level) => {
30
+ switch (level) {
31
+ case 'station': return 'text-neutral-300';
32
+ case 'matrix': return 'text-cyan-400';
33
+ case 'sector': return 'text-cyan-400';
34
+ case 'system': return 'text-cyan-400';
35
+ }
36
+ };
37
+ const getLevelLabel = (level) => {
38
+ switch (level) {
39
+ case 'station': return 'Station';
40
+ case 'matrix': return 'Matrix';
41
+ case 'sector': return 'Sector';
42
+ case 'system': return 'System';
43
+ }
44
+ };
45
+ function ManagerIncomePage() {
46
+ const t = (0, next_intl_1.useTranslations)('managerIncome');
47
+ const { isAdmin } = (0, useAuth_1.useAuth)();
48
+ const [income, setIncome] = (0, react_1.useState)(null);
49
+ const [teamCustody, setTeamCustody] = (0, react_1.useState)(null);
50
+ const [loading, setLoading] = (0, react_1.useState)(true);
51
+ const [refreshing, setRefreshing] = (0, react_1.useState)(false);
52
+ const [dateRange, setDateRange] = (0, react_1.useState)('30d');
53
+ const [startDate, setStartDate] = (0, react_1.useState)('');
54
+ const [endDate, setEndDate] = (0, react_1.useState)('');
55
+ (0, react_1.useEffect)(() => {
56
+ loadData();
57
+ }, [dateRange]);
58
+ const getDateParams = () => {
59
+ const now = new Date();
60
+ let start;
61
+ let end;
62
+ if (dateRange === '7d') {
63
+ const d = new Date(now);
64
+ d.setDate(d.getDate() - 7);
65
+ start = d.toISOString().split('T')[0];
66
+ }
67
+ else if (dateRange === '30d') {
68
+ const d = new Date(now);
69
+ d.setDate(d.getDate() - 30);
70
+ start = d.toISOString().split('T')[0];
71
+ }
72
+ else if (dateRange === '90d') {
73
+ const d = new Date(now);
74
+ d.setDate(d.getDate() - 90);
75
+ start = d.toISOString().split('T')[0];
76
+ }
77
+ if (startDate)
78
+ start = startDate;
79
+ if (endDate)
80
+ end = endDate;
81
+ return { start, end };
82
+ };
83
+ const loadData = async () => {
84
+ setLoading(true);
85
+ const { start, end } = getDateParams();
86
+ try {
87
+ const incomeRes = await (0, api_service_1.getManagerIncome)(start, end);
88
+ if (incomeRes.success) {
89
+ setIncome(incomeRes);
90
+ }
91
+ else {
92
+ console.warn('[ManagerIncome] Failed to fetch income data:', incomeRes.error);
93
+ }
94
+ }
95
+ catch (e) {
96
+ console.warn('[ManagerIncome] Failed to fetch income data:', e);
97
+ setIncome(null);
98
+ }
99
+ if (isAdmin()) {
100
+ try {
101
+ const custodyRes = await (0, api_service_1.getTeamCustodySummary)();
102
+ if (custodyRes && custodyRes.success) {
103
+ setTeamCustody(custodyRes);
104
+ }
105
+ }
106
+ catch (e) {
107
+ console.warn('[ManagerIncome] Failed to fetch team custody data:', e);
108
+ setTeamCustody(null);
109
+ }
110
+ }
111
+ setLoading(false);
112
+ };
113
+ const handleRefresh = async () => {
114
+ setRefreshing(true);
115
+ await loadData();
116
+ setRefreshing(false);
117
+ sonner_1.toast.success(t('refreshed'));
118
+ };
119
+ const handleCustomDateSearch = () => {
120
+ if (startDate || endDate) {
121
+ setDateRange('all');
122
+ loadData();
123
+ }
124
+ };
125
+ const totalIncome = income?.total_income ? parseFloat(income.total_income) : 0;
126
+ const levels = ['station', 'matrix', 'sector', 'system'];
127
+ const levelIncomes = levels.map(level => ({
128
+ level,
129
+ data: income?.income_by_level?.[level],
130
+ share: api_1.ManagerShareRatios[level],
131
+ role: api_1.ManagerRoleNames[level]
132
+ }));
133
+ const maxIncome = Math.max(...levelIncomes.map(l => l.data?.total_income ? parseFloat(l.data.total_income) : 0)) || 1;
134
+ if (loading) {
135
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-20", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-6 h-6 animate-spin text-neutral-400 mr-3" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('loading') })] })] }));
136
+ }
137
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", onClick: handleRefresh, disabled: refreshing, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", refreshing && "animate-spin") }), t('refresh')] })] }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Info, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('distributionRatio') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-4 md:grid-cols-8 gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-4 h-4 mx-auto mb-1 text-white" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-white font-mono", children: "50%" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('userMcc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.PiggyBank, { className: "w-4 h-4 mx-auto mb-1 text-cyan-400" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-cyan-400 font-mono", children: "10%" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('teamMcc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-4 h-4 mx-auto mb-1 text-cyan-400" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-cyan-400 font-mono", children: "4%" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('stationMagistrate') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Grid3x3, { className: "w-4 h-4 mx-auto mb-1 text-cyan-400" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-cyan-400 font-mono", children: "3%" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('matrixMagistrate') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Map, { className: "w-4 h-4 mx-auto mb-1 text-cyan-400" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-cyan-400 font-mono", children: "2%" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('sectorMagistrate') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { className: "w-4 h-4 mx-auto mb-1 text-cyan-400" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-cyan-400 font-mono", children: "1%" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('systemMagistrate') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "col-span-2 text-center p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4 mx-auto mb-1 text-cyan-400" }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-cyan-400 font-mono", children: "30%" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('stationVaultMcd') })] })] })] }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col md:flex-row gap-4 items-end", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex gap-2 flex-wrap", children: ['7d', '30d', '90d', 'all'].map(range => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setDateRange(range), className: (0, utils_1.cn)("px-3 py-1.5 text-sm rounded transition-colors", dateRange === range
138
+ ? "bg-cyan-700 text-white"
139
+ : "bg-neutral-800 text-neutral-400 hover:bg-neutral-700 hover:text-white"), children: range === '7d' ? t('days7') : range === '30d' ? t('days30') : range === '90d' ? t('days90') : t('all') }, range))) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2 items-end flex-1", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-neutral-400 text-xs tracking-wider", children: t('startDate') }), (0, jsx_runtime_1.jsx)(input_1.Input, { type: "date", value: startDate, onChange: (e) => setStartDate(e.target.value), className: "bg-neutral-800 border-neutral-600 text-white w-36 h-8 text-sm" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(label_1.Label, { className: "text-neutral-400 text-xs tracking-wider", children: t('endDate') }), (0, jsx_runtime_1.jsx)(input_1.Input, { type: "date", value: endDate, onChange: (e) => setEndDate(e.target.value), className: "bg-neutral-800 border-neutral-600 text-white w-36 h-8 text-sm" })] }), (0, jsx_runtime_1.jsx)(button_1.Button, { variant: "outline", size: "sm", className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", onClick: handleCustomDateSearch, children: t('query') })] })] }) }) }), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "total_manager_income" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-4xl font-bold text-white font-mono", children: [totalIncome.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }), (0, jsx_runtime_1.jsx)("span", { className: "text-lg text-neutral-500 ml-2", children: "MCC" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "p-4 bg-neutral-800 rounded-full", children: (0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-8 h-8 text-white" }) })] }) }) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: levelIncomes.map(({ level, data, share, role }) => {
140
+ const incomeAmount = data?.total_income ? parseFloat(data.total_income) : 0;
141
+ const recordCount = data?.record_count || 0;
142
+ const percentage = maxIncome > 0 ? (incomeAmount / maxIncome) * 100 : 0;
143
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)("p-2 rounded bg-neutral-800", getLevelColor(level)), children: getLevelIcon(level) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium", children: getLevelLabel(level) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500", children: [role, " - ", share * 100, "%"] })] })] }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { variant: "outline", className: incomeAmount > 0
144
+ ? "bg-white/20 text-white border border-white/30"
145
+ : "bg-neutral-500/20 text-neutral-300 border border-neutral-600", children: incomeAmount > 0 ? t('hasIncome') : t('noIncome') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-sm mb-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t('cumulativeIncome') }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono", children: [incomeAmount.toLocaleString(undefined, { minimumFractionDigits: 2 }), " MCC"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-2", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all", style: { width: `${percentage}%` } }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-4 pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xl font-bold text-white font-mono", children: recordCount }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('outputRecords') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xl font-bold text-white font-mono", children: recordCount > 0 ? (incomeAmount / recordCount).toFixed(2) : '0.00' }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('avgPerRecord') })] })] })] }) }, level));
146
+ }) }), isAdmin() && teamCustody && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.PiggyBank, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('teamCustodySummary') })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3", children: teamCustody.wallets.map((wallet, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: "p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: wallet.wallet_type }), (0, jsx_runtime_1.jsx)("div", { className: "text-lg font-bold text-white font-mono", children: parseFloat(wallet.total_received).toLocaleString() }), wallet.wallet_address && ((0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 mt-1 truncate font-mono", title: wallet.wallet_address, children: [wallet.wallet_address.slice(0, 8), "..."] }))] }, idx))) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-4 pt-4 border-t border-neutral-700 flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 tracking-wider", children: "total_custody" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-2xl font-bold text-white font-mono", children: [parseFloat(teamCustody.total_received).toLocaleString(), " MCC"] })] })] }) })), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.History, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: t('outputHistory') })] }), (0, jsx_runtime_1.jsx)(MiningDistributionHistory_1.MiningDistributionHistory, { title: "", description: "", showUserColumn: true, limit: 10 })] }) })] }));
147
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ import { Sidebar } from "../ui/sidebar";
3
+ export declare function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || (function () {
21
+ var ownKeys = function(o) {
22
+ ownKeys = Object.getOwnPropertyNames || function (o) {
23
+ var ar = [];
24
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
+ return ar;
26
+ };
27
+ return ownKeys(o);
28
+ };
29
+ return function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ })();
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.AppSidebar = AppSidebar;
39
+ const jsx_runtime_1 = require("react/jsx-runtime");
40
+ const React = __importStar(require("react"));
41
+ const navigation_1 = require("../../i18n/navigation");
42
+ const navigation_2 = require("next/navigation");
43
+ const lucide_react_1 = require("lucide-react");
44
+ const utils_1 = require("../../lib/utils");
45
+ const useAuth_1 = require("../../hooks/useAuth");
46
+ const menu_config_1 = require("../../config/menu-config");
47
+ const next_intl_1 = require("next-intl");
48
+ const sidebar_1 = require("../ui/sidebar");
49
+ const separator_1 = require("../ui/separator");
50
+ const button_1 = require("../ui/button");
51
+ const avatar_1 = require("../ui/avatar");
52
+ const auth_service_1 = require("../../lib/auth-service");
53
+ function NavMenuItem({ item }) {
54
+ const pathname = (0, navigation_2.usePathname)();
55
+ const isActive = (0, menu_config_1.isMenuItemActive)(item.href, pathname);
56
+ const [isOpen, setIsOpen] = React.useState(isActive);
57
+ const tm = (0, next_intl_1.useTranslations)("menu");
58
+ React.useEffect(() => {
59
+ if (isActive) {
60
+ setIsOpen(true);
61
+ }
62
+ }, [isActive]);
63
+ if (item.isSection) {
64
+ return ((0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsx)("span", { className: "flex w-full items-center px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-sidebar-foreground/50 pointer-events-none", children: tm(item.titleKey) }) }));
65
+ }
66
+ if (item.children && item.children.length > 0) {
67
+ return ((0, jsx_runtime_1.jsxs)(sidebar_1.SidebarMenuItem, { children: [(0, jsx_runtime_1.jsxs)(sidebar_1.SidebarMenuButton, { onClick: () => setIsOpen(!isOpen), className: (0, utils_1.cn)("w-full", isActive && "bg-sidebar-accent text-sidebar-accent-foreground"), children: [(0, jsx_runtime_1.jsx)(item.icon, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { children: tm(item.titleKey) }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: (0, utils_1.cn)("ml-auto h-4 w-4 transition-transform", isOpen && "rotate-90") })] }), isOpen && ((0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuSub, { children: item.children.map((subItem) => {
68
+ const subIsActive = (0, menu_config_1.isMenuItemActive)(subItem.href, pathname);
69
+ return ((0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuSubItem, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuSubButton, { asChild: true, isActive: subIsActive, children: (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: subItem.href, children: [(0, jsx_runtime_1.jsx)(subItem.icon, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { children: tm(subItem.titleKey) })] }) }) }, subItem.href));
70
+ }) }))] }));
71
+ }
72
+ return ((0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuButton, { asChild: true, isActive: isActive, tooltip: item.descriptionKey ? tm(item.descriptionKey) : undefined, children: (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, children: [(0, jsx_runtime_1.jsx)(item.icon, { className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("span", { children: tm(item.titleKey) }), item.badge && ((0, jsx_runtime_1.jsx)("span", { className: "ml-auto flex h-5 w-5 items-center justify-center rounded-full bg-sidebar-primary text-xs font-medium text-sidebar-primary-foreground", children: item.badge }))] }) }) }));
73
+ }
74
+ function AppSidebar({ ...props }) {
75
+ const { userInfo } = (0, useAuth_1.useAuth)();
76
+ const userRole = userInfo?.role || "user";
77
+ const tc = (0, next_intl_1.useTranslations)("common");
78
+ const menus = React.useMemo(() => (0, menu_config_1.getUserMenus)(userRole), [userRole]);
79
+ const handleLogout = async () => {
80
+ try {
81
+ await (0, auth_service_1.logOut)();
82
+ }
83
+ catch (error) {
84
+ console.error(tc("logoutFailed"), error);
85
+ }
86
+ };
87
+ return ((0, jsx_runtime_1.jsxs)(sidebar_1.Sidebar, { collapsible: "icon", ...props, children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarHeader, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuButton, { size: "lg", asChild: true, children: (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/user-system/dashboard", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-[#6366F1] text-white", children: (0, jsx_runtime_1.jsx)("span", { className: "text-lg font-bold", children: "M" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [(0, jsx_runtime_1.jsx)("span", { className: "truncate font-semibold", children: "Microcosm" }), (0, jsx_runtime_1.jsx)("span", { className: "truncate text-xs text-sidebar-foreground/50", children: "Open User System" })] })] }) }) }) }) }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarContent, { children: [(0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarMenu') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.userMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] }), menus.agentMenu && menus.agentMenu.length > 0 && ((0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarAgentManagement') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.agentMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] })), menus.adminMenu && menus.adminMenu.length > 0 && ((0, jsx_runtime_1.jsxs)(sidebar_1.SidebarGroup, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarGroupLabel, { children: tc('sidebarSystemManagement') }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenu, { children: menus.adminMenu.map((item) => ((0, jsx_runtime_1.jsx)(NavMenuItem, { item: item }, item.href))) })] }))] }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarFooter, { children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, { className: "mb-2" }), (0, jsx_runtime_1.jsxs)(sidebar_1.SidebarMenu, { children: [(0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 px-2 py-1.5", children: [(0, jsx_runtime_1.jsx)(avatar_1.Avatar, { className: "h-8 w-8", children: (0, jsx_runtime_1.jsx)(avatar_1.AvatarFallback, { className: "bg-[#6366F1] text-white", children: userInfo?.email?.charAt(0).toUpperCase() || "U" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col text-left text-sm leading-tight", children: [(0, jsx_runtime_1.jsx)("span", { className: "truncate font-semibold", children: userInfo?.email?.split("@")[0] || tc('defaultUser') }), (0, jsx_runtime_1.jsxs)("span", { className: "truncate text-xs text-sidebar-foreground/50", children: [userRole === "admin" && tc('admin'), userRole === "agent" && tc('agent'), userRole === "user" && tc('normalUser')] })] })] }) }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarMenuItem, { children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "ghost", size: "sm", className: "w-full justify-start", onClick: handleLogout, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { className: "mr-2 h-4 w-4" }), tc('logout')] }) })] })] }), (0, jsx_runtime_1.jsx)(sidebar_1.SidebarRail, {})] }));
88
+ }
@@ -0,0 +1 @@
1
+ export declare function DashboardHeader(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.DashboardHeader = DashboardHeader;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const navigation_1 = require("../../i18n/navigation");
9
+ const lucide_react_1 = require("lucide-react");
10
+ const utils_1 = require("../../lib/utils");
11
+ const useAuth_1 = require("../../hooks/useAuth");
12
+ const auth_service_1 = require("../../lib/auth-service");
13
+ const next_intl_1 = require("next-intl");
14
+ const LocaleSwitcher_1 = require("./LocaleSwitcher");
15
+ const hover_avatar_1 = require("../ui/hover-avatar");
16
+ const navItemDefs = [
17
+ { labelKey: "titan", href: "/titan", isTitan: true },
18
+ { labelKey: "blockchain", href: "/blockchain", submenu: "blockchain" },
19
+ { labelKey: "developers", href: "/developers", submenu: "developer" },
20
+ { labelKey: "mainnetPlan", href: "/mainnet" },
21
+ { labelKey: "game", href: "/game/crash-challenge", submenu: "game", isGame: true },
22
+ ];
23
+ const developerSubItemDefs = [
24
+ { labelKey: "techDocs", href: "/developers/api", icon: lucide_react_1.FileText },
25
+ { labelKey: "projectDev", href: "/developers/assistant", icon: lucide_react_1.Bot },
26
+ { labelKey: "projectSubmit", href: "/developers/submit", icon: lucide_react_1.Send },
27
+ { labelKey: "projectStats", href: "/developers/stats", icon: lucide_react_1.BarChart3 },
28
+ ];
29
+ const blockchainSubItemDefs = [
30
+ { labelKey: "quickMining", href: "https://m.microcosm.money", icon: lucide_react_1.Pickaxe, external: true },
31
+ { labelKey: "market", href: "/market", icon: lucide_react_1.TrendingUp },
32
+ { labelKey: "community", href: "/community", icon: lucide_react_1.Users },
33
+ { labelKey: "mccEconomics", href: "/blockchain/economics", icon: lucide_react_1.Coins },
34
+ ];
35
+ const gameSubItemDefs = [
36
+ { label: "Crash Challenge", href: "/game/crash-challenge", icon: lucide_react_1.Crosshair },
37
+ { label: "Diamond Hands", href: "/game/diamond-hands", icon: lucide_react_1.Gem },
38
+ ];
39
+ function TitanLabel() {
40
+ return ((0, jsx_runtime_1.jsxs)("span", { className: "tracking-wide", children: ["T", (0, jsx_runtime_1.jsx)("span", { className: "text-green-400 font-bold", children: "I" }), "TAN"] }));
41
+ }
42
+ function GameLabel() {
43
+ return ((0, jsx_runtime_1.jsxs)("span", { className: "tracking-wide", children: ["G", (0, jsx_runtime_1.jsx)("span", { className: "text-green-400 font-bold", children: "A" }), "ME"] }));
44
+ }
45
+ function DashboardHeader() {
46
+ const [showDeveloperMenu, setShowDeveloperMenu] = (0, react_1.useState)(false);
47
+ const [showBlockchainMenu, setShowBlockchainMenu] = (0, react_1.useState)(false);
48
+ const [showGameMenu, setShowGameMenu] = (0, react_1.useState)(false);
49
+ const [showUserMenu, setShowUserMenu] = (0, react_1.useState)(false);
50
+ const developerMenuTimeoutRef = (0, react_1.useRef)(null);
51
+ const blockchainMenuTimeoutRef = (0, react_1.useRef)(null);
52
+ const gameMenuTimeoutRef = (0, react_1.useRef)(null);
53
+ const userMenuTimeoutRef = (0, react_1.useRef)(null);
54
+ const { user, userInfo, loading } = (0, useAuth_1.useAuth)();
55
+ const t = (0, next_intl_1.useTranslations)("nav");
56
+ const tc = (0, next_intl_1.useTranslations)("common");
57
+ const handleLogout = () => {
58
+ setShowUserMenu(false);
59
+ (0, auth_service_1.logOut)();
60
+ };
61
+ const displayName = userInfo?.display_name || userInfo?.email?.split('@')[0] || tc('defaultUser');
62
+ const navItems = navItemDefs.map(i => ({ ...i, label: i.labelKey === "game" ? "GAME" : t(i.labelKey) }));
63
+ const developerSubItems = developerSubItemDefs.map(i => ({ ...i, label: t(i.labelKey) }));
64
+ const blockchainSubItems = blockchainSubItemDefs.map(i => ({ ...i, label: t(i.labelKey) }));
65
+ const handleDeveloperMouseEnter = () => {
66
+ if (developerMenuTimeoutRef.current)
67
+ clearTimeout(developerMenuTimeoutRef.current);
68
+ setShowDeveloperMenu(true);
69
+ };
70
+ const handleDeveloperMouseLeave = () => {
71
+ developerMenuTimeoutRef.current = setTimeout(() => setShowDeveloperMenu(false), 150);
72
+ };
73
+ const handleBlockchainMouseEnter = () => {
74
+ if (blockchainMenuTimeoutRef.current)
75
+ clearTimeout(blockchainMenuTimeoutRef.current);
76
+ setShowBlockchainMenu(true);
77
+ };
78
+ const handleBlockchainMouseLeave = () => {
79
+ blockchainMenuTimeoutRef.current = setTimeout(() => setShowBlockchainMenu(false), 150);
80
+ };
81
+ const handleGameMouseEnter = () => {
82
+ if (gameMenuTimeoutRef.current)
83
+ clearTimeout(gameMenuTimeoutRef.current);
84
+ setShowGameMenu(true);
85
+ };
86
+ const handleGameMouseLeave = () => {
87
+ gameMenuTimeoutRef.current = setTimeout(() => setShowGameMenu(false), 150);
88
+ };
89
+ const handleUserMouseEnter = () => {
90
+ if (userMenuTimeoutRef.current)
91
+ clearTimeout(userMenuTimeoutRef.current);
92
+ setShowUserMenu(true);
93
+ };
94
+ const handleUserMouseLeave = () => {
95
+ userMenuTimeoutRef.current = setTimeout(() => setShowUserMenu(false), 150);
96
+ };
97
+ (0, react_1.useEffect)(() => {
98
+ return () => {
99
+ if (developerMenuTimeoutRef.current)
100
+ clearTimeout(developerMenuTimeoutRef.current);
101
+ if (blockchainMenuTimeoutRef.current)
102
+ clearTimeout(blockchainMenuTimeoutRef.current);
103
+ if (gameMenuTimeoutRef.current)
104
+ clearTimeout(gameMenuTimeoutRef.current);
105
+ if (userMenuTimeoutRef.current)
106
+ clearTimeout(userMenuTimeoutRef.current);
107
+ };
108
+ }, []);
109
+ return ((0, jsx_runtime_1.jsx)("header", { className: "fixed top-0 left-0 right-0 z-50 h-14 2xs:h-16 bg-neutral-950 border-b border-neutral-800", children: (0, jsx_runtime_1.jsxs)("div", { className: "h-full px-2 2xs:px-3 xs:px-4 md:px-6 flex items-center relative", children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/", className: "hidden md:flex items-center gap-2 lg:gap-3 shrink-0", children: [(0, jsx_runtime_1.jsx)("img", { src: "/mcc-logo-40.png", alt: "MCC", className: "w-8 h-8 lg:w-10 lg:h-10 rounded" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-bold text-base lg:text-lg tracking-wider text-white", children: ["M", (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400", children: "I" }), "CROCOSM"] })] }), (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/", className: "md:hidden flex items-center gap-1.5 2xs:gap-2 ml-10 2xs:ml-12", children: [(0, jsx_runtime_1.jsx)("img", { src: "/mcc-logo-40.png", alt: "MCC", className: "w-6 h-6 2xs:w-7 2xs:h-7 xs:w-8 xs:h-8 rounded" }), (0, jsx_runtime_1.jsxs)("span", { className: "font-bold text-xs 2xs:text-sm xs:text-base tracking-wider text-white", children: ["M", (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400", children: "I" }), "CROCOSM"] })] }), (0, jsx_runtime_1.jsx)("nav", { className: "hidden lg:flex flex-1 items-center justify-center gap-0.5 xl:gap-1", children: navItems.map((item) => {
110
+ if (item.submenu === "developer") {
111
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleDeveloperMouseEnter, onMouseLeave: handleDeveloperMouseLeave, children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, className: "flex items-center gap-1 px-2 xl:px-3 2xl:px-4 py-2 text-xs xl:text-sm text-neutral-400 hover:text-white rounded transition-colors text-truncate-safe", children: [item.label, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14, className: (0, utils_1.cn)("transition-transform shrink-0", showDeveloperMenu && "rotate-180") })] }), showDeveloperMenu && ((0, jsx_runtime_1.jsx)("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1 w-56 bg-neutral-900 border border-neutral-700 rounded shadow-2xl overflow-hidden", children: developerSubItems.map((sub) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: sub.href, className: "flex items-center gap-3 px-4 py-2.5 text-sm text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors", children: [(0, jsx_runtime_1.jsx)(sub.icon, { size: 16, className: "text-neutral-500" }), sub.label] }, sub.href))) }))] }, item.label));
112
+ }
113
+ if (item.submenu === "blockchain") {
114
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleBlockchainMouseEnter, onMouseLeave: handleBlockchainMouseLeave, children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, className: "flex items-center gap-1 px-2 xl:px-3 2xl:px-4 py-2 text-xs xl:text-sm text-neutral-400 hover:text-white rounded transition-colors text-truncate-safe", children: [item.label, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14, className: (0, utils_1.cn)("transition-transform shrink-0", showBlockchainMenu && "rotate-180") })] }), showBlockchainMenu && ((0, jsx_runtime_1.jsx)("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1 w-56 bg-neutral-900 border border-neutral-700 rounded shadow-2xl overflow-hidden", children: blockchainSubItems.map((sub) => ("external" in sub && sub.external ? ((0, jsx_runtime_1.jsxs)("a", { href: sub.href, target: "_blank", rel: "noopener noreferrer", className: "flex items-center gap-3 px-4 py-2.5 text-sm text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors", children: [(0, jsx_runtime_1.jsx)(sub.icon, { size: 16, className: "text-neutral-500" }), sub.label] }, sub.href)) : ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: sub.href, className: "flex items-center gap-3 px-4 py-2.5 text-sm text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors", children: [(0, jsx_runtime_1.jsx)(sub.icon, { size: 16, className: "text-neutral-500" }), sub.label] }, sub.href)))) }))] }, item.label));
115
+ }
116
+ if (item.submenu === "game") {
117
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleGameMouseEnter, onMouseLeave: handleGameMouseLeave, children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: item.href, className: "flex items-center gap-1 px-2 xl:px-3 2xl:px-4 py-2 text-xs xl:text-sm text-neutral-400 hover:text-white rounded transition-colors text-truncate-safe", children: [(0, jsx_runtime_1.jsx)(GameLabel, {}), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14, className: (0, utils_1.cn)("transition-transform shrink-0", showGameMenu && "rotate-180") })] }), showGameMenu && ((0, jsx_runtime_1.jsx)("div", { className: "absolute top-full left-1/2 -translate-x-1/2 mt-1 w-56 bg-neutral-900 border border-neutral-700 rounded shadow-2xl overflow-hidden", children: gameSubItemDefs.map((sub) => ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: sub.href, className: "flex items-center gap-3 px-4 py-2.5 text-sm text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors", children: [(0, jsx_runtime_1.jsx)(sub.icon, { size: 16, className: "text-neutral-500" }), sub.label] }, sub.href))) }))] }, item.label));
118
+ }
119
+ return ((0, jsx_runtime_1.jsx)(navigation_1.Link, { href: item.href, className: "px-2 xl:px-3 2xl:px-4 py-2 text-xs xl:text-sm text-neutral-400 hover:text-white rounded transition-colors text-truncate-safe", children: "isTitan" in item && item.isTitan ? (0, jsx_runtime_1.jsx)(TitanLabel, {}) : "isGame" in item && item.isGame ? (0, jsx_runtime_1.jsx)(GameLabel, {}) : item.label }, item.label));
120
+ }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-end gap-0.5 2xs:gap-1 ml-auto", children: [(0, jsx_runtime_1.jsx)(LocaleSwitcher_1.LocaleSwitcher, {}), user && ((0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/notifications", className: "relative p-1.5 xs:p-2 rounded text-neutral-400 hover:text-cyan-400 transition-colors hidden xs:block touch-target", title: tc('notifications'), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Bell, { size: 16, className: "xs:hidden" }), (0, jsx_runtime_1.jsx)(lucide_react_1.Bell, { size: 18, className: "hidden xs:block" })] })), loading ? ((0, jsx_runtime_1.jsx)("span", { className: "text-xs 2xs:text-sm text-neutral-500", children: "..." })) : user ? ((0, jsx_runtime_1.jsxs)("div", { className: "relative", onMouseEnter: handleUserMouseEnter, onMouseLeave: handleUserMouseLeave, children: [(0, jsx_runtime_1.jsxs)("button", { className: "flex items-center gap-1 2xs:gap-1.5 xs:gap-2 px-1.5 2xs:px-2 xs:px-2.5 py-1 2xs:py-1.5 rounded hover:bg-neutral-700 transition-colors touch-target", children: [(0, jsx_runtime_1.jsx)(hover_avatar_1.HoverAvatar, { src: userInfo?.avatar_url, fallback: userInfo?.display_name || userInfo?.uid, size: 28, fallbackClassName: "bg-cyan-400/20 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs xs:text-sm text-neutral-300 max-w-[60px] xs:max-w-[80px] sm:max-w-[100px] truncate hidden sm:block", children: displayName }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14, className: (0, utils_1.cn)("text-neutral-500 transition-transform hidden md:block", showUserMenu && "rotate-180") })] }), showUserMenu && ((0, jsx_runtime_1.jsxs)("div", { className: "absolute top-full right-0 mt-1 w-48 bg-neutral-900 border border-neutral-700 rounded shadow-2xl overflow-hidden", children: [(0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/profile", className: "flex items-center gap-3 px-4 py-2.5 text-sm text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors", onClick: () => setShowUserMenu(false), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.User, { size: 16, className: "text-neutral-500" }), tc('profile')] }), (0, jsx_runtime_1.jsxs)(navigation_1.Link, { href: "/user-system/dashboard", className: "flex items-center gap-3 px-4 py-2.5 text-sm text-neutral-400 hover:text-white hover:bg-neutral-800 transition-colors", onClick: () => setShowUserMenu(false), children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LayoutDashboard, { size: 16, className: "text-neutral-500" }), tc('dashboard')] }), (0, jsx_runtime_1.jsx)("div", { className: "border-t border-neutral-700" }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleLogout, className: "w-full flex items-center gap-3 px-4 py-2.5 text-sm text-neutral-400 hover:text-red-500 hover:bg-neutral-800 transition-colors", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { size: 16, className: "text-neutral-500" }), tc('logout')] })] }))] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 2xs:gap-2", children: [(0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/login", className: "px-2 2xs:px-3 xs:px-4 py-1.5 text-xs 2xs:text-sm text-neutral-400 hover:text-white transition-colors", children: tc('login') }), (0, jsx_runtime_1.jsx)(navigation_1.Link, { href: "/register", className: "px-2 2xs:px-3 xs:px-4 py-1.5 text-xs 2xs:text-sm bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors", children: tc('register') })] }))] })] }) }));
121
+ }
@@ -0,0 +1 @@
1
+ export declare function LocaleSwitcher(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ "use client";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.LocaleSwitcher = LocaleSwitcher;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const next_intl_1 = require("next-intl");
8
+ const navigation_1 = require("../../i18n/navigation");
9
+ const lucide_react_1 = require("lucide-react");
10
+ const dropdown_menu_1 = require("../ui/dropdown-menu");
11
+ const locales = [
12
+ { code: "en", label: "English" },
13
+ { code: "zh", label: "\u4e2d\u6587" },
14
+ { code: "ko", label: "\ud55c\uad6d\uc5b4" },
15
+ { code: "ja", label: "\u65e5\u672c\u8a9e" },
16
+ ];
17
+ function LocaleSwitcher() {
18
+ const locale = (0, next_intl_1.useLocale)();
19
+ const router = (0, navigation_1.useRouter)();
20
+ const pathname = (0, navigation_1.usePathname)();
21
+ const currentLabel = locales.find((l) => l.code === locale)?.code.toUpperCase() ?? "EN";
22
+ function onSelectLocale(newLocale) {
23
+ // Cookie 持久化语言选择,跨页面/登录后保持
24
+ document.cookie = `NEXT_LOCALE=${newLocale};path=/;max-age=${365 * 24 * 60 * 60};SameSite=Lax`;
25
+ router.replace(pathname, { locale: newLocale });
26
+ }
27
+ return ((0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("button", { className: "flex items-center gap-1.5 px-2.5 py-1.5 text-sm text-neutral-400 hover:text-white rounded transition-colors hover:bg-white/5 outline-none", "aria-label": "Switch language", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { size: 16 }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-medium", children: currentLabel })] }) }), (0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuContent, { align: "end", className: "min-w-[140px] bg-neutral-900/95 backdrop-blur-xl border-neutral-700 shadow-xl", children: locales.map((l) => ((0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenuItem, { onClick: () => onSelectLocale(l.code), className: `cursor-pointer text-sm ${locale === l.code
28
+ ? "text-violet-400 font-medium"
29
+ : "text-neutral-300 hover:text-white"}`, children: [(0, jsx_runtime_1.jsx)("span", { className: "w-7 text-xs text-neutral-500 uppercase", children: l.code }), l.label] }, l.code))) })] }));
30
+ }
@@ -0,0 +1,2 @@
1
+ export declare function MainFooter(): import("react/jsx-runtime").JSX.Element;
2
+ export default MainFooter;