@jheavenknows/bluerouter 5.0.87 → 5.0.89

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 (1351) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +11 -11
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/required-server-files.json +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js +2 -2
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  91. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  95. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  97. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  104. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  106. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  108. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  109. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  110. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +6 -6
  111. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  112. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  114. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/branding/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/branding/upload/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  136. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  138. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  149. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  153. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  155. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  161. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +3 -3
  165. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  167. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  169. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  171. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/cli-tools/qwen-settings/route.js +2 -2
  175. package/app/.next-cli-build/server/app/api/cli-tools/qwen-settings/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js +122 -83
  181. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js +1 -1
  187. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js +1 -1
  193. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/provider-health/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  279. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  281. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  291. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  292. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  293. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  294. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  295. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  299. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  301. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  305. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  307. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  336. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  339. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/version/restart/route.js.nft.json +1 -1
  392. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  398. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  400. package/app/.next-cli-build/server/app/callback.html +1 -1
  401. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  402. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  403. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +6 -6
  405. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  406. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/analytics.html +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/analytics.rsc +8 -8
  410. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics/__PAGE__.segment.rsc +2 -2
  411. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard/analytics.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/analytics.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  414. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_full.segment.rsc +8 -8
  415. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_head.segment.rsc +1 -1
  416. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_index.segment.rsc +6 -6
  417. package/app/.next-cli-build/server/app/dashboard/analytics.segments/_tree.segment.rsc +2 -2
  418. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  419. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +8 -8
  420. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +2 -2
  421. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  423. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  424. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +8 -8
  425. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +6 -6
  427. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +2 -2
  428. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
  430. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  431. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
  435. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +6 -6
  437. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  438. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +9 -9
  440. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  441. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  444. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +9 -9
  445. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +6 -6
  447. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  448. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
  450. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  451. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  454. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
  455. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  456. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +6 -6
  457. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  458. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +9 -9
  460. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  463. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  464. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +9 -9
  465. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  466. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +6 -6
  467. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  468. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
  470. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  471. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  473. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  475. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
  476. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +6 -6
  478. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  480. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
  481. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  482. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  483. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  485. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
  486. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  487. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +6 -6
  488. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  491. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  495. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  496. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +6 -6
  498. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  499. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  500. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +7 -7
  501. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
  503. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  505. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +7 -7
  506. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
  507. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +6 -6
  508. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +2 -2
  509. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +7 -7
  511. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  515. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +7 -7
  516. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
  517. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +6 -6
  518. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +2 -2
  519. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  520. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
  521. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  522. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  524. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  526. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
  527. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +6 -6
  529. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  530. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  531. package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
  532. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  534. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  536. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
  537. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  538. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +6 -6
  539. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  540. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  541. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +8 -8
  542. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  543. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  544. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  546. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
  547. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  548. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +6 -6
  549. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  550. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  551. package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
  552. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  553. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  554. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  556. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
  557. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  558. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +6 -6
  559. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  560. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  561. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  562. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  563. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  564. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  565. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  566. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  567. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +6 -6
  568. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  569. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  570. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  571. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  573. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  574. package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
  575. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  576. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  577. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  578. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  579. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
  580. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  581. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +6 -6
  582. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  583. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  584. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
  585. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +1 -1
  586. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  587. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  588. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  589. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
  590. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  591. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +6 -6
  592. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  593. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  594. package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
  595. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  596. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  597. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  598. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  599. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
  600. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  601. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +6 -6
  602. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  603. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  604. package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
  605. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  606. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  607. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  608. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  609. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
  610. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  611. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +6 -6
  612. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  613. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  614. package/app/.next-cli-build/server/app/dashboard.rsc +9 -9
  615. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  616. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  617. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  618. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +9 -9
  619. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  620. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +6 -6
  621. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  622. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  623. package/app/.next-cli-build/server/app/index.html +1 -1
  624. package/app/.next-cli-build/server/app/index.rsc +6 -6
  625. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  626. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  627. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  628. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +6 -6
  629. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  630. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  631. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  632. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  633. package/app/.next-cli-build/server/app/landing.html +1 -1
  634. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  635. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  636. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  637. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +6 -6
  638. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  639. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  640. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  641. package/app/.next-cli-build/server/app/login/page.js +1 -1
  642. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  643. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  644. package/app/.next-cli-build/server/app/login.html +1 -1
  645. package/app/.next-cli-build/server/app/login.rsc +7 -7
  646. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  647. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  648. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +6 -6
  649. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  650. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  651. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  652. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  653. package/app/.next-cli-build/server/app/page.js +1 -1
  654. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  655. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  656. package/app/.next-cli-build/server/app-paths-manifest.json +11 -11
  657. package/app/.next-cli-build/server/chunks/2338.js +12 -12
  658. package/app/.next-cli-build/server/chunks/3110.js +1 -1
  659. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  660. package/app/.next-cli-build/server/chunks/4803.js +1 -1
  661. package/app/.next-cli-build/server/chunks/5852.js +1 -1
  662. package/app/.next-cli-build/server/chunks/6311.js +64 -0
  663. package/app/.next-cli-build/server/chunks/6328.js +1 -1
  664. package/app/.next-cli-build/server/chunks/700.js +1 -1
  665. package/app/.next-cli-build/server/chunks/7774.js +15 -15
  666. package/app/.next-cli-build/server/chunks/7965.js +1 -1
  667. package/app/.next-cli-build/server/chunks/8520.js +1 -1
  668. package/app/.next-cli-build/server/chunks/8895.js +1 -1
  669. package/app/.next-cli-build/server/chunks/9434.js +1 -1
  670. package/app/.next-cli-build/server/instrumentation.js +1 -1
  671. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  672. package/app/.next-cli-build/server/middleware.js +1 -1
  673. package/app/.next-cli-build/server/pages/404.html +1 -1
  674. package/app/.next-cli-build/server/pages/500.html +1 -1
  675. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  676. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  677. package/app/.next-cli-build/static/chunks/1a258343-1aa1820b9db68d51.js +1 -0
  678. package/app/.next-cli-build/static/chunks/{3794-e569667691edc8f7.js → 3794-c66b3d8325973459.js} +1 -1
  679. package/app/.next-cli-build/static/chunks/4546-4583313eeecaf077.js +64 -0
  680. package/app/.next-cli-build/static/chunks/{5263-17798e99cdafe50b.js → 5263-2b0cc34bbd67f65c.js} +1 -1
  681. package/app/.next-cli-build/static/chunks/{5497-c2d72bb72949ba15.js → 5497-4606a18266b8c632.js} +1 -1
  682. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/analytics/page-6bd62c37019ccc73.js +1 -0
  683. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/{page-ab5d688db6e32f62.js → page-51c6597458141664.js} +1 -1
  684. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-2558d7355357c608.js → page-0a77cb24c31eab31.js} +1 -1
  685. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-c0231e9486c2237d.js → page-3c45d7965e695b4e.js} +1 -1
  686. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-b2e2b7765d39da7a.js → page-2073cc7c324f2927.js} +1 -1
  687. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-a30dfa93b2d6ac90.js → page-88776e0540bc6caa.js} +1 -1
  688. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-03f35e824699a220.js → page-8258e0c2b7d00532.js} +1 -1
  689. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/{page-d03884f048a5a7c8.js → page-50e2d958c7514352.js} +1 -1
  690. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-89e3dfd1a0bfec87.js → page-d4eef04e38a1c920.js} +1 -1
  691. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-3bc7d22940bf015c.js → page-4a342a849f926efb.js} +1 -1
  692. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-224e01693a3cfaf1.js → page-81241b2ec53c6dac.js} +1 -1
  693. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-905212b2d7ed648e.js → page-b99de5582f2f7f87.js} +1 -1
  694. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-6de007eb2a59ca30.js → page-7955be4ef5b827d6.js} +1 -1
  695. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/{page-d03884f048a5a7c8.js → page-50e2d958c7514352.js} +1 -1
  696. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/{page-f9f3417fa83792d5.js → page-e3b94266bfc673d3.js} +1 -1
  697. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovidermonitor/{page-5ae6e44af9624f4e.js → page-f94d7da8afcc3542.js} +1 -1
  698. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-7e3819b380bd747e.js → page-47c2dd8f75544632.js} +1 -1
  699. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-0da77a157acefc7c.js → page-7c978d638cf25edd.js} +1 -1
  700. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-7b69e5101ad4864f.js → page-73e4562a8248af00.js} +1 -1
  701. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-80e7e47c3dfa4070.js → page-ab3b656faf565d92.js} +1 -1
  702. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-fa9e9680d235e2d8.js → page-53d81795dbcc226d.js} +1 -1
  703. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-33c6b65a7848eb94.js → page-ba5ad266df727471.js} +1 -1
  704. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-1002addd547b6453.js → page-fc7b93e145b1ff16.js} +1 -1
  705. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-c734cfa89fa60ee8.js → page-f02c40e946c83bc6.js} +1 -1
  706. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-5247f67b1fd67c5b.js → layout-ba91fa40d4a5ecd4.js} +1 -1
  707. package/app/.next-cli-build/static/chunks/{main-eb1b86e4183e86c5.js → main-52cce31a84751ecc.js} +1 -1
  708. package/app/.next-cli-build/static/css/d8559bfc25347903.css +1 -0
  709. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.54-to-5.0.55-5.0.55-20260701-132037 → upgrade-5.0.82-to-5.0.83-5.0.83-20260702-203556}/data.sqlite +0 -0
  710. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.55-to-5.0.56-5.0.56-20260701-132316 → upgrade-5.0.83-to-5.0.84-5.0.84-20260705-084618}/data.sqlite +0 -0
  711. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.56-to-5.0.57-5.0.57-20260701-134156 → upgrade-5.0.84-to-5.0.85-5.0.85-20260705-235313}/data.sqlite +0 -0
  712. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.0.57-to-5.0.58-5.0.58-20260701-140042 → upgrade-5.0.85-to-5.0.87-5.0.87-20260707-115428}/data.sqlite +0 -0
  713. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-5.0.87-to-5.0.88-5.0.88-20260707-121528/data.sqlite +0 -0
  714. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite +0 -0
  715. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
  716. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
  717. package/app/cli/.build-home/AppData/Roaming/bluerouter/jwt-secret +1 -1
  718. package/app/cli/.build-home/AppData/Roaming/bluerouter/machine-id +1 -1
  719. package/app/cli/.build-home/AppData/Roaming/nextjs-nodejs/Config/config.json +3 -3
  720. package/app/node_modules/@next/env/package.json +7 -8
  721. package/app/node_modules/baseline-browser-mapping/dist/index.cjs +1 -1
  722. package/app/node_modules/baseline-browser-mapping/package.json +3 -3
  723. package/app/node_modules/caniuse-lite/data/agents.js +1 -1
  724. package/app/node_modules/caniuse-lite/data/browserVersions.js +1 -1
  725. package/app/node_modules/caniuse-lite/data/features/aac.js +1 -1
  726. package/app/node_modules/caniuse-lite/data/features/abortcontroller.js +1 -1
  727. package/app/node_modules/caniuse-lite/data/features/ac3-ec3.js +1 -1
  728. package/app/node_modules/caniuse-lite/data/features/accelerometer.js +1 -1
  729. package/app/node_modules/caniuse-lite/data/features/addeventlistener.js +1 -1
  730. package/app/node_modules/caniuse-lite/data/features/alternate-stylesheet.js +1 -1
  731. package/app/node_modules/caniuse-lite/data/features/ambient-light.js +1 -1
  732. package/app/node_modules/caniuse-lite/data/features/apng.js +1 -1
  733. package/app/node_modules/caniuse-lite/data/features/array-find-index.js +1 -1
  734. package/app/node_modules/caniuse-lite/data/features/array-find.js +1 -1
  735. package/app/node_modules/caniuse-lite/data/features/array-flat.js +1 -1
  736. package/app/node_modules/caniuse-lite/data/features/array-includes.js +1 -1
  737. package/app/node_modules/caniuse-lite/data/features/arrow-functions.js +1 -1
  738. package/app/node_modules/caniuse-lite/data/features/asmjs.js +1 -1
  739. package/app/node_modules/caniuse-lite/data/features/async-clipboard.js +1 -1
  740. package/app/node_modules/caniuse-lite/data/features/async-functions.js +1 -1
  741. package/app/node_modules/caniuse-lite/data/features/atob-btoa.js +1 -1
  742. package/app/node_modules/caniuse-lite/data/features/audio-api.js +1 -1
  743. package/app/node_modules/caniuse-lite/data/features/audio.js +1 -1
  744. package/app/node_modules/caniuse-lite/data/features/audiotracks.js +1 -1
  745. package/app/node_modules/caniuse-lite/data/features/autofocus.js +1 -1
  746. package/app/node_modules/caniuse-lite/data/features/auxclick.js +1 -1
  747. package/app/node_modules/caniuse-lite/data/features/av1.js +1 -1
  748. package/app/node_modules/caniuse-lite/data/features/avif.js +1 -1
  749. package/app/node_modules/caniuse-lite/data/features/background-attachment.js +1 -1
  750. package/app/node_modules/caniuse-lite/data/features/background-clip-text.js +1 -1
  751. package/app/node_modules/caniuse-lite/data/features/background-img-opts.js +1 -1
  752. package/app/node_modules/caniuse-lite/data/features/background-position-x-y.js +1 -1
  753. package/app/node_modules/caniuse-lite/data/features/background-repeat-round-space.js +1 -1
  754. package/app/node_modules/caniuse-lite/data/features/background-sync.js +1 -1
  755. package/app/node_modules/caniuse-lite/data/features/battery-status.js +1 -1
  756. package/app/node_modules/caniuse-lite/data/features/beacon.js +1 -1
  757. package/app/node_modules/caniuse-lite/data/features/beforeafterprint.js +1 -1
  758. package/app/node_modules/caniuse-lite/data/features/bigint.js +1 -1
  759. package/app/node_modules/caniuse-lite/data/features/blobbuilder.js +1 -1
  760. package/app/node_modules/caniuse-lite/data/features/bloburls.js +1 -1
  761. package/app/node_modules/caniuse-lite/data/features/border-image.js +1 -1
  762. package/app/node_modules/caniuse-lite/data/features/border-radius.js +1 -1
  763. package/app/node_modules/caniuse-lite/data/features/broadcastchannel.js +1 -1
  764. package/app/node_modules/caniuse-lite/data/features/brotli.js +1 -1
  765. package/app/node_modules/caniuse-lite/data/features/calc.js +1 -1
  766. package/app/node_modules/caniuse-lite/data/features/canvas-blending.js +1 -1
  767. package/app/node_modules/caniuse-lite/data/features/canvas-text.js +1 -1
  768. package/app/node_modules/caniuse-lite/data/features/canvas.js +1 -1
  769. package/app/node_modules/caniuse-lite/data/features/ch-unit.js +1 -1
  770. package/app/node_modules/caniuse-lite/data/features/chacha20-poly1305.js +1 -1
  771. package/app/node_modules/caniuse-lite/data/features/channel-messaging.js +1 -1
  772. package/app/node_modules/caniuse-lite/data/features/childnode-remove.js +1 -1
  773. package/app/node_modules/caniuse-lite/data/features/classlist.js +1 -1
  774. package/app/node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js +1 -1
  775. package/app/node_modules/caniuse-lite/data/features/clipboard.js +1 -1
  776. package/app/node_modules/caniuse-lite/data/features/colr-v1.js +1 -1
  777. package/app/node_modules/caniuse-lite/data/features/colr.js +1 -1
  778. package/app/node_modules/caniuse-lite/data/features/comparedocumentposition.js +1 -1
  779. package/app/node_modules/caniuse-lite/data/features/console-basic.js +1 -1
  780. package/app/node_modules/caniuse-lite/data/features/console-time.js +1 -1
  781. package/app/node_modules/caniuse-lite/data/features/const.js +1 -1
  782. package/app/node_modules/caniuse-lite/data/features/constraint-validation.js +1 -1
  783. package/app/node_modules/caniuse-lite/data/features/contenteditable.js +1 -1
  784. package/app/node_modules/caniuse-lite/data/features/contentsecuritypolicy.js +1 -1
  785. package/app/node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js +1 -1
  786. package/app/node_modules/caniuse-lite/data/features/cookie-store-api.js +1 -1
  787. package/app/node_modules/caniuse-lite/data/features/cors.js +1 -1
  788. package/app/node_modules/caniuse-lite/data/features/createimagebitmap.js +1 -1
  789. package/app/node_modules/caniuse-lite/data/features/credential-management.js +1 -1
  790. package/app/node_modules/caniuse-lite/data/features/cross-document-view-transitions.js +1 -1
  791. package/app/node_modules/caniuse-lite/data/features/cryptography.js +1 -1
  792. package/app/node_modules/caniuse-lite/data/features/css-all.js +1 -1
  793. package/app/node_modules/caniuse-lite/data/features/css-anchor-positioning.js +1 -1
  794. package/app/node_modules/caniuse-lite/data/features/css-animation.js +1 -1
  795. package/app/node_modules/caniuse-lite/data/features/css-any-link.js +1 -1
  796. package/app/node_modules/caniuse-lite/data/features/css-appearance.js +1 -1
  797. package/app/node_modules/caniuse-lite/data/features/css-at-counter-style.js +1 -1
  798. package/app/node_modules/caniuse-lite/data/features/css-autofill.js +1 -1
  799. package/app/node_modules/caniuse-lite/data/features/css-backdrop-filter.js +1 -1
  800. package/app/node_modules/caniuse-lite/data/features/css-background-offsets.js +1 -1
  801. package/app/node_modules/caniuse-lite/data/features/css-backgroundblendmode.js +1 -1
  802. package/app/node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js +1 -1
  803. package/app/node_modules/caniuse-lite/data/features/css-boxshadow.js +1 -1
  804. package/app/node_modules/caniuse-lite/data/features/css-canvas.js +1 -1
  805. package/app/node_modules/caniuse-lite/data/features/css-caret-color.js +1 -1
  806. package/app/node_modules/caniuse-lite/data/features/css-cascade-layers.js +1 -1
  807. package/app/node_modules/caniuse-lite/data/features/css-cascade-scope.js +1 -1
  808. package/app/node_modules/caniuse-lite/data/features/css-case-insensitive.js +1 -1
  809. package/app/node_modules/caniuse-lite/data/features/css-clip-path.js +1 -1
  810. package/app/node_modules/caniuse-lite/data/features/css-color-adjust.js +1 -1
  811. package/app/node_modules/caniuse-lite/data/features/css-color-function.js +1 -1
  812. package/app/node_modules/caniuse-lite/data/features/css-conic-gradients.js +1 -1
  813. package/app/node_modules/caniuse-lite/data/features/css-container-queries-style.js +1 -1
  814. package/app/node_modules/caniuse-lite/data/features/css-container-queries.js +1 -1
  815. package/app/node_modules/caniuse-lite/data/features/css-container-query-units.js +1 -1
  816. package/app/node_modules/caniuse-lite/data/features/css-containment.js +1 -1
  817. package/app/node_modules/caniuse-lite/data/features/css-content-visibility.js +1 -1
  818. package/app/node_modules/caniuse-lite/data/features/css-counters.js +1 -1
  819. package/app/node_modules/caniuse-lite/data/features/css-crisp-edges.js +1 -1
  820. package/app/node_modules/caniuse-lite/data/features/css-cross-fade.js +1 -1
  821. package/app/node_modules/caniuse-lite/data/features/css-default-pseudo.js +1 -1
  822. package/app/node_modules/caniuse-lite/data/features/css-descendant-gtgt.js +1 -1
  823. package/app/node_modules/caniuse-lite/data/features/css-deviceadaptation.js +1 -1
  824. package/app/node_modules/caniuse-lite/data/features/css-dir-pseudo.js +1 -1
  825. package/app/node_modules/caniuse-lite/data/features/css-display-contents.js +1 -1
  826. package/app/node_modules/caniuse-lite/data/features/css-element-function.js +1 -1
  827. package/app/node_modules/caniuse-lite/data/features/css-env-function.js +1 -1
  828. package/app/node_modules/caniuse-lite/data/features/css-exclusions.js +1 -1
  829. package/app/node_modules/caniuse-lite/data/features/css-featurequeries.js +1 -1
  830. package/app/node_modules/caniuse-lite/data/features/css-file-selector-button.js +1 -1
  831. package/app/node_modules/caniuse-lite/data/features/css-filter-function.js +1 -1
  832. package/app/node_modules/caniuse-lite/data/features/css-filters.js +1 -1
  833. package/app/node_modules/caniuse-lite/data/features/css-first-letter.js +1 -1
  834. package/app/node_modules/caniuse-lite/data/features/css-first-line.js +1 -1
  835. package/app/node_modules/caniuse-lite/data/features/css-fixed.js +1 -1
  836. package/app/node_modules/caniuse-lite/data/features/css-focus-visible.js +1 -1
  837. package/app/node_modules/caniuse-lite/data/features/css-focus-within.js +1 -1
  838. package/app/node_modules/caniuse-lite/data/features/css-font-palette.js +1 -1
  839. package/app/node_modules/caniuse-lite/data/features/css-font-rendering-controls.js +1 -1
  840. package/app/node_modules/caniuse-lite/data/features/css-font-stretch.js +1 -1
  841. package/app/node_modules/caniuse-lite/data/features/css-gencontent.js +1 -1
  842. package/app/node_modules/caniuse-lite/data/features/css-gradients.js +1 -1
  843. package/app/node_modules/caniuse-lite/data/features/css-grid-animation.js +1 -1
  844. package/app/node_modules/caniuse-lite/data/features/css-grid-lanes.js +1 -1
  845. package/app/node_modules/caniuse-lite/data/features/css-grid.js +1 -1
  846. package/app/node_modules/caniuse-lite/data/features/css-hanging-punctuation.js +1 -1
  847. package/app/node_modules/caniuse-lite/data/features/css-has.js +1 -1
  848. package/app/node_modules/caniuse-lite/data/features/css-hyphens.js +1 -1
  849. package/app/node_modules/caniuse-lite/data/features/css-if.js +1 -1
  850. package/app/node_modules/caniuse-lite/data/features/css-image-orientation.js +1 -1
  851. package/app/node_modules/caniuse-lite/data/features/css-image-set.js +1 -1
  852. package/app/node_modules/caniuse-lite/data/features/css-in-out-of-range.js +1 -1
  853. package/app/node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js +1 -1
  854. package/app/node_modules/caniuse-lite/data/features/css-initial-letter.js +1 -1
  855. package/app/node_modules/caniuse-lite/data/features/css-initial-value.js +1 -1
  856. package/app/node_modules/caniuse-lite/data/features/css-lch-lab.js +1 -1
  857. package/app/node_modules/caniuse-lite/data/features/css-letter-spacing.js +1 -1
  858. package/app/node_modules/caniuse-lite/data/features/css-line-clamp.js +1 -1
  859. package/app/node_modules/caniuse-lite/data/features/css-logical-props.js +1 -1
  860. package/app/node_modules/caniuse-lite/data/features/css-marker-pseudo.js +1 -1
  861. package/app/node_modules/caniuse-lite/data/features/css-masks.js +1 -1
  862. package/app/node_modules/caniuse-lite/data/features/css-matches-pseudo.js +1 -1
  863. package/app/node_modules/caniuse-lite/data/features/css-math-functions.js +1 -1
  864. package/app/node_modules/caniuse-lite/data/features/css-media-interaction.js +1 -1
  865. package/app/node_modules/caniuse-lite/data/features/css-media-range-syntax.js +1 -1
  866. package/app/node_modules/caniuse-lite/data/features/css-media-resolution.js +1 -1
  867. package/app/node_modules/caniuse-lite/data/features/css-media-scripting.js +1 -1
  868. package/app/node_modules/caniuse-lite/data/features/css-mediaqueries.js +1 -1
  869. package/app/node_modules/caniuse-lite/data/features/css-mixblendmode.js +1 -1
  870. package/app/node_modules/caniuse-lite/data/features/css-module-scripts.js +1 -1
  871. package/app/node_modules/caniuse-lite/data/features/css-motion-paths.js +1 -1
  872. package/app/node_modules/caniuse-lite/data/features/css-namespaces.js +1 -1
  873. package/app/node_modules/caniuse-lite/data/features/css-nesting.js +1 -1
  874. package/app/node_modules/caniuse-lite/data/features/css-not-sel-list.js +1 -1
  875. package/app/node_modules/caniuse-lite/data/features/css-nth-child-of.js +1 -1
  876. package/app/node_modules/caniuse-lite/data/features/css-opacity.js +1 -1
  877. package/app/node_modules/caniuse-lite/data/features/css-optional-pseudo.js +1 -1
  878. package/app/node_modules/caniuse-lite/data/features/css-overflow-anchor.js +1 -1
  879. package/app/node_modules/caniuse-lite/data/features/css-overflow-overlay.js +1 -1
  880. package/app/node_modules/caniuse-lite/data/features/css-overflow.js +1 -1
  881. package/app/node_modules/caniuse-lite/data/features/css-overscroll-behavior.js +1 -1
  882. package/app/node_modules/caniuse-lite/data/features/css-page-break.js +1 -1
  883. package/app/node_modules/caniuse-lite/data/features/css-paged-media.js +1 -1
  884. package/app/node_modules/caniuse-lite/data/features/css-paint-api.js +1 -1
  885. package/app/node_modules/caniuse-lite/data/features/css-placeholder-shown.js +1 -1
  886. package/app/node_modules/caniuse-lite/data/features/css-placeholder.js +1 -1
  887. package/app/node_modules/caniuse-lite/data/features/css-print-color-adjust.js +1 -1
  888. package/app/node_modules/caniuse-lite/data/features/css-read-only-write.js +1 -1
  889. package/app/node_modules/caniuse-lite/data/features/css-rebeccapurple.js +1 -1
  890. package/app/node_modules/caniuse-lite/data/features/css-reflections.js +1 -1
  891. package/app/node_modules/caniuse-lite/data/features/css-regions.js +1 -1
  892. package/app/node_modules/caniuse-lite/data/features/css-relative-colors.js +1 -1
  893. package/app/node_modules/caniuse-lite/data/features/css-repeating-gradients.js +1 -1
  894. package/app/node_modules/caniuse-lite/data/features/css-resize.js +1 -1
  895. package/app/node_modules/caniuse-lite/data/features/css-revert-value.js +1 -1
  896. package/app/node_modules/caniuse-lite/data/features/css-rrggbbaa.js +1 -1
  897. package/app/node_modules/caniuse-lite/data/features/css-scroll-behavior.js +1 -1
  898. package/app/node_modules/caniuse-lite/data/features/css-scrollbar.js +1 -1
  899. package/app/node_modules/caniuse-lite/data/features/css-sel2.js +1 -1
  900. package/app/node_modules/caniuse-lite/data/features/css-sel3.js +1 -1
  901. package/app/node_modules/caniuse-lite/data/features/css-selection.js +1 -1
  902. package/app/node_modules/caniuse-lite/data/features/css-shapes.js +1 -1
  903. package/app/node_modules/caniuse-lite/data/features/css-snappoints.js +1 -1
  904. package/app/node_modules/caniuse-lite/data/features/css-sticky.js +1 -1
  905. package/app/node_modules/caniuse-lite/data/features/css-subgrid.js +1 -1
  906. package/app/node_modules/caniuse-lite/data/features/css-supports-api.js +1 -1
  907. package/app/node_modules/caniuse-lite/data/features/css-table.js +1 -1
  908. package/app/node_modules/caniuse-lite/data/features/css-text-align-last.js +1 -1
  909. package/app/node_modules/caniuse-lite/data/features/css-text-box-trim.js +1 -1
  910. package/app/node_modules/caniuse-lite/data/features/css-text-indent.js +1 -1
  911. package/app/node_modules/caniuse-lite/data/features/css-text-justify.js +1 -1
  912. package/app/node_modules/caniuse-lite/data/features/css-text-orientation.js +1 -1
  913. package/app/node_modules/caniuse-lite/data/features/css-text-spacing.js +1 -1
  914. package/app/node_modules/caniuse-lite/data/features/css-text-wrap-balance.js +1 -1
  915. package/app/node_modules/caniuse-lite/data/features/css-textshadow.js +1 -1
  916. package/app/node_modules/caniuse-lite/data/features/css-touch-action.js +1 -1
  917. package/app/node_modules/caniuse-lite/data/features/css-transitions.js +1 -1
  918. package/app/node_modules/caniuse-lite/data/features/css-unicode-bidi.js +1 -1
  919. package/app/node_modules/caniuse-lite/data/features/css-unset-value.js +1 -1
  920. package/app/node_modules/caniuse-lite/data/features/css-variables.js +1 -1
  921. package/app/node_modules/caniuse-lite/data/features/css-when-else.js +1 -1
  922. package/app/node_modules/caniuse-lite/data/features/css-widows-orphans.js +1 -1
  923. package/app/node_modules/caniuse-lite/data/features/css-width-stretch.js +1 -1
  924. package/app/node_modules/caniuse-lite/data/features/css-writing-mode.js +1 -1
  925. package/app/node_modules/caniuse-lite/data/features/css-zoom.js +1 -1
  926. package/app/node_modules/caniuse-lite/data/features/css3-attr.js +1 -1
  927. package/app/node_modules/caniuse-lite/data/features/css3-boxsizing.js +1 -1
  928. package/app/node_modules/caniuse-lite/data/features/css3-colors.js +1 -1
  929. package/app/node_modules/caniuse-lite/data/features/css3-cursors-grab.js +1 -1
  930. package/app/node_modules/caniuse-lite/data/features/css3-cursors-newer.js +1 -1
  931. package/app/node_modules/caniuse-lite/data/features/css3-cursors.js +1 -1
  932. package/app/node_modules/caniuse-lite/data/features/css3-tabsize.js +1 -1
  933. package/app/node_modules/caniuse-lite/data/features/currentcolor.js +1 -1
  934. package/app/node_modules/caniuse-lite/data/features/custom-elements.js +1 -1
  935. package/app/node_modules/caniuse-lite/data/features/custom-elementsv1.js +1 -1
  936. package/app/node_modules/caniuse-lite/data/features/customevent.js +1 -1
  937. package/app/node_modules/caniuse-lite/data/features/customizable-select.js +1 -1
  938. package/app/node_modules/caniuse-lite/data/features/datalist.js +1 -1
  939. package/app/node_modules/caniuse-lite/data/features/dataset.js +1 -1
  940. package/app/node_modules/caniuse-lite/data/features/datauri.js +1 -1
  941. package/app/node_modules/caniuse-lite/data/features/date-tolocaledatestring.js +1 -1
  942. package/app/node_modules/caniuse-lite/data/features/declarative-shadow-dom.js +1 -1
  943. package/app/node_modules/caniuse-lite/data/features/decorators.js +1 -1
  944. package/app/node_modules/caniuse-lite/data/features/details.js +1 -1
  945. package/app/node_modules/caniuse-lite/data/features/deviceorientation.js +1 -1
  946. package/app/node_modules/caniuse-lite/data/features/devicepixelratio.js +1 -1
  947. package/app/node_modules/caniuse-lite/data/features/dialog.js +1 -1
  948. package/app/node_modules/caniuse-lite/data/features/dispatchevent.js +1 -1
  949. package/app/node_modules/caniuse-lite/data/features/dnssec.js +1 -1
  950. package/app/node_modules/caniuse-lite/data/features/do-not-track.js +1 -1
  951. package/app/node_modules/caniuse-lite/data/features/document-currentscript.js +1 -1
  952. package/app/node_modules/caniuse-lite/data/features/document-evaluate-xpath.js +1 -1
  953. package/app/node_modules/caniuse-lite/data/features/document-execcommand.js +1 -1
  954. package/app/node_modules/caniuse-lite/data/features/document-policy.js +1 -1
  955. package/app/node_modules/caniuse-lite/data/features/document-scrollingelement.js +1 -1
  956. package/app/node_modules/caniuse-lite/data/features/documenthead.js +1 -1
  957. package/app/node_modules/caniuse-lite/data/features/dom-manip-convenience.js +1 -1
  958. package/app/node_modules/caniuse-lite/data/features/dom-range.js +1 -1
  959. package/app/node_modules/caniuse-lite/data/features/domcontentloaded.js +1 -1
  960. package/app/node_modules/caniuse-lite/data/features/dommatrix.js +1 -1
  961. package/app/node_modules/caniuse-lite/data/features/download.js +1 -1
  962. package/app/node_modules/caniuse-lite/data/features/dragndrop.js +1 -1
  963. package/app/node_modules/caniuse-lite/data/features/element-closest.js +1 -1
  964. package/app/node_modules/caniuse-lite/data/features/element-from-point.js +1 -1
  965. package/app/node_modules/caniuse-lite/data/features/element-scroll-methods.js +1 -1
  966. package/app/node_modules/caniuse-lite/data/features/eme.js +1 -1
  967. package/app/node_modules/caniuse-lite/data/features/eot.js +1 -1
  968. package/app/node_modules/caniuse-lite/data/features/es5.js +1 -1
  969. package/app/node_modules/caniuse-lite/data/features/es6-class.js +1 -1
  970. package/app/node_modules/caniuse-lite/data/features/es6-generators.js +1 -1
  971. package/app/node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js +1 -1
  972. package/app/node_modules/caniuse-lite/data/features/es6-module.js +1 -1
  973. package/app/node_modules/caniuse-lite/data/features/es6-number.js +1 -1
  974. package/app/node_modules/caniuse-lite/data/features/es6-string-includes.js +1 -1
  975. package/app/node_modules/caniuse-lite/data/features/es6.js +1 -1
  976. package/app/node_modules/caniuse-lite/data/features/eventsource.js +1 -1
  977. package/app/node_modules/caniuse-lite/data/features/extended-system-fonts.js +1 -1
  978. package/app/node_modules/caniuse-lite/data/features/feature-policy.js +1 -1
  979. package/app/node_modules/caniuse-lite/data/features/fetch.js +1 -1
  980. package/app/node_modules/caniuse-lite/data/features/fieldset-disabled.js +1 -1
  981. package/app/node_modules/caniuse-lite/data/features/fileapi.js +1 -1
  982. package/app/node_modules/caniuse-lite/data/features/filereader.js +1 -1
  983. package/app/node_modules/caniuse-lite/data/features/filereadersync.js +1 -1
  984. package/app/node_modules/caniuse-lite/data/features/filesystem.js +1 -1
  985. package/app/node_modules/caniuse-lite/data/features/flac.js +1 -1
  986. package/app/node_modules/caniuse-lite/data/features/flexbox-gap.js +1 -1
  987. package/app/node_modules/caniuse-lite/data/features/flexbox.js +1 -1
  988. package/app/node_modules/caniuse-lite/data/features/flow-root.js +1 -1
  989. package/app/node_modules/caniuse-lite/data/features/focusin-focusout-events.js +1 -1
  990. package/app/node_modules/caniuse-lite/data/features/font-family-system-ui.js +1 -1
  991. package/app/node_modules/caniuse-lite/data/features/font-feature.js +1 -1
  992. package/app/node_modules/caniuse-lite/data/features/font-kerning.js +1 -1
  993. package/app/node_modules/caniuse-lite/data/features/font-loading.js +1 -1
  994. package/app/node_modules/caniuse-lite/data/features/font-size-adjust.js +1 -1
  995. package/app/node_modules/caniuse-lite/data/features/font-smooth.js +1 -1
  996. package/app/node_modules/caniuse-lite/data/features/font-unicode-range.js +1 -1
  997. package/app/node_modules/caniuse-lite/data/features/font-variant-alternates.js +1 -1
  998. package/app/node_modules/caniuse-lite/data/features/font-variant-numeric.js +1 -1
  999. package/app/node_modules/caniuse-lite/data/features/fontface.js +1 -1
  1000. package/app/node_modules/caniuse-lite/data/features/form-attribute.js +1 -1
  1001. package/app/node_modules/caniuse-lite/data/features/form-submit-attributes.js +1 -1
  1002. package/app/node_modules/caniuse-lite/data/features/form-validation.js +1 -1
  1003. package/app/node_modules/caniuse-lite/data/features/forms.js +1 -1
  1004. package/app/node_modules/caniuse-lite/data/features/fullscreen.js +1 -1
  1005. package/app/node_modules/caniuse-lite/data/features/gamepad.js +1 -1
  1006. package/app/node_modules/caniuse-lite/data/features/geolocation.js +1 -1
  1007. package/app/node_modules/caniuse-lite/data/features/getboundingclientrect.js +1 -1
  1008. package/app/node_modules/caniuse-lite/data/features/getcomputedstyle.js +1 -1
  1009. package/app/node_modules/caniuse-lite/data/features/getelementsbyclassname.js +1 -1
  1010. package/app/node_modules/caniuse-lite/data/features/getrandomvalues.js +1 -1
  1011. package/app/node_modules/caniuse-lite/data/features/gyroscope.js +1 -1
  1012. package/app/node_modules/caniuse-lite/data/features/hardwareconcurrency.js +1 -1
  1013. package/app/node_modules/caniuse-lite/data/features/hashchange.js +1 -1
  1014. package/app/node_modules/caniuse-lite/data/features/heif.js +1 -1
  1015. package/app/node_modules/caniuse-lite/data/features/hevc.js +1 -1
  1016. package/app/node_modules/caniuse-lite/data/features/hidden.js +1 -1
  1017. package/app/node_modules/caniuse-lite/data/features/high-resolution-time.js +1 -1
  1018. package/app/node_modules/caniuse-lite/data/features/history.js +1 -1
  1019. package/app/node_modules/caniuse-lite/data/features/html-media-capture.js +1 -1
  1020. package/app/node_modules/caniuse-lite/data/features/html5semantic.js +1 -1
  1021. package/app/node_modules/caniuse-lite/data/features/http-live-streaming.js +1 -1
  1022. package/app/node_modules/caniuse-lite/data/features/http2.js +1 -1
  1023. package/app/node_modules/caniuse-lite/data/features/http3.js +1 -1
  1024. package/app/node_modules/caniuse-lite/data/features/iframe-sandbox.js +1 -1
  1025. package/app/node_modules/caniuse-lite/data/features/iframe-seamless.js +1 -1
  1026. package/app/node_modules/caniuse-lite/data/features/iframe-srcdoc.js +1 -1
  1027. package/app/node_modules/caniuse-lite/data/features/imagecapture.js +1 -1
  1028. package/app/node_modules/caniuse-lite/data/features/ime.js +1 -1
  1029. package/app/node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js +1 -1
  1030. package/app/node_modules/caniuse-lite/data/features/import-maps.js +1 -1
  1031. package/app/node_modules/caniuse-lite/data/features/imports.js +1 -1
  1032. package/app/node_modules/caniuse-lite/data/features/indeterminate-checkbox.js +1 -1
  1033. package/app/node_modules/caniuse-lite/data/features/indexeddb.js +1 -1
  1034. package/app/node_modules/caniuse-lite/data/features/indexeddb2.js +1 -1
  1035. package/app/node_modules/caniuse-lite/data/features/inline-block.js +1 -1
  1036. package/app/node_modules/caniuse-lite/data/features/innertext.js +1 -1
  1037. package/app/node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js +1 -1
  1038. package/app/node_modules/caniuse-lite/data/features/input-color.js +1 -1
  1039. package/app/node_modules/caniuse-lite/data/features/input-datetime.js +1 -1
  1040. package/app/node_modules/caniuse-lite/data/features/input-email-tel-url.js +1 -1
  1041. package/app/node_modules/caniuse-lite/data/features/input-event.js +1 -1
  1042. package/app/node_modules/caniuse-lite/data/features/input-file-accept.js +1 -1
  1043. package/app/node_modules/caniuse-lite/data/features/input-file-directory.js +1 -1
  1044. package/app/node_modules/caniuse-lite/data/features/input-file-multiple.js +1 -1
  1045. package/app/node_modules/caniuse-lite/data/features/input-inputmode.js +1 -1
  1046. package/app/node_modules/caniuse-lite/data/features/input-minlength.js +1 -1
  1047. package/app/node_modules/caniuse-lite/data/features/input-number.js +1 -1
  1048. package/app/node_modules/caniuse-lite/data/features/input-pattern.js +1 -1
  1049. package/app/node_modules/caniuse-lite/data/features/input-placeholder.js +1 -1
  1050. package/app/node_modules/caniuse-lite/data/features/input-range.js +1 -1
  1051. package/app/node_modules/caniuse-lite/data/features/input-search.js +1 -1
  1052. package/app/node_modules/caniuse-lite/data/features/input-selection.js +1 -1
  1053. package/app/node_modules/caniuse-lite/data/features/insert-adjacent.js +1 -1
  1054. package/app/node_modules/caniuse-lite/data/features/insertadjacenthtml.js +1 -1
  1055. package/app/node_modules/caniuse-lite/data/features/internationalization.js +1 -1
  1056. package/app/node_modules/caniuse-lite/data/features/intersectionobserver-v2.js +1 -1
  1057. package/app/node_modules/caniuse-lite/data/features/intersectionobserver.js +1 -1
  1058. package/app/node_modules/caniuse-lite/data/features/intl-pluralrules.js +1 -1
  1059. package/app/node_modules/caniuse-lite/data/features/intrinsic-width.js +1 -1
  1060. package/app/node_modules/caniuse-lite/data/features/jpeg2000.js +1 -1
  1061. package/app/node_modules/caniuse-lite/data/features/jpegxl.js +1 -1
  1062. package/app/node_modules/caniuse-lite/data/features/jpegxr.js +1 -1
  1063. package/app/node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js +1 -1
  1064. package/app/node_modules/caniuse-lite/data/features/json.js +1 -1
  1065. package/app/node_modules/caniuse-lite/data/features/justify-content-space-evenly.js +1 -1
  1066. package/app/node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js +1 -1
  1067. package/app/node_modules/caniuse-lite/data/features/keyboardevent-charcode.js +1 -1
  1068. package/app/node_modules/caniuse-lite/data/features/keyboardevent-code.js +1 -1
  1069. package/app/node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js +1 -1
  1070. package/app/node_modules/caniuse-lite/data/features/keyboardevent-key.js +1 -1
  1071. package/app/node_modules/caniuse-lite/data/features/keyboardevent-location.js +1 -1
  1072. package/app/node_modules/caniuse-lite/data/features/keyboardevent-which.js +1 -1
  1073. package/app/node_modules/caniuse-lite/data/features/lazyload.js +1 -1
  1074. package/app/node_modules/caniuse-lite/data/features/let.js +1 -1
  1075. package/app/node_modules/caniuse-lite/data/features/link-icon-png.js +1 -1
  1076. package/app/node_modules/caniuse-lite/data/features/link-icon-svg.js +1 -1
  1077. package/app/node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js +1 -1
  1078. package/app/node_modules/caniuse-lite/data/features/link-rel-modulepreload.js +1 -1
  1079. package/app/node_modules/caniuse-lite/data/features/link-rel-preconnect.js +1 -1
  1080. package/app/node_modules/caniuse-lite/data/features/link-rel-prefetch.js +1 -1
  1081. package/app/node_modules/caniuse-lite/data/features/link-rel-preload.js +1 -1
  1082. package/app/node_modules/caniuse-lite/data/features/link-rel-prerender.js +1 -1
  1083. package/app/node_modules/caniuse-lite/data/features/loading-lazy-attr.js +1 -1
  1084. package/app/node_modules/caniuse-lite/data/features/loading-lazy-media.js +1 -1
  1085. package/app/node_modules/caniuse-lite/data/features/localecompare.js +1 -1
  1086. package/app/node_modules/caniuse-lite/data/features/magnetometer.js +1 -1
  1087. package/app/node_modules/caniuse-lite/data/features/matchesselector.js +1 -1
  1088. package/app/node_modules/caniuse-lite/data/features/matchmedia.js +1 -1
  1089. package/app/node_modules/caniuse-lite/data/features/mathml.js +1 -1
  1090. package/app/node_modules/caniuse-lite/data/features/maxlength.js +1 -1
  1091. package/app/node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js +1 -1
  1092. package/app/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js +1 -1
  1093. package/app/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js +1 -1
  1094. package/app/node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js +1 -1
  1095. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js +1 -1
  1096. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js +1 -1
  1097. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js +1 -1
  1098. package/app/node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js +1 -1
  1099. package/app/node_modules/caniuse-lite/data/features/media-fragments.js +1 -1
  1100. package/app/node_modules/caniuse-lite/data/features/mediacapture-fromelement.js +1 -1
  1101. package/app/node_modules/caniuse-lite/data/features/mediarecorder.js +1 -1
  1102. package/app/node_modules/caniuse-lite/data/features/mediasource.js +1 -1
  1103. package/app/node_modules/caniuse-lite/data/features/menu.js +1 -1
  1104. package/app/node_modules/caniuse-lite/data/features/meta-theme-color.js +1 -1
  1105. package/app/node_modules/caniuse-lite/data/features/meter.js +1 -1
  1106. package/app/node_modules/caniuse-lite/data/features/midi.js +1 -1
  1107. package/app/node_modules/caniuse-lite/data/features/minmaxwh.js +1 -1
  1108. package/app/node_modules/caniuse-lite/data/features/mp3.js +1 -1
  1109. package/app/node_modules/caniuse-lite/data/features/mpeg-dash.js +1 -1
  1110. package/app/node_modules/caniuse-lite/data/features/mpeg4.js +1 -1
  1111. package/app/node_modules/caniuse-lite/data/features/multibackgrounds.js +1 -1
  1112. package/app/node_modules/caniuse-lite/data/features/multicolumn.js +1 -1
  1113. package/app/node_modules/caniuse-lite/data/features/mutation-events.js +1 -1
  1114. package/app/node_modules/caniuse-lite/data/features/mutationobserver.js +1 -1
  1115. package/app/node_modules/caniuse-lite/data/features/namevalue-storage.js +1 -1
  1116. package/app/node_modules/caniuse-lite/data/features/native-filesystem-api.js +1 -1
  1117. package/app/node_modules/caniuse-lite/data/features/nav-timing.js +1 -1
  1118. package/app/node_modules/caniuse-lite/data/features/netinfo.js +1 -1
  1119. package/app/node_modules/caniuse-lite/data/features/notifications.js +1 -1
  1120. package/app/node_modules/caniuse-lite/data/features/object-entries.js +1 -1
  1121. package/app/node_modules/caniuse-lite/data/features/object-fit.js +1 -1
  1122. package/app/node_modules/caniuse-lite/data/features/object-observe.js +1 -1
  1123. package/app/node_modules/caniuse-lite/data/features/object-values.js +1 -1
  1124. package/app/node_modules/caniuse-lite/data/features/objectrtc.js +1 -1
  1125. package/app/node_modules/caniuse-lite/data/features/offline-apps.js +1 -1
  1126. package/app/node_modules/caniuse-lite/data/features/offscreencanvas.js +1 -1
  1127. package/app/node_modules/caniuse-lite/data/features/ogg-vorbis.js +1 -1
  1128. package/app/node_modules/caniuse-lite/data/features/ogv.js +1 -1
  1129. package/app/node_modules/caniuse-lite/data/features/ol-reversed.js +1 -1
  1130. package/app/node_modules/caniuse-lite/data/features/once-event-listener.js +1 -1
  1131. package/app/node_modules/caniuse-lite/data/features/online-status.js +1 -1
  1132. package/app/node_modules/caniuse-lite/data/features/opus.js +1 -1
  1133. package/app/node_modules/caniuse-lite/data/features/orientation-sensor.js +1 -1
  1134. package/app/node_modules/caniuse-lite/data/features/outline.js +1 -1
  1135. package/app/node_modules/caniuse-lite/data/features/pad-start-end.js +1 -1
  1136. package/app/node_modules/caniuse-lite/data/features/page-transition-events.js +1 -1
  1137. package/app/node_modules/caniuse-lite/data/features/pagevisibility.js +1 -1
  1138. package/app/node_modules/caniuse-lite/data/features/passive-event-listener.js +1 -1
  1139. package/app/node_modules/caniuse-lite/data/features/passkeys.js +1 -1
  1140. package/app/node_modules/caniuse-lite/data/features/passwordrules.js +1 -1
  1141. package/app/node_modules/caniuse-lite/data/features/path2d.js +1 -1
  1142. package/app/node_modules/caniuse-lite/data/features/payment-request.js +1 -1
  1143. package/app/node_modules/caniuse-lite/data/features/pdf-viewer.js +1 -1
  1144. package/app/node_modules/caniuse-lite/data/features/permissions-api.js +1 -1
  1145. package/app/node_modules/caniuse-lite/data/features/permissions-policy.js +1 -1
  1146. package/app/node_modules/caniuse-lite/data/features/picture-in-picture.js +1 -1
  1147. package/app/node_modules/caniuse-lite/data/features/picture.js +1 -1
  1148. package/app/node_modules/caniuse-lite/data/features/ping.js +1 -1
  1149. package/app/node_modules/caniuse-lite/data/features/png-alpha.js +1 -1
  1150. package/app/node_modules/caniuse-lite/data/features/pointer-events.js +1 -1
  1151. package/app/node_modules/caniuse-lite/data/features/pointer.js +1 -1
  1152. package/app/node_modules/caniuse-lite/data/features/pointerlock.js +1 -1
  1153. package/app/node_modules/caniuse-lite/data/features/portals.js +1 -1
  1154. package/app/node_modules/caniuse-lite/data/features/prefers-color-scheme.js +1 -1
  1155. package/app/node_modules/caniuse-lite/data/features/prefers-reduced-motion.js +1 -1
  1156. package/app/node_modules/caniuse-lite/data/features/progress.js +1 -1
  1157. package/app/node_modules/caniuse-lite/data/features/promise-finally.js +1 -1
  1158. package/app/node_modules/caniuse-lite/data/features/promises.js +1 -1
  1159. package/app/node_modules/caniuse-lite/data/features/proximity.js +1 -1
  1160. package/app/node_modules/caniuse-lite/data/features/proxy.js +1 -1
  1161. package/app/node_modules/caniuse-lite/data/features/publickeypinning.js +1 -1
  1162. package/app/node_modules/caniuse-lite/data/features/push-api.js +1 -1
  1163. package/app/node_modules/caniuse-lite/data/features/queryselector.js +1 -1
  1164. package/app/node_modules/caniuse-lite/data/features/readonly-attr.js +1 -1
  1165. package/app/node_modules/caniuse-lite/data/features/referrer-policy.js +1 -1
  1166. package/app/node_modules/caniuse-lite/data/features/registerprotocolhandler.js +1 -1
  1167. package/app/node_modules/caniuse-lite/data/features/rel-noopener.js +1 -1
  1168. package/app/node_modules/caniuse-lite/data/features/rel-noreferrer.js +1 -1
  1169. package/app/node_modules/caniuse-lite/data/features/rellist.js +1 -1
  1170. package/app/node_modules/caniuse-lite/data/features/rem.js +1 -1
  1171. package/app/node_modules/caniuse-lite/data/features/requestanimationframe.js +1 -1
  1172. package/app/node_modules/caniuse-lite/data/features/requestidlecallback.js +1 -1
  1173. package/app/node_modules/caniuse-lite/data/features/resizeobserver.js +1 -1
  1174. package/app/node_modules/caniuse-lite/data/features/resource-timing.js +1 -1
  1175. package/app/node_modules/caniuse-lite/data/features/rest-parameters.js +1 -1
  1176. package/app/node_modules/caniuse-lite/data/features/rtcpeerconnection.js +1 -1
  1177. package/app/node_modules/caniuse-lite/data/features/ruby.js +1 -1
  1178. package/app/node_modules/caniuse-lite/data/features/run-in.js +1 -1
  1179. package/app/node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js +1 -1
  1180. package/app/node_modules/caniuse-lite/data/features/screen-orientation.js +1 -1
  1181. package/app/node_modules/caniuse-lite/data/features/script-async.js +1 -1
  1182. package/app/node_modules/caniuse-lite/data/features/script-defer.js +1 -1
  1183. package/app/node_modules/caniuse-lite/data/features/scrollintoview.js +1 -1
  1184. package/app/node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js +1 -1
  1185. package/app/node_modules/caniuse-lite/data/features/sdch.js +1 -1
  1186. package/app/node_modules/caniuse-lite/data/features/selection-api.js +1 -1
  1187. package/app/node_modules/caniuse-lite/data/features/server-timing.js +1 -1
  1188. package/app/node_modules/caniuse-lite/data/features/serviceworkers.js +1 -1
  1189. package/app/node_modules/caniuse-lite/data/features/setimmediate.js +1 -1
  1190. package/app/node_modules/caniuse-lite/data/features/shadowdom.js +1 -1
  1191. package/app/node_modules/caniuse-lite/data/features/shadowdomv1.js +1 -1
  1192. package/app/node_modules/caniuse-lite/data/features/sharedarraybuffer.js +1 -1
  1193. package/app/node_modules/caniuse-lite/data/features/sharedworkers.js +1 -1
  1194. package/app/node_modules/caniuse-lite/data/features/sni.js +1 -1
  1195. package/app/node_modules/caniuse-lite/data/features/spdy.js +1 -1
  1196. package/app/node_modules/caniuse-lite/data/features/speech-recognition.js +1 -1
  1197. package/app/node_modules/caniuse-lite/data/features/speech-synthesis.js +1 -1
  1198. package/app/node_modules/caniuse-lite/data/features/spellcheck-attribute.js +1 -1
  1199. package/app/node_modules/caniuse-lite/data/features/sql-storage.js +1 -1
  1200. package/app/node_modules/caniuse-lite/data/features/srcset.js +1 -1
  1201. package/app/node_modules/caniuse-lite/data/features/stream.js +1 -1
  1202. package/app/node_modules/caniuse-lite/data/features/streams.js +1 -1
  1203. package/app/node_modules/caniuse-lite/data/features/stricttransportsecurity.js +1 -1
  1204. package/app/node_modules/caniuse-lite/data/features/style-scoped.js +1 -1
  1205. package/app/node_modules/caniuse-lite/data/features/subresource-bundling.js +1 -1
  1206. package/app/node_modules/caniuse-lite/data/features/subresource-integrity.js +1 -1
  1207. package/app/node_modules/caniuse-lite/data/features/svg-css.js +1 -1
  1208. package/app/node_modules/caniuse-lite/data/features/svg-filters.js +1 -1
  1209. package/app/node_modules/caniuse-lite/data/features/svg-fonts.js +1 -1
  1210. package/app/node_modules/caniuse-lite/data/features/svg-fragment.js +1 -1
  1211. package/app/node_modules/caniuse-lite/data/features/svg-html.js +1 -1
  1212. package/app/node_modules/caniuse-lite/data/features/svg-html5.js +1 -1
  1213. package/app/node_modules/caniuse-lite/data/features/svg-img.js +1 -1
  1214. package/app/node_modules/caniuse-lite/data/features/svg-smil.js +1 -1
  1215. package/app/node_modules/caniuse-lite/data/features/svg.js +1 -1
  1216. package/app/node_modules/caniuse-lite/data/features/sxg.js +1 -1
  1217. package/app/node_modules/caniuse-lite/data/features/tabindex-attr.js +1 -1
  1218. package/app/node_modules/caniuse-lite/data/features/template-literals.js +1 -1
  1219. package/app/node_modules/caniuse-lite/data/features/template.js +1 -1
  1220. package/app/node_modules/caniuse-lite/data/features/temporal.js +1 -1
  1221. package/app/node_modules/caniuse-lite/data/features/testfeat.js +1 -1
  1222. package/app/node_modules/caniuse-lite/data/features/text-decoration.js +1 -1
  1223. package/app/node_modules/caniuse-lite/data/features/text-emphasis.js +1 -1
  1224. package/app/node_modules/caniuse-lite/data/features/text-overflow.js +1 -1
  1225. package/app/node_modules/caniuse-lite/data/features/text-size-adjust.js +1 -1
  1226. package/app/node_modules/caniuse-lite/data/features/text-stroke.js +1 -1
  1227. package/app/node_modules/caniuse-lite/data/features/textcontent.js +1 -1
  1228. package/app/node_modules/caniuse-lite/data/features/textencoder.js +1 -1
  1229. package/app/node_modules/caniuse-lite/data/features/tls1-1.js +1 -1
  1230. package/app/node_modules/caniuse-lite/data/features/tls1-2.js +1 -1
  1231. package/app/node_modules/caniuse-lite/data/features/tls1-3.js +1 -1
  1232. package/app/node_modules/caniuse-lite/data/features/touch.js +1 -1
  1233. package/app/node_modules/caniuse-lite/data/features/transforms2d.js +1 -1
  1234. package/app/node_modules/caniuse-lite/data/features/transforms3d.js +1 -1
  1235. package/app/node_modules/caniuse-lite/data/features/trusted-types.js +1 -1
  1236. package/app/node_modules/caniuse-lite/data/features/ttf.js +1 -1
  1237. package/app/node_modules/caniuse-lite/data/features/typedarrays.js +1 -1
  1238. package/app/node_modules/caniuse-lite/data/features/u2f.js +1 -1
  1239. package/app/node_modules/caniuse-lite/data/features/unhandledrejection.js +1 -1
  1240. package/app/node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js +1 -1
  1241. package/app/node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js +1 -1
  1242. package/app/node_modules/caniuse-lite/data/features/url.js +1 -1
  1243. package/app/node_modules/caniuse-lite/data/features/urlsearchparams.js +1 -1
  1244. package/app/node_modules/caniuse-lite/data/features/use-strict.js +1 -1
  1245. package/app/node_modules/caniuse-lite/data/features/user-select-none.js +1 -1
  1246. package/app/node_modules/caniuse-lite/data/features/user-timing.js +1 -1
  1247. package/app/node_modules/caniuse-lite/data/features/variable-fonts.js +1 -1
  1248. package/app/node_modules/caniuse-lite/data/features/vector-effect.js +1 -1
  1249. package/app/node_modules/caniuse-lite/data/features/vibration.js +1 -1
  1250. package/app/node_modules/caniuse-lite/data/features/video.js +1 -1
  1251. package/app/node_modules/caniuse-lite/data/features/videotracks.js +1 -1
  1252. package/app/node_modules/caniuse-lite/data/features/view-transitions.js +1 -1
  1253. package/app/node_modules/caniuse-lite/data/features/viewport-unit-variants.js +1 -1
  1254. package/app/node_modules/caniuse-lite/data/features/viewport-units.js +1 -1
  1255. package/app/node_modules/caniuse-lite/data/features/wai-aria.js +1 -1
  1256. package/app/node_modules/caniuse-lite/data/features/wake-lock.js +1 -1
  1257. package/app/node_modules/caniuse-lite/data/features/wasm-bigint.js +1 -1
  1258. package/app/node_modules/caniuse-lite/data/features/wasm-bulk-memory.js +1 -1
  1259. package/app/node_modules/caniuse-lite/data/features/wasm-extended-const.js +1 -1
  1260. package/app/node_modules/caniuse-lite/data/features/wasm-gc.js +1 -1
  1261. package/app/node_modules/caniuse-lite/data/features/wasm-multi-memory.js +1 -1
  1262. package/app/node_modules/caniuse-lite/data/features/wasm-multi-value.js +1 -1
  1263. package/app/node_modules/caniuse-lite/data/features/wasm-mutable-globals.js +1 -1
  1264. package/app/node_modules/caniuse-lite/data/features/wasm-nontrapping-fptoint.js +1 -1
  1265. package/app/node_modules/caniuse-lite/data/features/wasm-reference-types.js +1 -1
  1266. package/app/node_modules/caniuse-lite/data/features/wasm-relaxed-simd.js +1 -1
  1267. package/app/node_modules/caniuse-lite/data/features/wasm-signext.js +1 -1
  1268. package/app/node_modules/caniuse-lite/data/features/wasm-simd.js +1 -1
  1269. package/app/node_modules/caniuse-lite/data/features/wasm-tail-calls.js +1 -1
  1270. package/app/node_modules/caniuse-lite/data/features/wasm-threads.js +1 -1
  1271. package/app/node_modules/caniuse-lite/data/features/wasm.js +1 -1
  1272. package/app/node_modules/caniuse-lite/data/features/wav.js +1 -1
  1273. package/app/node_modules/caniuse-lite/data/features/wbr-element.js +1 -1
  1274. package/app/node_modules/caniuse-lite/data/features/web-animation.js +1 -1
  1275. package/app/node_modules/caniuse-lite/data/features/web-app-manifest.js +1 -1
  1276. package/app/node_modules/caniuse-lite/data/features/web-bluetooth.js +1 -1
  1277. package/app/node_modules/caniuse-lite/data/features/web-serial.js +1 -1
  1278. package/app/node_modules/caniuse-lite/data/features/web-share.js +1 -1
  1279. package/app/node_modules/caniuse-lite/data/features/webauthn.js +1 -1
  1280. package/app/node_modules/caniuse-lite/data/features/webcodecs.js +1 -1
  1281. package/app/node_modules/caniuse-lite/data/features/webgl.js +1 -1
  1282. package/app/node_modules/caniuse-lite/data/features/webgl2.js +1 -1
  1283. package/app/node_modules/caniuse-lite/data/features/webgpu.js +1 -1
  1284. package/app/node_modules/caniuse-lite/data/features/webhid.js +1 -1
  1285. package/app/node_modules/caniuse-lite/data/features/webkit-user-drag.js +1 -1
  1286. package/app/node_modules/caniuse-lite/data/features/webm.js +1 -1
  1287. package/app/node_modules/caniuse-lite/data/features/webnfc.js +1 -1
  1288. package/app/node_modules/caniuse-lite/data/features/webp.js +1 -1
  1289. package/app/node_modules/caniuse-lite/data/features/websockets.js +1 -1
  1290. package/app/node_modules/caniuse-lite/data/features/webtransport.js +1 -1
  1291. package/app/node_modules/caniuse-lite/data/features/webusb.js +1 -1
  1292. package/app/node_modules/caniuse-lite/data/features/webvr.js +1 -1
  1293. package/app/node_modules/caniuse-lite/data/features/webvtt.js +1 -1
  1294. package/app/node_modules/caniuse-lite/data/features/webworkers.js +1 -1
  1295. package/app/node_modules/caniuse-lite/data/features/webxr.js +1 -1
  1296. package/app/node_modules/caniuse-lite/data/features/will-change.js +1 -1
  1297. package/app/node_modules/caniuse-lite/data/features/woff.js +1 -1
  1298. package/app/node_modules/caniuse-lite/data/features/woff2.js +1 -1
  1299. package/app/node_modules/caniuse-lite/data/features/word-break.js +1 -1
  1300. package/app/node_modules/caniuse-lite/data/features/wordwrap.js +1 -1
  1301. package/app/node_modules/caniuse-lite/data/features/x-doc-messaging.js +1 -1
  1302. package/app/node_modules/caniuse-lite/data/features/x-frame-options.js +1 -1
  1303. package/app/node_modules/caniuse-lite/data/features/xhr2.js +1 -1
  1304. package/app/node_modules/caniuse-lite/data/features/xhtml.js +1 -1
  1305. package/app/node_modules/caniuse-lite/data/features/xhtmlsmil.js +1 -1
  1306. package/app/node_modules/caniuse-lite/data/features/xml-serializer.js +1 -1
  1307. package/app/node_modules/caniuse-lite/data/features/zstd.js +1 -1
  1308. package/app/node_modules/caniuse-lite/data/versionGroups.js +1 -0
  1309. package/app/node_modules/caniuse-lite/dist/unpacker/feature.js +30 -1
  1310. package/app/node_modules/caniuse-lite/dist/unpacker/versionGroups.js +1 -0
  1311. package/app/node_modules/caniuse-lite/package.json +1 -1
  1312. package/app/node_modules/nanoid/non-secure/index.cjs +0 -10
  1313. package/app/node_modules/nanoid/package.json +1 -1
  1314. package/app/node_modules/next/dist/build/swc/index.js +1 -1
  1315. package/app/node_modules/next/dist/build/webpack-config.js +3 -3
  1316. package/app/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
  1317. package/app/node_modules/next/dist/lib/patch-incorrect-lockfile.js +3 -3
  1318. package/app/node_modules/next/dist/server/config.js +1 -1
  1319. package/app/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +2 -2
  1320. package/app/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1 -1
  1321. package/app/node_modules/next/dist/server/lib/app-info-log.js +1 -1
  1322. package/app/node_modules/next/dist/server/lib/start-server.js +1 -1
  1323. package/app/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +1 -1
  1324. package/app/node_modules/next/dist/telemetry/anonymous-meta.js +1 -1
  1325. package/app/node_modules/next/dist/telemetry/events/swc-load-failure.js +1 -1
  1326. package/app/node_modules/next/dist/telemetry/events/version.js +2 -2
  1327. package/app/node_modules/next/package.json +10 -252
  1328. package/app/node_modules/pg/lib/client.js +7 -1
  1329. package/app/node_modules/pg/lib/connection-parameters.js +13 -0
  1330. package/app/node_modules/pg/lib/connection.js +43 -22
  1331. package/app/node_modules/pg/lib/defaults.js +3 -0
  1332. package/app/node_modules/pg/lib/query.js +4 -0
  1333. package/app/node_modules/pg/package.json +4 -4
  1334. package/app/node_modules/pg-connection-string/index.js +6 -0
  1335. package/app/node_modules/pg-connection-string/package.json +3 -3
  1336. package/app/node_modules/pg-protocol/dist/buffer-reader.js +1 -1
  1337. package/app/node_modules/pg-protocol/dist/buffer-writer.js +23 -0
  1338. package/app/node_modules/pg-protocol/dist/index.js +2 -2
  1339. package/app/node_modules/pg-protocol/dist/parser.js +1 -1
  1340. package/app/node_modules/pg-protocol/dist/serializer.js +11 -4
  1341. package/app/node_modules/pg-protocol/package.json +2 -2
  1342. package/app/package.json +1 -1
  1343. package/app/server.js +1 -1
  1344. package/package.json +1 -1
  1345. package/app/.next-cli-build/server/chunks/8581.js +0 -64
  1346. package/app/.next-cli-build/static/chunks/1a258343-bc0b514c079d8898.js +0 -1
  1347. package/app/.next-cli-build/static/chunks/2714-83a368a92f8c292c.js +0 -64
  1348. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/analytics/page-c687e836a9f9c8bd.js +0 -1
  1349. package/app/.next-cli-build/static/css/235bf5022a58e050.css +0 -1
  1350. /package/app/.next-cli-build/static/{GB6pMdAIstNCFUAF9jJxq → t8DOqjpfrbpEkTzoBBUtH}/_buildManifest.js +0 -0
  1351. /package/app/.next-cli-build/static/{GB6pMdAIstNCFUAF9jJxq → t8DOqjpfrbpEkTzoBBUtH}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var a={};a.id=451,a.ids=[451,9614],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},9588:(a,b,c)=>{c.d(b,{I8:()=>j,Tv:()=>u,UX:()=>o,aV:()=>n,bz:()=>q,hH:()=>t,oW:()=>s,s0:()=>l,ub:()=>m,vZ:()=>p});var d=c(65573),e=c(23211),f=c(89718),g=c(33792),h=c(90389);function i(a){return String(a||"").trim().toLowerCase()}function j(a){return i(a)}function k(a={}){return[a.ldapUsername,a.ldapEmail,a.ldapName,a.oidcEmail,a.oidcName,a.localUsername,a.username,a.email].map(i).filter(Boolean)}function l(a={}){let b=k(a),c=b[0]||"local",d=a.ldapName||a.ldapEmail||a.oidcName||a.oidcEmail||a.localUsername||c;return{userId:c,displayName:d,loginMethod:a.oidc?"OIDC":a.ldap?"LDAP":"Local",candidates:b}}function m(a={},b={}){var c;if(!b?.authenticated)return!1;if(b.local||!b.ldap&&!b.oidc||b.role===h.hS.ADMIN||!0===b.ldapIsAdmin)return!0;let d=Array.isArray(c=a.ldapAllowedUsers)?c.map(i).filter(Boolean):String(c||"").split(/[,\n]/).map(i).filter(Boolean);return 0!==d.length&&k(b).some(a=>d.includes(a))}function n(a={},b={}){return!(!b?.authenticated||m(a,b))&&(b.role===h.hS.MONITOR_ADMIN||!0===b.ldapIsMonitorAdmin)}function o(a={},b={}){return!(!b?.authenticated||m(a,b)||n(a,b))&&(b.role===h.hS.AI_GATEWAYS_MONITOR||!0===b.ldapIsAiGatewaysMonitor)}function p(a={},b={}){return b?.authenticated?m(a,b)?h.hS.ADMIN:n(a,b)?h.hS.MONITOR_ADMIN:o(a,b)?h.hS.AI_GATEWAYS_MONITOR:h.hS.USER:h.hS.GUEST}function q(a={}){return!0===a.isAdmin||!0===a.isMonitorAdmin}async function r(){let a=await (0,f.mt)(),b=await (0,d.UL)(),c=await (0,g.dY)(b.get("auth_token")?.value);if(!c?.authenticated)return{authenticated:!1,isAdmin:!1,isMonitorAdmin:!1,isAiGatewaysMonitor:!1,role:h.hS.GUEST,userId:"",displayName:"Guest",loginMethod:"None",settings:{...a,requireLogin:!0},session:null};let e=l(c||{}),i=p(a,c||{}),j=i===h.hS.ADMIN,k=i===h.hS.MONITOR_ADMIN,m=i===h.hS.AI_GATEWAYS_MONITOR;return{authenticated:!0,isAdmin:j,isMonitorAdmin:k,isAiGatewaysMonitor:m,role:i,canManageApiKeys:j||k,canUseMonitorAdminTabs:j||k,canViewAllAnalytics:j||k||m,...e,settings:{...a,requireLogin:!0},session:c}}async function s(){let a=await r();return a.authenticated?{access:a,response:null}:{access:a,response:e.NextResponse.json({error:"Authentication required"},{status:401})}}async function t(a={}){let{allowMonitorAdmin:b=!1}=a||{},{access:c,response:d}=await s();return d?{access:c,response:d}:c.isAdmin||b&&c.isMonitorAdmin?{access:c,response:null}:{access:c,response:e.NextResponse.json({error:"Admin access required"},{status:403})}}function u(a,b){if(!a?.authenticated||!b)return!1;if(q(a))return!0;let c=i(a.userId),d=i(b.ownerUser),e=i(b.createdByUser);return!!c&&(d===c||e===c)}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{a.exports=c(44870)},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33792:(a,b,c)=>{c.d(b,{Dc:()=>p,OZ:()=>s,YK:()=>n,dY:()=>q,tm:()=>r});var d=c(86935),e=c(69614),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(77598),k=c.n(j),l=c(49120);let m=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=i().join(l.DATA_DIR,"jwt-secret");try{return g().readFileSync(a,"utf8").trim()}catch{}g().mkdirSync(l.DATA_DIR,{recursive:!0});let b=k().randomBytes(32).toString("hex");return g().writeFileSync(a,b,{mode:384}),b}());function n(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function o(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(m)}async function p(a){if(!a)return!1;try{return await (0,e.V)(a,m),!0}catch{return!1}}async function q(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,m);return b}catch{return null}}async function r(a,b,c={}){let d=await o(c);a.set("auth_token",d,{httpOnly:!0,secure:n(b),sameSite:"lax",path:"/"})}function s(a){a.delete("auth_token")}},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},53053:a=>{a.exports=require("node:diagnostics_channel")},53254:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>bg,patchFetch:()=>bf,routeModule:()=>bb,serverHooks:()=>be,workAsyncStorage:()=>bc,workUnitAsyncStorage:()=>bd});var d={};c.r(d),c.d(d,{GET:()=>ba,dynamic:()=>a8});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(36366),x=c(644),y=c(45903),z=c(97242);let A=new Set;function B(a){return String(a||"").trim()}function C(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}async function D(){return(0,y.I6)(await (0,y.L7)())}async function E(a){let b=new(await Promise.resolve().then(c.bind(c,64939))).Client({host:a.host,port:Number(a.port||5432),database:a.database,user:a.username,password:a.password,ssl:!!a.ssl&&{rejectUnauthorized:!1}});return await b.connect(),{type:"postgres",query:async(a,c=[])=>(await b.query(a,c)).rows,queryOne:async(a,c=[])=>(await b.query(a,c)).rows[0]||null,async exec(a,c=[]){await b.query(a,c)},async close(){await b.end()}}}async function F(a){let b=await c.e(8491).then(c.t.bind(c,38491,19)),d=await b.createConnection({host:a.host,port:Number(a.port||3306),database:a.database,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,dateStrings:!0,connectTimeout:3e3});return{type:"mysql",async query(a,b=[]){let[c]=await d.query(a,b);return c},async queryOne(a,b=[]){let[c]=await d.query(a,b);return c[0]||null},async exec(a,b=[]){await d.query(a,b)},async close(){await d.end()}}}async function G(a){if("postgres"===a.type)return E(a);if("mysql"===a.type)return F(a);throw Error(`Unsupported prompt log database type: ${a.type}`)}async function H(){await (0,z.DU)().catch(()=>null)}async function I(a){if(!a.enabled)return;let b=`${a.type}:${a.host||""}:${a.port||""}:${a.database||""}`;if(!A.has(b))try{await H(a),A.add(b)}catch(a){console.warn("[prompt-log-analytics] Unable to ensure indexes:",a?.message||a)}}async function J(a,b,c,d,e=50){let f=Math.max(1,Math.min(500,Number(e)||50));return await a.query(`SELECT ${c},
1
+ "use strict";(()=>{var a={};a.id=451,a.ids=[451,9614],a.modules={261:a=>{a.exports=require("next/dist/shared/lib/router/utils/app-paths")},1932:a=>{a.exports=require("url")},3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{a.exports=require("node:buffer")},9588:(a,b,c)=>{c.d(b,{I8:()=>j,Tv:()=>u,UX:()=>o,aV:()=>n,bz:()=>q,hH:()=>t,oW:()=>s,s0:()=>l,ub:()=>m,vZ:()=>p});var d=c(65573),e=c(23211),f=c(89718),g=c(33792),h=c(90389);function i(a){return String(a||"").trim().toLowerCase()}function j(a){return i(a)}function k(a={}){return[a.ldapUsername,a.ldapEmail,a.ldapName,a.oidcEmail,a.oidcName,a.localUsername,a.username,a.email].map(i).filter(Boolean)}function l(a={}){let b=k(a),c=b[0]||"local",d=a.ldapName||a.ldapEmail||a.oidcName||a.oidcEmail||a.localUsername||c;return{userId:c,displayName:d,loginMethod:a.oidc?"OIDC":a.ldap?"LDAP":"Local",candidates:b}}function m(a={},b={}){var c;if(!b?.authenticated)return!1;if(b.local||!b.ldap&&!b.oidc||b.role===h.hS.ADMIN||!0===b.ldapIsAdmin)return!0;let d=Array.isArray(c=a.ldapAllowedUsers)?c.map(i).filter(Boolean):String(c||"").split(/[,\n]/).map(i).filter(Boolean);return 0!==d.length&&k(b).some(a=>d.includes(a))}function n(a={},b={}){return!(!b?.authenticated||m(a,b))&&(b.role===h.hS.MONITOR_ADMIN||!0===b.ldapIsMonitorAdmin)}function o(a={},b={}){return!(!b?.authenticated||m(a,b)||n(a,b))&&(b.role===h.hS.AI_GATEWAYS_MONITOR||!0===b.ldapIsAiGatewaysMonitor)}function p(a={},b={}){return b?.authenticated?m(a,b)?h.hS.ADMIN:n(a,b)?h.hS.MONITOR_ADMIN:o(a,b)?h.hS.AI_GATEWAYS_MONITOR:h.hS.USER:h.hS.GUEST}function q(a={}){return!0===a.isAdmin||!0===a.isMonitorAdmin}async function r(){let a=await (0,f.mt)(),b=await (0,d.UL)(),c=await (0,g.dY)(b.get("auth_token")?.value);if(!c?.authenticated)return{authenticated:!1,isAdmin:!1,isMonitorAdmin:!1,isAiGatewaysMonitor:!1,role:h.hS.GUEST,userId:"",displayName:"Guest",loginMethod:"None",settings:{...a,requireLogin:!0},session:null};let e=l(c||{}),i=p(a,c||{}),j=i===h.hS.ADMIN,k=i===h.hS.MONITOR_ADMIN,m=i===h.hS.AI_GATEWAYS_MONITOR;return{authenticated:!0,isAdmin:j,isMonitorAdmin:k,isAiGatewaysMonitor:m,role:i,canManageApiKeys:j||k,canUseMonitorAdminTabs:j||k,canViewAllAnalytics:j||k||m,...e,settings:{...a,requireLogin:!0},session:c}}async function s(){let a=await r();return a.authenticated?{access:a,response:null}:{access:a,response:e.NextResponse.json({error:"Authentication required"},{status:401})}}async function t(a={}){let{allowMonitorAdmin:b=!1}=a||{},{access:c,response:d}=await s();return d?{access:c,response:d}:c.isAdmin||b&&c.isMonitorAdmin?{access:c,response:null}:{access:c,response:e.NextResponse.json({error:"Admin access required"},{status:403})}}function u(a,b){if(!a?.authenticated||!b)return!1;if(q(a))return!0;let c=i(a.userId),d=i(b.ownerUser),e=i(b.createdByUser);return!!c&&(d===c||e===c)}},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19225:(a,b,c)=>{a.exports=c(44870)},19771:a=>{a.exports=require("process")},21820:a=>{a.exports=require("os")},27910:a=>{a.exports=require("stream")},28354:a=>{a.exports=require("util")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33792:(a,b,c)=>{c.d(b,{Dc:()=>p,OZ:()=>s,YK:()=>n,dY:()=>q,tm:()=>r});var d=c(86935),e=c(69614),f=c(73024),g=c.n(f),h=c(76760),i=c.n(h),j=c(77598),k=c.n(j),l=c(49120);let m=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=i().join(l.DATA_DIR,"jwt-secret");try{return g().readFileSync(a,"utf8").trim()}catch{}g().mkdirSync(l.DATA_DIR,{recursive:!0});let b=k().randomBytes(32).toString("hex");return g().writeFileSync(a,b,{mode:384}),b}());function n(a){let b="true"===process.env.AUTH_COOKIE_SECURE,c=a?.headers?.get?.("x-forwarded-proto");return b||"https"===c}async function o(a={}){return new d.P({authenticated:!0,...a}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("24h").sign(m)}async function p(a){if(!a)return!1;try{return await (0,e.V)(a,m),!0}catch{return!1}}async function q(a){if(!a)return null;try{let{payload:b}=await (0,e.V)(a,m);return b}catch{return null}}async function r(a,b,c={}){let d=await o(c);a.set("auth_token",d,{httpOnly:!0,secure:n(b),sameSite:"lax",path:"/"})}function s(a){a.delete("auth_token")}},33873:a=>{a.exports=require("path")},34631:a=>{a.exports=require("tls")},41204:a=>{a.exports=require("string_decoder")},44870:a=>{a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},46293:a=>{a.exports=require("sql.js")},50122:(a,b,c)=>{c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},53053:a=>{a.exports=require("node:diagnostics_channel")},53254:(a,b,c)=>{c.r(b),c.d(b,{handler:()=>bn,patchFetch:()=>bm,routeModule:()=>bi,serverHooks:()=>bl,workAsyncStorage:()=>bj,workUnitAsyncStorage:()=>bk});var d={};c.r(d),c.d(d,{GET:()=>bh,dynamic:()=>bf});var e=c(19225),f=c(84006),g=c(8317),h=c(99373),i=c(34775),j=c(24235),k=c(261),l=c(54365),m=c(90771),n=c(73461),o=c(67798),p=c(92280),q=c(62018),r=c(45696),s=c(47929),t=c(86439),u=c(37527),v=c(23211),w=c(36366),x=c(644),y=c(45903),z=c(97242);let A=new Set;function B(a){return String(a||"").trim()}function C(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}async function D(){return(0,y.I6)(await (0,y.L7)())}async function E(a){let b=new(await Promise.resolve().then(c.bind(c,64939))).Client({host:a.host,port:Number(a.port||5432),database:a.database,user:a.username,password:a.password,ssl:!!a.ssl&&{rejectUnauthorized:!1}});return await b.connect(),{type:"postgres",query:async(a,c=[])=>(await b.query(a,c)).rows,queryOne:async(a,c=[])=>(await b.query(a,c)).rows[0]||null,async exec(a,c=[]){await b.query(a,c)},async close(){await b.end()}}}async function F(a){let b=await c.e(8491).then(c.t.bind(c,38491,19)),d=await b.createConnection({host:a.host,port:Number(a.port||3306),database:a.database,user:a.username,password:a.password,ssl:a.ssl?{}:void 0,dateStrings:!0,connectTimeout:3e3});return{type:"mysql",async query(a,b=[]){let[c]=await d.query(a,b);return c},async queryOne(a,b=[]){let[c]=await d.query(a,b);return c[0]||null},async exec(a,b=[]){await d.query(a,b)},async close(){await d.end()}}}async function G(a){if("postgres"===a.type)return E(a);if("mysql"===a.type)return F(a);throw Error(`Unsupported prompt log database type: ${a.type}`)}async function H(){await (0,z.DU)().catch(()=>null)}async function I(a){if(!a.enabled)return;let b=`${a.type}:${a.host||""}:${a.port||""}:${a.database||""}`;if(!A.has(b))try{await H(a),A.add(b)}catch(a){console.warn("[prompt-log-analytics] Unable to ensure indexes:",a?.message||a)}}async function J(a,b,c,d,e=50){let f=Math.max(1,Math.min(500,Number(e)||50));return await a.query(`SELECT ${c},
2
2
  COUNT(*) AS requests,
3
3
  SUM(CASE WHEN error_text IS NOT NULL AND error_text <> '' THEN 1
4
4
  WHEN status_code IS NOT NULL AND CONCAT('', status_code) NOT LIKE '2%' THEN 1
@@ -9,59 +9,59 @@
9
9
  ${b.clause}
10
10
  GROUP BY ${d}
11
11
  ORDER BY requests DESC, errors DESC, lastSeen DESC
12
- LIMIT ${f}`,b.params)}function K(a,b=null){return(a||[]).map(a=>(function(a={},b={}){let c=C(a.requests,0),d=C(a.errors,0),e=C(a.success,Math.max(0,c-d));return{key:B(a.key??a.metric_key)||"unknown",label:B(a.label||a.key||a.metric_key)||"unknown",requests:c,success:e,errors:d,errorRate:c?d/c:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,lastSeen:B(a.lastSeen),topModels:[],topTools:[],topIps:[],...b}})(a,b?b(a):{}))}async function L(a,b){let c=a.type,d=await G(a);try{let e=function(a={},b){let c=function(a={}){return{keyword:B(a.keyword),model:B(a.model),stage:B(a.stage),sessionId:B(a.sessionId),clientIp:B(a.clientIp||a.sourceIp),sourceTool:B(a.sourceTool),dateFrom:B(a.dateFrom||a.startStored||a.startIso),dateTo:B(a.dateTo||a.endStored||a.endIso),workingTimeRanges:Array.isArray(a.workingTimeRanges)?a.workingTimeRanges:[]}}(a),d=[],e=[],f=a=>(e.push(a),"postgres"===b?`$${e.length}`:"?"),g="postgres"===b?"ILIKE":"LIKE";if(c.keyword){let a=`%${c.keyword}%`;d.push(`(${["prompt_text","response_text","error_text","model","endpoint","provider","account_name","connection_id","display_model","session_id","client_ip","client_host","client_user_agent","source_tool","source_tool_label","source_host"].map(b=>`${b} ${g} ${f(a)}`).join(" OR ")})`)}if(c.model&&d.push(`(model = ${f(c.model)} OR display_model = ${f(c.model)})`),c.stage&&d.push(`stage = ${f(c.stage)}`),c.sessionId&&d.push(`session_id = ${f(c.sessionId)}`),c.clientIp&&d.push(`client_ip ${g} ${f(`%${c.clientIp}%`)}`),c.sourceTool){let a=`%${c.sourceTool}%`;d.push(`(source_tool ${g} ${f(a)} OR source_tool_label ${g} ${f(a)} OR source_host ${g} ${f(a)})`)}let h=c.workingTimeRanges.filter(a=>a?.startIso&&a?.endIso);return h.length?d.push(`(${h.map(a=>`(created_at >= ${f(a.startIso)} AND created_at < ${f(a.endIso)})`).join(" OR ")})`):(c.dateFrom&&d.push(`created_at >= ${f(c.dateFrom)}`),c.dateTo&&d.push(`created_at < ${f(c.dateTo)}`)),{clause:d.length?`WHERE ${d.join(" AND ")}`:"",params:e,add:f}}(b,c),f=await d.queryOne(`SELECT COUNT(*) AS count FROM prompt_logs ${e.clause}`,e.params),g=C(f?.count,0),h=K(await J(d,e,"COALESCE(NULLIF(client_ip, ''), 'unknown') AS metric_key, COALESCE(NULLIF(client_ip, ''), 'unknown') AS label","COALESCE(NULLIF(client_ip, ''), 'unknown')")),i=K(await J(d,e,"COALESCE(NULLIF(source_tool_label, ''), NULLIF(source_tool, ''), NULLIF(source_host, ''), 'unknown') AS metric_key, COALESCE(NULLIF(source_tool_label, ''), NULLIF(source_tool, ''), NULLIF(source_host, ''), 'unknown') AS label","COALESCE(NULLIF(source_tool_label, ''), NULLIF(source_tool, ''), NULLIF(source_host, ''), 'unknown')")),j=K(await J(d,e,"COALESCE(NULLIF(session_id, ''), 'unknown') AS metric_key, COALESCE(NULLIF(session_id, ''), 'unknown') AS label","COALESCE(NULLIF(session_id, ''), 'unknown')")),k=K(await J(d,e,"COALESCE(NULLIF(stage, ''), 'unknown') AS metric_key, COALESCE(NULLIF(stage, ''), 'unknown') AS label","COALESCE(NULLIF(stage, ''), 'unknown')")),l=K(await J(d,e,"COALESCE(NULLIF(display_model, ''), NULLIF(model, ''), 'unknown') AS metric_key, COALESCE(NULLIF(display_model, ''), NULLIF(model, ''), 'unknown') AS label","COALESCE(NULLIF(display_model, ''), NULLIF(model, ''), 'unknown')")),m=K(await J(d,e,"COALESCE(NULLIF(account_name, ''), NULLIF(connection_id, ''), NULLIF(provider, ''), 'unknown') AS metric_key, COALESCE(NULLIF(account_name, ''), NULLIF(connection_id, ''), NULLIF(provider, ''), 'unknown') AS label","COALESCE(NULLIF(account_name, ''), NULLIF(connection_id, ''), NULLIF(provider, ''), 'unknown')")),n=K(await J(d,e,"CASE WHEN error_text IS NOT NULL AND error_text <> '' THEN 'error' ELSE COALESCE(CONCAT('', status_code), 'ok') END AS metric_key, CASE WHEN error_text IS NOT NULL AND error_text <> '' THEN 'error' ELSE COALESCE(CONCAT('', status_code), 'ok') END AS label","CASE WHEN error_text IS NOT NULL AND error_text <> '' THEN 'error' ELSE COALESCE(CONCAT('', status_code), 'ok') END")),o=await (0,z.DU)().catch(()=>({models:[],stages:[]}));return{total:g,sampled:g,disabled:!1,missing:!1,dbInfo:{type:a.type,host:a.host,database:a.database},models:o.models||[],stages:o.stages||[],topClientIps:h,topSourceTools:i,topSessions:j,topStages:k,topModels:l,topAccounts:m,topStatuses:n}}finally{await d.close()}}async function M(a={}){let b=await D();if(!b.enabled)return{disabled:!0,missing:!1,total:0,sampled:0,dbInfo:{type:b.type},models:[],stages:[],topClientIps:[],topSourceTools:[],topSessions:[],topStages:[],topModels:[],topAccounts:[],topStatuses:[]};if(await I(b),"postgres"===b.type||"mysql"===b.type)return L(b,a);throw Error(`Unsupported prompt log database type: ${b.type}`)}var N=c(35901),O=c(77638);let P=new Set(["today","todayWorking","yesterday","yesterdayWorking","24h","thisWeek","lastWeek","7d","thisMonth","lastMonth","30d","60d","all","custom"]),Q="lower(trim(COALESCE(CAST(status AS TEXT), '')))",R=`(
13
- ${Q} GLOB 'error*'
14
- OR ${Q} GLOB 'fail*'
15
- OR ${Q} GLOB 'failed*'
16
- OR ${Q} GLOB 'timeout*'
17
- OR ${Q} GLOB 'network*'
18
- OR ${Q} GLOB 'aborted*'
19
- OR ${Q} GLOB 'abort*'
20
- OR ${Q} GLOB 'rate_limited*'
21
- OR ${Q} GLOB 'provider_error*'
22
- OR ${Q} GLOB 'gateway_error*'
23
- OR ${Q} GLOB 'parse_error*'
24
- OR ${Q} GLOB 'model_error*'
25
- )`,S=`(
26
- (COALESCE(statusCode, 0) BETWEEN 200 AND 299 AND NOT ${R})
27
- OR ${Q} = ''
28
- OR ${Q} IN ('ok', 'success', 'succeeded', 'complete', 'completed', 'done', '200')
29
- OR ${Q} GLOB '2[0-9][0-9]*'
30
- OR ${Q} GLOB 'ok*'
31
- OR ${Q} GLOB 'success*'
32
- OR ${Q} GLOB 'succeeded*'
33
- OR ${Q} GLOB 'complete*'
34
- OR ${Q} GLOB 'completed*'
35
- OR ${Q} GLOB 'done*'
36
- )`,T=`(
37
- ${Q} IN ('pending', 'running', 'in_progress', 'queued', 'processing')
38
- )`,U=`(NOT ${T})`,V=`
39
- SUM(CASE WHEN ${U} THEN 1 ELSE 0 END) AS requests,
40
- SUM(CASE WHEN ${U} AND ${S} THEN 1 ELSE 0 END) AS success,
41
- SUM(CASE WHEN ${U} AND NOT ${S} THEN 1 ELSE 0 END) AS errors,
42
- SUM(CASE WHEN ${T} THEN 1 ELSE 0 END) AS pending,
43
- COALESCE(SUM(CASE WHEN ${U} THEN COALESCE(promptTokens, 0) ELSE 0 END), 0) AS promptTokens,
44
- COALESCE(SUM(CASE WHEN ${U} THEN COALESCE(completionTokens, 0) ELSE 0 END), 0) AS completionTokens,
45
- COALESCE(SUM(CASE WHEN ${U} THEN COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0) ELSE 0 END), 0) AS totalTokens,
46
- COALESCE(SUM(CASE WHEN ${U} THEN COALESCE(cachedTokens, 0) ELSE 0 END), 0) AS cachedTokens,
47
- COALESCE(SUM(CASE WHEN ${U} THEN COALESCE(reasoningTokens, 0) ELSE 0 END), 0) AS reasoningTokens,
48
- COALESCE(SUM(CASE WHEN ${U} THEN COALESCE(cost, 0) ELSE 0 END), 0) AS cost,
12
+ LIMIT ${f}`,b.params)}function K(a,b=null){return(a||[]).map(a=>(function(a={},b={}){let c=C(a.requests,0),d=C(a.errors,0),e=C(a.success,Math.max(0,c-d));return{key:B(a.key??a.metric_key)||"unknown",label:B(a.label||a.key||a.metric_key)||"unknown",requests:c,success:e,errors:d,errorRate:c?d/c:0,promptTokens:0,completionTokens:0,totalTokens:0,cost:0,lastSeen:B(a.lastSeen),topModels:[],topTools:[],topIps:[],...b}})(a,b?b(a):{}))}async function L(a,b){let c=a.type,d=await G(a);try{let e=function(a={},b){let c=function(a={}){return{keyword:B(a.keyword),model:B(a.model),stage:B(a.stage),sessionId:B(a.sessionId),clientIp:B(a.clientIp||a.sourceIp),sourceTool:B(a.sourceTool),dateFrom:B(a.dateFrom||a.startStored||a.startIso),dateTo:B(a.dateTo||a.endStored||a.endIso),workingTimeRanges:Array.isArray(a.workingTimeRanges)?a.workingTimeRanges:[]}}(a),d=[],e=[],f=a=>(e.push(a),"postgres"===b?`$${e.length}`:"?"),g="postgres"===b?"ILIKE":"LIKE";if(c.keyword){let a=`%${c.keyword}%`;d.push(`(${["prompt_text","response_text","error_text","model","endpoint","provider","account_name","connection_id","display_model","session_id","client_ip","client_host","client_user_agent","source_tool","source_tool_label","source_host"].map(b=>`${b} ${g} ${f(a)}`).join(" OR ")})`)}if(c.model&&d.push(`(model = ${f(c.model)} OR display_model = ${f(c.model)})`),c.stage&&d.push(`stage = ${f(c.stage)}`),c.sessionId&&d.push(`session_id = ${f(c.sessionId)}`),c.clientIp&&d.push(`client_ip ${g} ${f(`%${c.clientIp}%`)}`),c.sourceTool){let a=`%${c.sourceTool}%`;d.push(`(source_tool ${g} ${f(a)} OR source_tool_label ${g} ${f(a)} OR source_host ${g} ${f(a)})`)}let h=c.workingTimeRanges.filter(a=>a?.startIso&&a?.endIso);return h.length?d.push(`(${h.map(a=>`(created_at >= ${f(a.startIso)} AND created_at < ${f(a.endIso)})`).join(" OR ")})`):(c.dateFrom&&d.push(`created_at >= ${f(c.dateFrom)}`),c.dateTo&&d.push(`created_at < ${f(c.dateTo)}`)),{clause:d.length?`WHERE ${d.join(" AND ")}`:"",params:e,add:f}}(b,c),f=await d.queryOne(`SELECT COUNT(*) AS count FROM prompt_logs ${e.clause}`,e.params),g=C(f?.count,0),h=K(await J(d,e,"COALESCE(NULLIF(client_ip, ''), 'unknown') AS metric_key, COALESCE(NULLIF(client_ip, ''), 'unknown') AS label","COALESCE(NULLIF(client_ip, ''), 'unknown')")),i=K(await J(d,e,"COALESCE(NULLIF(source_tool_label, ''), NULLIF(source_tool, ''), NULLIF(source_host, ''), 'unknown') AS metric_key, COALESCE(NULLIF(source_tool_label, ''), NULLIF(source_tool, ''), NULLIF(source_host, ''), 'unknown') AS label","COALESCE(NULLIF(source_tool_label, ''), NULLIF(source_tool, ''), NULLIF(source_host, ''), 'unknown')")),j=K(await J(d,e,"COALESCE(NULLIF(session_id, ''), 'unknown') AS metric_key, COALESCE(NULLIF(session_id, ''), 'unknown') AS label","COALESCE(NULLIF(session_id, ''), 'unknown')")),k=K(await J(d,e,"COALESCE(NULLIF(stage, ''), 'unknown') AS metric_key, COALESCE(NULLIF(stage, ''), 'unknown') AS label","COALESCE(NULLIF(stage, ''), 'unknown')")),l=K(await J(d,e,"COALESCE(NULLIF(display_model, ''), NULLIF(model, ''), 'unknown') AS metric_key, COALESCE(NULLIF(display_model, ''), NULLIF(model, ''), 'unknown') AS label","COALESCE(NULLIF(display_model, ''), NULLIF(model, ''), 'unknown')")),m=K(await J(d,e,"COALESCE(NULLIF(account_name, ''), NULLIF(connection_id, ''), NULLIF(provider, ''), 'unknown') AS metric_key, COALESCE(NULLIF(account_name, ''), NULLIF(connection_id, ''), NULLIF(provider, ''), 'unknown') AS label","COALESCE(NULLIF(account_name, ''), NULLIF(connection_id, ''), NULLIF(provider, ''), 'unknown')")),n=K(await J(d,e,"CASE WHEN error_text IS NOT NULL AND error_text <> '' THEN 'error' ELSE COALESCE(CONCAT('', status_code), 'ok') END AS metric_key, CASE WHEN error_text IS NOT NULL AND error_text <> '' THEN 'error' ELSE COALESCE(CONCAT('', status_code), 'ok') END AS label","CASE WHEN error_text IS NOT NULL AND error_text <> '' THEN 'error' ELSE COALESCE(CONCAT('', status_code), 'ok') END")),o=await (0,z.DU)().catch(()=>({models:[],stages:[]}));return{total:g,sampled:g,disabled:!1,missing:!1,dbInfo:{type:a.type,host:a.host,database:a.database},models:o.models||[],stages:o.stages||[],topClientIps:h,topSourceTools:i,topSessions:j,topStages:k,topModels:l,topAccounts:m,topStatuses:n}}finally{await d.close()}}async function M(a={}){let b=await D();if(!b.enabled)return{disabled:!0,missing:!1,total:0,sampled:0,dbInfo:{type:b.type},models:[],stages:[],topClientIps:[],topSourceTools:[],topSessions:[],topStages:[],topModels:[],topAccounts:[],topStatuses:[]};if(await I(b),"postgres"===b.type||"mysql"===b.type)return L(b,a);throw Error(`Unsupported prompt log database type: ${b.type}`)}var N=c(35901),O=c(77638);let P=new Set(["today","todayWorking","yesterday","yesterdayWorking","24h","thisWeek","lastWeek","7d","thisMonth","lastMonth","30d","60d","all","custom"]),Q="today",R=process.env.DASHBOARD_ANALYTICS_TIME_ZONE||"Asia/Saigon",S=["Token Destroyer","Context Monarch","Prompt Titan","Output Overlord","Quota Crusher"],T="lower(trim(COALESCE(CAST(status AS TEXT), '')))",U=`(
13
+ ${T} GLOB 'error*'
14
+ OR ${T} GLOB 'fail*'
15
+ OR ${T} GLOB 'failed*'
16
+ OR ${T} GLOB 'timeout*'
17
+ OR ${T} GLOB 'network*'
18
+ OR ${T} GLOB 'aborted*'
19
+ OR ${T} GLOB 'abort*'
20
+ OR ${T} GLOB 'rate_limited*'
21
+ OR ${T} GLOB 'provider_error*'
22
+ OR ${T} GLOB 'gateway_error*'
23
+ OR ${T} GLOB 'parse_error*'
24
+ OR ${T} GLOB 'model_error*'
25
+ )`,V=`(
26
+ (COALESCE(statusCode, 0) BETWEEN 200 AND 299 AND NOT ${U})
27
+ OR ${T} = ''
28
+ OR ${T} IN ('ok', 'success', 'succeeded', 'complete', 'completed', 'done', '200')
29
+ OR ${T} GLOB '2[0-9][0-9]*'
30
+ OR ${T} GLOB 'ok*'
31
+ OR ${T} GLOB 'success*'
32
+ OR ${T} GLOB 'succeeded*'
33
+ OR ${T} GLOB 'complete*'
34
+ OR ${T} GLOB 'completed*'
35
+ OR ${T} GLOB 'done*'
36
+ )`,W=`(
37
+ ${T} IN ('pending', 'running', 'in_progress', 'queued', 'processing')
38
+ )`,X=`(NOT ${W})`,Y=`
39
+ SUM(CASE WHEN ${X} THEN 1 ELSE 0 END) AS requests,
40
+ SUM(CASE WHEN ${X} AND ${V} THEN 1 ELSE 0 END) AS success,
41
+ SUM(CASE WHEN ${X} AND NOT ${V} THEN 1 ELSE 0 END) AS errors,
42
+ SUM(CASE WHEN ${W} THEN 1 ELSE 0 END) AS pending,
43
+ COALESCE(SUM(CASE WHEN ${X} THEN COALESCE(promptTokens, 0) ELSE 0 END), 0) AS promptTokens,
44
+ COALESCE(SUM(CASE WHEN ${X} THEN COALESCE(completionTokens, 0) ELSE 0 END), 0) AS completionTokens,
45
+ COALESCE(SUM(CASE WHEN ${X} THEN COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0) ELSE 0 END), 0) AS totalTokens,
46
+ COALESCE(SUM(CASE WHEN ${X} THEN COALESCE(cachedTokens, 0) ELSE 0 END), 0) AS cachedTokens,
47
+ COALESCE(SUM(CASE WHEN ${X} THEN COALESCE(reasoningTokens, 0) ELSE 0 END), 0) AS reasoningTokens,
48
+ COALESCE(SUM(CASE WHEN ${X} THEN COALESCE(cost, 0) ELSE 0 END), 0) AS cost,
49
49
  MAX(timestamp) AS lastSeen
50
- `;function W(a){return String(a||"").trim()}function X(a){return W(a).toLowerCase()}function Y(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function Z(a){let b=W(a);if(!b)return"";let c=new Date(b);return Number.isNaN(c.getTime())?"":c.toISOString()}function $(a,b){let c=new Intl.DateTimeFormat("en-CA",{timeZone:b,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(a),d={};for(let a of c)"literal"!==a.type&&(d[a.type]=Number(a.value));return d}function _(a,b){let c=$(a,b);return Date.UTC(c.year,c.month-1,c.day,c.hour,c.minute,c.second||0)-a.getTime()}function aa(a,b,c,d,e=0,f=0,g=0,h=0){let i=new Date(Date.UTC(b,c-1,d,e,f,g,h)),j=_(i,a);return j=_(i=new Date(i.getTime()-j),a),new Date(Date.UTC(b,c-1,d,e,f,g,h)-j)}function ab(a,b){let c=$(a,b);return{year:c.year,month:c.month,day:c.day}}function ac(a,b){return[{from:[8,0],to:[12,0]},{from:[13,15],to:[17,15]}].map(c=>{let d=aa(b,a.year,a.month,a.day,c.from[0],c.from[1]),e=aa(b,a.year,a.month,a.day,c.to[0],c.to[1]);return{start:d,end:e,startIso:d.toISOString(),endIso:e.toISOString()}})}function ad(a=new Date){let b=new Date(a);return b.setHours(0,0,0,0),b}function ae(a,b){let c=new Date(a);return c.setDate(c.getDate()+b),c}function af(a=new Date){let b=ad(a),c=b.getDay();return ae(b,0===c?-6:1-c)}function ag(a=new Date){let b=new Date(a);return b.setDate(1),b.setHours(0,0,0,0),b}function ah(a={}){var b;return{...function(a={}){let b=P.has(a.period)?a.period:"24h",c=function(a){let b=W(a);if(!b)return"UTC";try{return new Intl.DateTimeFormat("en-US",{timeZone:b}).format(new Date),b}catch{return"UTC"}}(a.timeZone),d=new Date,e=null,f=d,g=[];if("custom"===b){let b=Z(a.dateFrom),c=Z(a.dateTo);e=new Date(b||d.getTime()-864e5),f=c?new Date(c):d}else if("today"===b)e=ad(d);else if("todayWorking"===b)g=ac(ab(d,c),c),e=g[0]?.start||ad(d),f=g[g.length-1]?.end||d;else if("yesterday"===b){let a=ad(d);e=ae(a,-1),f=a}else if("yesterdayWorking"===b)g=ac(function({year:a,month:b,day:c}){let d=new Date(Date.UTC(a,b-1,c));return d.setUTCDate(d.getUTCDate()+-1),{year:d.getUTCFullYear(),month:d.getUTCMonth()+1,day:d.getUTCDate()}}(ab(d,c)),c),e=g[0]?.start||ae(ad(d),-1),f=g[g.length-1]?.end||ad(d);else if("24h"===b)e=new Date(d.getTime()-864e5);else if("thisWeek"===b)e=af(d);else if("lastWeek"===b){let a=af(d);e=ae(a,-7),f=a}else if("7d"===b)e=new Date(d.getTime()-6048e5);else if("thisMonth"===b)e=ag(d);else if("lastMonth"===b){let a=ag(d);(e=new Date(a)).setMonth(e.getMonth()-1),f=a}else e="30d"===b?new Date(d.getTime()-2592e6):"60d"===b?new Date(d.getTime()-5184e6):null;if(e&&f&&e>f){let a=e;e=f,f=a}return{period:b,timeZone:c,start:e,end:f,startIso:e?e.toISOString():"",endIso:f?f.toISOString():"",workingTimeRanges:g}}(a),provider:W(a.provider),model:W(a.model),connectionId:W(a.connectionId),status:W(a.status),endpoint:W(a.endpoint),apiKey:W(a.apiKey),clientIp:W(a.clientIp||a.sourceIp),sourceTool:W(a.sourceTool),sessionId:W(a.sessionId),keyword:W(a.keyword),maxPromptLogRows:Math.max(200,Math.min(1500,Math.floor(Y(a.maxPromptLogRows,1500)))),userOwnedOnly:!0===a.userOwnedOnly||"1"===a.userOwnedOnly||"true"===a.userOwnedOnly,ownerCandidates:Array.isArray(b=a.ownerCandidates)?[...new Set(b.map(a=>X(a)).filter(Boolean))]:[...new Set(String(b||"").split(/[,\s]+/).map(a=>X(a)).filter(Boolean))],ownedAnyUserOnly:!0===a.ownedAnyUserOnly||"1"===a.ownedAnyUserOnly||"true"===a.ownedAnyUserOnly}}function ai(a){let b,c=W(a);return c?(b=W(c))?b.length<=12?b:`${b.slice(0,8)}...${b.slice(-4)}`:"local-no-key":"local-no-key"}async function aj(a){try{let b=await a.all("SELECT * FROM apiKeys ORDER BY createdAt DESC")||[],c=new Map,d=new Map,e=[];for(let a of b){let b=function(a={}){let b=W(a.key),c=ai(b);return{id:W(a.id),key:b,fingerprint:c,masked:c,name:W(a.name)||c,ownerUser:W(a.ownerUser||a.owner_user),createdByUser:W(a.createdByUser||a.created_by_user),machineId:W(a.machineId||a.machine_id),isActive:void 0===a.isActive||1===a.isActive||!0===a.isActive,createdAt:W(a.createdAt||a.created_at)}}(a);e.push(b),b.key&&c.set(b.key,b),d.set(b.fingerprint,b)}return{rows:b,all:e,byKey:c,byFingerprint:d}}catch{return{rows:[],all:[],byKey:new Map,byFingerprint:new Map}}}async function ak(a){let b=new Map;try{for(let c of await a.all("SELECT id, provider, name, email, isActive FROM providerConnections")||[])b.set(c.id,{id:c.id,provider:c.provider||"",name:c.name||c.email||c.id,email:c.email||"",isActive:1===c.isActive||!0===c.isActive})}catch{}try{for(let c of await a.all("SELECT id, type, name FROM providerNodes")||[]){let a=W(c.id);if(!a)continue;let d=W(c.name)||a;b.set(a,{id:a,provider:a,type:W(c.type),name:d,isProviderNode:!0})}}catch{}return b}function al(a,b=new Map){let c=W(a);if(!c)return"unknown";let d=b.get(c);if(d?.name)return d.name;let e=[...b.values()].filter(a=>a.provider===c&&a.name&&a.name!==c);return 1===e.length?e[0].name:c}function am(a){let b=Y(a.errors,0),c=Y(a.success,0),d=Y(a.pending,0),e=Y(a.requests,c+b),f=Y(a.promptTokens,0),g=Y(a.completionTokens,0),h=Y(a.totalTokens,f+g),i=c+b||e;return{...a,requests:e,success:c,errors:b,pending:d,totalTokens:h,errorRate:i?b/i:0,avgPromptTokens:e?f/e:0,avgCompletionTokens:e?g/e:0,avgTokens:e?h/e:0}}function an(a,b,c,d,e=!1){let f=Array.isArray(d.workingTimeRanges)?d.workingTimeRanges.filter(a=>a?.startIso&&a?.endIso):[];if(f.length){let d=e?"<=":"<";for(let e of(a.push(`(${f.map(()=>`(${c} >= ? AND ${c} ${d} ?)`).join(" OR ")})`),f))b.push(e.startIso,e.endIso);return}d.startIso&&(a.push(`${c} >= ?`),b.push(d.startIso)),d.endIso&&(a.push(`${c} ${e?"<=":"<"} ?`),b.push(d.endIso))}function ao(a,b=null,c={}){let d=[],e=[];if(an(d,e,"timestamp",a,!1),a.provider&&"provider"!==c.skip&&(d.push("provider = ?"),e.push(a.provider)),a.model&&"model"!==c.skip&&(d.push("model = ?"),e.push(a.model)),a.connectionId&&"connectionId"!==c.skip&&(d.push("connectionId = ?"),e.push(a.connectionId)),a.status&&"status"!==c.skip&&(d.push("status = ?"),e.push(a.status)),a.endpoint&&"endpoint"!==c.skip&&(d.push("endpoint = ?"),e.push(a.endpoint)),b&&"apiKey"!==c.skip)if(b.noMatch)d.push("1 = 0");else{let a=[];if((b.keys||[]).length>0){let c=b.keys.map(()=>"?").join(", ");a.push(`(apiKey IN (${c}) OR apiKeyFingerprint IN (${c}) OR apiKeyId IN (${c}))`),e.push(...b.keys,...b.keys,...b.keys)}if(b.filter){a.push("(apiKeyFingerprint LIKE ? OR apiKeyName LIKE ? OR apiKeyOwner LIKE ? OR apiKeyId LIKE ?)");let c=`%${b.filter}%`;e.push(c,c,c,c)}b.includeLocal&&a.push("(apiKey IS NULL OR apiKey = '' OR apiKeyFingerprint = 'local-no-key')"),a.length&&d.push(`(${a.join(" OR ")})`)}let f=a.ownerScope;if(f?.enabled&&"apiKey"!==c.skip)if(f.noMatch)d.push("1 = 0");else{let a=[];if((f.identifiers||[]).length>0){let b=f.identifiers.map(()=>"?").join(", ");a.push(`(apiKey IN (${b}) OR apiKeyFingerprint IN (${b}) OR apiKeyId IN (${b}))`),e.push(...f.identifiers,...f.identifiers,...f.identifiers)}if((f.owners||[]).length>0){let b=f.owners.map(()=>"?").join(", ");a.push(`lower(COALESCE(apiKeyOwner, '')) IN (${b})`),e.push(...f.owners)}d.push(a.length?`(${a.join(" OR ")})`:"1 = 0")}if(a.clientIp&&"clientIp"!==c.skip&&(d.push("clientIpNormalized LIKE ?"),e.push(`%${a.clientIp}%`)),a.sourceTool&&"sourceTool"!==c.skip){d.push("(sourceTool LIKE ? OR sourceToolLabel LIKE ? OR sourceHost LIKE ?)");let b=`%${a.sourceTool}%`;e.push(b,b,b)}return a.sessionId&&"sessionId"!==c.skip&&(d.push("sessionId = ?"),e.push(a.sessionId)),{clause:d.length?`WHERE ${d.join(" AND ")}`:"",params:e}}function ap(a,b){return Math.floor(a/b)*b}async function aq(a,b,c){let d=ao(b,c);return await a.get(`SELECT MIN(timestamp) AS minTs, MAX(timestamp) AS maxTs FROM usageHistory ${d.clause}`,d.params)||{}}async function ar(a,b,c){let d=ao(b,c),e=await a.get(`SELECT
51
- ${V},
50
+ `;function Z(a){return String(a||"").trim()}function $(a){return Z(a).toLowerCase()}function _(a,b=0){let c=Number(a);return Number.isFinite(c)?c:b}function aa(a){let b=Z(a);if(!b)return"";let c=new Date(b);return Number.isNaN(c.getTime())?"":c.toISOString()}function ab(a,b){let c=new Intl.DateTimeFormat("en-CA",{timeZone:b,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(a),d={};for(let a of c)"literal"!==a.type&&(d[a.type]=Number(a.value));return d}function ac(a,b){let c=ab(a,b);return Date.UTC(c.year,c.month-1,c.day,c.hour,c.minute,c.second||0)-a.getTime()}function ad(a,b,c,d,e=0,f=0,g=0,h=0){let i=new Date(Date.UTC(b,c-1,d,e,f,g,h)),j=ac(i,a);return j=ac(i=new Date(i.getTime()-j),a),new Date(Date.UTC(b,c-1,d,e,f,g,h)-j)}function ae(a,b){let c=ab(a,b);return{year:c.year,month:c.month,day:c.day}}function af(a,b){return[{from:[8,0],to:[12,0]},{from:[13,15],to:[17,15]}].map(c=>{let d=ad(b,a.year,a.month,a.day,c.from[0],c.from[1]),e=ad(b,a.year,a.month,a.day,c.to[0],c.to[1]);return{start:d,end:e,startIso:d.toISOString(),endIso:e.toISOString()}})}function ag(a=new Date){let b=new Date(a);return b.setHours(0,0,0,0),b}function ah(a,b){let c=new Date(a);return c.setDate(c.getDate()+b),c}function ai(a=new Date){let b=ag(a),c=b.getDay();return ah(b,0===c?-6:1-c)}function aj(a=new Date){let b=new Date(a);return b.setDate(1),b.setHours(0,0,0,0),b}function ak(a={}){var b;return{...function(a={}){let b=P.has(a.period)?a.period:"24h",c=function(a){let b=Z(a);if(!b)return"UTC";try{return new Intl.DateTimeFormat("en-US",{timeZone:b}).format(new Date),b}catch{return"UTC"}}(a.timeZone),d=new Date,e=null,f=d,g=[];if("custom"===b){let b=aa(a.dateFrom),c=aa(a.dateTo);e=new Date(b||d.getTime()-864e5),f=c?new Date(c):d}else if("today"===b)e=ag(d);else if("todayWorking"===b)g=af(ae(d,c),c),e=g[0]?.start||ag(d),f=g[g.length-1]?.end||d;else if("yesterday"===b){let a=ag(d);e=ah(a,-1),f=a}else if("yesterdayWorking"===b)g=af(function({year:a,month:b,day:c}){let d=new Date(Date.UTC(a,b-1,c));return d.setUTCDate(d.getUTCDate()+-1),{year:d.getUTCFullYear(),month:d.getUTCMonth()+1,day:d.getUTCDate()}}(ae(d,c)),c),e=g[0]?.start||ah(ag(d),-1),f=g[g.length-1]?.end||ag(d);else if("24h"===b)e=new Date(d.getTime()-864e5);else if("thisWeek"===b)e=ai(d);else if("lastWeek"===b){let a=ai(d);e=ah(a,-7),f=a}else if("7d"===b)e=new Date(d.getTime()-6048e5);else if("thisMonth"===b)e=aj(d);else if("lastMonth"===b){let a=aj(d);(e=new Date(a)).setMonth(e.getMonth()-1),f=a}else e="30d"===b?new Date(d.getTime()-2592e6):"60d"===b?new Date(d.getTime()-5184e6):null;if(e&&f&&e>f){let a=e;e=f,f=a}return{period:b,timeZone:c,start:e,end:f,startIso:e?e.toISOString():"",endIso:f?f.toISOString():"",workingTimeRanges:g}}(a),provider:Z(a.provider),model:Z(a.model),connectionId:Z(a.connectionId),status:Z(a.status),endpoint:Z(a.endpoint),apiKey:Z(a.apiKey),clientIp:Z(a.clientIp||a.sourceIp),sourceTool:Z(a.sourceTool),sessionId:Z(a.sessionId),keyword:Z(a.keyword),maxPromptLogRows:Math.max(200,Math.min(1500,Math.floor(_(a.maxPromptLogRows,1500)))),userOwnedOnly:!0===a.userOwnedOnly||"1"===a.userOwnedOnly||"true"===a.userOwnedOnly,ownerCandidates:Array.isArray(b=a.ownerCandidates)?[...new Set(b.map(a=>$(a)).filter(Boolean))]:[...new Set(String(b||"").split(/[,\s]+/).map(a=>$(a)).filter(Boolean))],ownedAnyUserOnly:!0===a.ownedAnyUserOnly||"1"===a.ownedAnyUserOnly||"true"===a.ownedAnyUserOnly}}function al(a){let b,c=Z(a);return c?(b=Z(c))?b.length<=12?b:`${b.slice(0,8)}...${b.slice(-4)}`:"local-no-key":"local-no-key"}async function am(a){try{let b=await a.all("SELECT * FROM apiKeys ORDER BY createdAt DESC")||[],c=new Map,d=new Map,e=[];for(let a of b){let b=function(a={}){let b=Z(a.key),c=al(b);return{id:Z(a.id),key:b,fingerprint:c,masked:c,name:Z(a.name)||c,ownerUser:Z(a.ownerUser||a.owner_user),createdByUser:Z(a.createdByUser||a.created_by_user),machineId:Z(a.machineId||a.machine_id),isActive:void 0===a.isActive||1===a.isActive||!0===a.isActive,createdAt:Z(a.createdAt||a.created_at)}}(a);e.push(b),b.key&&c.set(b.key,b),d.set(b.fingerprint,b)}return{rows:b,all:e,byKey:c,byFingerprint:d}}catch{return{rows:[],all:[],byKey:new Map,byFingerprint:new Map}}}async function an(a){let b=new Map;try{for(let c of await a.all("SELECT id, provider, name, email, isActive FROM providerConnections")||[])b.set(c.id,{id:c.id,provider:c.provider||"",name:c.name||c.email||c.id,email:c.email||"",isActive:1===c.isActive||!0===c.isActive})}catch{}try{for(let c of await a.all("SELECT id, type, name FROM providerNodes")||[]){let a=Z(c.id);if(!a)continue;let d=Z(c.name)||a;b.set(a,{id:a,provider:a,type:Z(c.type),name:d,isProviderNode:!0})}}catch{}return b}function ao(a,b=new Map){let c=Z(a);if(!c)return"unknown";let d=b.get(c);if(d?.name)return d.name;let e=[...b.values()].filter(a=>a.provider===c&&a.name&&a.name!==c);return 1===e.length?e[0].name:c}function ap(a){let b=_(a.errors,0),c=_(a.success,0),d=_(a.pending,0),e=_(a.requests,c+b),f=_(a.promptTokens,0),g=_(a.completionTokens,0),h=_(a.totalTokens,f+g),i=c+b||e;return{...a,requests:e,success:c,errors:b,pending:d,totalTokens:h,errorRate:i?b/i:0,avgPromptTokens:e?f/e:0,avgCompletionTokens:e?g/e:0,avgTokens:e?h/e:0}}function aq(a,b,c,d,e=!1){let f=Array.isArray(d.workingTimeRanges)?d.workingTimeRanges.filter(a=>a?.startIso&&a?.endIso):[];if(f.length){let d=e?"<=":"<";for(let e of(a.push(`(${f.map(()=>`(${c} >= ? AND ${c} ${d} ?)`).join(" OR ")})`),f))b.push(e.startIso,e.endIso);return}d.startIso&&(a.push(`${c} >= ?`),b.push(d.startIso)),d.endIso&&(a.push(`${c} ${e?"<=":"<"} ?`),b.push(d.endIso))}function ar(a,b=null,c={}){let d=[],e=[];if(aq(d,e,"timestamp",a,!1),a.provider&&"provider"!==c.skip&&(d.push("provider = ?"),e.push(a.provider)),a.model&&"model"!==c.skip&&(d.push("model = ?"),e.push(a.model)),a.connectionId&&"connectionId"!==c.skip&&(d.push("connectionId = ?"),e.push(a.connectionId)),a.status&&"status"!==c.skip&&(d.push("status = ?"),e.push(a.status)),a.endpoint&&"endpoint"!==c.skip&&(d.push("endpoint = ?"),e.push(a.endpoint)),b&&"apiKey"!==c.skip)if(b.noMatch)d.push("1 = 0");else{let a=[];if((b.keys||[]).length>0){let c=b.keys.map(()=>"?").join(", ");a.push(`(apiKey IN (${c}) OR apiKeyFingerprint IN (${c}) OR apiKeyId IN (${c}))`),e.push(...b.keys,...b.keys,...b.keys)}if(b.filter){a.push("(apiKeyFingerprint LIKE ? OR apiKeyName LIKE ? OR apiKeyOwner LIKE ? OR apiKeyId LIKE ?)");let c=`%${b.filter}%`;e.push(c,c,c,c)}b.includeLocal&&a.push("(apiKey IS NULL OR apiKey = '' OR apiKeyFingerprint = 'local-no-key')"),a.length&&d.push(`(${a.join(" OR ")})`)}let f=a.ownerScope;if(f?.enabled&&"apiKey"!==c.skip)if(f.noMatch)d.push("1 = 0");else{let a=[];if((f.identifiers||[]).length>0){let b=f.identifiers.map(()=>"?").join(", ");a.push(`(apiKey IN (${b}) OR apiKeyFingerprint IN (${b}) OR apiKeyId IN (${b}))`),e.push(...f.identifiers,...f.identifiers,...f.identifiers)}if((f.owners||[]).length>0){let b=f.owners.map(()=>"?").join(", ");a.push(`lower(COALESCE(apiKeyOwner, '')) IN (${b})`),e.push(...f.owners)}d.push(a.length?`(${a.join(" OR ")})`:"1 = 0")}if(a.clientIp&&"clientIp"!==c.skip&&(d.push("clientIpNormalized LIKE ?"),e.push(`%${a.clientIp}%`)),a.sourceTool&&"sourceTool"!==c.skip){d.push("(sourceTool LIKE ? OR sourceToolLabel LIKE ? OR sourceHost LIKE ?)");let b=`%${a.sourceTool}%`;e.push(b,b,b)}return a.sessionId&&"sessionId"!==c.skip&&(d.push("sessionId = ?"),e.push(a.sessionId)),{clause:d.length?`WHERE ${d.join(" AND ")}`:"",params:e}}function as(a,b){return Math.floor(a/b)*b}async function at(a,b,c){let d=ar(b,c);return await a.get(`SELECT MIN(timestamp) AS minTs, MAX(timestamp) AS maxTs FROM usageHistory ${d.clause}`,d.params)||{}}async function au(a,b,c){let d=ar(b,c),e=await a.get(`SELECT
51
+ ${Y},
52
52
  COUNT(DISTINCT COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''))) AS activeApiKeys,
53
53
  COUNT(DISTINCT NULLIF(provider, '')) AS activeProviders,
54
54
  COUNT(DISTINCT NULLIF(model, '')) AS activeModels,
55
55
  COUNT(DISTINCT NULLIF(endpoint, '')) AS activeEndpoints
56
56
  FROM usageHistory
57
- ${d.clause}`,d.params)||{},f=function(a={}){return am({requests:Y(a.requests,0),success:Y(a.success,0),errors:Y(a.errors,0),pending:Y(a.pending,0),promptTokens:Y(a.promptTokens,0),completionTokens:Y(a.completionTokens,0),totalTokens:Y(a.totalTokens,0),cachedTokens:Y(a.cachedTokens,0),reasoningTokens:Y(a.reasoningTokens,0),cost:Y(a.cost,0),lastSeen:a.lastSeen||""})}(e),g=b.start&&b.end?Math.max(1,(b.end.getTime()-b.start.getTime())/6e4):1;return{...f,activeApiKeys:Y(e.activeApiKeys,0),activeProviders:Y(e.activeProviders,0),activeModels:Y(e.activeModels,0),activeEndpoints:Y(e.activeEndpoints,0),requestsPerMinute:f.requests/g,tokensPerMinute:f.totalTokens/g,inputOutputRatio:f.completionTokens?f.promptTokens/f.completionTokens:f.promptTokens?null:0}}function as(a,b={}){return am({key:W(a.key)||"unknown",label:W(a.label||a.key)||"unknown",requests:Y(a.requests,0),success:Y(a.success,0),errors:Y(a.errors,0),pending:Y(a.pending,0),promptTokens:Y(a.promptTokens,0),completionTokens:Y(a.completionTokens,0),totalTokens:Y(a.totalTokens,0),cachedTokens:Y(a.cachedTokens,0),reasoningTokens:Y(a.reasoningTokens,0),cost:Y(a.cost,0),lastSeen:a.lastSeen||"",...b})}async function at(a,b,c,d,e,f=[],g=50,h="requests DESC, totalTokens DESC"){let i=ao(b,c);return await a.all(`SELECT
57
+ ${d.clause}`,d.params)||{},f=function(a={}){return ap({requests:_(a.requests,0),success:_(a.success,0),errors:_(a.errors,0),pending:_(a.pending,0),promptTokens:_(a.promptTokens,0),completionTokens:_(a.completionTokens,0),totalTokens:_(a.totalTokens,0),cachedTokens:_(a.cachedTokens,0),reasoningTokens:_(a.reasoningTokens,0),cost:_(a.cost,0),lastSeen:a.lastSeen||""})}(e),g=b.start&&b.end?Math.max(1,(b.end.getTime()-b.start.getTime())/6e4):1;return{...f,activeApiKeys:_(e.activeApiKeys,0),activeProviders:_(e.activeProviders,0),activeModels:_(e.activeModels,0),activeEndpoints:_(e.activeEndpoints,0),requestsPerMinute:f.requests/g,tokensPerMinute:f.totalTokens/g,inputOutputRatio:f.completionTokens?f.promptTokens/f.completionTokens:f.promptTokens?null:0}}function av(a,b={}){return ap({key:Z(a.key)||"unknown",label:Z(a.label||a.key)||"unknown",requests:_(a.requests,0),success:_(a.success,0),errors:_(a.errors,0),pending:_(a.pending,0),promptTokens:_(a.promptTokens,0),completionTokens:_(a.completionTokens,0),totalTokens:_(a.totalTokens,0),cachedTokens:_(a.cachedTokens,0),reasoningTokens:_(a.reasoningTokens,0),cost:_(a.cost,0),lastSeen:a.lastSeen||"",...b})}async function aw(a,b,c,d,e,f=[],g=50,h="requests DESC, totalTokens DESC"){let i=ar(b,c);return await a.all(`SELECT
58
58
  ${d},
59
- ${V}
59
+ ${Y}
60
60
  FROM usageHistory
61
61
  ${i.clause}
62
62
  GROUP BY ${e}
63
63
  ORDER BY ${h}
64
- LIMIT ?`,[...f,...i.params,g])||[]}async function au(a,b,c,d,e=new Map){let f=ao(b,c),g=f.clause?`${f.clause} AND ${U}`:`WHERE ${U}`,h=`COALESCE(NULLIF(${d}, ''), 'unknown')`,i=await a.all(`SELECT
64
+ LIMIT ?`,[...f,...i.params,g])||[]}async function ax(a,b,c,d,e=new Map){let f=ar(b,c),g=f.clause?`${f.clause} AND ${X}`:`WHERE ${X}`,h=`COALESCE(NULLIF(${d}, ''), 'unknown')`,i=await a.all(`SELECT
65
65
  COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS apiKeyGroupKey,
66
66
  ${h} AS itemKey,
67
67
  COUNT(*) AS requests,
@@ -70,46 +70,46 @@
70
70
  FROM usageHistory
71
71
  ${g}
72
72
  GROUP BY COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key'), ${h}
73
- ORDER BY apiKeyGroupKey ASC, requests DESC, totalTokens DESC`,f.params)||[],j=new Map;for(let a of i){let b=W(a.itemKey)||"unknown",c="provider"===d?al(b,e):b;!function(a,b,c,d=3){if(!b||!c?.key)return;let e=a.get(b)||[];e.push(c),e.sort((a,b)=>b.requests-a.requests||b.totalTokens-a.totalTokens||String(a.label).localeCompare(String(b.label))),a.set(b,e.slice(0,d))}(j,a.apiKeyGroupKey,{key:b,label:c,requests:Y(a.requests,0),totalTokens:Y(a.totalTokens,0),lastSeen:a.lastSeen||""})}return j}async function av(a,b,c,d,e){let f=await at(a,b,e,"COALESCE(NULLIF(provider, ''), 'unknown') AS key, COALESCE(NULLIF(provider, ''), 'unknown') AS label","COALESCE(NULLIF(provider, ''), 'unknown')"),g=await at(a,b,e,`
73
+ ORDER BY apiKeyGroupKey ASC, requests DESC, totalTokens DESC`,f.params)||[],j=new Map;for(let a of i){let b=Z(a.itemKey)||"unknown",c="provider"===d?ao(b,e):b;!function(a,b,c,d=3){if(!b||!c?.key)return;let e=a.get(b)||[];e.push(c),e.sort((a,b)=>b.requests-a.requests||b.totalTokens-a.totalTokens||String(a.label).localeCompare(String(b.label))),a.set(b,e.slice(0,d))}(j,a.apiKeyGroupKey,{key:b,label:c,requests:_(a.requests,0),totalTokens:_(a.totalTokens,0),lastSeen:a.lastSeen||""})}return j}async function ay(a,b,c,d,e){let f=await aw(a,b,e,"COALESCE(NULLIF(provider, ''), 'unknown') AS key, COALESCE(NULLIF(provider, ''), 'unknown') AS label","COALESCE(NULLIF(provider, ''), 'unknown')"),g=await aw(a,b,e,`
74
74
  COALESCE(NULLIF(provider, ''), 'unknown') || '|' || COALESCE(NULLIF(model, ''), 'unknown') AS key,
75
75
  COALESCE(NULLIF(provider, ''), 'unknown') AS provider,
76
76
  COALESCE(NULLIF(model, ''), 'unknown') AS model,
77
77
  COALESCE(NULLIF(model, ''), 'unknown') || ' (' || COALESCE(NULLIF(provider, ''), 'unknown') || ')' AS label
78
- `,"COALESCE(NULLIF(provider, ''), 'unknown'), COALESCE(NULLIF(model, ''), 'unknown')"),h=await at(a,b,e,`
78
+ `,"COALESCE(NULLIF(provider, ''), 'unknown'), COALESCE(NULLIF(model, ''), 'unknown')"),h=await aw(a,b,e,`
79
79
  COALESCE(NULLIF(connectionId, ''), 'unknown') AS key,
80
80
  COALESCE(NULLIF(connectionId, ''), 'unknown') AS connectionId,
81
81
  COALESCE(NULLIF(provider, ''), 'unknown') AS provider,
82
82
  COALESCE(NULLIF(connectionId, ''), 'unknown') AS label
83
- `,"COALESCE(NULLIF(connectionId, ''), 'unknown')"),i=await at(a,b,e,"COALESCE(NULLIF(endpoint, ''), 'unknown') AS key, COALESCE(NULLIF(endpoint, ''), 'unknown') AS label","COALESCE(NULLIF(endpoint, ''), 'unknown')"),j=await at(a,b,e,"COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS key, COALESCE(NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS rawApiKey, COALESCE(NULLIF(apiKeyName, ''), '') AS apiKeyName, COALESCE(NULLIF(apiKeyOwner, ''), '') AS apiKeyOwner, COALESCE(NULLIF(apiKeyId, ''), '') AS apiKeyId","COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key')"),k=await au(a,b,e,"model",d),l=await au(a,b,e,"provider",d),m=await au(a,b,e,"endpoint",d),n=await at(a,b,e,"COALESCE(NULLIF(status, ''), 'ok') AS key, COALESCE(NULLIF(status, ''), 'ok') AS label","COALESCE(NULLIF(status, ''), 'ok')"),o=ao(b,e),p=await a.all(`SELECT
83
+ `,"COALESCE(NULLIF(connectionId, ''), 'unknown')"),i=await aw(a,b,e,"COALESCE(NULLIF(endpoint, ''), 'unknown') AS key, COALESCE(NULLIF(endpoint, ''), 'unknown') AS label","COALESCE(NULLIF(endpoint, ''), 'unknown')"),j=await aw(a,b,e,"COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS key, COALESCE(NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS rawApiKey, COALESCE(NULLIF(apiKeyName, ''), '') AS apiKeyName, COALESCE(NULLIF(apiKeyOwner, ''), '') AS apiKeyOwner, COALESCE(NULLIF(apiKeyId, ''), '') AS apiKeyId","COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key')"),k=await ax(a,b,e,"model",d),l=await ax(a,b,e,"provider",d),m=await ax(a,b,e,"endpoint",d),n=await aw(a,b,e,"COALESCE(NULLIF(status, ''), 'ok') AS key, COALESCE(NULLIF(status, ''), 'ok') AS label","COALESCE(NULLIF(status, ''), 'ok')"),o=ar(b,e),p=await a.all(`SELECT
84
84
  COALESCE(NULLIF(status, ''), 'error') AS status,
85
85
  COALESCE(NULLIF(provider, ''), 'unknown') AS provider,
86
86
  COALESCE(NULLIF(model, ''), 'unknown') AS model,
87
87
  COALESCE(NULLIF(endpoint, ''), 'unknown') AS endpoint,
88
88
  COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS rawApiKey,
89
89
  COALESCE(NULLIF(status, ''), 'error') || '|' || COALESCE(NULLIF(provider, ''), 'unknown') || '|' || COALESCE(NULLIF(model, ''), 'unknown') || '|' || COALESCE(NULLIF(endpoint, ''), 'unknown') AS key,
90
- ${V}
90
+ ${Y}
91
91
  FROM usageHistory
92
- ${o.clause?`${o.clause} AND NOT ${S} AND NOT ${T}`:`WHERE NOT ${S} AND NOT ${T}`}
92
+ ${o.clause?`${o.clause} AND NOT ${V} AND NOT ${W}`:`WHERE NOT ${V} AND NOT ${W}`}
93
93
  GROUP BY COALESCE(NULLIF(status, ''), 'error'), COALESCE(NULLIF(provider, ''), 'unknown'), COALESCE(NULLIF(model, ''), 'unknown'), COALESCE(NULLIF(endpoint, ''), 'unknown'), COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key')
94
94
  ORDER BY errors DESC, requests DESC, lastSeen DESC
95
- LIMIT ?`,[...o.params,100])||[],q=f.map(a=>as(a,{label:al(a.key||a.label,d),provider:a.key||a.label||"unknown",topModels:[],topApiKeys:[]})),r=g.map(a=>as(a,{provider:a.provider||"",providerLabel:al(a.provider,d),model:a.model||"",label:`${a.model||"unknown"} (${al(a.provider,d)})`,topApiKeys:[]})),s=h.map(a=>{let b=d.get(a.connectionId);return as(a,{label:b?.name||a.connectionId||"unknown",provider:b?.provider||a.provider||"",providerLabel:al(b?.provider||a.provider,d),connectionId:a.connectionId||"",topModels:[]})}),t=i.map(a=>as(a)),u=j.map(a=>{let b="local-no-key"===a.rawApiKey?"":a.rawApiKey,d=c.byKey.get(b)||c.byFingerprint.get(b)||c.all.find(b=>b.id===a.apiKeyId||b.id===a.key),e=d?.fingerprint||ai(b),f=a.apiKeyName||d?.name||(b?e:"Local / kh\xf4ng d\xf9ng API key");return as(a,{key:a.apiKeyId||e,label:f,name:f,fingerprint:e,apiKeyId:a.apiKeyId||d?.id||"",ownerUser:a.apiKeyOwner||d?.ownerUser||"",createdByUser:d?.createdByUser||"",isActive:d?.isActive??null,topModels:k.get(a.key)||[],topProviders:l.get(a.key)||[],topEndpoints:m.get(a.key)||[]})});return{providers:q,models:r,providerAccounts:s,endpoints:t,apiKeys:u,statuses:n.map(a=>as(a)),errors:p.map(a=>{let b="local-no-key"===a.rawApiKey?"":a.rawApiKey,e=c.byKey.get(b)||c.byFingerprint.get(b)||c.all.find(a=>a.id===b);return as(a,{label:a.status||"error",status:a.status||"error",provider:a.provider||"unknown",providerLabel:al(a.provider,d),model:a.model||"unknown",endpoint:a.endpoint||"unknown",apiKey:e?.fingerprint||ai(b)})})}}async function aw(a,b,c,d={}){let e=function(a,b,c){let d=a.start?a.start.getTime():NaN,e=a.end?a.end.getTime():Date.now();if(!Number.isFinite(d)){let a=b?new Date(b).getTime():NaN,f=c?new Date(c).getTime():NaN;Number.isFinite(a)&&(d=a),Number.isFinite(f)&&(e=f)}Number.isFinite(d)||(d=e-864e5);let f=Math.max(1,e-d);return f<=216e5?3e5:f<=1296e5?36e5:f<=6912e5?216e5:f<=648e7?864e5:6048e5}(b,d.minTs,d.maxTs),f=Math.max(60,Math.floor(e/1e3)),g=b.start?b.start.getTime():new Date(d.minTs||Date.now()-864e5).getTime(),h=b.end?b.end.getTime():new Date(d.maxTs||Date.now()).getTime();Number.isFinite(g)||(g=Date.now()-864e5),Number.isFinite(h)||(h=Date.now());let i=Math.floor(((h=Math.max(g=ap(g,e),h))-g)/e)+1,j=f*(i>240?Math.ceil(i/240):1),k=1e3*j,l=ao(b,c),m=await a.all(`SELECT
95
+ LIMIT ?`,[...o.params,100])||[],q=f.map(a=>av(a,{label:ao(a.key||a.label,d),provider:a.key||a.label||"unknown",topModels:[],topApiKeys:[]})),r=g.map(a=>av(a,{provider:a.provider||"",providerLabel:ao(a.provider,d),model:a.model||"",label:`${a.model||"unknown"} (${ao(a.provider,d)})`,topApiKeys:[]})),s=h.map(a=>{let b=d.get(a.connectionId);return av(a,{label:b?.name||a.connectionId||"unknown",provider:b?.provider||a.provider||"",providerLabel:ao(b?.provider||a.provider,d),connectionId:a.connectionId||"",topModels:[]})}),t=i.map(a=>av(a)),u=j.map(a=>{let b="local-no-key"===a.rawApiKey?"":a.rawApiKey,d=c.byKey.get(b)||c.byFingerprint.get(b)||c.all.find(b=>b.id===a.apiKeyId||b.id===a.key),e=d?.fingerprint||al(b),f=a.apiKeyName||d?.name||(b?e:"Local / kh\xf4ng d\xf9ng API key");return av(a,{key:a.apiKeyId||e,label:f,name:f,fingerprint:e,apiKeyId:a.apiKeyId||d?.id||"",ownerUser:a.apiKeyOwner||d?.ownerUser||"",createdByUser:d?.createdByUser||"",isActive:d?.isActive??null,topModels:k.get(a.key)||[],topProviders:l.get(a.key)||[],topEndpoints:m.get(a.key)||[]})});return{providers:q,models:r,providerAccounts:s,endpoints:t,apiKeys:u,statuses:n.map(a=>av(a)),errors:p.map(a=>{let b="local-no-key"===a.rawApiKey?"":a.rawApiKey,e=c.byKey.get(b)||c.byFingerprint.get(b)||c.all.find(a=>a.id===b);return av(a,{label:a.status||"error",status:a.status||"error",provider:a.provider||"unknown",providerLabel:ao(a.provider,d),model:a.model||"unknown",endpoint:a.endpoint||"unknown",apiKey:e?.fingerprint||al(b)})})}}async function az(a,b,c,d={}){let e=function(a,b,c){let d=a.start?a.start.getTime():NaN,e=a.end?a.end.getTime():Date.now();if(!Number.isFinite(d)){let a=b?new Date(b).getTime():NaN,f=c?new Date(c).getTime():NaN;Number.isFinite(a)&&(d=a),Number.isFinite(f)&&(e=f)}Number.isFinite(d)||(d=e-864e5);let f=Math.max(1,e-d);return f<=216e5?3e5:f<=1296e5?36e5:f<=6912e5?216e5:f<=648e7?864e5:6048e5}(b,d.minTs,d.maxTs),f=Math.max(60,Math.floor(e/1e3)),g=b.start?b.start.getTime():new Date(d.minTs||Date.now()-864e5).getTime(),h=b.end?b.end.getTime():new Date(d.maxTs||Date.now()).getTime();Number.isFinite(g)||(g=Date.now()-864e5),Number.isFinite(h)||(h=Date.now());let i=Math.floor(((h=Math.max(g=as(g,e),h))-g)/e)+1,j=f*(i>240?Math.ceil(i/240):1),k=1e3*j,l=ar(b,c),m=await a.all(`SELECT
96
96
  ((CAST(strftime('%s', timestamp) AS INTEGER) / ?) * ?) AS bucketSec,
97
- ${V}
97
+ ${Y}
98
98
  FROM usageHistory
99
99
  ${l.clause}
100
100
  GROUP BY bucketSec
101
101
  HAVING bucketSec IS NOT NULL
102
- ORDER BY bucketSec ASC`,[j,j,...l.params])||[],n=new Map;for(let a=ap(g,k);a<=h;a+=k)n.set(a,{ts:a,label:new Date(a).toISOString(),requests:0,success:0,errors:0,pending:0,promptTokens:0,completionTokens:0,totalTokens:0,cachedTokens:0,reasoningTokens:0,cost:0});for(let a of m){let b=1e3*Y(a.bucketSec,0);b&&n.set(b,{ts:b,label:new Date(b).toISOString(),requests:Y(a.requests,0),success:Y(a.success,0),errors:Y(a.errors,0),pending:Y(a.pending,0),promptTokens:Y(a.promptTokens,0),completionTokens:Y(a.completionTokens,0),totalTokens:Y(a.totalTokens,0),cachedTokens:Y(a.cachedTokens,0),reasoningTokens:Y(a.reasoningTokens,0),cost:Y(a.cost,0)})}return[...n.values()].sort((a,b)=>a.ts-b.ts)}function ax(a,b){if(!a.length)return null;let c=[...a].sort((a,b)=>a-b),d=Math.min(c.length-1,Math.max(0,Math.ceil(b/100*c.length)-1));return c[d]}async function ay(a,b,c){try{let d=ao(b,c),e=d.clause?`${d.clause} AND`:"WHERE",f=[...d.params],g=await a.get(`SELECT COUNT(*) AS samples, AVG(latencyMs) AS avgMs
102
+ ORDER BY bucketSec ASC`,[j,j,...l.params])||[],n=new Map;for(let a=as(g,k);a<=h;a+=k)n.set(a,{ts:a,label:new Date(a).toISOString(),requests:0,success:0,errors:0,pending:0,promptTokens:0,completionTokens:0,totalTokens:0,cachedTokens:0,reasoningTokens:0,cost:0});for(let a of m){let b=1e3*_(a.bucketSec,0);b&&n.set(b,{ts:b,label:new Date(b).toISOString(),requests:_(a.requests,0),success:_(a.success,0),errors:_(a.errors,0),pending:_(a.pending,0),promptTokens:_(a.promptTokens,0),completionTokens:_(a.completionTokens,0),totalTokens:_(a.totalTokens,0),cachedTokens:_(a.cachedTokens,0),reasoningTokens:_(a.reasoningTokens,0),cost:_(a.cost,0)})}return[...n.values()].sort((a,b)=>a.ts-b.ts)}function aA(a,b){if(!a.length)return null;let c=[...a].sort((a,b)=>a-b),d=Math.min(c.length-1,Math.max(0,Math.ceil(b/100*c.length)-1));return c[d]}async function aB(a,b,c){try{let d=ar(b,c),e=d.clause?`${d.clause} AND`:"WHERE",f=[...d.params],g=await a.get(`SELECT COUNT(*) AS samples, AVG(latencyMs) AS avgMs
103
103
  FROM usageHistory
104
- ${e} latencyMs IS NOT NULL AND latencyMs > 0`,f)||{},h=Y(g.samples,0),i=async b=>{if(!h)return null;let c=Math.max(0,Math.min(h-1,Math.ceil(b/100*h)-1)),d=await a.get(`SELECT latencyMs
104
+ ${e} latencyMs IS NOT NULL AND latencyMs > 0`,f)||{},h=_(g.samples,0),i=async b=>{if(!h)return null;let c=Math.max(0,Math.min(h-1,Math.ceil(b/100*h)-1)),d=await a.get(`SELECT latencyMs
105
105
  FROM usageHistory
106
106
  ${e} latencyMs IS NOT NULL AND latencyMs > 0
107
107
  ORDER BY latencyMs ASC
108
- LIMIT 1 OFFSET ?`,[...f,c]);return d?Y(d.latencyMs,null):null};if(h>0)return{samples:h,avgMs:Y(g.avgMs,null),p50Ms:await i(50),p95Ms:await i(95),p99Ms:await i(99)}}catch{}let d=[];try{let c,e,f=(c=[],e=[],an(c,e,"timestamp",b,!1),b.provider&&(c.push("provider = ?"),e.push(b.provider)),b.model&&(c.push("model = ?"),e.push(b.model)),b.connectionId&&(c.push("connectionId = ?"),e.push(b.connectionId)),b.status&&(c.push("status = ?"),e.push(b.status)),{clause:c.length?`WHERE ${c.join(" AND ")}`:"",params:e});d=await a.all(`SELECT data FROM requestDetails ${f.clause} ORDER BY timestamp DESC LIMIT ?`,[...f.params,3e3])||[]}catch{d=[]}let e=[];for(let a of d){let b=function(a){let b=a?.latency||{};for(let c of[b.totalMs,b.total_ms,b.durationMs,b.duration_ms,b.elapsedMs,b.elapsed_ms,b.responseMs,b.response_ms,b.ms,b.total,a?.durationMs,a?.latencyMs]){let a=Number(c);if(Number.isFinite(a)&&a>=0)return a}return null}((0,x.q)(a.data,{})||{});Number.isFinite(b)&&e.push(b)}let f=e.reduce((a,b)=>a+b,0);return{samples:e.length,avgMs:e.length?f/e.length:null,p50Ms:ax(e,50),p95Ms:ax(e,95),p99Ms:ax(e,99)}}function az(a,b,c={}){let d=ao(a,b,c),e=[U,S,"(COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0)) > 0"];c.latencyOnly&&e.push("latencyMs IS NOT NULL AND latencyMs > 0"),c.ttftOnly&&e.push("ttftMs IS NOT NULL AND ttftMs > 0");let f=e.join(" AND ");return{clause:d.clause?`${d.clause} AND ${f}`:`WHERE ${f}`,params:d.params}}async function aA(a,b,c){try{let d=await a.get(`SELECT COUNT(*) AS samples FROM usageHistory ${b.clause} AND ${c}`,b.params)||{};return Y(d.samples,0)}catch{return 0}}async function aB(a,b,c,d,e,f){if(!f||!new Set(["latencyMs","ttftMs","promptTokens","completionTokens","totalTokens"]).has(c))return null;let g=Math.max(0,Math.min(f-1,Math.ceil(e/100*f)-1));try{let e=await a.get(`SELECT ${c} AS value
108
+ LIMIT 1 OFFSET ?`,[...f,c]);return d?_(d.latencyMs,null):null};if(h>0)return{samples:h,avgMs:_(g.avgMs,null),p50Ms:await i(50),p95Ms:await i(95),p99Ms:await i(99)}}catch{}let d=[];try{let c,e,f=(c=[],e=[],aq(c,e,"timestamp",b,!1),b.provider&&(c.push("provider = ?"),e.push(b.provider)),b.model&&(c.push("model = ?"),e.push(b.model)),b.connectionId&&(c.push("connectionId = ?"),e.push(b.connectionId)),b.status&&(c.push("status = ?"),e.push(b.status)),{clause:c.length?`WHERE ${c.join(" AND ")}`:"",params:e});d=await a.all(`SELECT data FROM requestDetails ${f.clause} ORDER BY timestamp DESC LIMIT ?`,[...f.params,3e3])||[]}catch{d=[]}let e=[];for(let a of d){let b=function(a){let b=a?.latency||{};for(let c of[b.totalMs,b.total_ms,b.durationMs,b.duration_ms,b.elapsedMs,b.elapsed_ms,b.responseMs,b.response_ms,b.ms,b.total,a?.durationMs,a?.latencyMs]){let a=Number(c);if(Number.isFinite(a)&&a>=0)return a}return null}((0,x.q)(a.data,{})||{});Number.isFinite(b)&&e.push(b)}let f=e.reduce((a,b)=>a+b,0);return{samples:e.length,avgMs:e.length?f/e.length:null,p50Ms:aA(e,50),p95Ms:aA(e,95),p99Ms:aA(e,99)}}function aC(a,b,c={}){let d=ar(a,b,c),e=[X,V,"(COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0)) > 0"];c.latencyOnly&&e.push("latencyMs IS NOT NULL AND latencyMs > 0"),c.ttftOnly&&e.push("ttftMs IS NOT NULL AND ttftMs > 0");let f=e.join(" AND ");return{clause:d.clause?`${d.clause} AND ${f}`:`WHERE ${f}`,params:d.params}}async function aD(a,b,c){try{let d=await a.get(`SELECT COUNT(*) AS samples FROM usageHistory ${b.clause} AND ${c}`,b.params)||{};return _(d.samples,0)}catch{return 0}}async function aE(a,b,c,d,e,f){if(!f||!new Set(["latencyMs","ttftMs","promptTokens","completionTokens","totalTokens"]).has(c))return null;let g=Math.max(0,Math.min(f-1,Math.ceil(e/100*f)-1));try{let e=await a.get(`SELECT ${c} AS value
109
109
  FROM usageHistory
110
110
  ${b.clause} AND ${d}
111
111
  ORDER BY ${c} ASC
112
- LIMIT 1 OFFSET ?`,[...b.params,g]);return e?Y(e.value,null):null}catch{return null}}function aC({samples:a=0,p95LatencyMs:b=0,p95TtftMs:c=0,slowRequestRate:d=0,errorRate:e=0}={}){if(!a)return{level:"none",label:"Chưa c\xf3 mẫu",tone:"slate",score:null};if(a<10)return{level:"low_sample",label:"\xcdt mẫu",tone:"amber",score:null};let f=100;return(b>0&&(b>9e4?f-=35:b>45e3?f-=20:b>15e3&&(f-=8)),c>0&&(c>45e3?f-=30:c>2e4?f-=16:c>8e3&&(f-=6)),f-=Math.min(30,Math.round(100*d)),f-=Math.min(25,Math.round(100*e)),(f=Math.max(0,Math.min(100,f)))>=85)?{level:"fast",label:"Nhanh",tone:"green",score:f}:f>=70?{level:"ok",label:"Ổn",tone:"blue",score:f}:f>=50?{level:"slow",label:"Chậm",tone:"amber",score:f}:{level:"very_slow",label:"Rất chậm",tone:"red",score:f}}async function aD(a,b,c,d={}){let e=az(b,c,{latencyOnly:!0}),f={};try{f=await a.get(`SELECT
112
+ LIMIT 1 OFFSET ?`,[...b.params,g]);return e?_(e.value,null):null}catch{return null}}function aF({samples:a=0,p95LatencyMs:b=0,p95TtftMs:c=0,slowRequestRate:d=0,errorRate:e=0}={}){if(!a)return{level:"none",label:"Chưa c\xf3 mẫu",tone:"slate",score:null};if(a<10)return{level:"low_sample",label:"\xcdt mẫu",tone:"amber",score:null};let f=100;return(b>0&&(b>9e4?f-=35:b>45e3?f-=20:b>15e3&&(f-=8)),c>0&&(c>45e3?f-=30:c>2e4?f-=16:c>8e3&&(f-=6)),f-=Math.min(30,Math.round(100*d)),f-=Math.min(25,Math.round(100*e)),(f=Math.max(0,Math.min(100,f)))>=85)?{level:"fast",label:"Nhanh",tone:"green",score:f}:f>=70?{level:"ok",label:"Ổn",tone:"blue",score:f}:f>=50?{level:"slow",label:"Chậm",tone:"amber",score:f}:{level:"very_slow",label:"Rất chậm",tone:"red",score:f}}async function aG(a,b,c,d={}){let e=aC(b,c,{latencyOnly:!0}),f={};try{f=await a.get(`SELECT
113
113
  COUNT(*) AS samples,
114
114
  AVG(latencyMs) AS avgLatencyMs,
115
115
  MIN(latencyMs) AS minLatencyMs,
@@ -136,7 +136,7 @@
136
136
  SUM(CASE WHEN promptTokens >= ? THEN 1 ELSE 0 END) AS hugeInputRequests,
137
137
  SUM(CASE WHEN promptTokens >= ? THEN 1 ELSE 0 END) AS extremeInputRequests
138
138
  FROM usageHistory
139
- ${e.clause}`,[45e3,9e4,2e4,3e4,5e4,7e4,...e.params])||{}}catch{f={}}let g=Y(f.samples,0),h=await aA(a,e,"ttftMs IS NOT NULL AND ttftMs > 0"),i=await aA(a,e,"promptTokens IS NOT NULL AND promptTokens > 0"),j=await aA(a,e,"completionTokens IS NOT NULL AND completionTokens > 0"),k=await aB(a,e,"latencyMs","latencyMs IS NOT NULL AND latencyMs > 0",50,g),l=await aB(a,e,"latencyMs","latencyMs IS NOT NULL AND latencyMs > 0",95,g),m=await aB(a,e,"latencyMs","latencyMs IS NOT NULL AND latencyMs > 0",99,g),n=await aB(a,e,"ttftMs","ttftMs IS NOT NULL AND ttftMs > 0",50,h),o=await aB(a,e,"ttftMs","ttftMs IS NOT NULL AND ttftMs > 0",95,h),p=await aB(a,e,"ttftMs","ttftMs IS NOT NULL AND ttftMs > 0",99,h),q=await aB(a,e,"promptTokens","promptTokens IS NOT NULL AND promptTokens > 0",50,i),r=await aB(a,e,"promptTokens","promptTokens IS NOT NULL AND promptTokens > 0",95,i),s=await aB(a,e,"promptTokens","promptTokens IS NOT NULL AND promptTokens > 0",99,i),t=await aB(a,e,"completionTokens","completionTokens IS NOT NULL AND completionTokens > 0",95,j),u=Y(f.slowRequests,0),v=Y(f.verySlowRequests,0),w=Y(f.slowTtftRequests,0),x=Y(f.longInputRequests,0),y=Y(f.hugeInputRequests,0),z=Y(f.extremeInputRequests,0),A=Y(f.totalPromptTokens,0),B=Y(f.totalLatencyMs,0),C=Y(f.totalTtftMs,0),D=Y(f.promptTokensWithTtft,0),E=Y(f.completionTokensWithLatency,0),F=Y(f.latencyMsWithOutput,0),G=Y(f.completionTokensAfterTtft,0),H=Y(f.decodeMs,0),I=g?u/g:0,J=g?v/g:0,K=h?w/h:0,L=g?x/g:0,M=g?y/g:0,N=g?z/g:0,O=aC({samples:g,p95LatencyMs:Y(l,0),p95TtftMs:Y(o,0),slowRequestRate:I,errorRate:Y(d.errorRate,0)});return{samples:g,ttftSamples:h,inputSamples:i,outputSamples:j,label:O.label,level:O.level,tone:O.tone,score:O.score,thresholds:{slowLatencyMs:45e3,verySlowLatencyMs:9e4,slowTtftMs:2e4,longInputTokens:3e4,hugeInputTokens:5e4,extremeInputTokens:7e4},avgLatencyMs:Y(f.avgLatencyMs,null),minLatencyMs:Y(f.minLatencyMs,null),maxLatencyMs:Y(f.maxLatencyMs,null),p50LatencyMs:k,p95LatencyMs:l,p99LatencyMs:m,avgTtftMs:Y(f.avgTtftMs,null),maxTtftMs:Y(f.maxTtftMs,null),p50TtftMs:n,p95TtftMs:o,p99TtftMs:p,avgPromptTokens:Y(f.avgPromptTokens,0),maxPromptTokens:Y(f.maxPromptTokens,0),p50PromptTokens:q,p95PromptTokens:r,p99PromptTokens:s,avgCompletionTokens:Y(f.avgCompletionTokens,0),maxCompletionTokens:Y(f.maxCompletionTokens,0),p95CompletionTokens:t,slowRequests:u,verySlowRequests:v,slowTtftRequests:w,longInputRequests:x,hugeInputRequests:y,extremeInputRequests:z,slowRequestRate:I,verySlowRequestRate:J,slowTtftRate:K,longInputRate:L,hugeInputRate:M,extremeInputRate:N,approxInputTokensPerSecond:C>0?D/(C/1e3):null,outputTokensPerSecond:F>0?E/(F/1e3):null,decodeTokensPerSecond:H>0?G/(H/1e3):null,latencyMsPer10kInputTokens:A>0?B/(A/1e4):null}}async function aE(a,b,c,d=new Map){let e=az(b,c,{latencyOnly:!0});try{return(await a.all(`WITH base AS (
139
+ ${e.clause}`,[45e3,9e4,2e4,3e4,5e4,7e4,...e.params])||{}}catch{f={}}let g=_(f.samples,0),h=await aD(a,e,"ttftMs IS NOT NULL AND ttftMs > 0"),i=await aD(a,e,"promptTokens IS NOT NULL AND promptTokens > 0"),j=await aD(a,e,"completionTokens IS NOT NULL AND completionTokens > 0"),k=await aE(a,e,"latencyMs","latencyMs IS NOT NULL AND latencyMs > 0",50,g),l=await aE(a,e,"latencyMs","latencyMs IS NOT NULL AND latencyMs > 0",95,g),m=await aE(a,e,"latencyMs","latencyMs IS NOT NULL AND latencyMs > 0",99,g),n=await aE(a,e,"ttftMs","ttftMs IS NOT NULL AND ttftMs > 0",50,h),o=await aE(a,e,"ttftMs","ttftMs IS NOT NULL AND ttftMs > 0",95,h),p=await aE(a,e,"ttftMs","ttftMs IS NOT NULL AND ttftMs > 0",99,h),q=await aE(a,e,"promptTokens","promptTokens IS NOT NULL AND promptTokens > 0",50,i),r=await aE(a,e,"promptTokens","promptTokens IS NOT NULL AND promptTokens > 0",95,i),s=await aE(a,e,"promptTokens","promptTokens IS NOT NULL AND promptTokens > 0",99,i),t=await aE(a,e,"completionTokens","completionTokens IS NOT NULL AND completionTokens > 0",95,j),u=_(f.slowRequests,0),v=_(f.verySlowRequests,0),w=_(f.slowTtftRequests,0),x=_(f.longInputRequests,0),y=_(f.hugeInputRequests,0),z=_(f.extremeInputRequests,0),A=_(f.totalPromptTokens,0),B=_(f.totalLatencyMs,0),C=_(f.totalTtftMs,0),D=_(f.promptTokensWithTtft,0),E=_(f.completionTokensWithLatency,0),F=_(f.latencyMsWithOutput,0),G=_(f.completionTokensAfterTtft,0),H=_(f.decodeMs,0),I=g?u/g:0,J=g?v/g:0,K=h?w/h:0,L=g?x/g:0,M=g?y/g:0,N=g?z/g:0,O=aF({samples:g,p95LatencyMs:_(l,0),p95TtftMs:_(o,0),slowRequestRate:I,errorRate:_(d.errorRate,0)});return{samples:g,ttftSamples:h,inputSamples:i,outputSamples:j,label:O.label,level:O.level,tone:O.tone,score:O.score,thresholds:{slowLatencyMs:45e3,verySlowLatencyMs:9e4,slowTtftMs:2e4,longInputTokens:3e4,hugeInputTokens:5e4,extremeInputTokens:7e4},avgLatencyMs:_(f.avgLatencyMs,null),minLatencyMs:_(f.minLatencyMs,null),maxLatencyMs:_(f.maxLatencyMs,null),p50LatencyMs:k,p95LatencyMs:l,p99LatencyMs:m,avgTtftMs:_(f.avgTtftMs,null),maxTtftMs:_(f.maxTtftMs,null),p50TtftMs:n,p95TtftMs:o,p99TtftMs:p,avgPromptTokens:_(f.avgPromptTokens,0),maxPromptTokens:_(f.maxPromptTokens,0),p50PromptTokens:q,p95PromptTokens:r,p99PromptTokens:s,avgCompletionTokens:_(f.avgCompletionTokens,0),maxCompletionTokens:_(f.maxCompletionTokens,0),p95CompletionTokens:t,slowRequests:u,verySlowRequests:v,slowTtftRequests:w,longInputRequests:x,hugeInputRequests:y,extremeInputRequests:z,slowRequestRate:I,verySlowRequestRate:J,slowTtftRate:K,longInputRate:L,hugeInputRate:M,extremeInputRate:N,approxInputTokensPerSecond:C>0?D/(C/1e3):null,outputTokensPerSecond:F>0?E/(F/1e3):null,decodeTokensPerSecond:H>0?G/(H/1e3):null,latencyMsPer10kInputTokens:A>0?B/(A/1e4):null}}async function aH(a,b,c,d=new Map){let e=aC(b,c,{latencyOnly:!0});try{return(await a.all(`WITH base AS (
140
140
  SELECT
141
141
  COALESCE(NULLIF(provider, ''), 'unknown') AS provider,
142
142
  COALESCE(NULLIF(model, ''), 'unknown') AS model,
@@ -184,38 +184,38 @@
184
184
  FROM ranked
185
185
  GROUP BY provider, model
186
186
  ORDER BY samples DESC, p95LatencyMs DESC
187
- LIMIT ?`,[...e.params,45e3,2e4,3e4,5e4,30])||[]).map(a=>{let b=Y(a.samples,0),c=b?Y(a.slowRequests,0)/b:0,e=b?Y(a.slowTtftRequests,0)/b:0,f=b?Y(a.longInputRequests,0)/b:0,g=b?Y(a.hugeInputRequests,0)/b:0,h=aC({samples:b,p95LatencyMs:Y(a.p95LatencyMs,0),p95TtftMs:Y(a.p95TtftMs,0),slowRequestRate:c});return{key:a.key,provider:a.provider,providerLabel:al(a.provider,d),model:a.model,label:`${a.model} (${al(a.provider,d)})`,samples:b,level:h.level,labelQuality:h.label,tone:h.tone,score:h.score,avgLatencyMs:Y(a.avgLatencyMs,null),p50LatencyMs:Y(a.p50LatencyMs,null),p95LatencyMs:Y(a.p95LatencyMs,null),maxLatencyMs:Y(a.maxLatencyMs,null),avgTtftMs:Y(a.avgTtftMs,null),p95TtftMs:Y(a.p95TtftMs,null),maxTtftMs:Y(a.maxTtftMs,null),avgPromptTokens:Y(a.avgPromptTokens,0),p95PromptTokens:Y(a.p95PromptTokensApprox,0),maxPromptTokens:Y(a.maxPromptTokens,0),avgCompletionTokens:Y(a.avgCompletionTokens,0),slowRequests:Y(a.slowRequests,0),slowRequestRate:c,slowTtftRate:e,longInputRate:f,hugeInputRate:g,outputTokensPerSecond:Y(a.totalLatencyMs,0)>0?Y(a.totalCompletionTokens,0)/(Y(a.totalLatencyMs,0)/1e3):null}})}catch(a){return console.error("[analytics] Failed to build model experience stats:",a?.message||a),[]}}async function aF(a,b,c,d,e){try{let f=az(b,c,{latencyOnly:!0});return(await a.all(`SELECT id, timestamp, provider, model, connectionId, apiKey, apiKeyId, apiKeyFingerprint, apiKeyName, endpoint, clientIp, clientIpNormalized, sourceTool, sourceToolLabel, sessionId, latencyMs, ttftMs, statusCode, errorCode, errorType, promptTokens, completionTokens, cachedTokens, reasoningTokens, cost, status, tokens
187
+ LIMIT ?`,[...e.params,45e3,2e4,3e4,5e4,30])||[]).map(a=>{let b=_(a.samples,0),c=b?_(a.slowRequests,0)/b:0,e=b?_(a.slowTtftRequests,0)/b:0,f=b?_(a.longInputRequests,0)/b:0,g=b?_(a.hugeInputRequests,0)/b:0,h=aF({samples:b,p95LatencyMs:_(a.p95LatencyMs,0),p95TtftMs:_(a.p95TtftMs,0),slowRequestRate:c});return{key:a.key,provider:a.provider,providerLabel:ao(a.provider,d),model:a.model,label:`${a.model} (${ao(a.provider,d)})`,samples:b,level:h.level,labelQuality:h.label,tone:h.tone,score:h.score,avgLatencyMs:_(a.avgLatencyMs,null),p50LatencyMs:_(a.p50LatencyMs,null),p95LatencyMs:_(a.p95LatencyMs,null),maxLatencyMs:_(a.maxLatencyMs,null),avgTtftMs:_(a.avgTtftMs,null),p95TtftMs:_(a.p95TtftMs,null),maxTtftMs:_(a.maxTtftMs,null),avgPromptTokens:_(a.avgPromptTokens,0),p95PromptTokens:_(a.p95PromptTokensApprox,0),maxPromptTokens:_(a.maxPromptTokens,0),avgCompletionTokens:_(a.avgCompletionTokens,0),slowRequests:_(a.slowRequests,0),slowRequestRate:c,slowTtftRate:e,longInputRate:f,hugeInputRate:g,outputTokensPerSecond:_(a.totalLatencyMs,0)>0?_(a.totalCompletionTokens,0)/(_(a.totalLatencyMs,0)/1e3):null}})}catch(a){return console.error("[analytics] Failed to build model experience stats:",a?.message||a),[]}}async function aI(a,b,c,d,e){try{let f=aC(b,c,{latencyOnly:!0});return(await a.all(`SELECT id, timestamp, provider, model, connectionId, apiKey, apiKeyId, apiKeyFingerprint, apiKeyName, endpoint, clientIp, clientIpNormalized, sourceTool, sourceToolLabel, sessionId, latencyMs, ttftMs, statusCode, errorCode, errorType, promptTokens, completionTokens, cachedTokens, reasoningTokens, cost, status, tokens
188
188
  FROM usageHistory
189
189
  ${f.clause}
190
190
  ORDER BY latencyMs DESC
191
- LIMIT ?`,[...f.params,20])||[]).map(a=>aG(a,d,e))}catch{return[]}}function aG(a,b,c){let d=function(a={}){let b=(0,x.q)(a.tokens,{})||{},c=Y(a.promptTokens,0)||Y(b.prompt_tokens,0)||Y(b.input_tokens,0),d=Y(a.completionTokens,0)||Y(b.completion_tokens,0)||Y(b.output_tokens,0);return{promptTokens:c,completionTokens:d,totalTokens:c+d,cachedTokens:Y(a.cachedTokens,0)||Y(b.cached_tokens,0)||Y(b.cache_read_input_tokens,0)||Y(b.prompt_tokens_details?.cached_tokens,0),reasoningTokens:Y(a.reasoningTokens,0)||Y(b.reasoning_tokens,0)||Y(b.completion_tokens_details?.reasoning_tokens,0)||Y(b.output_tokens_details?.reasoning_tokens,0)}}(a),e=b.get(a.apiKey)||b.get(a.apiKeyFingerprint)||null,f=c.get(a.connectionId)||null;return{id:a.id,timestamp:a.timestamp,provider:a.provider||"",providerLabel:al(a.provider,c),model:a.model||"",connectionId:a.connectionId||"",accountName:f?.name||a.connectionId||"",apiKeyName:a.apiKeyName||e?.name||(a.apiKeyFingerprint||a.apiKey?ai(a.apiKeyFingerprint||a.apiKey):"Local"),apiKeyFingerprint:a.apiKeyFingerprint||e?.fingerprint||ai(a.apiKey),apiKeyId:a.apiKeyId||e?.id||"",clientIp:a.clientIpNormalized||a.clientIp||"",sourceTool:a.sourceTool||a.sourceToolLabel||"",sessionId:a.sessionId||"",latencyMs:Y(a.latencyMs,0),ttftMs:Y(a.ttftMs,0),statusCode:a.statusCode||null,errorCode:a.errorCode||"",errorType:a.errorType||"",endpoint:a.endpoint||"",status:a.status||"ok",promptTokens:d.promptTokens,completionTokens:d.completionTokens,totalTokens:d.totalTokens,cachedTokens:d.cachedTokens,reasoningTokens:d.reasoningTokens,cost:Y(a.cost,0)}}async function aH(a,b,c,d,e){let f=ao(b,c);return(await a.all(`SELECT id, timestamp, provider, model, connectionId, apiKey, apiKeyId, apiKeyFingerprint, apiKeyName, endpoint, clientIp, clientIpNormalized, sourceTool, sourceToolLabel, sessionId, latencyMs, ttftMs, statusCode, errorCode, errorType, promptTokens, completionTokens, cachedTokens, reasoningTokens, cost, status, tokens
191
+ LIMIT ?`,[...f.params,20])||[]).map(a=>aJ(a,d,e))}catch{return[]}}function aJ(a,b,c){let d=function(a={}){let b=(0,x.q)(a.tokens,{})||{},c=_(a.promptTokens,0)||_(b.prompt_tokens,0)||_(b.input_tokens,0),d=_(a.completionTokens,0)||_(b.completion_tokens,0)||_(b.output_tokens,0);return{promptTokens:c,completionTokens:d,totalTokens:c+d,cachedTokens:_(a.cachedTokens,0)||_(b.cached_tokens,0)||_(b.cache_read_input_tokens,0)||_(b.prompt_tokens_details?.cached_tokens,0),reasoningTokens:_(a.reasoningTokens,0)||_(b.reasoning_tokens,0)||_(b.completion_tokens_details?.reasoning_tokens,0)||_(b.output_tokens_details?.reasoning_tokens,0)}}(a),e=b.get(a.apiKey)||b.get(a.apiKeyFingerprint)||null,f=c.get(a.connectionId)||null;return{id:a.id,timestamp:a.timestamp,provider:a.provider||"",providerLabel:ao(a.provider,c),model:a.model||"",connectionId:a.connectionId||"",accountName:f?.name||a.connectionId||"",apiKeyName:a.apiKeyName||e?.name||(a.apiKeyFingerprint||a.apiKey?al(a.apiKeyFingerprint||a.apiKey):"Local"),apiKeyFingerprint:a.apiKeyFingerprint||e?.fingerprint||al(a.apiKey),apiKeyId:a.apiKeyId||e?.id||"",clientIp:a.clientIpNormalized||a.clientIp||"",sourceTool:a.sourceTool||a.sourceToolLabel||"",sessionId:a.sessionId||"",latencyMs:_(a.latencyMs,0),ttftMs:_(a.ttftMs,0),statusCode:a.statusCode||null,errorCode:a.errorCode||"",errorType:a.errorType||"",endpoint:a.endpoint||"",status:a.status||"ok",promptTokens:d.promptTokens,completionTokens:d.completionTokens,totalTokens:d.totalTokens,cachedTokens:d.cachedTokens,reasoningTokens:d.reasoningTokens,cost:_(a.cost,0)}}async function aK(a,b,c,d,e){let f=ar(b,c);return(await a.all(`SELECT id, timestamp, provider, model, connectionId, apiKey, apiKeyId, apiKeyFingerprint, apiKeyName, endpoint, clientIp, clientIpNormalized, sourceTool, sourceToolLabel, sessionId, latencyMs, ttftMs, statusCode, errorCode, errorType, promptTokens, completionTokens, cachedTokens, reasoningTokens, cost, status, tokens
192
192
  FROM usageHistory
193
193
  ${f.clause}
194
194
  ORDER BY timestamp DESC
195
- LIMIT ?`,[...f.params,50])||[]).map(a=>aG(a,d,e))}async function aI(a,b,c,d,e){let f=ao(b,c);return(await a.all(`SELECT id, timestamp, provider, model, connectionId, apiKey, apiKeyId, apiKeyFingerprint, apiKeyName, endpoint, clientIp, clientIpNormalized, sourceTool, sourceToolLabel, sessionId, latencyMs, ttftMs, statusCode, errorCode, errorType, promptTokens, completionTokens, cachedTokens, reasoningTokens, cost, status, tokens
195
+ LIMIT ?`,[...f.params,50])||[]).map(a=>aJ(a,d,e))}async function aL(a,b,c,d,e){let f=ar(b,c);return(await a.all(`SELECT id, timestamp, provider, model, connectionId, apiKey, apiKeyId, apiKeyFingerprint, apiKeyName, endpoint, clientIp, clientIpNormalized, sourceTool, sourceToolLabel, sessionId, latencyMs, ttftMs, statusCode, errorCode, errorType, promptTokens, completionTokens, cachedTokens, reasoningTokens, cost, status, tokens
196
196
  FROM usageHistory
197
197
  ${f.clause}
198
198
  ORDER BY (COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0)) DESC, timestamp DESC
199
- LIMIT ?`,[...f.params,20])||[]).map(a=>aG(a,d,e))}function aJ(a,b,c=b){let d=function(a,b=a){let c=W(a);return c?{value:c,label:W(b)||c}:null}(b,c);return d&&(a.some(a=>a.value===d.value)||a.unshift(d)),a}function aK(a){return{...a,provider:"",model:"",connectionId:"",status:"",endpoint:"",apiKey:""}}async function aL(a,b,c,d=500){let e=ao(aK(b),null),f=e.clause?`${e.clause} AND`:"WHERE";return(await a.all(`SELECT DISTINCT ${c} AS value
199
+ LIMIT ?`,[...f.params,20])||[]).map(a=>aJ(a,d,e))}function aM(a,b,c=b){let d=function(a,b=a){let c=Z(a);return c?{value:c,label:Z(b)||c}:null}(b,c);return d&&(a.some(a=>a.value===d.value)||a.unshift(d)),a}function aN(a){return{...a,provider:"",model:"",connectionId:"",status:"",endpoint:"",apiKey:""}}async function aO(a,b,c,d=500){let e=ar(aN(b),null),f=e.clause?`${e.clause} AND`:"WHERE";return(await a.all(`SELECT DISTINCT ${c} AS value
200
200
  FROM usageHistory
201
201
  ${f} ${c} IS NOT NULL AND ${c} <> ''
202
202
  ORDER BY ${c} ASC
203
- LIMIT ?`,[...e.params,d])||[]).map(a=>W(a.value)).filter(Boolean)}async function aM(a,b){let c=ao(aK(b),null),d=c.clause?`${c.clause} AND`:"WHERE";try{let b=await a.get(`SELECT 1 AS hasLocal
203
+ LIMIT ?`,[...e.params,d])||[]).map(a=>Z(a.value)).filter(Boolean)}async function aP(a,b){let c=ar(aN(b),null),d=c.clause?`${c.clause} AND`:"WHERE";try{let b=await a.get(`SELECT 1 AS hasLocal
204
204
  FROM usageHistory
205
205
  ${d} (apiKey IS NULL OR apiKey = '')
206
- LIMIT 1`,c.params);return!!b?.hasLocal}catch{return!1}}async function aN(a,b,c,d){let e=await aL(a,b,"provider",500),f=await aL(a,b,"model",1e3),g=await aL(a,b,"endpoint",500),h=await aL(a,b,"status",200),i=(await aL(a,b,"connectionId",1e3)).map(a=>{let b=c.get(a),d=al(b?.provider||a,c),e=b?.name?`${b.name}${d&&d!==b.name?` \xb7 ${d}`:""}`:d||a;return{value:a,label:e}}),j=[];for(let c of(await aM(a,b)&&j.push({value:"local-no-key",label:"Local / kh\xf4ng d\xf9ng API key"}),(function(a={},b={}){let c=a.all||[],d=b.ownerScope;if(!d?.enabled)return c;if(d.noMatch)return[];let e=new Set((d.identifiers||[]).map(a=>W(a)).filter(Boolean)),f=new Set((d.ids||[]).map(a=>W(a)).filter(Boolean)),g=new Set((d.fingerprints||[]).map(a=>W(a)).filter(Boolean)),h=new Set((d.owners||[]).map(a=>X(a)).filter(Boolean));return c.filter(a=>!!a&&(a.key&&e.has(a.key)||a.id&&(e.has(a.id)||f.has(a.id))||a.fingerprint&&(e.has(a.fingerprint)||g.has(a.fingerprint))||a.ownerUser&&h.has(X(a.ownerUser))))})(d,b).slice(0,500)))j.push({value:c.fingerprint,label:`${c.name||c.fingerprint}${c.ownerUser?` \xb7 ${c.ownerUser}`:""}`});aJ(i,b.connectionId,b.connectionId),aJ(j,b.apiKey,b.apiKey);let k=e.map(a=>({value:a,label:al(a,c)})),l=f.map(a=>({value:a,label:a})),m=g.map(a=>({value:a,label:a})),n=h.map(a=>({value:a,label:a}));return aJ(k,b.provider,b.provider),aJ(l,b.model,b.model),aJ(m,b.endpoint,b.endpoint),aJ(n,b.status,b.status),{providers:k,models:l.map(a=>a.value),endpoints:m.map(a=>a.value),statuses:n.map(a=>a.value),connections:i,apiKeys:j,clientIps:[],sourceTools:[]}}async function aO(a,b,c,d,e,f,g=new Map){let h=await aN(a,b,g,e);return h.clientIps=(d.topClientIps||[]).map(a=>a.key).filter(Boolean),h.sourceTools=(d.topSourceTools||[]).map(a=>a.key).filter(Boolean),h}let aP="COALESCE(NULLIF(apiKeyOwner, ''), NULLIF(apiKeyName, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKeyId, ''), NULLIF(clientIpNormalized, ''), 'local-no-key')",aQ="COALESCE(NULLIF(apiKeyOwner, ''), NULLIF(apiKeyName, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(clientIpNormalized, ''), 'Local / kh\xf4ng API key')",aR="COALESCE(NULLIF(clientIpNormalized, ''), NULLIF(clientIp, ''), 'unknown')";async function aS(a,b,c,d,e=new Map){if(!new Set(["model","provider","endpoint","clientIpNormalized","sourceTool"]).has(d))return new Map;let f=az(b,c),g=`COALESCE(NULLIF(${d}, ''), 'unknown')`;try{let b=await a.all(`SELECT
207
- ${aP} AS clientKey,
206
+ LIMIT 1`,c.params);return!!b?.hasLocal}catch{return!1}}async function aQ(a,b,c,d){let e=await aO(a,b,"provider",500),f=await aO(a,b,"model",1e3),g=await aO(a,b,"endpoint",500),h=await aO(a,b,"status",200),i=(await aO(a,b,"connectionId",1e3)).map(a=>{let b=c.get(a),d=ao(b?.provider||a,c),e=b?.name?`${b.name}${d&&d!==b.name?` \xb7 ${d}`:""}`:d||a;return{value:a,label:e}}),j=[];for(let c of(await aP(a,b)&&j.push({value:"local-no-key",label:"Local / kh\xf4ng d\xf9ng API key"}),(function(a={},b={}){let c=a.all||[],d=b.ownerScope;if(!d?.enabled)return c;if(d.noMatch)return[];let e=new Set((d.identifiers||[]).map(a=>Z(a)).filter(Boolean)),f=new Set((d.ids||[]).map(a=>Z(a)).filter(Boolean)),g=new Set((d.fingerprints||[]).map(a=>Z(a)).filter(Boolean)),h=new Set((d.owners||[]).map(a=>$(a)).filter(Boolean));return c.filter(a=>!!a&&(a.key&&e.has(a.key)||a.id&&(e.has(a.id)||f.has(a.id))||a.fingerprint&&(e.has(a.fingerprint)||g.has(a.fingerprint))||a.ownerUser&&h.has($(a.ownerUser))))})(d,b).slice(0,500)))j.push({value:c.fingerprint,label:`${c.name||c.fingerprint}${c.ownerUser?` \xb7 ${c.ownerUser}`:""}`});aM(i,b.connectionId,b.connectionId),aM(j,b.apiKey,b.apiKey);let k=e.map(a=>({value:a,label:ao(a,c)})),l=f.map(a=>({value:a,label:a})),m=g.map(a=>({value:a,label:a})),n=h.map(a=>({value:a,label:a}));return aM(k,b.provider,b.provider),aM(l,b.model,b.model),aM(m,b.endpoint,b.endpoint),aM(n,b.status,b.status),{providers:k,models:l.map(a=>a.value),endpoints:m.map(a=>a.value),statuses:n.map(a=>a.value),connections:i,apiKeys:j,clientIps:[],sourceTools:[]}}async function aR(a,b,c,d,e,f,g=new Map){let h=await aQ(a,b,g,e);return h.clientIps=(d.topClientIps||[]).map(a=>a.key).filter(Boolean),h.sourceTools=(d.topSourceTools||[]).map(a=>a.key).filter(Boolean),h}let aS="COALESCE(NULLIF(apiKeyOwner, ''), NULLIF(apiKeyName, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKeyId, ''), NULLIF(clientIpNormalized, ''), 'local-no-key')",aT="COALESCE(NULLIF(apiKeyOwner, ''), NULLIF(apiKeyName, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(clientIpNormalized, ''), 'Local / kh\xf4ng API key')",aU="COALESCE(NULLIF(clientIpNormalized, ''), NULLIF(clientIp, ''), 'unknown')";async function aV(a,b,c,d,e=new Map){if(!new Set(["model","provider","endpoint","clientIpNormalized","sourceTool"]).has(d))return new Map;let f=aC(b,c),g=`COALESCE(NULLIF(${d}, ''), 'unknown')`;try{let b=await a.all(`SELECT
207
+ ${aS} AS clientKey,
208
208
  ${g} AS itemKey,
209
209
  COUNT(*) AS requests,
210
210
  COALESCE(SUM(COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0)), 0) AS totalTokens,
211
211
  MAX(timestamp) AS lastSeen
212
212
  FROM usageHistory
213
213
  ${f.clause}
214
- GROUP BY ${aP}, ${g}
215
- ORDER BY clientKey ASC, requests DESC, totalTokens DESC`,f.params)||[],c=new Map;for(let a of b){let b=W(a.itemKey)||"unknown",f="provider"===d?al(b,e):b;!function(a,b,c,d=3){if(!b||!c?.key)return;let e=a.get(b)||[];e.push(c),e.sort((a,b)=>b.requests-a.requests||b.totalTokens-a.totalTokens||String(a.label).localeCompare(String(b.label))),a.set(b,e.slice(0,d))}(c,a.clientKey,{key:b,label:f,requests:Y(a.requests,0),totalTokens:Y(a.totalTokens,0),lastSeen:a.lastSeen||""})}return c}catch(a){return console.error("[analytics] Failed to build client top usage map:",a?.message||a),new Map}}function aT(a={},b={}){let c=Y(a.requests,0),d=Y(a.success,c),e=Y(a.errors,0),f=Y(a.promptTokens,0),g=Y(a.completionTokens,0),h=Y(a.totalTokens,f+g),i=Y(a.p95PromptTokens,0),j=Y(a.p95LatencyMs,null),k=c?e/c:0,l=c?Y(a.longInputRequests,0)/c:0,m=c?Y(a.hugeInputRequests,0)/c:0,n=c?Y(a.extremeInputRequests,0)/c:0,o=c?Y(a.slowRequests,0)/c:0,p=function({requests:a=0,p95PromptTokens:b=0,p95LatencyMs:c=0,longInputRate:d=0,errorRate:e=0}={}){return a?b>=7e4||d>=.5||c>=9e4?{level:"critical",label:"Rất nặng",tone:"red"}:b>=5e4||d>=.3||c>=45e3||e>=.2?{level:"high",label:"Nặng",tone:"amber"}:b>=3e4||d>=.1||e>=.05?{level:"medium",label:"Cần theo d\xf5i",tone:"blue"}:{level:"normal",label:"Ổn",tone:"green"}:{level:"none",label:"Chưa c\xf3 mẫu",tone:"slate"}}({requests:c,p95PromptTokens:i,p95LatencyMs:Y(j,0),longInputRate:l,errorRate:k});return{key:W(a.clientKey)||"unknown",label:W(a.clientLabel||a.clientKey)||"unknown",ownerUser:W(a.ownerUser),apiKeyName:W(a.apiKeyName),apiKeyFingerprint:W(a.apiKeyFingerprint),primaryClientIp:W(a.primaryClientIp),primarySourceTool:W(a.primarySourceTool),apiKeyCount:Y(a.apiKeyCount,0),sourceIpCount:Y(a.sourceIpCount,0),sourceToolCount:Y(a.sourceToolCount,0),sessionCount:Y(a.sessionCount,0),requests:c,success:d,errors:e,errorRate:k,promptTokens:f,completionTokens:g,totalTokens:h,cost:Y(a.cost,0),avgPromptTokens:c?f/c:0,avgCompletionTokens:c?g/c:0,avgTokens:c?h/c:0,p50PromptTokens:Y(a.p50PromptTokens,0),p95PromptTokens:i,maxPromptTokens:Y(a.maxPromptTokens,0),avgLatencyMs:Y(a.avgLatencyMs,null),p95LatencyMs:j,maxLatencyMs:Y(a.maxLatencyMs,null),avgTtftMs:Y(a.avgTtftMs,null),p95TtftMs:Y(a.p95TtftMs,null),longInputRequests:Y(a.longInputRequests,0),hugeInputRequests:Y(a.hugeInputRequests,0),extremeInputRequests:Y(a.extremeInputRequests,0),slowRequests:Y(a.slowRequests,0),slowTtftRequests:Y(a.slowTtftRequests,0),longInputRate:l,hugeInputRate:m,extremeInputRate:n,slowRequestRate:o,slowTtftRate:c?Y(a.slowTtftRequests,0)/c:0,outputTokensPerSecond:Y(a.totalLatencyMs,0)>0?g/(Y(a.totalLatencyMs,0)/1e3):null,level:p.level,pressureLabel:p.label,tone:p.tone,lastSeen:a.lastSeen||"",...b}}async function aU(a,b,c,{dimension:d="apiKey",order:e="tokens",limit:f=25}={}){let g=az(b,c),h="sourceIp"===d;try{return(await a.all(`WITH base AS (
214
+ GROUP BY ${aS}, ${g}
215
+ ORDER BY clientKey ASC, requests DESC, totalTokens DESC`,f.params)||[],c=new Map;for(let a of b){let b=Z(a.itemKey)||"unknown",f="provider"===d?ao(b,e):b;!function(a,b,c,d=3){if(!b||!c?.key)return;let e=a.get(b)||[];e.push(c),e.sort((a,b)=>b.requests-a.requests||b.totalTokens-a.totalTokens||String(a.label).localeCompare(String(b.label))),a.set(b,e.slice(0,d))}(c,a.clientKey,{key:b,label:f,requests:_(a.requests,0),totalTokens:_(a.totalTokens,0),lastSeen:a.lastSeen||""})}return c}catch(a){return console.error("[analytics] Failed to build client top usage map:",a?.message||a),new Map}}function aW(a={},b={}){let c=_(a.requests,0),d=_(a.success,c),e=_(a.errors,0),f=_(a.promptTokens,0),g=_(a.completionTokens,0),h=_(a.totalTokens,f+g),i=_(a.p95PromptTokens,0),j=_(a.p95LatencyMs,null),k=c?e/c:0,l=c?_(a.longInputRequests,0)/c:0,m=c?_(a.hugeInputRequests,0)/c:0,n=c?_(a.extremeInputRequests,0)/c:0,o=c?_(a.slowRequests,0)/c:0,p=function({requests:a=0,p95PromptTokens:b=0,p95LatencyMs:c=0,longInputRate:d=0,errorRate:e=0}={}){return a?b>=7e4||d>=.5||c>=9e4?{level:"critical",label:"Rất nặng",tone:"red"}:b>=5e4||d>=.3||c>=45e3||e>=.2?{level:"high",label:"Nặng",tone:"amber"}:b>=3e4||d>=.1||e>=.05?{level:"medium",label:"Cần theo d\xf5i",tone:"blue"}:{level:"normal",label:"Ổn",tone:"green"}:{level:"none",label:"Chưa c\xf3 mẫu",tone:"slate"}}({requests:c,p95PromptTokens:i,p95LatencyMs:_(j,0),longInputRate:l,errorRate:k});return{key:Z(a.clientKey)||"unknown",label:Z(a.clientLabel||a.clientKey)||"unknown",ownerUser:Z(a.ownerUser),apiKeyName:Z(a.apiKeyName),apiKeyFingerprint:Z(a.apiKeyFingerprint),primaryClientIp:Z(a.primaryClientIp),primarySourceTool:Z(a.primarySourceTool),apiKeyCount:_(a.apiKeyCount,0),sourceIpCount:_(a.sourceIpCount,0),sourceToolCount:_(a.sourceToolCount,0),sessionCount:_(a.sessionCount,0),requests:c,success:d,errors:e,errorRate:k,promptTokens:f,completionTokens:g,totalTokens:h,cost:_(a.cost,0),avgPromptTokens:c?f/c:0,avgCompletionTokens:c?g/c:0,avgTokens:c?h/c:0,p50PromptTokens:_(a.p50PromptTokens,0),p95PromptTokens:i,maxPromptTokens:_(a.maxPromptTokens,0),avgLatencyMs:_(a.avgLatencyMs,null),p95LatencyMs:j,maxLatencyMs:_(a.maxLatencyMs,null),avgTtftMs:_(a.avgTtftMs,null),p95TtftMs:_(a.p95TtftMs,null),longInputRequests:_(a.longInputRequests,0),hugeInputRequests:_(a.hugeInputRequests,0),extremeInputRequests:_(a.extremeInputRequests,0),slowRequests:_(a.slowRequests,0),slowTtftRequests:_(a.slowTtftRequests,0),longInputRate:l,hugeInputRate:m,extremeInputRate:n,slowRequestRate:o,slowTtftRate:c?_(a.slowTtftRequests,0)/c:0,outputTokensPerSecond:_(a.totalLatencyMs,0)>0?g/(_(a.totalLatencyMs,0)/1e3):null,level:p.level,pressureLabel:p.label,tone:p.tone,lastSeen:a.lastSeen||"",...b}}async function aX(a,b,c,{dimension:d="apiKey",order:e="tokens",limit:f=25}={}){let g=aC(b,c),h="sourceIp"===d;try{return(await a.all(`WITH base AS (
216
216
  SELECT
217
- ${h?aR:"COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key')"} AS groupKey,
218
- ${h?aR:"COALESCE(NULLIF(apiKeyName, ''), NULLIF(apiKeyOwner, ''), NULLIF(apiKeyFingerprint, ''), 'Local / kh\xf4ng API key')"} AS groupLabel,
217
+ ${h?aU:"COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key')"} AS groupKey,
218
+ ${h?aU:"COALESCE(NULLIF(apiKeyName, ''), NULLIF(apiKeyOwner, ''), NULLIF(apiKeyFingerprint, ''), 'Local / kh\xf4ng API key')"} AS groupLabel,
219
219
  COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS apiKeyStable,
220
220
  COALESCE(NULLIF(apiKeyName, ''), '') AS apiKeyName,
221
221
  COALESCE(NULLIF(apiKeyOwner, ''), '') AS apiKeyOwner,
@@ -272,10 +272,10 @@
272
272
  GROUP BY groupKey
273
273
  HAVING groupKey <> 'unknown'
274
274
  ORDER BY ${"heavy"===e?"heavyRequests DESC, maxPromptTokens DESC, promptTokens DESC, totalTokens DESC, requests DESC":"totalTokens DESC, promptTokens DESC, requests DESC, maxPromptTokens DESC"}
275
- LIMIT ?`,[...g.params,3e4,5e4,7e4,3e4,3e4,f])||[]).map(a=>(function(a={},b={}){let c=Y(a.requests,0),d=Y(a.promptTokens,0),e=Y(a.completionTokens,0),f=Y(a.totalTokens,d+e);return{key:W(a.key||a.groupKey)||"unknown",label:W(a.label||a.groupLabel||a.key||a.groupKey)||"unknown",requests:c,promptTokens:d,completionTokens:e,totalTokens:f,cost:Y(a.cost,0),avgPromptTokens:c?d/c:0,avgCompletionTokens:c?e/c:0,avgTokens:c?f/c:0,p95PromptTokens:Y(a.p95PromptTokens,0),maxPromptTokens:Y(a.maxPromptTokens,0),p95TotalTokens:Y(a.p95TotalTokens,0),maxTotalTokens:Y(a.maxTotalTokens,0),longInputRequests:Y(a.longInputRequests,0),hugeInputRequests:Y(a.hugeInputRequests,0),extremeInputRequests:Y(a.extremeInputRequests,0),heavyRequests:Y(a.heavyRequests,0),longInputRate:c?Y(a.longInputRequests,0)/c:0,hugeInputRate:c?Y(a.hugeInputRequests,0)/c:0,extremeInputRate:c?Y(a.extremeInputRequests,0)/c:0,heavyRequestRate:c?Y(a.heavyRequests,0)/c:0,apiKeyCount:Y(a.apiKeyCount,0),sourceIpCount:Y(a.sourceIpCount,0),sourceToolCount:Y(a.sourceToolCount,0),modelCount:Y(a.modelCount,0),providerCount:Y(a.providerCount,0),lastSeen:a.lastSeen||"",...b}})(a,{apiKeyName:W(a.apiKeyName),apiKeyOwner:W(a.apiKeyOwner),apiKeyFingerprint:W(a.apiKeyFingerprint),primaryClientIp:W(a.primaryClientIp),primarySourceTool:W(a.primarySourceTool)}))}catch(a){return console.error(`[analytics] Failed to build top ${d} ${e} consumers:`,a?.message||a),[]}}async function aV(a,b,c){return await aU(a,b,c,{dimension:"apiKey",order:"tokens",limit:25})}async function aW(a,b,c){return await aU(a,b,c,{dimension:"sourceIp",order:"tokens",limit:25})}async function aX(a,b,c){return await aU(a,b,c,{dimension:"sourceIp",order:"heavy",limit:25})}async function aY(a,b,c,d=new Map){let e=az(b,c),f=await aS(a,b,c,"model",d),g=await aS(a,b,c,"provider",d),h=await aS(a,b,c,"endpoint",d),i=await aS(a,b,c,"clientIpNormalized",d),j=await aS(a,b,c,"sourceTool",d);try{return(await a.all(`WITH base AS (
275
+ LIMIT ?`,[...g.params,3e4,5e4,7e4,3e4,3e4,f])||[]).map(a=>(function(a={},b={}){let c=_(a.requests,0),d=_(a.promptTokens,0),e=_(a.completionTokens,0),f=_(a.totalTokens,d+e);return{key:Z(a.key||a.groupKey)||"unknown",label:Z(a.label||a.groupLabel||a.key||a.groupKey)||"unknown",requests:c,promptTokens:d,completionTokens:e,totalTokens:f,cost:_(a.cost,0),avgPromptTokens:c?d/c:0,avgCompletionTokens:c?e/c:0,avgTokens:c?f/c:0,p95PromptTokens:_(a.p95PromptTokens,0),maxPromptTokens:_(a.maxPromptTokens,0),p95TotalTokens:_(a.p95TotalTokens,0),maxTotalTokens:_(a.maxTotalTokens,0),longInputRequests:_(a.longInputRequests,0),hugeInputRequests:_(a.hugeInputRequests,0),extremeInputRequests:_(a.extremeInputRequests,0),heavyRequests:_(a.heavyRequests,0),longInputRate:c?_(a.longInputRequests,0)/c:0,hugeInputRate:c?_(a.hugeInputRequests,0)/c:0,extremeInputRate:c?_(a.extremeInputRequests,0)/c:0,heavyRequestRate:c?_(a.heavyRequests,0)/c:0,apiKeyCount:_(a.apiKeyCount,0),sourceIpCount:_(a.sourceIpCount,0),sourceToolCount:_(a.sourceToolCount,0),modelCount:_(a.modelCount,0),providerCount:_(a.providerCount,0),lastSeen:a.lastSeen||"",...b}})(a,{apiKeyName:Z(a.apiKeyName),apiKeyOwner:Z(a.apiKeyOwner),apiKeyFingerprint:Z(a.apiKeyFingerprint),primaryClientIp:Z(a.primaryClientIp),primarySourceTool:Z(a.primarySourceTool)}))}catch(a){return console.error(`[analytics] Failed to build top ${d} ${e} consumers:`,a?.message||a),[]}}async function aY(a,b,c){return await aX(a,b,c,{dimension:"apiKey",order:"tokens",limit:25})}async function aZ(a,b,c){return await aX(a,b,c,{dimension:"sourceIp",order:"tokens",limit:25})}async function a$(a,b,c){return await aX(a,b,c,{dimension:"sourceIp",order:"heavy",limit:25})}async function a_(a,b,c,d=new Map){let e=aC(b,c),f=await aV(a,b,c,"model",d),g=await aV(a,b,c,"provider",d),h=await aV(a,b,c,"endpoint",d),i=await aV(a,b,c,"clientIpNormalized",d),j=await aV(a,b,c,"sourceTool",d);try{return(await a.all(`WITH base AS (
276
276
  SELECT
277
- ${aP} AS clientKey,
278
- ${aQ} AS clientLabel,
277
+ ${aS} AS clientKey,
278
+ ${aT} AS clientLabel,
279
279
  COALESCE(NULLIF(apiKeyOwner, ''), '') AS ownerUser,
280
280
  COALESCE(NULLIF(apiKeyName, ''), '') AS apiKeyName,
281
281
  COALESCE(NULLIF(apiKeyFingerprint, ''), '') AS apiKeyFingerprint,
@@ -339,27 +339,27 @@
339
339
  FROM ranked
340
340
  GROUP BY clientKey
341
341
  ORDER BY promptTokens DESC, totalTokens DESC, requests DESC
342
- LIMIT ?`,[...e.params,3e4,5e4,7e4,45e3,2e4,25])||[]).map(a=>aT(a,{topModels:f.get(a.clientKey)||[],topProviders:g.get(a.clientKey)||[],topEndpoints:h.get(a.clientKey)||[],topIps:i.get(a.clientKey)||[],topTools:j.get(a.clientKey)||[]}))}catch(a){return console.error("[analytics] Failed to build top heavy users:",a?.message||a),[]}}async function aZ(a,b,c){let d=ao(b,c);try{return(await a.all(`SELECT
343
- ${aP} AS clientKey,
344
- ${aQ} AS clientLabel,
342
+ LIMIT ?`,[...e.params,3e4,5e4,7e4,45e3,2e4,25])||[]).map(a=>aW(a,{topModels:f.get(a.clientKey)||[],topProviders:g.get(a.clientKey)||[],topEndpoints:h.get(a.clientKey)||[],topIps:i.get(a.clientKey)||[],topTools:j.get(a.clientKey)||[]}))}catch(a){return console.error("[analytics] Failed to build top heavy users:",a?.message||a),[]}}async function a0(a,b,c){let d=ar(b,c);try{return(await a.all(`SELECT
343
+ ${aS} AS clientKey,
344
+ ${aT} AS clientLabel,
345
345
  COALESCE(NULLIF(apiKeyOwner, ''), '') AS ownerUser,
346
346
  COALESCE(NULLIF(apiKeyName, ''), '') AS apiKeyName,
347
347
  COALESCE(NULLIF(apiKeyFingerprint, ''), '') AS apiKeyFingerprint,
348
348
  MAX(clientIpNormalized) AS primaryClientIp,
349
349
  MAX(COALESCE(NULLIF(sourceTool, ''), NULLIF(sourceToolLabel, ''))) AS primarySourceTool,
350
- SUM(CASE WHEN ${U} THEN 1 ELSE 0 END) AS requests,
351
- SUM(CASE WHEN ${U} AND ${S} THEN 1 ELSE 0 END) AS success,
352
- SUM(CASE WHEN ${U} AND NOT ${S} THEN 1 ELSE 0 END) AS errors,
353
- SUM(CASE WHEN ${U} THEN COALESCE(promptTokens, 0) ELSE 0 END) AS promptTokens,
354
- SUM(CASE WHEN ${U} THEN COALESCE(completionTokens, 0) ELSE 0 END) AS completionTokens,
355
- SUM(CASE WHEN ${U} THEN COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0) ELSE 0 END) AS totalTokens,
350
+ SUM(CASE WHEN ${X} THEN 1 ELSE 0 END) AS requests,
351
+ SUM(CASE WHEN ${X} AND ${V} THEN 1 ELSE 0 END) AS success,
352
+ SUM(CASE WHEN ${X} AND NOT ${V} THEN 1 ELSE 0 END) AS errors,
353
+ SUM(CASE WHEN ${X} THEN COALESCE(promptTokens, 0) ELSE 0 END) AS promptTokens,
354
+ SUM(CASE WHEN ${X} THEN COALESCE(completionTokens, 0) ELSE 0 END) AS completionTokens,
355
+ SUM(CASE WHEN ${X} THEN COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0) ELSE 0 END) AS totalTokens,
356
356
  MAX(timestamp) AS lastSeen
357
357
  FROM usageHistory
358
358
  ${d.clause}
359
- GROUP BY ${aP}
359
+ GROUP BY ${aS}
360
360
  HAVING errors > 0
361
361
  ORDER BY errors DESC, requests DESC
362
- LIMIT ?`,[...d.params,25])||[]).map(a=>aT(a))}catch(a){return console.error("[analytics] Failed to build problem clients:",a?.message||a),[]}}async function a$(a,b,c){let d=az(b,c);try{let b=await a.all(`WITH base AS (
362
+ LIMIT ?`,[...d.params,25])||[]).map(a=>aW(a))}catch(a){return console.error("[analytics] Failed to build problem clients:",a?.message||a),[]}}async function a1(a,b,c){let d=aC(b,c);try{let b=await a.all(`WITH base AS (
363
363
  SELECT
364
364
  CASE
365
365
  WHEN promptTokens < 2000 THEN 'lt2k'
@@ -417,7 +417,7 @@
417
417
  MIN(CASE WHEN ttftMs > 0 AND ttftRank >= ((cnt * 95 + 99) / 100) THEN ttftMs END) AS p95TtftMs
418
418
  FROM ranked
419
419
  GROUP BY bucketKey, label, sortOrder
420
- ORDER BY sortOrder ASC`,d.params)||[],c=b.reduce((a,b)=>a+Y(b.requests,0),0);return b.map(a=>({key:a.key,label:a.label,requests:Y(a.requests,0),share:c?Y(a.requests,0)/c:0,promptTokens:Y(a.promptTokens,0),completionTokens:Y(a.completionTokens,0),totalTokens:Y(a.totalTokens,0),avgPromptTokens:Y(a.avgPromptTokens,0),maxPromptTokens:Y(a.maxPromptTokens,0),avgLatencyMs:Y(a.avgLatencyMs,null),p95LatencyMs:Y(a.p95LatencyMs,null),maxLatencyMs:Y(a.maxLatencyMs,null),avgTtftMs:Y(a.avgTtftMs,null),p95TtftMs:Y(a.p95TtftMs,null)}))}catch(a){return console.error("[analytics] Failed to build input size buckets:",a?.message||a),[]}}async function a_(a,b,c){let d=ao(b,c),e={clause:d.clause?`${d.clause} AND ${U}`:`WHERE ${U}`,params:d.params};try{let b=await a.get(`SELECT
420
+ ORDER BY sortOrder ASC`,d.params)||[],c=b.reduce((a,b)=>a+_(b.requests,0),0);return b.map(a=>({key:a.key,label:a.label,requests:_(a.requests,0),share:c?_(a.requests,0)/c:0,promptTokens:_(a.promptTokens,0),completionTokens:_(a.completionTokens,0),totalTokens:_(a.totalTokens,0),avgPromptTokens:_(a.avgPromptTokens,0),maxPromptTokens:_(a.maxPromptTokens,0),avgLatencyMs:_(a.avgLatencyMs,null),p95LatencyMs:_(a.p95LatencyMs,null),maxLatencyMs:_(a.maxLatencyMs,null),avgTtftMs:_(a.avgTtftMs,null),p95TtftMs:_(a.p95TtftMs,null)}))}catch(a){return console.error("[analytics] Failed to build input size buckets:",a?.message||a),[]}}async function a2(a,b,c){let d=ar(b,c),e={clause:d.clause?`${d.clause} AND ${X}`:`WHERE ${X}`,params:d.params};try{let b=await a.get(`SELECT
421
421
  COUNT(*) AS totalRequests,
422
422
  SUM(CASE WHEN thinkingEnabled = 1 THEN 1 ELSE 0 END) AS thinkingOnRequests,
423
423
  SUM(CASE WHEN thinkingEnabled = 0 THEN 1 ELSE 0 END) AS thinkingOffRequests,
@@ -448,7 +448,7 @@
448
448
  GROUP BY provider, model
449
449
  HAVING requests > 0
450
450
  ORDER BY autoOffRequests DESC, requests DESC
451
- LIMIT 20`,e.params)||[],f=Y(b.totalRequests,0),g=Y(b.autoOffRequests,0),h=Y(b.thinkingOnRequests,0),i=Y(b.thinkingOffRequests,0),j=Y(b.unknownRequests,0),k=Y(b.thresholdConfiguredRequests,0);return{totalRequests:f,thinkingOnRequests:h,thinkingOffRequests:i,unknownRequests:j,autoOffRequests:g,thresholdConfiguredRequests:k,thinkingOnRate:f?h/f:0,thinkingOffRate:f?i/f:0,unknownRate:f?j/f:0,autoOffRate:f?g/f:0,autoOffEligibleHitRate:k?g/k:0,avgPromptChars:Y(b.avgPromptChars,0),maxPromptChars:Y(b.maxPromptChars,0),avgAutoOffPromptChars:Y(b.avgAutoOffPromptChars,0),byReason:c.map(a=>({reason:a.reason||"unknown",requests:Y(a.requests,0),share:g?Y(a.requests,0)/g:0,avgPromptChars:Y(a.avgPromptChars,0),maxPromptChars:Y(a.maxPromptChars,0)})),byModel:d.map(a=>{let b=Y(a.requests,0),c=Y(a.autoOffRequests,0);return{provider:a.provider||"",model:a.model||"",requests:b,thinkingOnRequests:Y(a.thinkingOnRequests,0),thinkingOffRequests:Y(a.thinkingOffRequests,0),autoOffRequests:c,autoOffRate:b?c/b:0,avgPromptChars:Y(a.avgPromptChars,0),maxPromptChars:Y(a.maxPromptChars,0)}})}}catch(a){return console.error("[analytics] Failed to build thinking analytics:",a?.message||a),{totalRequests:0,thinkingOnRequests:0,thinkingOffRequests:0,unknownRequests:0,autoOffRequests:0,thresholdConfiguredRequests:0,thinkingOnRate:0,thinkingOffRate:0,unknownRate:0,autoOffRate:0,autoOffEligibleHitRate:0,byReason:[],byModel:[]}}}async function a0(a,b,c){let d=ao(b,c),e={clause:d.clause?`${d.clause} AND ${U}`:`WHERE ${U}`,params:d.params},f="CASE WHEN COALESCE(promptChars, 0) > 0 THEN promptChars ELSE COALESCE(promptTokens, 0) END";try{let b=await a.get(`SELECT
451
+ LIMIT 20`,e.params)||[],f=_(b.totalRequests,0),g=_(b.autoOffRequests,0),h=_(b.thinkingOnRequests,0),i=_(b.thinkingOffRequests,0),j=_(b.unknownRequests,0),k=_(b.thresholdConfiguredRequests,0);return{totalRequests:f,thinkingOnRequests:h,thinkingOffRequests:i,unknownRequests:j,autoOffRequests:g,thresholdConfiguredRequests:k,thinkingOnRate:f?h/f:0,thinkingOffRate:f?i/f:0,unknownRate:f?j/f:0,autoOffRate:f?g/f:0,autoOffEligibleHitRate:k?g/k:0,avgPromptChars:_(b.avgPromptChars,0),maxPromptChars:_(b.maxPromptChars,0),avgAutoOffPromptChars:_(b.avgAutoOffPromptChars,0),byReason:c.map(a=>({reason:a.reason||"unknown",requests:_(a.requests,0),share:g?_(a.requests,0)/g:0,avgPromptChars:_(a.avgPromptChars,0),maxPromptChars:_(a.maxPromptChars,0)})),byModel:d.map(a=>{let b=_(a.requests,0),c=_(a.autoOffRequests,0);return{provider:a.provider||"",model:a.model||"",requests:b,thinkingOnRequests:_(a.thinkingOnRequests,0),thinkingOffRequests:_(a.thinkingOffRequests,0),autoOffRequests:c,autoOffRate:b?c/b:0,avgPromptChars:_(a.avgPromptChars,0),maxPromptChars:_(a.maxPromptChars,0)}})}}catch(a){return console.error("[analytics] Failed to build thinking analytics:",a?.message||a),{totalRequests:0,thinkingOnRequests:0,thinkingOffRequests:0,unknownRequests:0,autoOffRequests:0,thresholdConfiguredRequests:0,thinkingOnRate:0,thinkingOffRate:0,unknownRate:0,autoOffRate:0,autoOffEligibleHitRate:0,byReason:[],byModel:[]}}}async function a3(a,b,c){let d=ar(b,c),e={clause:d.clause?`${d.clause} AND ${X}`:`WHERE ${X}`,params:d.params},f="CASE WHEN COALESCE(promptChars, 0) > 0 THEN promptChars ELSE COALESCE(promptTokens, 0) END";try{let b=await a.get(`SELECT
452
452
  COUNT(*) AS totalRequests,
453
453
  SUM(CASE WHEN ${f} >= 30000 THEN 1 ELSE 0 END) AS gte30kRequests,
454
454
  SUM(CASE WHEN ${f} >= 50000 THEN 1 ELSE 0 END) AS gte50kRequests,
@@ -495,4 +495,43 @@
495
495
  SUM(CASE WHEN thinkingAutoOff = 1 THEN 1 ELSE 0 END) AS autoOffRequests
496
496
  FROM base
497
497
  GROUP BY label, sortOrder
498
- ORDER BY sortOrder ASC`,e.params)||[],d=Y(b.totalRequests,0),g=Y(b.gte30kRequests,0),h=Y(b.gte50kRequests,0),i=Y(b.gte100kRequests,0);return{totalRequests:d,gte30kRequests:g,gte50kRequests:h,gte100kRequests:i,gte30kRate:d?g/d:0,gte50kRate:d?h/d:0,gte100kRate:d?i/d:0,avgRequestSize:Y(b.avgRequestSize,0),maxRequestSize:Y(b.maxRequestSize,0),avgLargeLatencyMs:Y(b.avgLargeLatencyMs,null),avgLargeTtftMs:Y(b.avgLargeTtftMs,null),largePromptTokens:Y(b.largePromptTokens,0),largeCompletionTokens:Y(b.largeCompletionTokens,0),buckets:c.map(a=>{let b=Y(a.requests,0),c=Y(a.autoOffRequests,0);return{label:a.label,requests:b,share:d?b/d:0,avgRequestSize:Y(a.avgRequestSize,0),maxRequestSize:Y(a.maxRequestSize,0),avgLatencyMs:Y(a.avgLatencyMs,null),avgTtftMs:Y(a.avgTtftMs,null),promptTokens:Y(a.promptTokens,0),completionTokens:Y(a.completionTokens,0),autoOffRequests:c,autoOffRate:b?c/b:0}})}}catch(a){return console.error("[analytics] Failed to build large context analytics:",a?.message||a),{totalRequests:0,gte30kRequests:0,gte50kRequests:0,gte100kRequests:0,gte30kRate:0,gte50kRate:0,gte100kRate:0,buckets:[]}}}async function a1(a,b,c,d={},e=new Map){let f=await aY(a,b,c,e),g=await aZ(a,b,c),h=await aV(a,b,c),i=await aW(a,b,c),j=await aX(a,b,c),k=await a$(a,b,c),l=f[0]||null,m=h[0]||null,n=i[0]||null,o=j[0]||null,p=f.reduce((a,b)=>a+Y(b.totalTokens,0),0),q=Y(d.totalTokens,0),r=l&&q?Y(l.totalTokens,0)/q:0,s=m&&q?Y(m.totalTokens,0)/q:0,t=n&&q?Y(n.totalTokens,0)/q:0,u=k.filter(a=>["30k-50k","50k-70k",">=70k"].includes(a.label)).reduce((a,b)=>a+Y(b.share,0),0),v=k.find(a=>">=70k"===a.label)||null;return{summary:{trackedUsers:f.length,topUserLabel:l?.label||"-",topUserTokens:l?.totalTokens||0,topUserTokenShare:r,topUsersTokenShare:q?p/q:0,topApiKeyLabel:m?.label||"-",topApiKeyTokens:m?.totalTokens||0,topApiKeyTokenShare:s,topSourceIpLabel:n?.label||"-",topSourceIpTokens:n?.totalTokens||0,topSourceIpTokenShare:t,topSourceIpHeavyLabel:o?.label||"-",topSourceIpHeavyRequests:o?.heavyRequests||0,longInputBucketShare:u,extremeInputShare:v?.share||0,problemClients:g.length},topHeavyUsers:f,topProblemClients:g,topApiKeysByTokens:h,topSourceIpsByTokens:i,topSourceIpsByHeavyRequests:j,inputBuckets:k}}function a2(a){let b=String(a??"");return/[",\n\r]/.test(b)?`"${b.replace(/"/g,'""')}"`:b}async function a3(a,b=4){let c=[a].filter(Boolean),d=Math.max(0,Math.max(1,Math.min(6,Number(b)||4))-c.length);if(d<=0)return c;for(let a of(await Promise.all(Array.from({length:d},async()=>{try{return await (0,O.d9)()}catch(a){return console.warn("[dashboardAnalytics] Extra MySQL analytics connection unavailable:",a?.message||a),null}}))))a&&c.push(a);return c}function a4(a,b=0){return Array.isArray(a)&&0!==a.length?a[Math.abs(b)%a.length]||a[0]:null}async function a5(a=[]){let b=[...new Set((a||[]).filter(Boolean))];await Promise.all(b.map(a=>a?.close?.().catch(()=>{})))}async function a6(a={}){let b=JSON.stringify(ah(a)),c=(global._dashboardAnalyticsV2Cache||(global._dashboardAnalyticsV2Cache=new Map),global._dashboardAnalyticsV2Cache),d=c.get(b);if(d&&Date.now()-d.createdAt<15e3)return d.data;let e=ah(a),f=await (0,w.c)(),g=await (0,O.d9)().catch(a=>(console.error("[dashboardAnalytics] MySQL observability query adapter unavailable; SQLite fallback is disabled:",a?.message||a),null));if(!g)throw Error("MySQL observability is not configured or unavailable; SQLite analytics fallback is disabled.");let h=[g];try{h=await a3(g,3);let a=a4(h,0),[d,i]=await Promise.all([aj(f),ak(f)]),j=e.userOwnedOnly?function(a=[],b={}){let c=[...new Set((a||[]).map(a=>X(a)).filter(Boolean))];if(0===c.length)return{enabled:!0,noMatch:!0,owners:[],identifiers:[],ids:[],fingerprints:[]};let d=new Set(c),e=new Set,f=new Set,g=new Set;for(let a of b.all||[]){let b=X(a.ownerUser);b&&d.has(b)&&(a.key&&e.add(a.key),a.id&&(e.add(a.id),f.add(a.id)),a.fingerprint&&(e.add(a.fingerprint),g.add(a.fingerprint)))}return{enabled:!0,noMatch:0===e.size,owners:c,identifiers:[...e],ids:[...f],fingerprints:[...g]}}(e.ownerCandidates,d):e.ownedAnyUserOnly?function(a={}){let b=new Set,c=new Set,d=new Set,e=new Set;for(let f of a.all||[]){let a=X(f.ownerUser);a&&(b.add(a),f.key&&c.add(f.key),f.id&&(c.add(f.id),d.add(f.id)),f.fingerprint&&(c.add(f.fingerprint),e.add(f.fingerprint)))}return{enabled:!0,noMatch:0===c.size&&0===b.size,owners:[...b],identifiers:[...c],ids:[...d],fingerprints:[...e]}}(d):null,k=j?{...e,ownerScope:j}:e,l=function(a,b){let c=X(a);if(!c)return null;let d=[],e=!1;for(let a of(["local","local-no-key","no-key","khong-key","kh\xf4ng-key","kh\xf4ng d\xf9ng api key"].some(a=>a.includes(c)||c.includes(a))&&(e=!0),b.all||[]))[a.key,a.id,a.name,a.ownerUser,a.createdByUser,a.machineId,a.fingerprint,a.masked].some(a=>X(a).includes(c))&&a.key&&d.push(a.key);return a.length>=16&&!d.includes(a)&&d.push(a),{keys:[...new Set(d)],includeLocal:e,noMatch:0===d.length&&!e,filter:c}}(k.apiKey,d),m=k.userOwnedOnly||k.ownedAnyUserOnly?Promise.resolve(function(a="disabled"){return{disabled:!0,reason:a,missing:!1,total:0,sampled:0,dbInfo:{},models:[],stages:[],topClientIps:[],topSourceTools:[],topSessions:[],topStages:[],topModels:[],topAccounts:[],topStatuses:[]}}("user_owned_scope_no_api_key_columns")):M({keyword:k.keyword,model:k.model,sourceTool:k.sourceTool,clientIp:k.clientIp,sessionId:k.sessionId,dateFrom:k.startIso,dateTo:k.endIso,workingTimeRanges:k.workingTimeRanges}),n=(0,N.Wl)({keyword:k.keyword,provider:k.provider,model:k.model,connectionId:k.connectionId,endpoint:k.endpoint,apiKey:k.apiKey,apiKeyScope:j,status:k.status,sourceTool:k.sourceTool,clientIp:k.clientIp,sessionId:k.sessionId,dateFrom:k.startIso,dateTo:k.endIso,workingTimeRanges:k.workingTimeRanges}),[o,p,q,r,s,t]=await Promise.all([aq(a4(h,0),k,l),ar(a4(h,1),k,l),av(a4(h,2),k,d,i,l),ay(a4(h,3),k,l),m,n]),u=function(a={},b=new Map){if(!a||"object"!=typeof a)return a;let c=a=>Array.isArray(a)?a.map(a=>(function(a={},b=new Map){if(!a||"object"!=typeof a)return a;let c=W(a.provider||a.errorSource||a.providerId),d=W(a.providerLabel)||al(c,b),e={...a};for(let a of["sample","sampleMessage","errorMessage","errorMessageShort","message","details"])"string"==typeof e[a]&&(e[a]=function(a,b,c){let d="string"==typeof a?a:"";return d&&b&&c&&b!==c?d.split(b).join(c):a}(e[a],c,d));return{...e,provider:c,providerLabel:d,label:W(e.label)||d||c||"unknown"}})(a,b)):[];return{...a,topErrors:c(a.topErrors),topServerErrors:c(a.topServerErrors),topClientErrors:c(a.topClientErrors),topRateLimitErrors:c(a.topRateLimitErrors),errorDistribution:c(a.errorDistribution),byFaultOwner:c(a.byFaultOwner),byProvider:c(a.byProvider)}}(t,i),v=u?.summary||{};p.rawErrorEvents=Y(u?.total,0),p.serverErrorEvents=Y(v.serverImpacting,0),p.gatewayErrorEvents=Y(v.gateway,0),p.upstreamErrorEvents=Y(v.upstream,0),p.clientErrorEvents=Y(v.client,0),p.rateLimitErrorEvents=Y(v.rateLimit,0),p.unknownErrorEvents=Y(v.unknown,0),p.serverErrorRate=p.requests?p.serverErrorEvents/p.requests:0,p.clientErrorRate=p.requests?p.clientErrorEvents/p.requests:0,p.rateLimitErrorRate=p.requests?p.rateLimitErrorEvents/p.requests:0,u?.topErrors?.length&&(q.errors=u.topErrors);let w=new Map([...d.byKey.entries(),...d.byFingerprint.entries()]),[x,y,z,A,B,C,D]=await Promise.all([aD(a4(h,0),k,l,p),a1(a4(h,1),k,l,p,i),a_(a4(h,2),k,l),a0(a4(h,3),k,l),aw(a4(h,2),k,l,o),aH(a4(h,3),k,l,w,i),aI(a4(h,0),k,l,w,i)]),[E,F]=await Promise.all([aE(a4(h,1),k,l,i),aF(a4(h,2),k,l,w,i)]);x.byModel=E,x.slowestRequests=F,p.userExperienceScore=x.score,p.userExperienceLabel=x.label,p.slowRequestRate=x.slowRequestRate,p.longInputRate=x.longInputRate,p.thinkingAutoOffRate=z.autoOffRate||0,p.largeContextRate=A.gte50kRate||0,p.topHeavyUser=y.summary?.topUserLabel||"",p.topHeavyUserTokenShare=y.summary?.topUserTokenShare||0,p.extremeInputShare=y.summary?.extremeInputShare||0;let G=await aO(a,k,q,s,d,l,i),H=function({overview:a,groups:b,promptLogStats:c,requestErrorStats:d,experience:e,clientRequests:f}){let g=[],h=d?.summary||{},i=Y(h.serverImpacting,0),j=Y(h.client,0),k=Y(h.rateLimit,0),l=Y(a.serverErrorRate,a.requests?i/a.requests:0),m=Y(a.clientErrorRate,a.requests?j/a.requests:0);a.requests>=10&&i>=3&&l>=.05?g.push({level:l>=.15?"danger":"warning",title:"Tỷ lệ lỗi server/provider cao",detail:`${i.toLocaleString("vi-VN")} lỗi server-impacting (${(100*l).toFixed(1)}% request) trong khoảng thời gian đang lọc. Ưu ti\xean kiểm tra upstream/provider, gateway, timeout v\xe0 5xx.`}):a.requests>=10&&a.errorRate>=.2&&m>=.1?g.push({level:"warning",title:"Nhiều lỗi do client/request",detail:`${j.toLocaleString("vi-VN")} lỗi được ph\xe2n loại l\xe0 client-side (${(100*m).toFixed(1)}% request): sai endpoint/model/auth/body/context. Kh\xf4ng n\xean t\xednh nh\xf3m n\xe0y như lỗi server.`}):a.requests>=10&&a.errorRate>=.2&&g.push({level:"warning",title:"Tỷ lệ lỗi tổng cao",detail:`Tổng lỗi usage l\xe0 ${(100*a.errorRate).toFixed(1)}%, nhưng lỗi server-impacting chỉ ${(100*l).toFixed(1)}%. Xem ph\xe2n loại client/server b\xean dưới trước khi kết luận provider hỏng.`}),k>=5&&a.requests>0&&k/a.requests>=.05&&g.push({level:"warning",title:"Rate limit / quota đ\xe1ng ch\xfa \xfd",detail:`${k.toLocaleString("vi-VN")} lỗi rate-limit/quota trong khoảng lọc. Kiểm tra policy API key, quota provider hoặc ph\xe2n tải model.`});let n=b.apiKeys?.[0];n&&a.totalTokens>0&&n.totalTokens/a.totalTokens>=.5&&g.push({level:"warning",title:"Một API key d\xf9ng phần lớn token",detail:`${n.name||n.fingerprint} đang d\xf9ng ${(n.totalTokens/a.totalTokens*100).toFixed(1)}% tổng token.`});let o=c?.topClientIps?.[0];o&&c.total>0&&o.requests/c.total>=.5&&o.requests>=20&&g.push({level:"warning",title:"Một IP chiếm phần lớn request prompt log",detail:`${o.label} chiếm ${(o.requests/c.total*100).toFixed(1)}% prompt logs trong to\xe0n bộ dữ liệu khớp bộ lọc.`});let p=d?.topServerErrors?.[0];return p&&p.requests>=5&&g.push({level:p.requests>=20?"danger":"warning",title:"Provider/Gateway c\xf3 lỗi cần xử l\xfd",detail:`${p.providerLabel||p.provider||p.errorSource||"unknown"}/${p.model||"unknown"} c\xf3 ${p.requests.toLocaleString("vi-VN")} lỗi ${p.errorType||p.status||"server-impacting"}.`}),e?.samples>=10&&Y(e.slowRequestRate,0)>=.2&&g.push({level:e.slowRequestRate>=.4?"danger":"warning",title:"Nhiều request phản hồi chậm",detail:`${(100*e.slowRequestRate).toFixed(1)}% request th\xe0nh c\xf4ng c\xf3 latency >= 45s. Kiểm tra request input d\xe0i, chờ slot/upstream queue v\xe0 tải model server.`}),e?.samples>=10&&Y(e.longInputRate,0)>=.3&&g.push({level:"warning",title:"Tỷ lệ request input d\xe0i cao",detail:`${(100*e.longInputRate).toFixed(1)}% request c\xf3 input >= 30k token. Với VS Code/agent, P95/P99 latency cao c\xf3 thể chủ yếu do prompt eval v\xe0 chờ slot, kh\xf4ng phải do output chậm.`}),f?.summary?.topUserTokenShare>=.35&&g.push({level:f.summary.topUserTokenShare>=.6?"danger":"warning",title:"Token usage tập trung v\xe0o một user/API key",detail:`${f.summary.topUserLabel||"Một client"} đang chiếm ${(100*f.summary.topUserTokenShare).toFixed(1)}% tổng token trong khoảng lọc. N\xean kiểm tra quota, workflow VS Code/agent v\xe0 request input d\xe0i của client n\xe0y.`}),f?.summary?.extremeInputShare>=.1&&g.push({level:f.summary.extremeInputShare>=.25?"danger":"warning",title:"Nhiều request cực d\xe0i >=70k token",detail:`${(100*f.summary.extremeInputShare).toFixed(1)}% request th\xe0nh c\xf4ng c\xf3 input >=70k token. Đ\xe2y l\xe0 nh\xf3m dễ k\xe9o TTFT/P95/P99 l\xean cao v\xe0 l\xe0m request nhỏ phải chờ slot.`}),g}({overview:p,groups:q,promptLogStats:s,requestErrorStats:u,experience:x,clientRequests:y}),I={generatedAt:new Date().toISOString(),analyticsVersion:"v3.5-token-consumer-monitor",filters:{period:k.period,startIso:k.startIso,endIso:k.endIso,provider:k.provider,model:k.model,connectionId:k.connectionId,status:k.status,endpoint:k.endpoint,apiKey:k.apiKey,clientIp:k.clientIp,sourceTool:k.sourceTool,sessionId:k.sessionId,keyword:k.keyword,userOwnedOnly:k.userOwnedOnly,ownedAnyUserOnly:k.ownedAnyUserOnly},overview:p,latency:r,experience:x,clientRequests:y,thinkingAnalytics:z,largeContextAnalytics:A,timeSeries:B,groups:q,promptLogs:s,requestErrors:u,anomalies:H,recentUsage:C,heavyRequests:D,options:G,qualityNotes:[]};if(await a5(h),c.set(b,{createdAt:Date.now(),data:I}),c.size>100){for(let[a,b]of c)if(Date.now()-b.createdAt>15e3&&c.delete(a),c.size<=100)break}return I}catch(a){throw await a5(h),console.error("[dashboardAnalytics] MySQL observability query failed; SQLite fallback is disabled:",a?.message||a),a}}var a7=c(9588);let a8="force-dynamic",a9=["period","dateFrom","dateTo","provider","model","connectionId","status","endpoint","apiKey","clientIp","sourceIp","sourceTool","sessionId","keyword","maxPromptLogRows","timeZone"];async function ba(a){try{let b,{access:c,response:d}=await (0,a7.oW)();if(d)return d;let{searchParams:e}=new URL(a.url),f=function(a){let b={};for(let c of a9){let d=a.get(c);null!==d&&""!==String(d).trim()&&(b[c]=d)}return b}(e);b=c.isAdmin||c.isMonitorAdmin?f:c.isAiGatewaysMonitor?{...f,ownedAnyUserOnly:!0}:{...f,userOwnedOnly:!0,ownerCandidates:[...new Set([...c.candidates||[],c.userId].map(a7.I8).filter(Boolean))]};let g=await a6(b);if("csv"===e.get("format")){let a=(function(a){let b=[];for(let[c,d]of(b.push(["section","key","label","requests","success","errors","errorRate","inputTokens","outputTokens","totalTokens","cost","lastSeen"]),[["providers",a.groups.providers],["models",a.groups.models],["providerAccounts",a.groups.providerAccounts],["apiKeys",a.groups.apiKeys],["endpoints",a.groups.endpoints],["clientIps",a.promptLogs.topClientIps],["sourceTools",a.promptLogs.topSourceTools],["requestErrors",a.requestErrors?.topErrors||a.groups.errors],["modelExperience",a.experience?.byModel||[]],["clientHeavyUsers",a.clientRequests?.topHeavyUsers||[]],["clientTopApiKeysByTokens",a.clientRequests?.topApiKeysByTokens||[]],["clientTopSourceIpsByTokens",a.clientRequests?.topSourceIpsByTokens||[]],["clientTopSourceIpsByHeavyRequests",a.clientRequests?.topSourceIpsByHeavyRequests||[]],["clientProblemClients",a.clientRequests?.topProblemClients||[]],["inputBuckets",a.clientRequests?.inputBuckets||[]]]))for(let a of d||[])b.push([c,a.key||"",a.label||a.name||"",a.requests||0,a.success||0,a.errors||0,a.errorRate||0,a.promptTokens||0,a.completionTokens||0,a.totalTokens||0,a.cost||0,a.lastSeen||""]);return b})(g).map(a=>a.map(a2).join(",")).join("\n");return new Response(a,{status:200,headers:{"Content-Type":"text/csv; charset=utf-8","Content-Disposition":`attachment; filename="bluerouter-analytics-${new Date().toISOString().slice(0,10)}.csv"`,"Cache-Control":"no-store"}})}return v.NextResponse.json(g,{headers:{"Cache-Control":"no-store"}})}catch(a){return console.error("[analytics] Failed to build dashboard analytics:",a),v.NextResponse.json({error:a?.message||"Failed to build dashboard analytics"},{status:500})}}let bb=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/dashboard/analytics/route",pathname:"/api/dashboard/analytics",filename:"route",bundlePath:"app/api/dashboard/analytics/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"D:\\bluerouter\\src\\app\\api\\dashboard\\analytics\\route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:bc,workUnitAsyncStorage:bd,serverHooks:be}=bb;function bf(){return(0,g.patchFetch)({workAsyncStorage:bc,workUnitAsyncStorage:bd})}async function bg(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),bb.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/dashboard/analytics/route";"/index"===d&&(d="/");let e=await bb.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||bb.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===bb.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await bb.getIncrementalCache(a,x,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>bb.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>bb.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await bb.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await bb.handleResponse({req:a,nextConfig:x,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await bb.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},69614:(a,b,c)=>{c.d(b,{V:()=>p});var d=c(88888),e=c(91356),f=c(99129),g=c(73575),h=c(41570),i=c(19035),j=c(24762),k=c(80308),l=c(11980);async function m(a,b,c){if(!(0,i.Gv)(a))throw new f.Ye("Flattened JWS must be an object");if(void 0===a.protected&&void 0===a.header)throw new f.Ye('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==a.protected&&"string"!=typeof a.protected)throw new f.Ye("JWS Protected Header incorrect type");if(void 0===a.payload)throw new f.Ye("JWS Payload missing");if("string"!=typeof a.signature)throw new f.Ye("JWS Signature missing or incorrect type");if(void 0!==a.header&&!(0,i.Gv)(a.header))throw new f.Ye("JWS Unprotected Header incorrect type");let m={};if(a.protected)try{let b=(0,d.D)(a.protected);m=JSON.parse(g.D0.decode(b))}catch{throw new f.Ye("JWS Protected Header is invalid")}if(!(0,i.fz)(m,a.header))throw new f.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...m,...a.header},o=(0,k.n)(f.Ye,new Map([["b64",!0]]),c?.crit,m,n),p=!0;if(o.has("b64")&&"boolean"!=typeof(p=m.b64))throw new f.Ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:q}=n;if("string"!=typeof q||!q)throw new f.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');let r=c&&function(a,b){if(void 0!==b&&(!Array.isArray(b)||b.some(a=>"string"!=typeof a)))throw TypeError(`"${a}" option must be an array of strings`);if(b)return new Set(b)}("algorithms",c.algorithms);if(r&&!r.has(q))throw new f.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof a.payload)throw new f.Ye("JWS Payload must be a string")}else if("string"!=typeof a.payload&&!(a.payload instanceof Uint8Array))throw new f.Ye("JWS Payload must be a string or an Uint8Array instance");let s=!1;"function"==typeof b&&(b=await b(m,a),s=!0),(0,j.y)(q,b,"verify");let t=(0,g.xW)(void 0!==a.protected?(0,g.lF)(a.protected):new Uint8Array,(0,g.lF)("."),"string"==typeof a.payload?p?(0,g.lF)(a.payload):g.Rd.encode(a.payload):a.payload),u=(0,h.h2)(a.signature,"signature",f.Ye),v=await (0,l.l)(b,q);if(!await (0,e.MX)(q,v,u,t))throw new f.h2;let w={payload:p?(0,h.h2)(a.payload,"payload",f.Ye):"string"==typeof a.payload?g.Rd.encode(a.payload):a.payload};return(void 0!==a.protected&&(w.protectedHeader=m),void 0!==a.header&&(w.unprotectedHeader=a.header),s)?{...w,key:v}:w}async function n(a,b,c){if(a instanceof Uint8Array&&(a=g.D0.decode(a)),"string"!=typeof a)throw new f.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:e,2:h,length:i}=a.split(".");if(3!==i)throw new f.Ye("Invalid Compact JWS");let j=await m({payload:e,protected:d,signature:h},b,c),k={payload:j.payload,protectedHeader:j.protectedHeader};return"function"==typeof b?{...k,key:j.key}:k}var o=c(17347);async function p(a,b,c){let d=await n(a,b,c);if(d.protectedHeader.crit?.includes("b64")&&!1===d.protectedHeader.b64)throw new f.Dp("JWTs MUST NOT use unencoded payload");let e={payload:(0,o.k6)(d.protectedHeader,d.payload,c),protectedHeader:d.protectedHeader};return"function"==typeof b?{...e,key:d.key}:e}},73024:a=>{a.exports=require("node:fs")},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},79868:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},90389:(a,b,c)=>{c.d(b,{hS:()=>d});let d=Object.freeze({ADMIN:"admin",MONITOR_ADMIN:"monitor_admin",AI_GATEWAYS_MONITOR:"ai_gateways_monitor",USER:"user",GUEST:"guest"});Object.freeze([{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/analytics",label:"Analytics",icon:"monitoring"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/prompt-logs",label:"Prompt Logs",icon:"manage_search"}]),Object.freeze(["/dashboard","/dashboard/endpoint","/dashboard/api-keys","/dashboard/usage","/dashboard/analytics","/dashboard/quota","/dashboard/prompt-logs"])},91645:a=>{a.exports=require("net")},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},94735:a=>{a.exports=require("events")},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,5592,5573,6935,402,5901,7242],()=>b(b.s=53254));module.exports=c})();
498
+ ORDER BY sortOrder ASC`,e.params)||[],d=_(b.totalRequests,0),g=_(b.gte30kRequests,0),h=_(b.gte50kRequests,0),i=_(b.gte100kRequests,0);return{totalRequests:d,gte30kRequests:g,gte50kRequests:h,gte100kRequests:i,gte30kRate:d?g/d:0,gte50kRate:d?h/d:0,gte100kRate:d?i/d:0,avgRequestSize:_(b.avgRequestSize,0),maxRequestSize:_(b.maxRequestSize,0),avgLargeLatencyMs:_(b.avgLargeLatencyMs,null),avgLargeTtftMs:_(b.avgLargeTtftMs,null),largePromptTokens:_(b.largePromptTokens,0),largeCompletionTokens:_(b.largeCompletionTokens,0),buckets:c.map(a=>{let b=_(a.requests,0),c=_(a.autoOffRequests,0);return{label:a.label,requests:b,share:d?b/d:0,avgRequestSize:_(a.avgRequestSize,0),maxRequestSize:_(a.maxRequestSize,0),avgLatencyMs:_(a.avgLatencyMs,null),avgTtftMs:_(a.avgTtftMs,null),promptTokens:_(a.promptTokens,0),completionTokens:_(a.completionTokens,0),autoOffRequests:c,autoOffRate:b?c/b:0}})}}catch(a){return console.error("[analytics] Failed to build large context analytics:",a?.message||a),{totalRequests:0,gte30kRequests:0,gte50kRequests:0,gte100kRequests:0,gte30kRate:0,gte50kRate:0,gte100kRate:0,buckets:[]}}}async function a4(a,b,c,d={},e=new Map){let f=await a_(a,b,c,e),g=await a0(a,b,c),h=await aY(a,b,c),i=await aZ(a,b,c),j=await a$(a,b,c),k=await a1(a,b,c),l=f[0]||null,m=h[0]||null,n=i[0]||null,o=j[0]||null,p=f.reduce((a,b)=>a+_(b.totalTokens,0),0),q=_(d.totalTokens,0),r=l&&q?_(l.totalTokens,0)/q:0,s=m&&q?_(m.totalTokens,0)/q:0,t=n&&q?_(n.totalTokens,0)/q:0,u=k.filter(a=>["30k-50k","50k-70k",">=70k"].includes(a.label)).reduce((a,b)=>a+_(b.share,0),0),v=k.find(a=>">=70k"===a.label)||null;return{summary:{trackedUsers:f.length,topUserLabel:l?.label||"-",topUserTokens:l?.totalTokens||0,topUserTokenShare:r,topUsersTokenShare:q?p/q:0,topApiKeyLabel:m?.label||"-",topApiKeyTokens:m?.totalTokens||0,topApiKeyTokenShare:s,topSourceIpLabel:n?.label||"-",topSourceIpTokens:n?.totalTokens||0,topSourceIpTokenShare:t,topSourceIpHeavyLabel:o?.label||"-",topSourceIpHeavyRequests:o?.heavyRequests||0,longInputBucketShare:u,extremeInputShare:v?.share||0,problemClients:g.length},topHeavyUsers:f,topProblemClients:g,topApiKeysByTokens:h,topSourceIpsByTokens:i,topSourceIpsByHeavyRequests:j,inputBuckets:k}}function a5(a){let b=String(a??"");return/[",\n\r]/.test(b)?`"${b.replace(/"/g,'""')}"`:b}async function a6(a,b=4){let c=[a].filter(Boolean),d=Math.max(0,Math.max(1,Math.min(6,Number(b)||4))-c.length);if(d<=0)return c;for(let a of(await Promise.all(Array.from({length:d},async()=>{try{return await (0,O.d9)()}catch(a){return console.warn("[dashboardAnalytics] Extra MySQL analytics connection unavailable:",a?.message||a),null}}))))a&&c.push(a);return c}function a7(a,b=0){return Array.isArray(a)&&0!==a.length?a[Math.abs(b)%a.length]||a[0]:null}async function a8(a=[]){let b=[...new Set((a||[]).filter(Boolean))];await Promise.all(b.map(a=>a?.close?.().catch(()=>{})))}function a9(a={}){return{rows:[],generatedAt:"",nextRefreshAt:"",refreshEveryMs:9e5,period:Q,periodLabel:"H\xf4m nay",status:"warming",...a}}function ba(){return global._dashboardTokenLeaderboard||(global._dashboardTokenLeaderboard={data:a9(),refreshPromise:null,timerStarted:!1,lastError:""}),global._dashboardTokenLeaderboard}async function bb(){let a=ak({period:Q,timeZone:R}),b=await (0,O.d9)(),c=[b];try{c=await a6(b,1);let d=a7(c,0),e=aC(a,null),f=await d.get(`SELECT
499
+ SUM(COALESCE(promptTokens, 0) + COALESCE(completionTokens, 0)) AS totalTokens,
500
+ COUNT(*) AS requests
501
+ FROM usageHistory
502
+ ${e.clause}`,e.params)||{},g=_(f.totalTokens,0),h=await d.all(`WITH base AS (
503
+ SELECT
504
+ COALESCE(NULLIF(apiKeyOwner, ''), NULLIF(apiKeyName, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKeyId, ''), 'local-no-key') AS groupKey,
505
+ COALESCE(NULLIF(apiKeyOwner, ''), '') AS ownerUser,
506
+ COALESCE(NULLIF(apiKeyName, ''), '') AS apiKeyName,
507
+ COALESCE(NULLIF(apiKeyFingerprint, ''), '') AS apiKeyFingerprint,
508
+ COALESCE(NULLIF(apiKeyId, ''), NULLIF(apiKeyFingerprint, ''), NULLIF(apiKey, ''), 'local-no-key') AS apiKeyStable,
509
+ COALESCE(NULLIF(clientIpNormalized, ''), NULLIF(clientIp, ''), '') AS clientIpStable,
510
+ COALESCE(NULLIF(provider, ''), 'unknown') AS providerStable,
511
+ COALESCE(NULLIF(model, ''), 'unknown') AS modelStable,
512
+ timestamp,
513
+ COALESCE(promptTokens, 0) AS promptTokens,
514
+ COALESCE(completionTokens, 0) AS completionTokens,
515
+ COALESCE(cost, 0) AS cost
516
+ FROM usageHistory
517
+ ${e.clause}
518
+ )
519
+ SELECT
520
+ groupKey AS key,
521
+ MAX(ownerUser) AS ownerUser,
522
+ MAX(apiKeyName) AS apiKeyName,
523
+ MAX(apiKeyFingerprint) AS apiKeyFingerprint,
524
+ COUNT(*) AS requests,
525
+ SUM(promptTokens) AS promptTokens,
526
+ SUM(completionTokens) AS completionTokens,
527
+ SUM(promptTokens + completionTokens) AS totalTokens,
528
+ SUM(cost) AS cost,
529
+ COUNT(DISTINCT NULLIF(apiKeyStable, '')) AS apiKeyCount,
530
+ COUNT(DISTINCT NULLIF(clientIpStable, '')) AS sourceIpCount,
531
+ COUNT(DISTINCT modelStable) AS modelCount,
532
+ COUNT(DISTINCT providerStable) AS providerCount,
533
+ MAX(timestamp) AS lastSeen
534
+ FROM base
535
+ GROUP BY groupKey
536
+ ORDER BY totalTokens DESC, requests DESC
537
+ LIMIT ?`,[...e.params,5])||[];return{rows:function(a=[],b=0){return a.map((a,c)=>{let d=c+1,e=_(a.promptTokens,0),f=_(a.completionTokens,0),g=_(a.totalTokens,e+f),h=Z(a.ownerUser),i=Z(a.apiKeyName),j=Z(a.apiKeyFingerprint);return{key:Z(a.key)||`${d}`,rank:d,title:S[c]||"Token Royalty",ownerUser:h,label:h||i||j||"Local / kh\xf4ng API key",apiKeyName:i,apiKeyFingerprint:j,requests:_(a.requests,0),promptTokens:e,completionTokens:f,totalTokens:g,cost:_(a.cost,0),apiKeyCount:_(a.apiKeyCount,0),modelCount:_(a.modelCount,0),providerCount:_(a.providerCount,0),sourceIpCount:_(a.sourceIpCount,0),lastSeen:a.lastSeen||"",tokenShare:b?g/b:0}})}(h,g),generatedAt:new Date().toISOString(),nextRefreshAt:new Date(Date.now()+9e5).toISOString(),refreshEveryMs:9e5,period:Q,periodLabel:"H\xf4m nay",status:"ready",totalTokens:g,totalRequests:_(f.requests,0)}}finally{await a8(c)}}async function bc(){let a=ba();return a.refreshPromise||(a.refreshPromise=bb().then(b=>(a.data=b,a.lastError="",b)).catch(b=>{let c=b?.message||String(b);return a.lastError=c,a.data=a9({status:a.data?.rows?.length?"stale":"error",error:c}),console.error("[analytics] Failed to refresh token leaderboard:",c),a.data}).finally(()=>{a.refreshPromise=null})),a.refreshPromise}async function bd(a={}){let b=JSON.stringify(ak(a)),c=(global._dashboardAnalyticsV2Cache||(global._dashboardAnalyticsV2Cache=new Map),global._dashboardAnalyticsV2Cache),d=c.get(b);if(d&&Date.now()-d.createdAt<15e3)return d.data;let e=ak(a),f=await (0,w.c)(),g=await (0,O.d9)().catch(a=>(console.error("[dashboardAnalytics] MySQL observability query adapter unavailable; SQLite fallback is disabled:",a?.message||a),null));if(!g)throw Error("MySQL observability is not configured or unavailable; SQLite analytics fallback is disabled.");let h=[g];try{h=await a6(g,3);let a=a7(h,0),[d,i]=await Promise.all([am(f),an(f)]),j=e.userOwnedOnly?function(a=[],b={}){let c=[...new Set((a||[]).map(a=>$(a)).filter(Boolean))];if(0===c.length)return{enabled:!0,noMatch:!0,owners:[],identifiers:[],ids:[],fingerprints:[]};let d=new Set(c),e=new Set,f=new Set,g=new Set;for(let a of b.all||[]){let b=$(a.ownerUser);b&&d.has(b)&&(a.key&&e.add(a.key),a.id&&(e.add(a.id),f.add(a.id)),a.fingerprint&&(e.add(a.fingerprint),g.add(a.fingerprint)))}return{enabled:!0,noMatch:0===e.size,owners:c,identifiers:[...e],ids:[...f],fingerprints:[...g]}}(e.ownerCandidates,d):e.ownedAnyUserOnly?function(a={}){let b=new Set,c=new Set,d=new Set,e=new Set;for(let f of a.all||[]){let a=$(f.ownerUser);a&&(b.add(a),f.key&&c.add(f.key),f.id&&(c.add(f.id),d.add(f.id)),f.fingerprint&&(c.add(f.fingerprint),e.add(f.fingerprint)))}return{enabled:!0,noMatch:0===c.size&&0===b.size,owners:[...b],identifiers:[...c],ids:[...d],fingerprints:[...e]}}(d):null,k=j?{...e,ownerScope:j}:e,l=function(a,b){let c=$(a);if(!c)return null;let d=[],e=!1;for(let a of(["local","local-no-key","no-key","khong-key","kh\xf4ng-key","kh\xf4ng d\xf9ng api key"].some(a=>a.includes(c)||c.includes(a))&&(e=!0),b.all||[]))[a.key,a.id,a.name,a.ownerUser,a.createdByUser,a.machineId,a.fingerprint,a.masked].some(a=>$(a).includes(c))&&a.key&&d.push(a.key);return a.length>=16&&!d.includes(a)&&d.push(a),{keys:[...new Set(d)],includeLocal:e,noMatch:0===d.length&&!e,filter:c}}(k.apiKey,d),m=k.userOwnedOnly||k.ownedAnyUserOnly?Promise.resolve(function(a="disabled"){return{disabled:!0,reason:a,missing:!1,total:0,sampled:0,dbInfo:{},models:[],stages:[],topClientIps:[],topSourceTools:[],topSessions:[],topStages:[],topModels:[],topAccounts:[],topStatuses:[]}}("user_owned_scope_no_api_key_columns")):M({keyword:k.keyword,model:k.model,sourceTool:k.sourceTool,clientIp:k.clientIp,sessionId:k.sessionId,dateFrom:k.startIso,dateTo:k.endIso,workingTimeRanges:k.workingTimeRanges}),n=(0,N.Wl)({keyword:k.keyword,provider:k.provider,model:k.model,connectionId:k.connectionId,endpoint:k.endpoint,apiKey:k.apiKey,apiKeyScope:j,status:k.status,sourceTool:k.sourceTool,clientIp:k.clientIp,sessionId:k.sessionId,dateFrom:k.startIso,dateTo:k.endIso,workingTimeRanges:k.workingTimeRanges}),[o,p,q,r,s,t]=await Promise.all([at(a7(h,0),k,l),au(a7(h,1),k,l),ay(a7(h,2),k,d,i,l),aB(a7(h,3),k,l),m,n]),u=function(a={},b=new Map){if(!a||"object"!=typeof a)return a;let c=a=>Array.isArray(a)?a.map(a=>(function(a={},b=new Map){if(!a||"object"!=typeof a)return a;let c=Z(a.provider||a.errorSource||a.providerId),d=Z(a.providerLabel)||ao(c,b),e={...a};for(let a of["sample","sampleMessage","errorMessage","errorMessageShort","message","details"])"string"==typeof e[a]&&(e[a]=function(a,b,c){let d="string"==typeof a?a:"";return d&&b&&c&&b!==c?d.split(b).join(c):a}(e[a],c,d));return{...e,provider:c,providerLabel:d,label:Z(e.label)||d||c||"unknown"}})(a,b)):[];return{...a,topErrors:c(a.topErrors),topServerErrors:c(a.topServerErrors),topClientErrors:c(a.topClientErrors),topRateLimitErrors:c(a.topRateLimitErrors),errorDistribution:c(a.errorDistribution),byFaultOwner:c(a.byFaultOwner),byProvider:c(a.byProvider)}}(t,i),v=u?.summary||{};p.rawErrorEvents=_(u?.total,0),p.serverErrorEvents=_(v.serverImpacting,0),p.gatewayErrorEvents=_(v.gateway,0),p.upstreamErrorEvents=_(v.upstream,0),p.clientErrorEvents=_(v.client,0),p.rateLimitErrorEvents=_(v.rateLimit,0),p.unknownErrorEvents=_(v.unknown,0),p.serverErrorRate=p.requests?p.serverErrorEvents/p.requests:0,p.clientErrorRate=p.requests?p.clientErrorEvents/p.requests:0,p.rateLimitErrorRate=p.requests?p.rateLimitErrorEvents/p.requests:0,u?.topErrors?.length&&(q.errors=u.topErrors);let w=new Map([...d.byKey.entries(),...d.byFingerprint.entries()]),[x,y,z,A,B,C,D]=await Promise.all([aG(a7(h,0),k,l,p),a4(a7(h,1),k,l,p,i),a2(a7(h,2),k,l),a3(a7(h,3),k,l),az(a7(h,2),k,l,o),aK(a7(h,3),k,l,w,i),aL(a7(h,0),k,l,w,i)]),[E,F]=await Promise.all([aH(a7(h,1),k,l,i),aI(a7(h,2),k,l,w,i)]);x.byModel=E,x.slowestRequests=F,p.userExperienceScore=x.score,p.userExperienceLabel=x.label,p.slowRequestRate=x.slowRequestRate,p.longInputRate=x.longInputRate,p.thinkingAutoOffRate=z.autoOffRate||0,p.largeContextRate=A.gte50kRate||0,p.topHeavyUser=y.summary?.topUserLabel||"",p.topHeavyUserTokenShare=y.summary?.topUserTokenShare||0,p.extremeInputShare=y.summary?.extremeInputShare||0;let G=await aR(a,k,q,s,d,l,i),H=function({overview:a,groups:b,promptLogStats:c,requestErrorStats:d,experience:e,clientRequests:f}){let g=[],h=d?.summary||{},i=_(h.serverImpacting,0),j=_(h.client,0),k=_(h.rateLimit,0),l=_(a.serverErrorRate,a.requests?i/a.requests:0),m=_(a.clientErrorRate,a.requests?j/a.requests:0);a.requests>=10&&i>=3&&l>=.05?g.push({level:l>=.15?"danger":"warning",title:"Tỷ lệ lỗi server/provider cao",detail:`${i.toLocaleString("vi-VN")} lỗi server-impacting (${(100*l).toFixed(1)}% request) trong khoảng thời gian đang lọc. Ưu ti\xean kiểm tra upstream/provider, gateway, timeout v\xe0 5xx.`}):a.requests>=10&&a.errorRate>=.2&&m>=.1?g.push({level:"warning",title:"Nhiều lỗi do client/request",detail:`${j.toLocaleString("vi-VN")} lỗi được ph\xe2n loại l\xe0 client-side (${(100*m).toFixed(1)}% request): sai endpoint/model/auth/body/context. Kh\xf4ng n\xean t\xednh nh\xf3m n\xe0y như lỗi server.`}):a.requests>=10&&a.errorRate>=.2&&g.push({level:"warning",title:"Tỷ lệ lỗi tổng cao",detail:`Tổng lỗi usage l\xe0 ${(100*a.errorRate).toFixed(1)}%, nhưng lỗi server-impacting chỉ ${(100*l).toFixed(1)}%. Xem ph\xe2n loại client/server b\xean dưới trước khi kết luận provider hỏng.`}),k>=5&&a.requests>0&&k/a.requests>=.05&&g.push({level:"warning",title:"Rate limit / quota đ\xe1ng ch\xfa \xfd",detail:`${k.toLocaleString("vi-VN")} lỗi rate-limit/quota trong khoảng lọc. Kiểm tra policy API key, quota provider hoặc ph\xe2n tải model.`});let n=b.apiKeys?.[0];n&&a.totalTokens>0&&n.totalTokens/a.totalTokens>=.5&&g.push({level:"warning",title:"Một API key d\xf9ng phần lớn token",detail:`${n.name||n.fingerprint} đang d\xf9ng ${(n.totalTokens/a.totalTokens*100).toFixed(1)}% tổng token.`});let o=c?.topClientIps?.[0];o&&c.total>0&&o.requests/c.total>=.5&&o.requests>=20&&g.push({level:"warning",title:"Một IP chiếm phần lớn request prompt log",detail:`${o.label} chiếm ${(o.requests/c.total*100).toFixed(1)}% prompt logs trong to\xe0n bộ dữ liệu khớp bộ lọc.`});let p=d?.topServerErrors?.[0];return p&&p.requests>=5&&g.push({level:p.requests>=20?"danger":"warning",title:"Provider/Gateway c\xf3 lỗi cần xử l\xfd",detail:`${p.providerLabel||p.provider||p.errorSource||"unknown"}/${p.model||"unknown"} c\xf3 ${p.requests.toLocaleString("vi-VN")} lỗi ${p.errorType||p.status||"server-impacting"}.`}),e?.samples>=10&&_(e.slowRequestRate,0)>=.2&&g.push({level:e.slowRequestRate>=.4?"danger":"warning",title:"Nhiều request phản hồi chậm",detail:`${(100*e.slowRequestRate).toFixed(1)}% request th\xe0nh c\xf4ng c\xf3 latency >= 45s. Kiểm tra request input d\xe0i, chờ slot/upstream queue v\xe0 tải model server.`}),e?.samples>=10&&_(e.longInputRate,0)>=.3&&g.push({level:"warning",title:"Tỷ lệ request input d\xe0i cao",detail:`${(100*e.longInputRate).toFixed(1)}% request c\xf3 input >= 30k token. Với VS Code/agent, P95/P99 latency cao c\xf3 thể chủ yếu do prompt eval v\xe0 chờ slot, kh\xf4ng phải do output chậm.`}),f?.summary?.topUserTokenShare>=.35&&g.push({level:f.summary.topUserTokenShare>=.6?"danger":"warning",title:"Token usage tập trung v\xe0o một user/API key",detail:`${f.summary.topUserLabel||"Một client"} đang chiếm ${(100*f.summary.topUserTokenShare).toFixed(1)}% tổng token trong khoảng lọc. N\xean kiểm tra quota, workflow VS Code/agent v\xe0 request input d\xe0i của client n\xe0y.`}),f?.summary?.extremeInputShare>=.1&&g.push({level:f.summary.extremeInputShare>=.25?"danger":"warning",title:"Nhiều request cực d\xe0i >=70k token",detail:`${(100*f.summary.extremeInputShare).toFixed(1)}% request th\xe0nh c\xf4ng c\xf3 input >=70k token. Đ\xe2y l\xe0 nh\xf3m dễ k\xe9o TTFT/P95/P99 l\xean cao v\xe0 l\xe0m request nhỏ phải chờ slot.`}),g}({overview:p,groups:q,promptLogStats:s,requestErrorStats:u,experience:x,clientRequests:y}),I={generatedAt:new Date().toISOString(),analyticsVersion:"v3.6-token-leaderboard",filters:{period:k.period,startIso:k.startIso,endIso:k.endIso,provider:k.provider,model:k.model,connectionId:k.connectionId,status:k.status,endpoint:k.endpoint,apiKey:k.apiKey,clientIp:k.clientIp,sourceTool:k.sourceTool,sessionId:k.sessionId,keyword:k.keyword,userOwnedOnly:k.userOwnedOnly,ownedAnyUserOnly:k.ownedAnyUserOnly},overview:p,latency:r,experience:x,clientRequests:y,tokenLeaderboard:(!function(){let a=ba();if(a.timerStarted)return;a.timerStarted=!0;let b=setTimeout(()=>{bc().catch(()=>{})},1e3);b.unref?.();let c=setInterval(()=>{bc().catch(()=>{})},9e5);c.unref?.()}(),ba().data||a9()),thinkingAnalytics:z,largeContextAnalytics:A,timeSeries:B,groups:q,promptLogs:s,requestErrors:u,anomalies:H,recentUsage:C,heavyRequests:D,options:G,qualityNotes:[]};if(await a8(h),c.set(b,{createdAt:Date.now(),data:I}),c.size>100){for(let[a,b]of c)if(Date.now()-b.createdAt>15e3&&c.delete(a),c.size<=100)break}return I}catch(a){throw await a8(h),console.error("[dashboardAnalytics] MySQL observability query failed; SQLite fallback is disabled:",a?.message||a),a}}var be=c(9588);let bf="force-dynamic",bg=["period","dateFrom","dateTo","provider","model","connectionId","status","endpoint","apiKey","clientIp","sourceIp","sourceTool","sessionId","keyword","maxPromptLogRows","timeZone"];async function bh(a){try{let b,{access:c,response:d}=await (0,be.oW)();if(d)return d;let{searchParams:e}=new URL(a.url),f=function(a){let b={};for(let c of bg){let d=a.get(c);null!==d&&""!==String(d).trim()&&(b[c]=d)}return b}(e);b=c.isAdmin||c.isMonitorAdmin?f:c.isAiGatewaysMonitor?{...f,ownedAnyUserOnly:!0}:{...f,userOwnedOnly:!0,ownerCandidates:[...new Set([...c.candidates||[],c.userId].map(be.I8).filter(Boolean))]};let g=await bd(b);if("csv"===e.get("format")){let a=(function(a){let b=[];for(let[c,d]of(b.push(["section","key","label","requests","success","errors","errorRate","inputTokens","outputTokens","totalTokens","cost","lastSeen"]),[["providers",a.groups.providers],["models",a.groups.models],["providerAccounts",a.groups.providerAccounts],["apiKeys",a.groups.apiKeys],["endpoints",a.groups.endpoints],["clientIps",a.promptLogs.topClientIps],["sourceTools",a.promptLogs.topSourceTools],["requestErrors",a.requestErrors?.topErrors||a.groups.errors],["modelExperience",a.experience?.byModel||[]],["clientHeavyUsers",a.clientRequests?.topHeavyUsers||[]],["clientTopApiKeysByTokens",a.clientRequests?.topApiKeysByTokens||[]],["clientTopSourceIpsByTokens",a.clientRequests?.topSourceIpsByTokens||[]],["clientTopSourceIpsByHeavyRequests",a.clientRequests?.topSourceIpsByHeavyRequests||[]],["clientProblemClients",a.clientRequests?.topProblemClients||[]],["inputBuckets",a.clientRequests?.inputBuckets||[]]]))for(let a of d||[])b.push([c,a.key||"",a.label||a.name||"",a.requests||0,a.success||0,a.errors||0,a.errorRate||0,a.promptTokens||0,a.completionTokens||0,a.totalTokens||0,a.cost||0,a.lastSeen||""]);return b})(g).map(a=>a.map(a5).join(",")).join("\n");return new Response(a,{status:200,headers:{"Content-Type":"text/csv; charset=utf-8","Content-Disposition":`attachment; filename="bluerouter-analytics-${new Date().toISOString().slice(0,10)}.csv"`,"Cache-Control":"no-store"}})}return v.NextResponse.json(g,{headers:{"Cache-Control":"no-store"}})}catch(a){return console.error("[analytics] Failed to build dashboard analytics:",a),v.NextResponse.json({error:a?.message||"Failed to build dashboard analytics"},{status:500})}}let bi=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/dashboard/analytics/route",pathname:"/api/dashboard/analytics",filename:"route",bundlePath:"app/api/dashboard/analytics/route"},distDir:".next-cli-build",relativeProjectDir:"",resolvedPagePath:"D:\\bluerouter\\src\\app\\api\\dashboard\\analytics\\route.js",nextConfigOutput:"standalone",userland:d,...{}}),{workAsyncStorage:bj,workUnitAsyncStorage:bk,serverHooks:bl}=bi;function bm(){return(0,g.patchFetch)({workAsyncStorage:bj,workUnitAsyncStorage:bk})}async function bn(a,b,c){c.requestMeta&&(0,h.setRequestMeta)(a,c.requestMeta),bi.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let d="/api/dashboard/analytics/route";"/index"===d&&(d="/");let e=await bi.prepare(a,b,{srcPage:d,multiZoneDraftMode:!1});if(!e)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:g,deploymentId:v,params:w,nextConfig:x,parsedUrl:y,isDraftMode:z,prerenderManifest:A,routerServerContext:B,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,resolvedPathname:E,clientReferenceManifest:F,serverActionsManifest:G}=e,H=(0,k.normalizeAppPath)(d),I=!!(A.dynamicRoutes[H]||A.routes[E]),J=async()=>((null==B?void 0:B.render404)?await B.render404(a,b,y,!1):b.end("This page could not be found"),null);if(I&&!z){let a=!!A.routes[E],b=A.dynamicRoutes[H];if(b&&!1===b.fallback&&!a){if(x.adapterPath)return await J();throw new t.NoFallbackError}}let K=null;!I||bi.isDev||z||(K="/index"===(K=E)?"/":K);let L=!0===bi.isDev||!I,M=I&&!L;G&&F&&(0,j.setManifestsSingleton)({page:d,clientReferenceManifest:F,serverActionsManifest:G});let N=a.method||"GET",O=(0,i.getTracer)(),P=O.getActiveScopeSpan(),Q=!!(null==B?void 0:B.isWrappedByNextServer),R=!!(0,h.getRequestMeta)(a,"minimalMode"),S=(0,h.getRequestMeta)(a,"incrementalCache")||await bi.getIncrementalCache(a,x,A,R);null==S||S.resetRequestCache(),globalThis.__incrementalCache=S;let T={params:w,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:L,incrementalCache:S,cacheLifeProfiles:x.cacheLife,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d,e)=>bi.onRequestError(a,b,d,e,B)},sharedContext:{buildId:g,deploymentId:v}},U=new l.NodeNextRequest(a),V=new l.NodeNextResponse(b),W=m.NextRequestAdapter.fromNodeNextRequest(U,(0,m.signalFromNodeResponse)(b));try{let e,g=async a=>bi.handle(W,T).finally(()=>{if(!a)return;a.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let c=O.getRootSpanAttributes();if(!c)return;if(c.get("next.span_type")!==n.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${c.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let f=c.get("next.route");if(f){let b=`${N} ${f}`;a.setAttributes({"next.route":f,"http.route":f,"next.span_name":b}),a.updateName(b),e&&e!==a&&(e.setAttribute("http.route",f),e.updateName(b))}else a.updateName(`${N} ${d}`)}),h=async e=>{var h,i;let j=async({previousCacheEntry:f})=>{try{if(!R&&C&&D&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let d=await g(e);a.fetchMetrics=T.renderOpts.fetchMetrics;let h=T.renderOpts.pendingWaitUntil;h&&c.waitUntil&&(c.waitUntil(h),h=void 0);let i=T.renderOpts.collectedTags;if(!I)return await (0,p.I)(U,V,d,T.renderOpts.pendingWaitUntil),null;{let a=await d.blob(),b=(0,q.toNodeOutgoingHttpHeaders)(d.headers);i&&(b[s.NEXT_CACHE_TAGS_HEADER]=i),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==T.renderOpts.collectedRevalidate&&!(T.renderOpts.collectedRevalidate>=s.INFINITE_CACHE)&&T.renderOpts.collectedRevalidate,e=void 0===T.renderOpts.collectedExpire||T.renderOpts.collectedExpire>=s.INFINITE_CACHE?void 0:T.renderOpts.collectedExpire;return{value:{kind:u.CachedRouteKind.APP_ROUTE,status:d.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:e}}}}catch(b){throw(null==f?void 0:f.isStale)&&await bi.onRequestError(a,b,{routerKind:"App Router",routePath:d,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),b}},k=await bi.handleResponse({req:a,nextConfig:x,cacheKey:K,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:D,responseGenerator:j,waitUntil:c.waitUntil,isMinimalMode:R});if(!I)return null;if((null==k||null==(h=k.value)?void 0:h.kind)!==u.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==k||null==(i=k.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});R||b.setHeader("x-nextjs-cache",C?"REVALIDATED":k.isMiss?"MISS":k.isStale?"STALE":"HIT"),z&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let l=(0,q.fromNodeOutgoingHttpHeaders)(k.value.headers);return R&&I||l.delete(s.NEXT_CACHE_TAGS_HEADER),!k.cacheControl||b.getHeader("Cache-Control")||l.get("Cache-Control")||l.set("Cache-Control",(0,r.getCacheControlHeader)(k.cacheControl)),await (0,p.I)(U,V,new Response(k.value.body,{headers:l,status:k.value.status||200})),null};Q&&P?await h(P):(e=O.getActiveScopeSpan(),await O.withPropagatedContext(a.headers,()=>O.trace(n.BaseServerSpan.handleRequest,{spanName:`${N} ${d}`,kind:i.SpanKind.SERVER,attributes:{"http.method":N,"http.target":a.url}},h),void 0,!Q))}catch(b){if(b instanceof t.NoFallbackError||await bi.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,o.c)({isStaticGeneration:M,isOnDemandRevalidate:C})},!1,B),I)throw b;return await (0,p.I)(U,V,new Response(null,{status:500})),null}}},55511:a=>{a.exports=require("crypto")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64939:a=>{a.exports=import("pg")},66136:a=>{a.exports=require("timers")},69614:(a,b,c)=>{c.d(b,{V:()=>p});var d=c(88888),e=c(91356),f=c(99129),g=c(73575),h=c(41570),i=c(19035),j=c(24762),k=c(80308),l=c(11980);async function m(a,b,c){if(!(0,i.Gv)(a))throw new f.Ye("Flattened JWS must be an object");if(void 0===a.protected&&void 0===a.header)throw new f.Ye('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==a.protected&&"string"!=typeof a.protected)throw new f.Ye("JWS Protected Header incorrect type");if(void 0===a.payload)throw new f.Ye("JWS Payload missing");if("string"!=typeof a.signature)throw new f.Ye("JWS Signature missing or incorrect type");if(void 0!==a.header&&!(0,i.Gv)(a.header))throw new f.Ye("JWS Unprotected Header incorrect type");let m={};if(a.protected)try{let b=(0,d.D)(a.protected);m=JSON.parse(g.D0.decode(b))}catch{throw new f.Ye("JWS Protected Header is invalid")}if(!(0,i.fz)(m,a.header))throw new f.Ye("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let n={...m,...a.header},o=(0,k.n)(f.Ye,new Map([["b64",!0]]),c?.crit,m,n),p=!0;if(o.has("b64")&&"boolean"!=typeof(p=m.b64))throw new f.Ye('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:q}=n;if("string"!=typeof q||!q)throw new f.Ye('JWS "alg" (Algorithm) Header Parameter missing or invalid');let r=c&&function(a,b){if(void 0!==b&&(!Array.isArray(b)||b.some(a=>"string"!=typeof a)))throw TypeError(`"${a}" option must be an array of strings`);if(b)return new Set(b)}("algorithms",c.algorithms);if(r&&!r.has(q))throw new f.Rb('"alg" (Algorithm) Header Parameter value not allowed');if(p){if("string"!=typeof a.payload)throw new f.Ye("JWS Payload must be a string")}else if("string"!=typeof a.payload&&!(a.payload instanceof Uint8Array))throw new f.Ye("JWS Payload must be a string or an Uint8Array instance");let s=!1;"function"==typeof b&&(b=await b(m,a),s=!0),(0,j.y)(q,b,"verify");let t=(0,g.xW)(void 0!==a.protected?(0,g.lF)(a.protected):new Uint8Array,(0,g.lF)("."),"string"==typeof a.payload?p?(0,g.lF)(a.payload):g.Rd.encode(a.payload):a.payload),u=(0,h.h2)(a.signature,"signature",f.Ye),v=await (0,l.l)(b,q);if(!await (0,e.MX)(q,v,u,t))throw new f.h2;let w={payload:p?(0,h.h2)(a.payload,"payload",f.Ye):"string"==typeof a.payload?g.Rd.encode(a.payload):a.payload};return(void 0!==a.protected&&(w.protectedHeader=m),void 0!==a.header&&(w.unprotectedHeader=a.header),s)?{...w,key:v}:w}async function n(a,b,c){if(a instanceof Uint8Array&&(a=g.D0.decode(a)),"string"!=typeof a)throw new f.Ye("Compact JWS must be a string or Uint8Array");let{0:d,1:e,2:h,length:i}=a.split(".");if(3!==i)throw new f.Ye("Invalid Compact JWS");let j=await m({payload:e,protected:d,signature:h},b,c),k={payload:j.payload,protectedHeader:j.protectedHeader};return"function"==typeof b?{...k,key:j.key}:k}var o=c(17347);async function p(a,b,c){let d=await n(a,b,c);if(d.protectedHeader.crit?.includes("b64")&&!1===d.protectedHeader.b64)throw new f.Dp("JWTs MUST NOT use unencoded payload");let e={payload:(0,o.k6)(d.protectedHeader,d.payload,c),protectedHeader:d.protectedHeader};return"function"==typeof b?{...e,key:d.key}:e}},73024:a=>{a.exports=require("node:fs")},74075:a=>{a.exports=require("zlib")},76760:a=>{a.exports=require("node:path")},77598:a=>{a.exports=require("node:crypto")},79428:a=>{a.exports=require("buffer")},80099:a=>{a.exports=require("node:sqlite")},81787:a=>{a.exports=require("bun:sqlite")},86439:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external")},87550:a=>{a.exports=require("better-sqlite3")},90389:(a,b,c)=>{c.d(b,{hS:()=>d});let d=Object.freeze({ADMIN:"admin",MONITOR_ADMIN:"monitor_admin",AI_GATEWAYS_MONITOR:"ai_gateways_monitor",USER:"user",GUEST:"guest"});Object.freeze([{href:"/dashboard/endpoint",label:"Endpoint",icon:"api"},{href:"/dashboard/api-keys",label:"API Keys",icon:"vpn_key"},{href:"/dashboard/usage",label:"Usage",icon:"bar_chart"},{href:"/dashboard/analytics",label:"Analytics",icon:"monitoring"},{href:"/dashboard/quota",label:"Quota Tracker",icon:"data_usage"},{href:"/dashboard/prompt-logs",label:"Prompt Logs",icon:"manage_search"}]),Object.freeze(["/dashboard","/dashboard/endpoint","/dashboard/api-keys","/dashboard/usage","/dashboard/analytics","/dashboard/quota","/dashboard/prompt-logs"])},91645:a=>{a.exports=require("net")},92280:(a,b,c)=>{Object.defineProperty(b,"I",{enumerable:!0,get:function(){return g}});let d=c(28208),e=c(47617),f=c(62018);async function g(a,b,c,g){if((0,d.isNodeNextResponse)(b)){var h;b.statusCode=c.status,b.statusMessage=c.statusText;let d=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(h=c.headers)||h.forEach((a,c)=>{if("x-middleware-set-cookie"!==c.toLowerCase())if("set-cookie"===c.toLowerCase())for(let d of(0,f.splitCookiesString)(a))b.appendHeader(c,d);else{let e=void 0!==b.getHeader(c);(d.includes(c.toLowerCase())||!e)&&b.appendHeader(c,a)}});let{originalResponse:i}=b;c.body&&"HEAD"!==a.method?await (0,e.pipeToNodeResponse)(c.body,i,g):i.end()}}},94735:a=>{a.exports=require("events")},94755:(a,b,c)=>{c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(50122);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,5592,5573,6935,402,5901,7242],()=>b(b.s=53254));module.exports=c})();