codexLB-up 1.25.0b10__py3-none-any.whl

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 (827) hide show
  1. app/__init__.py +10 -0
  2. app/admin_cli.py +494 -0
  3. app/cli.py +339 -0
  4. app/codex_sessions_retag.py +487 -0
  5. app/core/__init__.py +0 -0
  6. app/core/audit/__init__.py +0 -0
  7. app/core/audit/service.py +216 -0
  8. app/core/audit/types.py +94 -0
  9. app/core/auth/__init__.py +236 -0
  10. app/core/auth/api_key_cache.py +65 -0
  11. app/core/auth/dashboard_access.py +429 -0
  12. app/core/auth/dashboard_mode.py +171 -0
  13. app/core/auth/dashboard_session_ttl.py +74 -0
  14. app/core/auth/dashboard_users_cache.py +120 -0
  15. app/core/auth/dependencies.py +710 -0
  16. app/core/auth/external_identity.py +78 -0
  17. app/core/auth/guardian.py +374 -0
  18. app/core/auth/models.py +49 -0
  19. app/core/auth/providers/__init__.py +129 -0
  20. app/core/auth/providers/oidc.py +838 -0
  21. app/core/auth/providers/registry.py +118 -0
  22. app/core/auth/refresh.py +394 -0
  23. app/core/auth/step_up.py +117 -0
  24. app/core/auth/totp.py +81 -0
  25. app/core/balancer/__init__.py +71 -0
  26. app/core/balancer/logic.py +1612 -0
  27. app/core/balancer/rendezvous_hash.py +21 -0
  28. app/core/balancer/types.py +21 -0
  29. app/core/bootstrap.py +172 -0
  30. app/core/cache/invalidation.py +426 -0
  31. app/core/clients/__init__.py +0 -0
  32. app/core/clients/codex.py +996 -0
  33. app/core/clients/codex_version.py +187 -0
  34. app/core/clients/codex_version_snapshot.py +2 -0
  35. app/core/clients/files.py +534 -0
  36. app/core/clients/headers.py +29 -0
  37. app/core/clients/http.py +511 -0
  38. app/core/clients/model_fetcher.py +276 -0
  39. app/core/clients/native_egress.py +1304 -0
  40. app/core/clients/oauth.py +477 -0
  41. app/core/clients/proxy.py +6089 -0
  42. app/core/clients/proxy_websocket.py +1411 -0
  43. app/core/clients/rate_limit_reset_credits.py +412 -0
  44. app/core/clients/stream_errors.py +12 -0
  45. app/core/clients/thread_cache_identity.py +347 -0
  46. app/core/clients/usage.py +467 -0
  47. app/core/clock.py +170 -0
  48. app/core/config/__init__.py +0 -0
  49. app/core/config/background_jobs.py +73 -0
  50. app/core/config/context_window_overrides.py +166 -0
  51. app/core/config/dashboard_overrides.py +145 -0
  52. app/core/config/inheritable.py +47 -0
  53. app/core/config/key_fingerprint.py +115 -0
  54. app/core/config/settings.py +872 -0
  55. app/core/config/settings_cache.py +100 -0
  56. app/core/config/spool_retention.py +217 -0
  57. app/core/config/tiers.py +174 -0
  58. app/core/conversation_archive.py +568 -0
  59. app/core/crypto.py +37 -0
  60. app/core/draining.py +11 -0
  61. app/core/errors.py +365 -0
  62. app/core/exceptions.py +155 -0
  63. app/core/handlers/__init__.py +3 -0
  64. app/core/handlers/exceptions.py +478 -0
  65. app/core/http_protocol.py +176 -0
  66. app/core/http_protocol_httptools.py +204 -0
  67. app/core/ingress_limits.py +17 -0
  68. app/core/metadata_store.py +18 -0
  69. app/core/metrics/__init__.py +0 -0
  70. app/core/metrics/middleware.py +74 -0
  71. app/core/metrics/prometheus.py +604 -0
  72. app/core/middleware/__init__.py +25 -0
  73. app/core/middleware/api_firewall.py +111 -0
  74. app/core/middleware/app_version.py +37 -0
  75. app/core/middleware/dashboard_auth_proxy.py +55 -0
  76. app/core/middleware/dashboard_csrf.py +177 -0
  77. app/core/middleware/dashboard_gzip.py +41 -0
  78. app/core/middleware/dashboard_overrides.py +59 -0
  79. app/core/middleware/firewall_cache.py +91 -0
  80. app/core/middleware/inflight.py +126 -0
  81. app/core/middleware/multipart_content_encoding.py +129 -0
  82. app/core/middleware/path_rewrite.py +148 -0
  83. app/core/middleware/request_body_limit.py +196 -0
  84. app/core/middleware/request_decompression.py +209 -0
  85. app/core/middleware/request_id.py +72 -0
  86. app/core/middleware/required_capability_http.py +116 -0
  87. app/core/middleware/trusted_proxy_headers.py +36 -0
  88. app/core/multipart.py +237 -0
  89. app/core/multipart_fields.py +91 -0
  90. app/core/openai/__init__.py +0 -0
  91. app/core/openai/chat_requests.py +493 -0
  92. app/core/openai/chat_responses.py +931 -0
  93. app/core/openai/contracts.py +46 -0
  94. app/core/openai/exceptions.py +24 -0
  95. app/core/openai/host_models.py +14 -0
  96. app/core/openai/images.py +413 -0
  97. app/core/openai/message_coercion.py +376 -0
  98. app/core/openai/model_refresh_scheduler.py +423 -0
  99. app/core/openai/model_registry.py +997 -0
  100. app/core/openai/model_registry_store.py +548 -0
  101. app/core/openai/models.py +172 -0
  102. app/core/openai/parsing.py +97 -0
  103. app/core/openai/requests.py +1980 -0
  104. app/core/openai/strict_schema.py +199 -0
  105. app/core/openai/tool_call_safety.py +99 -0
  106. app/core/openai/v1_requests.py +187 -0
  107. app/core/plan_types.py +90 -0
  108. app/core/prestop.py +202 -0
  109. app/core/rate_limiter/__init__.py +0 -0
  110. app/core/rate_limiter/db_rate_limiter.py +215 -0
  111. app/core/request_locality.py +473 -0
  112. app/core/resilience/__init__.py +0 -0
  113. app/core/resilience/backpressure.py +57 -0
  114. app/core/resilience/bulkhead.py +202 -0
  115. app/core/resilience/circuit_breaker.py +150 -0
  116. app/core/resilience/degradation.py +55 -0
  117. app/core/resilience/loop_lag_monitor.py +60 -0
  118. app/core/resilience/memory_monitor.py +137 -0
  119. app/core/resilience/network_recovery.py +256 -0
  120. app/core/resilience/overload.py +98 -0
  121. app/core/resilience/toggles.py +114 -0
  122. app/core/retention/__init__.py +0 -0
  123. app/core/retention/job.py +240 -0
  124. app/core/retention/scheduler.py +69 -0
  125. app/core/runtime_logging.py +601 -0
  126. app/core/scheduling/__init__.py +0 -0
  127. app/core/scheduling/leader_election.py +993 -0
  128. app/core/scheduling/leader_election_handle.py +25 -0
  129. app/core/server.py +140 -0
  130. app/core/shutdown.py +326 -0
  131. app/core/socket_peer.py +22 -0
  132. app/core/startup.py +41 -0
  133. app/core/timeout_invariants.py +347 -0
  134. app/core/tracing/__init__.py +0 -0
  135. app/core/tracing/otel.py +207 -0
  136. app/core/types.py +6 -0
  137. app/core/upstream_proxy/__init__.py +13 -0
  138. app/core/upstream_proxy/cache.py +130 -0
  139. app/core/upstream_proxy/resolver.py +189 -0
  140. app/core/upstream_proxy/types.py +104 -0
  141. app/core/usage/__init__.py +407 -0
  142. app/core/usage/depletion.py +109 -0
  143. app/core/usage/live_hub.py +41 -0
  144. app/core/usage/live_snapshots.py +174 -0
  145. app/core/usage/logs.py +212 -0
  146. app/core/usage/metadata_scheduler.py +118 -0
  147. app/core/usage/models.py +54 -0
  148. app/core/usage/pricing.py +576 -0
  149. app/core/usage/pricing_catalog.py +241 -0
  150. app/core/usage/pricing_snapshot.json +821 -0
  151. app/core/usage/quota.py +133 -0
  152. app/core/usage/refresh_policy.py +21 -0
  153. app/core/usage/refresh_scheduler.py +713 -0
  154. app/core/usage/reset_credits_refresh_scheduler.py +435 -0
  155. app/core/usage/types.py +168 -0
  156. app/core/utils/__init__.py +0 -0
  157. app/core/utils/json_guards.py +18 -0
  158. app/core/utils/locks.py +33 -0
  159. app/core/utils/masking.py +20 -0
  160. app/core/utils/proxy_env.py +104 -0
  161. app/core/utils/request_id.py +65 -0
  162. app/core/utils/retry.py +77 -0
  163. app/core/utils/shared_future.py +172 -0
  164. app/core/utils/sse.py +286 -0
  165. app/core/utils/time.py +24 -0
  166. app/db/__init__.py +0 -0
  167. app/db/account_identity_lock.py +56 -0
  168. app/db/alembic/__init__.py +1 -0
  169. app/db/alembic/env.py +70 -0
  170. app/db/alembic/revision_ids.py +43 -0
  171. app/db/alembic/versions/20260213_000000_base_schema.py +248 -0
  172. app/db/alembic/versions/20260213_000100_normalize_account_plan_types.py +45 -0
  173. app/db/alembic/versions/20260213_000200_add_request_logs_reasoning_effort.py +45 -0
  174. app/db/alembic/versions/20260213_000300_add_accounts_reset_at.py +45 -0
  175. app/db/alembic/versions/20260213_000400_add_accounts_chatgpt_account_id.py +45 -0
  176. app/db/alembic/versions/20260213_000500_add_dashboard_settings.py +70 -0
  177. app/db/alembic/versions/20260213_000600_add_dashboard_settings_totp.py +64 -0
  178. app/db/alembic/versions/20260213_000700_add_dashboard_settings_password.py +59 -0
  179. app/db/alembic/versions/20260213_000800_add_api_keys.py +87 -0
  180. app/db/alembic/versions/20260214_000000_add_api_key_limits.py +143 -0
  181. app/db/alembic/versions/20260215_000000_add_idx_logs_requested_at.py +38 -0
  182. app/db/alembic/versions/20260218_000000_add_api_key_usage_reservations.py +117 -0
  183. app/db/alembic/versions/20260218_000100_add_import_without_overwrite_and_drop_accounts_email_unique.py +198 -0
  184. app/db/alembic/versions/20260225_000000_add_dashboard_settings_routing_strategy.py +53 -0
  185. app/db/alembic/versions/20260228_020000_align_api_key_limit_enum_types.py +104 -0
  186. app/db/alembic/versions/20260228_030000_add_api_firewall_allowlist.py +42 -0
  187. app/db/alembic/versions/20260306_000000_add_request_logs_service_tier.py +45 -0
  188. app/db/alembic/versions/20260307_000000_add_api_key_enforcement_fields.py +56 -0
  189. app/db/alembic/versions/20260308_000000_add_sqlite_performance_indexes.py +41 -0
  190. app/db/alembic/versions/20260309_000000_add_additional_usage_history.py +71 -0
  191. app/db/alembic/versions/20260309_000000_request_logs_nullable_account_id.py +28 -0
  192. app/db/alembic/versions/20260310_000000_add_request_logs_transport.py +45 -0
  193. app/db/alembic/versions/20260310_000000_fix_postgresql_enum_value_casing.py +79 -0
  194. app/db/alembic/versions/20260310_120000_add_sticky_session_kinds_and_affinity_ttl.py +110 -0
  195. app/db/alembic/versions/20260312_000000_add_additional_usage_quota_key.py +193 -0
  196. app/db/alembic/versions/20260312_000000_split_sticky_sessions_primary_key_by_kind.py +96 -0
  197. app/db/alembic/versions/20260312_010000_merge_additional_usage_and_sticky_session_heads.py +25 -0
  198. app/db/alembic/versions/20260312_020000_merge_request_logs_transport_and_feature_heads.py +25 -0
  199. app/db/alembic/versions/20260312_020000_merge_request_logs_transport_and_sticky_heads.py +25 -0
  200. app/db/alembic/versions/20260312_120000_add_dashboard_upstream_stream_transport.py +62 -0
  201. app/db/alembic/versions/20260313_024500_merge_request_log_transport_heads.py +27 -0
  202. app/db/alembic/versions/20260319_100937_increase_prompt_cache_ttl_to_1800s.py +73 -0
  203. app/db/alembic/versions/20260319_111500_merge_prompt_cache_ttl_and_upstream_transport_heads.py +25 -0
  204. app/db/alembic/versions/20260319_183000_normalize_sqlite_account_status_casing.py +48 -0
  205. app/db/alembic/versions/20260320_000000_add_request_log_requested_actual_tiers.py +51 -0
  206. app/db/alembic/versions/20260321_190000_tighten_dashboard_db_indexes.py +64 -0
  207. app/db/alembic/versions/20260321_210000_merge_request_log_tiers_and_dashboard_index_heads.py +25 -0
  208. app/db/alembic/versions/20260325_000000_add_request_log_cost.py +193 -0
  209. app/db/alembic/versions/20260328_000000_add_rate_limit_attempts.py +48 -0
  210. app/db/alembic/versions/20260328_120000_add_request_log_ttft.py +37 -0
  211. app/db/alembic/versions/20260328_130000_add_audit_logs_table.py +45 -0
  212. app/db/alembic/versions/20260328_140000_add_scheduler_leader_table.py +39 -0
  213. app/db/alembic/versions/20260330_000000_add_cache_locality_settings.py +69 -0
  214. app/db/alembic/versions/20260330_010000_merge_scheduler_leader_and_cache_locality_heads.py +25 -0
  215. app/db/alembic/versions/20260330_020000_add_bridge_ring_members.py +46 -0
  216. app/db/alembic/versions/20260401_000000_add_api_key_enforced_service_tier.py +52 -0
  217. app/db/alembic/versions/20260401_000000_add_cache_invalidation.py +41 -0
  218. app/db/alembic/versions/20260401_020000_merge_cache_invalidation_and_api_key_service_tier_heads.py +22 -0
  219. app/db/alembic/versions/20260402_000000_switch_dashboard_routing_default_to_capacity_weighted.py +66 -0
  220. app/db/alembic/versions/20260403_000000_add_credit_api_key_limit_values.py +44 -0
  221. app/db/alembic/versions/20260406_000000_add_api_key_account_assignments.py +57 -0
  222. app/db/alembic/versions/20260406_010000_add_api_key_assignment_scope_flag.py +75 -0
  223. app/db/alembic/versions/20260407_000000_add_bridge_gateway_safe_mode.py +51 -0
  224. app/db/alembic/versions/20260407_010000_merge_api_key_assignment_and_bridge_gateway_heads.py +25 -0
  225. app/db/alembic/versions/20260408_000000_switch_import_without_overwrite_default_to_true.py +73 -0
  226. app/db/alembic/versions/20260408_010000_merge_import_without_overwrite_and_assignment_heads.py +25 -0
  227. app/db/alembic/versions/20260409_000000_add_http_bridge_sessions.py +130 -0
  228. app/db/alembic/versions/20260409_000000_switch_sticky_threads_and_prefer_earlier_reset_defaults_to_true.py +89 -0
  229. app/db/alembic/versions/20260409_010000_add_dashboard_settings_bootstrap_token.py +57 -0
  230. app/db/alembic/versions/20260409_010000_merge_http_bridge_and_import_without_overwrite_heads.py +25 -0
  231. app/db/alembic/versions/20260409_020000_fix_http_bridge_last_seen_index.py +46 -0
  232. app/db/alembic/versions/20260410_000000_backfill_pristine_dashboard_settings_defaults.py +77 -0
  233. app/db/alembic/versions/20260410_030000_restore_import_without_overwrite_default_true.py +73 -0
  234. app/db/alembic/versions/20260410_040000_merge_dashboard_defaults_and_import_default_heads.py +25 -0
  235. app/db/alembic/versions/20260413_000000_add_accounts_blocked_at.py +44 -0
  236. app/db/alembic/versions/20260415_160000_add_automations_tables.py +189 -0
  237. app/db/alembic/versions/20260415_160000_add_request_logs_response_lookup_index.py +67 -0
  238. app/db/alembic/versions/20260417_000000_add_request_log_plan_type.py +44 -0
  239. app/db/alembic/versions/20260418_190000_add_automation_runs_cycle_key.py +87 -0
  240. app/db/alembic/versions/20260419_000000_add_automation_run_cycle_metadata.py +56 -0
  241. app/db/alembic/versions/20260419_020000_add_automation_run_cycles_snapshot_tables.py +342 -0
  242. app/db/alembic/versions/20260421_000000_add_dashboard_session_ttl_setting.py +51 -0
  243. app/db/alembic/versions/20260421_120000_merge_request_log_lookup_and_plan_type_heads.py +25 -0
  244. app/db/alembic/versions/20260421_130000_merge_automation_and_request_log_heads.py +25 -0
  245. app/db/alembic/versions/20260422_103000_normalize_legacy_automation_run_cycle_keys.py +648 -0
  246. app/db/alembic/versions/20260423_120000_add_api_key_limit_reset_at_index.py +43 -0
  247. app/db/alembic/versions/20260424_000000_merge_dashboard_session_ttl_and_request_log_heads.py +25 -0
  248. app/db/alembic/versions/20260426_000000_add_dashboard_relative_availability_settings.py +68 -0
  249. app/db/alembic/versions/20260427_130000_add_warmup_model_and_request_kind.py +75 -0
  250. app/db/alembic/versions/20260506_000000_add_account_routing_policy.py +37 -0
  251. app/db/alembic/versions/20260509_000000_add_api_key_traffic_class.py +37 -0
  252. app/db/alembic/versions/20260509_010000_add_additional_quota_routing_policies.py +37 -0
  253. app/db/alembic/versions/20260513_000000_add_accounts_alias.py +44 -0
  254. app/db/alembic/versions/20260513_000000_add_api_key_apply_to_codex_model.py +59 -0
  255. app/db/alembic/versions/20260514_000000_add_request_logs_api_key_time_index.py +43 -0
  256. app/db/alembic/versions/20260515_000000_add_prefer_earlier_reset_window.py +47 -0
  257. app/db/alembic/versions/20260515_000000_soft_delete_request_logs_on_account_delete.py +83 -0
  258. app/db/alembic/versions/20260515_020000_add_split_sticky_budget_thresholds.py +62 -0
  259. app/db/alembic/versions/20260516_000000_add_sqlite_hot_path_indexes.py +75 -0
  260. app/db/alembic/versions/20260517_000000_merge_sqlite_hot_path_and_request_log_delete_heads.py +24 -0
  261. app/db/alembic/versions/20260518_000000_add_http_bridge_durable_input_prefix.py +44 -0
  262. app/db/alembic/versions/20260518_010000_merge_http_bridge_and_sqlite_recovery_heads.py +25 -0
  263. app/db/alembic/versions/20260518_120000_add_dashboard_guest_access.py +57 -0
  264. app/db/alembic/versions/20260520_000000_merge_api_key_and_http_bridge_heads.py +26 -0
  265. app/db/alembic/versions/20260520_010000_add_request_logs_api_key_account_index.py +45 -0
  266. app/db/alembic/versions/20260520_010000_merge_automation_and_api_key_heads.py +26 -0
  267. app/db/alembic/versions/20260520_030000_add_quota_planner.py +194 -0
  268. app/db/alembic/versions/20260520_040000_merge_quota_planner_and_request_log_index_heads.py +24 -0
  269. app/db/alembic/versions/20260521_000000_add_account_security_work_authorized.py +46 -0
  270. app/db/alembic/versions/20260521_000000_merge_dashboard_guest_and_api_key_heads.py +26 -0
  271. app/db/alembic/versions/20260521_000000_merge_prefer_reset_window_head.py +26 -0
  272. app/db/alembic/versions/20260521_000000_merge_warmup_and_request_log_index_heads.py +25 -0
  273. app/db/alembic/versions/20260522_000000_add_limit_warmup_trigger.py +195 -0
  274. app/db/alembic/versions/20260524_000000_merge_accounts_alias_and_reset_window_heads.py +24 -0
  275. app/db/alembic/versions/20260525_000000_add_usage_raw_window_latest_index.py +31 -0
  276. app/db/alembic/versions/20260526_000000_add_request_log_failure_metadata.py +100 -0
  277. app/db/alembic/versions/20260531_000000_add_account_workspace_identity.py +39 -0
  278. app/db/alembic/versions/20260531_000000_add_single_account_routing.py +42 -0
  279. app/db/alembic/versions/20260601_000000_merge_relative_availability_and_usage_raw_heads.py +24 -0
  280. app/db/alembic/versions/20260601_010000_add_api_key_usage_sections.py +58 -0
  281. app/db/alembic/versions/20260601_010000_add_routing_policy_persistence.py +67 -0
  282. app/db/alembic/versions/20260601_010000_merge_security_work_and_relative_availability_heads.py +25 -0
  283. app/db/alembic/versions/20260601_010000_merge_split_sticky_and_relative_usage_heads.py +25 -0
  284. app/db/alembic/versions/20260601_010000_merge_warmup_and_relative_availability_heads.py +25 -0
  285. app/db/alembic/versions/20260601_020000_merge_additional_quota_routing_and_relative_availability_heads.py +25 -0
  286. app/db/alembic/versions/20260601_020000_merge_quota_planner_and_relative_availability_heads.py +25 -0
  287. app/db/alembic/versions/20260601_020000_merge_reset_window_and_relative_availability_heads.py +25 -0
  288. app/db/alembic/versions/20260601_020000_merge_routing_policy_and_split_threshold_heads.py +24 -0
  289. app/db/alembic/versions/20260601_020000_merge_warmup_and_request_log_failure_heads.py +25 -0
  290. app/db/alembic/versions/20260601_030000_merge_single_account_and_routing_quota_heads.py +29 -0
  291. app/db/alembic/versions/20260601_040000_merge_security_work_and_routing_consolidation_heads.py +25 -0
  292. app/db/alembic/versions/20260601_050000_merge_quota_planner_and_routing_consolidation_heads.py +25 -0
  293. app/db/alembic/versions/20260602_050000_add_upstream_proxy_routing.py +164 -0
  294. app/db/alembic/versions/20260602_060000_merge_account_workspace_and_failure_heads.py +25 -0
  295. app/db/alembic/versions/20260602_070000_add_request_log_useragent_fields.py +86 -0
  296. app/db/alembic/versions/20260602_070000_merge_quota_planner_and_account_workspace_heads.py +25 -0
  297. app/db/alembic/versions/20260602_080000_merge_upstream_proxy_and_quota_planner_heads.py +25 -0
  298. app/db/alembic/versions/20260602_080000_merge_useragent_and_upstream_proxy_heads.py +24 -0
  299. app/db/alembic/versions/20260603_000000_add_weekly_pace_working_days.py +52 -0
  300. app/db/alembic/versions/20260603_000000_free_account_monthly_window.py +60 -0
  301. app/db/alembic/versions/20260604_000000_add_reauth_required_account_status.py +159 -0
  302. app/db/alembic/versions/20260604_010000_merge_automations_and_reauth_status_heads.py +25 -0
  303. app/db/alembic/versions/20260604_010000_merge_dashboard_guest_and_reauth_status_heads.py +25 -0
  304. app/db/alembic/versions/20260604_010000_merge_useragent_and_reauth_heads.py +24 -0
  305. app/db/alembic/versions/20260607_000000_merge_weekly_monthly_useragent_heads.py +28 -0
  306. app/db/alembic/versions/20260608_000000_add_hide_upstream_quota_from_api_keys.py +50 -0
  307. app/db/alembic/versions/20260611_000000_add_request_log_archive_request_id.py +47 -0
  308. app/db/alembic/versions/20260611_000000_merge_automations_and_weekly_monthly_useragent_heads.py +26 -0
  309. app/db/alembic/versions/20260611_000000_merge_dashboard_guest_and_weekly_useragent_heads.py +26 -0
  310. app/db/alembic/versions/20260611_010000_add_request_log_client_ip.py +57 -0
  311. app/db/alembic/versions/20260611_020000_merge_request_log_archive_and_client_ip_heads.py +26 -0
  312. app/db/alembic/versions/20260611_030000_merge_dashboard_guest_and_request_log_client_ip_heads.py +26 -0
  313. app/db/alembic/versions/20260613_000000_add_accounts_codex_installation_id.py +57 -0
  314. app/db/alembic/versions/20260613_010000_merge_installation_id_and_dashboard_weekly_heads.py +26 -0
  315. app/db/alembic/versions/20260615_000000_merge_automations_and_dashboard_guest_heads.py +26 -0
  316. app/db/alembic/versions/20260623_000000_add_limit_warmup_exhausted_threshold.py +51 -0
  317. app/db/alembic/versions/20260626_000000_add_http_downstream_transport_policy.py +46 -0
  318. app/db/alembic/versions/20260626_010000_add_request_logs_upstream_transport.py +31 -0
  319. app/db/alembic/versions/20260629_000000_add_dashboard_query_hot_path_indexes.py +53 -0
  320. app/db/alembic/versions/20260630_000000_add_limit_warmup_staggered_idle.py +47 -0
  321. app/db/alembic/versions/20260630_000000_merge_request_log_client_ip_and_dashboard_hot_path_heads.py +26 -0
  322. app/db/alembic/versions/20260630_010000_merge_warmup_and_request_log_dashboard_heads.py +26 -0
  323. app/db/alembic/versions/20260630_020000_merge_automations_and_main_heads.py +26 -0
  324. app/db/alembic/versions/20260630_020000_merge_warmup_threshold_and_main_heads.py +26 -0
  325. app/db/alembic/versions/20260630_030000_add_automation_run_model_snapshot.py +59 -0
  326. app/db/alembic/versions/20260630_040000_merge_automation_snapshot_and_warmup_threshold_heads.py +26 -0
  327. app/db/alembic/versions/20260630_050000_add_automation_run_prompt_snapshot.py +52 -0
  328. app/db/alembic/versions/20260701_000000_add_weekly_pace_smoothing_minutes.py +51 -0
  329. app/db/alembic/versions/20260702_000000_add_model_sources.py +176 -0
  330. app/db/alembic/versions/20260705_000000_add_model_source_audio_transcriptions.py +50 -0
  331. app/db/alembic/versions/20260705_000000_harden_dashboard_session_ttl.py +62 -0
  332. app/db/alembic/versions/20260706_000000_add_model_source_audio_per_minute.py +43 -0
  333. app/db/alembic/versions/20260707_000000_merge_model_sources_and_session_ttl.py +24 -0
  334. app/db/alembic/versions/20260707_010000_merge_automations_and_model_sources_heads.py +24 -0
  335. app/db/alembic/versions/20260707_020000_add_automation_job_account_scope.py +125 -0
  336. app/db/alembic/versions/20260709_000000_add_ttft_phase_observability.py +66 -0
  337. app/db/alembic/versions/20260711_000000_add_dashboard_prohibit_fast_mode.py +42 -0
  338. app/db/alembic/versions/20260711_010000_add_account_chatgpt_user_id.py +40 -0
  339. app/db/alembic/versions/20260711_020000_add_dashboard_account_concurrency_caps.py +71 -0
  340. app/db/alembic/versions/20260711_030000_add_limit_warmup_idle_threshold.py +51 -0
  341. app/db/alembic/versions/20260712_010000_add_account_usage_rollups.py +56 -0
  342. app/db/alembic/versions/20260712_020000_add_api_key_usage_rollups.py +53 -0
  343. app/db/alembic/versions/20260713_020000_add_model_registry_snapshot.py +42 -0
  344. app/db/alembic/versions/20260713_040000_add_account_refresh_claims.py +42 -0
  345. app/db/alembic/versions/20260713_040000_add_replica_guardrails.py +64 -0
  346. app/db/alembic/versions/20260713_070000_add_reset_credit_redeem_tables.py +58 -0
  347. app/db/alembic/versions/20260714_000000_add_oauth_flow_states.py +63 -0
  348. app/db/alembic/versions/20260715_000000_add_request_log_queue_latency.py +44 -0
  349. app/db/alembic/versions/20260716_000000_add_oauth_device_flow_slots.py +41 -0
  350. app/db/alembic/versions/20260716_010000_add_dashboard_retention_settings.py +48 -0
  351. app/db/alembic/versions/20260716_010000_add_reset_credit_display_settings.py +73 -0
  352. app/db/alembic/versions/20260717_000000_add_http_bridge_retry_circuits.py +47 -0
  353. app/db/alembic/versions/20260717_000000_merge_retention_and_reset_credit_display_heads.py +26 -0
  354. app/db/alembic/versions/20260717_000000_optimize_dashboard_hot_path_indexes.py +162 -0
  355. app/db/alembic/versions/20260717_000001_merge_retry_circuits_and_dashboard_indexes.py +22 -0
  356. app/db/alembic/versions/20260720_000000_add_request_log_conversation_id.py +57 -0
  357. app/db/alembic/versions/20260722_000000_backfill_request_log_useragent_families.py +40 -0
  358. app/db/alembic/versions/20260724_000000_add_request_usage_time_rollups.py +176 -0
  359. app/db/alembic/versions/20260724_000000_merge_request_log_schema_heads.py +33 -0
  360. app/db/alembic/versions/20260725_000000_add_http_bridge_pending_tool_calls.py +43 -0
  361. app/db/alembic/versions/20260726_000000_add_account_plan_downgrade_observations.py +44 -0
  362. app/db/alembic/versions/20260726_000000_repair_request_usage_rollups_after_merge.py +37 -0
  363. app/db/alembic/versions/20260727_000000_add_sticky_session_continuity_abandoned_at.py +45 -0
  364. app/db/alembic/versions/20260728_000000_merge_pending_tool_calls_and_rollup_repair_heads.py +31 -0
  365. app/db/alembic/versions/20260730_000000_add_api_key_fair_share_threshold.py +44 -0
  366. app/db/alembic/versions/20260730_000000_add_http_bridge_recovery_attempts.py +60 -0
  367. app/db/alembic/versions/20260731_000000_add_capability_lineage_markers.py +38 -0
  368. app/db/alembic/versions/20260803_000000_merge_http_bridge_recovery_and_capability_lineage_heads.py +30 -0
  369. app/db/alembic/versions/20260804_000000_add_http_bridge_operations.py +63 -0
  370. app/db/alembic/versions/20260804_000001_add_global_http_bridge_operation_fingerprint.py +53 -0
  371. app/db/alembic/versions/20260804_230000_add_request_log_connection_request_kind.py +43 -0
  372. app/db/alembic/versions/20260805_000000_add_http_bridge_operation_spool.py +75 -0
  373. app/db/alembic/versions/20260805_000001_finalize_http_bridge_operation_spool.py +65 -0
  374. app/db/alembic/versions/20260806_000000_add_additional_usage_alias_probe_indexes.py +84 -0
  375. app/db/alembic/versions/20260806_000000_add_anonymous_telemetry.py +49 -0
  376. app/db/alembic/versions/20260806_010000_add_conversation_presence_rollup.py +72 -0
  377. app/db/alembic/versions/20260806_020000_add_usage_history_bulk_covering_indexes.py +99 -0
  378. app/db/alembic/versions/20260806_030000_add_api_key_allowed_reasoning_efforts.py +65 -0
  379. app/db/alembic/versions/20260806_120000_add_http_bridge_owner_process_epoch.py +57 -0
  380. app/db/alembic/versions/20260807_000000_merge_http_bridge_operation_spool_and_latest_main.py +24 -0
  381. app/db/alembic/versions/20260808_000000_tune_usage_history_autovacuum.py +54 -0
  382. app/db/alembic/versions/20260810_000000_add_http_bridge_recovery_dispatch_count.py +44 -0
  383. app/db/alembic/versions/20260811_000000_add_hourly_rollup_cancelled_count.py +92 -0
  384. app/db/alembic/versions/20260812_000000_merge_recovery_dispatch_and_hourly_cancelled_heads.py +25 -0
  385. app/db/alembic/versions/20260812_120000_add_sticky_abandonment_scope.py +43 -0
  386. app/db/alembic/versions/20260813_000000_add_file_account_pins.py +40 -0
  387. app/db/alembic/versions/20260816_000000_add_account_pending_deletion.py +81 -0
  388. app/db/alembic/versions/20260816_000000_add_model_source_embeddings.py +50 -0
  389. app/db/alembic/versions/20260821_000000_add_retry_circuit_admission_generation.py +49 -0
  390. app/db/alembic/versions/20260826_000000_add_http_bridge_event_chunks.py +107 -0
  391. app/db/alembic/versions/20260828_000000_add_accounts_chatgpt_identity_index.py +55 -0
  392. app/db/alembic/versions/20260830_000000_add_quota_warmup_claim_expiry.py +83 -0
  393. app/db/alembic/versions/20260908_000000_add_guest_session_generation.py +37 -0
  394. app/db/alembic/versions/20260908_000000_add_subscription_overflow.py +140 -0
  395. app/db/alembic/versions/20260908_000000_replace_upstream_stream_transport_default_sentinel.py +50 -0
  396. app/db/alembic/versions/20260908_020000_merge_overflow_transport_heads.py +27 -0
  397. app/db/alembic/versions/20260909_000000_add_dashboard_roles.py +72 -0
  398. app/db/alembic/versions/20260909_010000_add_dashboard_users.py +183 -0
  399. app/db/alembic/versions/20260909_020000_reproject_compat_admin_credentials.py +105 -0
  400. app/db/alembic/versions/20260909_030000_add_audit_actor_columns.py +103 -0
  401. app/db/alembic/versions/20260909_030000_dashboard_resilience_toggle_settings.py +63 -0
  402. app/db/alembic/versions/20260909_040000_add_dashboard_user_invites.py +54 -0
  403. app/db/alembic/versions/20260909_040000_dashboard_timeout_settings.py +68 -0
  404. app/db/alembic/versions/20260909_050000_dashboard_routing_overload_settings.py +65 -0
  405. app/db/alembic/versions/20260909_060000_add_report_rollup.py +74 -0
  406. app/db/alembic/versions/20260909_070000_automation_run_claim_budget.py +50 -0
  407. app/db/alembic/versions/20260909_080000_dashboard_stream_bridge_budgets.py +62 -0
  408. app/db/alembic/versions/20260909_090000_dashboard_background_job_toggles.py +63 -0
  409. app/db/alembic/versions/20260909_100000_dashboard_codex_prewarm.py +49 -0
  410. app/db/alembic/versions/20260909_110000_model_context_window_overrides.py +45 -0
  411. app/db/alembic/versions/20260909_120000_dashboard_conversation_archive.py +48 -0
  412. app/db/alembic/versions/20260909_130000_add_request_logs_live_facet_indexes.py +96 -0
  413. app/db/alembic/versions/20260910_000000_add_totp_required_for_admin_role.py +44 -0
  414. app/db/alembic/versions/20260910_000000_request_logs_missing_cost_index.py +52 -0
  415. app/db/alembic/versions/20260910_010000_add_dashboard_auth_providers.py +134 -0
  416. app/db/alembic/versions/20260910_010000_dashboard_spool_retention.py +52 -0
  417. app/db/alembic/versions/20260910_020000_add_dashboard_role_mappings.py +74 -0
  418. app/db/alembic/versions/20260910_143000_request_log_affinity.py +28 -0
  419. app/db/alembic/versions/20260910_180000_merge_affinity_guest_heads.py +17 -0
  420. app/db/alembic/versions/20260910_200000_merge_affinity_identity_heads.py +17 -0
  421. app/db/alembic/versions/20260910_220000_merge_affinity_invite_heads.py +17 -0
  422. app/db/alembic/versions/20260911_000000_model_source_pins_kind_expires_index.py +43 -0
  423. app/db/alembic/versions/20260911_010000_merge_pin_index_and_affinity_heads.py +17 -0
  424. app/db/alembic/versions/20260911_020000_add_http_bridge_terminal_append_phase.py +54 -0
  425. app/db/alembic/versions/20260911_030000_add_local_login_policy.py +48 -0
  426. app/db/alembic/versions/20260911_040000_add_thread_cache_identity_mode.py +48 -0
  427. app/db/alembic/versions/20260911_060000_add_bridge_session_continuity_abandonment.py +40 -0
  428. app/db/alembic/versions/20260912_000000_merge_thread_cache_and_bridge_retirement_heads.py +22 -0
  429. app/db/alembic/versions/20260912_010000_drop_legacy_dashboard_credentials.py +140 -0
  430. app/db/alembic/versions/20260913_000000_add_oidc_provider_flow.py +134 -0
  431. app/db/alembic/versions/20260914_000000_add_scim_tokens.py +78 -0
  432. app/db/alembic/versions/20260914_000000_drop_subscription_overflow_schema.py +132 -0
  433. app/db/alembic/versions/20260918_000000_merge_scim_and_overflow_heads.py +17 -0
  434. app/db/alembic/versions/__init__.py +1 -0
  435. app/db/backup.py +64 -0
  436. app/db/migrate.py +1249 -0
  437. app/db/migration_lock.py +160 -0
  438. app/db/migration_url.py +18 -0
  439. app/db/models.py +3100 -0
  440. app/db/recover.py +244 -0
  441. app/db/session.py +1295 -0
  442. app/db/snapshot.py +46 -0
  443. app/db/sqlite_lock_retry.py +190 -0
  444. app/db/sqlite_utils.py +549 -0
  445. app/dependencies.py +462 -0
  446. app/main.py +1240 -0
  447. app/modules/__init__.py +0 -0
  448. app/modules/accounts/__init__.py +0 -0
  449. app/modules/accounts/api.py +426 -0
  450. app/modules/accounts/auth_manager.py +1439 -0
  451. app/modules/accounts/background_repository.py +160 -0
  452. app/modules/accounts/deletion.py +540 -0
  453. app/modules/accounts/mappers.py +654 -0
  454. app/modules/accounts/refresh_claims.py +352 -0
  455. app/modules/accounts/repository.py +1679 -0
  456. app/modules/accounts/schemas.py +308 -0
  457. app/modules/accounts/service.py +809 -0
  458. app/modules/accounts/usage_rollup.py +486 -0
  459. app/modules/accounts/usage_rollup_scheduler.py +75 -0
  460. app/modules/accounts/usage_time_rollup.py +1037 -0
  461. app/modules/accounts/usage_time_rollup_read.py +522 -0
  462. app/modules/api_keys/__init__.py +1 -0
  463. app/modules/api_keys/api.py +344 -0
  464. app/modules/api_keys/last_used_coalescer.py +216 -0
  465. app/modules/api_keys/limit_windows.py +41 -0
  466. app/modules/api_keys/repository.py +1200 -0
  467. app/modules/api_keys/reset_scheduler.py +85 -0
  468. app/modules/api_keys/schemas.py +135 -0
  469. app/modules/api_keys/service.py +2123 -0
  470. app/modules/audit/__init__.py +0 -0
  471. app/modules/audit/api.py +88 -0
  472. app/modules/audit/repository.py +74 -0
  473. app/modules/audit/schemas.py +33 -0
  474. app/modules/audit/service.py +71 -0
  475. app/modules/auth_providers/__init__.py +0 -0
  476. app/modules/auth_providers/api.py +127 -0
  477. app/modules/auth_providers/config.py +343 -0
  478. app/modules/auth_providers/repository.py +101 -0
  479. app/modules/auth_providers/schemas.py +88 -0
  480. app/modules/auth_providers/seed.py +105 -0
  481. app/modules/auth_providers/service.py +289 -0
  482. app/modules/automations/__init__.py +1 -0
  483. app/modules/automations/api.py +369 -0
  484. app/modules/automations/repository.py +1896 -0
  485. app/modules/automations/scheduler.py +107 -0
  486. app/modules/automations/schemas.py +158 -0
  487. app/modules/automations/service.py +2548 -0
  488. app/modules/cache_isolation_probe/__init__.py +0 -0
  489. app/modules/cache_isolation_probe/api.py +188 -0
  490. app/modules/cache_isolation_probe/prefix.py +144 -0
  491. app/modules/cache_isolation_probe/schemas.py +94 -0
  492. app/modules/cache_isolation_probe/sender.py +229 -0
  493. app/modules/cache_isolation_probe/service.py +525 -0
  494. app/modules/conversation_archive/__init__.py +1 -0
  495. app/modules/conversation_archive/api.py +101 -0
  496. app/modules/conversation_archive/schemas.py +28 -0
  497. app/modules/conversation_archive/service.py +165 -0
  498. app/modules/dashboard/__init__.py +1 -0
  499. app/modules/dashboard/api.py +106 -0
  500. app/modules/dashboard/builders.py +107 -0
  501. app/modules/dashboard/repository.py +304 -0
  502. app/modules/dashboard/schemas.py +148 -0
  503. app/modules/dashboard/service.py +534 -0
  504. app/modules/dashboard/timeframes.py +19 -0
  505. app/modules/dashboard/weekly_pace.py +617 -0
  506. app/modules/dashboard_auth/__init__.py +1 -0
  507. app/modules/dashboard_auth/api.py +1344 -0
  508. app/modules/dashboard_auth/oidc_api.py +753 -0
  509. app/modules/dashboard_auth/oidc_flows.py +330 -0
  510. app/modules/dashboard_auth/repository.py +452 -0
  511. app/modules/dashboard_auth/schemas.py +232 -0
  512. app/modules/dashboard_auth/service.py +1384 -0
  513. app/modules/dashboard_roles/__init__.py +0 -0
  514. app/modules/dashboard_roles/api.py +64 -0
  515. app/modules/dashboard_roles/repository.py +54 -0
  516. app/modules/dashboard_roles/schemas.py +29 -0
  517. app/modules/dashboard_roles/seed.py +80 -0
  518. app/modules/dashboard_roles/service.py +142 -0
  519. app/modules/dashboard_users/__init__.py +0 -0
  520. app/modules/dashboard_users/api.py +278 -0
  521. app/modules/dashboard_users/break_glass.py +169 -0
  522. app/modules/dashboard_users/credentials.py +18 -0
  523. app/modules/dashboard_users/identity_resolver.py +665 -0
  524. app/modules/dashboard_users/repository.py +725 -0
  525. app/modules/dashboard_users/schemas.py +117 -0
  526. app/modules/dashboard_users/service.py +1054 -0
  527. app/modules/firewall/__init__.py +1 -0
  528. app/modules/firewall/api.py +78 -0
  529. app/modules/firewall/repository.py +51 -0
  530. app/modules/firewall/schemas.py +28 -0
  531. app/modules/firewall/service.py +93 -0
  532. app/modules/fleet/__init__.py +1 -0
  533. app/modules/fleet/api.py +177 -0
  534. app/modules/fleet/mappers.py +56 -0
  535. app/modules/fleet/observability.py +372 -0
  536. app/modules/fleet/schemas.py +119 -0
  537. app/modules/health/__init__.py +0 -0
  538. app/modules/health/api.py +246 -0
  539. app/modules/health/schemas.py +27 -0
  540. app/modules/limit_warmup/__init__.py +1 -0
  541. app/modules/limit_warmup/repository.py +159 -0
  542. app/modules/limit_warmup/service.py +1001 -0
  543. app/modules/model_sources/__init__.py +1 -0
  544. app/modules/model_sources/api.py +99 -0
  545. app/modules/model_sources/catalog.py +307 -0
  546. app/modules/model_sources/forwarding.py +1435 -0
  547. app/modules/model_sources/projection.py +55 -0
  548. app/modules/model_sources/repository.py +201 -0
  549. app/modules/model_sources/schemas.py +79 -0
  550. app/modules/model_sources/selection.py +166 -0
  551. app/modules/model_sources/service.py +236 -0
  552. app/modules/oauth/__init__.py +0 -0
  553. app/modules/oauth/api.py +101 -0
  554. app/modules/oauth/repository.py +238 -0
  555. app/modules/oauth/schemas.py +49 -0
  556. app/modules/oauth/service.py +1196 -0
  557. app/modules/oauth/templates/oauth_success.html +122 -0
  558. app/modules/proxy/__init__.py +0 -0
  559. app/modules/proxy/_load_balancer/__init__.py +1 -0
  560. app/modules/proxy/_load_balancer/error_rate.py +116 -0
  561. app/modules/proxy/_load_balancer/latency_cohort.py +154 -0
  562. app/modules/proxy/_load_balancer/model_eligibility.py +250 -0
  563. app/modules/proxy/_load_balancer/opportunistic_admission.py +350 -0
  564. app/modules/proxy/_load_balancer/overload_backoff.py +394 -0
  565. app/modules/proxy/_load_balancer/sticky_selection.py +2417 -0
  566. app/modules/proxy/_load_balancer/throughput_cohort.py +233 -0
  567. app/modules/proxy/_load_balancer/ttft_cohort.py +214 -0
  568. app/modules/proxy/_load_balancer/tunables.py +97 -0
  569. app/modules/proxy/_load_balancer/types.py +96 -0
  570. app/modules/proxy/_load_balancer/unbound_selection.py +534 -0
  571. app/modules/proxy/_service/__init__.py +6 -0
  572. app/modules/proxy/_service/api_key_usage.py +745 -0
  573. app/modules/proxy/_service/clock_budget.py +38 -0
  574. app/modules/proxy/_service/codex_control.py +611 -0
  575. app/modules/proxy/_service/compact.py +2211 -0
  576. app/modules/proxy/_service/file_ops.py +749 -0
  577. app/modules/proxy/_service/http_bridge/__init__.py +3 -0
  578. app/modules/proxy/_service/http_bridge/accepted_replay.py +331 -0
  579. app/modules/proxy/_service/http_bridge/account_sessions.py +57 -0
  580. app/modules/proxy/_service/http_bridge/activity.py +178 -0
  581. app/modules/proxy/_service/http_bridge/helpers.py +3959 -0
  582. app/modules/proxy/_service/http_bridge/mixin.py +2435 -0
  583. app/modules/proxy/_service/http_bridge/owner_forwarding.py +609 -0
  584. app/modules/proxy/_service/http_bridge/protocol.py +167 -0
  585. app/modules/proxy/_service/http_bridge/proxy_failover.py +58 -0
  586. app/modules/proxy/_service/http_bridge/quarantine.py +443 -0
  587. app/modules/proxy/_service/http_bridge/request_submit.py +4582 -0
  588. app/modules/proxy/_service/http_bridge/retry_circuit.py +2442 -0
  589. app/modules/proxy/_service/http_bridge/service_stubs.py +492 -0
  590. app/modules/proxy/_service/http_bridge/session_registry.py +778 -0
  591. app/modules/proxy/_service/http_bridge/streaming.py +5328 -0
  592. app/modules/proxy/_service/http_bridge/upstream_events.py +4538 -0
  593. app/modules/proxy/_service/observability.py +410 -0
  594. app/modules/proxy/_service/rate_limit.py +361 -0
  595. app/modules/proxy/_service/realtime_live.py +655 -0
  596. app/modules/proxy/_service/refresh.py +154 -0
  597. app/modules/proxy/_service/request_log.py +585 -0
  598. app/modules/proxy/_service/response_create.py +930 -0
  599. app/modules/proxy/_service/streaming/__init__.py +3 -0
  600. app/modules/proxy/_service/streaming/helpers.py +1317 -0
  601. app/modules/proxy/_service/streaming/mixin.py +1100 -0
  602. app/modules/proxy/_service/streaming/protocol.py +32 -0
  603. app/modules/proxy/_service/streaming/retry.py +3762 -0
  604. app/modules/proxy/_service/support.py +2122 -0
  605. app/modules/proxy/_service/transcribe.py +434 -0
  606. app/modules/proxy/_service/warmup.py +483 -0
  607. app/modules/proxy/_service/websocket/__init__.py +3 -0
  608. app/modules/proxy/_service/websocket/helpers.py +2360 -0
  609. app/modules/proxy/_service/websocket/mixin.py +7285 -0
  610. app/modules/proxy/_service/websocket/protocol.py +74 -0
  611. app/modules/proxy/account_cache.py +229 -0
  612. app/modules/proxy/account_eligibility.py +87 -0
  613. app/modules/proxy/additional_model_limits.py +40 -0
  614. app/modules/proxy/affinity.py +830 -0
  615. app/modules/proxy/affinity_observation.py +101 -0
  616. app/modules/proxy/api.py +10254 -0
  617. app/modules/proxy/api_key_usage.py +113 -0
  618. app/modules/proxy/cap_partitioning.py +280 -0
  619. app/modules/proxy/capability_lineage.py +65 -0
  620. app/modules/proxy/capability_lineage_repository.py +82 -0
  621. app/modules/proxy/capability_routing.py +253 -0
  622. app/modules/proxy/continuity.py +112 -0
  623. app/modules/proxy/downstream_delivery.py +277 -0
  624. app/modules/proxy/durable_bridge_coordinator.py +1217 -0
  625. app/modules/proxy/durable_bridge_repository.py +4516 -0
  626. app/modules/proxy/durable_bridge_runtime.py +9 -0
  627. app/modules/proxy/durable_bridge_transcript_codec.py +122 -0
  628. app/modules/proxy/fair_share.py +131 -0
  629. app/modules/proxy/file_pin_repository.py +210 -0
  630. app/modules/proxy/helpers.py +439 -0
  631. app/modules/proxy/http_bridge_event_batcher.py +613 -0
  632. app/modules/proxy/http_bridge_forwarding.py +797 -0
  633. app/modules/proxy/http_continuation.py +76 -0
  634. app/modules/proxy/images_observability.py +62 -0
  635. app/modules/proxy/images_service.py +1054 -0
  636. app/modules/proxy/load_balancer.py +3016 -0
  637. app/modules/proxy/rate_limit_cache.py +46 -0
  638. app/modules/proxy/replay_safety.py +1063 -0
  639. app/modules/proxy/repo_bundle.py +31 -0
  640. app/modules/proxy/request_policy.py +1054 -0
  641. app/modules/proxy/ring_membership.py +251 -0
  642. app/modules/proxy/schemas.py +345 -0
  643. app/modules/proxy/selection_errors.py +41 -0
  644. app/modules/proxy/service.py +2600 -0
  645. app/modules/proxy/source_admission.py +125 -0
  646. app/modules/proxy/source_dispatch.py +999 -0
  647. app/modules/proxy/sticky_repository.py +831 -0
  648. app/modules/proxy/thread_anchors.py +491 -0
  649. app/modules/proxy/tool_call_dedupe.py +802 -0
  650. app/modules/proxy/types.py +54 -0
  651. app/modules/proxy/work_admission.py +121 -0
  652. app/modules/quota_planner/__init__.py +1 -0
  653. app/modules/quota_planner/api.py +276 -0
  654. app/modules/quota_planner/logic.py +743 -0
  655. app/modules/quota_planner/repository.py +722 -0
  656. app/modules/quota_planner/scheduler.py +212 -0
  657. app/modules/quota_planner/schemas.py +102 -0
  658. app/modules/quota_planner/warmup.py +693 -0
  659. app/modules/rate_limit_reset_credits/__init__.py +0 -0
  660. app/modules/rate_limit_reset_credits/api.py +601 -0
  661. app/modules/rate_limit_reset_credits/redeem_coordination.py +274 -0
  662. app/modules/rate_limit_reset_credits/store.py +114 -0
  663. app/modules/reports/__init__.py +1 -0
  664. app/modules/reports/api.py +134 -0
  665. app/modules/reports/cache.py +74 -0
  666. app/modules/reports/filters.py +27 -0
  667. app/modules/reports/repository.py +525 -0
  668. app/modules/reports/rollup.py +150 -0
  669. app/modules/reports/rollup_read.py +148 -0
  670. app/modules/reports/schemas.py +123 -0
  671. app/modules/reports/service.py +287 -0
  672. app/modules/reports/thread_identity.py +256 -0
  673. app/modules/request_logs/__init__.py +0 -0
  674. app/modules/request_logs/api.py +224 -0
  675. app/modules/request_logs/cost_backfill.py +154 -0
  676. app/modules/request_logs/mappers.py +97 -0
  677. app/modules/request_logs/repository.py +1765 -0
  678. app/modules/request_logs/schemas.py +145 -0
  679. app/modules/request_logs/service.py +348 -0
  680. app/modules/role_mappings/__init__.py +0 -0
  681. app/modules/role_mappings/api.py +206 -0
  682. app/modules/role_mappings/matching.py +55 -0
  683. app/modules/role_mappings/repository.py +106 -0
  684. app/modules/role_mappings/schemas.py +67 -0
  685. app/modules/role_mappings/service.py +334 -0
  686. app/modules/runtime/__init__.py +1 -0
  687. app/modules/runtime/api.py +18 -0
  688. app/modules/runtime/schemas.py +14 -0
  689. app/modules/runtime/service.py +218 -0
  690. app/modules/scim/__init__.py +1 -0
  691. app/modules/scim/api.py +194 -0
  692. app/modules/scim/dependencies.py +112 -0
  693. app/modules/scim/errors.py +77 -0
  694. app/modules/scim/management_api.py +156 -0
  695. app/modules/scim/repository.py +212 -0
  696. app/modules/scim/schemas.py +145 -0
  697. app/modules/scim/service.py +786 -0
  698. app/modules/scim/tokens.py +43 -0
  699. app/modules/settings/__init__.py +1 -0
  700. app/modules/settings/api.py +1677 -0
  701. app/modules/settings/repository.py +606 -0
  702. app/modules/settings/schemas.py +496 -0
  703. app/modules/settings/service.py +769 -0
  704. app/modules/shared/__init__.py +0 -0
  705. app/modules/shared/schemas.py +22 -0
  706. app/modules/sticky_sessions/__init__.py +1 -0
  707. app/modules/sticky_sessions/api.py +118 -0
  708. app/modules/sticky_sessions/cleanup_scheduler.py +487 -0
  709. app/modules/sticky_sessions/schemas.py +78 -0
  710. app/modules/sticky_sessions/service.py +196 -0
  711. app/modules/telemetry/__init__.py +5 -0
  712. app/modules/telemetry/api.py +115 -0
  713. app/modules/telemetry/clients.py +62 -0
  714. app/modules/telemetry/consent.py +115 -0
  715. app/modules/telemetry/scheduler.py +85 -0
  716. app/modules/telemetry/schemas.py +163 -0
  717. app/modules/telemetry/sender.py +221 -0
  718. app/modules/telemetry/snapshot.py +490 -0
  719. app/modules/usage/__init__.py +0 -0
  720. app/modules/usage/additional_quota_keys.py +379 -0
  721. app/modules/usage/api.py +45 -0
  722. app/modules/usage/background_repository.py +147 -0
  723. app/modules/usage/builders.py +559 -0
  724. app/modules/usage/depletion_service.py +277 -0
  725. app/modules/usage/live_ingest.py +356 -0
  726. app/modules/usage/mappers.py +29 -0
  727. app/modules/usage/plan_downgrade_observations.py +488 -0
  728. app/modules/usage/repository.py +1890 -0
  729. app/modules/usage/schemas.py +68 -0
  730. app/modules/usage/service.py +102 -0
  731. app/modules/usage/updater.py +1488 -0
  732. app/static/assets/Trans-Cj-J9mVA.js +1 -0
  733. app/static/assets/access-page-DHzZiXZi.js +1 -0
  734. app/static/assets/account-cost-donut-DGhfA4U8.js +1 -0
  735. app/static/assets/account-identifiers-CxbdLshZ.js +1 -0
  736. app/static/assets/account-status-DIsU5sUS.js +1 -0
  737. app/static/assets/account-trend-chart-BptlfwwQ.js +1 -0
  738. app/static/assets/accounts-page-Bbai8ift.js +3 -0
  739. app/static/assets/api-Dwa7XxPe.js +1 -0
  740. app/static/assets/api-client-dugX1Pti.js +55 -0
  741. app/static/assets/api-key-create-dialog-DnRm0oYN.js +1 -0
  742. app/static/assets/api-key-created-dialog-B6jkDG9f.js +1 -0
  743. app/static/assets/api-key-edit-dialog-Ck3Bnc3V.js +1 -0
  744. app/static/assets/api-trend-chart-BchCw7Hj.js +1 -0
  745. app/static/assets/apis-page-BvXz9c6i.js +2 -0
  746. app/static/assets/arrow-up-Dqh_KzJo.js +1 -0
  747. app/static/assets/arrow-up-down-LBRgVDGY.js +1 -0
  748. app/static/assets/automations-page-DQgNAJOR.js +3 -0
  749. app/static/assets/badge-DqMb9es0.js +1 -0
  750. app/static/assets/blur-email-HEvKagG2.js +1 -0
  751. app/static/assets/button-BjVmmiGW.js +1 -0
  752. app/static/assets/checkbox-apsl9vzk.js +1 -0
  753. app/static/assets/chevron-left-1d_pHVa5.js +1 -0
  754. app/static/assets/circle-alert-BS0xd_o1.js +1 -0
  755. app/static/assets/clsx-DB0hHKMi.js +1 -0
  756. app/static/assets/colors-BBy8GEtr.js +1 -0
  757. app/static/assets/copy-button-D7nAvOKR.js +1 -0
  758. app/static/assets/cost-per-day-chart-YdqlkZVM.js +1 -0
  759. app/static/assets/createLucideIcon-DBLzLNh2.js +1 -0
  760. app/static/assets/dashboard-page-CSdhBy0f.js +2 -0
  761. app/static/assets/distribution-metric-format-yZTy1ZEu.js +1 -0
  762. app/static/assets/donut-chart-Bxc69cra.js +1 -0
  763. app/static/assets/download-kQteIcsB.js +1 -0
  764. app/static/assets/ellipsis-B_5OgIre.js +1 -0
  765. app/static/assets/empty-state-JcA7tc8m.js +1 -0
  766. app/static/assets/es2015-bMH8YKZT.js +41 -0
  767. app/static/assets/es6-B264ni6W.js +69 -0
  768. app/static/assets/external-link-UVAOgMQ0.js +1 -0
  769. app/static/assets/i18n-BWqZ9Ua2.js +1 -0
  770. app/static/assets/inbox-B_RM2s1J.js +1 -0
  771. app/static/assets/index-DIpd264Z.js +23 -0
  772. app/static/assets/index-DMeLKRJx.css +2 -0
  773. app/static/assets/inherit-badge-QhTYVaU6.js +1 -0
  774. app/static/assets/invite-dialog-0CYh0GiQ.js +1 -0
  775. app/static/assets/iso-Bpe5Ihbb.js +1 -0
  776. app/static/assets/label-CGaLmLNf.js +1 -0
  777. app/static/assets/lazy-recharts-Pv8p9ArM.js +2 -0
  778. app/static/assets/loading-overlay-CzKQfHLI.js +1 -0
  779. app/static/assets/mini-quota-bar-cGT_t8Ae.js +1 -0
  780. app/static/assets/model-distribution-donut-BKjAfT48.js +1 -0
  781. app/static/assets/model-source-multi-select-D2d06Vc7.js +1 -0
  782. app/static/assets/multi-select-filter-KIA5qU6Z.js +1 -0
  783. app/static/assets/oauth-dialog-XeaGGDjS.js +1 -0
  784. app/static/assets/pagination-controls-D1Ypd0RU.js +1 -0
  785. app/static/assets/payload-CIYnGZz9.js +1 -0
  786. app/static/assets/queue-wait-chart-VoV7Yg9L.js +1 -0
  787. app/static/assets/report-chart-card-BXDliwcc.js +1 -0
  788. app/static/assets/reports-page-CGCJeMHG.js +3 -0
  789. app/static/assets/reset-credit-confirm-dialog-QOifTnVB.js +1 -0
  790. app/static/assets/rolldown-runtime-hePW80VL.js +1 -0
  791. app/static/assets/search-HfhqwERt.js +1 -0
  792. app/static/assets/select-Cl33bz-g.js +1 -0
  793. app/static/assets/settings-page-mZj01HYl.js +2 -0
  794. app/static/assets/shim-CZwyM4Q7.js +1 -0
  795. app/static/assets/skeleton-C_EUc4Rp.js +1 -0
  796. app/static/assets/sparkline-chart-DdNNsddM.js +1 -0
  797. app/static/assets/status-badge-CHHA5X6c.js +1 -0
  798. app/static/assets/switch-CzxgokcM.js +1 -0
  799. app/static/assets/table-DXaNSQ0G.js +1 -0
  800. app/static/assets/time-to-first-token-chart--68L0u_v.js +1 -0
  801. app/static/assets/tokens-per-day-chart-Cs82BFuE.js +1 -0
  802. app/static/assets/tokens-per-second-chart-AD2dfOn6.js +1 -0
  803. app/static/assets/totp-settings-CRHtxQ7j.js +1 -0
  804. app/static/assets/trash-D3KyWr1h.js +1 -0
  805. app/static/assets/use-account-quota-display-BPmrTBTC.js +1 -0
  806. app/static/assets/use-accounts-PWlVGw3z.js +1 -0
  807. app/static/assets/use-auth-CuDlW3iC.js +1 -0
  808. app/static/assets/use-chart-colors-DIu6tClI.js +1 -0
  809. app/static/assets/use-model-sources-Bul24JBu.js +1 -0
  810. app/static/assets/use-models-DUCPUuZg.js +1 -0
  811. app/static/assets/use-reduced-motion-hAm5r6_d.js +1 -0
  812. app/static/assets/useTranslation--56nHhlH.js +1 -0
  813. app/static/assets/useragent-distribution-donut-Dup6sf_n.js +1 -0
  814. app/static/assets/users-uIC3TIlE.js +1 -0
  815. app/static/assets/vendor-query-_bHZuxEx.js +1 -0
  816. app/static/assets/vendor-react-BVL0YZPW.js +9 -0
  817. app/static/favicon.svg +10 -0
  818. app/static/fonts/GeistSans-Variable.woff2 +0 -0
  819. app/static/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
  820. app/static/fonts/jetbrains-mono-latin.woff2 +0 -0
  821. app/static/index.html +29 -0
  822. codexlb_up-1.25.0b10.dist-info/METADATA +124 -0
  823. codexlb_up-1.25.0b10.dist-info/RECORD +827 -0
  824. codexlb_up-1.25.0b10.dist-info/WHEEL +4 -0
  825. codexlb_up-1.25.0b10.dist-info/entry_points.txt +3 -0
  826. codexlb_up-1.25.0b10.dist-info/licenses/LICENSE +21 -0
  827. config/additional_quota_registry.json +11 -0
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/account-cost-donut-DGhfA4U8.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-query-_bHZuxEx.js","assets/useTranslation--56nHhlH.js","assets/shim-CZwyM4Q7.js","assets/index-DIpd264Z.js","assets/vendor-react-BVL0YZPW.js","assets/createLucideIcon-DBLzLNh2.js","assets/iso-Bpe5Ihbb.js","assets/es2015-bMH8YKZT.js","assets/button-BjVmmiGW.js","assets/clsx-DB0hHKMi.js","assets/api-client-dugX1Pti.js","assets/circle-alert-BS0xd_o1.js","assets/i18n-BWqZ9Ua2.js","assets/label-CGaLmLNf.js","assets/use-auth-CuDlW3iC.js","assets/index-DMeLKRJx.css","assets/lazy-recharts-Pv8p9ArM.js","assets/colors-BBy8GEtr.js","assets/use-reduced-motion-hAm5r6_d.js","assets/api-trend-chart-BchCw7Hj.js","assets/use-chart-colors-DIu6tClI.js","assets/api-key-create-dialog-DnRm0oYN.js","assets/model-source-multi-select-D2d06Vc7.js","assets/chevron-left-1d_pHVa5.js","assets/select-Cl33bz-g.js","assets/use-models-DUCPUuZg.js","assets/account-status-DIsU5sUS.js","assets/use-accounts-PWlVGw3z.js","assets/badge-DqMb9es0.js","assets/status-badge-CHHA5X6c.js","assets/api-Dwa7XxPe.js","assets/trash-D3KyWr1h.js","assets/switch-CzxgokcM.js","assets/use-model-sources-Bul24JBu.js","assets/checkbox-apsl9vzk.js","assets/api-key-edit-dialog-Ck3Bnc3V.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,S as n,r,t as i,x as a}from"./vendor-query-_bHZuxEx.js";import{t as o}from"./iso-Bpe5Ihbb.js";import{i as s,n as c,o as l,s as u,t as d}from"./select-Cl33bz-g.js";import{t as f}from"./ellipsis-B_5OgIre.js";import{n as p,r as m,t as h}from"./trash-D3KyWr1h.js";import{n as g,t as _}from"./search-HfhqwERt.js";import{t as v}from"./useTranslation--56nHhlH.js";import{c as y,t as b}from"./button-BjVmmiGW.js";import{d as x,f as S,h as C,m as w,r as T,v as E}from"./api-client-dugX1Pti.js";import{t as D}from"./switch-CzxgokcM.js";import{n as ee,r as te}from"./use-auth-CuDlW3iC.js";import{En as ne,Gt as O,K as re,Kt as ie,O as k,On as ae,Pn as A,Xn as j,Zn as oe,cn as M,dr as N,er as se,et as ce,j as P,kn as F,sn as I,ur as le,z as L}from"./index-DIpd264Z.js";import{o as R,s as z}from"./account-status-DIsU5sUS.js";import{t as B}from"./loading-overlay-CzKQfHLI.js";import{t as V}from"./badge-DqMb9es0.js";import{t as H}from"./mini-quota-bar-cGT_t8Ae.js";import{t as U}from"./skeleton-C_EUc4Rp.js";import{i as W,n as ue,o as de,r as fe,s as pe,t as G}from"./api-Dwa7XxPe.js";import{t as me}from"./api-key-created-dialog-B6jkDG9f.js";var K=e(t(),1),q=n();function J(e){return e.expiresAt?new Date(e.expiresAt).getTime()<Date.now():!1}function he(e){if(!Number.isFinite(e)||e<=0)return`0%`;let t=e*100,n=+(t<10);return`${t.toLocaleString(void 0,{maximumFractionDigits:n})}%`}function Y({label:e,value:t,meta:n}){let r=`api-keys-overview-stat-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`)}`;return(0,q.jsxs)(`div`,{className:`rounded-xl border bg-card p-4`,"data-testid":r,children:[(0,q.jsx)(`p`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:e}),(0,q.jsx)(`p`,{className:`mt-1 text-[1.55rem] font-semibold tracking-tight tabular-nums`,children:t}),n?(0,q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n}):null]})}function ge(e,t){return e===`cost`?P(t):k(t)}function _e(e,t){let n=e.reduce((e,n)=>{let r=n.usageSummary,i=t===`cost`?r?.totalCostUsd??0:t===`tokens`?r?.totalTokens??0:r?.requestCount??0;return i>0&&e.push({id:n.id,label:n.name,labelSuffix:n.keyPrefix?` · ${n.keyPrefix}`:``,value:i}),e},[]).sort((e,t)=>t.value-e.value),r=n.reduce((e,t)=>e+t.value,0);return r<=0?[]:n.map(e=>({...e,share:e.value/r}))}function X({title:e,subtitle:t,metric:n,apiKeys:r}){let{t:i}=v(),a=_e(r,n),o=a.length>0;return(0,q.jsxs)(`div`,{className:`rounded-xl border bg-card p-4`,"data-testid":`api-keys-overview-${n}-panel`,children:[(0,q.jsxs)(`div`,{className:`mb-3`,children:[(0,q.jsx)(`h3`,{className:`text-sm font-semibold`,children:e}),(0,q.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t})]}),o?(0,q.jsx)(`div`,{className:`space-y-3 overflow-y-auto pr-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,style:{maxHeight:`18rem`},children:a.map((e,t)=>(0,q.jsxs)(`div`,{className:`animate-fade-in-up space-y-1.5`,style:{animationDelay:`${t*50}ms`},children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs`,children:[(0,q.jsxs)(`span`,{className:`min-w-0 truncate font-medium`,children:[e.label,(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:e.labelSuffix})]}),(0,q.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[ge(n,e.value),` · `,he(e.share)]})]}),(0,q.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,q.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width] duration-500 ease-out`,style:{width:`${Math.max(e.share*100,1)}%`}})})]},e.id))}):(0,q.jsx)(`div`,{className:`flex h-[12rem] items-center justify-center rounded-lg border border-dashed bg-muted/10 px-4 text-sm text-muted-foreground`,children:i(`apiKeys.overview.noUsage`)})]})}function Z({apiKeys:e}){let{t}=v(),n=e.length,r=e.filter(e=>e.isActive&&!J(e)).length,i=e.filter(e=>J(e)).length,a=e.filter(e=>(e.usageSummary?.requestCount??0)>0).length,o=e.reduce((e,t)=>e+(t.usageSummary?.requestCount??0),0),s=e.reduce((e,t)=>e+(t.usageSummary?.totalTokens??0),0),c=e.reduce((e,t)=>e+(t.usageSummary?.totalCostUsd??0),0),l=n-r,u=n-a;return(0,q.jsxs)(`section`,{className:`space-y-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(`h2`,{className:`text-[13px] font-medium uppercase tracking-wider text-muted-foreground`,children:t(`apiKeys.overview.title`)}),(0,q.jsx)(`div`,{className:`h-px flex-1 bg-border`})]}),(0,q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 xl:grid-cols-5`,children:[(0,q.jsx)(Y,{label:t(`apiKeys.overview.apiKeys`),value:k(n),meta:t(`apiKeys.overview.expiredMeta`,{count:k(i)})}),(0,q.jsx)(Y,{label:t(`apiKeys.overview.activeKeys`),value:k(r),meta:t(`apiKeys.overview.inactiveMeta`,{count:k(l)})}),(0,q.jsx)(Y,{label:t(`apiKeys.overview.usedKeys`),value:k(a),meta:t(`apiKeys.overview.idleMeta`,{count:k(u)})}),(0,q.jsx)(Y,{label:t(`apiKeys.overview.lifetimeRequests`),value:k(o),meta:t(`apiKeys.overview.tokensMeta`,{count:k(s)})}),(0,q.jsx)(Y,{label:t(`apiKeys.overview.lifetimeCost`),value:P(c),meta:t(`apiKeys.overview.lifetimeCostMeta`)})]}),(0,q.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,q.jsx)(X,{title:t(`apiKeys.overview.costByKey`),subtitle:t(`apiKeys.overview.costByKeySubtitle`),metric:`cost`,apiKeys:e}),(0,q.jsx)(X,{title:t(`apiKeys.overview.tokensByKey`),subtitle:t(`apiKeys.overview.tokensByKeySubtitle`),metric:`tokens`,apiKeys:e})]})]})}var ve={total_tokens:`Total Tokens`,input_tokens:`Input Tokens`,output_tokens:`Output Tokens`,cost_usd:`Cost (USD)`,credits:`Credits`};function ye(e,t,n){if(!e)return t;let r=re(e,n);return`${r.date} ${r.time}`}function be(e){return e.expiresAt?new Date(e.expiresAt).getTime()<Date.now():!1}function xe({apiKey:e,usageSummary:t,usageMessage:n,allowUsageSummaryFallback:r=!0}){let{t:i}=v(),a=ce(e=>e.dateDisplayFormat),o=be(e),s=e.allowedModels?.join(`, `)||i(`apiKeys.modelSelect.all`),c=e.enforcedModel||null,l=e.enforcedReasoningEffort||null,u=e.allowedReasoningEfforts?.map(e=>i(`common.reasoning.${e}`)).join(`, `)||null,d=e.trafficClass===`opportunistic`?i(`common.traffic.opportunistic`):i(`common.traffic.foreground`),f=r?t??e.usageSummary:t??null,p=f&&f.requestCount>0;return(0,q.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-muted/30 p-4`,"data-testid":`api-key-info`,children:[(0,q.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:i(`apis.keyInfo.title`)}),(0,q.jsxs)(`dl`,{className:`space-y-2 text-xs`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.table.prefix`)}),(0,q.jsx)(`dd`,{className:`font-mono font-medium`,children:e.keyPrefix})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.table.models`)}),(0,q.jsx)(`dd`,{className:`text-right font-medium`,children:s})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.form.trafficClass`)}),(0,q.jsx)(`dd`,{className:`font-medium`,children:d})]}),c?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.form.enforcedModel`)}),(0,q.jsx)(`dd`,{className:`font-mono font-medium`,children:c})]}):null,l?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.form.enforcedReasoning`)}),(0,q.jsx)(`dd`,{className:`font-medium`,children:l})]}):null,u?(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.form.allowedReasoningEfforts`)}),(0,q.jsx)(`dd`,{className:`text-right font-medium`,children:u})]}):null,(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.table.expiry`)}),(0,q.jsx)(`dd`,{className:y(`font-medium`,o?`text-red-600 dark:text-red-400`:``),children:o?i(`common.states.expired`):ye(e.expiresAt,i(`common.time.never`),a)})]}),(0,q.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.table.usage`)}),(0,q.jsx)(`dd`,{className:`text-right tabular-nums`,children:p?(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`span`,{className:`font-medium`,children:i(`common.units.tokensShort`,{count:k(f.totalTokens)})}),(0,q.jsx)(`span`,{className:`mx-1 text-muted-foreground/40`,children:`|`}),(0,q.jsx)(`span`,{className:`font-medium`,children:i(`common.units.cachedShort`,{count:k(f.cachedInputTokens)})}),(0,q.jsx)(`span`,{className:`mx-1 text-muted-foreground/40`,children:`|`}),(0,q.jsx)(`span`,{className:`font-medium`,children:i(`common.units.requestsShort`,{count:k(f.requestCount)})}),(0,q.jsx)(`span`,{className:`mx-1 text-muted-foreground/40`,children:`|`}),(0,q.jsx)(`span`,{className:`font-medium`,children:P(f.totalCostUsd)})]}):(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:n??i(`apis.keyInfo.noUsageRecorded`)})})]}),(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`dt`,{className:`text-muted-foreground`,children:i(`apiKeys.form.limits`)}),(0,q.jsx)(`dd`,{className:`text-right tabular-nums`,children:e.limits.length>0?(0,q.jsx)(`span`,{className:`font-medium`,children:i(`apis.keyInfo.limitsConfigured`,{count:e.limits.length})}):(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:i(`apis.keyInfo.noLimitsConfigured`)})})]}),e.limits.map(e=>{let t=e.limitType===`cost_usd`,n=e.maxValue>0?Math.min(100,e.currentValue/e.maxValue*100):0,r=t?`$${(e.currentValue/1e6).toFixed(2)}`:k(e.currentValue),a=t?`$${(e.maxValue/1e6).toFixed(2)}`:k(e.maxValue),o=e.modelFilter||i(`common.options.allLower`);return(0,q.jsxs)(`div`,{className:`space-y-1 pl-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs tabular-nums`,children:[(0,q.jsxs)(`span`,{className:`text-muted-foreground`,children:[i(`apis.keyInfo.limitTypes.${e.limitType}`,{defaultValue:ve[e.limitType]}),` (`,e.limitWindow,`,`,` `,o,`)`]}),(0,q.jsxs)(`span`,{className:`font-medium`,children:[r,` / `,a]})]}),(0,q.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-muted`,children:(0,q.jsx)(`div`,{className:y(`h-full rounded-full transition-all`,n>=90?`bg-red-500`:n>=70?`bg-orange-500`:`bg-primary`),style:{width:`${n}%`}})})]},e.id)})]})]})]})}var Se=(0,K.lazy)(()=>N(()=>import(`./account-cost-donut-DGhfA4U8.js`).then(e=>({default:t=>(0,q.jsx)(e.AccountCostDonut,{...t})})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),Ce=(0,K.lazy)(()=>N(()=>import(`./api-trend-chart-BchCw7Hj.js`).then(e=>({default:t=>(0,q.jsx)(e.ApiTrendChart,{...t})})),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22])));function Q(e){let t=0;return e.map(e=>(t+=e.v,{t:e.t,v:t}))}function we({apiKey:e,trends:t,usage7Day:n,usage7DayLoading:r=!1,usage7DayError:i=null,busy:a,readOnly:o=!1,onEdit:s,onDelete:c,onRegenerate:l,onToggleActive:u}){let{t:d}=v(),[p,_]=(0,K.useState)(!1),y=(0,K.useMemo)(()=>t?p?{cost:Q(t.cost),tokens:Q(t.tokens)}:t:null,[t,p]),x=(0,K.useMemo)(()=>n?{requestCount:n.totalRequests,totalTokens:n.totalTokens,cachedInputTokens:n.cachedInputTokens,totalCostUsd:n.totalCostUsd}:null,[n]),S=(0,K.useMemo)(()=>n?null:r?d(`apis.detail.loadingUsage`):i?d(`apis.detail.usageUnavailable`):null,[d,n,i,r]),C=n&&n.accountCosts.length>0,w=t&&(t.cost.length>0||t.tokens.length>0);return e?(0,q.jsxs)(`div`,{className:`animate-fade-in-up space-y-4 rounded-xl border bg-card p-5`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,q.jsx)(`h2`,{className:`text-base font-semibold`,children:e.name}),o?null:(0,q.jsxs)(ne,{children:[(0,q.jsx)(A,{asChild:!0,children:(0,q.jsxs)(b,{type:`button`,size:`icon-sm`,variant:`ghost`,disabled:a,children:[(0,q.jsx)(f,{className:`size-4`}),(0,q.jsx)(`span`,{className:`sr-only`,children:d(`apiKeys.table.actions`)})]})}),(0,q.jsxs)(ae,{align:`end`,children:[(0,q.jsxs)(F,{onClick:()=>s(e),children:[(0,q.jsx)(m,{className:`size-4`}),d(`common.actions.edit`)]}),(0,q.jsxs)(F,{onClick:()=>l(e),children:[(0,q.jsx)(oe,{className:`size-4`}),d(`common.actions.regenerate`)]})]})]})]}),C||w?(0,q.jsxs)(`div`,{className:`rounded-xl border bg-card p-4 lg:flex lg:items-start`,"data-testid":`api-usage-panel`,children:[C&&(0,q.jsx)(`div`,{className:w?`lg:w-[25%] lg:shrink-0 lg:pr-4`:`lg:w-full`,children:(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`div`,{className:`h-[240px]`}),children:(0,q.jsx)(Se,{accountCosts:n.accountCosts,totalCostUsd:n.totalCostUsd})})}),w?(0,q.jsxs)(`div`,{className:C?`mt-4 border-t pt-4 lg:mt-0 lg:max-w-[75%] lg:flex-1 lg:border-t-0 lg:border-l lg:pl-4 lg:pt-0`:`lg:w-full`,"data-testid":`api-trend-panel`,children:[(0,q.jsxs)(`div`,{className:`mb-3 flex flex-col gap-3 md:flex-row md:items-start md:justify-between`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h3`,{className:`text-sm font-semibold`,children:d(`apis.detail.usageTrend`)}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d(`apis.detail.usageTrendDescription`)})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-start gap-3 md:justify-end`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground`,"data-testid":`api-trend-legend`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[d(`apiKeys.limitTypes.total_tokens`),(0,q.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-chart-2`})]}),(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[d(`apiKeys.limitTypes.cost_usd`),(0,q.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full bg-chart-1`})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border px-2 py-1`,children:[(0,q.jsx)(`span`,{id:`api-trend-accumulated-label`,className:`text-[10px]`,children:d(`apis.detail.accumulated`)}),(0,q.jsx)(D,{size:`sm`,"aria-labelledby":`api-trend-accumulated-label`,checked:p,onCheckedChange:_})]})]})]}),y?(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(`div`,{className:`h-[260px]`}),children:(0,q.jsx)(Ce,{cost:y.cost,tokens:y.tokens})}):null]}):null]}):null,i?(0,q.jsx)(I,{variant:`error`,children:i}):null,(0,q.jsx)(xe,{apiKey:e,usageSummary:x,usageMessage:S,allowUsageSummaryFallback:!1}),o?null:(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t pt-4`,children:[e.isActive?(0,q.jsxs)(b,{type:`button`,size:`sm`,variant:`outline`,className:`h-8 gap-1.5 text-xs`,onClick:()=>u(e),disabled:a,children:[(0,q.jsx)(f,{className:`h-3.5 w-3.5`}),d(`common.actions.disable`)]}):(0,q.jsxs)(b,{type:`button`,size:`sm`,className:`h-8 gap-1.5 text-xs`,onClick:()=>u(e),disabled:a,children:[(0,q.jsx)(g,{className:`h-3.5 w-3.5`}),d(`common.actions.enable`)]}),(0,q.jsxs)(b,{type:`button`,size:`sm`,variant:`destructive`,className:`h-8 gap-1.5 text-xs`,onClick:()=>c(e),disabled:a,children:[(0,q.jsx)(h,{className:`h-3.5 w-3.5`}),d(`common.actions.delete`)]})]})]},e.id):(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center rounded-xl border border-dashed p-12`,children:[(0,q.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-xl bg-muted`,children:(0,q.jsx)(se,{className:`h-5 w-5 text-muted-foreground`})}),(0,q.jsx)(`p`,{className:`mt-3 text-sm font-medium text-muted-foreground`,children:d(`apis.detail.emptyTitle`)}),(0,q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground/70`,children:d(`apis.detail.emptyDescription`)})]})}function Te(e){return e>=90?`bg-red-500`:e>=70?`bg-orange-500`:e>=40?`bg-amber-500`:`bg-emerald-500`}function Ee({percent:e}){if(e===null)return(0,q.jsx)(`div`,{className:`h-1 flex-1 overflow-hidden rounded-full bg-muted`});let t=Math.max(0,Math.min(100,e));return(0,q.jsx)(`div`,{className:`h-1 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,q.jsx)(`div`,{className:y(`h-full rounded-full`,Te(t)),style:{width:`${t}%`}})})}function De(e){if(e.limits.length===0)return null;let t=0;for(let n of e.limits)if(n.maxValue>0){let e=n.currentValue/n.maxValue*100;e>t&&(t=e)}return t}function Oe(e){return e.expiresAt?new Date(e.expiresAt).getTime()<Date.now():!1}function ke({apiKey:e,selected:t,onSelect:n}){let{t:r}=v(),i=Oe(e),a=e.pooledRemainingPercentPrimary??null,o=e.pooledRemainingPercentSecondary??null,s=e.pooledCapacityCreditsPrimary>0&&a!==null,c=o!==null,l=Number(s)+Number(c),u=De(e);return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:y(`w-full rounded-lg px-3 py-2.5 text-left transition-colors`,t?`bg-primary/8 ring-1 ring-primary/25`:`hover:bg-muted/50`),children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,q.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.name})}),(0,q.jsx)(V,{className:y(!e.isActive||i?`bg-zinc-500 text-white`:`bg-emerald-500 text-white`),children:e.isActive?r(i?`common.states.expired`:`common.states.active`):r(`common.states.disabled`)})]}),l>0?(0,q.jsxs)(`div`,{className:y(`mt-2 grid gap-2`,l>1?`grid-cols-2`:`grid-cols-1`),children:[s?(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:r(`apis.listItem.pooled5h`)}),(0,q.jsx)(`span`,{className:`tabular-nums font-medium`,children:L(a)})]}),(0,q.jsx)(H,{"aria-label":r(`apis.listItem.pooled5hAria`),percent:a,testId:`pooled-quota-track-5h`})]}):null,c?(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:r(`apis.listItem.pooledWeekly`)}),(0,q.jsx)(`span`,{className:`tabular-nums font-medium`,children:L(o)})]}),(0,q.jsx)(H,{"aria-label":r(`apis.listItem.pooledWeeklyAria`),percent:o,testId:`pooled-quota-track-weekly`})]}):null]}):null,u===null?null:(0,q.jsxs)(`div`,{className:`mt-1.5 space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:r(`apis.listItem.apiLimit`)}),(0,q.jsx)(`span`,{className:`tabular-nums font-medium`,children:L(u)})]}),(0,q.jsx)(Ee,{percent:u})]})]})}var Ae=[`all`,`active`,`disabled`,`expired`],je={active:`common.states.active`,disabled:`common.states.disabled`,expired:`common.states.expired`};function Me(e){return e.expiresAt?new Date(e.expiresAt).getTime()<Date.now():!1}function Ne(e,t){if(t===`all`)return!0;let n=Me(e);return t===`active`?e.isActive&&!n:t===`disabled`?!e.isActive:t!==`expired`||n}function Pe({apiKeys:e,selectedKeyId:t,onSelect:n,onOpenCreate:r,readOnly:i=!1}){let{t:a}=v(),[o,f]=(0,K.useState)(``),[m,h]=(0,K.useState)(`all`),g=(0,K.useMemo)(()=>{let t=o.trim().toLowerCase();return e.filter(e=>Ne(e,m)?!t||e.name.toLowerCase().includes(t)||e.keyPrefix.toLowerCase().includes(t):!1)},[e,o,m]);return(0,q.jsxs)(`div`,{className:`space-y-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,q.jsx)(_,{className:`pointer-events-none absolute top-1/2 left-2.5 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60`,"aria-hidden":!0}),(0,q.jsx)(ie,{placeholder:a(`apis.list.searchPlaceholder`),value:o,onChange:e=>f(e.target.value),className:`h-8 pl-8`})]}),(0,q.jsxs)(d,{value:m,onValueChange:h,children:[(0,q.jsx)(l,{size:`sm`,className:`w-32 shrink-0`,children:(0,q.jsx)(u,{placeholder:a(`accounts.list.statusPlaceholder`)})}),(0,q.jsx)(c,{children:Ae.map(e=>(0,q.jsx)(s,{value:e,children:a(e===`all`?`accounts.list.allStatuses`:je[e])},e))})]})]}),i?null:(0,q.jsxs)(b,{type:`button`,size:`sm`,onClick:r,className:`h-8 w-full gap-1.5 text-xs`,children:[(0,q.jsx)(p,{className:`h-3.5 w-3.5`}),a(`apis.list.createKey`)]}),(0,q.jsx)(`div`,{className:`max-h-[calc(100vh-16rem)] space-y-1 overflow-y-auto p-1`,children:g.length===0?(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-lg border border-dashed p-6 text-center`,children:[(0,q.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:e.length===0?a(`apis.list.emptyTitle`):a(`apis.list.noMatches`)}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:e.length===0?a(`apis.list.emptyDescription`):a(`accounts.list.adjustFilters`)})]}):g.map(e=>(0,q.jsx)(ke,{apiKey:e,selected:e.id===t,onSelect:n},e.id))})]})}function Fe(){return(0,q.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,q.jsxs)(`div`,{className:`rounded-xl border bg-card p-4 space-y-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(U,{className:`h-8 flex-1 rounded-md`}),(0,q.jsx)(U,{className:`h-8 w-32 rounded-md`})]}),(0,q.jsx)(U,{className:`h-8 w-full rounded-md`}),Array.from({length:4}).map((e,t)=>(0,q.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,q.jsx)(U,{className:`h-4 w-32`}),(0,q.jsx)(U,{className:`h-3 w-20`})]}),(0,q.jsx)(U,{className:`h-5 w-14 rounded-full`})]},`list-${t}`))]}),(0,q.jsxs)(`div`,{className:`rounded-xl border bg-card p-5 space-y-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsx)(U,{className:`h-5 w-40`}),(0,q.jsx)(U,{className:`h-3 w-32`})]}),(0,q.jsx)(U,{className:`h-8 w-8 rounded-md`})]}),(0,q.jsxs)(`div`,{className:`space-y-3 rounded-lg border bg-muted/30 p-4`,children:[(0,q.jsx)(U,{className:`h-3 w-20`}),Array.from({length:5}).map((e,t)=>(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsx)(U,{className:`h-3 w-16`}),(0,q.jsx)(U,{className:`h-3 w-24`})]},`info-${t}`))]}),(0,q.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-muted/30 p-4`,children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,q.jsx)(U,{className:`h-3 w-20`}),(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(U,{className:`h-2 w-2 rounded-full`}),(0,q.jsx)(U,{className:`h-2.5 w-12`})]}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(U,{className:`h-2 w-2 rounded-full`}),(0,q.jsx)(U,{className:`h-2.5 w-12`})]})]})]}),(0,q.jsx)(U,{className:`h-48 w-full rounded-md`})]})]})]})}var $=C({t:o({offset:!0}),v:w()}),Ie=C({keyId:E(),cost:x($),tokens:x($)}),Le=C({accountId:E().nullable().default(null),email:E().nullable().default(null),costUsd:w().default(0),isDeleted:S().default(!1)}),Re=C({keyId:E(),totalTokens:w().int(),totalCostUsd:w(),totalRequests:w().int(),cachedInputTokens:w().int(),accountCosts:x(Le).default([])});function ze(e){return T(`${G}/${encodeURIComponent(e)}/trends`,Ie)}function Be(e){return T(`${G}/${encodeURIComponent(e)}/usage-7d`,Re)}function Ve({enabled:e=!0}={}){let{t}=v(),n=a(),{data:o,error:s,isFetching:c,isLoading:l,isPending:u,isSuccess:d,refetch:f}=r({queryKey:[`api-keys`,`list`],queryFn:W,select:e=>e,enabled:e,refetchInterval:3e4,refetchIntervalInBackground:!1});return{apiKeysQuery:{data:o,error:s,isFetching:c,isLoading:l,isPending:u,isSuccess:d,refetch:f},createMutation:i({mutationFn:e=>ue(e),onSuccess:()=>{M.success(t(`apiKeys.toasts.created`)),n.invalidateQueries({queryKey:[`api-keys`,`list`]}),n.invalidateQueries({queryKey:[`api-keys`,`trends`]})},onError:e=>{M.error(e.message||t(`apiKeys.toasts.createFailed`))}}),updateMutation:i({mutationFn:({keyId:e,payload:t})=>pe(e,t),onSuccess:()=>{M.success(t(`apiKeys.toasts.updated`)),n.invalidateQueries({queryKey:[`api-keys`,`list`]}),n.invalidateQueries({queryKey:[`api-keys`,`trends`]})},onError:e=>{M.error(e.message||t(`apiKeys.toasts.updateFailed`))}}),deleteMutation:i({mutationFn:e=>fe(e),onSuccess:()=>{M.success(t(`apiKeys.toasts.deleted`)),n.invalidateQueries({queryKey:[`api-keys`,`list`]}),n.invalidateQueries({queryKey:[`api-keys`,`trends`]})},onError:e=>{M.error(e.message||t(`apiKeys.toasts.deleteFailed`))}}),regenerateMutation:i({mutationFn:e=>de(e),onSuccess:()=>{M.success(t(`apiKeys.toasts.regenerated`)),n.invalidateQueries({queryKey:[`api-keys`,`list`]}),n.invalidateQueries({queryKey:[`api-keys`,`trends`]})},onError:e=>{M.error(e.message||t(`apiKeys.toasts.regenerateFailed`))}})}}function He(e,{enabled:t=!0}={}){return r({queryKey:[`api-keys`,`trends`,e],queryFn:()=>ze(e),enabled:t&&!!e,staleTime:3e5,refetchInterval:3e5,refetchIntervalInBackground:!1})}function Ue(e,{enabled:t=!0}={}){return r({queryKey:[`api-keys`,`usage-7d`,e],queryFn:()=>Be(e),enabled:t&&!!e,staleTime:12e4,refetchInterval:12e4,refetchIntervalInBackground:!1})}var We=(0,K.lazy)(()=>N(()=>import(`./api-key-create-dialog-DnRm0oYN.js`).then(e=>({default:e.ApiKeyCreateDialog})),__vite__mapDeps([23,1,2,24,7,8,6,9,10,11,12,25,26,5,13,14,3,4,15,16,17,27,28,29,30,31,32,33,34,35,36]))),Ge=(0,K.lazy)(()=>N(()=>import(`./api-key-edit-dialog-Ck3Bnc3V.js`).then(e=>({default:e.ApiKeyEditDialog})),__vite__mapDeps([37,1,2,24,7,8,6,9,10,11,12,25,26,5,13,14,3,4,15,16,17,27,28,29,30,31,32,33,34,35,36])));function Ke(){let{t:e}=v(),[t,n]=le(),r=te(`api_keys:read`),i=ee(e=>e.canWrite),{apiKeysQuery:a,createMutation:o,updateMutation:s,deleteMutation:c,regenerateMutation:l}=Ve({enabled:r}),u=R(),d=R(),f=R(),p=R(),m=(0,K.useMemo)(()=>a.data??[],[a.data]),h=t.get(`selected`),g=(0,K.useCallback)(e=>{let r=new URLSearchParams(t);r.set(`selected`,e),n(r)},[t,n]),_=(0,K.useMemo)(()=>m.length===0?null:h&&m.some(e=>e.id===h)?h:m[0].id,[m,h]),y=(0,K.useMemo)(()=>_?m.find(e=>e.id===_)??null:null,[m,_]),x=He(y?.id??null,{enabled:r}),S=Ue(y?.id??null,{enabled:r}),C=o.isPending||s.isPending||c.isPending||l.isPending,w=O(o.error)||O(s.error)||O(c.error)||O(l.error),T=O(a.error),E=O(S.error),D=w||(a.data?T:null);return r?(0,q.jsxs)(`div`,{className:`animate-fade-in-up space-y-6`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e(`apis.page.title`)}),(0,q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`apis.page.subtitle`)})]}),D?(0,q.jsx)(I,{variant:`error`,children:D}):null,a.isPending&&!a.data?(0,q.jsx)(Fe,{}):a.data?(0,q.jsxs)(`div`,{className:`space-y-6`,children:[(0,q.jsx)(Z,{apiKeys:m}),(0,q.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,q.jsx)(`div`,{className:`rounded-xl border bg-card p-4`,children:(0,q.jsx)(Pe,{apiKeys:m,selectedKeyId:_,onSelect:g,onOpenCreate:()=>u.show(),readOnly:!i})}),(0,q.jsx)(we,{apiKey:y,trends:x.data,usage7Day:S.data,usage7DayLoading:S.isPending,usage7DayError:E,busy:C,readOnly:!i,onEdit:e=>d.show(e),onToggleActive:e=>{s.mutateAsync({keyId:e.id,payload:{isActive:!e.isActive}}).catch(()=>null)},onDelete:e=>f.show(e),onRegenerate:e=>{l.mutateAsync(e.id).then(e=>{p.show(e.key)}).catch(()=>null)}})]})]}):(0,q.jsxs)(`div`,{className:`space-y-3 rounded-xl border bg-card p-4`,children:[(0,q.jsx)(I,{variant:`error`,children:T??e(`apiKeys.toasts.loadFailed`)}),(0,q.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{a.refetch()},disabled:a.isFetching,children:e(`common.actions.retry`)})]}),(0,q.jsxs)(K.Suspense,{fallback:null,children:[(0,q.jsx)(We,{open:u.open,busy:o.isPending,onOpenChange:u.onOpenChange,onSubmit:async e=>{let t=await o.mutateAsync(e);p.show(t.key)}}),(0,q.jsx)(Ge,{open:d.open,busy:s.isPending,apiKey:d.data,onOpenChange:d.onOpenChange,onSubmit:async e=>{d.data&&await s.mutateAsync({keyId:d.data.id,payload:e})}})]}),(0,q.jsx)(me,{open:p.open,apiKey:p.data,onOpenChange:p.onOpenChange}),(0,q.jsx)(z,{open:f.open,title:e(`apiKeys.deleteDialog.title`),description:e(`apiKeys.deleteDialog.description`),confirmLabel:e(`common.actions.delete`),onOpenChange:f.onOpenChange,onConfirm:()=>{f.data&&c.mutateAsync(f.data.id).catch(()=>null).finally(()=>{f.hide()})}}),(0,q.jsx)(B,{visible:!!a.data&&C,label:e(`apiKeys.page.updating`)})]}):(0,q.jsxs)(`div`,{className:`animate-fade-in-up space-y-6`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e(`apis.page.title`)}),(0,q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`apis.page.subtitle`)})]}),(0,q.jsxs)(`div`,{role:`status`,className:`flex flex-col items-center gap-2 rounded-xl border border-dashed bg-card p-8 text-center`,children:[(0,q.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10`,children:(0,q.jsx)(j,{className:`h-5 w-5 text-primary`,"aria-hidden":`true`})}),(0,q.jsx)(`p`,{className:`text-sm font-medium`,children:e(`apis.page.adminOnlyTitle`)}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`apis.page.adminOnlyDescription`)})]})]})}export{Ke as ApisPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DBLzLNh2.js";var t={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};t.node;var n=e(t),r={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};r.node;var i=e(r);export{n,i as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DBLzLNh2.js";var t={name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,S as n,p as r,r as i,t as a,x as o}from"./vendor-query-_bHZuxEx.js";import{t as s}from"./createLucideIcon-DBLzLNh2.js";import{i as c,n as l,o as u,s as d,t as f}from"./select-Cl33bz-g.js";import{t as p}from"./pagination-controls-D1Ypd0RU.js";import{n as m,t as h}from"./use-models-DUCPUuZg.js";import{t as ee}from"./inbox-B_RM2s1J.js";import{n as te,r as ne,t as re}from"./trash-D3KyWr1h.js";import{n as ie,t as g}from"./search-HfhqwERt.js";import{n as _,t as v}from"./account-identifiers-CxbdLshZ.js";import{t as y}from"./useTranslation--56nHhlH.js";import{c as b,t as x}from"./button-BjVmmiGW.js";import{a as S,d as C,f as w,h as T,i as E,m as D,n as ae,p as oe,r as O,t as k,u as A,v as j}from"./api-client-dugX1Pti.js";import{t as se}from"./label-CGaLmLNf.js";import{t as ce}from"./switch-CzxgokcM.js";import{n as M}from"./use-auth-CuDlW3iC.js";import{G as le,Gt as N,Kt as P,L as ue,N as F,X as de,an as I,cn as L,en as R,et as fe,in as pe,mt as me,nn as he,pt as ge,r as _e,rn as ve,sn as z,tn as ye,tr as B,ur as be}from"./index-DIpd264Z.js";import{o as xe,s as V}from"./account-status-DIsU5sUS.js";import{t as Se}from"./blur-email-HEvKagG2.js";import{i as Ce}from"./use-accounts-PWlVGw3z.js";import{t as we}from"./badge-DqMb9es0.js";import{t as Te}from"./empty-state-JcA7tc8m.js";import{a as H,i as U,n as W,o as G,r as K,t as Ee}from"./table-DXaNSQ0G.js";import{t as De}from"./payload-CIYnGZz9.js";import{t as Oe}from"./inherit-badge-QhTYVaU6.js";import{t as q}from"./multi-select-filter-KIA5qU6Z.js";var ke={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};ke.node;var Ae=s(ke),J=e(t(),1),je=3;function Y(e){return(e??``).trim()}function Me(e,t){return t?`${e}\n${t}`:e}function Ne(e){return{primary:`Unknown account`,secondary:`ID ${v(e,7,5)}`,title:`Unknown account\n${e}`}}function Pe(e){let t=new Map;for(let n of e){let e=Y(n.displayName),r=Y(n.email),i=e||r||`Unnamed account`,a=e.length>0&&r.length>0&&e.toLowerCase()!==r.toLowerCase()?r:n.isEmailDuplicate===!0?`ID ${v(n.accountId,6,4)}`:null;t.set(n.accountId,{accountId:n.accountId,primary:i,secondary:a,title:Me(i,a)})}return t}function Fe(e,t){if(!e)return{primary:`No account`,secondary:null,title:`No account`};let n=t.get(e);return n?{primary:n.primary,secondary:n.secondary,title:n.title}:Ne(e)}function Ie(e,t,n=!0){if(e.length===0)return n?{primary:`All accounts`,secondary:`Uses every available account`,title:`All accounts`}:{primary:`No selected accounts`,secondary:`Selected accounts are unavailable`,title:`No selected accounts`};if(e.length===1)return Fe(e[0]??null,t);let r=e.map(e=>Fe(e,t)),i=r.map(e=>e.primary);if(e.length<=je)return{primary:i.join(`, `),secondary:`${e.length} selected`,title:r.map(e=>e.title).join(`
2
+ `)};let a=i.slice(0,2).join(`, `),o=e.length-2;return{primary:`${e.length} accounts`,secondary:`${a} +${o} more`,title:r.map(e=>e.title).join(`
3
+ `)}}var Le=/^(\d{1,2}):([0-5]\d)\s*([ap]m)$/i,Re=/^([01]?\d|2[0-3]):([0-5]\d)$/;function ze(e,t){let n=e.trim();if(!n)return{ok:!1,reason:`empty`};if(t===`24h`){let e=Re.exec(n);if(!e)return{ok:!1,reason:`invalid`};let t=Number(e[1]),r=Number(e[2]);return{ok:!0,value:`${t.toString().padStart(2,`0`)}:${r.toString().padStart(2,`0`)}`}}let r=Le.exec(n);if(!r)return{ok:!1,reason:`invalid`};let i=Number(r[1]),a=Number(r[2]),o=r[3].toUpperCase();return i<1||i>12?{ok:!1,reason:`invalid`}:{ok:!0,value:`${(i%12+(o===`PM`?12:0)).toString().padStart(2,`0`)}:${a.toString().padStart(2,`0`)}`}}function Be(e,t){let n=/^(\d{2}):(\d{2})$/.exec(e.trim());if(!n)return e.trim();let r=Number(n[1]),i=Number(n[2]);if(r<0||r>23||i<0||i>59)return e.trim();if(t===`24h`)return`${n[1]}:${n[2]}`;let a=(r+11)%12+1,o=r>=12?`PM`:`AM`;return`${a.toString().padStart(2,`0`)}:${n[2]} ${o}`}function Ve(e){return e===`24h`?`HH:MM`:`HH:MM AM`}var X=n(),He=[{value:`daily`,labelKey:`automations.types.daily`}],Ue=[{value:`mon`,shortLabel:`Mon`},{value:`tue`,shortLabel:`Tue`},{value:`wed`,shortLabel:`Wed`},{value:`thu`,shortLabel:`Thu`},{value:`fri`,shortLabel:`Fri`},{value:`sat`,shortLabel:`Sat`},{value:`sun`,shortLabel:`Sun`}],We=Ue.map(e=>e.value),Ge=`server_default`,Ke=`05:00`,qe=0,Je=240,Ye=`__default__`,Xe=[`low`,`medium`,`high`,`xhigh`,`max`,`ultra`],Ze={minimal:`Minimal`,low:`Low`,medium:`Medium`,high:`High`,xhigh:`XHigh`,max:`Max`,ultra:`Ultra`},Z={name:`automation-name`,model:`automation-model`,reasoning:`automation-reasoning`,includePaused:`automation-include-paused`,time:`automation-time`,threshold:`automation-threshold`,accounts:`automation-accounts`,type:`automation-type`,timezone:`automation-timezone`,days:`automation-days`,prompt:`automation-prompt`};function Qe(){return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}function $e(e){let t=[Ge,Qe(),`UTC`,`Europe/Warsaw`,`America/New_York`,`America/Los_Angeles`,`Asia/Tokyo`];return Array.from(new Set([Ge,e,...t].filter(e=>e.trim().length>0)))}function et(e,t){if(e.length!==t.length)return!0;let n=new Set(e);return t.some(e=>!n.has(e))}function tt(e,t){return e===Ge?t(`automations.schedule.serverDefault`):e}function nt(e){let t={};return e.name.trim().length===0&&(t.name=e.t(`automations.dialog.validation.nameRequired`)),e.model.trim().length===0&&(t.model=e.t(`automations.dialog.validation.modelRequired`)),e.scheduleTimeValid||(t.time=e.t(`automations.dialog.validation.timeInvalid`)),e.scheduleThresholdValid||(t.threshold=e.t(`automations.dialog.validation.thresholdInvalid`,{max:Je})),e.availableAccountCount<=0&&(t.accounts=e.t(`automations.dialog.validation.noAccounts`)),t}function rt(e){let t=e.trim();if(t.length===0)return{ok:!1};let n=Number(t);return!Number.isFinite(n)||!Number.isInteger(n)||n<0||n>Je?{ok:!1}:{ok:!0,value:n}}function it(e,t){return JSON.stringify(e===null?[`create`,t]:[`edit`,t,e.id,e.name,e.enabled,e.includePausedAccounts,e.schedule.type,e.schedule.time,e.schedule.timezone,e.schedule.thresholdMinutes,e.schedule.days,e.model,e.reasoningEffort??null,e.prompt,e.accountScopeAll,e.accountIds])}function at({open:e,onOpenChange:t,...n}){let r=de(e=>e.timeFormat),i=it(n.editingJob,r);return(0,X.jsx)(R,{open:e,onOpenChange:t,children:e?(0,X.jsx)(ot,{...n,onOpenChange:t,timeFormat:r},i):null})}function ot({busy:e,editingJob:t,models:n,modelsLoading:r,onOpenChange:i,onCreate:a,onUpdate:o,timeFormat:s}){let{t:p}=y(),h=t!==null,{accountsQuery:ee}=Ce(),te=t?.name??``,ne=t?.schedule.time??Ke,re=t?.schedule.thresholdMinutes??qe,[ie]=(0,J.useState)(te),[g,_]=(0,J.useState)(te),[v,S]=(0,J.useState)(te.trim().length>0),[C,w]=(0,J.useState)(t?.schedule.type??`daily`),[T]=(0,J.useState)(Be(ne,s)),[E,D]=(0,J.useState)(!0),[ae]=(0,J.useState)(String(re)),[oe,O]=(0,J.useState)(!0),[k,A]=(0,J.useState)(t?.includePausedAccounts??!1),[j,se]=(0,J.useState)(t?.schedule.timezone??Ge),[M,le]=(0,J.useState)(()=>[...t?.schedule.days??We]),[N,ue]=(0,J.useState)(t?.model??``),[F,de]=(0,J.useState)(t?.reasoningEffort??Ye),[L,R]=(0,J.useState)(!1),[fe]=(0,J.useState)(t?.prompt??`ping`),[me,ge]=(0,J.useState)(()=>[...t?.accountIds??[]]),_e=(0,J.useRef)(null),z=(0,J.useRef)(null),B=(0,J.useRef)(null),be=(0,J.useRef)(null),[xe,V]=(0,J.useState)({name:!1,model:!1,time:!1,threshold:!1,accounts:!1}),[Se,we]=(0,J.useState)(!1),Te=ee.data?.length??0,H=N||n[0]?.id||``,U=(0,J.useMemo)(()=>n.find(e=>e.id===H)??null,[n,H]),W=(0,J.useMemo)(()=>U?.supportedReasoningEfforts??Xe,[U]),G=F===Ye||W.includes(F)?F:Ye,K=G===Ye?null:G,Ee=t!==null&&H!==t.model&&K!==(t.reasoningEffort??null),De=t!==null&&U!==null&&H===t.model&&K===null&&t.reasoningEffort!=null&&!W.includes(t.reasoningEffort),Oe=(0,J.useMemo)(()=>$e(j),[j]),q=(0,J.useMemo)(()=>n.map(e=>(0,X.jsx)(c,{value:e.id,children:e.id},e.id)),[n]),ke=(0,J.useMemo)(()=>W.map(e=>(0,X.jsx)(c,{value:e,children:p(`common.reasoning.${e}`,{defaultValue:Ze[e]??e})},e)),[W,p]),Ae=(0,J.useMemo)(()=>nt({name:g,model:H,scheduleTimeValid:E,scheduleThresholdValid:oe,availableAccountCount:Te,t:p}),[Te,g,oe,E,H,p]),je=v&&Object.entries(Ae).filter(([e])=>e!==`name`).length===0&&M.length>0,Y=e=>Se||xe[e]?Ae[e]??null:null,Me=async()=>{we(!0);let e=(_e.current?.value??ie).trim();_(e),S(e.length>0),V(e=>({...e,name:!0,time:!0,threshold:!0}));let n=ze(z.current?.value??T,s);if(n.ok){let e=Be(n.value,s);z.current&&(z.current.value=e),D(!0)}else D(!1);let r=rt(B.current?.value??ae);r.ok?(B.current&&(B.current.value=String(r.value)),O(!0)):O(!1);let c=nt({name:e,model:H,scheduleTimeValid:n.ok,scheduleThresholdValid:r.ok,availableAccountCount:Te,t:p});if(Object.keys(c).length>0||M.length===0||!n.ok||!r.ok)return;let l=(be.current?.value??fe).trim()||`ping`,u={name:e,includePausedAccounts:k,schedule:{type:C,time:n.value,timezone:j.trim(),thresholdMinutes:r.value,days:M},model:H.trim(),prompt:l};try{if(t){let e=me.length===0,n=t.accountScopeAll??t.accountIds.length===0,r=et(t.accountIds,me)||n!==e?{accountIds:me}:{},i=L||Ee||De?{...u,...r,reasoningEffort:K}:{...u,...r};await o(t.id,i)}else await a({...u,accountIds:me,reasoningEffort:K,enabled:!0});i(!1)}catch{return}};return(0,X.jsxs)(ye,{className:`flex max-h-[calc(100vh-2rem)] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl`,children:[(0,X.jsxs)(pe,{className:`px-6 pt-6 pb-2 pr-12`,children:[(0,X.jsx)(I,{children:p(h?`automations.dialog.editTitle`:`automations.dialog.createTitle`)}),(0,X.jsx)(he,{children:p(h?`automations.dialog.editDescription`:`automations.dialog.createDescription`)})]}),(0,X.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),Me()},children:[(0,X.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-6 overflow-y-auto px-6 pb-4`,children:[(0,X.jsxs)(`section`,{className:`space-y-3`,children:[(0,X.jsx)(`div`,{className:`space-y-0.5`,children:(0,X.jsx)(`h4`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:p(`automations.dialog.sections.basics`)})}),(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-1.5 sm:col-span-2`,children:[(0,X.jsx)(`label`,{htmlFor:Z.name,className:`text-sm font-medium`,children:p(`apiKeys.table.name`)}),(0,X.jsx)(P,{ref:_e,id:Z.name,placeholder:p(`automations.dialog.placeholders.name`),defaultValue:ie,"aria-invalid":Y(`name`)?!0:void 0,"aria-describedby":Y(`name`)?`${Z.name}-error`:void 0,onBlur:()=>{V(e=>({...e,name:!0}));let e=(_e.current?.value??``).trim();_(e),S(e.length>0)},onInput:e=>{let t=e.currentTarget.value.trim();S(t.length>0)}},`name-0`),Y(`name`)?(0,X.jsx)(`p`,{id:`${Z.name}-error`,className:`text-xs text-destructive`,children:Y(`name`)}):null]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:Z.type,className:`text-sm font-medium`,children:p(`automations.jobs.columns.type`)}),(0,X.jsxs)(f,{value:C,onValueChange:e=>w(e),children:[(0,X.jsx)(u,{id:Z.type,children:(0,X.jsx)(d,{placeholder:p(`automations.dialog.placeholders.type`)})}),(0,X.jsx)(l,{children:He.map(e=>(0,X.jsx)(c,{value:e.value,children:p(e.labelKey)},e.value))})]})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:Z.model,className:`text-sm font-medium`,children:p(`dashboard.requests.columns.model`)}),(0,X.jsxs)(f,{value:H,onValueChange:e=>{ue(e),V(e=>({...e,model:!0}))},children:[(0,X.jsx)(u,{id:Z.model,"aria-invalid":Y(`model`)?!0:void 0,"aria-describedby":Y(`model`)?`${Z.model}-error`:void 0,children:(0,X.jsx)(d,{placeholder:p(`automations.dialog.placeholders.model`)})}),(0,X.jsx)(l,{align:`start`,children:q})]}),!r&&n.length===0?(0,X.jsx)(`p`,{className:`text-xs text-destructive`,children:p(`automations.dialog.noModels`)}):null,Y(`model`)?(0,X.jsx)(`p`,{id:`${Z.model}-error`,className:`text-xs text-destructive`,children:Y(`model`)}):null]}),(0,X.jsxs)(`div`,{className:`space-y-1.5 sm:col-span-2`,children:[(0,X.jsx)(`label`,{htmlFor:Z.reasoning,className:`text-sm font-medium`,children:p(`automations.dialog.reasoningEffort`)}),(0,X.jsxs)(f,{value:G,onValueChange:e=>{de(e),R(!0)},children:[(0,X.jsx)(u,{id:Z.reasoning,children:(0,X.jsx)(d,{placeholder:p(`automations.dialog.modelDefault`)})}),(0,X.jsxs)(l,{align:`start`,children:[(0,X.jsxs)(c,{value:Ye,children:[p(`automations.dialog.modelDefault`),U?.defaultReasoningEffort?` (${p(`common.reasoning.${U.defaultReasoningEffort}`,{defaultValue:Ze[U.defaultReasoningEffort]??U.defaultReasoningEffort})})`:``]}),ke]})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`automations.dialog.reasoningHint`)})]})]})]}),(0,X.jsxs)(`section`,{className:`space-y-3`,children:[(0,X.jsx)(`div`,{className:`space-y-0.5`,children:(0,X.jsx)(`h4`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:p(`automations.dialog.sections.schedule`)})}),(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:Z.time,className:`text-sm font-medium`,children:p(`dashboard.requests.columns.time`)}),(0,X.jsx)(P,{ref:z,id:Z.time,type:`text`,inputMode:`text`,autoComplete:`off`,defaultValue:T,placeholder:Ve(s),"aria-invalid":Y(`time`)?!0:void 0,"aria-describedby":Y(`time`)?`${Z.time}-error`:`${Z.time}-hint`,onBlur:()=>{V(e=>({...e,time:!0}));let e=ze(z.current?.value??T,s);if(!e.ok){D(!1);return}let t=Be(e.value,s);z.current&&(z.current.value=t),D(!0)}},`time-0`),(0,X.jsx)(`p`,{id:`${Z.time}-hint`,className:`text-xs text-muted-foreground`,children:p(s===`24h`?`automations.dialog.timeHint24h`:`automations.dialog.timeHint12h`)}),Y(`time`)?(0,X.jsx)(`p`,{id:`${Z.time}-error`,className:`text-xs text-destructive`,children:Y(`time`)}):null]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsx)(`label`,{htmlFor:Z.timezone,className:`text-sm font-medium`,children:p(`quotaPlanner.fields.timezone`)}),(0,X.jsxs)(f,{value:j,onValueChange:se,children:[(0,X.jsx)(u,{id:Z.timezone,children:(0,X.jsx)(d,{placeholder:p(`automations.dialog.placeholders.timezone`),children:tt(j,p)})}),(0,X.jsx)(l,{children:Oe.map(e=>(0,X.jsx)(c,{value:e,children:tt(e,p)},e))})]})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5 sm:col-span-2`,children:[(0,X.jsx)(`label`,{htmlFor:Z.threshold,className:`text-sm font-medium`,children:p(`automations.dialog.thresholdMinutes`)}),(0,X.jsx)(P,{ref:B,id:Z.threshold,type:`number`,min:0,max:Je,step:1,defaultValue:ae,"aria-invalid":Y(`threshold`)?!0:void 0,"aria-describedby":Y(`threshold`)?`${Z.threshold}-error`:`${Z.threshold}-hint`,onBlur:()=>{V(e=>({...e,threshold:!0}));let e=rt(B.current?.value??ae);e.ok?(B.current&&(B.current.value=String(e.value)),O(!0)):O(!1)}},`threshold-0`),(0,X.jsx)(`p`,{id:`${Z.threshold}-hint`,className:`text-xs text-muted-foreground`,children:p(`automations.dialog.thresholdHint`)}),Y(`threshold`)?(0,X.jsx)(`p`,{id:`${Z.threshold}-error`,className:`text-xs text-destructive`,children:Y(`threshold`)}):null]}),(0,X.jsx)(`div`,{className:`space-y-1.5 sm:col-span-2`,children:(0,X.jsxs)(`div`,{className:`border-border/70 bg-muted/10 flex items-center justify-between rounded-md border px-3 py-2.5`,children:[(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,X.jsx)(`label`,{htmlFor:Z.includePaused,className:`text-sm font-medium`,children:p(`automations.dialog.includePaused`)}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`automations.dialog.includePausedDescription`)})]}),(0,X.jsx)(ce,{id:Z.includePaused,checked:k,onCheckedChange:A,"aria-label":p(`automations.dialog.includePaused`)})]})}),(0,X.jsxs)(`div`,{className:`space-y-1.5 sm:col-span-2`,children:[(0,X.jsx)(`label`,{htmlFor:Z.days,className:`text-sm font-medium`,children:p(`automations.dialog.daysOfWeek`)}),(0,X.jsx)(`div`,{id:Z.days,role:`group`,"aria-label":p(`automations.dialog.daysOfWeek`),className:`grid grid-cols-4 gap-1.5 sm:grid-cols-7`,children:Ue.map(e=>{let t=M.includes(e.value);return(0,X.jsx)(x,{type:`button`,size:`sm`,variant:`outline`,"aria-pressed":t,className:b(`font-medium`,t?`border-primary/35 bg-primary/15 text-primary hover:bg-primary/20 hover:text-primary`:`border-border/70 bg-background text-muted-foreground hover:bg-accent/50 hover:text-foreground`),onClick:()=>Ne(e.value),children:p(`settings.routing.workingDays.days.${e.value}`,{defaultValue:e.shortLabel})},e.value)})}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(`automations.dialog.daysHint`)})]})]})]}),(0,X.jsxs)(`section`,{className:`space-y-3`,children:[(0,X.jsx)(`div`,{className:`space-y-0.5`,children:(0,X.jsx)(`h4`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:p(`automations.dialog.sections.execution`)})}),(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-1.5 sm:col-span-2`,children:[(0,X.jsx)(`label`,{htmlFor:Z.prompt,className:`text-sm font-medium`,children:p(`automations.dialog.prompt`)}),(0,X.jsx)(`textarea`,{ref:be,id:Z.prompt,className:`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive min-h-24 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px]`,placeholder:p(`automations.dialog.placeholders.prompt`),defaultValue:fe},`prompt-0`)]}),(0,X.jsxs)(`div`,{className:`space-y-1.5 sm:col-span-2`,children:[(0,X.jsx)(`label`,{htmlFor:Z.accounts,className:`text-sm font-medium`,children:p(`automations.jobs.columns.accounts`)}),(0,X.jsx)(m,{value:me,onChange:e=>{ge(e),V(e=>({...e,accounts:!0}))},placeholder:p(`apiKeys.accountSelect.all`),triggerId:Z.accounts,ariaInvalid:Y(`accounts`)?!0:void 0,ariaDescribedBy:Y(`accounts`)?`${Z.accounts}-error`:void 0,allowPausedAccounts:k}),Y(`accounts`)?(0,X.jsx)(`p`,{id:`${Z.accounts}-error`,className:`text-xs text-destructive`,children:Y(`accounts`)}):null]})]})]}),Se&&!je?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p(h?`automations.dialog.resolveToSave`:`automations.dialog.resolveToCreate`)}):null]}),(0,X.jsxs)(ve,{className:`border-t px-6 py-4`,children:[(0,X.jsx)(x,{type:`button`,variant:`outline`,onClick:()=>i(!1),children:p(`common.cancel`)}),(0,X.jsx)(x,{type:`submit`,disabled:e||r||!je,children:p(h?`automations.dialog.saveChanges`:`automations.dialog.createAction`)})]})]})]});function Ne(e){le(t=>t.includes(e)?t.length===1?t:t.filter(t=>t!==e):Ue.map(e=>e.value).filter(n=>n===e||t.includes(n)))}}var st=`automations-pause-all`;function ct(){let{t:e}=y(),t=M(e=>e.canWrite),{settingsQuery:n,updateSettingsMutation:r}=_e(),i=n.data;if(!i)return null;let a=!i.automationsSchedulerEnabled,o=r.isPending||!t,s=e=>r.mutateAsync(e).then(()=>void 0);return(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border bg-card px-3 py-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(se,{htmlFor:st,className:`text-sm font-medium`,children:e(`automations.pause.label`)}),a?(0,X.jsx)(we,{variant:`destructive`,children:e(`automations.pause.badge`)}):null]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(a?`automations.pause.pausedDescription`:`automations.pause.description`)}),(0,X.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e(`automations.pause.inheritPrefix`)}),(0,X.jsx)(Oe,{settings:i,name:`automations_scheduler_enabled`,field:`automationsSchedulerEnabled`,busy:o,onSave:s})]})]}),(0,X.jsx)(ce,{id:st,"aria-label":e(`automations.pause.ariaLabel`),checked:a,disabled:o,onCheckedChange:e=>void s(De(i,{automationsSchedulerEnabled:!e}))})]})}function lt({filters:e,accountOptions:t,modelOptions:n,statusOptions:r,scheduleTypeOptions:i,onSearchChange:a,onAccountChange:o,onModelChange:s,onStatusChange:c,onScheduleTypeChange:l,onReset:u}){let{t:d}=y();return(0,X.jsxs)(`div`,{className:`space-y-2 rounded-xl border bg-card p-4`,children:[(0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,X.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,X.jsx)(g,{className:`pointer-events-none absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground/60`,"aria-hidden":`true`}),(0,X.jsx)(P,{value:e.search,onChange:e=>a(e.target.value),className:`h-8 pl-9`,placeholder:d(`automations.filters.jobsSearchPlaceholder`),"aria-label":d(`automations.filters.jobsSearchAria`)})]})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(q,{label:d(`automations.jobs.columns.accounts`),values:e.accountIds,options:t,onChange:o}),(0,X.jsx)(q,{label:d(`apiKeys.table.models`),values:e.models,options:n,onChange:s}),(0,X.jsx)(q,{label:d(`automations.filters.statuses`),values:e.statuses,options:r,onChange:c}),(0,X.jsx)(q,{label:d(`automations.filters.type`),values:e.scheduleTypes,options:i,onChange:l}),(0,X.jsxs)(x,{type:`button`,variant:`ghost`,size:`sm`,onClick:u,className:`h-8 gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(_,{className:`h-3 w-3`,"aria-hidden":`true`}),d(`common.actions.reset`)]})]})]})}function ut({filters:e,accountOptions:t,modelOptions:n,statusOptions:r,triggerOptions:i,onSearchChange:a,onAccountChange:o,onModelChange:s,onStatusChange:c,onTriggerChange:l,onReset:u}){let{t:d}=y();return(0,X.jsxs)(`div`,{className:`space-y-2 rounded-xl border bg-card p-4`,children:[(0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,X.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,X.jsx)(g,{className:`pointer-events-none absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground/60`,"aria-hidden":`true`}),(0,X.jsx)(P,{value:e.search,onChange:e=>a(e.target.value),className:`h-8 pl-9`,placeholder:d(`automations.filters.runsSearchPlaceholder`),"aria-label":d(`automations.filters.runsSearchAria`)})]})}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(q,{label:d(`automations.jobs.columns.accounts`),values:e.accountIds,options:t,onChange:o}),(0,X.jsx)(q,{label:d(`apiKeys.table.models`),values:e.models,options:n,onChange:s}),(0,X.jsx)(q,{label:d(`automations.filters.statuses`),values:e.statuses,options:r,onChange:c}),(0,X.jsx)(q,{label:d(`automations.filters.triggers`),values:e.triggers,options:i,onChange:l}),(0,X.jsxs)(x,{type:`button`,variant:`ghost`,size:`sm`,onClick:u,className:`h-8 gap-1.5 text-xs text-muted-foreground`,children:[(0,X.jsx)(_,{className:`h-3 w-3`,"aria-hidden":`true`}),d(`common.actions.reset`)]})]})]})}function dt(e){switch(e){case`success`:return`default`;case`partial`:return`secondary`;case`failed`:return`destructive`;case`running`:return`outline`}}function ft(e,t,n){return e===`running`&&(t??0)>0?n?n(`automations.statuses.inProgress`):`in progress`:n?n(`automations.statuses.${e}`,{defaultValue:e}):e}function pt(e){return dt(e)}function mt(e){return e===`pending`?`outline`:dt(e)}function ht(e){let t={total:e.length,success:0,failed:0,partial:0,running:0,pending:0,completed:0};for(let n of e)switch(n.status){case`success`:t.success+=1,t.completed+=1;break;case`failed`:t.failed+=1,t.completed+=1;break;case`partial`:t.partial+=1,t.completed+=1;break;case`running`:t.running+=1;break;case`pending`:t.pending+=1}return t}function gt({open:e,onOpenChange:t,isLoading:n,data:r,blurred:i,accountDisplayIndex:a,accountBlurIndex:o}){let{t:s}=y(),c=fe(e=>e.dateDisplayFormat);return(0,X.jsx)(R,{open:e,onOpenChange:t,children:(0,X.jsxs)(ye,{className:`max-h-[90vh] overflow-hidden sm:max-w-5xl`,children:[(0,X.jsxs)(pe,{children:[(0,X.jsx)(I,{children:s(`automations.runs.detailsTitle`)}),(0,X.jsx)(he,{children:s(`automations.runs.detailsDescription`)})]}),(0,X.jsx)(`div`,{className:`min-h-0 space-y-4 overflow-y-auto`,children:n?(0,X.jsx)(ge,{}):r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`rounded-md border bg-muted/10 p-3`,children:(()=>{let e=r.run.effectiveStatus??r.run.status,t=ht(r.accounts),n=t.failed+t.partial,i=t.pending+t.running;return(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1.25fr)_repeat(4,minmax(0,1fr))]`,children:[(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/60 p-3`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`automations.runs.runStatus`)}),(0,X.jsx)(`div`,{className:`mt-2`,children:(0,X.jsx)(we,{variant:pt(e),children:ft(e,r.pendingAccounts,s)})}),(0,X.jsx)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:s(`automations.runs.completedOfTotal`,{completed:t.completed,total:t.total})})]}),(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/40 p-3`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`automations.runs.total`)}),(0,X.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums`,children:t.total})]}),(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/40 p-3`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`automations.statuses.success`)}),(0,X.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums`,children:t.success})]}),(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/40 p-3`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`automations.statuses.failed`)}),(0,X.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums`,children:n}),t.partial>0?(0,X.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:s(`automations.runs.includesPartial`,{count:t.partial})}):null]}),(0,X.jsxs)(`div`,{className:`rounded-md border bg-background/40 p-3`,children:[(0,X.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`automations.statuses.pending`)}),(0,X.jsx)(`div`,{className:`mt-1 text-2xl font-semibold tabular-nums`,children:i}),t.running>0?(0,X.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:s(`automations.runs.runningCount`,{count:t.running})}):null]})]})})()}),(0,X.jsx)(`div`,{className:`rounded-md border`,children:(0,X.jsx)(`div`,{className:`max-h-[56vh] overflow-auto`,children:(0,X.jsxs)(Ee,{className:`min-w-[980px] table-fixed`,children:[(0,X.jsx)(H,{children:(0,X.jsxs)(G,{className:`hover:bg-transparent [&>th]:sticky [&>th]:top-0 [&>th]:z-10 [&>th]:bg-card`,children:[(0,X.jsx)(U,{className:`w-52 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`dashboard.requests.columns.account`)}),(0,X.jsx)(U,{className:`w-28 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`dashboard.requests.columns.status`)}),(0,X.jsx)(U,{className:`w-32 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,title:s(`automations.runs.cycleStartTitle`),children:s(`automations.runs.columns.cycleStart`)}),(0,X.jsx)(U,{className:`w-32 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,title:s(`automations.runs.dispatchAtTitle`),children:s(`automations.runs.columns.dispatchAt`)}),(0,X.jsx)(U,{className:`w-32 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`automations.runs.columns.finishedAtShort`)}),(0,X.jsx)(U,{className:`w-56 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:s(`automations.runs.columns.error`)})]})}),(0,X.jsx)(W,{children:r.accounts.map(e=>{let t=Fe(e.accountId,a),n=o.get(e.accountId),l=i&&!!n?.primary,u=i&&!!n?.secondary,d=F(r.run.startedAt,c),f=e.scheduledFor?F(e.scheduledFor,c):null,p=e.finishedAt?F(e.finishedAt,c):null,m=e.status;return(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`truncate text-foreground/95`,title:t.title,children:l?(0,X.jsx)(`span`,{className:`privacy-blur`,children:t.primary}):t.primary}),t.secondary?(0,X.jsx)(`div`,{className:`truncate text-muted-foreground`,title:t.title,children:u?(0,X.jsx)(`span`,{className:`privacy-blur`,children:t.secondary}):t.secondary}):null]})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsx)(we,{variant:mt(m),children:m===`pending`?s(`automations.statuses.pending`):ft(m,null,s)})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`font-mono tabular-nums text-foreground/95`,children:d.primary}),(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:d.secondary})]})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:f?(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`font-mono tabular-nums text-foreground/95`,children:f.primary}),(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:f.secondary})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:p?(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`font-mono tabular-nums text-foreground/95`,children:p.primary}),(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:p.secondary})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:e.errorCode||e.errorMessage?(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`truncate font-medium text-destructive/90`,title:`${e.errorCode??`error`}${e.errorMessage?`: ${e.errorMessage}`:``}`,children:e.errorCode??`error`}),e.errorMessage?(0,X.jsx)(`div`,{className:`line-clamp-2 break-words text-muted-foreground`,title:e.errorMessage,children:e.errorMessage}):null]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:s(`automations.runs.noError`)})})]},`${e.accountId}:${e.runId??`pending`}`)})})]})})})]}):(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:s(`automations.runs.detailsUnavailable`)})})]})})}var _t=A([`daily`]),vt=A([`mon`,`tue`,`wed`,`thu`,`fri`,`sat`,`sun`]),yt=A([`running`,`success`,`failed`,`partial`]),bt=A([`scheduled`,`manual`]),xt=A([`minimal`,`low`,`medium`,`high`,`xhigh`,`max`,`ultra`]),St=C(vt).min(1).max(7).refine(e=>new Set(e).size===e.length,`Duplicate schedule days are not allowed`),Ct=T({type:_t,time:j().regex(/^\d{2}:\d{2}$/),timezone:j().min(1),thresholdMinutes:D().int().min(0).max(240).default(0),days:St}),wt=T({id:j().min(1),jobId:j().min(1),jobName:j().nullable().optional(),model:j().nullable().optional(),reasoningEffort:xt.nullable().optional(),trigger:bt,status:yt,scheduledFor:j().datetime({offset:!0}),startedAt:j().datetime({offset:!0}),finishedAt:j().datetime({offset:!0}).nullable(),accountId:j().nullable(),errorCode:j().nullable(),errorMessage:j().nullable(),attemptCount:D().int().nonnegative(),effectiveStatus:yt.nullable().optional(),totalAccounts:D().int().nonnegative().nullable().optional(),completedAccounts:D().int().nonnegative().nullable().optional(),pendingAccounts:D().int().nonnegative().nullable().optional(),cycleKey:j().nullable().optional()}),Tt=T({id:j().min(1),name:j().min(1),enabled:w(),includePausedAccounts:w().default(!1),schedule:Ct,model:j().min(1),reasoningEffort:xt.nullable().optional(),prompt:j().min(1),accountScopeAll:w().default(!0),accountIds:C(j().min(1)).default([]),nextRunAt:j().datetime({offset:!0}).nullable(),lastRun:wt.nullable()}),Et=T({items:C(Tt).default([]),total:D().int().nonnegative().default(0),hasMore:w().default(!1)}),Dt=T({items:C(wt).default([]),total:D().int().nonnegative().default(0),hasMore:w().default(!1)}),Ot=T({accountIds:C(j().min(1)).default([]),models:C(j().min(1)).default([]),statuses:C(j().min(1)).default([]),scheduleTypes:C(j().min(1)).default([])}),kt=T({accountIds:C(j().min(1)).default([]),models:C(j().min(1)).default([]),statuses:C(j().min(1)).default([]),triggers:C(j().min(1)).default([])}),At=T({accountId:j().min(1),status:A([`pending`,`running`,`success`,`failed`,`partial`]),runId:j().nullable().optional(),scheduledFor:j().datetime({offset:!0}).nullable().optional(),startedAt:j().datetime({offset:!0}).nullable().optional(),finishedAt:j().datetime({offset:!0}).nullable().optional(),errorCode:j().nullable().optional(),errorMessage:j().nullable().optional()}),jt=T({run:wt,accounts:C(At).default([]),totalAccounts:D().int().nonnegative(),completedAccounts:D().int().nonnegative(),pendingAccounts:D().int().nonnegative()}),Mt=T({name:j().min(1),enabled:w().default(!0),includePausedAccounts:w().optional(),schedule:Ct,model:j().min(1),reasoningEffort:xt.nullable().optional(),prompt:j().optional(),accountIds:C(j().min(1))}),Nt=T({name:j().min(1).optional(),enabled:w().optional(),includePausedAccounts:w().optional(),schedule:Ct.optional(),model:j().min(1).optional(),reasoningEffort:xt.nullable().optional(),prompt:j().min(1).optional(),accountIds:C(j().min(1)).optional()}),Pt=T({status:oe(`deleted`)}),Q=`/api/automations`;function $(e,t,n){if(n&&n.length!==0)for(let r of n)r&&e.append(t,r)}function Ft(e,t){return t.size>0?`${e}?${t.toString()}`:e}function It(e={}){let t=new URLSearchParams;return typeof e.limit==`number`&&t.set(`limit`,String(e.limit)),typeof e.offset==`number`&&t.set(`offset`,String(e.offset)),e.search&&t.set(`search`,e.search),$(t,`accountId`,e.accountIds),$(t,`model`,e.models),$(t,`status`,e.statuses),$(t,`scheduleType`,e.scheduleTypes),O(Ft(Q,t),Et)}function Lt(e={}){let t=new URLSearchParams;return e.search&&t.set(`search`,e.search),$(t,`accountId`,e.accountIds),$(t,`model`,e.models),$(t,`status`,e.statuses),$(t,`scheduleType`,e.scheduleTypes),O(Ft(`${Q}/options`,t),Ot)}function Rt(e={}){let t=new URLSearchParams;return typeof e.limit==`number`&&t.set(`limit`,String(e.limit)),typeof e.offset==`number`&&t.set(`offset`,String(e.offset)),e.search&&t.set(`search`,e.search),$(t,`accountId`,e.accountIds),$(t,`model`,e.models),$(t,`status`,e.statuses),$(t,`trigger`,e.triggers),$(t,`automationId`,e.automationIds),O(Ft(`${Q}/runs`,t),Dt)}function zt(e={}){let t=new URLSearchParams;return e.search&&t.set(`search`,e.search),$(t,`accountId`,e.accountIds),$(t,`model`,e.models),$(t,`status`,e.statuses),$(t,`trigger`,e.triggers),$(t,`automationId`,e.automationIds),O(Ft(`${Q}/runs/options`,t),kt)}function Bt(e){return O(`${Q}/runs/${e}/details`,jt)}function Vt(e){let t=Mt.parse(e);return S(Q,Tt,{body:t})}function Ht(e,t){let n=Nt.parse(t);return E(`${Q}/${e}`,Tt,{body:n})}function Ut(e){return ae(`${Q}/${e}`,Pt)}function Wt(e){return S(`${Q}/${e}/run-now`,wt)}function Gt(e,t=20){return O(`${Q}/${e}/runs?limit=${t}`,Dt)}var Kt={search:``,accountIds:[],models:[],statuses:[],scheduleTypes:[],limit:25,offset:0},qt={search:``,accountIds:[],models:[],statuses:[],triggers:[],limit:25,offset:0},Jt=[`jobsSearch`,`jobsAccountId`,`jobsModel`,`jobsStatus`,`jobsScheduleType`,`jobsLimit`,`jobsOffset`],Yt=[`runsSearch`,`runsAccountId`,`runsModel`,`runsStatus`,`runsTrigger`,`runsLimit`,`runsOffset`];function Xt(e,t){if(e===null)return t;let n=Number(e);return Number.isFinite(n)?Math.max(0,Math.trunc(n)):t}function Zt(e){return{search:e.get(`jobsSearch`)??``,accountIds:e.getAll(`jobsAccountId`),models:e.getAll(`jobsModel`),statuses:e.getAll(`jobsStatus`),scheduleTypes:e.getAll(`jobsScheduleType`),limit:Math.max(1,Xt(e.get(`jobsLimit`),Kt.limit)),offset:Xt(e.get(`jobsOffset`),Kt.offset)}}function Qt(e){return{search:e.get(`runsSearch`)??``,accountIds:e.getAll(`runsAccountId`),models:e.getAll(`runsModel`),statuses:e.getAll(`runsStatus`),triggers:e.getAll(`runsTrigger`),limit:Math.max(1,Xt(e.get(`runsLimit`),qt.limit)),offset:Xt(e.get(`runsOffset`),qt.offset)}}function $t(e,t){let n=new URLSearchParams(t);for(let e of Jt)n.delete(e);e.search&&n.set(`jobsSearch`,e.search);for(let t of e.accountIds)n.append(`jobsAccountId`,t);for(let t of e.models)n.append(`jobsModel`,t);for(let t of e.statuses)n.append(`jobsStatus`,t);for(let t of e.scheduleTypes)n.append(`jobsScheduleType`,t);return n.set(`jobsLimit`,String(e.limit)),n.set(`jobsOffset`,String(e.offset)),n}function en(e,t){let n=new URLSearchParams(t);for(let e of Yt)n.delete(e);e.search&&n.set(`runsSearch`,e.search);for(let t of e.accountIds)n.append(`runsAccountId`,t);for(let t of e.models)n.append(`runsModel`,t);for(let t of e.statuses)n.append(`runsStatus`,t);for(let t of e.triggers)n.append(`runsTrigger`,t);return n.set(`runsLimit`,String(e.limit)),n.set(`runsOffset`,String(e.offset)),n}function tn(){let[e,t]=be(),n=(0,J.useMemo)(()=>Zt(e),[e]),a=(0,J.useMemo)(()=>Qt(e),[e]),o=(0,J.useMemo)(()=>({limit:n.limit,offset:n.offset,search:n.search||void 0,accountIds:n.accountIds,models:n.models,statuses:n.statuses,scheduleTypes:n.scheduleTypes}),[n]),s=(0,J.useMemo)(()=>({limit:a.limit,offset:a.offset,search:a.search||void 0,accountIds:a.accountIds,models:a.models,statuses:a.statuses,triggers:a.triggers}),[a]);return{jobsFilters:n,runsFilters:a,jobsListFilters:o,runsListFilters:s,jobsQuery:i({queryKey:[`automations`,`jobs`,o],queryFn:()=>It(o),refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0,placeholderData:r}),runsQuery:i({queryKey:[`automations`,`runs`,s],queryFn:()=>Rt(s),refetchInterval:15e3,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0,placeholderData:r}),jobOptionsQuery:i({queryKey:[`automations`,`jobs-options`,n.search,n.accountIds,n.models,n.statuses,n.scheduleTypes],queryFn:()=>Lt({search:n.search||void 0,accountIds:n.accountIds,models:n.models,statuses:n.statuses,scheduleTypes:n.scheduleTypes}),refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0}),runOptionsQuery:i({queryKey:[`automations`,`runs-options`,a.search,a.accountIds,a.models,a.statuses,a.triggers],queryFn:()=>zt({search:a.search||void 0,accountIds:a.accountIds,models:a.models,statuses:a.statuses,triggers:a.triggers}),refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0}),updateJobsFilters:e=>{t(t=>$t({...Zt(t),...e},t))},updateRunsFilters:e=>{t(t=>en({...Qt(t),...e},t))},resetJobsFilters:()=>{t(e=>$t(Kt,e))},resetRunsFilters:()=>{t(e=>en(qt,e))}}}function nn(){let{settingsQuery:e}=_e(),t=e.data;return t?!t.automationsSchedulerEnabled:void 0}function rn(e,t={}){let{t:n}=y(),r=t.enableQueries??!0,s=o(),c=i({queryKey:[`automations`,`list`],queryFn:()=>It(),enabled:r,refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0}),l=e??c.data?.items[0]?.id??null,u=i({queryKey:[`automations`,`runs`,l],queryFn:()=>Gt(l??``,20),enabled:r&&l!=null,refetchInterval:15e3,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0}),d=async()=>{await s.invalidateQueries({queryKey:[`automations`]})};return{automationsQuery:c,runsQuery:u,effectiveSelectedAutomationId:l,createMutation:a({mutationFn:e=>Vt(e),onSuccess:async()=>{L.success(n(`automations.toasts.created`)),await d()},onError:e=>{L.error(e.message||n(`automations.toasts.createFailed`))}}),updateMutation:a({mutationFn:({automationId:e,payload:t})=>Ht(e,t),onSuccess:async()=>{L.success(n(`automations.toasts.updated`)),await d()},onError:e=>{L.error(e.message||n(`automations.toasts.updateFailed`))}}),deleteMutation:a({mutationFn:e=>Ut(e),onSuccess:async()=>{L.success(n(`automations.toasts.deleted`)),await d()},onError:e=>{L.error(e.message||n(`automations.toasts.deleteFailed`))}}),runNowMutation:a({mutationFn:e=>Wt(e),onSuccess:async()=>{L.success(n(`automations.toasts.runQueued`)),await d()},onError:e=>{e instanceof k&&e.code===`automations_paused`?L.error(n(`automations.toasts.runRefusedPaused`)):L.error(e.message||n(`automations.toasts.runFailed`))}})}}var an=[],on=[],sn=`server_default`,cn=[`enabled`,`disabled`],ln=[`running`,`success`,`partial`,`failed`],un=[`scheduled`,`manual`],dn=[`daily`];function fn(e,t){return t(`settings.routing.workingDays.days.${e}`,{defaultValue:e.toUpperCase()})}function pn(e,t){return e.length===7?t(`automations.schedule.everyDay`):e.join(`,`)===`mon,tue,wed,thu,fri`?t(`automations.schedule.weekdays`):e.map(e=>fn(e,t)).join(`, `)}function mn(e,t){return Be(e,t)}function hn(e,t,n,r){let i=mn(t,n);if(e.length===7)return r(`automations.schedule.everyDayAt`,{time:i});let a=e.join(`,`);return a===`mon,tue,wed,thu,fri`?r(`automations.schedule.weekdaysAt`,{time:i}):a===`sat,sun`?r(`automations.schedule.weekendsAt`,{time:i}):r(`automations.schedule.daysAt`,{days:pn(e,r),time:i})}function gn(e,t){return e===sn?t(`automations.schedule.serverDefault`):e}function _n(e,t){return e===`daily`?t(`automations.types.daily`):e}function vn(e,t){return t(`automations.statuses.${e}`,{defaultValue:le(e)})}function yn(e){return e.search.trim().length>0||e.accountIds.length>0||e.models.length>0||e.statuses.length>0||e.scheduleTypes.length>0}function bn(e){return e.search.trim().length>0||e.accountIds.length>0||e.models.length>0||e.statuses.length>0||e.triggers.length>0}function xn(){let{t:e}=y(),[t,n]=(0,J.useState)(null),[r,a]=(0,J.useState)(null),o=de(e=>e.timeFormat),s=fe(e=>e.dateDisplayFormat),c=me(e=>e.blurred),l=xe(),u=xe(),d=xe(),{data:f=[],isLoading:m}=h(),{accountsQuery:g}=Ce(),{jobsFilters:_,runsFilters:v,jobsQuery:b,runsQuery:S,jobOptionsQuery:C,runOptionsQuery:w,updateJobsFilters:T,updateRunsFilters:E,resetJobsFilters:D,resetRunsFilters:ae}=tn(),{createMutation:oe,updateMutation:O,deleteMutation:k,runNowMutation:A}=rn(null,{enableQueries:!1}),j=nn()===!0,se=i({queryKey:[`automations`,`run-details`,r],queryFn:()=>Bt(r??``),enabled:r!==null,refetchOnWindowFocus:!1}),M=b.data?.items??an,le=S.data?.items??on,P=(0,J.useMemo)(()=>Pe(g.data??[]),[g.data]),I=(0,J.useMemo)(()=>new Map((g.data??[]).map(e=>[e.accountId,e])),[g.data]),L=(0,J.useMemo)(()=>{let e=new Map;for(let t of g.data??[]){let n=(t.displayName??``).trim(),r=(t.email??``).trim(),i=n||r||`Unnamed account`,a=n.length>0&&r.length>0&&n.toLowerCase()!==r.toLowerCase(),o=Se(i,r),s=a&&Se(r,r);e.set(t.accountId,{primary:o,secondary:s,any:o||s})}return e},[g.data]),R=(0,J.useMemo)(()=>f.filter(e=>!e.sourceOnly),[f]),pe=(0,J.useMemo)(()=>[...new Set([...C.data?.accountIds??[],...(g.data??[]).map(e=>e.accountId)])].sort().map(e=>{let t=Fe(e,P),n=(I.get(e)?.email??``).trim(),r=L.get(e)?.any??(n.length>0&&Se(t.primary,n));return{value:e,label:t.secondary?`${t.primary} (${t.secondary})`:t.primary,isEmail:r}}),[L,P,I,g.data,C.data?.accountIds]),he=(0,J.useMemo)(()=>[...new Set([...R.map(e=>e.id.trim()),...(C.data?.models??[]).map(e=>e.trim())])].filter(e=>e.length>0).sort().map(e=>({value:e,label:e})),[R,C.data?.models]),_e=(0,J.useMemo)(()=>cn.map(t=>({value:t,label:vn(t,e)})),[e]),ve=(0,J.useMemo)(()=>(C.data?.scheduleTypes?.length?C.data.scheduleTypes:[...dn]).map(t=>({value:t,label:_n(t,e)})),[C.data,e]),ye=(0,J.useMemo)(()=>[...new Set([...w.data?.accountIds??[],...(g.data??[]).map(e=>e.accountId)])].sort().map(e=>{let t=Fe(e,P),n=(I.get(e)?.email??``).trim(),r=L.get(e)?.any??(n.length>0&&Se(t.primary,n));return{value:e,label:t.secondary?`${t.primary} (${t.secondary})`:t.primary,isEmail:r}}),[L,P,I,g.data,w.data?.accountIds]),be=(0,J.useMemo)(()=>[...new Set([...R.map(e=>e.id.trim()),...(w.data?.models??[]).map(e=>e.trim())])].filter(e=>e.length>0).sort().map(e=>({value:e,label:e})),[R,w.data?.models]),De=(0,J.useMemo)(()=>ln.map(t=>({value:t,label:vn(t,e)})),[e]),Oe=(0,J.useMemo)(()=>un.map(t=>({value:t,label:vn(t,e)})),[e]),q=b.data?.total??0,ke=b.data?.hasMore??!1,je=S.data?.total??0,Y=S.data?.hasMore??!1,Me=yn(_),Ne=bn(v),Le=oe.isPending||O.isPending||k.isPending||A.isPending,Re=N(b.error)||N(S.error)||N(C.error)||N(w.error)||N(se.error)||N(oe.error)||N(O.error)||N(k.error)||N(A.error),ze=()=>{n(null),l.show()},Be=e=>{n(e),l.show()};return(0,X.jsxs)(`div`,{className:`animate-fade-in-up space-y-6`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e(`automations.page.title`)}),(0,X.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`automations.page.subtitle`)})]}),(0,X.jsx)(ct,{})]}),Re?(0,X.jsx)(z,{variant:`error`,children:Re}):null,(0,X.jsxs)(`section`,{className:`space-y-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-semibold`,children:e(`automations.jobs.title`)}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`automations.jobs.description`)})]}),(0,X.jsxs)(x,{type:`button`,size:`sm`,onClick:ze,children:[(0,X.jsx)(te,{className:`mr-1.5 h-4 w-4`}),e(`automations.jobs.add`)]})]}),(0,X.jsx)(lt,{filters:_,accountOptions:pe,modelOptions:he,statusOptions:_e,scheduleTypeOptions:ve,onSearchChange:e=>T({search:e,offset:0}),onAccountChange:e=>T({accountIds:e,offset:0}),onModelChange:e=>T({models:e,offset:0}),onStatusChange:e=>T({statuses:e,offset:0}),onScheduleTypeChange:e=>T({scheduleTypes:e,offset:0}),onReset:D}),b.isLoading&&!b.data?(0,X.jsx)(`div`,{className:`rounded-xl border bg-card py-8`,children:(0,X.jsx)(ge,{})}):M.length===0?(0,X.jsx)(`div`,{className:`rounded-xl border bg-card p-5`,children:(0,X.jsx)(Te,{icon:Ae,title:e(Me?`automations.jobs.emptyFilteredTitle`:`automations.jobs.emptyTitle`),description:e(Me?`automations.jobs.emptyFilteredDescription`:`automations.jobs.emptyDescription`)})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`rounded-xl border bg-card`,children:(0,X.jsx)(`div`,{className:`relative overflow-x-auto`,children:(0,X.jsxs)(Ee,{className:`min-w-[980px] table-fixed`,children:[(0,X.jsx)(H,{children:(0,X.jsxs)(G,{className:`hover:bg-transparent`,children:[(0,X.jsx)(U,{className:`w-56 pl-4 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.jobs.columns.name`)}),(0,X.jsx)(U,{className:`w-32 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.jobs.columns.type`)}),(0,X.jsx)(U,{className:`w-56 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.jobs.columns.schedule`)}),(0,X.jsx)(U,{className:`w-40 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`dashboard.requests.columns.model`)}),(0,X.jsx)(U,{className:`w-52 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.jobs.columns.accounts`)}),(0,X.jsx)(U,{className:`w-36 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.jobs.columns.nextRun`)}),(0,X.jsx)(U,{className:`w-28 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.jobs.columns.lastStatus`)}),(0,X.jsx)(U,{className:`w-36 pr-4 text-right text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`apiKeys.table.actions`)})]})}),(0,X.jsx)(W,{children:M.map(t=>{let n=t.nextRunAt?F(t.nextRunAt,s):null,r=Ie(t.accountIds,P,t.accountScopeAll),i=hn(t.schedule.days,t.schedule.time,o,e),a=gn(t.schedule.timezone,e),l=t.schedule.thresholdMinutes>0?e(`automations.schedule.spreadUpTo`,{minutes:t.schedule.thresholdMinutes}):e(`automations.schedule.immediateDispatch`),f=ue(t.model,t.reasoningEffort),p=c&&t.accountIds.length>0&&(t.accountIds.length===1?L.get(t.accountIds[0])?.primary??!1:t.accountIds.some(e=>L.get(e)?.any??!1)),m=c&&t.accountIds.length>0&&(t.accountIds.length===1?L.get(t.accountIds[0])?.secondary??!1:t.accountIds.some(e=>L.get(e)?.any??!1));return(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{className:`pl-4 align-middle`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,X.jsx)(`div`,{className:`truncate text-sm font-medium`,title:t.name,children:t.name}),(0,X.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,title:t.prompt,children:t.prompt})]})}),(0,X.jsx)(K,{className:`align-middle text-xs text-muted-foreground`,children:_n(t.schedule.type,e)}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`truncate text-foreground/95`,title:i,children:i}),(0,X.jsx)(`div`,{className:`truncate text-muted-foreground`,title:a,children:a}),(0,X.jsx)(`div`,{className:`truncate text-muted-foreground`,title:l,children:l})]})}),(0,X.jsx)(K,{className:`truncate align-middle text-xs`,title:f,children:f}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`truncate text-foreground/95`,title:r.title,children:p?(0,X.jsx)(`span`,{className:`privacy-blur`,children:r.primary}):r.primary}),r.secondary?(0,X.jsx)(`div`,{className:`truncate text-muted-foreground`,title:r.title,children:m?(0,X.jsx)(`span`,{className:`privacy-blur`,children:r.secondary}):r.secondary}):null]})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:n?(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`text-foreground/95`,children:n.primary}),(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:n.secondary})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:e(`common.states.disabled`)})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:t.lastRun?(0,X.jsx)(we,{variant:pt(t.lastRun.effectiveStatus??t.lastRun.status),children:ft(t.lastRun.effectiveStatus??t.lastRun.status,t.lastRun.pendingAccounts,e)}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(K,{className:`pr-4 text-right align-middle`,children:(0,X.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,onClick:e=>{e.stopPropagation()},children:[(0,X.jsx)(ce,{checked:t.enabled,disabled:Le,"aria-label":t.enabled?e(`automations.jobs.disableAria`,{name:t.name}):e(`automations.jobs.enableAria`,{name:t.name}),title:t.enabled?e(`automations.jobs.disableTitle`):e(`automations.jobs.enableTitle`),onCheckedChange:e=>{O.mutateAsync({automationId:t.id,payload:{enabled:e}})}}),(0,X.jsx)(x,{type:`button`,size:`icon`,variant:`ghost`,className:`h-8 w-8`,disabled:Le,"aria-label":e(`automations.jobs.editAria`,{name:t.name}),title:e(`automations.jobs.editTitle`),onClick:()=>{Be(t)},children:(0,X.jsx)(ne,{className:`h-4 w-4`})}),(0,X.jsx)(x,{type:`button`,size:`icon`,variant:`ghost`,className:`h-8 w-8`,disabled:Le||j,"aria-label":e(`automations.jobs.runNowAria`,{name:t.name}),title:e(j?`automations.jobs.runNowPausedTitle`:`automations.jobs.runNowTitle`),onClick:()=>{d.show(t)},children:(0,X.jsx)(ie,{className:`h-4 w-4`})}),(0,X.jsx)(x,{type:`button`,size:`icon`,variant:`ghost`,className:`h-8 w-8 text-destructive hover:text-destructive`,disabled:Le,"aria-label":e(`automations.jobs.deleteAria`,{name:t.name}),title:e(`automations.jobs.deleteTitle`),onClick:()=>u.show(t),children:(0,X.jsx)(re,{className:`h-4 w-4`})})]})})]},t.id)})})]})})}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(p,{total:q,limit:_.limit,offset:_.offset,hasMore:ke,onLimitChange:e=>T({limit:e,offset:0}),onOffsetChange:e=>T({offset:e})})})]})]}),(0,X.jsxs)(`section`,{className:`space-y-3`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-semibold`,children:e(`automations.runs.title`)}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`automations.runs.description`)})]}),(0,X.jsx)(ut,{filters:v,accountOptions:ye,modelOptions:be,statusOptions:De,triggerOptions:Oe,onSearchChange:e=>E({search:e,offset:0}),onAccountChange:e=>E({accountIds:e,offset:0}),onModelChange:e=>E({models:e,offset:0}),onStatusChange:e=>E({statuses:e,offset:0}),onTriggerChange:e=>E({triggers:e,offset:0}),onReset:ae}),S.isLoading&&!S.data?(0,X.jsx)(`div`,{className:`rounded-xl border bg-card py-8`,children:(0,X.jsx)(ge,{})}):le.length===0?(0,X.jsx)(`div`,{className:`rounded-xl border bg-card p-5`,children:(0,X.jsx)(Te,{icon:ee,title:e(Ne?`automations.runs.emptyFilteredTitle`:`automations.runs.emptyTitle`),description:e(Ne?`automations.runs.emptyFilteredDescription`:`automations.runs.emptyDescription`)})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`rounded-xl border bg-card`,children:(0,X.jsx)(`div`,{className:`relative overflow-x-auto`,children:(0,X.jsxs)(Ee,{className:`min-w-[980px] table-fixed`,children:[(0,X.jsx)(H,{children:(0,X.jsxs)(G,{className:`hover:bg-transparent`,children:[(0,X.jsx)(U,{className:`w-24 pl-4 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`dashboard.requests.columns.status`)}),(0,X.jsx)(U,{className:`w-56 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.runs.columns.job`)}),(0,X.jsx)(U,{className:`w-24 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.runs.columns.trigger`)}),(0,X.jsx)(U,{className:`w-36 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.runs.columns.scheduledFor`)}),(0,X.jsx)(U,{className:`w-36 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.runs.columns.startedAt`)}),(0,X.jsx)(U,{className:`w-36 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.runs.columns.finishedAt`)}),(0,X.jsx)(U,{className:`w-48 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`dashboard.requests.columns.account`)}),(0,X.jsx)(U,{className:`w-64 pr-4 text-[11px] font-medium uppercase tracking-wider text-muted-foreground/80`,children:e(`automations.runs.columns.error`)})]})}),(0,X.jsx)(W,{children:le.map(t=>{let n=t.effectiveStatus??t.status,r=F(t.scheduledFor,s),i=F(t.startedAt,s),o=t.finishedAt?F(t.finishedAt,s):null,l=Fe(t.accountId,P),u=(t.totalAccounts??0)>1,d=t.pendingAccounts??0,f=t.completedAccounts??0,p=e(`automations.runs.groupedAccounts`,{count:t.totalAccounts??0}),m=d>0?e(`automations.runs.groupedProgress`,{completed:f,pending:d}):e(`automations.runs.groupedCycle`),h=t.accountId?L.get(t.accountId):null,ee=!u&&c&&!!h?.primary,te=!u&&c&&!!h?.secondary,ne=t.errorCode?`${t.errorCode}${t.errorMessage?`: ${t.errorMessage}`:``}`:null,re=t.jobName||t.jobId,ie=t.model?ue(t.model,t.reasoningEffort):`-`;return(0,X.jsxs)(G,{children:[(0,X.jsx)(K,{className:`pl-4 align-middle`,children:(0,X.jsx)(we,{variant:pt(n),children:ft(n,t.pendingAccounts,e)})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`truncate text-foreground/95`,title:re,children:re}),(0,X.jsx)(`div`,{className:`truncate text-muted-foreground`,title:ie,children:ie})]})}),(0,X.jsx)(K,{className:`align-middle text-xs text-muted-foreground`,children:t.trigger}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`text-foreground/95`,children:r.primary}),(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:r.secondary})]})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`text-foreground/95`,children:i.primary}),(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:i.secondary})]})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:o?(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`text-foreground/95`,children:o.primary}),(0,X.jsx)(`div`,{className:`text-muted-foreground`,children:o.secondary})]}):(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`-`})}),(0,X.jsx)(K,{className:`align-middle text-xs`,children:(0,X.jsxs)(`div`,{className:`space-y-0.5 leading-tight`,children:[(0,X.jsx)(`div`,{className:`truncate text-foreground/95`,title:u?p:l.title,children:ee?(0,X.jsx)(`span`,{className:`privacy-blur`,children:l.primary}):u?p:l.primary}),u||l.secondary?(0,X.jsx)(`div`,{className:`truncate text-muted-foreground`,title:u?m:l.title,children:te?(0,X.jsx)(`span`,{className:`privacy-blur`,children:l.secondary}):u?m:l.secondary}):null]})}),(0,X.jsx)(K,{className:`pr-4 align-middle text-xs text-muted-foreground whitespace-normal`,children:(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(`div`,{className:`min-w-0`,children:ne?(0,X.jsx)(`p`,{className:`line-clamp-2 break-words`,title:ne,children:ne}):`-`}),(0,X.jsx)(x,{type:`button`,size:`icon`,variant:`ghost`,className:`h-7 w-7 shrink-0`,"aria-label":e(`automations.runs.detailsAria`,{id:t.id}),title:e(`automations.runs.detailsTitle`),onClick:()=>a(t.id),children:(0,X.jsx)(B,{className:`h-4 w-4`})})]})})]},t.id)})})]})})}),(0,X.jsx)(`div`,{className:`flex justify-end`,children:(0,X.jsx)(p,{total:je,limit:v.limit,offset:v.offset,hasMore:Y,onLimitChange:e=>E({limit:e,offset:0}),onOffsetChange:e=>E({offset:e})})})]})]}),(0,X.jsx)(at,{open:l.open,busy:Le,editingJob:t,models:R,modelsLoading:m,onOpenChange:e=>{l.onOpenChange(e),e||n(null)},onCreate:async e=>{await oe.mutateAsync(e),n(null)},onUpdate:async(e,t)=>{await O.mutateAsync({automationId:e,payload:t}),n(null)}}),(0,X.jsx)(V,{open:u.open,title:e(`automations.deleteDialog.title`),description:e(`automations.deleteDialog.description`),confirmLabel:e(`common.actions.delete`),onOpenChange:u.onOpenChange,onConfirm:()=>{u.data&&k.mutateAsync(u.data.id).finally(()=>{u.hide()})}}),(0,X.jsx)(V,{open:d.open,title:e(`automations.runNowDialog.title`),description:d.data?e(`automations.runNowDialog.descriptionWithName`,{name:d.data.name}):e(`automations.runNowDialog.description`),confirmLabel:e(`automations.runNowDialog.confirm`),cancelLabel:e(`common.cancel`),onOpenChange:d.onOpenChange,onConfirm:()=>{d.data&&A.mutateAsync(d.data.id).finally(()=>{d.hide()})}}),(0,X.jsx)(gt,{open:r!==null,onOpenChange:e=>{e||a(null)},isLoading:se.isLoading,data:se.data,blurred:c,accountDisplayIndex:P,accountBlurIndex:L})]})}export{xn as AutomationsPage};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-hePW80VL.js";import{C as e,S as t}from"./vendor-query-_bHZuxEx.js";import{c as n,i as r,r as i}from"./button-BjVmmiGW.js";e();var a=i(`inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}}),o=t();function s({className:e,variant:t=`default`,asChild:i=!1,...s}){let c=i?r:`span`;return(0,o.jsx)(c,{"data-slot":`badge`,"data-variant":t,className:n(a({variant:t}),e),...s})}export{s as t};
@@ -0,0 +1 @@
1
+ function e(e,t){return!!e&&!!t&&e===t}export{e as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,S as n}from"./vendor-query-_bHZuxEx.js";import{t as r}from"./clsx-DB0hHKMi.js";var i=e(t(),1),a=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},o=(e,t)=>({classGroupId:e,validator:t}),s=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),c=`-`,l=[],u=`arbitrary..`,d=e=>{let t=ee(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return p(e);let n=e.split(c);return f(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?a(i,t):t:i||l}return n[e]||l}}},f=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=f(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(c):e.slice(t).join(c),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},p=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?u+r:void 0})(),ee=e=>{let{theme:t,classGroups:n}=e;return m(n,t)},m=(e,t)=>{let n=s();for(let r in e){let i=e[r];h(i,n,r,t)}return n},h=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];g(i,t,n,r)}},g=(e,t,n,r)=>{typeof e==`string`?_(e,t,n):typeof e==`function`?v(e,t,n,r):y(e,t,n,r)},_=(e,t,n)=>{let r=e===``?t:b(t,e);r.classGroupId=n},v=(e,t,n,r)=>{x(e)?h(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(o(n,e)))},y=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];h(o,b(t,a),n,r)}},b=(e,t)=>{let n=e,r=t.split(c),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=s(),n.nextPart.set(t,i)),n=i}return n},x=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,S=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},C=`!`,w=`:`,te=[],ne=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),T=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===w){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(C)?(c=s.slice(0,-1),l=!0):s.startsWith(C)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ne(t,l,c,u)};if(t){let e=t+w,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ne(te,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},re=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},E=e=>({cache:S(e.cacheSize),parseClassName:T(e),sortModifiers:re(e),postfixLookupClassGroupIds:D(e),...d(e)}),D=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},O=/\s+/,k=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(O),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:ee}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let m=!!ee,h;if(m){h=r(p.substring(0,ee));let e=h&&o[h]?r(p):void 0;e&&e!==h&&(h=e,m=!1)}else h=r(p);if(!h){if(!m||(h=r(p),!h)){l=t+(l.length>0?` `+l:l);continue}m=!1}let g=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),_=f?g+C:g,v=_+h;if(s.indexOf(v)>-1)continue;s.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];s.push(_+t)}l=t+(l.length>0?` `+l:l)}return l},A=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=j(n))&&(i&&(i+=` `),i+=r);return i},j=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=j(e[r]))&&(n&&(n+=` `),n+=t);return n},M=(e,...t)=>{let n,r,i,a,o=o=>(n=E(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=k(e,n);return i(e,a),a};return a=o,(...e)=>a(A(...e))},ie=[],N=e=>{let t=t=>t[e]||ie;return t.isThemeGetter=!0,t.themeKey=e,t},P=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ae=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,L=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,se=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,z=e=>oe.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),ce=e=>e.endsWith(`%`)&&B(e.slice(0,-1)),H=e=>F.test(e),le=()=>!0,ue=e=>I.test(e)&&!L.test(e),U=()=>!1,W=e=>se.test(e),G=e=>R.test(e),de=e=>!K(e)&&!Y(e),fe=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),pe=e=>Z(e,De,U),K=e=>P.test(e),q=e=>Z(e,Oe,ue),me=e=>Z(e,ke,B),he=e=>Z(e,je,le),ge=e=>Z(e,Ae,U),_e=e=>Z(e,Te,U),ve=e=>Z(e,Ee,G),J=e=>Z(e,Me,W),Y=e=>ae.test(e),X=e=>Q(e,Oe),ye=e=>Q(e,Ae),be=e=>Q(e,Te),xe=e=>Q(e,De),Se=e=>Q(e,Ee),Ce=e=>Q(e,Me,!0),we=e=>Q(e,je,!0),Z=(e,t,n)=>{let r=P.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=ae.exec(e);return r?r[1]?t(r[1]):n:!1},Te=e=>e===`position`||e===`percentage`,Ee=e=>e===`image`||e===`url`,De=e=>e===`length`||e===`size`||e===`bg-size`,Oe=e=>e===`length`,ke=e=>e===`number`,Ae=e=>e===`family-name`,je=e=>e===`number`||e===`weight`,Me=e=>e===`shadow`,Ne=M(()=>{let e=N(`color`),t=N(`font`),n=N(`text`),r=N(`font-weight`),i=N(`tracking`),a=N(`leading`),o=N(`breakpoint`),s=N(`container`),c=N(`spacing`),l=N(`radius`),u=N(`shadow`),d=N(`inset-shadow`),f=N(`text-shadow`),p=N(`drop-shadow`),ee=N(`blur`),m=N(`perspective`),h=N(`aspect`),g=N(`ease`),_=N(`animate`),v=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],y=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],b=()=>[...y(),Y,K],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[Y,K,c],w=()=>[z,`full`,`auto`,...C()],te=()=>[V,`none`,`subgrid`,Y,K],ne=()=>[`auto`,{span:[`full`,V,Y,K]},V,Y,K],T=()=>[V,`auto`,Y,K],re=()=>[`auto`,`min`,`max`,`fr`,Y,K],E=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],D=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],O=()=>[`auto`,...C()],k=()=>[z,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],A=()=>[s,z,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],j=()=>[z,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],M=()=>[e,Y,K],ie=()=>[...y(),be,_e,{position:[Y,K]}],P=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,xe,pe,{size:[Y,K]}],oe=()=>[ce,X,q],F=()=>[``,`none`,`full`,l,Y,K],I=()=>[``,B,X,q],L=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],R=()=>[B,ce,be,_e],ue=()=>[``,`none`,ee,Y,K],U=()=>[`none`,B,Y,K],W=()=>[`none`,B,Y,K],G=()=>[B,Y,K],Z=()=>[z,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[H],breakpoint:[H],color:[le],container:[H],"drop-shadow":[H],ease:[`in`,`out`,`in-out`],font:[de],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[H],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[H],shadow:[H],spacing:[`px`,B],text:[H],"text-shadow":[H],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,z,K,Y,h]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,K]}],"container-named":[fe],columns:[{columns:[B,`auto`,K,Y,s]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[V,`auto`,Y,K]}],basis:[{basis:[z,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[B,z,`auto`,`initial`,`none`,K]}],grow:[{grow:[``,B,Y,K]}],shrink:[{shrink:[``,B,Y,K]}],order:[{order:[V,`first`,`last`,`none`,Y,K]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...E(),`normal`]}],"justify-items":[{"justify-items":[...D(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...D()]}],"align-content":[{content:[`normal`,...E()]}],"align-items":[{items:[...D(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...D(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":E()}],"place-items":[{"place-items":[...D(),`baseline`]}],"place-self":[{"place-self":[`auto`,...D()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:k()}],"inline-size":[{inline:[`auto`,...A()]}],"min-inline-size":[{"min-inline":[`auto`,...A()]}],"max-inline-size":[{"max-inline":[`none`,...A()]}],"block-size":[{block:[`auto`,...j()]}],"min-block-size":[{"min-block":[`auto`,...j()]}],"max-block-size":[{"max-block":[`none`,...j()]}],w:[{w:[s,`screen`,...k()]}],"min-w":[{"min-w":[s,`screen`,`none`,...k()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...k()]}],h:[{h:[`screen`,`lh`,...k()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...k()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...k()]}],"font-size":[{text:[`base`,n,X,q]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,we,he]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ce,K]}],"font-family":[{font:[ye,ge,t]}],"font-features":[{"font-features":[K]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,K]}],"line-clamp":[{"line-clamp":[B,`none`,Y,me]}],leading:[{leading:[`none`,a,...C()]}],"list-image":[{"list-image":[`none`,Y,K]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,K]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...L(),`wavy`]}],"text-decoration-thickness":[{decoration:[B,`from-font`,`auto`,Y,q]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[B,`auto`,Y,K]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[V,Y,K]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,K]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,K]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},V,Y,K],radial:[``,Y,K],conic:[``,V,Y,K]},Se,ve]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":I()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...L(),`hidden`,`none`]}],"divide-style":[{divide:[...L(),`hidden`,`none`]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...L(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[B,Y,K]}],"outline-w":[{outline:[``,B,X,q]}],"outline-color":[{outline:M()}],shadow:[{shadow:[``,`inner`,`none`,u,Ce,J]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ce,J]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:I()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[B,q]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":[`none`,f,Ce,J]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[B,Y,K]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Y,K]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":y()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,K]}],filter:[{filter:[``,`none`,Y,K]}],blur:[{blur:ue()}],brightness:[{brightness:[B,Y,K]}],contrast:[{contrast:[B,Y,K]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ce,J]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:[``,B,Y,K]}],"hue-rotate":[{"hue-rotate":[B,Y,K]}],invert:[{invert:[``,B,Y,K]}],saturate:[{saturate:[B,Y,K]}],sepia:[{sepia:[``,B,Y,K]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,K]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[B,Y,K]}],"backdrop-contrast":[{"backdrop-contrast":[B,Y,K]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,B,Y,K]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,Y,K]}],"backdrop-invert":[{"backdrop-invert":[``,B,Y,K]}],"backdrop-opacity":[{"backdrop-opacity":[B,Y,K]}],"backdrop-saturate":[{"backdrop-saturate":[B,Y,K]}],"backdrop-sepia":[{"backdrop-sepia":[``,B,Y,K]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,K]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[B,`initial`,Y,K]}],ease:[{ease:[`linear`,`initial`,g,Y,K]}],delay:[{delay:[B,Y,K]}],animate:[{animate:[`none`,_,Y,K]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[m,Y,K]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:U()}],"rotate-x":[{"rotate-x":U()}],"rotate-y":[{"rotate-y":U()}],"rotate-z":[{"rotate-z":U()}],scale:[{scale:W()}],"scale-x":[{"scale-x":W()}],"scale-y":[{"scale-y":W()}],"scale-z":[{"scale-z":W()}],"scale-3d":[`scale-3d`],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Y,K,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"translate-none":[`translate-none`],zoom:[{zoom:[V,Y,K]}],accent:[{accent:M()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,K]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,K]}],fill:[{fill:[`none`,...M()]}],"stroke-w":[{stroke:[B,X,q,me]}],stroke:[{stroke:[`none`,...M()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Pe(...e){return Ne(r(e))}var Fe=Object.defineProperty,Ie=(e,t)=>Fe(e,`name`,{value:t,configurable:!0});function Le(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ie(Le,`setRef`);function Re(...e){return t=>{let n=!1,r=e.map(e=>{let r=Le(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Le(e[t],null)}}}}Ie(Re,`composeRefs`);function ze(...e){return i.useCallback(Re(...e),e)}Ie(ze,`useComposedRefs`);var Be=Object.defineProperty,$=(e,t)=>Be(e,`name`,{value:t,configurable:!0});function Ve(e){let t=i.forwardRef((t,n)=>{let{children:r,...a}=t,o=null,s=!1,c=[];Xe(r)&&typeof tt==`function`&&(r=tt(r._payload)),i.Children.forEach(r,e=>{if(Je(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Xe(n)&&typeof tt==`function`&&(n=tt(n._payload)),o=Ge(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=i.cloneElement(o,void 0,c):!s&&i.Children.count(r)===1&&i.isValidElement(r)&&(o=r);let l=o?qe(o):void 0,u=ze(n,l);if(!o){if(r||r===0)throw Error(s?et(e):$e(e));return r}let d=Ke(a,o.props??{});return o.type!==i.Fragment&&(d.ref=n?u:l),i.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}$(Ve,`createSlot`);var He=Ve(`Slot`),Ue=Symbol.for(`radix.slottable`);function We(e){let t=$(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Ue,t}$(We,`createSlottable`);var Ge=$((e,t)=>{if(`child`in e.props){let t=e.props.child;return i.isValidElement(t)?i.cloneElement(t,void 0,e.props.children(t.props.children)):null}return i.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Ke(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Qe(a,i))}return{...e,...n}}$(Ke,`mergeProps`);function qe(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}$(qe,`getElementRef`);function Je(e){return i.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ue}$(Je,`isSlottable`);var Ye=Symbol.for(`react.lazy`);function Xe(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ye&&`_payload`in e&&Ze(e._payload)}$(Xe,`isLazyComponent`);function Ze(e){return typeof e==`object`&&!!e&&`then`in e}$(Ze,`isPromiseLike`);function Qe(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}$(Qe,`concatAriaDescribedby`);var $e=$(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),et=$(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),tt=i.use,nt=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,rt=r,it=(e,t)=>n=>{if(t?.variants==null)return rt(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=nt(t)||nt(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return rt(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},at=it(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}}),ot=n();function st({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?He:`button`;return(0,ot.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Pe(at({variant:t,size:n,className:e})),...i})}export{Ve as a,Pe as c,He as i,at as n,We as o,it as r,ze as s,st as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,S as n}from"./vendor-query-_bHZuxEx.js";import{_ as r,g as i,m as a,p as o,v as s}from"./es2015-bMH8YKZT.js";import{c,s as l}from"./button-BjVmmiGW.js";import{w as u}from"./api-client-dugX1Pti.js";import{ir as d}from"./index-DIpd264Z.js";var f=e(t(),1),p=n(),m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0}),g=`Checkbox`,[_,v]=r(g),[y,b]=_(g);function x(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:m}=e,[h,_]=a({prop:n,defaultProp:i??!1,onChange:l,caller:g}),[v,b]=f.useState(null),[x,S]=f.useState(null),C=f.useRef(!1),[w,T]=f.useReducer(e=>e+1,0),E=!v||!!s||!!v.closest(`form`),D={checked:h,disabled:o,setChecked:_,control:v,setControl:b,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:u,defaultChecked:!A(i)&&i,isFormControl:E,bubbleInput:x,setBubbleInput:S};return(0,p.jsx)(y,{scope:t,...D,children:k(m)?m(D):r})}h(x,`CheckboxProvider`);var S=`CheckboxTrigger`,C=f.forwardRef(h(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a){let{control:o,value:c,disabled:u,checked:d,required:m,setControl:g,setChecked:_,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:x,bubbleInput:C}=b(S,e),w=l(a,g),T=f.useRef(d);return f.useEffect(()=>{let e=o?.form;if(e){let t=h(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,_]),(0,p.jsx)(s.button,{type:`button`,role:`checkbox`,"aria-checked":A(d)?`mixed`:d,"aria-required":m,"data-state":j(d),"data-disabled":u?``:void 0,disabled:u,value:c,...r,ref:w,onKeyDown:i(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:i(n,e=>{y(),_(e=>A(e)?!0:!e),C&&x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},`CheckboxTrigger`)),w=f.forwardRef(h(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,p.jsx)(x,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(C,{...d,ref:t,__scopeCheckbox:n}),e&&(0,p.jsx)(O,{__scopeCheckbox:n})]})})},`Checkbox`)),T=`CheckboxIndicator`,E=f.forwardRef(h(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=b(T,n);return(0,p.jsx)(o,{present:r||A(a.checked)||a.checked===!0,children:(0,p.jsx)(s.span,{"data-state":j(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),D=`CheckboxBubbleInput`,O=f.forwardRef(h(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:a,hasConsumerStoppedPropagationRef:o,userInteractionCount:c,checked:d,defaultChecked:m,required:h,disabled:g,name:_,value:v,form:y,bubbleInput:x,setBubbleInput:S}=b(D,e),C=l(r,S),w=u(a),T=f.useRef(!1),E=f.useRef(d),O=f.useRef(c);f.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=c!==O.current;O.current=c;let i=E.current!==d;E.current=d;let a=!(r&&o.current);if(i&&n){T.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=A(d),n.call(e,!A(d)&&d),e.dispatchEvent(t),T.current=!1}},[x,d,o,c]);let k=f.useRef(!A(d)&&d);return(0,p.jsx)(s.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:_,value:v,form:y,...n,tabIndex:-1,ref:C,onClick:i(t,e=>{T.current&&e.stopPropagation()}),style:{...n.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function k(e){return typeof e==`function`}h(k,`isFunction`);function A(e){return e===`indeterminate`}h(A,`isIndeterminate`);function j(e){return A(e)?`indeterminate`:e?`checked`:`unchecked`}h(j,`getState`);function M({className:e,...t}){return(0,p.jsx)(w,{"data-slot":`checkbox`,className:c(`peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50`,e),...t,children:(0,p.jsx)(E,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,p.jsx)(d,{className:`size-3.5`})})})}export{M as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DBLzLNh2.js";var t={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};t.node;var n=e(t),r={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};r.node;var i=e(r);export{n,i as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DBLzLNh2.js";var t={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};t.node;var n=e(t);export{n as t};
@@ -0,0 +1 @@
1
+ function e(t){var n,r,i=``;if(typeof t==`string`||typeof t==`number`)i+=t;else if(typeof t==`object`){if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=` `),i+=r)}else for(r in t)t[r]&&(i&&(i+=` `),i+=r)}return i}function t(){for(var t,n,r=0,i=``,a=arguments.length;r<a;r++)(t=arguments[r])&&(n=e(t))&&(i&&(i+=` `),i+=n);return i}export{t};
@@ -0,0 +1 @@
1
+ import{Q as e,Z as t}from"./index-DIpd264Z.js";function n(e,t,n){return Math.min(n,Math.max(t,e))}function r(e,t){if(!e.startsWith(`#`)||e.length!==7)return e;let r=Number.parseInt(e.slice(1),16);if(!Number.isFinite(r))return e;let i=r>>16&255,a=r>>8&255,o=r&255,s=t>=0?255:0,c=n(Math.abs(t),0,1),l=e=>n(e,0,255).toString(16).padStart(2,`0`),u=e=>Math.round(e+(s-e)*c);return`#${l(u(i))}${l(u(a))}${l(u(o))}`}function i(n,i=!1){let a=[...i?t:e];if(n<=a.length)return a.slice(0,n);let o=[.2,-.18,.32,-.28],s=[...a],c=0;for(;s.length<n;){let e=a[c%a.length],t=o[c%o.length];s.push(r(e,t)),c+=1}return s}export{i as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,S as n}from"./vendor-query-_bHZuxEx.js";import{t as r}from"./createLucideIcon-DBLzLNh2.js";import{t as i}from"./useTranslation--56nHhlH.js";import{t as a}from"./button-BjVmmiGW.js";import{cn as o,ir as s}from"./index-DIpd264Z.js";var c={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};c.node;var l=r(c),u=e(t(),1);function d(e,t){if(typeof document.execCommand!=`function`)return!1;let n=t.container??document.body;if(!n)return!1;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement(`textarea`);i.value=e,i.setAttribute(`readonly`,``),i.setAttribute(`aria-hidden`,`true`),i.style.position=`fixed`,i.style.left=`-9999px`,i.style.top=`-9999px`,i.style.opacity=`0`,n.appendChild(i),i.focus(),i.select();try{return document.execCommand(`copy`)}catch{return!1}finally{i.parentNode===n&&n.removeChild(i),r?.isConnected&&r.focus()}}async function f(e,t={}){let n=window.isSecureContext&&typeof navigator.clipboard?.writeText==`function`?navigator.clipboard.writeText(e).then(()=>!0).catch(()=>!1):null;return d(e,t)?!0:n??!1}var p=n();function m({value:e,label:t,iconOnly:n=!1}){let{t:r}=i(),[c,d]=(0,u.useState)(!1),m=(0,u.useRef)(!1),h=(0,u.useRef)(null),g=t??r(`components.copyButton.copy`);(0,u.useEffect)(()=>(m.current=!0,()=>{m.current=!1,h.current!==null&&clearTimeout(h.current)}),[]);let _=async t=>{let n=t.currentTarget.closest(`[role='dialog']`);try{let t=await f(e,{container:n instanceof HTMLElement?n:void 0});if(!m.current)return;if(t){d(!0),o.success(r(`components.copyButton.toasts.copied`)),h.current!==null&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,d(!1)},1200);return}o.error(r(`components.copyButton.toasts.failed`))}catch{m.current&&o.error(r(`components.copyButton.toasts.failed`))}},v=r(`components.copyButton.copied`);return(0,p.jsxs)(a,{type:`button`,variant:`outline`,size:n?`icon-sm`:`sm`,onMouseDown:e=>e.preventDefault(),onClick:e=>void _(e),"aria-label":c?r(`components.copyButton.copiedAria`,{label:g}):g,title:c?v:g,children:[c?(0,p.jsx)(s,{className:n?`h-4 w-4`:`mr-2 h-4 w-4`}):(0,p.jsx)(l,{className:n?`h-4 w-4`:`mr-2 h-4 w-4`}),n?null:c?v:g]})}export{f as n,l as r,m as t};
@@ -0,0 +1 @@
1
+ import{S as e}from"./vendor-query-_bHZuxEx.js";import{n as t,t as n}from"./report-chart-card-BXDliwcc.js";import{t as r}from"./useTranslation--56nHhlH.js";import{j as i}from"./index-DIpd264Z.js";import{c as a,d as o,f as s,n as c,r as l,t as u,u as d}from"./lazy-recharts-Pv8p9ArM.js";import{t as f}from"./reports-page-CGCJeMHG.js";var p=e();function m({startDate:e,endDate:m,data:h}){let{t:g}=r(),_=f(e,m,h).map(e=>({date:e.date.slice(5),cost:e.costUsd}));return(0,p.jsx)(n,{title:g(`reports.charts.costByDay`),empty:h.length===0,children:(0,p.jsx)(a,{width:`100%`,height:`100%`,children:(0,p.jsxs)(c,{data:_,margin:{top:5,right:10,left:10,bottom:0},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:`costGrad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0%`,stopColor:`#3b82f6`,stopOpacity:.3}),(0,p.jsx)(`stop`,{offset:`100%`,stopColor:`#3b82f6`,stopOpacity:.05})]})}),(0,p.jsx)(l,{strokeDasharray:`3 3`,stroke:`hsl(var(--border))`,vertical:!1}),(0,p.jsx)(o,{dataKey:`date`,tick:{fontSize:10,fill:`var(--muted-foreground)`},axisLine:!1,tickLine:!1}),(0,p.jsx)(s,{tick:{fontSize:10,fill:`var(--muted-foreground)`},axisLine:!1,tickLine:!1,tickFormatter:i}),(0,p.jsx)(d,{content:(0,p.jsx)(t,{names:{cost:g(`reports.dailyBreakdown.columns.cost`)},formatValue:i})}),(0,p.jsx)(u,{type:`monotone`,dataKey:`cost`,stroke:`#3b82f6`,strokeWidth:2,fill:`url(#costGrad)`,dot:!1,activeDot:{r:4,strokeWidth:1.5,fill:`hsl(var(--popover))`}})]})})})}export{m as CostPerDayChart};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t}from"./vendor-query-_bHZuxEx.js";var n=e(t(),1),r=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function i(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:r(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var a=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function l(e){return e!=null}function u(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??c.width,a=e.size??e.height??c.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],u=[...e.name?[`lucide-${e.name}`]:[],...o],d=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?s(...d):s(`lucide`,...u,...d),p=t.absoluteStrokeWidth?Number(t.strokeWidth??c[`stroke-width`])*Number(e.size??e.width??c.width)/Number(t.size??t.width??c.width):t.strokeWidth??c[`stroke-width`];return[`svg`,{...Object.entries(c).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&l(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&l(t.width)&&{[r(`width`)]:t.width},...`height`in t&&l(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...f&&{[r(`class`)]:f},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function d(e,t={}){return u(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var f=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},p=(0,n.createContext)({}),m=()=>(0,n.useContext)(p),h=(0,n.forwardRef)(({color:e,size:t,width:r,height:i,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:c,className:l=``,children:u,iconNode:p=[],icon:h={node:p,aliases:[],size:24},...g},_)=>{let{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=m()??{},w=!!u||f(g),[T,E,D=[]]=d(h,{color:e??S,width:r??t??v,height:i??t??v,strokeWidth:a??y,absoluteStrokeWidth:o??b,nonScalingStroke:c??x,className:s(C,l),hasA11yProp:w,attributes:g});return(0,n.createElement)(T,{ref:_,...E},[...D.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(u)?u:[u]])});function g(e,t=[],r=[]){let a=typeof e==`string`?i(e,t,r):e,s=(0,n.forwardRef)(({className:e,...t},r)=>(0,n.createElement)(h,{ref:r,icon:a,className:e,...t}));return a.name&&(s.displayName=o(a.name)),s}export{g as t};