From 581ba2def3e58427d630148fa656cecadb16d347 Mon Sep 17 00:00:00 2001 From: yuneng-jiang Date: Sat, 17 Jan 2026 09:19:05 -0800 Subject: [PATCH] building ui --- .../_next/static/1-ApFSfWImQ15E9std-To/_buildManifest.js | 1 - .../out/_next/static/1-ApFSfWImQ15E9std-To/_ssgManifest.js | 1 - .../out/_next/static/chunks/1011-ebab1bc95b4aa615.js | 1 - .../out/_next/static/chunks/1108-7d554d3c02522125.js | 1 - .../out/_next/static/chunks/1274-e76373d2e507ce0d.js | 1 - .../out/_next/static/chunks/137-639f92dd476d20a9.js | 1 - .../out/_next/static/chunks/1803-3425d0cf2a3e4677.js | 1 - .../out/_next/static/chunks/1909-3c9de76bfc43e12c.js | 1 - .../out/_next/static/chunks/1918-00295dde1099fe9a.js | 1 - .../out/_next/static/chunks/1994-a4d0b99849c16b62.js | 1 - .../out/_next/static/chunks/2117-bb4323b3c0b11a1f.js | 2 -- .../out/_next/static/chunks/2202-6fd6882207f0e000.js | 1 - .../out/_next/static/chunks/2512-088e26ac9d573932.js | 1 - .../out/_next/static/chunks/2618-e3b2304a0f9519ff.js | 1 - .../out/_next/static/chunks/2703-dd215da2f0e066a4.js | 1 - .../out/_next/static/chunks/3492-e51306a03d83393c.js | 1 - .../out/_next/static/chunks/3507-14fb4e6cd377d7da.js | 1 - .../out/_next/static/chunks/3862-d5d4e83b9e0293bc.js | 1 - .../out/_next/static/chunks/4242-1670159d75c167a5.js | 1 - .../out/_next/static/chunks/4375-5cfcda7839272f23.js | 1 - .../out/_next/static/chunks/5144-568f2e27c5fa36d1.js | 1 - .../out/_next/static/chunks/5695-8a460f773f836c7c.js | 1 - .../out/_next/static/chunks/5766-127b95309f7ddbc4.js | 1 - .../out/_next/static/chunks/5975-a2924ccaea8442a9.js | 1 - .../out/_next/static/chunks/5992-e20acf7c5cf0486a.js | 1 - .../out/_next/static/chunks/6399-759f6cf22845f708.js | 1 - .../out/_next/static/chunks/6537-a0859fb62e73fda7.js | 1 - .../out/_next/static/chunks/6600-43a47ceabf838b3d.js | 1 - .../out/_next/static/chunks/6609-d93906f43161f066.js | 1 - .../out/_next/static/chunks/665-61c75c183699f983.js | 1 - .../out/_next/static/chunks/6653-f5732600f703fa47.js | 1 - .../out/_next/static/chunks/6685-13e80be9679226cf.js | 1 - .../out/_next/static/chunks/7038-d0da4f296b52ff2c.js | 1 - .../out/_next/static/chunks/7526-5af38ec64144fa99.js | 1 - .../out/_next/static/chunks/789-d313fdf35e0f5eb6.js | 1 - .../out/_next/static/chunks/8049-4d78caf73638c2f1.js | 1 - .../out/_next/static/chunks/8143-a060d3236c194d12.js | 1 - .../out/_next/static/chunks/816-e7500f06e5b83b0f.js | 1 - .../out/_next/static/chunks/9039-b27050bcf5fc1882.js | 1 - .../out/_next/static/chunks/9042-d8cd1ebe1dccc37b.js | 1 - .../out/_next/static/chunks/9051-95743f0e60203e26.js | 1 - .../out/_next/static/chunks/9140-28cd72e0efbaaf59.js | 1 - .../out/_next/static/chunks/9145-93c7b6227c4920ff.js | 1 - .../out/_next/static/chunks/9165-82d12d1c73da639d.js | 1 - .../out/_next/static/chunks/9264-f3f681df00e28eb2.js | 1 - .../out/_next/static/chunks/9409-6eefc92a7f8433ff.js | 1 - .../out/_next/static/chunks/9488-74f4cb042a3dc1fc.js | 1 - .../out/_next/static/chunks/9640-9fdc46ee926e66f7.js | 1 - .../out/_next/static/chunks/9818-3d784f3deb9777aa.js | 1 - .../app/(dashboard)/api-reference/page-e1a54745192ab0f1.js | 1 - .../experimental/api-playground/page-a38490363367933d.js | 1 - .../experimental/budgets/page-a029a8af3d496554.js | 1 - .../experimental/caching/page-61530c0f4001665a.js | 1 - .../experimental/old-usage/page-a5949d3354a4f639.js | 1 - .../experimental/prompts/page-e4cff298653ef6f9.js | 1 - .../experimental/tag-management/page-11f42a480e765a27.js | 1 - .../app/(dashboard)/guardrails/page-284c5c9327640cac.js | 1 - .../chunks/app/(dashboard)/layout-e63b613e46c2e033.js | 1 - .../chunks/app/(dashboard)/logs/page-821dd33748b68445.js | 1 - .../app/(dashboard)/model-hub/page-6f1db36e353a266f.js | 1 - .../models-and-endpoints/page-dcff39a77e29cce9.js | 1 - .../app/(dashboard)/organizations/page-0c1c703bea2034a6.js | 1 - .../app/(dashboard)/playground/page-21fce773237d12ff.js | 1 - .../settings/admin-settings/page-c3ba84cd9a49b3be.js | 1 - .../settings/logging-and-alerts/page-2b8465951c8dfc62.js | 1 - .../settings/router-settings/page-23f9ef91e9884ffa.js | 1 - .../(dashboard)/settings/ui-theme/page-e1d412e24a5858cf.js | 1 - .../chunks/app/(dashboard)/teams/page-7a508c7796ccf637.js | 1 - .../app/(dashboard)/test-key/page-6def303f12cbdd60.js | 1 - .../(dashboard)/tools/mcp-servers/page-3ebb650f7fce7002.js | 1 - .../tools/vector-stores/page-a9ed7f5a9452e84f.js | 1 - .../chunks/app/(dashboard)/usage/page-93e576db03dbe83e.js | 1 - .../chunks/app/(dashboard)/users/page-604640afeeb4e175.js | 1 - .../app/(dashboard)/virtual-keys/page-0db426a035946828.js | 1 - .../out/_next/static/chunks/app/layout-86876c52b469bf46.js | 1 - .../_next/static/chunks/app/login/page-a2acba32f200dd9b.js | 1 - .../chunks/app/mcp/oauth/callback/page-497caf09e19a569a.js | 1 - .../static/chunks/app/model_hub/page-05da063e203b6329.js | 1 - .../chunks/app/model_hub_table/page-7cd318abffd902f7.js | 1 - .../static/chunks/app/onboarding/page-0e0b8a8621f762fa.js | 1 - .../out/_next/static/chunks/app/page-3dd1d820cb216b26.js | 1 - .../out/_next/static/chunks/main-598d78e71630173a.js | 1 - .../out/_next/static/chunks/main-app-77a6ca3c04ee9adf.js | 1 - .../_experimental/out/_next/static/css/acd478299f7f6aa6.css | 3 --- .../out/{api-reference/index.html => api-reference.html} | 2 +- litellm/proxy/_experimental/out/api-reference.txt | 6 +++--- .../{api-playground/index.html => api-playground.html} | 2 +- .../proxy/_experimental/out/experimental/api-playground.txt | 6 +++--- .../out/experimental/{budgets/index.html => budgets.html} | 2 +- litellm/proxy/_experimental/out/experimental/budgets.txt | 6 +++--- .../out/experimental/{caching/index.html => caching.html} | 2 +- litellm/proxy/_experimental/out/experimental/caching.txt | 6 +++--- .../experimental/{old-usage/index.html => old-usage.html} | 2 +- litellm/proxy/_experimental/out/experimental/old-usage.txt | 6 +++--- .../out/experimental/{prompts/index.html => prompts.html} | 2 +- litellm/proxy/_experimental/out/experimental/prompts.txt | 6 +++--- .../_experimental/out/experimental/tag-management.html | 1 + .../proxy/_experimental/out/experimental/tag-management.txt | 6 +++--- .../out/experimental/tag-management/index.html | 1 - litellm/proxy/_experimental/out/guardrails.html | 1 + litellm/proxy/_experimental/out/guardrails.txt | 6 +++--- litellm/proxy/_experimental/out/index.html | 2 +- litellm/proxy/_experimental/out/index.txt | 4 ++-- .../_experimental/out/{login/index.html => login.html} | 2 +- litellm/proxy/_experimental/out/login.txt | 4 ++-- litellm/proxy/_experimental/out/logs.html | 1 + litellm/proxy/_experimental/out/logs.txt | 6 +++--- litellm/proxy/_experimental/out/logs/index.html | 1 - .../out/mcp/oauth/{callback/index.html => callback.html} | 2 +- litellm/proxy/_experimental/out/mcp/oauth/callback.txt | 4 ++-- .../out/{model-hub/index.html => model-hub.html} | 2 +- litellm/proxy/_experimental/out/model-hub.txt | 6 +++--- litellm/proxy/_experimental/out/model_hub.txt | 4 ++-- litellm/proxy/_experimental/out/model_hub_table.html | 1 + litellm/proxy/_experimental/out/model_hub_table.txt | 4 ++-- litellm/proxy/_experimental/out/model_hub_table/index.html | 1 - litellm/proxy/_experimental/out/models-and-endpoints.html | 1 + litellm/proxy/_experimental/out/models-and-endpoints.txt | 6 +++--- .../proxy/_experimental/out/models-and-endpoints/index.html | 1 - litellm/proxy/_experimental/out/onboarding.html | 1 + litellm/proxy/_experimental/out/onboarding.txt | 4 ++-- .../out/{organizations/index.html => organizations.html} | 2 +- litellm/proxy/_experimental/out/organizations.txt | 6 +++--- .../out/{playground/index.html => playground.html} | 2 +- litellm/proxy/_experimental/out/playground.txt | 6 +++--- .../{admin-settings/index.html => admin-settings.html} | 2 +- litellm/proxy/_experimental/out/settings/admin-settings.txt | 6 +++--- .../index.html => logging-and-alerts.html} | 2 +- .../proxy/_experimental/out/settings/logging-and-alerts.txt | 6 +++--- .../{router-settings/index.html => router-settings.html} | 2 +- .../proxy/_experimental/out/settings/router-settings.txt | 6 +++--- .../out/settings/{ui-theme/index.html => ui-theme.html} | 2 +- litellm/proxy/_experimental/out/settings/ui-theme.txt | 6 +++--- .../_experimental/out/{teams/index.html => teams.html} | 2 +- litellm/proxy/_experimental/out/teams.txt | 6 +++--- .../out/{test-key/index.html => test-key.html} | 2 +- litellm/proxy/_experimental/out/test-key.txt | 6 +++--- .../out/tools/{mcp-servers/index.html => mcp-servers.html} | 2 +- litellm/proxy/_experimental/out/tools/mcp-servers.txt | 6 +++--- .../tools/{vector-stores/index.html => vector-stores.html} | 2 +- litellm/proxy/_experimental/out/tools/vector-stores.txt | 6 +++--- litellm/proxy/_experimental/out/usage.html | 1 + litellm/proxy/_experimental/out/usage.txt | 6 +++--- litellm/proxy/_experimental/out/usage/index.html | 1 - litellm/proxy/_experimental/out/users.html | 1 + litellm/proxy/_experimental/out/users.txt | 6 +++--- litellm/proxy/_experimental/out/users/index.html | 1 - .../out/{virtual-keys/index.html => virtual-keys.html} | 2 +- litellm/proxy/_experimental/out/virtual-keys.txt | 6 +++--- 149 files changed, 113 insertions(+), 198 deletions(-) delete mode 100644 litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_buildManifest.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_ssgManifest.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1011-ebab1bc95b4aa615.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1108-7d554d3c02522125.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1274-e76373d2e507ce0d.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/137-639f92dd476d20a9.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1803-3425d0cf2a3e4677.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1909-3c9de76bfc43e12c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1918-00295dde1099fe9a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1994-a4d0b99849c16b62.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2117-bb4323b3c0b11a1f.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2202-6fd6882207f0e000.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2512-088e26ac9d573932.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2618-e3b2304a0f9519ff.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2703-dd215da2f0e066a4.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3492-e51306a03d83393c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3507-14fb4e6cd377d7da.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3862-d5d4e83b9e0293bc.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4242-1670159d75c167a5.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4375-5cfcda7839272f23.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5144-568f2e27c5fa36d1.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5695-8a460f773f836c7c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5766-127b95309f7ddbc4.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5975-a2924ccaea8442a9.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5992-e20acf7c5cf0486a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6399-759f6cf22845f708.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6537-a0859fb62e73fda7.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6600-43a47ceabf838b3d.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6609-d93906f43161f066.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/665-61c75c183699f983.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6653-f5732600f703fa47.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6685-13e80be9679226cf.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7038-d0da4f296b52ff2c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7526-5af38ec64144fa99.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/789-d313fdf35e0f5eb6.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8049-4d78caf73638c2f1.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8143-a060d3236c194d12.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/816-e7500f06e5b83b0f.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9039-b27050bcf5fc1882.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9042-d8cd1ebe1dccc37b.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9051-95743f0e60203e26.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9140-28cd72e0efbaaf59.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9145-93c7b6227c4920ff.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9165-82d12d1c73da639d.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9264-f3f681df00e28eb2.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9409-6eefc92a7f8433ff.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9488-74f4cb042a3dc1fc.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9640-9fdc46ee926e66f7.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9818-3d784f3deb9777aa.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/api-reference/page-e1a54745192ab0f1.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-a38490363367933d.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/page-a029a8af3d496554.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/page-61530c0f4001665a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/page-a5949d3354a4f639.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-e4cff298653ef6f9.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/page-11f42a480e765a27.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/page-284c5c9327640cac.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/layout-e63b613e46c2e033.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-821dd33748b68445.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-6f1db36e353a266f.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-dcff39a77e29cce9.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-0c1c703bea2034a6.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/playground/page-21fce773237d12ff.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-c3ba84cd9a49b3be.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-2b8465951c8dfc62.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/page-23f9ef91e9884ffa.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/page-e1d412e24a5858cf.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-7a508c7796ccf637.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/page-6def303f12cbdd60.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/page-3ebb650f7fce7002.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-a9ed7f5a9452e84f.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-93e576db03dbe83e.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-604640afeeb4e175.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-0db426a035946828.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/layout-86876c52b469bf46.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/login/page-a2acba32f200dd9b.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/mcp/oauth/callback/page-497caf09e19a569a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-05da063e203b6329.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-7cd318abffd902f7.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-0e0b8a8621f762fa.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-3dd1d820cb216b26.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/main-598d78e71630173a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/main-app-77a6ca3c04ee9adf.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/css/acd478299f7f6aa6.css rename litellm/proxy/_experimental/out/{api-reference/index.html => api-reference.html} (91%) rename litellm/proxy/_experimental/out/experimental/{api-playground/index.html => api-playground.html} (88%) rename litellm/proxy/_experimental/out/experimental/{budgets/index.html => budgets.html} (88%) rename litellm/proxy/_experimental/out/experimental/{caching/index.html => caching.html} (87%) rename litellm/proxy/_experimental/out/experimental/{old-usage/index.html => old-usage.html} (84%) rename litellm/proxy/_experimental/out/experimental/{prompts/index.html => prompts.html} (90%) create mode 100644 litellm/proxy/_experimental/out/experimental/tag-management.html delete mode 100644 litellm/proxy/_experimental/out/experimental/tag-management/index.html create mode 100644 litellm/proxy/_experimental/out/guardrails.html rename litellm/proxy/_experimental/out/{login/index.html => login.html} (87%) create mode 100644 litellm/proxy/_experimental/out/logs.html delete mode 100644 litellm/proxy/_experimental/out/logs/index.html rename litellm/proxy/_experimental/out/mcp/oauth/{callback/index.html => callback.html} (92%) rename litellm/proxy/_experimental/out/{model-hub/index.html => model-hub.html} (85%) create mode 100644 litellm/proxy/_experimental/out/model_hub_table.html delete mode 100644 litellm/proxy/_experimental/out/model_hub_table/index.html create mode 100644 litellm/proxy/_experimental/out/models-and-endpoints.html delete mode 100644 litellm/proxy/_experimental/out/models-and-endpoints/index.html create mode 100644 litellm/proxy/_experimental/out/onboarding.html rename litellm/proxy/_experimental/out/{organizations/index.html => organizations.html} (85%) rename litellm/proxy/_experimental/out/{playground/index.html => playground.html} (85%) rename litellm/proxy/_experimental/out/settings/{admin-settings/index.html => admin-settings.html} (88%) rename litellm/proxy/_experimental/out/settings/{logging-and-alerts/index.html => logging-and-alerts.html} (88%) rename litellm/proxy/_experimental/out/settings/{router-settings/index.html => router-settings.html} (88%) rename litellm/proxy/_experimental/out/settings/{ui-theme/index.html => ui-theme.html} (88%) rename litellm/proxy/_experimental/out/{teams/index.html => teams.html} (86%) rename litellm/proxy/_experimental/out/{test-key/index.html => test-key.html} (88%) rename litellm/proxy/_experimental/out/tools/{mcp-servers/index.html => mcp-servers.html} (89%) rename litellm/proxy/_experimental/out/tools/{vector-stores/index.html => vector-stores.html} (88%) create mode 100644 litellm/proxy/_experimental/out/usage.html delete mode 100644 litellm/proxy/_experimental/out/usage/index.html create mode 100644 litellm/proxy/_experimental/out/users.html delete mode 100644 litellm/proxy/_experimental/out/users/index.html rename litellm/proxy/_experimental/out/{virtual-keys/index.html => virtual-keys.html} (85%) diff --git a/litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_buildManifest.js deleted file mode 100644 index 1b732be87b0..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST={__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-cf5ca766ac8f493f.js"],sortedPages:["/_app","/_error"]},self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_ssgManifest.js deleted file mode 100644 index 5b3ff592fd4..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/1-ApFSfWImQ15E9std-To/_ssgManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1011-ebab1bc95b4aa615.js b/litellm/proxy/_experimental/out/_next/static/chunks/1011-ebab1bc95b4aa615.js deleted file mode 100644 index 2c722c865d2..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1011-ebab1bc95b4aa615.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1011],{21011:function(e,l,s){s.d(l,{Z:function(){return eh},g:function(){return ex}});var i=s(57437),a=s(10012),r=s(4260),t=s(7310),n=s.n(t),o=s(2265);let d=e=>{let{placeholder:l,value:s,onChange:t,icon:d,className:c}=e,[m,u]=(0,o.useState)(s);(0,o.useEffect)(()=>{u(s)},[s]);let x=(0,o.useMemo)(()=>n()(e=>t(e),300),[t]);(0,o.useEffect)(()=>()=>{x.cancel()},[x]);let h=(0,o.useCallback)(e=>{let l=e.target.value;u(l),x(l)},[x]);return(0,i.jsx)(r.default,{placeholder:l,value:m,onChange:h,prefix:d?(0,i.jsx)(d,{size:16,className:"text-gray-500"}):void 0,className:(0,a.cx)("w-64",c)})};var c=s(33866),m=s(5545),u=s(3577);let x=e=>{let{onClick:l,active:s,hasActiveFilters:a,label:r="Filters"}=e;return(0,i.jsx)(c.Z,{color:"blue",dot:a,children:(0,i.jsx)(m.ZP,{type:"default",onClick:l,icon:(0,i.jsx)(u.Z,{size:16}),className:s?"bg-gray-100":"",children:r})})};var h=s(69076);let _=e=>{let{onClick:l,label:s="Reset Filters"}=e;return(0,i.jsx)(m.ZP,{type:"default",onClick:l,icon:(0,i.jsx)(h.Z,{size:16}),children:s})};var g=s(73247),j=s(92369),p=e=>{let{filters:l,showFilters:s,onToggleFilters:a,onChange:r,onReset:t}=e,n=!!(l.org_id||l.org_alias);return(0,i.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,i.jsx)(d,{placeholder:"Search by Organization Name",value:l.org_alias,onChange:e=>r("org_alias",e),icon:g.Z,className:"w-64"}),(0,i.jsx)(x,{onClick:()=>a(!s),active:s,hasActiveFilters:n}),(0,i.jsx)(_,{onClick:t})]}),s&&(0,i.jsx)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:(0,i.jsx)(d,{placeholder:"Search by Organization ID",value:l.org_id,onChange:e=>r("org_id",e),icon:j.Z,className:"w-64"})})]})},v=s(15424),Z=s(23628),b=s(86462),f=s(47686),w=s(41649),z=s(78489),y=s(12514),N=s(49804),C=s(67101),S=s(47323),O=s(12485),k=s(18135),M=s(35242),I=s(29706),P=s(77991),F=s(21626),A=s(97214),T=s(28241),D=s(58834),L=s(69552),E=s(71876),R=s(84264),U=s(49566),B=s(10032),V=s(99981),q=s(22116),G=s(37592),W=s(59872),$=s(21609),J=s(39957),Q=s(46468),Y=s(97492),H=s(9114),K=s(19250),X=s(10900),ee=s(53410),el=s(74998),es=s(96761),ei=s(30401),ea=s(78867),er=s(33860),et=s(60131),en=s(24199),eo=s(36894),ed=s(97415),ec=s(47359),em=s(29299),eu=e=>{var l,s,a,t;let{organizationId:n,onClose:d,accessToken:c,is_org_admin:u,is_proxy_admin:x,userModels:h,editOrg:_}=e,[g,j]=(0,o.useState)(null),[p,v]=(0,o.useState)(!0),[Z]=B.Z.useForm(),[b,f]=(0,o.useState)(!1),[N,V]=(0,o.useState)(!1),[q,$]=(0,o.useState)(!1),[J,eu]=(0,o.useState)(null),[ex,eh]=(0,o.useState)({}),[e_,eg]=(0,o.useState)(!1),ej=u||x,{data:ep}=(0,ec.y)(),ev=(0,o.useMemo)(()=>(0,em.O)(ep),[ep]),eZ=async()=>{try{if(v(!0),!c)return;let e=await (0,K.organizationInfoCall)(c,n);j(e)}catch(e){H.Z.fromBackend("Failed to load organization information"),console.error("Error fetching organization info:",e)}finally{v(!1)}};(0,o.useEffect)(()=>{eZ()},[n,c]);let eb=async e=>{try{if(null==c)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,K.organizationMemberAddCall)(c,n,l),H.Z.success("Organization member added successfully"),V(!1),Z.resetFields(),eZ()}catch(e){H.Z.fromBackend("Failed to add organization member"),console.error("Error adding organization member:",e)}},ef=async e=>{try{if(!c)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,K.organizationMemberUpdateCall)(c,n,l),H.Z.success("Organization member updated successfully"),$(!1),Z.resetFields(),eZ()}catch(e){H.Z.fromBackend("Failed to update organization member"),console.error("Error updating organization member:",e)}},ew=async e=>{try{if(!c)return;await (0,K.organizationMemberDeleteCall)(c,n,e.user_id),H.Z.success("Organization member deleted successfully"),$(!1),Z.resetFields(),eZ()}catch(e){H.Z.fromBackend("Failed to delete organization member"),console.error("Error deleting organization member:",e)}},ez=async e=>{try{if(!c)return;eg(!0);let l={organization_id:n,organization_alias:e.organization_alias,models:e.models,litellm_budget_table:{tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,max_budget:e.max_budget,budget_duration:e.budget_duration},metadata:e.metadata?JSON.parse(e.metadata):null};if((void 0!==e.vector_stores||void 0!==e.mcp_servers_and_groups)&&(l.object_permission={...null==g?void 0:g.object_permission,vector_stores:e.vector_stores||[]},void 0!==e.mcp_servers_and_groups)){let{servers:s,accessGroups:i}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};s&&s.length>0&&(l.object_permission.mcp_servers=s),i&&i.length>0&&(l.object_permission.mcp_access_groups=i)}await (0,K.organizationUpdateCall)(c,l),H.Z.success("Organization settings updated successfully"),f(!1),eZ()}catch(e){H.Z.fromBackend("Failed to update organization settings"),console.error("Error updating organization:",e)}finally{eg(!1)}};if(p)return(0,i.jsx)("div",{className:"p-4",children:"Loading..."});if(!g)return(0,i.jsx)("div",{className:"p-4",children:"Organization not found"});let ey=async(e,l)=>{await (0,W.vQ)(e)&&(eh(e=>({...e,[l]:!0})),setTimeout(()=>{eh(e=>({...e,[l]:!1}))},2e3))};return(0,i.jsxs)("div",{className:"w-full h-screen p-4 bg-white",children:[(0,i.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,i.jsxs)("div",{children:[(0,i.jsx)(z.Z,{icon:X.Z,onClick:d,variant:"light",className:"mb-4",children:"Back to Organizations"}),(0,i.jsx)(es.Z,{children:g.organization_alias}),(0,i.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,i.jsx)(R.Z,{className:"text-gray-500 font-mono",children:g.organization_id}),(0,i.jsx)(m.ZP,{type:"text",size:"small",icon:ex["org-id"]?(0,i.jsx)(ei.Z,{size:12}):(0,i.jsx)(ea.Z,{size:12}),onClick:()=>ey(g.organization_id,"org-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ex["org-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,i.jsxs)(k.Z,{defaultIndex:_?2:0,children:[(0,i.jsxs)(M.Z,{className:"mb-4",children:[(0,i.jsx)(O.Z,{children:"Overview"}),(0,i.jsx)(O.Z,{children:"Members"}),(0,i.jsx)(O.Z,{children:"Settings"})]}),(0,i.jsxs)(P.Z,{children:[(0,i.jsx)(I.Z,{children:(0,i.jsxs)(C.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,i.jsxs)(y.Z,{children:[(0,i.jsx)(R.Z,{children:"Organization Details"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(R.Z,{children:["Created: ",new Date(g.created_at).toLocaleDateString()]}),(0,i.jsxs)(R.Z,{children:["Updated: ",new Date(g.updated_at).toLocaleDateString()]}),(0,i.jsxs)(R.Z,{children:["Created By: ",g.created_by]})]})]}),(0,i.jsxs)(y.Z,{children:[(0,i.jsx)(R.Z,{children:"Budget Status"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(es.Z,{children:["$",(0,W.pw)(g.spend,4)]}),(0,i.jsxs)(R.Z,{children:["of"," ",null===g.litellm_budget_table.max_budget?"Unlimited":"$".concat((0,W.pw)(g.litellm_budget_table.max_budget,4))]}),g.litellm_budget_table.budget_duration&&(0,i.jsxs)(R.Z,{className:"text-gray-500",children:["Reset: ",g.litellm_budget_table.budget_duration]})]})]}),(0,i.jsxs)(y.Z,{children:[(0,i.jsx)(R.Z,{children:"Rate Limits"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(R.Z,{children:["TPM: ",g.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,i.jsxs)(R.Z,{children:["RPM: ",g.litellm_budget_table.rpm_limit||"Unlimited"]}),g.litellm_budget_table.max_parallel_requests&&(0,i.jsxs)(R.Z,{children:["Max Parallel Requests: ",g.litellm_budget_table.max_parallel_requests]})]})]}),(0,i.jsxs)(y.Z,{children:[(0,i.jsx)(R.Z,{children:"Models"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===g.models.length?(0,i.jsx)(w.Z,{color:"red",children:"All proxy models"}):g.models.map((e,l)=>(0,i.jsx)(w.Z,{color:"red",children:e},l))})]}),(0,i.jsxs)(y.Z,{children:[(0,i.jsx)(R.Z,{children:"Teams"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:null===(l=g.teams)||void 0===l?void 0:l.map((e,l)=>(0,i.jsx)(w.Z,{color:"red",children:ev[e.team_id]||e.team_id},l))})]}),(0,i.jsx)(et.Z,{objectPermission:g.object_permission,variant:"card",accessToken:c})]})}),(0,i.jsx)(I.Z,{children:(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsx)(y.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[75vh]",children:(0,i.jsxs)(F.Z,{children:[(0,i.jsx)(D.Z,{children:(0,i.jsxs)(E.Z,{children:[(0,i.jsx)(L.Z,{children:"User ID"}),(0,i.jsx)(L.Z,{children:"Role"}),(0,i.jsx)(L.Z,{children:"Spend"}),(0,i.jsx)(L.Z,{children:"Created At"}),(0,i.jsx)(L.Z,{})]})}),(0,i.jsx)(A.Z,{children:g.members&&g.members.length>0?g.members.map((e,l)=>(0,i.jsxs)(E.Z,{children:[(0,i.jsx)(T.Z,{children:(0,i.jsx)(R.Z,{className:"font-mono",children:e.user_id})}),(0,i.jsx)(T.Z,{children:(0,i.jsx)(R.Z,{className:"font-mono",children:e.user_role})}),(0,i.jsx)(T.Z,{children:(0,i.jsxs)(R.Z,{children:["$",(0,W.pw)(e.spend,4)]})}),(0,i.jsx)(T.Z,{children:(0,i.jsx)(R.Z,{children:new Date(e.created_at).toLocaleString()})}),(0,i.jsx)(T.Z,{children:ej&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(S.Z,{icon:ee.Z,size:"sm",onClick:()=>{eu({role:e.user_role,user_email:e.user_email,user_id:e.user_id}),$(!0)}}),(0,i.jsx)(S.Z,{icon:el.Z,size:"sm",onClick:()=>{ew(e)}})]})})]},l)):(0,i.jsx)(E.Z,{children:(0,i.jsx)(T.Z,{colSpan:5,className:"text-center py-8",children:(0,i.jsx)(R.Z,{className:"text-gray-500",children:"No members found"})})})})]})}),ej&&(0,i.jsx)(z.Z,{onClick:()=>{V(!0)},children:"Add Member"})]})}),(0,i.jsx)(I.Z,{children:(0,i.jsxs)(y.Z,{className:"overflow-y-auto max-h-[65vh]",children:[(0,i.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,i.jsx)(es.Z,{children:"Organization Settings"}),ej&&!b&&(0,i.jsx)(z.Z,{onClick:()=>f(!0),children:"Edit Settings"})]}),b?(0,i.jsxs)(B.Z,{form:Z,onFinish:ez,initialValues:{organization_alias:g.organization_alias,models:g.models,tpm_limit:g.litellm_budget_table.tpm_limit,rpm_limit:g.litellm_budget_table.rpm_limit,max_budget:g.litellm_budget_table.max_budget,budget_duration:g.litellm_budget_table.budget_duration,metadata:g.metadata?JSON.stringify(g.metadata,null,2):"",vector_stores:(null===(s=g.object_permission)||void 0===s?void 0:s.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(a=g.object_permission)||void 0===a?void 0:a.mcp_servers)||[],accessGroups:(null===(t=g.object_permission)||void 0===t?void 0:t.mcp_access_groups)||[]}},layout:"vertical",children:[(0,i.jsx)(B.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,i.jsx)(U.Z,{})}),(0,i.jsx)(B.Z.Item,{label:"Models",name:"models",children:(0,i.jsxs)(G.default,{mode:"multiple",placeholder:"Select models",children:[(0,i.jsx)(G.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),h.map(e=>(0,i.jsx)(G.default.Option,{value:e,children:(0,Q.W0)(e)},e))]})}),(0,i.jsx)(B.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,i.jsx)(en.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,i.jsx)(B.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,i.jsxs)(G.default,{placeholder:"n/a",children:[(0,i.jsx)(G.default.Option,{value:"24h",children:"daily"}),(0,i.jsx)(G.default.Option,{value:"7d",children:"weekly"}),(0,i.jsx)(G.default.Option,{value:"30d",children:"monthly"})]})}),(0,i.jsx)(B.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,i.jsx)(en.Z,{step:1,style:{width:"100%"}})}),(0,i.jsx)(B.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,i.jsx)(en.Z,{step:1,style:{width:"100%"}})}),(0,i.jsx)(B.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,i.jsx)(ed.Z,{onChange:e=>Z.setFieldValue("vector_stores",e),value:Z.getFieldValue("vector_stores"),accessToken:c||"",placeholder:"Select vector stores"})}),(0,i.jsx)(B.Z.Item,{label:"MCP Servers & Access Groups",name:"mcp_servers_and_groups",children:(0,i.jsx)(Y.Z,{onChange:e=>Z.setFieldValue("mcp_servers_and_groups",e),value:Z.getFieldValue("mcp_servers_and_groups"),accessToken:c||"",placeholder:"Select MCP servers and access groups"})}),(0,i.jsx)(B.Z.Item,{label:"Metadata",name:"metadata",children:(0,i.jsx)(r.default.TextArea,{rows:4})}),(0,i.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,i.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,i.jsx)(z.Z,{variant:"secondary",onClick:()=>f(!1),disabled:e_,children:"Cancel"}),(0,i.jsx)(z.Z,{type:"submit",loading:e_,children:"Save Changes"})]})})]}):(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(R.Z,{className:"font-medium",children:"Organization Name"}),(0,i.jsx)("div",{children:g.organization_alias})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(R.Z,{className:"font-medium",children:"Organization ID"}),(0,i.jsx)("div",{className:"font-mono",children:g.organization_id})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(R.Z,{className:"font-medium",children:"Created At"}),(0,i.jsx)("div",{children:new Date(g.created_at).toLocaleString()})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(R.Z,{className:"font-medium",children:"Models"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:g.models.map((e,l)=>(0,i.jsx)(w.Z,{color:"red",children:e},l))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(R.Z,{className:"font-medium",children:"Rate Limits"}),(0,i.jsxs)("div",{children:["TPM: ",g.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,i.jsxs)("div",{children:["RPM: ",g.litellm_budget_table.rpm_limit||"Unlimited"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(R.Z,{className:"font-medium",children:"Budget"}),(0,i.jsxs)("div",{children:["Max:"," ",null!==g.litellm_budget_table.max_budget?"$".concat((0,W.pw)(g.litellm_budget_table.max_budget,4)):"No Limit"]}),(0,i.jsxs)("div",{children:["Reset: ",g.litellm_budget_table.budget_duration||"Never"]})]}),(0,i.jsx)(et.Z,{objectPermission:g.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:c})]})]})})]})]}),(0,i.jsx)(er.Z,{isVisible:N,onCancel:()=>V(!1),onSubmit:eb,accessToken:c,title:"Add Organization Member",roles:[{label:"org_admin",value:"org_admin",description:"Can add and remove members, and change their roles."},{label:"internal_user",value:"internal_user",description:"Can view/create keys for themselves within organization."},{label:"internal_user_viewer",value:"internal_user_viewer",description:"Can only view their keys within organization."}],defaultRole:"internal_user"}),(0,i.jsx)(eo.Z,{visible:q,onCancel:()=>$(!1),onSubmit:ef,initialData:J,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Org Admin",value:"org_admin"},{label:"Internal User",value:"internal_user"},{label:"Internal User Viewer",value:"internal_user_viewer"}]}})]})};let ex=async function(e,l){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;l(await (0,K.organizationListCall)(e,s,i))};var eh=e=>{let{organizations:l,userRole:s,userModels:a,accessToken:t,lastRefreshed:n,handleRefreshClick:d,currentOrg:c,guardrailsList:m=[],setOrganizations:u,premiumUser:x}=e,[h,_]=(0,o.useState)(null),[g,j]=(0,o.useState)(!1),[X,ee]=(0,o.useState)(!1),[el,es]=(0,o.useState)(null),[ei,ea]=(0,o.useState)(!1),[er,et]=(0,o.useState)(!1),[eo]=B.Z.useForm(),[ec,em]=(0,o.useState)({}),[eh,e_]=(0,o.useState)(!1),[eg,ej]=(0,o.useState)({org_id:"",org_alias:"",sort_by:"created_at",sort_order:"desc"}),ep=e=>{e&&(es(e),ee(!0))},ev=async()=>{if(el&&t)try{ea(!0),await (0,K.organizationDeleteCall)(t,el),H.Z.success("Organization deleted successfully"),ee(!1),es(null),await ex(t,u,eg.org_id||null,eg.org_alias||null)}catch(e){console.error("Error deleting organization:",e)}finally{ea(!1)}},eZ=async e=>{try{var l,s,i,a;if(!t)return;console.log("values in organizations new create call: ".concat(JSON.stringify(e))),(e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0||e.allowed_mcp_servers_and_groups&&((null===(l=e.allowed_mcp_servers_and_groups.servers)||void 0===l?void 0:l.length)>0||(null===(s=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===s?void 0:s.length)>0))&&(e.object_permission={},e.allowed_vector_store_ids&&e.allowed_vector_store_ids.length>0&&(e.object_permission.vector_stores=e.allowed_vector_store_ids,delete e.allowed_vector_store_ids),e.allowed_mcp_servers_and_groups&&((null===(i=e.allowed_mcp_servers_and_groups.servers)||void 0===i?void 0:i.length)>0&&(e.object_permission.mcp_servers=e.allowed_mcp_servers_and_groups.servers),(null===(a=e.allowed_mcp_servers_and_groups.accessGroups)||void 0===a?void 0:a.length)>0&&(e.object_permission.mcp_access_groups=e.allowed_mcp_servers_and_groups.accessGroups),delete e.allowed_mcp_servers_and_groups)),await (0,K.organizationCreateCall)(t,e),H.Z.success("Organization created successfully"),et(!1),eo.resetFields(),ex(t,u,eg.org_id||null,eg.org_alias||null)}catch(e){console.error("Error creating organization:",e)}};return x?(0,i.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[(0,i.jsx)(C.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,i.jsxs)(N.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"===s||"Org Admin"===s)&&(0,i.jsx)(z.Z,{className:"w-fit",onClick:()=>et(!0),children:"+ Create New Organization"}),h?(0,i.jsx)(eu,{organizationId:h,onClose:()=>{_(null),j(!1)},accessToken:t,is_org_admin:!0,is_proxy_admin:"Admin"===s,userModels:a,editOrg:g}):(0,i.jsxs)(k.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,i.jsxs)(M.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,i.jsx)("div",{className:"flex",children:(0,i.jsx)(O.Z,{children:"Your Organizations"})}),(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[n&&(0,i.jsxs)(R.Z,{children:["Last Refreshed: ",n]}),(0,i.jsx)(S.Z,{icon:Z.Z,variant:"shadow",size:"xs",className:"self-center",onClick:d})]})]}),(0,i.jsx)(P.Z,{children:(0,i.jsxs)(I.Z,{children:[(0,i.jsx)(R.Z,{children:"Click on “Organization ID” to view organization details."}),(0,i.jsx)(C.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,i.jsx)(N.Z,{numColSpan:1,children:(0,i.jsxs)(y.Z,{className:"w-full mx-auto flex-auto overflow-hidden overflow-y-auto max-h-[50vh]",children:[(0,i.jsx)("div",{className:"border-b px-6 py-4",children:(0,i.jsx)("div",{className:"flex flex-col space-y-4",children:(0,i.jsx)(p,{filters:eg,showFilters:eh,onToggleFilters:e_,onChange:(e,l)=>{let s={...eg,[e]:l};ej(s),t&&(0,K.organizationListCall)(t,s.org_id||null,s.org_alias||null).then(e=>{e&&u(e)}).catch(e=>{console.error("Error fetching organizations:",e)})},onReset:()=>{ej({org_id:"",org_alias:"",sort_by:"created_at",sort_order:"desc"}),t&&(0,K.organizationListCall)(t,null,null).then(e=>{e&&u(e)}).catch(e=>{console.error("Error fetching organizations:",e)})}})})}),(0,i.jsxs)(F.Z,{children:[(0,i.jsx)(D.Z,{children:(0,i.jsxs)(E.Z,{children:[(0,i.jsx)(L.Z,{children:"Organization ID"}),(0,i.jsx)(L.Z,{children:"Organization Name"}),(0,i.jsx)(L.Z,{children:"Created"}),(0,i.jsx)(L.Z,{children:"Spend (USD)"}),(0,i.jsx)(L.Z,{children:"Budget (USD)"}),(0,i.jsx)(L.Z,{children:"Models"}),(0,i.jsx)(L.Z,{children:"TPM / RPM Limits"}),(0,i.jsx)(L.Z,{children:"Info"}),(0,i.jsx)(L.Z,{children:"Actions"})]})}),(0,i.jsx)(A.Z,{children:l&&l.length>0?l.sort((e,l)=>new Date(l.created_at).getTime()-new Date(e.created_at).getTime()).map(e=>{var l,a,r,t,n,o,d,c,m;return(0,i.jsxs)(E.Z,{children:[(0,i.jsx)(T.Z,{children:(0,i.jsx)("div",{className:"overflow-hidden",children:(0,i.jsx)(V.Z,{title:e.organization_id,children:(0,i.jsxs)(z.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>_(e.organization_id),children:[null===(l=e.organization_id)||void 0===l?void 0:l.slice(0,7),"..."]})})})}),(0,i.jsx)(T.Z,{children:e.organization_alias}),(0,i.jsx)(T.Z,{children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,i.jsx)(T.Z,{children:(0,W.pw)(e.spend,4)}),(0,i.jsx)(T.Z,{children:(null===(a=e.litellm_budget_table)||void 0===a?void 0:a.max_budget)!==null&&(null===(r=e.litellm_budget_table)||void 0===r?void 0:r.max_budget)!==void 0?null===(t=e.litellm_budget_table)||void 0===t?void 0:t.max_budget:"No limit"}),(0,i.jsx)(T.Z,{style:{maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:e.models.length>3?"px-0":"",children:(0,i.jsx)("div",{className:"flex flex-col",children:Array.isArray(e.models)?(0,i.jsx)("div",{className:"flex flex-col",children:0===e.models.length?(0,i.jsx)(w.Z,{size:"xs",className:"mb-1",color:"red",children:(0,i.jsx)(R.Z,{children:"All Proxy Models"})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"flex items-start",children:[e.models.length>3&&(0,i.jsx)("div",{children:(0,i.jsx)(S.Z,{icon:ec[e.organization_id||""]?b.Z:f.Z,className:"cursor-pointer",size:"xs",onClick:()=>{em(l=>({...l,[e.organization_id||""]:!l[e.organization_id||""]}))}})}),(0,i.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.models.slice(0,3).map((e,l)=>"all-proxy-models"===e?(0,i.jsx)(w.Z,{size:"xs",color:"red",children:(0,i.jsx)(R.Z,{children:"All Proxy Models"})},l):(0,i.jsx)(w.Z,{size:"xs",color:"blue",children:(0,i.jsx)(R.Z,{children:e.length>30?"".concat((0,Q.W0)(e).slice(0,30),"..."):(0,Q.W0)(e)})},l)),e.models.length>3&&!ec[e.organization_id||""]&&(0,i.jsx)(w.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,i.jsxs)(R.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),ec[e.organization_id||""]&&(0,i.jsx)("div",{className:"flex flex-wrap gap-1",children:e.models.slice(3).map((e,l)=>"all-proxy-models"===e?(0,i.jsx)(w.Z,{size:"xs",color:"red",children:(0,i.jsx)(R.Z,{children:"All Proxy Models"})},l+3):(0,i.jsx)(w.Z,{size:"xs",color:"blue",children:(0,i.jsx)(R.Z,{children:e.length>30?"".concat((0,Q.W0)(e).slice(0,30),"..."):(0,Q.W0)(e)})},l+3))})]})]})})}):null})}),(0,i.jsx)(T.Z,{children:(0,i.jsxs)(R.Z,{children:["TPM:"," ",(null===(n=e.litellm_budget_table)||void 0===n?void 0:n.tpm_limit)?null===(o=e.litellm_budget_table)||void 0===o?void 0:o.tpm_limit:"Unlimited",(0,i.jsx)("br",{}),"RPM:"," ",(null===(d=e.litellm_budget_table)||void 0===d?void 0:d.rpm_limit)?null===(c=e.litellm_budget_table)||void 0===c?void 0:c.rpm_limit:"Unlimited"]})}),(0,i.jsx)(T.Z,{children:(0,i.jsxs)(R.Z,{children:[(null===(m=e.members)||void 0===m?void 0:m.length)||0," Members"]})}),(0,i.jsx)(T.Z,{children:"Admin"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J.Z,{variant:"Edit",tooltipText:"Edit organization",onClick:()=>{_(e.organization_id),j(!0)}}),(0,i.jsx)(J.Z,{variant:"Delete",tooltipText:"Delete organization",onClick:()=>ep(e.organization_id)})]})})]},e.organization_id)}):null})]})]})})})]})})]})]})}),(0,i.jsx)(q.Z,{title:"Create Organization",visible:er,width:800,footer:null,onCancel:()=>{et(!1),eo.resetFields()},children:(0,i.jsxs)(B.Z,{form:eo,onFinish:eZ,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,i.jsx)(B.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,i.jsx)(U.Z,{placeholder:""})}),(0,i.jsx)(B.Z.Item,{label:"Models",name:"models",children:(0,i.jsxs)(G.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,i.jsx)(G.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),a&&a.length>0&&a.map(e=>(0,i.jsx)(G.default.Option,{value:e,children:(0,Q.W0)(e)},e))]})}),(0,i.jsx)(B.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,i.jsx)(en.Z,{step:.01,precision:2,width:200})}),(0,i.jsx)(B.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,i.jsxs)(G.default,{defaultValue:null,placeholder:"n/a",children:[(0,i.jsx)(G.default.Option,{value:"24h",children:"daily"}),(0,i.jsx)(G.default.Option,{value:"7d",children:"weekly"}),(0,i.jsx)(G.default.Option,{value:"30d",children:"monthly"})]})}),(0,i.jsx)(B.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,i.jsx)(en.Z,{step:1,width:400})}),(0,i.jsx)(B.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,i.jsx)(en.Z,{step:1,width:400})}),(0,i.jsx)(B.Z.Item,{label:(0,i.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,i.jsx)(V.Z,{title:"Select which vector stores this organization can access by default. Leave empty for access to all vector stores",children:(0,i.jsx)(v.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_vector_store_ids",className:"mt-4",help:"Select vector stores this organization can access. Leave empty for access to all vector stores",children:(0,i.jsx)(ed.Z,{onChange:e=>eo.setFieldValue("allowed_vector_store_ids",e),value:eo.getFieldValue("allowed_vector_store_ids"),accessToken:t||"",placeholder:"Select vector stores (optional)"})}),(0,i.jsx)(B.Z.Item,{label:(0,i.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,i.jsx)(V.Z,{title:"Select which MCP servers and access groups this organization can access by default.",children:(0,i.jsx)(v.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_mcp_servers_and_groups",className:"mt-4",help:"Select MCP servers and access groups this organization can access.",children:(0,i.jsx)(Y.Z,{onChange:e=>eo.setFieldValue("allowed_mcp_servers_and_groups",e),value:eo.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:t||"",placeholder:"Select MCP servers and access groups (optional)"})}),(0,i.jsx)(B.Z.Item,{label:"Metadata",name:"metadata",children:(0,i.jsx)(r.default.TextArea,{rows:4})}),(0,i.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,i.jsx)(z.Z,{type:"submit",children:"Create Organization"})})]})}),(0,i.jsx)($.Z,{isOpen:X,title:"Delete Organization?",message:"Are you sure you want to delete this organization? This action cannot be undone.",resourceInformationTitle:"Organization Information",resourceInformation:[{label:"Organization ID",value:el,code:!0}],onCancel:()=>{ee(!1),es(null)},onOk:ev,confirmLoading:ei})]}):(0,i.jsx)("div",{children:(0,i.jsxs)(R.Z,{children:["This is a LiteLLM Enterprise feature, and requires a valid key to use. Get a trial key"," ",(0,i.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})})}},29299:function(e,l,s){s.d(l,{O:function(){return i},o:function(){return a}});let i=e=>e?e.reduce((e,l)=>(e[l.team_id]=l.team_alias,e),{}):{},a=(e,l)=>{let s=l.find(l=>l.team_id===e);return s?s.team_alias:null}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1108-7d554d3c02522125.js b/litellm/proxy/_experimental/out/_next/static/chunks/1108-7d554d3c02522125.js deleted file mode 100644 index bf079f880be..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1108-7d554d3c02522125.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1108],{40278:function(t,e,r){"use strict";r.d(e,{Z:function(){return S}});var n=r(5853),o=r(7084),i=r(26898),a=r(13241),u=r(1153),c=r(2265),l=r(47625),s=r(93765),f=r(31699),p=r(97059),h=r(62994),d=r(25311),y=(0,s.z)({chartName:"BarChart",GraphicalChild:f.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:p.K},{axisType:"yAxis",AxisComp:h.B}],formatAxisMap:d.t9}),v=r(56940),m=r(26680),b=r(8147),g=r(22190),x=r(65278),w=r(98593),O=r(92666),j=r(32644);let S=c.forwardRef((t,e)=>{let{data:r=[],categories:s=[],index:d,colors:S=i.s,valueFormatter:P=u.Cj,layout:E="horizontal",stack:k=!1,relative:A=!1,startEndOnly:M=!1,animationDuration:T=900,showAnimation:_=!1,showXAxis:C=!0,showYAxis:N=!0,yAxisWidth:D=56,intervalType:I="equidistantPreserveStart",showTooltip:L=!0,showLegend:B=!0,showGridLines:R=!0,autoMinValue:z=!1,minValue:U,maxValue:$,allowDecimals:F=!0,noDataText:q,onValueChange:Z,enableLegendSlider:W=!1,customTooltip:Y,rotateLabelX:H,barCategoryGap:X,tickGap:G=5,xAxisLabel:V,yAxisLabel:K,className:Q,padding:J=C||N?{left:20,right:20}:{left:0,right:0}}=t,tt=(0,n._T)(t,["data","categories","index","colors","valueFormatter","layout","stack","relative","startEndOnly","animationDuration","showAnimation","showXAxis","showYAxis","yAxisWidth","intervalType","showTooltip","showLegend","showGridLines","autoMinValue","minValue","maxValue","allowDecimals","noDataText","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","barCategoryGap","tickGap","xAxisLabel","yAxisLabel","className","padding"]),[te,tr]=(0,c.useState)(60),tn=(0,j.me)(s,S),[to,ti]=c.useState(void 0),[ta,tu]=(0,c.useState)(void 0),tc=!!Z;function tl(t,e,r){var n,o,i,a;r.stopPropagation(),Z&&((0,j.vZ)(to,Object.assign(Object.assign({},t.payload),{value:t.value}))?(tu(void 0),ti(void 0),null==Z||Z(null)):(tu(null===(o=null===(n=t.tooltipPayload)||void 0===n?void 0:n[0])||void 0===o?void 0:o.dataKey),ti(Object.assign(Object.assign({},t.payload),{value:t.value})),null==Z||Z(Object.assign({eventType:"bar",categoryClicked:null===(a=null===(i=t.tooltipPayload)||void 0===i?void 0:i[0])||void 0===a?void 0:a.dataKey},t.payload))))}let ts=(0,j.i4)(z,U,$);return c.createElement("div",Object.assign({ref:e,className:(0,a.q)("w-full h-80",Q)},tt),c.createElement(l.h,{className:"h-full w-full"},(null==r?void 0:r.length)?c.createElement(y,{barCategoryGap:X,data:r,stackOffset:k?"sign":A?"expand":"none",layout:"vertical"===E?"vertical":"horizontal",onClick:tc&&(ta||to)?()=>{ti(void 0),tu(void 0),null==Z||Z(null)}:void 0,margin:{bottom:V?30:void 0,left:K?20:void 0,right:K?5:void 0,top:5}},R?c.createElement(v.q,{className:(0,a.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:"vertical"!==E,vertical:"vertical"===E}):null,"vertical"!==E?c.createElement(p.K,{padding:J,hide:!C,dataKey:d,interval:M?"preserveStartEnd":I,tick:{transform:"translate(0, 6)"},ticks:M?[r[0][d],r[r.length-1][d]]:void 0,fill:"",stroke:"",className:(0,a.q)("mt-4 text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,angle:null==H?void 0:H.angle,dy:null==H?void 0:H.verticalShift,height:null==H?void 0:H.xAxisHeight,minTickGap:G},V&&c.createElement(m._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},V)):c.createElement(p.K,{hide:!C,type:"number",tick:{transform:"translate(-3, 0)"},domain:ts,fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,tickFormatter:P,minTickGap:G,allowDecimals:F,angle:null==H?void 0:H.angle,dy:null==H?void 0:H.verticalShift,height:null==H?void 0:H.xAxisHeight},V&&c.createElement(m._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},V)),"vertical"!==E?c.createElement(h.B,{width:D,hide:!N,axisLine:!1,tickLine:!1,type:"number",domain:ts,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:A?t=>"".concat((100*t).toString()," %"):P,allowDecimals:F},K&&c.createElement(m._,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},K)):c.createElement(h.B,{width:D,hide:!N,dataKey:d,axisLine:!1,tickLine:!1,ticks:M?[r[0][d],r[r.length-1][d]]:void 0,type:"category",interval:"preserveStartEnd",tick:{transform:"translate(0, 6)"},fill:"",stroke:"",className:(0,a.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content")},K&&c.createElement(m._,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},K)),c.createElement(b.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{fill:"#d1d5db",opacity:"0.15"},content:L?t=>{let{active:e,payload:r,label:n}=t;return Y?c.createElement(Y,{payload:null==r?void 0:r.map(t=>{var e;return Object.assign(Object.assign({},t),{color:null!==(e=tn.get(t.dataKey))&&void 0!==e?e:o.fr.Gray})}),active:e,label:n}):c.createElement(w.ZP,{active:e,payload:r,label:n,valueFormatter:P,categoryColors:tn})}:c.createElement(c.Fragment,null),position:{y:0}}),B?c.createElement(g.D,{verticalAlign:"top",height:te,content:t=>{let{payload:e}=t;return(0,x.Z)({payload:e},tn,tr,ta,tc?t=>{tc&&(t!==ta||to?(tu(t),null==Z||Z({eventType:"category",categoryClicked:t})):(tu(void 0),null==Z||Z(null)),ti(void 0))}:void 0,W)}}):null,s.map(t=>{var e;return c.createElement(f.$,{className:(0,a.q)((0,u.bM)(null!==(e=tn.get(t))&&void 0!==e?e:o.fr.Gray,i.K.background).fillColor,Z?"cursor-pointer":""),key:t,name:t,type:"linear",stackId:k||A?"a":void 0,dataKey:t,fill:"",isAnimationActive:_,animationDuration:T,shape:t=>((t,e,r,n)=>{let{fillOpacity:o,name:i,payload:a,value:u}=t,{x:l,width:s,y:f,height:p}=t;return"horizontal"===n&&p<0?(f+=p,p=Math.abs(p)):"vertical"===n&&s<0&&(l+=s,s=Math.abs(s)),c.createElement("rect",{x:l,y:f,width:s,height:p,opacity:e||r&&r!==i?(0,j.vZ)(e,Object.assign(Object.assign({},a),{value:u}))?o:.3:o})})(t,to,ta,E),onClick:tl})})):c.createElement(O.Z,{noDataText:q})))});S.displayName="BarChart"},65278:function(t,e,r){"use strict";r.d(e,{Z:function(){return y}});var n=r(2265);let o=t=>{n.useEffect(()=>{let e=()=>{t()};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[t])};var i=r(5853),a=r(26898),u=r(13241),c=r(1153);let l=t=>{var e=(0,i._T)(t,[]);return n.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),n.createElement("path",{d:"M8 12L14 6V18L8 12Z"}))},s=t=>{var e=(0,i._T)(t,[]);return n.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),n.createElement("path",{d:"M16 12L10 18V6L16 12Z"}))},f=(0,c.fn)("Legend"),p=t=>{let{name:e,color:r,onClick:o,activeLegend:i}=t,l=!!o;return n.createElement("li",{className:(0,u.q)(f("legendItem"),"group inline-flex items-center px-2 py-0.5 rounded-tremor-small transition whitespace-nowrap",l?"cursor-pointer":"cursor-default","text-tremor-content",l?"hover:bg-tremor-background-subtle":"","dark:text-dark-tremor-content",l?"dark:hover:bg-dark-tremor-background-subtle":""),onClick:t=>{t.stopPropagation(),null==o||o(e,r)}},n.createElement("svg",{className:(0,u.q)("flex-none h-2 w-2 mr-1.5",(0,c.bM)(r,a.K.text).textColor,i&&i!==e?"opacity-40":"opacity-100"),fill:"currentColor",viewBox:"0 0 8 8"},n.createElement("circle",{cx:4,cy:4,r:4})),n.createElement("p",{className:(0,u.q)("whitespace-nowrap truncate text-tremor-default","text-tremor-content",l?"group-hover:text-tremor-content-emphasis":"","dark:text-dark-tremor-content",i&&i!==e?"opacity-40":"opacity-100",l?"dark:group-hover:text-dark-tremor-content-emphasis":"")},e))},h=t=>{let{icon:e,onClick:r,disabled:o}=t,[i,a]=n.useState(!1),c=n.useRef(null);return n.useEffect(()=>(i?c.current=setInterval(()=>{null==r||r()},300):clearInterval(c.current),()=>clearInterval(c.current)),[i,r]),(0,n.useEffect)(()=>{o&&(clearInterval(c.current),a(!1))},[o]),n.createElement("button",{type:"button",className:(0,u.q)(f("legendSliderButton"),"w-5 group inline-flex items-center truncate rounded-tremor-small transition",o?"cursor-not-allowed":"cursor-pointer",o?"text-tremor-content-subtle":"text-tremor-content hover:text-tremor-content-emphasis hover:bg-tremor-background-subtle",o?"dark:text-dark-tremor-subtle":"dark:text-dark-tremor dark:hover:text-tremor-content-emphasis dark:hover:bg-dark-tremor-background-subtle"),disabled:o,onClick:t=>{t.stopPropagation(),null==r||r()},onMouseDown:t=>{t.stopPropagation(),a(!0)},onMouseUp:t=>{t.stopPropagation(),a(!1)}},n.createElement(e,{className:"w-full"}))},d=n.forwardRef((t,e)=>{let{categories:r,colors:o=a.s,className:c,onClickLegendItem:d,activeLegend:y,enableLegendSlider:v=!1}=t,m=(0,i._T)(t,["categories","colors","className","onClickLegendItem","activeLegend","enableLegendSlider"]),b=n.useRef(null),g=n.useRef(null),[x,w]=n.useState(null),[O,j]=n.useState(null),S=n.useRef(null),P=(0,n.useCallback)(()=>{let t=null==b?void 0:b.current;t&&w({left:t.scrollLeft>0,right:t.scrollWidth-t.clientWidth>t.scrollLeft})},[w]),E=(0,n.useCallback)(t=>{var e,r;let n=null==b?void 0:b.current,o=null==g?void 0:g.current,i=null!==(e=null==n?void 0:n.clientWidth)&&void 0!==e?e:0,a=null!==(r=null==o?void 0:o.clientWidth)&&void 0!==r?r:0;n&&v&&(n.scrollTo({left:"left"===t?n.scrollLeft-i+a:n.scrollLeft+i-a,behavior:"smooth"}),setTimeout(()=>{P()},400))},[v,P]);n.useEffect(()=>{let t=t=>{"ArrowLeft"===t?E("left"):"ArrowRight"===t&&E("right")};return O?(t(O),S.current=setInterval(()=>{t(O)},300)):clearInterval(S.current),()=>clearInterval(S.current)},[O,E]);let k=t=>{t.stopPropagation(),"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(t.preventDefault(),j(t.key))},A=t=>{t.stopPropagation(),j(null)};return n.useEffect(()=>{let t=null==b?void 0:b.current;return v&&(P(),null==t||t.addEventListener("keydown",k),null==t||t.addEventListener("keyup",A)),()=>{null==t||t.removeEventListener("keydown",k),null==t||t.removeEventListener("keyup",A)}},[P,v]),n.createElement("ol",Object.assign({ref:e,className:(0,u.q)(f("root"),"relative overflow-hidden",c)},m),n.createElement("div",{ref:b,tabIndex:0,className:(0,u.q)("h-full flex",v?(null==x?void 0:x.right)||(null==x?void 0:x.left)?"pl-4 pr-12 items-center overflow-auto snap-mandatory [&::-webkit-scrollbar]:hidden [scrollbar-width:none]":"":"flex-wrap")},r.map((t,e)=>n.createElement(p,{key:"item-".concat(e),name:t,color:o[e%o.length],onClick:d,activeLegend:y}))),v&&((null==x?void 0:x.right)||(null==x?void 0:x.left))?n.createElement(n.Fragment,null,n.createElement("div",{className:(0,u.q)("bg-tremor-background","dark:bg-dark-tremor-background","absolute flex top-0 pr-1 bottom-0 right-0 items-center justify-center h-full"),ref:g},n.createElement(h,{icon:l,onClick:()=>{j(null),E("left")},disabled:!(null==x?void 0:x.left)}),n.createElement(h,{icon:s,onClick:()=>{j(null),E("right")},disabled:!(null==x?void 0:x.right)}))):null)});d.displayName="Legend";let y=(t,e,r,i,a,u)=>{let{payload:c}=t,l=(0,n.useRef)(null);o(()=>{var t,e;r((e=null===(t=l.current)||void 0===t?void 0:t.clientHeight)?Number(e)+20:60)});let s=c.filter(t=>"none"!==t.type);return n.createElement("div",{ref:l,className:"flex items-center justify-end"},n.createElement(d,{categories:s.map(t=>t.value),colors:s.map(t=>e.get(t.value)),onClickLegendItem:a,activeLegend:i,enableLegendSlider:u}))}},98593:function(t,e,r){"use strict";r.d(e,{$B:function(){return c},ZP:function(){return s},zX:function(){return l}});var n=r(2265),o=r(7084),i=r(26898),a=r(13241),u=r(1153);let c=t=>{let{children:e}=t;return n.createElement("div",{className:(0,a.q)("rounded-tremor-default text-tremor-default border","bg-tremor-background shadow-tremor-dropdown border-tremor-border","dark:bg-dark-tremor-background dark:shadow-dark-tremor-dropdown dark:border-dark-tremor-border")},e)},l=t=>{let{value:e,name:r,color:o}=t;return n.createElement("div",{className:"flex items-center justify-between space-x-8"},n.createElement("div",{className:"flex items-center space-x-2"},n.createElement("span",{className:(0,a.q)("shrink-0 rounded-tremor-full border-2 h-3 w-3","border-tremor-background shadow-tremor-card","dark:border-dark-tremor-background dark:shadow-dark-tremor-card",(0,u.bM)(o,i.K.background).bgColor)}),n.createElement("p",{className:(0,a.q)("text-right whitespace-nowrap","text-tremor-content","dark:text-dark-tremor-content")},r)),n.createElement("p",{className:(0,a.q)("font-medium tabular-nums text-right whitespace-nowrap","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e))},s=t=>{let{active:e,payload:r,label:i,categoryColors:u,valueFormatter:s}=t;if(e&&r){let t=r.filter(t=>"none"!==t.type);return n.createElement(c,null,n.createElement("div",{className:(0,a.q)("border-tremor-border border-b px-4 py-2","dark:border-dark-tremor-border")},n.createElement("p",{className:(0,a.q)("font-medium","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},i)),n.createElement("div",{className:(0,a.q)("px-4 py-2 space-y-1")},t.map((t,e)=>{var r;let{value:i,name:a}=t;return n.createElement(l,{key:"id-".concat(e),value:s(i),name:a,color:null!==(r=u.get(a))&&void 0!==r?r:o.fr.Blue})})))}return null}},92666:function(t,e,r){"use strict";r.d(e,{Z:function(){return i}});var n=r(13241),o=r(2265);let i=t=>{let{className:e,noDataText:r="No data"}=t;return o.createElement("div",{className:(0,n.q)("flex items-center justify-center w-full h-full border border-dashed rounded-tremor-default","border-tremor-border","dark:border-dark-tremor-border",e)},o.createElement("p",{className:(0,n.q)("text-tremor-content text-tremor-default","dark:text-dark-tremor-content")},r))}},32644:function(t,e,r){"use strict";r.d(e,{FB:function(){return i},i4:function(){return o},me:function(){return n},vZ:function(){return function t(e,r){if(e===r)return!0;if("object"!=typeof e||"object"!=typeof r||null===e||null===r)return!1;let n=Object.keys(e),o=Object.keys(r);if(n.length!==o.length)return!1;for(let i of n)if(!o.includes(i)||!t(e[i],r[i]))return!1;return!0}}});let n=(t,e)=>{let r=new Map;return t.forEach((t,n)=>{r.set(t,e[n%e.length])}),r},o=(t,e,r)=>[t?"auto":null!=e?e:0,null!=r?r:"auto"];function i(t,e){let r=[];for(let n of t)if(Object.prototype.hasOwnProperty.call(n,e)&&(r.push(n[e]),r.length>1))return!1;return!0}},49804:function(t,e,r){"use strict";r.d(e,{Z:function(){return l}});var n=r(5853),o=r(13241),i=r(1153),a=r(2265),u=r(9496);let c=(0,i.fn)("Col"),l=a.forwardRef((t,e)=>{let{numColSpan:r=1,numColSpanSm:i,numColSpanMd:l,numColSpanLg:s,children:f,className:p}=t,h=(0,n._T)(t,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),d=(t,e)=>t&&Object.keys(e).includes(String(t))?e[t]:"";return a.createElement("div",Object.assign({ref:e,className:(0,o.q)(c("root"),(()=>{let t=d(r,u.PT),e=d(i,u.SP),n=d(l,u.VS),a=d(s,u._w);return(0,o.q)(t,e,n,a)})(),p)},h),f)});l.displayName="Col"},97765:function(t,e,r){"use strict";r.d(e,{Z:function(){return c}});var n=r(5853),o=r(26898),i=r(13241),a=r(1153),u=r(2265);let c=u.forwardRef((t,e)=>{let{color:r,children:c,className:l}=t,s=(0,n._T)(t,["color","children","className"]);return u.createElement("p",Object.assign({ref:e,className:(0,i.q)(r?(0,a.bM)(r,o.K.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",l)},s),c)});c.displayName="Subtitle"},61134:function(t,e,r){var n;!function(o){"use strict";var i,a={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},u=!0,c="[DecimalError] ",l=c+"Invalid argument: ",s=c+"Exponent out of range: ",f=Math.floor,p=Math.pow,h=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d=f(1286742750677284.5),y={};function v(t,e){var r,n,o,i,a,c,l,s,f=t.constructor,p=f.precision;if(!t.s||!e.s)return e.s||(e=new f(t)),u?E(e,p):e;if(l=t.d,s=e.d,a=t.e,o=e.e,l=l.slice(),i=a-o){for(i<0?(n=l,i=-i,c=s.length):(n=s,o=a,c=l.length),i>(c=(a=Math.ceil(p/7))>c?a+1:c+1)&&(i=c,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((c=l.length)-(i=s.length)<0&&(i=c,n=s,s=l,l=n),r=0;i;)r=(l[--i]=l[i]+s[i]+r)/1e7|0,l[i]%=1e7;for(r&&(l.unshift(r),++o),c=l.length;0==l[--c];)l.pop();return e.d=l,e.e=o,u?E(e,p):e}function m(t,e,r){if(t!==~~t||tr)throw Error(l+t)}function b(t){var e,r,n,o=t.length-1,i="",a=t[0];if(o>0){for(i+=a,e=1;et.e^this.s<0?1:-1;for(e=0,r=(n=this.d.length)<(o=t.d.length)?n:o;et.d[e]^this.s<0?1:-1;return n===o?0:n>o^this.s<0?1:-1},y.decimalPlaces=y.dp=function(){var t=this.d.length-1,e=(t-this.e)*7;if(t=this.d[t])for(;t%10==0;t/=10)e--;return e<0?0:e},y.dividedBy=y.div=function(t){return g(this,new this.constructor(t))},y.dividedToIntegerBy=y.idiv=function(t){var e=this.constructor;return E(g(this,new e(t),0,1),e.precision)},y.equals=y.eq=function(t){return!this.cmp(t)},y.exponent=function(){return w(this)},y.greaterThan=y.gt=function(t){return this.cmp(t)>0},y.greaterThanOrEqualTo=y.gte=function(t){return this.cmp(t)>=0},y.isInteger=y.isint=function(){return this.e>this.d.length-2},y.isNegative=y.isneg=function(){return this.s<0},y.isPositive=y.ispos=function(){return this.s>0},y.isZero=function(){return 0===this.s},y.lessThan=y.lt=function(t){return 0>this.cmp(t)},y.lessThanOrEqualTo=y.lte=function(t){return 1>this.cmp(t)},y.logarithm=y.log=function(t){var e,r=this.constructor,n=r.precision,o=n+5;if(void 0===t)t=new r(10);else if((t=new r(t)).s<1||t.eq(i))throw Error(c+"NaN");if(this.s<1)throw Error(c+(this.s?"NaN":"-Infinity"));return this.eq(i)?new r(0):(u=!1,e=g(S(this,o),S(t,o),o),u=!0,E(e,n))},y.minus=y.sub=function(t){return t=new this.constructor(t),this.s==t.s?k(this,t):v(this,(t.s=-t.s,t))},y.modulo=y.mod=function(t){var e,r=this.constructor,n=r.precision;if(!(t=new r(t)).s)throw Error(c+"NaN");return this.s?(u=!1,e=g(this,t,0,1).times(t),u=!0,this.minus(e)):E(new r(this),n)},y.naturalExponential=y.exp=function(){return x(this)},y.naturalLogarithm=y.ln=function(){return S(this)},y.negated=y.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t},y.plus=y.add=function(t){return t=new this.constructor(t),this.s==t.s?v(this,t):k(this,(t.s=-t.s,t))},y.precision=y.sd=function(t){var e,r,n;if(void 0!==t&&!!t!==t&&1!==t&&0!==t)throw Error(l+t);if(e=w(this)+1,r=7*(n=this.d.length-1)+1,n=this.d[n]){for(;n%10==0;n/=10)r--;for(n=this.d[0];n>=10;n/=10)r++}return t&&e>r?e:r},y.squareRoot=y.sqrt=function(){var t,e,r,n,o,i,a,l=this.constructor;if(this.s<1){if(!this.s)return new l(0);throw Error(c+"NaN")}for(t=w(this),u=!1,0==(o=Math.sqrt(+this))||o==1/0?(((e=b(this.d)).length+t)%2==0&&(e+="0"),o=Math.sqrt(e),t=f((t+1)/2)-(t<0||t%2),n=new l(e=o==1/0?"5e"+t:(e=o.toExponential()).slice(0,e.indexOf("e")+1)+t)):n=new l(o.toString()),o=a=(r=l.precision)+3;;)if(n=(i=n).plus(g(this,i,a+2)).times(.5),b(i.d).slice(0,a)===(e=b(n.d)).slice(0,a)){if(e=e.slice(a-3,a+1),o==a&&"4999"==e){if(E(i,r+1,0),i.times(i).eq(this)){n=i;break}}else if("9999"!=e)break;a+=4}return u=!0,E(n,r)},y.times=y.mul=function(t){var e,r,n,o,i,a,c,l,s,f=this.constructor,p=this.d,h=(t=new f(t)).d;if(!this.s||!t.s)return new f(0);for(t.s*=this.s,r=this.e+t.e,(l=p.length)<(s=h.length)&&(i=p,p=h,h=i,a=l,l=s,s=a),i=[],n=a=l+s;n--;)i.push(0);for(n=s;--n>=0;){for(e=0,o=l+n;o>n;)c=i[o]+h[n]*p[o-n-1]+e,i[o--]=c%1e7|0,e=c/1e7|0;i[o]=(i[o]+e)%1e7|0}for(;!i[--a];)i.pop();return e?++r:i.shift(),t.d=i,t.e=r,u?E(t,f.precision):t},y.toDecimalPlaces=y.todp=function(t,e){var r=this,n=r.constructor;return(r=new n(r),void 0===t)?r:(m(t,0,1e9),void 0===e?e=n.rounding:m(e,0,8),E(r,t+w(r)+1,e))},y.toExponential=function(t,e){var r,n=this,o=n.constructor;return void 0===t?r=A(n,!0):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),r=A(n=E(new o(n),t+1,e),!0,t+1)),r},y.toFixed=function(t,e){var r,n,o=this.constructor;return void 0===t?A(this):(m(t,0,1e9),void 0===e?e=o.rounding:m(e,0,8),r=A((n=E(new o(this),t+w(this)+1,e)).abs(),!1,t+w(n)+1),this.isneg()&&!this.isZero()?"-"+r:r)},y.toInteger=y.toint=function(){var t=this.constructor;return E(new t(this),w(this)+1,t.rounding)},y.toNumber=function(){return+this},y.toPower=y.pow=function(t){var e,r,n,o,a,l,s=this,p=s.constructor,h=+(t=new p(t));if(!t.s)return new p(i);if(!(s=new p(s)).s){if(t.s<1)throw Error(c+"Infinity");return s}if(s.eq(i))return s;if(n=p.precision,t.eq(i))return E(s,n);if(l=(e=t.e)>=(r=t.d.length-1),a=s.s,l){if((r=h<0?-h:h)<=9007199254740991){for(o=new p(i),e=Math.ceil(n/7+4),u=!1;r%2&&M((o=o.times(s)).d,e),0!==(r=f(r/2));)M((s=s.times(s)).d,e);return u=!0,t.s<0?new p(i).div(o):E(o,n)}}else if(a<0)throw Error(c+"NaN");return a=a<0&&1&t.d[Math.max(e,r)]?-1:1,s.s=1,u=!1,o=t.times(S(s,n+12)),u=!0,(o=x(o)).s=a,o},y.toPrecision=function(t,e){var r,n,o=this,i=o.constructor;return void 0===t?(r=w(o),n=A(o,r<=i.toExpNeg||r>=i.toExpPos)):(m(t,1,1e9),void 0===e?e=i.rounding:m(e,0,8),r=w(o=E(new i(o),t,e)),n=A(o,t<=r||r<=i.toExpNeg,t)),n},y.toSignificantDigits=y.tosd=function(t,e){var r=this.constructor;return void 0===t?(t=r.precision,e=r.rounding):(m(t,1,1e9),void 0===e?e=r.rounding:m(e,0,8)),E(new r(this),t,e)},y.toString=y.valueOf=y.val=y.toJSON=function(){var t=w(this),e=this.constructor;return A(this,t<=e.toExpNeg||t>=e.toExpPos)};var g=function(){function t(t,e){var r,n=0,o=t.length;for(t=t.slice();o--;)r=t[o]*e+n,t[o]=r%1e7|0,n=r/1e7|0;return n&&t.unshift(n),t}function e(t,e,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;oe[o]?1:-1;break}return i}function r(t,e,r){for(var n=0;r--;)t[r]-=n,n=t[r]1;)t.shift()}return function(n,o,i,a){var u,l,s,f,p,h,d,y,v,m,b,g,x,O,j,S,P,k,A=n.constructor,M=n.s==o.s?1:-1,T=n.d,_=o.d;if(!n.s)return new A(n);if(!o.s)throw Error(c+"Division by zero");for(s=0,l=n.e-o.e,P=_.length,j=T.length,y=(d=new A(M)).d=[];_[s]==(T[s]||0);)++s;if(_[s]>(T[s]||0)&&--l,(g=null==i?i=A.precision:a?i+(w(n)-w(o))+1:i)<0)return new A(0);if(g=g/7+2|0,s=0,1==P)for(f=0,_=_[0],g++;(s1&&(_=t(_,f),T=t(T,f),P=_.length,j=T.length),O=P,m=(v=T.slice(0,P)).length;m=1e7/2&&++S;do f=0,(u=e(_,v,P,m))<0?(b=v[0],P!=m&&(b=1e7*b+(v[1]||0)),(f=b/S|0)>1?(f>=1e7&&(f=1e7-1),h=(p=t(_,f)).length,m=v.length,1==(u=e(p,v,h,m))&&(f--,r(p,P16)throw Error(s+w(t));if(!t.s)return new h(i);for(null==e?(u=!1,c=d):c=e,a=new h(.03125);t.abs().gte(.1);)t=t.times(a),f+=5;for(c+=Math.log(p(2,f))/Math.LN10*2+5|0,r=n=o=new h(i),h.precision=c;;){if(n=E(n.times(t),c),r=r.times(++l),b((a=o.plus(g(n,r,c))).d).slice(0,c)===b(o.d).slice(0,c)){for(;f--;)o=E(o.times(o),c);return h.precision=d,null==e?(u=!0,E(o,d)):o}o=a}}function w(t){for(var e=7*t.e,r=t.d[0];r>=10;r/=10)e++;return e}function O(t,e,r){if(e>t.LN10.sd())throw u=!0,r&&(t.precision=r),Error(c+"LN10 precision limit exceeded");return E(new t(t.LN10),e)}function j(t){for(var e="";t--;)e+="0";return e}function S(t,e){var r,n,o,a,l,s,f,p,h,d=1,y=t,v=y.d,m=y.constructor,x=m.precision;if(y.s<1)throw Error(c+(y.s?"NaN":"-Infinity"));if(y.eq(i))return new m(0);if(null==e?(u=!1,p=x):p=e,y.eq(10))return null==e&&(u=!0),O(m,p);if(p+=10,m.precision=p,n=(r=b(v)).charAt(0),!(15e14>Math.abs(a=w(y))))return f=O(m,p+2,x).times(a+""),y=S(new m(n+"."+r.slice(1)),p-10).plus(f),m.precision=x,null==e?(u=!0,E(y,x)):y;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=b((y=y.times(t)).d)).charAt(0),d++;for(a=w(y),n>1?(y=new m("0."+r),a++):y=new m(n+"."+r.slice(1)),s=l=y=g(y.minus(i),y.plus(i),p),h=E(y.times(y),p),o=3;;){if(l=E(l.times(h),p),b((f=s.plus(g(l,new m(o),p))).d).slice(0,p)===b(s.d).slice(0,p))return s=s.times(2),0!==a&&(s=s.plus(O(m,p+2,x).times(a+""))),s=g(s,new m(d),p),m.precision=x,null==e?(u=!0,E(s,x)):s;s=f,o+=2}}function P(t,e){var r,n,o;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;48===e.charCodeAt(n);)++n;for(o=e.length;48===e.charCodeAt(o-1);)--o;if(e=e.slice(n,o)){if(o-=n,r=r-n-1,t.e=f(r/7),t.d=[],n=(r+1)%7,r<0&&(n+=7),nd||t.e<-d))throw Error(s+r)}else t.s=0,t.e=0,t.d=[0];return t}function E(t,e,r){var n,o,i,a,c,l,h,y,v=t.d;for(a=1,i=v[0];i>=10;i/=10)a++;if((n=e-a)<0)n+=7,o=e,h=v[y=0];else{if((y=Math.ceil((n+1)/7))>=(i=v.length))return t;for(a=1,h=i=v[y];i>=10;i/=10)a++;n%=7,o=n-7+a}if(void 0!==r&&(c=h/(i=p(10,a-o-1))%10|0,l=e<0||void 0!==v[y+1]||h%i,l=r<4?(c||l)&&(0==r||r==(t.s<0?3:2)):c>5||5==c&&(4==r||l||6==r&&(n>0?o>0?h/p(10,a-o):0:v[y-1])%10&1||r==(t.s<0?8:7))),e<1||!v[0])return l?(i=w(t),v.length=1,e=e-i-1,v[0]=p(10,(7-e%7)%7),t.e=f(-e/7)||0):(v.length=1,v[0]=t.e=t.s=0),t;if(0==n?(v.length=y,i=1,y--):(v.length=y+1,i=p(10,7-n),v[y]=o>0?(h/p(10,a-o)%p(10,o)|0)*i:0),l)for(;;){if(0==y){1e7==(v[0]+=i)&&(v[0]=1,++t.e);break}if(v[y]+=i,1e7!=v[y])break;v[y--]=0,i=1}for(n=v.length;0===v[--n];)v.pop();if(u&&(t.e>d||t.e<-d))throw Error(s+w(t));return t}function k(t,e){var r,n,o,i,a,c,l,s,f,p,h=t.constructor,d=h.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new h(t),u?E(e,d):e;if(l=t.d,p=e.d,n=e.e,s=t.e,l=l.slice(),a=s-n){for((f=a<0)?(r=l,a=-a,c=p.length):(r=p,n=s,c=l.length),a>(o=Math.max(Math.ceil(d/7),c)+2)&&(a=o,r.length=1),r.reverse(),o=a;o--;)r.push(0);r.reverse()}else{for((f=(o=l.length)<(c=p.length))&&(c=o),o=0;o0;--o)l[c++]=0;for(o=p.length;o>a;){if(l[--o]0?i=i.charAt(0)+"."+i.slice(1)+j(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+j(-o-1)+i,r&&(n=r-a)>0&&(i+=j(n))):o>=a?(i+=j(o+1-a),r&&(n=r-o-1)>0&&(i=i+"."+j(n))):((n=o+1)0&&(o+1===a&&(i+="."),i+=j(n))),t.s<0?"-"+i:i}function M(t,e){if(t.length>e)return t.length=e,!0}function T(t){if(!t||"object"!=typeof t)throw Error(c+"Object expected");var e,r,n,o=["precision",1,1e9,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e=o[e+1]&&n<=o[e+2])this[r]=n;else throw Error(l+r+": "+n)}if(void 0!==(n=t[r="LN10"])){if(n==Math.LN10)this[r]=new this(n);else throw Error(l+r+": "+n)}return this}(a=function t(e){var r,n,o;function i(t){if(!(this instanceof i))return new i(t);if(this.constructor=i,t instanceof i){this.s=t.s,this.e=t.e,this.d=(t=t.d)?t.slice():t;return}if("number"==typeof t){if(0*t!=0)throw Error(l+t);if(t>0)this.s=1;else if(t<0)t=-t,this.s=-1;else{this.s=0,this.e=0,this.d=[0];return}if(t===~~t&&t<1e7){this.e=0,this.d=[t];return}return P(this,t.toString())}if("string"!=typeof t)throw Error(l+t);if(45===t.charCodeAt(0)?(t=t.slice(1),this.s=-1):this.s=1,h.test(t))P(this,t);else throw Error(l+t)}if(i.prototype=y,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=t,i.config=i.set=T,void 0===e&&(e={}),e)for(r=0,o=["precision","rounding","toExpNeg","toExpPos","LN10"];r-1}},56883:function(t){t.exports=function(t,e,r){for(var n=-1,o=null==t?0:t.length;++n0&&i(s)?r>1?t(s,r-1,i,a,u):n(u,s):a||(u[u.length]=s)}return u}},63321:function(t,e,r){var n=r(33023)();t.exports=n},98060:function(t,e,r){var n=r(63321),o=r(43228);t.exports=function(t,e){return t&&n(t,e,o)}},92167:function(t,e,r){var n=r(67906),o=r(70235);t.exports=function(t,e){e=n(e,t);for(var r=0,i=e.length;null!=t&&re}},93012:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},47909:function(t,e,r){var n=r(8235),o=r(31953),i=r(35281);t.exports=function(t,e,r){return e==e?i(t,e,r):n(t,o,r)}},90370:function(t,e,r){var n=r(54506),o=r(10303);t.exports=function(t){return o(t)&&"[object Arguments]"==n(t)}},56318:function(t,e,r){var n=r(6791),o=r(10303);t.exports=function t(e,r,i,a,u){return e===r||(null!=e&&null!=r&&(o(e)||o(r))?n(e,r,i,a,t,u):e!=e&&r!=r)}},6791:function(t,e,r){var n=r(85885),o=r(97638),i=r(88030),a=r(64974),u=r(81690),c=r(25614),l=r(98051),s=r(9792),f="[object Arguments]",p="[object Array]",h="[object Object]",d=Object.prototype.hasOwnProperty;t.exports=function(t,e,r,y,v,m){var b=c(t),g=c(e),x=b?p:u(t),w=g?p:u(e);x=x==f?h:x,w=w==f?h:w;var O=x==h,j=w==h,S=x==w;if(S&&l(t)){if(!l(e))return!1;b=!0,O=!1}if(S&&!O)return m||(m=new n),b||s(t)?o(t,e,r,y,v,m):i(t,e,x,r,y,v,m);if(!(1&r)){var P=O&&d.call(t,"__wrapped__"),E=j&&d.call(e,"__wrapped__");if(P||E){var k=P?t.value():t,A=E?e.value():e;return m||(m=new n),v(k,A,r,y,m)}}return!!S&&(m||(m=new n),a(t,e,r,y,v,m))}},62538:function(t,e,r){var n=r(85885),o=r(56318);t.exports=function(t,e,r,i){var a=r.length,u=a,c=!i;if(null==t)return!u;for(t=Object(t);a--;){var l=r[a];if(c&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++ao?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n=200){var y=e?null:u(t);if(y)return c(y);p=!1,s=a,d=new n}else d=e?[]:h;t:for(;++l=o?t:n(t,e,r)}},1536:function(t,e,r){var n=r(78371);t.exports=function(t,e){if(t!==e){var r=void 0!==t,o=null===t,i=t==t,a=n(t),u=void 0!==e,c=null===e,l=e==e,s=n(e);if(!c&&!s&&!a&&t>e||a&&u&&l&&!c&&!s||o&&u&&l||!r&&l||!i)return 1;if(!o&&!a&&!s&&t=c)return l;return l*("desc"==r[o]?-1:1)}}return t.index-e.index}},92077:function(t,e,r){var n=r(74288)["__core-js_shared__"];t.exports=n},97930:function(t,e,r){var n=r(5629);t.exports=function(t,e){return function(r,o){if(null==r)return r;if(!n(r))return t(r,o);for(var i=r.length,a=e?i:-1,u=Object(r);(e?a--:++a-1?u[c?e[l]:l]:void 0}}},35464:function(t,e,r){var n=r(19608),o=r(49639),i=r(175);t.exports=function(t){return function(e,r,a){return a&&"number"!=typeof a&&o(e,r,a)&&(r=a=void 0),e=i(e),void 0===r?(r=e,e=0):r=i(r),a=void 0===a?es))return!1;var p=c.get(t),h=c.get(e);if(p&&h)return p==e&&h==t;var d=-1,y=!0,v=2&r?new n:void 0;for(c.set(t,e),c.set(e,t);++d-1&&t%1==0&&t-1}},13368:function(t,e,r){var n=r(24457);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},38764:function(t,e,r){var n=r(9855),o=r(99078),i=r(88675);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},78615:function(t,e,r){var n=r(1507);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},83391:function(t,e,r){var n=r(1507);t.exports=function(t){return n(this,t).get(t)}},53483:function(t,e,r){var n=r(1507);t.exports=function(t){return n(this,t).has(t)}},74724:function(t,e,r){var n=r(1507);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},22523:function(t){t.exports=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}},47073:function(t){t.exports=function(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}},23787:function(t,e,r){var n=r(50967);t.exports=function(t){var e=n(t,function(t){return 500===r.size&&r.clear(),t}),r=e.cache;return e}},20453:function(t,e,r){var n=r(39866)(Object,"create");t.exports=n},77184:function(t,e,r){var n=r(45070)(Object.keys,Object);t.exports=n},39931:function(t,e,r){t=r.nmd(t);var n=r(17071),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,a=i&&i.exports===o&&n.process,u=function(){try{var t=i&&i.require&&i.require("util").types;if(t)return t;return a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=u},80910:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},45070:function(t){t.exports=function(t,e){return function(r){return t(e(r))}}},49478:function(t,e,r){var n=r(60493),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}},84092:function(t,e,r){var n=r(99078);t.exports=function(){this.__data__=new n,this.size=0}},31663:function(t){t.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},69135:function(t){t.exports=function(t){return this.__data__.get(t)}},39552:function(t){t.exports=function(t){return this.__data__.has(t)}},63960:function(t,e,r){var n=r(99078),o=r(88675),i=r(76219);t.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(t,e),this.size=r.size,this}},35281:function(t){t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n=e||r<0||v&&n>=s}function x(){var t,r,n,i=o();if(g(i))return w(i);p=setTimeout(x,(t=i-h,r=i-d,n=e-t,v?u(n,s-r):n))}function w(t){return(p=void 0,m&&c)?b(t):(c=l=void 0,f)}function O(){var t,r=o(),n=g(r);if(c=arguments,l=this,h=r,n){if(void 0===p)return d=t=h,p=setTimeout(x,e),y?b(t):f;if(v)return clearTimeout(p),p=setTimeout(x,e),b(h)}return void 0===p&&(p=setTimeout(x,e)),f}return e=i(e)||0,n(r)&&(y=!!r.leading,s=(v="maxWait"in r)?a(i(r.maxWait)||0,e):s,m="trailing"in r?!!r.trailing:m),O.cancel=function(){void 0!==p&&clearTimeout(p),d=0,c=h=l=p=void 0},O.flush=function(){return void 0===p?f:w(o())},O}},37560:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},32242:function(t,e,r){var n=r(78897),o=r(28935),i=r(88157),a=r(25614),u=r(49639);t.exports=function(t,e,r){var c=a(t)?n:o;return r&&u(t,e,r)&&(e=void 0),c(t,i(e,3))}},84173:function(t,e,r){var n=r(82602)(r(12152));t.exports=n},12152:function(t,e,r){var n=r(8235),o=r(88157),i=r(85759),a=Math.max;t.exports=function(t,e,r){var u=null==t?0:t.length;if(!u)return -1;var c=null==r?0:i(r);return c<0&&(c=a(u+c,0)),n(t,o(e,3),c)}},11314:function(t,e,r){var n=r(72569),o=r(89238);t.exports=function(t,e){return n(o(t,e),1)}},13735:function(t,e,r){var n=r(92167);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},17764:function(t,e,r){var n=r(93012),o=r(59592);t.exports=function(t,e){return null!=t&&o(t,e,n)}},79586:function(t){t.exports=function(t){return t}},56569:function(t,e,r){var n=r(90370),o=r(10303),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(t){return o(t)&&a.call(t,"callee")&&!u.call(t,"callee")};t.exports=c},25614:function(t){var e=Array.isArray;t.exports=e},5629:function(t,e,r){var n=r(86757),o=r(13973);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},24342:function(t,e,r){var n=r(54506),o=r(10303);t.exports=function(t){return!0===t||!1===t||o(t)&&"[object Boolean]"==n(t)}},98051:function(t,e,r){t=r.nmd(t);var n=r(74288),o=r(7406),i=e&&!e.nodeType&&e,a=i&&t&&!t.nodeType&&t,u=a&&a.exports===i?n.Buffer:void 0,c=u?u.isBuffer:void 0;t.exports=c||o},21652:function(t,e,r){var n=r(56318);t.exports=function(t,e){return n(t,e)}},86757:function(t,e,r){var n=r(54506),o=r(28302);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},13973:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},82559:function(t,e,r){var n=r(22345);t.exports=function(t){return n(t)&&t!=+t}},77571:function(t){t.exports=function(t){return null==t}},22345:function(t,e,r){var n=r(54506),o=r(10303);t.exports=function(t){return"number"==typeof t||o(t)&&"[object Number]"==n(t)}},28302:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},10303:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},90231:function(t,e,r){var n=r(54506),o=r(62602),i=r(10303),a=Object.prototype,u=Function.prototype.toString,c=a.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=n(t))return!1;var e=o(t);if(null===e)return!0;var r=c.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},42715:function(t,e,r){var n=r(54506),o=r(25614),i=r(10303);t.exports=function(t){return"string"==typeof t||!o(t)&&i(t)&&"[object String]"==n(t)}},78371:function(t,e,r){var n=r(54506),o=r(10303);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},9792:function(t,e,r){var n=r(59332),o=r(23305),i=r(39931),a=i&&i.isTypedArray,u=a?o(a):n;t.exports=u},43228:function(t,e,r){var n=r(28579),o=r(4578),i=r(5629);t.exports=function(t){return i(t)?n(t):o(t)}},86185:function(t){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},89238:function(t,e,r){var n=r(73819),o=r(88157),i=r(24240),a=r(25614);t.exports=function(t,e){return(a(t)?n:i)(t,o(e,3))}},41443:function(t,e,r){var n=r(83023),o=r(98060),i=r(88157);t.exports=function(t,e){var r={};return e=i(e,3),o(t,function(t,o,i){n(r,o,e(t,o,i))}),r}},95645:function(t,e,r){var n=r(67646),o=r(58905),i=r(79586);t.exports=function(t){return t&&t.length?n(t,i,o):void 0}},50967:function(t,e,r){var n=r(76219);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(o.Cache||n),r}o.Cache=n,t.exports=o},99008:function(t,e,r){var n=r(67646),o=r(20121),i=r(79586);t.exports=function(t){return t&&t.length?n(t,i,o):void 0}},93810:function(t){t.exports=function(){}},11121:function(t,e,r){var n=r(74288);t.exports=function(){return n.Date.now()}},22350:function(t,e,r){var n=r(18155),o=r(73584),i=r(67352),a=r(70235);t.exports=function(t){return i(t)?n(a(t)):o(t)}},99676:function(t,e,r){var n=r(35464)();t.exports=n},33645:function(t,e,r){var n=r(25253),o=r(88157),i=r(12327),a=r(25614),u=r(49639);t.exports=function(t,e,r){var c=a(t)?n:i;return r&&u(t,e,r)&&(e=void 0),c(t,o(e,3))}},34935:function(t,e,r){var n=r(72569),o=r(84046),i=r(44843),a=r(49639),u=i(function(t,e){if(null==t)return[];var r=e.length;return r>1&&a(t,e[0],e[1])?e=[]:r>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),o(t,n(e,1),[])});t.exports=u},55716:function(t){t.exports=function(){return[]}},7406:function(t){t.exports=function(){return!1}},37065:function(t,e,r){var n=r(7310),o=r(28302);t.exports=function(t,e,r){var i=!0,a=!0;if("function"!=typeof t)throw TypeError("Expected a function");return o(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),n(t,e,{leading:i,maxWait:e,trailing:a})}},175:function(t,e,r){var n=r(6660),o=1/0;t.exports=function(t){return t?(t=n(t))===o||t===-o?(t<0?-1:1)*17976931348623157e292:t==t?t:0:0===t?t:0}},85759:function(t,e,r){var n=r(175);t.exports=function(t){var e=n(t),r=e%1;return e==e?r?e-r:e:0}},6660:function(t,e,r){var n=r(41087),o=r(28302),i=r(78371),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return a;if(o(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=c.test(t);return r||l.test(t)?s(t.slice(2),r?2:8):u.test(t)?a:+t}},3641:function(t,e,r){var n=r(65020);t.exports=function(t){return null==t?"":n(t)}},47230:function(t,e,r){var n=r(88157),o=r(13826);t.exports=function(t,e){return t&&t.length?o(t,n(e,2)):[]}},75551:function(t,e,r){var n=r(80675)("toUpperCase");t.exports=n},48049:function(t,e,r){"use strict";var n=r(14397);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function t(t,e,r,o,i,a){if(a!==n){var u=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function e(){return t}t.isRequired=t;var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},40718:function(t,e,r){t.exports=r(48049)()},14397:function(t){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},84735:function(t,e,r){"use strict";r.d(e,{ZP:function(){return tS}});var n=r(2265),o=r(40718),i=r.n(o),a=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty;function l(t,e){return function(r,n,o){return t(r,n,o)&&e(r,n,o)}}function s(t){return function(e,r,n){if(!e||!r||"object"!=typeof e||"object"!=typeof r)return t(e,r,n);var o=n.cache,i=o.get(e),a=o.get(r);if(i&&a)return i===r&&a===e;o.set(e,r),o.set(r,e);var u=t(e,r,n);return o.delete(e),o.delete(r),u}}function f(t){return a(t).concat(u(t))}var p=Object.hasOwn||function(t,e){return c.call(t,e)};function h(t,e){return t===e||!t&&!e&&t!=t&&e!=e}var d=Object.getOwnPropertyDescriptor,y=Object.keys;function v(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function m(t,e){return h(t.getTime(),e.getTime())}function b(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function g(t,e){return t===e}function x(t,e,r){var n,o,i=t.size;if(i!==e.size)return!1;if(!i)return!0;for(var a=Array(i),u=t.entries(),c=0;(n=u.next())&&!n.done;){for(var l=e.entries(),s=!1,f=0;(o=l.next())&&!o.done;){if(a[f]){f++;continue}var p=n.value,h=o.value;if(r.equals(p[0],h[0],c,f,t,e,r)&&r.equals(p[1],h[1],p[0],h[0],t,e,r)){s=a[f]=!0;break}f++}if(!s)return!1;c++}return!0}function w(t,e,r){var n=y(t),o=n.length;if(y(e).length!==o)return!1;for(;o-- >0;)if(!A(t,e,r,n[o]))return!1;return!0}function O(t,e,r){var n,o,i,a=f(t),u=a.length;if(f(e).length!==u)return!1;for(;u-- >0;)if(!A(t,e,r,n=a[u])||(o=d(t,n),i=d(e,n),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable)))return!1;return!0}function j(t,e){return h(t.valueOf(),e.valueOf())}function S(t,e){return t.source===e.source&&t.flags===e.flags}function P(t,e,r){var n,o,i=t.size;if(i!==e.size)return!1;if(!i)return!0;for(var a=Array(i),u=t.values();(n=u.next())&&!n.done;){for(var c=e.values(),l=!1,s=0;(o=c.next())&&!o.done;){if(!a[s]&&r.equals(n.value,o.value,n.value,o.value,t,e,r)){l=a[s]=!0;break}s++}if(!l)return!1}return!0}function E(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function k(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function A(t,e,r,n){return("_owner"===n||"__o"===n||"__v"===n)&&(!!t.$$typeof||!!e.$$typeof)||p(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var M=Array.isArray,T="undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView:null,_=Object.assign,C=Object.prototype.toString.call.bind(Object.prototype.toString),N=D();function D(t){void 0===t&&(t={});var e,r,n,o,i,a,u,c,f,p,d,y,A,N,D=t.circular,I=t.createInternalComparator,L=t.createState,B=t.strict,R=(r=(e=function(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,o={areArraysEqual:n?O:v,areDatesEqual:m,areErrorsEqual:b,areFunctionsEqual:g,areMapsEqual:n?l(x,O):x,areNumbersEqual:h,areObjectsEqual:n?O:w,arePrimitiveWrappersEqual:j,areRegExpsEqual:S,areSetsEqual:n?l(P,O):P,areTypedArraysEqual:n?O:E,areUrlsEqual:k,unknownTagComparators:void 0};if(r&&(o=_({},o,r(o))),e){var i=s(o.areArraysEqual),a=s(o.areMapsEqual),u=s(o.areObjectsEqual),c=s(o.areSetsEqual);o=_({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:u,areSetsEqual:c})}return o}(t)).areArraysEqual,n=e.areDatesEqual,o=e.areErrorsEqual,i=e.areFunctionsEqual,a=e.areMapsEqual,u=e.areNumbersEqual,c=e.areObjectsEqual,f=e.arePrimitiveWrappersEqual,p=e.areRegExpsEqual,d=e.areSetsEqual,y=e.areTypedArraysEqual,A=e.areUrlsEqual,N=e.unknownTagComparators,function(t,e,l){if(t===e)return!0;if(null==t||null==e)return!1;var s=typeof t;if(s!==typeof e)return!1;if("object"!==s)return"number"===s?u(t,e,l):"function"===s&&i(t,e,l);var h=t.constructor;if(h!==e.constructor)return!1;if(h===Object)return c(t,e,l);if(M(t))return r(t,e,l);if(null!=T&&T(t))return y(t,e,l);if(h===Date)return n(t,e,l);if(h===RegExp)return p(t,e,l);if(h===Map)return a(t,e,l);if(h===Set)return d(t,e,l);var v=C(t);if("[object Date]"===v)return n(t,e,l);if("[object RegExp]"===v)return p(t,e,l);if("[object Map]"===v)return a(t,e,l);if("[object Set]"===v)return d(t,e,l);if("[object Object]"===v)return"function"!=typeof t.then&&"function"!=typeof e.then&&c(t,e,l);if("[object URL]"===v)return A(t,e,l);if("[object Error]"===v)return o(t,e,l);if("[object Arguments]"===v)return c(t,e,l);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return f(t,e,l);if(N){var m=N[v];if(!m){var b=null!=t?t[Symbol.toStringTag]:void 0;b&&(m=N[b])}if(m)return m(t,e,l)}return!1}),z=I?I(R):function(t,e,r,n,o,i,a){return R(t,e,a)};return function(t){var e=t.circular,r=t.comparator,n=t.createState,o=t.equals,i=t.strict;if(n)return function(t,a){var u=n(),c=u.cache;return r(t,a,{cache:void 0===c?e?new WeakMap:void 0:c,equals:o,meta:u.meta,strict:i})};if(e)return function(t,e){return r(t,e,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(t,e){return r(t,e,a)}}({circular:void 0!==D&&D,comparator:R,createState:L,equals:z,strict:void 0!==B&&B})}function I(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1;requestAnimationFrame(function n(o){if(r<0&&(r=o),o-r>e)t(o),r=-1;else{var i;i=n,"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(i)}})}function L(t){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r=0&&t<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",n);var p=V(i,u),h=V(a,c),d=(t=i,e=u,function(r){var n;return G([].concat(function(t){if(Array.isArray(t))return H(t)}(n=X(t,e).map(function(t,e){return t*e}).slice(1))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||Y(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),r)}),y=function(t){for(var e=t>1?1:t,r=e,n=0;n<8;++n){var o,i=p(r)-e,a=d(r);if(1e-4>Math.abs(i-e)||a<1e-4)break;r=(o=r-i/a)>1?1:o<0?0:o}return h(r)};return y.isStepper=!1,y},Q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.stiff,r=void 0===e?100:e,n=t.damping,o=void 0===n?8:n,i=t.dt,a=void 0===i?17:i,u=function(t,e,n){var i=n+(-(t-e)*r-n*o)*a/1e3,u=n*a/1e3+t;return 1e-4>Math.abs(u-e)&&1e-4>Math.abs(i)?[e,0]:[u,i]};return u.isStepper=!0,u.dt=a,u},J=function(){for(var t=arguments.length,e=Array(t),r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r0?r[o-1]:n,p=l||Object.keys(c);if("function"==typeof u||"spring"===u)return[].concat(th(t),[e.runJSAnimation.bind(e,{from:f.style,to:c,duration:i,easing:u}),i]);var h=Z(p,i,u),d=tv(tv(tv({},f.style),c),{},{transition:h});return[].concat(th(t),[d,i,s]).filter(F)},[a,Math.max(void 0===u?0:u,n)])),[t.onAnimationEnd]))}},{key:"runAnimation",value:function(t){if(!this.manager){var e,r,n;this.manager=(e=function(){return null},r=!1,n=function t(n){if(!r){if(Array.isArray(n)){if(!n.length)return;var o=function(t){if(Array.isArray(t))return t}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return B(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return B(t,void 0)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],a=o.slice(1);if("number"==typeof i){I(t.bind(null,a),i);return}t(i),I(t.bind(null,a));return}"object"===L(n)&&e(n),"function"==typeof n&&n()}},{stop:function(){r=!0},start:function(t){r=!1,n(t)},subscribe:function(t){return e=t,function(){e=function(){return null}}}})}var o=t.begin,i=t.duration,a=t.attributeName,u=t.to,c=t.easing,l=t.onAnimationStart,s=t.onAnimationEnd,f=t.steps,p=t.children,h=this.manager;if(this.unSubscribe=h.subscribe(this.handleStyleChange),"function"==typeof c||"function"==typeof p||"spring"===c){this.runJSAnimation(t);return}if(f.length>1){this.runStepAnimation(t);return}var d=a?tm({},a,u):u,y=Z(Object.keys(d),i,c);h.start([l,o,tv(tv({},d),{},{transition:y}),i,s])}},{key:"render",value:function(){var t=this.props,e=t.children,r=(t.begin,t.duration),o=(t.attributeName,t.easing,t.isActive),i=(t.steps,t.from,t.to,t.canBegin,t.onAnimationEnd,t.shouldReAnimate,t.onAnimationReStart,function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},i=Object.keys(t);for(n=0;n=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,tp)),a=n.Children.count(e),u=this.state.style;if("function"==typeof e)return e(u);if(!o||0===a||r<=0)return e;var c=function(t){var e=t.props,r=e.style,o=e.className;return(0,n.cloneElement)(t,tv(tv({},i),{},{style:tv(tv({},void 0===r?{}:r),u),className:o}))};return 1===a?c(n.Children.only(e)):n.createElement("div",null,n.Children.map(e,function(t){return c(t)}))}}],function(t,e){for(var r=0;r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,w),i=parseInt("".concat(r),10),a=parseInt("".concat(n),10),u=parseInt("".concat(e.height||o.height),10),c=parseInt("".concat(e.width||o.width),10);return P(P(P(P(P({},e),o),i?{x:i}:{}),a?{y:a}:{}),{},{height:u,width:c,name:e.name,radius:e.radius})}function k(t){return n.createElement(x.bn,j({shapeType:"rectangle",propTransformer:E,activeClassName:"recharts-active-bar"},t))}var A=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(r,n){if("number"==typeof t)return t;var o=(0,d.hj)(r)||(0,d.Rw)(r);return o?t(r,n):(o||(0,g.Z)(!1),e)}},M=["value","background"];function T(t){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(){return(_=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,M);if(!u)return null;var l=N(N(N(N(N({},c),{},{fill:"#eee"},u),a),(0,b.bw)(t.props,e,r)),{},{onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd,dataKey:o,index:r,className:"recharts-bar-background-rectangle"});return n.createElement(k,_({key:"background-bar-".concat(r),option:t.props.background,isActive:r===i},l))})}},{key:"renderErrorBar",value:function(t,e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,o=r.data,i=r.xAxis,a=r.yAxis,u=r.layout,c=r.children,l=(0,y.NN)(c,f.W);if(!l)return null;var p="vertical"===u?o[0].height/2:o[0].width/2,h=function(t,e){var r=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:r,errorVal:(0,m.F$)(t,e)}};return n.createElement(s.m,{clipPath:t?"url(#clipPath-".concat(e,")"):null},l.map(function(t){return n.cloneElement(t,{key:"error-bar-".concat(e,"-").concat(t.props.dataKey),data:o,xAxis:i,yAxis:a,layout:u,offset:p,dataPointFormatter:h})}))}},{key:"render",value:function(){var t=this.props,e=t.hide,r=t.data,i=t.className,a=t.xAxis,u=t.yAxis,c=t.left,f=t.top,p=t.width,d=t.height,y=t.isAnimationActive,v=t.background,m=t.id;if(e||!r||!r.length)return null;var b=this.state.isAnimationFinished,g=(0,o.Z)("recharts-bar",i),x=a&&a.allowDataOverflow,w=u&&u.allowDataOverflow,O=x||w,j=l()(m)?this.id:m;return n.createElement(s.m,{className:g},x||w?n.createElement("defs",null,n.createElement("clipPath",{id:"clipPath-".concat(j)},n.createElement("rect",{x:x?c:c-p/2,y:w?f:f-d/2,width:x?p:2*p,height:w?d:2*d}))):null,n.createElement(s.m,{className:"recharts-bar-rectangles",clipPath:O?"url(#clipPath-".concat(j,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(O,j),(!y||b)&&h.e.renderCallByParent(this.props,r))}}],r=[{key:"getDerivedStateFromProps",value:function(t,e){return t.animationId!==e.prevAnimationId?{prevAnimationId:t.animationId,curData:t.data,prevData:e.curData}:t.data!==e.curData?{curData:t.data}:null}}],e&&D(a.prototype,e),r&&D(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}(n.PureComponent);R(U,"displayName","Bar"),R(U,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!v.x.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),R(U,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,o=t.bandSize,i=t.xAxis,a=t.yAxis,u=t.xAxisTicks,c=t.yAxisTicks,l=t.stackedData,s=t.dataStartIndex,f=t.displayedData,h=t.offset,v=(0,m.Bu)(n,r);if(!v)return null;var b=e.layout,g=r.type.defaultProps,x=void 0!==g?N(N({},g),r.props):r.props,w=x.dataKey,O=x.children,j=x.minPointSize,S="horizontal"===b?a:i,P=l?S.scale.domain():null,E=(0,m.Yj)({numericAxis:S}),k=(0,y.NN)(O,p.b),M=f.map(function(t,e){l?f=(0,m.Vv)(l[s+e],P):Array.isArray(f=(0,m.F$)(t,w))||(f=[E,f]);var n=A(j,U.defaultProps.minPointSize)(f[1],e);if("horizontal"===b){var f,p,h,y,g,x,O,S=[a.scale(f[0]),a.scale(f[1])],M=S[0],T=S[1];p=(0,m.Fy)({axis:i,ticks:u,bandSize:o,offset:v.offset,entry:t,index:e}),h=null!==(O=null!=T?T:M)&&void 0!==O?O:void 0,y=v.size;var _=M-T;if(g=Number.isNaN(_)?0:_,x={x:p,y:a.y,width:y,height:a.height},Math.abs(n)>0&&Math.abs(g)0&&Math.abs(y)=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function P(t,e){for(var r=0;r0?this.props:d)),o<=0||a<=0||!y||!y.length)?null:n.createElement(s.m,{className:(0,c.Z)("recharts-cartesian-axis",l),ref:function(e){t.layerReference=e}},r&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),p._.renderCallByParent(this.props))}}],r=[{key:"renderTickItem",value:function(t,e,r){var o=(0,c.Z)(e.className,"recharts-cartesian-axis-tick-value");return n.isValidElement(t)?n.cloneElement(t,j(j({},e),{},{className:o})):i()(t)?t(j(j({},e),{},{className:o})):n.createElement(f.x,w({},e,{className:"recharts-cartesian-axis-tick-value"}),r)}}],e&&P(o.prototype,e),r&&P(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}(n.Component);M(_,"displayName","CartesianAxis"),M(_,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"})},56940:function(t,e,r){"use strict";r.d(e,{q:function(){return M}});var n=r(2265),o=r(86757),i=r.n(o),a=r(1175),u=r(16630),c=r(82944),l=r(85355),s=r(78242),f=r(80285),p=r(25739),h=["x1","y1","x2","y2","key"],d=["offset"];function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function m(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var x=function(t){var e=t.fill;if(!e||"none"===e)return null;var r=t.fillOpacity,o=t.x,i=t.y,a=t.width,u=t.height,c=t.ry;return n.createElement("rect",{x:o,y:i,ry:c,width:a,height:u,stroke:"none",fill:e,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function w(t,e){var r;if(n.isValidElement(t))r=n.cloneElement(t,e);else if(i()(t))r=t(e);else{var o=e.x1,a=e.y1,u=e.x2,l=e.y2,s=e.key,f=g(e,h),p=(0,c.L6)(f,!1),y=(p.offset,g(p,d));r=n.createElement("line",b({},y,{x1:o,y1:a,x2:u,y2:l,fill:"none",key:s}))}return r}function O(t){var e=t.x,r=t.width,o=t.horizontal,i=void 0===o||o,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var u=a.map(function(n,o){return w(i,m(m({},t),{},{x1:e,y1:n,x2:e+r,y2:n,key:"line-".concat(o),index:o}))});return n.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function j(t){var e=t.y,r=t.height,o=t.vertical,i=void 0===o||o,a=t.verticalPoints;if(!i||!a||!a.length)return null;var u=a.map(function(n,o){return w(i,m(m({},t),{},{x1:n,y1:e,x2:n,y2:e+r,key:"line-".concat(o),index:o}))});return n.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function S(t){var e=t.horizontalFill,r=t.fillOpacity,o=t.x,i=t.y,a=t.width,u=t.height,c=t.horizontalPoints,l=t.horizontal;if(!(void 0===l||l)||!e||!e.length)return null;var s=c.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,c){var l=s[c+1]?s[c+1]-t:i+u-t;if(l<=0)return null;var f=c%e.length;return n.createElement("rect",{key:"react-".concat(c),y:t,x:o,height:l,width:a,stroke:"none",fill:e[f],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return n.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function P(t){var e=t.vertical,r=t.verticalFill,o=t.fillOpacity,i=t.x,a=t.y,u=t.width,c=t.height,l=t.verticalPoints;if(!(void 0===e||e)||!r||!r.length)return null;var s=l.map(function(t){return Math.round(t+i-i)}).sort(function(t,e){return t-e});i!==s[0]&&s.unshift(0);var f=s.map(function(t,e){var l=s[e+1]?s[e+1]-t:i+u-t;if(l<=0)return null;var f=e%r.length;return n.createElement("rect",{key:"react-".concat(e),x:t,y:a,width:l,height:c,stroke:"none",fill:r[f],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return n.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var E=function(t,e){var r=t.xAxis,n=t.width,o=t.height,i=t.offset;return(0,l.Rf)((0,s.f)(m(m(m({},f.O.defaultProps),r),{},{ticks:(0,l.uY)(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.left,i.left+i.width,e)},k=function(t,e){var r=t.yAxis,n=t.width,o=t.height,i=t.offset;return(0,l.Rf)((0,s.f)(m(m(m({},f.O.defaultProps),r),{},{ticks:(0,l.uY)(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.top,i.top+i.height,e)},A={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function M(t){var e,r,o,c,l,s,f=(0,p.zn)(),h=(0,p.Mw)(),d=(0,p.qD)(),v=m(m({},t),{},{stroke:null!==(e=t.stroke)&&void 0!==e?e:A.stroke,fill:null!==(r=t.fill)&&void 0!==r?r:A.fill,horizontal:null!==(o=t.horizontal)&&void 0!==o?o:A.horizontal,horizontalFill:null!==(c=t.horizontalFill)&&void 0!==c?c:A.horizontalFill,vertical:null!==(l=t.vertical)&&void 0!==l?l:A.vertical,verticalFill:null!==(s=t.verticalFill)&&void 0!==s?s:A.verticalFill,x:(0,u.hj)(t.x)?t.x:d.left,y:(0,u.hj)(t.y)?t.y:d.top,width:(0,u.hj)(t.width)?t.width:d.width,height:(0,u.hj)(t.height)?t.height:d.height}),g=v.x,w=v.y,M=v.width,T=v.height,_=v.syncWithTicks,C=v.horizontalValues,N=v.verticalValues,D=(0,p.CW)(),I=(0,p.Nf)();if(!(0,u.hj)(M)||M<=0||!(0,u.hj)(T)||T<=0||!(0,u.hj)(g)||g!==+g||!(0,u.hj)(w)||w!==+w)return null;var L=v.verticalCoordinatesGenerator||E,B=v.horizontalCoordinatesGenerator||k,R=v.horizontalPoints,z=v.verticalPoints;if((!R||!R.length)&&i()(B)){var U=C&&C.length,$=B({yAxis:I?m(m({},I),{},{ticks:U?C:I.ticks}):void 0,width:f,height:h,offset:d},!!U||_);(0,a.Z)(Array.isArray($),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(y($),"]")),Array.isArray($)&&(R=$)}if((!z||!z.length)&&i()(L)){var F=N&&N.length,q=L({xAxis:D?m(m({},D),{},{ticks:F?N:D.ticks}):void 0,width:f,height:h,offset:d},!!F||_);(0,a.Z)(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(y(q),"]")),Array.isArray(q)&&(z=q)}return n.createElement("g",{className:"recharts-cartesian-grid"},n.createElement(x,{fill:v.fill,fillOpacity:v.fillOpacity,x:v.x,y:v.y,width:v.width,height:v.height,ry:v.ry}),n.createElement(O,b({},v,{offset:d,horizontalPoints:R,xAxis:D,yAxis:I})),n.createElement(j,b({},v,{offset:d,verticalPoints:z,xAxis:D,yAxis:I})),n.createElement(S,b({},v,{horizontalPoints:R})),n.createElement(P,b({},v,{verticalPoints:z})))}M.displayName="CartesianGrid"},13137:function(t,e,r){"use strict";r.d(e,{W:function(){return v}});var n=r(2265),o=r(69398),i=r(9841),a=r(82944),u=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){return(l=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,u),m=(0,a.L6)(v,!1);"x"===this.props.direction&&"number"!==d.type&&(0,o.Z)(!1);var b=p.map(function(t){var o,a,u=h(t,f),p=u.x,v=u.y,b=u.value,g=u.errorVal;if(!g)return null;var x=[];if(Array.isArray(g)){var w=function(t){if(Array.isArray(t))return t}(g)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{for(i=(r=r.call(t)).next;!(c=(n=i.call(r)).done)&&(u.push(n.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(g,2)||function(t,e){if(t){if("string"==typeof t)return s(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,2)}}(g,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();o=w[0],a=w[1]}else o=a=g;if("vertical"===r){var O=d.scale,j=v+e,S=j+c,P=j-c,E=O(b-o),k=O(b+a);x.push({x1:k,y1:S,x2:k,y2:P}),x.push({x1:E,y1:j,x2:k,y2:j}),x.push({x1:E,y1:S,x2:E,y2:P})}else if("horizontal"===r){var A=y.scale,M=p+e,T=M-c,_=M+c,C=A(b-o),N=A(b+a);x.push({x1:T,y1:N,x2:_,y2:N}),x.push({x1:M,y1:C,x2:M,y2:N}),x.push({x1:T,y1:C,x2:_,y2:C})}return n.createElement(i.m,l({className:"recharts-errorBar",key:"bar-".concat(x.map(function(t){return"".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))},m),x.map(function(t){return n.createElement("line",l({},t,{key:"line-".concat(t.x1,"-").concat(t.x2,"-").concat(t.y1,"-").concat(t.y2)}))}))});return n.createElement(i.m,{className:"recharts-errorBars"},b)}}],function(t,e){for(var r=0;rt*o)return!1;var i=r();return t*(e-t*i/2-n)>=0&&t*(e+t*i/2-o)<=0}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function h(t){for(var e=1;e=2?(0,i.uY)(m[1].coordinate-m[0].coordinate):1,M=(n="width"===P,f=b.x,p=b.y,d=b.width,y=b.height,1===A?{start:n?f:p,end:n?f+d:p+y}:{start:n?f+d:p+y,end:n?f:p});return"equidistantPreserveStart"===w?function(t,e,r,n,o){for(var i,a=(n||[]).slice(),u=e.start,c=e.end,f=0,p=1,h=u;p<=a.length;)if(i=function(){var e,i=null==n?void 0:n[f];if(void 0===i)return{v:l(n,p)};var a=f,d=function(){return void 0===e&&(e=r(i,a)),e},y=i.coordinate,v=0===f||s(t,y,d,h,c);v||(f=0,h=u,p+=1),v&&(h=y+t*(d()/2+o),f+=p)}())return i.v;return[]}(A,M,k,m,g):("preserveStart"===w||"preserveStartEnd"===w?function(t,e,r,n,o,i){var a=(n||[]).slice(),u=a.length,c=e.start,l=e.end;if(i){var f=n[u-1],p=r(f,u-1),d=t*(f.coordinate+t*p/2-l);a[u-1]=f=h(h({},f),{},{tickCoord:d>0?f.coordinate-d*t:f.coordinate}),s(t,f.tickCoord,function(){return p},c,l)&&(l=f.tickCoord-t*(p/2+o),a[u-1]=h(h({},f),{},{isShow:!0}))}for(var y=i?u-1:u,v=function(e){var n,i=a[e],u=function(){return void 0===n&&(n=r(i,e)),n};if(0===e){var f=t*(i.coordinate-t*u()/2-c);a[e]=i=h(h({},i),{},{tickCoord:f<0?i.coordinate-f*t:i.coordinate})}else a[e]=i=h(h({},i),{},{tickCoord:i.coordinate});s(t,i.tickCoord,u,c,l)&&(c=i.tickCoord+t*(u()/2+o),a[e]=h(h({},i),{},{isShow:!0}))},m=0;m0?l.coordinate-p*t:l.coordinate})}else i[e]=l=h(h({},l),{},{tickCoord:l.coordinate});s(t,l.tickCoord,f,u,c)&&(c=l.tickCoord-t*(f()/2+o),i[e]=h(h({},l),{},{isShow:!0}))},f=a-1;f>=0;f--)l(f);return i}(A,M,k,m,g)).filter(function(t){return t.isShow})}},93765:function(t,e,r){"use strict";r.d(e,{z:function(){return eD}});var n,o,i=r(2265),a=r(77571),u=r.n(a),c=r(86757),l=r.n(c),s=r(99676),f=r.n(s),p=r(13735),h=r.n(p),d=r(34935),y=r.n(d),v=r(37065),m=r.n(v),b=r(87602),g=r(69398),x=r(48777),w=r(9841),O=r(8147),j=r(22190),S=r(81889),P=r(73649),E=r(82944),k=r(55284),A=r(58811),M=r(85355),T=r(16630);function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function N(t){for(var e=1;e0&&e.handleDrag(t.changedTouches[0])}),W(e,"handleDragEnd",function(){e.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var t=e.props,r=t.endIndex,n=t.onDragEnd,o=t.startIndex;null==n||n({endIndex:r,startIndex:o})}),e.detachDragEndListener()}),W(e,"handleLeaveWrapper",function(){(e.state.isTravellerMoving||e.state.isSlideMoving)&&(e.leaveTimer=window.setTimeout(e.handleDragEnd,e.props.leaveTimeOut))}),W(e,"handleEnterSlideOrTraveller",function(){e.setState({isTextActive:!0})}),W(e,"handleLeaveSlideOrTraveller",function(){e.setState({isTextActive:!1})}),W(e,"handleSlideDragStart",function(t){var r=X(t)?t.changedTouches[0]:t;e.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:r.pageX}),e.attachDragEndListener()}),e.travellerDragStartHandlers={startX:e.handleTravellerDragStart.bind(e,"startX"),endX:e.handleTravellerDragStart.bind(e,"endX")},e.state={},e}return!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Z(t,e)}(n,t),e=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(t){var e=t.startX,r=t.endX,o=this.state.scaleValues,i=this.props,a=i.gap,u=i.data.length-1,c=n.getIndexInRange(o,Math.min(e,r)),l=n.getIndexInRange(o,Math.max(e,r));return{startIndex:c-c%a,endIndex:l===u?u:l-l%a}}},{key:"getTextOfTick",value:function(t){var e=this.props,r=e.data,n=e.tickFormatter,o=e.dataKey,i=(0,M.F$)(r[t],o,t);return l()(n)?n(i,t):i}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(t){var e=this.state,r=e.slideMoveStartX,n=e.startX,o=e.endX,i=this.props,a=i.x,u=i.width,c=i.travellerWidth,l=i.startIndex,s=i.endIndex,f=i.onChange,p=t.pageX-r;p>0?p=Math.min(p,a+u-c-o,a+u-c-n):p<0&&(p=Math.max(p,a-n,a-o));var h=this.getIndex({startX:n+p,endX:o+p});(h.startIndex!==l||h.endIndex!==s)&&f&&f(h),this.setState({startX:n+p,endX:o+p,slideMoveStartX:t.pageX})}},{key:"handleTravellerDragStart",value:function(t,e){var r=X(e)?e.changedTouches[0]:e;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:t,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(t){var e=this.state,r=e.brushMoveStartX,n=e.movingTravellerId,o=e.endX,i=e.startX,a=this.state[n],u=this.props,c=u.x,l=u.width,s=u.travellerWidth,f=u.onChange,p=u.gap,h=u.data,d={startX:this.state.startX,endX:this.state.endX},y=t.pageX-r;y>0?y=Math.min(y,c+l-s-a):y<0&&(y=Math.max(y,c-a)),d[n]=a+y;var v=this.getIndex(d),m=v.startIndex,b=v.endIndex,g=function(){var t=h.length-1;return"startX"===n&&(o>i?m%p==0:b%p==0)||oi?b%p==0:m%p==0)||o>i&&b===t};this.setState(W(W({},n,a+y),"brushMoveStartX",t.pageX),function(){f&&g()&&f(v)})}},{key:"handleTravellerMoveKeyboard",value:function(t,e){var r=this,n=this.state,o=n.scaleValues,i=n.startX,a=n.endX,u=this.state[e],c=o.indexOf(u);if(-1!==c){var l=c+t;if(-1!==l&&!(l>=o.length)){var s=o[l];"startX"===e&&s>=a||"endX"===e&&s<=i||this.setState(W({},e,s),function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))})}}}},{key:"renderBackground",value:function(){var t=this.props,e=t.x,r=t.y,n=t.width,o=t.height,a=t.fill,u=t.stroke;return i.createElement("rect",{stroke:u,fill:a,x:e,y:r,width:n,height:o})}},{key:"renderPanorama",value:function(){var t=this.props,e=t.x,r=t.y,n=t.width,o=t.height,a=t.data,u=t.children,c=t.padding,l=i.Children.only(u);return l?i.cloneElement(l,{x:e,y:r,width:n,height:o,margin:c,compact:!0,data:a}):null}},{key:"renderTravellerLayer",value:function(t,e){var r,o,a=this,u=this.props,c=u.y,l=u.travellerWidth,s=u.height,f=u.traveller,p=u.ariaLabel,h=u.data,d=u.startIndex,y=u.endIndex,v=Math.max(t,this.props.x),m=U(U({},(0,E.L6)(this.props,!1)),{},{x:v,y:c,width:l,height:s}),b=p||"Min value: ".concat(null===(r=h[d])||void 0===r?void 0:r.name,", Max value: ").concat(null===(o=h[y])||void 0===o?void 0:o.name);return i.createElement(w.m,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":t,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[e],onTouchStart:this.travellerDragStartHandlers[e],onKeyDown:function(t){["ArrowLeft","ArrowRight"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),a.handleTravellerMoveKeyboard("ArrowRight"===t.key?1:-1,e))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},n.renderTraveller(f,m))}},{key:"renderSlide",value:function(t,e){var r=this.props,n=r.y,o=r.height,a=r.stroke,u=r.travellerWidth;return i.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:a,fillOpacity:.2,x:Math.min(t,e)+u,y:n,width:Math.max(Math.abs(e-t)-u,0),height:o})}},{key:"renderText",value:function(){var t=this.props,e=t.startIndex,r=t.endIndex,n=t.y,o=t.height,a=t.travellerWidth,u=t.stroke,c=this.state,l=c.startX,s=c.endX,f={pointerEvents:"none",fill:u};return i.createElement(w.m,{className:"recharts-brush-texts"},i.createElement(A.x,R({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,s)-5,y:n+o/2},f),this.getTextOfTick(e)),i.createElement(A.x,R({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,s)+a+5,y:n+o/2},f),this.getTextOfTick(r)))}},{key:"render",value:function(){var t=this.props,e=t.data,r=t.className,n=t.children,o=t.x,a=t.y,u=t.width,c=t.height,l=t.alwaysShowText,s=this.state,f=s.startX,p=s.endX,h=s.isTextActive,d=s.isSlideMoving,y=s.isTravellerMoving,v=s.isTravellerFocused;if(!e||!e.length||!(0,T.hj)(o)||!(0,T.hj)(a)||!(0,T.hj)(u)||!(0,T.hj)(c)||u<=0||c<=0)return null;var m=(0,b.Z)("recharts-brush",r),g=1===i.Children.count(n),x=L("userSelect","none");return i.createElement(w.m,{className:m,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:x},this.renderBackground(),g&&this.renderPanorama(),this.renderSlide(f,p),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(p,"endX"),(h||d||y||v||l)&&this.renderText())}}],r=[{key:"renderDefaultTraveller",value:function(t){var e=t.x,r=t.y,n=t.width,o=t.height,a=t.stroke,u=Math.floor(r+o/2)-1;return i.createElement(i.Fragment,null,i.createElement("rect",{x:e,y:r,width:n,height:o,fill:a,stroke:"none"}),i.createElement("line",{x1:e+1,y1:u,x2:e+n-1,y2:u,fill:"none",stroke:"#fff"}),i.createElement("line",{x1:e+1,y1:u+2,x2:e+n-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(t,e){return i.isValidElement(t)?i.cloneElement(t,e):l()(t)?t(e):n.renderDefaultTraveller(e)}},{key:"getDerivedStateFromProps",value:function(t,e){var r=t.data,n=t.width,o=t.x,i=t.travellerWidth,a=t.updateId,u=t.startIndex,c=t.endIndex;if(r!==e.prevData||a!==e.prevUpdateId)return U({prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n},r&&r.length?H({data:r,width:n,x:o,travellerWidth:i,startIndex:u,endIndex:c}):{scale:null,scaleValues:null});if(e.scale&&(n!==e.prevWidth||o!==e.prevX||i!==e.prevTravellerWidth)){e.scale.range([o,o+n-i]);var l=e.scale.domain().map(function(t){return e.scale(t)});return{prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n,startX:e.scale(t.startIndex),endX:e.scale(t.endIndex),scaleValues:l}}return null}},{key:"getIndexInRange",value:function(t,e){for(var r=t.length,n=0,o=r-1;o-n>1;){var i=Math.floor((n+o)/2);t[i]>e?o=i:n=i}return e>=t[o]?o:n}}],e&&$(n.prototype,e),r&&$(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}(i.PureComponent);W(G,"displayName","Brush"),W(G,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var V=r(4094),K=r(38569),Q=r(26680),J=function(t,e){var r=t.alwaysShow,n=t.ifOverflow;return r&&(n="extendDomain"),n===e},tt=r(25311),te=r(1175);function tr(){return(tr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,t2));return(0,T.hj)(r)&&(0,T.hj)(o)&&(0,T.hj)(f)&&(0,T.hj)(h)&&(0,T.hj)(u)&&(0,T.hj)(l)?i.createElement("path",t5({},(0,E.L6)(y,!0),{className:(0,b.Z)("recharts-cross",d),d:"M".concat(r,",").concat(u,"v").concat(h,"M").concat(l,",").concat(o,"h").concat(f)})):null};function t7(t){var e=t.cx,r=t.cy,n=t.radius,o=t.startAngle,i=t.endAngle;return{points:[(0,tq.op)(e,r,n,o),(0,tq.op)(e,r,n,i)],cx:e,cy:r,radius:n,startAngle:o,endAngle:i}}var t8=r(60474);function t4(t){return(t4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t9(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function et(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function ec(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ec=function(){return!!t})()}function el(t){return(el=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function es(t,e){return(es=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function ef(t){return function(t){if(Array.isArray(t))return eh(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ep(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ep(t,e){if(t){if("string"==typeof t)return eh(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eh(t,e)}}function eh(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0?i:t&&t.length&&(0,T.hj)(n)&&(0,T.hj)(o)?t.slice(n,o+1):[]};function eS(t){return"number"===t?[0,"auto"]:void 0}var eP=function(t,e,r,n){var o=t.graphicalItems,i=t.tooltipAxis,a=ej(e,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(o,u){var c,l,s=null!==(c=u.props.data)&&void 0!==c?c:e;if(s&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(s=s.slice(t.dataStartIndex,t.dataEndIndex+1)),i.dataKey&&!i.allowDuplicatedCategory){var f=void 0===s?a:s;l=(0,T.Ap)(f,i.dataKey,n)}else l=s&&s[r]||a[r];return l?[].concat(ef(o),[(0,M.Qo)(u,l)]):o},[])},eE=function(t,e,r,n){var o=n||{x:t.chartX,y:t.chartY},i="horizontal"===r?o.x:"vertical"===r?o.y:"centric"===r?o.angle:o.radius,a=t.orderedTooltipTicks,u=t.tooltipAxis,c=t.tooltipTicks,l=(0,M.VO)(i,a,c,u);if(l>=0&&c){var s=c[l]&&c[l].value,f=eP(t,e,l,s),p=eO(r,a,l,o);return{activeTooltipIndex:l,activeLabel:s,activePayload:f,activeCoordinate:p}}return null},ek=function(t,e){var r=e.axes,n=e.graphicalItems,o=e.axisType,i=e.axisIdKey,a=e.stackGroups,c=e.dataStartIndex,l=e.dataEndIndex,s=t.layout,p=t.children,h=t.stackOffset,d=(0,M.NA)(s,o);return r.reduce(function(e,r){var y=void 0!==r.type.defaultProps?ey(ey({},r.type.defaultProps),r.props):r.props,v=y.type,m=y.dataKey,b=y.allowDataOverflow,g=y.allowDuplicatedCategory,x=y.scale,w=y.ticks,O=y.includeHidden,j=y[i];if(e[j])return e;var S=ej(t.data,{graphicalItems:n.filter(function(t){var e;return(i in t.props?t.props[i]:null===(e=t.type.defaultProps)||void 0===e?void 0:e[i])===j}),dataStartIndex:c,dataEndIndex:l}),P=S.length;(function(t,e,r){if("number"===r&&!0===e&&Array.isArray(t)){var n=null==t?void 0:t[0],o=null==t?void 0:t[1];if(n&&o&&(0,T.hj)(n)&&(0,T.hj)(o))return!0}return!1})(y.domain,b,v)&&(A=(0,M.LG)(y.domain,null,b),d&&("number"===v||"auto"!==x)&&(C=(0,M.gF)(S,m,"category")));var E=eS(v);if(!A||0===A.length){var k,A,_,C,N,D=null!==(N=y.domain)&&void 0!==N?N:E;if(m){if(A=(0,M.gF)(S,m,v),"category"===v&&d){var I=(0,T.bv)(A);g&&I?(_=A,A=f()(0,P)):g||(A=(0,M.ko)(D,A,r).reduce(function(t,e){return t.indexOf(e)>=0?t:[].concat(ef(t),[e])},[]))}else if("category"===v)A=g?A.filter(function(t){return""!==t&&!u()(t)}):(0,M.ko)(D,A,r).reduce(function(t,e){return t.indexOf(e)>=0||""===e||u()(e)?t:[].concat(ef(t),[e])},[]);else if("number"===v){var L=(0,M.ZI)(S,n.filter(function(t){var e,r,n=i in t.props?t.props[i]:null===(e=t.type.defaultProps)||void 0===e?void 0:e[i],o="hide"in t.props?t.props.hide:null===(r=t.type.defaultProps)||void 0===r?void 0:r.hide;return n===j&&(O||!o)}),m,o,s);L&&(A=L)}d&&("number"===v||"auto"!==x)&&(C=(0,M.gF)(S,m,"category"))}else A=d?f()(0,P):a&&a[j]&&a[j].hasStack&&"number"===v?"expand"===h?[0,1]:(0,M.EB)(a[j].stackGroups,c,l):(0,M.s6)(S,n.filter(function(t){var e=i in t.props?t.props[i]:t.type.defaultProps[i],r="hide"in t.props?t.props.hide:t.type.defaultProps.hide;return e===j&&(O||!r)}),v,s,!0);"number"===v?(A=tF(p,A,j,o,w),D&&(A=(0,M.LG)(D,A,b))):"category"===v&&D&&A.every(function(t){return D.indexOf(t)>=0})&&(A=D)}return ey(ey({},e),{},ev({},j,ey(ey({},y),{},{axisType:o,domain:A,categoricalDomain:C,duplicateDomain:_,originalDomain:null!==(k=y.domain)&&void 0!==k?k:E,isCategorical:d,layout:s})))},{})},eA=function(t,e){var r=e.graphicalItems,n=e.Axis,o=e.axisType,i=e.axisIdKey,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,l=t.layout,s=t.children,p=ej(t.data,{graphicalItems:r,dataStartIndex:u,dataEndIndex:c}),d=p.length,y=(0,M.NA)(l,o),v=-1;return r.reduce(function(t,e){var m,b=(void 0!==e.type.defaultProps?ey(ey({},e.type.defaultProps),e.props):e.props)[i],g=eS("number");return t[b]?t:(v++,m=y?f()(0,d):a&&a[b]&&a[b].hasStack?tF(s,m=(0,M.EB)(a[b].stackGroups,u,c),b,o):tF(s,m=(0,M.LG)(g,(0,M.s6)(p,r.filter(function(t){var e,r,n=i in t.props?t.props[i]:null===(e=t.type.defaultProps)||void 0===e?void 0:e[i],o="hide"in t.props?t.props.hide:null===(r=t.type.defaultProps)||void 0===r?void 0:r.hide;return n===b&&!o}),"number",l),n.defaultProps.allowDataOverflow),b,o),ey(ey({},t),{},ev({},b,ey(ey({axisType:o},n.defaultProps),{},{hide:!0,orientation:h()(eb,"".concat(o,".").concat(v%2),null),domain:m,originalDomain:g,isCategorical:y,layout:l}))))},{})},eM=function(t,e){var r=e.axisType,n=void 0===r?"xAxis":r,o=e.AxisComp,i=e.graphicalItems,a=e.stackGroups,u=e.dataStartIndex,c=e.dataEndIndex,l=t.children,s="".concat(n,"Id"),f=(0,E.NN)(l,o),p={};return f&&f.length?p=ek(t,{axes:f,graphicalItems:i,axisType:n,axisIdKey:s,stackGroups:a,dataStartIndex:u,dataEndIndex:c}):i&&i.length&&(p=eA(t,{Axis:o,graphicalItems:i,axisType:n,axisIdKey:s,stackGroups:a,dataStartIndex:u,dataEndIndex:c})),p},eT=function(t){var e=(0,T.Kt)(t),r=(0,M.uY)(e,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:y()(r,function(t){return t.coordinate}),tooltipAxis:e,tooltipAxisBandSize:(0,M.zT)(e,r)}},e_=function(t){var e=t.children,r=t.defaultShowTooltip,n=(0,E.sP)(e,G),o=0,i=0;return t.data&&0!==t.data.length&&(i=t.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(o=n.props.startIndex),n.props.endIndex>=0&&(i=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:!!r}},eC=function(t){return"horizontal"===t?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===t?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===t?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},eN=function(t,e){var r=t.props,n=t.graphicalItems,o=t.xAxisMap,i=void 0===o?{}:o,a=t.yAxisMap,u=void 0===a?{}:a,c=r.width,l=r.height,s=r.children,f=r.margin||{},p=(0,E.sP)(s,G),d=(0,E.sP)(s,j.D),y=Object.keys(u).reduce(function(t,e){var r=u[e],n=r.orientation;return r.mirror||r.hide?t:ey(ey({},t),{},ev({},n,t[n]+r.width))},{left:f.left||0,right:f.right||0}),v=Object.keys(i).reduce(function(t,e){var r=i[e],n=r.orientation;return r.mirror||r.hide?t:ey(ey({},t),{},ev({},n,h()(t,"".concat(n))+r.height))},{top:f.top||0,bottom:f.bottom||0}),m=ey(ey({},v),y),b=m.bottom;p&&(m.bottom+=p.props.height||G.defaultProps.height),d&&e&&(m=(0,M.By)(m,n,r,e));var g=c-m.left-m.right,x=l-m.top-m.bottom;return ey(ey({brushBottom:b},m),{},{width:Math.max(g,0),height:Math.max(x,0)})},eD=function(t){var e=t.chartName,r=t.GraphicalChild,n=t.defaultTooltipEventType,o=void 0===n?"axis":n,a=t.validateTooltipEventTypes,c=void 0===a?["axis"]:a,s=t.axisComponents,f=t.legendContent,p=t.formatAxisMap,d=t.defaultProps,y=function(t,e){var r=e.graphicalItems,n=e.stackGroups,o=e.offset,i=e.updateId,a=e.dataStartIndex,c=e.dataEndIndex,l=t.barSize,f=t.layout,p=t.barGap,h=t.barCategoryGap,d=t.maxBarSize,y=eC(f),v=y.numericAxisName,m=y.cateAxisName,b=!!r&&!!r.length&&r.some(function(t){var e=(0,E.Gf)(t&&t.type);return e&&e.indexOf("Bar")>=0}),x=[];return r.forEach(function(r,y){var w=ej(t.data,{graphicalItems:[r],dataStartIndex:a,dataEndIndex:c}),O=void 0!==r.type.defaultProps?ey(ey({},r.type.defaultProps),r.props):r.props,j=O.dataKey,S=O.maxBarSize,P=O["".concat(v,"Id")],k=O["".concat(m,"Id")],A=s.reduce(function(t,r){var n=e["".concat(r.axisType,"Map")],o=O["".concat(r.axisType,"Id")];n&&n[o]||"zAxis"===r.axisType||(0,g.Z)(!1);var i=n[o];return ey(ey({},t),{},ev(ev({},r.axisType,i),"".concat(r.axisType,"Ticks"),(0,M.uY)(i)))},{}),T=A[m],_=A["".concat(m,"Ticks")],C=n&&n[P]&&n[P].hasStack&&(0,M.O3)(r,n[P].stackGroups),N=(0,E.Gf)(r.type).indexOf("Bar")>=0,D=(0,M.zT)(T,_),I=[],L=b&&(0,M.pt)({barSize:l,stackGroups:n,totalSize:"xAxis"===m?A[m].width:"yAxis"===m?A[m].height:void 0});if(N){var B,R,z=u()(S)?d:S,U=null!==(B=null!==(R=(0,M.zT)(T,_,!0))&&void 0!==R?R:z)&&void 0!==B?B:0;I=(0,M.qz)({barGap:p,barCategoryGap:h,bandSize:U!==D?U:D,sizeList:L[k],maxBarSize:z}),U!==D&&(I=I.map(function(t){return ey(ey({},t),{},{position:ey(ey({},t.position),{},{offset:t.position.offset-U/2})})}))}var $=r&&r.type&&r.type.getComposedData;$&&x.push({props:ey(ey({},$(ey(ey({},A),{},{displayedData:w,props:t,dataKey:j,item:r,bandSize:D,barPosition:I,offset:o,stackedData:C,layout:f,dataStartIndex:a,dataEndIndex:c}))),{},ev(ev(ev({key:r.key||"item-".concat(y)},v,A[v]),m,A[m]),"animationId",i)),childIndex:(0,E.$R)(r,t.children),item:r})}),x},v=function(t,n){var o=t.props,i=t.dataStartIndex,a=t.dataEndIndex,u=t.updateId;if(!(0,E.TT)({props:o}))return null;var c=o.children,l=o.layout,f=o.stackOffset,h=o.data,d=o.reverseStackOrder,v=eC(l),m=v.numericAxisName,b=v.cateAxisName,g=(0,E.NN)(c,r),x=(0,M.wh)(h,g,"".concat(m,"Id"),"".concat(b,"Id"),f,d),w=s.reduce(function(t,e){var r="".concat(e.axisType,"Map");return ey(ey({},t),{},ev({},r,eM(o,ey(ey({},e),{},{graphicalItems:g,stackGroups:e.axisType===m&&x,dataStartIndex:i,dataEndIndex:a}))))},{}),O=eN(ey(ey({},w),{},{props:o,graphicalItems:g}),null==n?void 0:n.legendBBox);Object.keys(w).forEach(function(t){w[t]=p(o,w[t],O,t.replace("Map",""),e)});var j=eT(w["".concat(b,"Map")]),S=y(o,ey(ey({},w),{},{dataStartIndex:i,dataEndIndex:a,updateId:u,graphicalItems:g,stackGroups:x,offset:O}));return ey(ey({formattedGraphicalItems:S,graphicalItems:g,offset:O,stackGroups:x},j),w)},j=function(t){var r;function n(t){var r,o,a,c,s;return!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,n),c=n,s=[t],c=el(c),ev(a=function(t,e){if(e&&("object"===eo(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,ec()?Reflect.construct(c,s||[],el(this).constructor):c.apply(this,s)),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ev(a,"accessibilityManager",new tQ),ev(a,"handleLegendBBoxUpdate",function(t){if(t){var e=a.state,r=e.dataStartIndex,n=e.dataEndIndex,o=e.updateId;a.setState(ey({legendBBox:t},v({props:a.props,dataStartIndex:r,dataEndIndex:n,updateId:o},ey(ey({},a.state),{},{legendBBox:t}))))}}),ev(a,"handleReceiveSyncEvent",function(t,e,r){a.props.syncId===t&&(r!==a.eventEmitterSymbol||"function"==typeof a.props.syncMethod)&&a.applySyncEvent(e)}),ev(a,"handleBrushChange",function(t){var e=t.startIndex,r=t.endIndex;if(e!==a.state.dataStartIndex||r!==a.state.dataEndIndex){var n=a.state.updateId;a.setState(function(){return ey({dataStartIndex:e,dataEndIndex:r},v({props:a.props,dataStartIndex:e,dataEndIndex:r,updateId:n},a.state))}),a.triggerSyncEvent({dataStartIndex:e,dataEndIndex:r})}}),ev(a,"handleMouseEnter",function(t){var e=a.getMouseInfo(t);if(e){var r=ey(ey({},e),{},{isTooltipActive:!0});a.setState(r),a.triggerSyncEvent(r);var n=a.props.onMouseEnter;l()(n)&&n(r,t)}}),ev(a,"triggeredAfterMouseMove",function(t){var e=a.getMouseInfo(t),r=e?ey(ey({},e),{},{isTooltipActive:!0}):{isTooltipActive:!1};a.setState(r),a.triggerSyncEvent(r);var n=a.props.onMouseMove;l()(n)&&n(r,t)}),ev(a,"handleItemMouseEnter",function(t){a.setState(function(){return{isTooltipActive:!0,activeItem:t,activePayload:t.tooltipPayload,activeCoordinate:t.tooltipPosition||{x:t.cx,y:t.cy}}})}),ev(a,"handleItemMouseLeave",function(){a.setState(function(){return{isTooltipActive:!1}})}),ev(a,"handleMouseMove",function(t){t.persist(),a.throttleTriggeredAfterMouseMove(t)}),ev(a,"handleMouseLeave",function(t){a.throttleTriggeredAfterMouseMove.cancel();var e={isTooltipActive:!1};a.setState(e),a.triggerSyncEvent(e);var r=a.props.onMouseLeave;l()(r)&&r(e,t)}),ev(a,"handleOuterEvent",function(t){var e,r=(0,E.Bh)(t),n=h()(a.props,"".concat(r));r&&l()(n)&&n(null!==(e=/.*touch.*/i.test(r)?a.getMouseInfo(t.changedTouches[0]):a.getMouseInfo(t))&&void 0!==e?e:{},t)}),ev(a,"handleClick",function(t){var e=a.getMouseInfo(t);if(e){var r=ey(ey({},e),{},{isTooltipActive:!0});a.setState(r),a.triggerSyncEvent(r);var n=a.props.onClick;l()(n)&&n(r,t)}}),ev(a,"handleMouseDown",function(t){var e=a.props.onMouseDown;l()(e)&&e(a.getMouseInfo(t),t)}),ev(a,"handleMouseUp",function(t){var e=a.props.onMouseUp;l()(e)&&e(a.getMouseInfo(t),t)}),ev(a,"handleTouchMove",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&a.throttleTriggeredAfterMouseMove(t.changedTouches[0])}),ev(a,"handleTouchStart",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&a.handleMouseDown(t.changedTouches[0])}),ev(a,"handleTouchEnd",function(t){null!=t.changedTouches&&t.changedTouches.length>0&&a.handleMouseUp(t.changedTouches[0])}),ev(a,"handleDoubleClick",function(t){var e=a.props.onDoubleClick;l()(e)&&e(a.getMouseInfo(t),t)}),ev(a,"handleContextMenu",function(t){var e=a.props.onContextMenu;l()(e)&&e(a.getMouseInfo(t),t)}),ev(a,"triggerSyncEvent",function(t){void 0!==a.props.syncId&&tY.emit(tH,a.props.syncId,t,a.eventEmitterSymbol)}),ev(a,"applySyncEvent",function(t){var e=a.props,r=e.layout,n=e.syncMethod,o=a.state.updateId,i=t.dataStartIndex,u=t.dataEndIndex;if(void 0!==t.dataStartIndex||void 0!==t.dataEndIndex)a.setState(ey({dataStartIndex:i,dataEndIndex:u},v({props:a.props,dataStartIndex:i,dataEndIndex:u,updateId:o},a.state)));else if(void 0!==t.activeTooltipIndex){var c=t.chartX,l=t.chartY,s=t.activeTooltipIndex,f=a.state,p=f.offset,h=f.tooltipTicks;if(!p)return;if("function"==typeof n)s=n(h,t);else if("value"===n){s=-1;for(var d=0;d=0){if(s.dataKey&&!s.allowDuplicatedCategory){var A="function"==typeof s.dataKey?function(t){return"function"==typeof s.dataKey?s.dataKey(t.payload):null}:"payload.".concat(s.dataKey.toString());C=(0,T.Ap)(v,A,p),N=m&&b&&(0,T.Ap)(b,A,p)}else C=null==v?void 0:v[f],N=m&&b&&b[f];if(S||j){var _=void 0!==t.props.activeIndex?t.props.activeIndex:f;return[(0,i.cloneElement)(t,ey(ey(ey({},n.props),P),{},{activeIndex:_})),null,null]}if(!u()(C))return[k].concat(ef(a.renderActivePoints({item:n,activePoint:C,basePoint:N,childIndex:f,isRange:m})))}else{var C,N,D,I=(null!==(D=a.getItemByXY(a.state.activeCoordinate))&&void 0!==D?D:{graphicalItem:k}).graphicalItem,L=I.item,B=void 0===L?t:L,R=I.childIndex,z=ey(ey(ey({},n.props),P),{},{activeIndex:R});return[(0,i.cloneElement)(B,z),null,null]}}return m?[k,null,null]:[k,null]}),ev(a,"renderCustomized",function(t,e,r){return(0,i.cloneElement)(t,ey(ey({key:"recharts-customized-".concat(r)},a.props),a.state))}),ev(a,"renderMap",{CartesianGrid:{handler:ew,once:!0},ReferenceArea:{handler:a.renderReferenceElement},ReferenceLine:{handler:ew},ReferenceDot:{handler:a.renderReferenceElement},XAxis:{handler:ew},YAxis:{handler:ew},Brush:{handler:a.renderBrush,once:!0},Bar:{handler:a.renderGraphicChild},Line:{handler:a.renderGraphicChild},Area:{handler:a.renderGraphicChild},Radar:{handler:a.renderGraphicChild},RadialBar:{handler:a.renderGraphicChild},Scatter:{handler:a.renderGraphicChild},Pie:{handler:a.renderGraphicChild},Funnel:{handler:a.renderGraphicChild},Tooltip:{handler:a.renderCursor,once:!0},PolarGrid:{handler:a.renderPolarGrid,once:!0},PolarAngleAxis:{handler:a.renderPolarAxis},PolarRadiusAxis:{handler:a.renderPolarAxis},Customized:{handler:a.renderCustomized}}),a.clipPathId="".concat(null!==(r=t.id)&&void 0!==r?r:(0,T.EL)("recharts"),"-clip"),a.throttleTriggeredAfterMouseMove=m()(a.triggeredAfterMouseMove,null!==(o=t.throttleDelay)&&void 0!==o?o:1e3/60),a.state={},a}return!function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&es(t,e)}(n,t),r=[{key:"componentDidMount",value:function(){var t,e;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(t=this.props.margin.left)&&void 0!==t?t:0,top:null!==(e=this.props.margin.top)&&void 0!==e?e:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var t=this.props,e=t.children,r=t.data,n=t.height,o=t.layout,i=(0,E.sP)(e,O.u);if(i){var a=i.props.defaultIndex;if("number"==typeof a&&!(a<0)&&!(a>this.state.tooltipTicks.length-1)){var u=this.state.tooltipTicks[a]&&this.state.tooltipTicks[a].value,c=eP(this.state,r,a,u),l=this.state.tooltipTicks[a].coordinate,s=(this.state.offset.top+n)/2,f="horizontal"===o?{x:l,y:s}:{y:l,x:s},p=this.state.formattedGraphicalItems.find(function(t){return"Scatter"===t.item.type.name});p&&(f=ey(ey({},f),p.props.points[a].tooltipPosition),c=p.props.points[a].tooltipPayload);var h={activeTooltipIndex:a,isTooltipActive:!0,activeLabel:u,activePayload:c,activeCoordinate:f};this.setState(h),this.renderCursor(i),this.accessibilityManager.setIndex(a)}}}},{key:"getSnapshotBeforeUpdate",value:function(t,e){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==e.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==t.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==t.margin){var r,n;this.accessibilityManager.setDetails({offset:{left:null!==(r=this.props.margin.left)&&void 0!==r?r:0,top:null!==(n=this.props.margin.top)&&void 0!==n?n:0}})}return null}},{key:"componentDidUpdate",value:function(t){(0,E.rL)([(0,E.sP)(t.children,O.u)],[(0,E.sP)(this.props.children,O.u)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var t=(0,E.sP)(this.props.children,O.u);if(t&&"boolean"==typeof t.props.shared){var e=t.props.shared?"axis":"item";return c.indexOf(e)>=0?e:o}return o}},{key:"getMouseInfo",value:function(t){if(!this.container)return null;var e=this.container,r=e.getBoundingClientRect(),n=(0,V.os)(r),o={chartX:Math.round(t.pageX-n.left),chartY:Math.round(t.pageY-n.top)},i=r.width/e.offsetWidth||1,a=this.inRange(o.chartX,o.chartY,i);if(!a)return null;var u=this.state,c=u.xAxisMap,l=u.yAxisMap,s=this.getTooltipEventType(),f=eE(this.state,this.props.data,this.props.layout,a);if("axis"!==s&&c&&l){var p=(0,T.Kt)(c).scale,h=(0,T.Kt)(l).scale,d=p&&p.invert?p.invert(o.chartX):null,y=h&&h.invert?h.invert(o.chartY):null;return ey(ey({},o),{},{xValue:d,yValue:y},f)}return f?ey(ey({},o),f):null}},{key:"inRange",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,o=t/r,i=e/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return o>=a.left&&o<=a.left+a.width&&i>=a.top&&i<=a.top+a.height?{x:o,y:i}:null}var u=this.state,c=u.angleAxisMap,l=u.radiusAxisMap;if(c&&l){var s=(0,T.Kt)(c);return(0,tq.z3)({x:o,y:i},s)}return null}},{key:"parseEventsOfWrapper",value:function(){var t=this.props.children,e=this.getTooltipEventType(),r=(0,E.sP)(t,O.u),n={};return r&&"axis"===e&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),ey(ey({},(0,tX.Ym)(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){tY.on(tH,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){tY.removeListener(tH,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(t,e,r){for(var n=this.state.formattedGraphicalItems,o=0,i=n.length;ot.length)&&(e=t.length);for(var r=0,n=Array(e);r=0?1:-1;"insideStart"===u?(o=b+S*l,a=w):"insideEnd"===u?(o=g-S*l,a=!w):"end"===u&&(o=g+S*l,a=w),a=j<=0?a:!a;var P=(0,d.op)(p,y,O,o),E=(0,d.op)(p,y,O,o+(a?1:-1)*359),k="M".concat(P.x,",").concat(P.y,"\n A").concat(O,",").concat(O,",0,1,").concat(a?0:1,",\n ").concat(E.x,",").concat(E.y),A=i()(t.id)?(0,h.EL)("recharts-radial-line-"):t.id;return n.createElement("text",x({},r,{dominantBaseline:"central",className:(0,s.Z)("recharts-radial-bar-label",f)}),n.createElement("defs",null,n.createElement("path",{id:A,d:k})),n.createElement("textPath",{xlinkHref:"#".concat(A)},e))},j=function(t){var e=t.viewBox,r=t.offset,n=t.position,o=e.cx,i=e.cy,a=e.innerRadius,u=e.outerRadius,c=(e.startAngle+e.endAngle)/2;if("outside"===n){var l=(0,d.op)(o,i,u+r,c),s=l.x;return{x:s,y:l.y,textAnchor:s>=o?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"end"};var f=(0,d.op)(o,i,(a+u)/2,c);return{x:f.x,y:f.y,textAnchor:"middle",verticalAnchor:"middle"}},S=function(t){var e=t.viewBox,r=t.parentViewBox,n=t.offset,o=t.position,i=e.x,a=e.y,u=e.width,c=e.height,s=c>=0?1:-1,f=s*n,p=s>0?"end":"start",d=s>0?"start":"end",y=u>=0?1:-1,v=y*n,m=y>0?"end":"start",b=y>0?"start":"end";if("top"===o)return g(g({},{x:i+u/2,y:a-s*n,textAnchor:"middle",verticalAnchor:p}),r?{height:Math.max(a-r.y,0),width:u}:{});if("bottom"===o)return g(g({},{x:i+u/2,y:a+c+f,textAnchor:"middle",verticalAnchor:d}),r?{height:Math.max(r.y+r.height-(a+c),0),width:u}:{});if("left"===o){var x={x:i-v,y:a+c/2,textAnchor:m,verticalAnchor:"middle"};return g(g({},x),r?{width:Math.max(x.x-r.x,0),height:c}:{})}if("right"===o){var w={x:i+u+v,y:a+c/2,textAnchor:b,verticalAnchor:"middle"};return g(g({},w),r?{width:Math.max(r.x+r.width-w.x,0),height:c}:{})}var O=r?{width:u,height:c}:{};return"insideLeft"===o?g({x:i+v,y:a+c/2,textAnchor:b,verticalAnchor:"middle"},O):"insideRight"===o?g({x:i+u-v,y:a+c/2,textAnchor:m,verticalAnchor:"middle"},O):"insideTop"===o?g({x:i+u/2,y:a+f,textAnchor:"middle",verticalAnchor:d},O):"insideBottom"===o?g({x:i+u/2,y:a+c-f,textAnchor:"middle",verticalAnchor:p},O):"insideTopLeft"===o?g({x:i+v,y:a+f,textAnchor:b,verticalAnchor:d},O):"insideTopRight"===o?g({x:i+u-v,y:a+f,textAnchor:m,verticalAnchor:d},O):"insideBottomLeft"===o?g({x:i+v,y:a+c-f,textAnchor:b,verticalAnchor:p},O):"insideBottomRight"===o?g({x:i+u-v,y:a+c-f,textAnchor:m,verticalAnchor:p},O):l()(o)&&((0,h.hj)(o.x)||(0,h.hU)(o.x))&&((0,h.hj)(o.y)||(0,h.hU)(o.y))?g({x:i+(0,h.h1)(o.x,u),y:a+(0,h.h1)(o.y,c),textAnchor:"end",verticalAnchor:"end"},O):g({x:i+u/2,y:a+c/2,textAnchor:"middle",verticalAnchor:"middle"},O)};function P(t){var e,r=t.offset,o=g({offset:void 0===r?5:r},function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,v)),a=o.viewBox,c=o.position,l=o.value,d=o.children,y=o.content,m=o.className,b=o.textBreakAll;if(!a||i()(l)&&i()(d)&&!(0,n.isValidElement)(y)&&!u()(y))return null;if((0,n.isValidElement)(y))return(0,n.cloneElement)(y,o);if(u()(y)){if(e=(0,n.createElement)(y,o),(0,n.isValidElement)(e))return e}else e=w(o);var P="cx"in a&&(0,h.hj)(a.cx),E=(0,p.L6)(o,!0);if(P&&("insideStart"===c||"insideEnd"===c||"end"===c))return O(o,e,E);var k=P?j(o):S(o);return n.createElement(f.x,x({className:(0,s.Z)("recharts-label",void 0===m?"":m)},E,k,{breakAll:b}),e)}P.displayName="Label";var E=function(t){var e=t.cx,r=t.cy,n=t.angle,o=t.startAngle,i=t.endAngle,a=t.r,u=t.radius,c=t.innerRadius,l=t.outerRadius,s=t.x,f=t.y,p=t.top,d=t.left,y=t.width,v=t.height,m=t.clockWise,b=t.labelViewBox;if(b)return b;if((0,h.hj)(y)&&(0,h.hj)(v)){if((0,h.hj)(s)&&(0,h.hj)(f))return{x:s,y:f,width:y,height:v};if((0,h.hj)(p)&&(0,h.hj)(d))return{x:p,y:d,width:y,height:v}}return(0,h.hj)(s)&&(0,h.hj)(f)?{x:s,y:f,width:0,height:0}:(0,h.hj)(e)&&(0,h.hj)(r)?{cx:e,cy:r,startAngle:o||n||0,endAngle:i||n||0,innerRadius:c||0,outerRadius:l||u||a||0,clockWise:m}:t.viewBox?t.viewBox:{}};P.parseViewBox=E,P.renderCallByParent=function(t,e){var r,o,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&i&&!t.label)return null;var a=t.children,c=E(t),s=(0,p.NN)(a,P).map(function(t,r){return(0,n.cloneElement)(t,{viewBox:e||c,key:"label-".concat(r)})});return i?[(r=t.label,o=e||c,r?!0===r?n.createElement(P,{key:"label-implicit",viewBox:o}):(0,h.P2)(r)?n.createElement(P,{key:"label-implicit",viewBox:o,value:r}):(0,n.isValidElement)(r)?r.type===P?(0,n.cloneElement)(r,{key:"label-implicit",viewBox:o}):n.createElement(P,{key:"label-implicit",content:r,viewBox:o}):u()(r)?n.createElement(P,{key:"label-implicit",content:r,viewBox:o}):l()(r)?n.createElement(P,x({viewBox:o},r,{key:"label-implicit"})):null:null)].concat(function(t){if(Array.isArray(t))return m(t)}(s)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(s)||function(t,e){if(t){if("string"==typeof t)return m(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(t,void 0)}}(s)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):s}},58772:function(t,e,r){"use strict";r.d(e,{e:function(){return P}});var n=r(2265),o=r(77571),i=r.n(o),a=r(28302),u=r.n(a),c=r(86757),l=r.n(c),s=r(86185),f=r.n(s),p=r(26680),h=r(9841),d=r(82944),y=r(85355);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=["valueAccessor"],b=["data","dataKey","clockWise","id","textBreakAll"];function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var S=function(t){return Array.isArray(t.value)?f()(t.value):t.value};function P(t){var e=t.valueAccessor,r=void 0===e?S:e,o=j(t,m),a=o.data,u=o.dataKey,c=o.clockWise,l=o.id,s=o.textBreakAll,f=j(o,b);return a&&a.length?n.createElement(h.m,{className:"recharts-label-list"},a.map(function(t,e){var o=i()(u)?r(t,e):(0,y.F$)(t&&t.payload,u),a=i()(l)?{}:{id:"".concat(l,"-").concat(e)};return n.createElement(p._,x({},(0,d.L6)(t,!0),f,a,{parentViewBox:t.parentViewBox,value:o,textBreakAll:s,viewBox:p._.parseViewBox(i()(c)?t:O(O({},t),{},{clockWise:c})),key:"label-".concat(e),index:e}))})):null}P.displayName="LabelList",P.renderCallByParent=function(t,e){var r,o=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t||!t.children&&o&&!t.label)return null;var i=t.children,a=(0,d.NN)(i,P).map(function(t,r){return(0,n.cloneElement)(t,{data:e,key:"labelList-".concat(r)})});return o?[(r=t.label)?!0===r?n.createElement(P,{key:"labelList-implicit",data:e}):n.isValidElement(r)||l()(r)?n.createElement(P,{key:"labelList-implicit",data:e,content:r}):u()(r)?n.createElement(P,x({data:e},r,{key:"labelList-implicit"})):null:null].concat(function(t){if(Array.isArray(t))return g(t)}(a)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return g(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(t,void 0)}}(a)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()):a}},22190:function(t,e,r){"use strict";r.d(e,{D:function(){return N}});var n=r(2265),o=r(86757),i=r.n(o),a=r(87602),u=r(1175),c=r(48777),l=r(14870),s=r(41637);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(){return(p=Object.assign?Object.assign.bind():function(t){for(var e=1;e');var x=e.inactive?h:e.color;return n.createElement("li",p({className:b,style:y,key:"legend-item-".concat(r)},(0,s.bw)(t.props,e,r)),n.createElement(c.T,{width:o,height:o,viewBox:d,style:v},t.renderIcon(e)),n.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},l?l(g,e,r):g))})}},{key:"render",value:function(){var t=this.props,e=t.payload,r=t.layout,o=t.align;return e&&e.length?n.createElement("ul",{className:"recharts-default-legend",style:{padding:0,margin:0,textAlign:"horizontal"===r?o:"left"}},this.renderItems()):null}}],function(t,e){for(var r=0;r1||Math.abs(e.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=e.width,this.lastBoundingBox.height=e.height,t&&t(e)):(-1!==this.lastBoundingBox.width||-1!==this.lastBoundingBox.height)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,t&&t(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?P({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(t){var e,r,n=this.props,o=n.layout,i=n.align,a=n.verticalAlign,u=n.margin,c=n.chartWidth,l=n.chartHeight;return t&&(void 0!==t.left&&null!==t.left||void 0!==t.right&&null!==t.right)||(e="center"===i&&"vertical"===o?{left:((c||0)-this.getBBoxSnapshot().width)/2}:"right"===i?{right:u&&u.right||0}:{left:u&&u.left||0}),t&&(void 0!==t.top&&null!==t.top||void 0!==t.bottom&&null!==t.bottom)||(r="middle"===a?{top:((l||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:u&&u.bottom||0}:{top:u&&u.top||0}),P(P({},e),r)}},{key:"render",value:function(){var t=this,e=this.props,r=e.content,o=e.width,i=e.height,a=e.wrapperStyle,u=e.payloadUniqBy,c=e.payload,l=P(P({position:"absolute",width:o||"auto",height:i||"auto"},this.getDefaultPosition(a)),a);return n.createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(e){t.wrapperNode=e}},function(t,e){if(n.isValidElement(t))return n.cloneElement(t,e);if("function"==typeof t)return n.createElement(t,e);e.ref;var r=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,j);return n.createElement(g,r)}(r,P(P({},this.props),{},{payload:(0,w.z)(c,u,C)})))}}],r=[{key:"getWithHeight",value:function(t,e){var r=P(P({},this.defaultProps),t.props).layout;return"vertical"===r&&(0,x.hj)(t.props.height)?{height:t.props.height}:"horizontal"===r?{width:t.props.width||e}:null}}],e&&E(o.prototype,e),r&&E(o,r),Object.defineProperty(o,"prototype",{writable:!1}),o}(n.PureComponent);T(N,"displayName","Legend"),T(N,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"})},47625:function(t,e,r){"use strict";r.d(e,{h:function(){return d}});var n=r(87602),o=r(2265),i=r(37065),a=r.n(i),u=r(16630),c=r(1175),l=r(82944);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function p(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&(t=a()(t,S,{trailing:!0,leading:!1}));var e=new ResizeObserver(t),r=M.current.getBoundingClientRect();return D(r.width,r.height),e.observe(M.current),function(){e.disconnect()}},[D,S]);var I=(0,o.useMemo)(function(){var t=C.containerWidth,e=C.containerHeight;if(t<0||e<0)return null;(0,c.Z)((0,u.hU)(y)||(0,u.hU)(m),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",y,m),(0,c.Z)(!i||i>0,"The aspect(%s) must be greater than zero.",i);var r=(0,u.hU)(y)?t:y,n=(0,u.hU)(m)?e:m;i&&i>0&&(r?n=r/i:n&&(r=n*i),w&&n>w&&(n=w)),(0,c.Z)(r>0||n>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",r,n,y,m,g,x,i);var a=!Array.isArray(O)&&(0,l.Gf)(O.type).endsWith("Chart");return o.Children.map(O,function(t){return o.isValidElement(t)?(0,o.cloneElement)(t,p({width:r,height:n},a?{style:p({height:"100%",width:"100%",maxHeight:n,maxWidth:r},t.props.style)}:{})):t})},[i,O,m,w,x,g,C,y]);return o.createElement("div",{id:P?"".concat(P):void 0,className:(0,n.Z)("recharts-responsive-container",E),style:p(p({},void 0===A?{}:A),{},{width:y,height:m,minWidth:g,minHeight:x,maxHeight:w}),ref:M},I)})},58811:function(t,e,r){"use strict";r.d(e,{x:function(){return B}});var n=r(2265),o=r(77571),i=r.n(o),a=r(87602),u=r(16630),c=r(34067),l=r(82944),s=r(4094);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T(t,e)}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:[];return t.reduce(function(t,e){var i=e.word,a=e.width,u=t[t.length-1];return u&&(null==n||o||u.width+a+ra||e.reduce(function(t,e){return t.width>e.width?t:e}).width>Number(n),e]},y=0,v=c.length-1,m=0;y<=v&&m<=c.length-1;){var b=Math.floor((y+v)/2),g=M(d(b-1),2),x=g[0],w=g[1],O=M(d(b),1)[0];if(x||O||(y=b+1),x&&O&&(v=b-1),!x&&O){i=w;break}m++}return i||h},D=function(t){return[{words:i()(t)?[]:t.toString().split(_)}]},I=function(t){var e=t.width,r=t.scaleToFit,n=t.children,o=t.style,i=t.breakAll,a=t.maxLines;if((e||r)&&!c.x.isSsr){var u=C({breakAll:i,children:n,style:o});return u?N({breakAll:i,children:n,maxLines:a,style:o},u.wordsWithComputedWidth,u.spaceWidth,e,r):D(n)}return D(n)},L="#808080",B=function(t){var e,r=t.x,o=void 0===r?0:r,i=t.y,c=void 0===i?0:i,s=t.lineHeight,f=void 0===s?"1em":s,p=t.capHeight,h=void 0===p?"0.71em":p,d=t.scaleToFit,y=void 0!==d&&d,v=t.textAnchor,m=t.verticalAnchor,b=t.fill,g=void 0===b?L:b,x=A(t,P),w=(0,n.useMemo)(function(){return I({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:y,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,y,x.style,x.width]),O=x.dx,j=x.dy,M=x.angle,T=x.className,_=x.breakAll,C=A(x,E);if(!(0,u.P2)(o)||!(0,u.P2)(c))return null;var N=o+((0,u.hj)(O)?O:0),D=c+((0,u.hj)(j)?j:0);switch(void 0===m?"end":m){case"start":e=S("calc(".concat(h,")"));break;case"middle":e=S("calc(".concat((w.length-1)/2," * -").concat(f," + (").concat(h," / 2))"));break;default:e=S("calc(".concat(w.length-1," * -").concat(f,")"))}var B=[];if(y){var R=w[0].width,z=x.width;B.push("scale(".concat(((0,u.hj)(z)?z/R:1)/R,")"))}return M&&B.push("rotate(".concat(M,", ").concat(N,", ").concat(D,")")),B.length&&(C.transform=B.join(" ")),n.createElement("text",k({},(0,l.L6)(C,!0),{x:N,y:D,className:(0,a.Z)("recharts-text",T),textAnchor:void 0===v?"start":v,fill:g.includes("url")?L:g}),w.map(function(t,r){var o=t.words.join(_?"":" ");return n.createElement("tspan",{x:N,dy:0===r?e:f,key:"".concat(o,"-").concat(r)},o)}))}},8147:function(t,e,r){"use strict";r.d(e,{u:function(){return F}});var n=r(2265),o=r(34935),i=r.n(o),a=r(77571),u=r.n(a),c=r(87602),l=r(16630);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(){return(f=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);rc[n]+s?Math.max(f,c[n]):Math.max(p,c[n])}function O(t){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function S(t){for(var e=1;e1||Math.abs(t.height-this.state.lastBoundingBox.height)>1)&&this.setState({lastBoundingBox:{width:t.width,height:t.height}})}else(-1!==this.state.lastBoundingBox.width||-1!==this.state.lastBoundingBox.height)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var t,e;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(t=this.props.coordinate)||void 0===t?void 0:t.x)!==this.state.dismissedAtCoordinate.x||(null===(e=this.props.coordinate)||void 0===e?void 0:e.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var t,e,r,o,i,a,u,s,f,p,h,d,y,v,m,O,j,P,E,k=this,A=this.props,M=A.active,T=A.allowEscapeViewBox,_=A.animationDuration,C=A.animationEasing,N=A.children,D=A.coordinate,I=A.hasPayload,L=A.isAnimationActive,B=A.offset,R=A.position,z=A.reverseDirection,U=A.useTranslate3d,$=A.viewBox,F=A.wrapperStyle,q=(d=(t={allowEscapeViewBox:T,coordinate:D,offsetTopLeft:B,position:R,reverseDirection:z,tooltipBox:this.state.lastBoundingBox,useTranslate3d:U,viewBox:$}).allowEscapeViewBox,y=t.coordinate,v=t.offsetTopLeft,m=t.position,O=t.reverseDirection,j=t.tooltipBox,P=t.useTranslate3d,E=t.viewBox,j.height>0&&j.width>0&&y?(r=(e={translateX:p=w({allowEscapeViewBox:d,coordinate:y,key:"x",offsetTopLeft:v,position:m,reverseDirection:O,tooltipDimension:j.width,viewBox:E,viewBoxDimension:E.width}),translateY:h=w({allowEscapeViewBox:d,coordinate:y,key:"y",offsetTopLeft:v,position:m,reverseDirection:O,tooltipDimension:j.height,viewBox:E,viewBoxDimension:E.height}),useTranslate3d:P}).translateX,o=e.translateY,f={transform:e.useTranslate3d?"translate3d(".concat(r,"px, ").concat(o,"px, 0)"):"translate(".concat(r,"px, ").concat(o,"px)")}):f=x,{cssProperties:f,cssClasses:(a=(i={translateX:p,translateY:h,coordinate:y}).coordinate,u=i.translateX,s=i.translateY,(0,c.Z)(g,b(b(b(b({},"".concat(g,"-right"),(0,l.hj)(u)&&a&&(0,l.hj)(a.x)&&u>=a.x),"".concat(g,"-left"),(0,l.hj)(u)&&a&&(0,l.hj)(a.x)&&u=a.y),"".concat(g,"-top"),(0,l.hj)(s)&&a&&(0,l.hj)(a.y)&&s0;return n.createElement(T,{allowEscapeViewBox:i,animationDuration:a,animationEasing:u,isAnimationActive:f,active:o,coordinate:l,hasPayload:O,offset:p,position:y,reverseDirection:m,useTranslate3d:b,viewBox:g,wrapperStyle:x},(t=I(I({},this.props),{},{payload:w}),n.isValidElement(c)?n.cloneElement(c,t):"function"==typeof c?n.createElement(c,t):n.createElement(v,t)))}}],function(t,e){for(var r=0;r=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,a),s=(0,o.Z)("recharts-layer",c);return n.createElement("g",u({className:s},(0,i.L6)(l,!0),{ref:e}),r)})},48777:function(t,e,r){"use strict";r.d(e,{T:function(){return c}});var n=r(2265),o=r(87602),i=r(82944),a=["children","width","height","viewBox","className","style","title","desc"];function u(){return(u=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,a),y=l||{width:r,height:c,x:0,y:0},v=(0,o.Z)("recharts-surface",s);return n.createElement("svg",u({},(0,i.L6)(d,!0,"svg"),{className:v,width:r,height:c,style:f,viewBox:"".concat(y.x," ").concat(y.y," ").concat(y.width," ").concat(y.height)}),n.createElement("title",null,p),n.createElement("desc",null,h),e)}},25739:function(t,e,r){"use strict";r.d(e,{br:function(){return g},CW:function(){return O},Mw:function(){return A},zn:function(){return k},sp:function(){return x},qD:function(){return E},d2:function(){return P},bH:function(){return w},Ud:function(){return S},Nf:function(){return j}});var n=r(2265),o=r(69398),i=r(84173),a=r.n(i),u=r(32242),c=r.n(u),l=r(50967),s=r.n(l)()(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),f=r(16630),p=(0,n.createContext)(void 0),h=(0,n.createContext)(void 0),d=(0,n.createContext)(void 0),y=(0,n.createContext)({}),v=(0,n.createContext)(void 0),m=(0,n.createContext)(0),b=(0,n.createContext)(0),g=function(t){var e=t.state,r=e.xAxisMap,o=e.yAxisMap,i=e.offset,a=t.clipPathId,u=t.children,c=t.width,l=t.height,f=s(i);return n.createElement(p.Provider,{value:r},n.createElement(h.Provider,{value:o},n.createElement(y.Provider,{value:i},n.createElement(d.Provider,{value:f},n.createElement(v.Provider,{value:a},n.createElement(m.Provider,{value:l},n.createElement(b.Provider,{value:c},u)))))))},x=function(){return(0,n.useContext)(v)},w=function(t){var e=(0,n.useContext)(p);null!=e||(0,o.Z)(!1);var r=e[t];return null!=r||(0,o.Z)(!1),r},O=function(){var t=(0,n.useContext)(p);return(0,f.Kt)(t)},j=function(){var t=(0,n.useContext)(h);return a()(t,function(t){return c()(t.domain,Number.isFinite)})||(0,f.Kt)(t)},S=function(t){var e=(0,n.useContext)(h);null!=e||(0,o.Z)(!1);var r=e[t];return null!=r||(0,o.Z)(!1),r},P=function(){return(0,n.useContext)(d)},E=function(){return(0,n.useContext)(y)},k=function(){return(0,n.useContext)(b)},A=function(){return(0,n.useContext)(m)}},57165:function(t,e,r){"use strict";r.d(e,{H:function(){return H}});var n=r(2265);function o(){}function i(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function a(t){this._context=t}function u(t){this._context=t}function c(t){this._context=t}a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:i(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},u.prototype={areaStart:o,areaEnd:o,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:i(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};class l{constructor(t,e){this._context=t,this._x=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,e,t,e):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+e)/2,t,this._y0,t,e)}this._x0=t,this._y0=e}}function s(t){this._context=t}function f(t){this._context=t}function p(t){return new f(t)}function h(t,e,r){var n=t._x1-t._x0,o=e-t._x1,i=(t._y1-t._y0)/(n||o<0&&-0),a=(r-t._y1)/(o||n<0&&-0);return((i<0?-1:1)+(a<0?-1:1))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs((i*o+a*n)/(n+o)))||0}function d(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function y(t,e,r){var n=t._x0,o=t._y0,i=t._x1,a=t._y1,u=(i-n)/3;t._context.bezierCurveTo(n+u,o+u*e,i-u,a-u*r,i,a)}function v(t){this._context=t}function m(t){this._context=new b(t)}function b(t){this._context=t}function g(t){this._context=t}function x(t){var e,r,n=t.length-1,o=Array(n),i=Array(n),a=Array(n);for(o[0]=0,i[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)o[e]=(a[e]-o[e+1])/i[e];for(e=0,i[n-1]=(t[n]+o[n-1])/2;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}}this._x=t,this._y=e}};var O=r(22516),j=r(76115),S=r(67790);function P(t){return t[0]}function E(t){return t[1]}function k(t,e){var r=(0,j.Z)(!0),n=null,o=p,i=null,a=(0,S.d)(u);function u(u){var c,l,s,f=(u=(0,O.Z)(u)).length,p=!1;for(null==n&&(i=o(s=a())),c=0;c<=f;++c)!(c=f;--p)u.point(m[p],b[p]);u.lineEnd(),u.areaEnd()}}v&&(m[s]=+t(h,s,l),b[s]=+e(h,s,l),u.point(n?+n(h,s,l):m[s],r?+r(h,s,l):b[s]))}if(d)return u=null,d+""||null}function s(){return k().defined(o).curve(a).context(i)}return t="function"==typeof t?t:void 0===t?P:(0,j.Z)(+t),e="function"==typeof e?e:void 0===e?(0,j.Z)(0):(0,j.Z)(+e),r="function"==typeof r?r:void 0===r?E:(0,j.Z)(+r),l.x=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.Z)(+e),n=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:(0,j.Z)(+e),l):t},l.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:(0,j.Z)(+t),l):n},l.y=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.Z)(+t),r=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:(0,j.Z)(+t),l):e},l.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:(0,j.Z)(+t),l):r},l.lineX0=l.lineY0=function(){return s().x(t).y(e)},l.lineY1=function(){return s().x(t).y(r)},l.lineX1=function(){return s().x(n).y(e)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:(0,j.Z)(!!t),l):o},l.curve=function(t){return arguments.length?(a=t,null!=i&&(u=a(i)),l):a},l.context=function(t){return arguments.length?(null==t?i=u=null:u=a(i=t),l):i},l}var M=r(75551),T=r.n(M),_=r(86757),C=r.n(_),N=r(87602),D=r(41637),I=r(82944),L=r(16630);function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(){return(R=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=0?1:-1,c=r>=0?1:-1,l=n>=0&&r>=0||n<0&&r<0?1:0;if(a>0&&o instanceof Array){for(var s=[0,0,0,0],f=0;f<4;f++)s[f]=o[f]>a?a:o[f];i="M".concat(t,",").concat(e+u*s[0]),s[0]>0&&(i+="A ".concat(s[0],",").concat(s[0],",0,0,").concat(l,",").concat(t+c*s[0],",").concat(e)),i+="L ".concat(t+r-c*s[1],",").concat(e),s[1]>0&&(i+="A ".concat(s[1],",").concat(s[1],",0,0,").concat(l,",\n ").concat(t+r,",").concat(e+u*s[1])),i+="L ".concat(t+r,",").concat(e+n-u*s[2]),s[2]>0&&(i+="A ".concat(s[2],",").concat(s[2],",0,0,").concat(l,",\n ").concat(t+r-c*s[2],",").concat(e+n)),i+="L ".concat(t+c*s[3],",").concat(e+n),s[3]>0&&(i+="A ".concat(s[3],",").concat(s[3],",0,0,").concat(l,",\n ").concat(t,",").concat(e+n-u*s[3])),i+="Z"}else if(a>0&&o===+o&&o>0){var p=Math.min(a,o);i="M ".concat(t,",").concat(e+u*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+c*p,",").concat(e,"\n L ").concat(t+r-c*p,",").concat(e,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+r,",").concat(e+u*p,"\n L ").concat(t+r,",").concat(e+n-u*p,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t+r-c*p,",").concat(e+n,"\n L ").concat(t+c*p,",").concat(e+n,"\n A ").concat(p,",").concat(p,",0,0,").concat(l,",").concat(t,",").concat(e+n-u*p," Z")}else i="M ".concat(t,",").concat(e," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return i},h=function(t,e){if(!t||!e)return!1;var r=t.x,n=t.y,o=e.x,i=e.y,a=e.width,u=e.height;return!!(Math.abs(a)>0&&Math.abs(u)>0)&&r>=Math.min(o,o+a)&&r<=Math.max(o,o+a)&&n>=Math.min(i,i+u)&&n<=Math.max(i,i+u)},d={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},y=function(t){var e,r=f(f({},d),t),u=(0,n.useRef)(),s=function(t){if(Array.isArray(t))return t}(e=(0,n.useState)(-1))||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{for(i=(r=r.call(t)).next;!(c=(n=i.call(r)).done)&&(u.push(n.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,2)||function(t,e){if(t){if("string"==typeof t)return l(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(t,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=s[0],y=s[1];(0,n.useEffect)(function(){if(u.current&&u.current.getTotalLength)try{var t=u.current.getTotalLength();t&&y(t)}catch(t){}},[]);var v=r.x,m=r.y,b=r.width,g=r.height,x=r.radius,w=r.className,O=r.animationEasing,j=r.animationDuration,S=r.animationBegin,P=r.isAnimationActive,E=r.isUpdateAnimationActive;if(v!==+v||m!==+m||b!==+b||g!==+g||0===b||0===g)return null;var k=(0,o.Z)("recharts-rectangle",w);return E?n.createElement(i.ZP,{canBegin:h>0,from:{width:b,height:g,x:v,y:m},to:{width:b,height:g,x:v,y:m},duration:j,animationEasing:O,isActive:E},function(t){var e=t.width,o=t.height,l=t.x,s=t.y;return n.createElement(i.ZP,{canBegin:h>0,from:"0px ".concat(-1===h?1:h,"px"),to:"".concat(h,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,isActive:P,easing:O},n.createElement("path",c({},(0,a.L6)(r,!0),{className:k,d:p(l,s,e,o,x),ref:u})))}):n.createElement("path",c({},(0,a.L6)(r,!0),{className:k,d:p(v,m,b,g,x)}))}},60474:function(t,e,r){"use strict";r.d(e,{L:function(){return v}});var n=r(2265),o=r(87602),i=r(82944),a=r(39206),u=r(16630);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(){return(l=Object.assign?Object.assign.bind():function(t){for(var e=1;e180),",").concat(+(c>s),",\n ").concat(p.x,",").concat(p.y,"\n ");if(o>0){var d=(0,a.op)(r,n,o,c),y=(0,a.op)(r,n,o,s);h+="L ".concat(y.x,",").concat(y.y,"\n A ").concat(o,",").concat(o,",0,\n ").concat(+(Math.abs(l)>180),",").concat(+(c<=s),",\n ").concat(d.x,",").concat(d.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},d=function(t){var e=t.cx,r=t.cy,n=t.innerRadius,o=t.outerRadius,i=t.cornerRadius,a=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,s=t.endAngle,f=(0,u.uY)(s-l),d=p({cx:e,cy:r,radius:o,angle:l,sign:f,cornerRadius:i,cornerIsExternal:c}),y=d.circleTangency,v=d.lineTangency,m=d.theta,b=p({cx:e,cy:r,radius:o,angle:s,sign:-f,cornerRadius:i,cornerIsExternal:c}),g=b.circleTangency,x=b.lineTangency,w=b.theta,O=c?Math.abs(l-s):Math.abs(l-s)-m-w;if(O<0)return a?"M ".concat(v.x,",").concat(v.y,"\n a").concat(i,",").concat(i,",0,0,1,").concat(2*i,",0\n a").concat(i,",").concat(i,",0,0,1,").concat(-(2*i),",0\n "):h({cx:e,cy:r,innerRadius:n,outerRadius:o,startAngle:l,endAngle:s});var j="M ".concat(v.x,",").concat(v.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(y.x,",").concat(y.y,"\n A").concat(o,",").concat(o,",0,").concat(+(O>180),",").concat(+(f<0),",").concat(g.x,",").concat(g.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,"\n ");if(n>0){var S=p({cx:e,cy:r,radius:n,angle:l,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),P=S.circleTangency,E=S.lineTangency,k=S.theta,A=p({cx:e,cy:r,radius:n,angle:s,sign:-f,isExternal:!0,cornerRadius:i,cornerIsExternal:c}),M=A.circleTangency,T=A.lineTangency,_=A.theta,C=c?Math.abs(l-s):Math.abs(l-s)-k-_;if(C<0&&0===i)return"".concat(j,"L").concat(e,",").concat(r,"Z");j+="L".concat(T.x,",").concat(T.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(M.x,",").concat(M.y,"\n A").concat(n,",").concat(n,",0,").concat(+(C>180),",").concat(+(f>0),",").concat(P.x,",").concat(P.y,"\n A").concat(i,",").concat(i,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,"Z")}else j+="L".concat(e,",").concat(r,"Z");return j},y={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},v=function(t){var e,r=f(f({},y),t),a=r.cx,c=r.cy,s=r.innerRadius,p=r.outerRadius,v=r.cornerRadius,m=r.forceCornerRadius,b=r.cornerIsExternal,g=r.startAngle,x=r.endAngle,w=r.className;if(p0&&360>Math.abs(g-x)?d({cx:a,cy:c,innerRadius:s,outerRadius:p,cornerRadius:Math.min(S,j/2),forceCornerRadius:m,cornerIsExternal:b,startAngle:g,endAngle:x}):h({cx:a,cy:c,innerRadius:s,outerRadius:p,startAngle:g,endAngle:x}),n.createElement("path",l({},(0,i.L6)(r,!0),{className:O,d:e,role:"img"}))}},14870:function(t,e,r){"use strict";r.d(e,{v:function(){return N}});var n=r(2265),o=r(75551),i=r.n(o);let a=Math.cos,u=Math.sin,c=Math.sqrt,l=Math.PI,s=2*l;var f={draw(t,e){let r=c(e/l);t.moveTo(r,0),t.arc(0,0,r,0,s)}};let p=c(1/3),h=2*p,d=u(l/10)/u(7*l/10),y=u(s/10)*d,v=-a(s/10)*d,m=c(3),b=c(3)/2,g=1/c(12),x=(g/2+1)*3;var w=r(76115),O=r(67790);c(3),c(3);var j=r(87602),S=r(82944);function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var E=["type","size","sizeType"];function k(){return(k=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,E)),{},{type:o,size:u,sizeType:l}),p=s.className,h=s.cx,d=s.cy,y=(0,S.L6)(s,!0);return h===+h&&d===+d&&u===+u?n.createElement("path",k({},y,{className:(0,j.Z)("recharts-symbols",p),transform:"translate(".concat(h,", ").concat(d,")"),d:(e=T["symbol".concat(i()(o))]||f,(function(t,e){let r=null,n=(0,O.d)(o);function o(){let o;if(r||(r=o=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),o)return r=null,o+""||null}return t="function"==typeof t?t:(0,w.Z)(t||f),e="function"==typeof e?e:(0,w.Z)(void 0===e?64:+e),o.type=function(e){return arguments.length?(t="function"==typeof e?e:(0,w.Z)(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:(0,w.Z)(+t),o):e},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o})().type(e).size(C(u,l,o))())})):null};N.registerSymbol=function(t,e){T["symbol".concat(i()(t))]=e}},11638:function(t,e,r){"use strict";r.d(e,{bn:function(){return C},a3:function(){return z},lT:function(){return N},V$:function(){return D},w7:function(){return I}});var n=r(2265),o=r(86757),i=r.n(o),a=r(90231),u=r.n(a),c=r(24342),l=r.n(c),s=r(21652),f=r.n(s),p=r(73649),h=r(87602),d=r(84735),y=r(82944);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(){return(m=Object.assign?Object.assign.bind():function(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0,from:{upperWidth:0,lowerWidth:0,height:p,x:c,y:l},to:{upperWidth:s,lowerWidth:f,height:p,x:c,y:l},duration:j,animationEasing:g,isActive:P},function(t){var e=t.upperWidth,i=t.lowerWidth,u=t.height,c=t.x,l=t.y;return n.createElement(d.ZP,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:j,easing:g},n.createElement("path",m({},(0,y.L6)(r,!0),{className:E,d:w(c,l,e,i,u),ref:o})))}):n.createElement("g",null,n.createElement("path",m({},(0,y.L6)(r,!0),{className:E,d:w(c,l,s,f,p)})))},S=r(60474),P=r(9841),E=r(14870),k=["option","shapeType","propTransformer","activeClassName","isActive"];function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function T(t){for(var e=1;e=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,k);if((0,n.isValidElement)(r))e=(0,n.cloneElement)(r,T(T({},f),(0,n.isValidElement)(r)?r.props:r));else if(i()(r))e=r(f);else if(u()(r)&&!l()(r)){var p=(void 0===a?function(t,e){return T(T({},e),t)}:a)(r,f);e=n.createElement(_,{shapeType:o,elementProps:p})}else e=n.createElement(_,{shapeType:o,elementProps:f});return s?n.createElement(P.m,{className:void 0===c?"recharts-active-shape":c},e):e}function N(t,e){return null!=e&&"trapezoids"in t.props}function D(t,e){return null!=e&&"sectors"in t.props}function I(t,e){return null!=e&&"points"in t.props}function L(t,e){var r,n,o=t.x===(null==e||null===(r=e.labelViewBox)||void 0===r?void 0:r.x)||t.x===e.x,i=t.y===(null==e||null===(n=e.labelViewBox)||void 0===n?void 0:n.y)||t.y===e.y;return o&&i}function B(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function R(t,e){var r=t.x===e.x,n=t.y===e.y,o=t.z===e.z;return r&&n&&o}function z(t){var e,r,n,o=t.activeTooltipItem,i=t.graphicalItem,a=t.itemData,u=(N(i,o)?e="trapezoids":D(i,o)?e="sectors":I(i,o)&&(e="points"),e),c=N(i,o)?null===(r=o.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:D(i,o)?null===(n=o.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:I(i,o)?o.payload:{},l=a.filter(function(t,e){var r=f()(c,t),n=i.props[u].filter(function(t){var e;return(N(i,o)?e=L:D(i,o)?e=B:I(i,o)&&(e=R),e)(t,o)}),a=i.props[u].indexOf(n[n.length-1]);return r&&e===a});return a.indexOf(l[l.length-1])}},25311:function(t,e,r){"use strict";r.d(e,{Ky:function(){return w},O1:function(){return b},_b:function(){return g},t9:function(){return m},xE:function(){return O}});var n=r(41443),o=r.n(n),i=r(32242),a=r.n(i),u=r(85355),c=r(82944),l=r(16630),s=r(31699);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var r=0;r0&&(A=Math.min((t||0)-(M[e-1]||0),A))}),Number.isFinite(A)){var T=A/k,_="vertical"===g.layout?r.height:r.width;if("gap"===g.padding&&(c=T*_/2),"no-gap"===g.padding){var C=(0,l.h1)(t.barCategoryGap,T*_),N=T*_/2;c=N-C-(N-C)/_*C}}}s="xAxis"===n?[r.left+(j.left||0)+(c||0),r.left+r.width-(j.right||0)-(c||0)]:"yAxis"===n?"horizontal"===f?[r.top+r.height-(j.bottom||0),r.top+(j.top||0)]:[r.top+(j.top||0)+(c||0),r.top+r.height-(j.bottom||0)-(c||0)]:g.range,P&&(s=[s[1],s[0]]);var D=(0,u.Hq)(g,o,m),I=D.scale,L=D.realScaleType;I.domain(w).range(s),(0,u.zF)(I);var B=(0,u.g$)(I,d(d({},g),{},{realScaleType:L}));"xAxis"===n?(b="top"===x&&!S||"bottom"===x&&S,p=r.left,h=v[E]-b*g.height):"yAxis"===n&&(b="left"===x&&!S||"right"===x&&S,p=v[E]-b*g.width,h=r.top);var R=d(d(d({},g),B),{},{realScaleType:L,x:p,y:h,scale:I,width:"xAxis"===n?r.width:g.width,height:"yAxis"===n?r.height:g.height});return R.bandSize=(0,u.zT)(R,B),g.hide||"xAxis"!==n?g.hide||(v[E]+=(b?-1:1)*R.width):v[E]+=(b?-1:1)*R.height,d(d({},i),{},y({},a,R))},{})},b=function(t,e){var r=t.x,n=t.y,o=e.x,i=e.y;return{x:Math.min(r,o),y:Math.min(n,i),width:Math.abs(o-r),height:Math.abs(i-n)}},g=function(t){return b({x:t.x1,y:t.y1},{x:t.x2,y:t.y2})},x=function(){var t,e;function r(t){!function(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}(this,r),this.scale=t}return t=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.bandAware,n=e.position;if(void 0!==t){if(n)switch(n){case"start":default:return this.scale(t);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(t)+i}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+a}return this.scale(t)}}},{key:"isInRange",value:function(t){var e=this.range(),r=e[0],n=e[e.length-1];return r<=n?t>=r&&t<=n:t>=n&&t<=r}}],e=[{key:"create",value:function(t){return new r(t)}}],t&&p(r.prototype,t),e&&p(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}();y(x,"EPS",1e-4);var w=function(t){var e=Object.keys(t).reduce(function(e,r){return d(d({},e),{},y({},r,x.create(t[r])))},{});return d(d({},e),{},{apply:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,i=r.position;return o()(t,function(t,r){return e[r].apply(t,{bandAware:n,position:i})})},isInRange:function(t){return a()(t,function(t,r){return e[r].isInRange(t)})}})},O=function(t){var e=t.width,r=t.height,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(n%180+180)%180*Math.PI/180,i=Math.atan(r/e);return Math.abs(o>i&&otx(e,t()).base(e.base()),tj.o.apply(e,arguments),e}},scaleOrdinal:function(){return tX.Z},scalePoint:function(){return f.x},scalePow:function(){return tJ},scaleQuantile:function(){return function t(){var e,r=[],n=[],o=[];function i(){var t=0,e=Math.max(1,n.length);for(o=Array(e-1);++t=1)return+r(t[n-1],n-1,t);var n,o=(n-1)*e,i=Math.floor(o),a=+r(t[i],i,t);return a+(+r(t[i+1],i+1,t)-a)*(o-i)}}(r,t/e);return a}function a(t){return null==t||isNaN(t=+t)?e:n[P(o,t)]}return a.invertExtent=function(t){var e=n.indexOf(t);return e<0?[NaN,NaN]:[e>0?o[e-1]:r[0],e=o?[i[o-1],n]:[i[e-1],i[e]]},u.unknown=function(t){return arguments.length&&(e=t),u},u.thresholds=function(){return i.slice()},u.copy=function(){return t().domain([r,n]).range(a).unknown(e)},tj.o.apply(tI(u),arguments)}},scaleRadial:function(){return function t(){var e,r=tO(),n=[0,1],o=!1;function i(t){var n,i=Math.sign(n=r(t))*Math.sqrt(Math.abs(n));return isNaN(i)?e:o?Math.round(i):i}return i.invert=function(t){return r.invert(t1(t))},i.domain=function(t){return arguments.length?(r.domain(t),i):r.domain()},i.range=function(t){return arguments.length?(r.range((n=Array.from(t,td)).map(t1)),i):n.slice()},i.rangeRound=function(t){return i.range(t).round(!0)},i.round=function(t){return arguments.length?(o=!!t,i):o},i.clamp=function(t){return arguments.length?(r.clamp(t),i):r.clamp()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t(r.domain(),n).round(o).clamp(r.clamp()).unknown(e)},tj.o.apply(i,arguments),tI(i)}},scaleSequential:function(){return function t(){var e=tI(rX()(tv));return e.copy=function(){return rG(e,t())},tj.O.apply(e,arguments)}},scaleSequentialLog:function(){return function t(){var e=tZ(rX()).domain([1,10]);return e.copy=function(){return rG(e,t()).base(e.base())},tj.O.apply(e,arguments)}},scaleSequentialPow:function(){return rV},scaleSequentialQuantile:function(){return function t(){var e=[],r=tv;function n(t){if(null!=t&&!isNaN(t=+t))return r((P(e,t,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();for(let r of(e=[],t))null==r||isNaN(r=+r)||e.push(r);return e.sort(g),n},n.interpolator=function(t){return arguments.length?(r=t,n):r},n.range=function(){return e.map((t,n)=>r(n/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(r,n)=>(function(t,e,r){if(!(!(n=(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let r=-1;for(let n of t)null!=(n=e(n,++r,t))&&(n=+n)>=n&&(yield n)}}(t,void 0))).length)||isNaN(e=+e))){if(e<=0||n<2)return t5(t);if(e>=1)return t2(t);var n,o=(n-1)*e,i=Math.floor(o),a=t2((function t(e,r,n=0,o=1/0,i){if(r=Math.floor(r),n=Math.floor(Math.max(0,n)),o=Math.floor(Math.min(e.length-1,o)),!(n<=r&&r<=o))return e;for(i=void 0===i?t6:function(t=g){if(t===g)return t6;if("function"!=typeof t)throw TypeError("compare is not a function");return(e,r)=>{let n=t(e,r);return n||0===n?n:(0===t(r,r))-(0===t(e,e))}}(i);o>n;){if(o-n>600){let a=o-n+1,u=r-n+1,c=Math.log(a),l=.5*Math.exp(2*c/3),s=.5*Math.sqrt(c*l*(a-l)/a)*(u-a/2<0?-1:1),f=Math.max(n,Math.floor(r-u*l/a+s)),p=Math.min(o,Math.floor(r+(a-u)*l/a+s));t(e,r,f,p,i)}let a=e[r],u=n,c=o;for(t3(e,n,r),i(e[o],a)>0&&t3(e,n,o);ui(e[u],a);)++u;for(;i(e[c],a)>0;)--c}0===i(e[n],a)?t3(e,n,c):t3(e,++c,o),c<=r&&(n=c+1),r<=c&&(o=c-1)}return e})(t,i).subarray(0,i+1));return a+(t5(t.subarray(i+1))-a)*(o-i)}})(e,n/t))},n.copy=function(){return t(r).domain(e)},tj.O.apply(n,arguments)}},scaleSequentialSqrt:function(){return rK},scaleSequentialSymlog:function(){return function t(){var e=tH(rX());return e.copy=function(){return rG(e,t()).constant(e.constant())},tj.O.apply(e,arguments)}},scaleSqrt:function(){return t0},scaleSymlog:function(){return function t(){var e=tH(tw());return e.copy=function(){return tx(e,t()).constant(e.constant())},tj.o.apply(e,arguments)}},scaleThreshold:function(){return function t(){var e,r=[.5],n=[0,1],o=1;function i(t){return null!=t&&t<=t?n[P(r,t,0,o)]:e}return i.domain=function(t){return arguments.length?(o=Math.min((r=Array.from(t)).length,n.length-1),i):r.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),o=Math.min(r.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var e=n.indexOf(t);return[r[e-1],r[e]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return t().domain(r).range(n).unknown(e)},tj.o.apply(i,arguments)}},scaleTime:function(){return rY},scaleUtc:function(){return rH},tickFormat:function(){return tD}});var f=r(55284);let p=Math.sqrt(50),h=Math.sqrt(10),d=Math.sqrt(2);function y(t,e,r){let n,o,i;let a=(e-t)/Math.max(0,r),u=Math.floor(Math.log10(a)),c=a/Math.pow(10,u),l=c>=p?10:c>=h?5:c>=d?2:1;return(u<0?(n=Math.round(t*(i=Math.pow(10,-u)/l)),o=Math.round(e*i),n/ie&&--o,i=-i):(n=Math.round(t/(i=Math.pow(10,u)*l)),o=Math.round(e/i),n*ie&&--o),o0))return[];if(t===e)return[t];let n=e=o))return[];let u=i-o+1,c=Array(u);if(n){if(a<0)for(let t=0;te?1:t>=e?0:NaN}function x(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function w(t){let e,r,n;function o(t,n,o=0,i=t.length){if(o>>1;0>r(t[e],n)?o=e+1:i=e}while(og(t(e),r),n=(e,r)=>t(e)-r):(e=t===g||t===x?t:O,r=t,n=t),{left:o,center:function(t,e,r=0,i=t.length){let a=o(t,e,r,i-1);return a>r&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n,o=0,i=t.length){if(o>>1;0>=r(t[e],n)?o=e+1:i=e}while(o>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?Z(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?Z(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=N.exec(t))?new Y(e[1],e[2],e[3],1):(e=D.exec(t))?new Y(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=I.exec(t))?Z(e[1],e[2],e[3],e[4]):(e=L.exec(t))?Z(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=B.exec(t))?Q(e[1],e[2]/100,e[3]/100,1):(e=R.exec(t))?Q(e[1],e[2]/100,e[3]/100,e[4]):z.hasOwnProperty(t)?q(z[t]):"transparent"===t?new Y(NaN,NaN,NaN,0):null}function q(t){return new Y(t>>16&255,t>>8&255,255&t,1)}function Z(t,e,r,n){return n<=0&&(t=e=r=NaN),new Y(t,e,r,n)}function W(t,e,r,n){var o;return 1==arguments.length?((o=t)instanceof A||(o=F(o)),o)?new Y((o=o.rgb()).r,o.g,o.b,o.opacity):new Y:new Y(t,e,r,null==n?1:n)}function Y(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function H(){return`#${K(this.r)}${K(this.g)}${K(this.b)}`}function X(){let t=G(this.opacity);return`${1===t?"rgb(":"rgba("}${V(this.r)}, ${V(this.g)}, ${V(this.b)}${1===t?")":`, ${t})`}`}function G(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function V(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function K(t){return((t=V(t))<16?"0":"")+t.toString(16)}function Q(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new tt(t,e,r,n)}function J(t){if(t instanceof tt)return new tt(t.h,t.s,t.l,t.opacity);if(t instanceof A||(t=F(t)),!t)return new tt;if(t instanceof tt)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,o=Math.min(e,r,n),i=Math.max(e,r,n),a=NaN,u=i-o,c=(i+o)/2;return u?(a=e===i?(r-n)/u+(r0&&c<1?0:a,new tt(a,u,c,t.opacity)}function tt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function te(t){return(t=(t||0)%360)<0?t+360:t}function tr(t){return Math.max(0,Math.min(1,t||0))}function tn(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}function to(t,e,r,n,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*e+(4-6*i+3*a)*r+(1+3*t+3*i-3*a)*n+a*o)/6}E(A,F,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:U,formatHex:U,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return J(this).formatHsl()},formatRgb:$,toString:$}),E(Y,W,k(A,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new Y(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new Y(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Y(V(this.r),V(this.g),V(this.b),G(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:H,formatHex:H,formatHex8:function(){return`#${K(this.r)}${K(this.g)}${K(this.b)}${K((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:X,toString:X})),E(tt,function(t,e,r,n){return 1==arguments.length?J(t):new tt(t,e,r,null==n?1:n)},k(A,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new tt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,o=2*r-n;return new Y(tn(t>=240?t-240:t+120,o,n),tn(t,o,n),tn(t<120?t+240:t-120,o,n),this.opacity)},clamp(){return new tt(te(this.h),tr(this.s),tr(this.l),G(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=G(this.opacity);return`${1===t?"hsl(":"hsla("}${te(this.h)}, ${100*tr(this.s)}%, ${100*tr(this.l)}%${1===t?")":`, ${t})`}`}}));var ti=t=>()=>t;function ta(t,e){var r=e-t;return r?function(e){return t+e*r}:ti(isNaN(t)?e:t)}var tu=function t(e){var r,n=1==(r=+(r=e))?ta:function(t,e){var n,o,i;return e-t?(n=t,o=e,n=Math.pow(n,i=r),o=Math.pow(o,i)-n,i=1/i,function(t){return Math.pow(n+t*o,i)}):ti(isNaN(t)?e:t)};function o(t,e){var r=n((t=W(t)).r,(e=W(e)).r),o=n(t.g,e.g),i=n(t.b,e.b),a=ta(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=o(e),t.b=i(e),t.opacity=a(e),t+""}}return o.gamma=t,o}(1);function tc(t){return function(e){var r,n,o=e.length,i=Array(o),a=Array(o),u=Array(o);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),o=t[n],i=t[n+1],a=n>0?t[n-1]:2*o-i,u=nu&&(a=e.slice(u,a),l[c]?l[c]+=a:l[++c]=a),(o=o[0])===(i=i[0])?l[c]?l[c]+=i:l[++c]=i:(l[++c]=null,s.push({i:c,x:tl(o,i)})),u=tf.lastIndex;return ue&&(r=t,t=e,e=r),l=function(r){return Math.max(t,Math.min(e,r))}),n=c>2?tg:tb,o=i=null,f}function f(e){return null==e||isNaN(e=+e)?r:(o||(o=n(a.map(t),u,c)))(t(l(e)))}return f.invert=function(r){return l(e((i||(i=n(u,a.map(t),tl)))(r)))},f.domain=function(t){return arguments.length?(a=Array.from(t,td),s()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),c=th,s()},f.clamp=function(t){return arguments.length?(l=!!t||tv,s()):l!==tv},f.interpolate=function(t){return arguments.length?(c=t,s()):c},f.unknown=function(t){return arguments.length?(r=t,f):r},function(r,n){return t=r,e=n,s()}}function tO(){return tw()(tv,tv)}var tj=r(89999),tS=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tP(t){var e;if(!(e=tS.exec(t)))throw Error("invalid format: "+t);return new tE({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function tE(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function tk(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function tA(t){return(t=tk(Math.abs(t)))?t[1]:NaN}function tM(t,e){var r=tk(t,e);if(!r)return t+"";var n=r[0],o=r[1];return o<0?"0."+Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+Array(o-n.length+2).join("0")}tP.prototype=tE.prototype,tE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var tT={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>tM(100*t,e),r:tM,s:function(t,e){var r=tk(t,e);if(!r)return t+"";var o=r[0],i=r[1],a=i-(n=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=o.length;return a===u?o:a>u?o+Array(a-u+1).join("0"):a>0?o.slice(0,a)+"."+o.slice(a):"0."+Array(1-a).join("0")+tk(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function t_(t){return t}var tC=Array.prototype.map,tN=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function tD(t,e,r,n){var o,u,c=b(t,e,r);switch((n=tP(null==n?",f":n)).type){case"s":var l=Math.max(Math.abs(t),Math.abs(e));return null!=n.precision||isNaN(u=Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(tA(l)/3)))-tA(Math.abs(c))))||(n.precision=u),a(n,l);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(u=Math.max(0,tA(Math.abs(Math.max(Math.abs(t),Math.abs(e)))-(o=Math.abs(o=c)))-tA(o))+1)||(n.precision=u-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(u=Math.max(0,-tA(Math.abs(c))))||(n.precision=u-("%"===n.type)*2)}return i(n)}function tI(t){var e=t.domain;return t.ticks=function(t){var r=e();return v(r[0],r[r.length-1],null==t?10:t)},t.tickFormat=function(t,r){var n=e();return tD(n[0],n[n.length-1],null==t?10:t,r)},t.nice=function(r){null==r&&(r=10);var n,o,i=e(),a=0,u=i.length-1,c=i[a],l=i[u],s=10;for(l0;){if((o=m(c,l,r))===n)return i[a]=c,i[u]=l,e(i);if(o>0)c=Math.floor(c/o)*o,l=Math.ceil(l/o)*o;else if(o<0)c=Math.ceil(c*o)/o,l=Math.floor(l*o)/o;else break;n=o}return t},t}function tL(){var t=tO();return t.copy=function(){return tx(t,tL())},tj.o.apply(t,arguments),tI(t)}function tB(t,e){t=t.slice();var r,n=0,o=t.length-1,i=t[n],a=t[o];return a-t(-e,r)}function tZ(t){let e,r;let n=t(tR,tz),o=n.domain,a=10;function u(){var i,u;return e=(i=a)===Math.E?Math.log:10===i&&Math.log10||2===i&&Math.log2||(i=Math.log(i),t=>Math.log(t)/i),r=10===(u=a)?tF:u===Math.E?Math.exp:t=>Math.pow(u,t),o()[0]<0?(e=tq(e),r=tq(r),t(tU,t$)):t(tR,tz),n}return n.base=function(t){return arguments.length?(a=+t,u()):a},n.domain=function(t){return arguments.length?(o(t),u()):o()},n.ticks=t=>{let n,i;let u=o(),c=u[0],l=u[u.length-1],s=l0){for(;f<=p;++f)for(n=1;nl)break;d.push(i)}}else for(;f<=p;++f)for(n=a-1;n>=1;--n)if(!((i=f>0?n/r(-f):n*r(f))l)break;d.push(i)}2*d.length{if(null==t&&(t=10),null==o&&(o=10===a?"s":","),"function"!=typeof o&&(a%1||null!=(o=tP(o)).precision||(o.trim=!0),o=i(o)),t===1/0)return o;let u=Math.max(1,a*t/n.ticks().length);return t=>{let n=t/r(Math.round(e(t)));return n*ao(tB(o(),{floor:t=>r(Math.floor(e(t))),ceil:t=>r(Math.ceil(e(t)))})),n}function tW(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function tY(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function tH(t){var e=1,r=t(tW(1),tY(e));return r.constant=function(r){return arguments.length?t(tW(e=+r),tY(e)):e},tI(r)}i=(o=function(t){var e,r,o,i=void 0===t.grouping||void 0===t.thousands?t_:(e=tC.call(t.grouping,Number),r=t.thousands+"",function(t,n){for(var o=t.length,i=[],a=0,u=e[0],c=0;o>0&&u>0&&(c+u+1>n&&(u=Math.max(1,n-c)),i.push(t.substring(o-=u,o+u)),!((c+=u+1)>n));)u=e[a=(a+1)%e.length];return i.reverse().join(r)}),a=void 0===t.currency?"":t.currency[0]+"",u=void 0===t.currency?"":t.currency[1]+"",c=void 0===t.decimal?".":t.decimal+"",l=void 0===t.numerals?t_:(o=tC.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return o[+t]})}),s=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",p=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=tP(t)).fill,r=t.align,o=t.sign,h=t.symbol,d=t.zero,y=t.width,v=t.comma,m=t.precision,b=t.trim,g=t.type;"n"===g?(v=!0,g="g"):tT[g]||(void 0===m&&(m=12),b=!0,g="g"),(d||"0"===e&&"="===r)&&(d=!0,e="0",r="=");var x="$"===h?a:"#"===h&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",w="$"===h?u:/[%p]/.test(g)?s:"",O=tT[g],j=/[defgprs%]/.test(g);function S(t){var a,u,s,h=x,S=w;if("c"===g)S=O(t)+S,t="";else{var P=(t=+t)<0||1/t<0;if(t=isNaN(t)?p:O(Math.abs(t),m),b&&(t=function(t){e:for(var e,r=t.length,n=1,o=-1;n0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t}(t)),P&&0==+t&&"+"!==o&&(P=!1),h=(P?"("===o?o:f:"-"===o||"("===o?"":o)+h,S=("s"===g?tN[8+n/3]:"")+S+(P&&"("===o?")":""),j){for(a=-1,u=t.length;++a(s=t.charCodeAt(a))||s>57){S=(46===s?c+t.slice(a+1):t.slice(a))+S,t=t.slice(0,a);break}}}v&&!d&&(t=i(t,1/0));var E=h.length+t.length+S.length,k=E>1)+h+t+S+k.slice(E);break;default:t=k+h+t+S}return l(t)}return m=void 0===m?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),S.toString=function(){return t+""},S}return{format:h,formatPrefix:function(t,e){var r=h(((t=tP(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor(tA(e)/3))),o=Math.pow(10,-n),i=tN[8+n/3];return function(t){return r(o*t)+i}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,a=o.formatPrefix;var tX=r(36967);function tG(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function tV(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function tK(t){return t<0?-t*t:t*t}function tQ(t){var e=t(tv,tv),r=1;return e.exponent=function(e){return arguments.length?1==(r=+e)?t(tv,tv):.5===r?t(tV,tK):t(tG(r),tG(1/r)):r},tI(e)}function tJ(){var t=tQ(tw());return t.copy=function(){return tx(t,tJ()).exponent(t.exponent())},tj.o.apply(t,arguments),t}function t0(){return tJ.apply(null,arguments).exponent(.5)}function t1(t){return Math.sign(t)*t*t}function t2(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r=o)&&(r=o)}return r}function t5(t,e){let r;if(void 0===e)for(let e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let n=-1;for(let o of t)null!=(o=e(o,++n,t))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function t6(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function t3(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}let t7=new Date,t8=new Date;function t4(t,e,r,n){function o(e){return t(e=0==arguments.length?new Date:new Date(+e)),e}return o.floor=e=>(t(e=new Date(+e)),e),o.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),o.round=t=>{let e=o(t),r=o.ceil(t);return t-e(e(t=new Date(+t),null==r?1:Math.floor(r)),t),o.range=(r,n,i)=>{let a;let u=[];if(r=o.ceil(r),i=null==i?1:Math.floor(i),!(r0))return u;do u.push(a=new Date(+r)),e(r,i),t(r);while(at4(e=>{if(e>=e)for(;t(e),!r(e);)e.setTime(e-1)},(t,n)=>{if(t>=t){if(n<0)for(;++n<=0;)for(;e(t,-1),!r(t););else for(;--n>=0;)for(;e(t,1),!r(t););}}),r&&(o.count=(e,n)=>(t7.setTime(+e),t8.setTime(+n),t(t7),t(t8),Math.floor(r(t7,t8))),o.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?o.filter(n?e=>n(e)%t==0:e=>o.count(0,e)%t==0):o:null),o}let t9=t4(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);t9.every=t=>isFinite(t=Math.floor(t))&&t>0?t>1?t4(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):t9:null,t9.range;let et=t4(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+1e3*e)},(t,e)=>(e-t)/1e3,t=>t.getUTCSeconds());et.range;let ee=t4(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getMinutes());ee.range;let er=t4(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+6e4*e)},(t,e)=>(e-t)/6e4,t=>t.getUTCMinutes());er.range;let en=t4(t=>{t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-6e4*t.getMinutes())},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getHours());en.range;let eo=t4(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+36e5*e)},(t,e)=>(e-t)/36e5,t=>t.getUTCHours());eo.range;let ei=t4(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5,t=>t.getDate()-1);ei.range;let ea=t4(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>t.getUTCDate()-1);ea.range;let eu=t4(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/864e5,t=>Math.floor(t/864e5));function ec(t){return t4(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+7*e)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/6048e5)}eu.range;let el=ec(0),es=ec(1),ef=ec(2),ep=ec(3),eh=ec(4),ed=ec(5),ey=ec(6);function ev(t){return t4(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)},(t,e)=>(e-t)/6048e5)}el.range,es.range,ef.range,ep.range,eh.range,ed.range,ey.range;let em=ev(0),eb=ev(1),eg=ev(2),ex=ev(3),ew=ev(4),eO=ev(5),ej=ev(6);em.range,eb.range,eg.range,ex.range,ew.range,eO.range,ej.range;let eS=t4(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());eS.range;let eP=t4(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());eP.range;let eE=t4(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());eE.every=t=>isFinite(t=Math.floor(t))&&t>0?t4(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)}):null,eE.range;let ek=t4(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());function eA(t,e,r,n,o,i){let a=[[et,1,1e3],[et,5,5e3],[et,15,15e3],[et,30,3e4],[i,1,6e4],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,36e5],[o,3,108e5],[o,6,216e5],[o,12,432e5],[n,1,864e5],[n,2,1728e5],[r,1,6048e5],[e,1,2592e6],[e,3,7776e6],[t,1,31536e6]];function u(e,r,n){let o=Math.abs(r-e)/n,i=w(([,,t])=>t).right(a,o);if(i===a.length)return t.every(b(e/31536e6,r/31536e6,n));if(0===i)return t9.every(Math.max(b(e,r,n),1));let[u,c]=a[o/a[i-1][2]isFinite(t=Math.floor(t))&&t>0?t4(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)}):null,ek.range;let[eM,eT]=eA(ek,eP,em,eu,eo,er),[e_,eC]=eA(eE,eS,el,ei,en,ee);function eN(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function eD(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function eI(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}var eL={"-":"",_:" ",0:"0"},eB=/^\s*\d+/,eR=/^%/,ez=/[\\^$*+?|[\]().{}]/g;function eU(t,e,r){var n=t<0?"-":"",o=(n?-t:t)+"",i=o.length;return n+(i[t.toLowerCase(),e]))}function eZ(t,e,r){var n=eB.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function eW(t,e,r){var n=eB.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function eY(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function eH(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function eX(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function eG(t,e,r){var n=eB.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function eV(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function eK(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function eQ(t,e,r){var n=eB.exec(e.slice(r,r+1));return n?(t.q=3*n[0]-3,r+n[0].length):-1}function eJ(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function e0(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function e1(t,e,r){var n=eB.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function e2(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function e5(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function e6(t,e,r){var n=eB.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function e3(t,e,r){var n=eB.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function e7(t,e,r){var n=eB.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function e8(t,e,r){var n=eR.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function e4(t,e,r){var n=eB.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function e9(t,e,r){var n=eB.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function rt(t,e){return eU(t.getDate(),e,2)}function re(t,e){return eU(t.getHours(),e,2)}function rr(t,e){return eU(t.getHours()%12||12,e,2)}function rn(t,e){return eU(1+ei.count(eE(t),t),e,3)}function ro(t,e){return eU(t.getMilliseconds(),e,3)}function ri(t,e){return ro(t,e)+"000"}function ra(t,e){return eU(t.getMonth()+1,e,2)}function ru(t,e){return eU(t.getMinutes(),e,2)}function rc(t,e){return eU(t.getSeconds(),e,2)}function rl(t){var e=t.getDay();return 0===e?7:e}function rs(t,e){return eU(el.count(eE(t)-1,t),e,2)}function rf(t){var e=t.getDay();return e>=4||0===e?eh(t):eh.ceil(t)}function rp(t,e){return t=rf(t),eU(eh.count(eE(t),t)+(4===eE(t).getDay()),e,2)}function rh(t){return t.getDay()}function rd(t,e){return eU(es.count(eE(t)-1,t),e,2)}function ry(t,e){return eU(t.getFullYear()%100,e,2)}function rv(t,e){return eU((t=rf(t)).getFullYear()%100,e,2)}function rm(t,e){return eU(t.getFullYear()%1e4,e,4)}function rb(t,e){var r=t.getDay();return eU((t=r>=4||0===r?eh(t):eh.ceil(t)).getFullYear()%1e4,e,4)}function rg(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+eU(e/60|0,"0",2)+eU(e%60,"0",2)}function rx(t,e){return eU(t.getUTCDate(),e,2)}function rw(t,e){return eU(t.getUTCHours(),e,2)}function rO(t,e){return eU(t.getUTCHours()%12||12,e,2)}function rj(t,e){return eU(1+ea.count(ek(t),t),e,3)}function rS(t,e){return eU(t.getUTCMilliseconds(),e,3)}function rP(t,e){return rS(t,e)+"000"}function rE(t,e){return eU(t.getUTCMonth()+1,e,2)}function rk(t,e){return eU(t.getUTCMinutes(),e,2)}function rA(t,e){return eU(t.getUTCSeconds(),e,2)}function rM(t){var e=t.getUTCDay();return 0===e?7:e}function rT(t,e){return eU(em.count(ek(t)-1,t),e,2)}function r_(t){var e=t.getUTCDay();return e>=4||0===e?ew(t):ew.ceil(t)}function rC(t,e){return t=r_(t),eU(ew.count(ek(t),t)+(4===ek(t).getUTCDay()),e,2)}function rN(t){return t.getUTCDay()}function rD(t,e){return eU(eb.count(ek(t)-1,t),e,2)}function rI(t,e){return eU(t.getUTCFullYear()%100,e,2)}function rL(t,e){return eU((t=r_(t)).getUTCFullYear()%100,e,2)}function rB(t,e){return eU(t.getUTCFullYear()%1e4,e,4)}function rR(t,e){var r=t.getUTCDay();return eU((t=r>=4||0===r?ew(t):ew.ceil(t)).getUTCFullYear()%1e4,e,4)}function rz(){return"+0000"}function rU(){return"%"}function r$(t){return+t}function rF(t){return Math.floor(+t/1e3)}function rq(t){return new Date(t)}function rZ(t){return t instanceof Date?+t:+new Date(+t)}function rW(t,e,r,n,o,i,a,u,c,l){var s=tO(),f=s.invert,p=s.domain,h=l(".%L"),d=l(":%S"),y=l("%I:%M"),v=l("%I %p"),m=l("%a %d"),b=l("%b %d"),g=l("%B"),x=l("%Y");function w(t){return(c(t)1)for(var r,n,o,i=1,a=t[e[0]],u=a.length;i=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:r$,s:rF,S:rc,u:rl,U:rs,V:rp,w:rh,W:rd,x:null,X:null,y:ry,Y:rm,Z:rg,"%":rU},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return i[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:rx,e:rx,f:rP,g:rL,G:rR,H:rw,I:rO,j:rj,L:rS,m:rE,M:rk,p:function(t){return o[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:r$,s:rF,S:rA,u:rM,U:rT,V:rC,w:rN,W:rD,x:null,X:null,y:rI,Y:rB,Z:rz,"%":rU},w={a:function(t,e,r){var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){var n=f.exec(e.slice(r));return n?(t.w=p.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){var n=m.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){var n=y.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,r,n){return S(t,e,r,n)},d:e0,e:e0,f:e7,g:eV,G:eG,H:e2,I:e2,j:e1,L:e3,m:eJ,M:e5,p:function(t,e,r){var n=l.exec(e.slice(r));return n?(t.p=s.get(n[0].toLowerCase()),r+n[0].length):-1},q:eQ,Q:e4,s:e9,S:e6,u:eW,U:eY,V:eH,w:eZ,W:eX,x:function(t,e,n){return S(t,r,e,n)},X:function(t,e,r){return S(t,n,e,r)},y:eV,Y:eG,Z:eK,"%":e8};function O(t,e){return function(r){var n,o,i,a=[],u=-1,c=0,l=t.length;for(r instanceof Date||(r=new Date(+r));++u53)return null;"w"in i||(i.w=1),"Z"in i?(n=(o=(n=eD(eI(i.y,0,1))).getUTCDay())>4||0===o?eb.ceil(n):eb(n),n=ea.offset(n,(i.V-1)*7),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(n=(o=(n=eN(eI(i.y,0,1))).getDay())>4||0===o?es.ceil(n):es(n),n=ei.offset(n,(i.V-1)*7),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?eD(eI(i.y,0,1)).getUTCDay():eN(eI(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,eD(i)):eN(i)}}function S(t,e,r,n){for(var o,i,a=0,u=e.length,c=r.length;a=c)return -1;if(37===(o=e.charCodeAt(a++))){if(!(i=w[(o=e.charAt(a++))in eL?e.charAt(a++):o])||(n=i(t,r,n))<0)return -1}else if(o!=r.charCodeAt(n++))return -1}return n}return g.x=O(r,g),g.X=O(n,g),g.c=O(e,g),x.x=O(r,x),x.X=O(n,x),x.c=O(e,x),{format:function(t){var e=O(t+="",g);return e.toString=function(){return t},e},parse:function(t){var e=j(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=O(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=j(t+="",!0);return e.toString=function(){return t},e}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})).format,u.parse,l=u.utcFormat,u.utcParse;var r2=r(22516),r5=r(76115);function r6(t){for(var e=t.length,r=Array(e);--e>=0;)r[e]=e;return r}function r3(t,e){return t[e]}function r7(t){let e=[];return e.key=t,e}var r8=r(95645),r4=r.n(r8),r9=r(99008),nt=r.n(r9),ne=r(77571),nr=r.n(ne),nn=r(86757),no=r.n(nn),ni=r(42715),na=r.n(ni),nu=r(13735),nc=r.n(nu),nl=r(11314),ns=r.n(nl),nf=r(82559),np=r.n(nf),nh=r(75551),nd=r.n(nh),ny=r(21652),nv=r.n(ny),nm=r(34935),nb=r.n(nm),ng=r(61134),nx=r.n(ng);function nw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=e?r.apply(void 0,o):t(e-a,nP(function(){for(var t=arguments.length,e=Array(t),n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);rn&&(o=n,i=r),[o,i]}function nR(t,e,r){if(t.lte(0))return new(nx())(0);var n=nC.getDigitCount(t.toNumber()),o=new(nx())(10).pow(n),i=t.div(o),a=1!==n?.05:.1,u=new(nx())(Math.ceil(i.div(a).toNumber())).add(r).mul(a).mul(o);return e?u:new(nx())(Math.ceil(u))}function nz(t,e,r){var n=1,o=new(nx())(t);if(!o.isint()&&r){var i=Math.abs(t);i<1?(n=new(nx())(10).pow(nC.getDigitCount(t)-1),o=new(nx())(Math.floor(o.div(n).toNumber())).mul(n)):i>1&&(o=new(nx())(Math.floor(t)))}else 0===t?o=new(nx())(Math.floor((e-1)/2)):r||(o=new(nx())(Math.floor(t)));var a=Math.floor((e-1)/2);return nM(nA(function(t){return o.add(new(nx())(t-a).mul(n)).toNumber()}),nk)(0,e)}var nU=n_(function(t){var e=nD(t,2),r=e[0],n=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),u=nD(nB([r,n]),2),c=u[0],l=u[1];if(c===-1/0||l===1/0){var s=l===1/0?[c].concat(nN(nk(0,o-1).map(function(){return 1/0}))):[].concat(nN(nk(0,o-1).map(function(){return-1/0})),[l]);return r>n?nT(s):s}if(c===l)return nz(c,o,i);var f=function t(e,r,n,o){var i,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((r-e)/(n-1)))return{step:new(nx())(0),tickMin:new(nx())(0),tickMax:new(nx())(0)};var u=nR(new(nx())(r).sub(e).div(n-1),o,a),c=Math.ceil((i=e<=0&&r>=0?new(nx())(0):(i=new(nx())(e).add(r).div(2)).sub(new(nx())(i).mod(u))).sub(e).div(u).toNumber()),l=Math.ceil(new(nx())(r).sub(i).div(u).toNumber()),s=c+l+1;return s>n?t(e,r,n,o,a+1):(s0?l+(n-s):l,c=r>0?c:c+(n-s)),{step:u,tickMin:i.sub(new(nx())(c).mul(u)),tickMax:i.add(new(nx())(l).mul(u))})}(c,l,a,i),p=f.step,h=f.tickMin,d=f.tickMax,y=nC.rangeStep(h,d.add(new(nx())(.1).mul(p)),p);return r>n?nT(y):y});n_(function(t){var e=nD(t,2),r=e[0],n=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=Math.max(o,2),u=nD(nB([r,n]),2),c=u[0],l=u[1];if(c===-1/0||l===1/0)return[r,n];if(c===l)return nz(c,o,i);var s=nR(new(nx())(l).sub(c).div(a-1),i,0),f=nM(nA(function(t){return new(nx())(c).add(new(nx())(t).mul(s)).toNumber()}),nk)(0,a).filter(function(t){return t>=c&&t<=l});return r>n?nT(f):f});var n$=n_(function(t,e){var r=nD(t,2),n=r[0],o=r[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=nD(nB([n,o]),2),u=a[0],c=a[1];if(u===-1/0||c===1/0)return[n,o];if(u===c)return[u];var l=nR(new(nx())(c).sub(u).div(Math.max(e,2)-1),i,0),s=[].concat(nN(nC.rangeStep(new(nx())(u),new(nx())(c).sub(new(nx())(.99).mul(l)),l)),[c]);return n>o?nT(s):s}),nF=r(13137),nq=r(16630),nZ=r(82944),nW=r(38569);function nY(t){return(nY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nH(t){return function(t){if(Array.isArray(t))return nX(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return nX(t,void 0);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nX(t,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nX(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,a=null!==(e=null==r?void 0:r.length)&&void 0!==e?e:0;if(a<=1)return 0;if(o&&"angleAxis"===o.axisType&&1e-6>=Math.abs(Math.abs(o.range[1]-o.range[0])-360))for(var u=o.range,c=0;c0?n[c-1].coordinate:n[a-1].coordinate,s=n[c].coordinate,f=c>=a-1?n[0].coordinate:n[c+1].coordinate,p=void 0;if((0,nq.uY)(s-l)!==(0,nq.uY)(f-s)){var h=[];if((0,nq.uY)(f-s)===(0,nq.uY)(u[1]-u[0])){p=f;var d=s+u[1]-u[0];h[0]=Math.min(d,(d+l)/2),h[1]=Math.max(d,(d+l)/2)}else{p=l;var y=f+u[1]-u[0];h[0]=Math.min(s,(y+s)/2),h[1]=Math.max(s,(y+s)/2)}var v=[Math.min(s,(p+s)/2),Math.max(s,(p+s)/2)];if(t>v[0]&&t<=v[1]||t>=h[0]&&t<=h[1]){i=n[c].index;break}}else{var m=Math.min(l,f),b=Math.max(l,f);if(t>(m+s)/2&&t<=(b+s)/2){i=n[c].index;break}}}else for(var g=0;g0&&g(r[g].coordinate+r[g-1].coordinate)/2&&t<=(r[g].coordinate+r[g+1].coordinate)/2||g===a-1&&t>(r[g].coordinate+r[g-1].coordinate)/2){i=r[g].index;break}return i},n1=function(t){var e,r,n=t.type.displayName,o=null!==(e=t.type)&&void 0!==e&&e.defaultProps?nV(nV({},t.type.defaultProps),t.props):t.props,i=o.stroke,a=o.fill;switch(n){case"Line":r=i;break;case"Area":case"Radar":r=i&&"none"!==i?i:a;break;default:r=a}return r},n2=function(t){var e=t.barSize,r=t.totalSize,n=t.stackGroups,o=void 0===n?{}:n;if(!o)return{};for(var i={},a=Object.keys(o),u=0,c=a.length;u=0});if(v&&v.length){var m=v[0].type.defaultProps,b=void 0!==m?nV(nV({},m),v[0].props):v[0].props,g=b.barSize,x=b[y];i[x]||(i[x]=[]);var w=nr()(g)?e:g;i[x].push({item:v[0],stackList:v.slice(1),barSize:nr()(w)?void 0:(0,nq.h1)(w,r,0)})}}return i},n5=function(t){var e,r=t.barGap,n=t.barCategoryGap,o=t.bandSize,i=t.sizeList,a=void 0===i?[]:i,u=t.maxBarSize,c=a.length;if(c<1)return null;var l=(0,nq.h1)(r,o,0,!0),s=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=o/c,h=a.reduce(function(t,e){return t+e.barSize||0},0);(h+=(c-1)*l)>=o&&(h-=(c-1)*l,l=0),h>=o&&p>0&&(f=!0,p*=.9,h=c*p);var d={offset:((o-h)/2>>0)-l,size:0};e=a.reduce(function(t,e){var r={item:e.item,position:{offset:d.offset+d.size+l,size:f?p:e.barSize}},n=[].concat(nH(t),[r]);return d=n[n.length-1].position,e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){n.push({item:t,position:d})}),n},s)}else{var y=(0,nq.h1)(n,o,0,!0);o-2*y-(c-1)*l<=0&&(l=0);var v=(o-2*y-(c-1)*l)/c;v>1&&(v>>=0);var m=u===+u?Math.min(v,u):v;e=a.reduce(function(t,e,r){var n=[].concat(nH(t),[{item:e.item,position:{offset:y+(v+l)*r+(v-m)/2,size:m}}]);return e.stackList&&e.stackList.length&&e.stackList.forEach(function(t){n.push({item:t,position:n[n.length-1].position})}),n},s)}return e},n6=function(t,e,r,n){var o=r.children,i=r.width,a=r.margin,u=i-(a.left||0)-(a.right||0),c=(0,nW.z)({children:o,legendWidth:u});if(c){var l=n||{},s=l.width,f=l.height,p=c.align,h=c.verticalAlign,d=c.layout;if(("vertical"===d||"horizontal"===d&&"middle"===h)&&"center"!==p&&(0,nq.hj)(t[p]))return nV(nV({},t),{},nK({},p,t[p]+(s||0)));if(("horizontal"===d||"vertical"===d&&"center"===p)&&"middle"!==h&&(0,nq.hj)(t[h]))return nV(nV({},t),{},nK({},h,t[h]+(f||0)))}return t},n3=function(t,e,r,n,o){var i=e.props.children,a=(0,nZ.NN)(i,nF.W).filter(function(t){var e;return e=t.props.direction,!!nr()(o)||("horizontal"===n?"yAxis"===o:"vertical"===n||"x"===e?"xAxis"===o:"y"!==e||"yAxis"===o)});if(a&&a.length){var u=a.map(function(t){return t.props.dataKey});return t.reduce(function(t,e){var n=nQ(e,r);if(nr()(n))return t;var o=Array.isArray(n)?[nt()(n),r4()(n)]:[n,n],i=u.reduce(function(t,r){var n=nQ(e,r,0),i=o[0]-Math.abs(Array.isArray(n)?n[0]:n),a=o[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(i,t[0]),Math.max(a,t[1])]},[1/0,-1/0]);return[Math.min(i[0],t[0]),Math.max(i[1],t[1])]},[1/0,-1/0])}return null},n7=function(t,e,r,n,o){var i=e.map(function(e){return n3(t,e,r,o,n)}).filter(function(t){return!nr()(t)});return i&&i.length?i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]):null},n8=function(t,e,r,n,o){var i=e.map(function(e){var i=e.props.dataKey;return"number"===r&&i&&n3(t,e,i,n)||nJ(t,i,r,o)});if("number"===r)return i.reduce(function(t,e){return[Math.min(t[0],e[0]),Math.max(t[1],e[1])]},[1/0,-1/0]);var a={};return i.reduce(function(t,e){for(var r=0,n=e.length;r=2?2*(0,nq.uY)(a[0]-a[1])*c:c,e&&(t.ticks||t.niceTicks))?(t.ticks||t.niceTicks).map(function(t){return{coordinate:n(o?o.indexOf(t):t)+c,value:t,offset:c}}).filter(function(t){return!np()(t.coordinate)}):t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(t,e){return{coordinate:n(t)+c,value:t,index:e,offset:c}}):n.ticks&&!r?n.ticks(t.tickCount).map(function(t){return{coordinate:n(t)+c,value:t,offset:c}}):n.domain().map(function(t,e){return{coordinate:n(t)+c,value:o?o[t]:t,index:e,offset:c}})},oe=new WeakMap,or=function(t,e){if("function"!=typeof e)return t;oe.has(t)||oe.set(t,new WeakMap);var r=oe.get(t);if(r.has(e))return r.get(e);var n=function(){t.apply(void 0,arguments),e.apply(void 0,arguments)};return r.set(e,n),n},on=function(t,e,r){var n=t.scale,o=t.type,i=t.layout,a=t.axisType;if("auto"===n)return"radial"===i&&"radiusAxis"===a?{scale:f.Z(),realScaleType:"band"}:"radial"===i&&"angleAxis"===a?{scale:tL(),realScaleType:"linear"}:"category"===o&&e&&(e.indexOf("LineChart")>=0||e.indexOf("AreaChart")>=0||e.indexOf("ComposedChart")>=0&&!r)?{scale:f.x(),realScaleType:"point"}:"category"===o?{scale:f.Z(),realScaleType:"band"}:{scale:tL(),realScaleType:"linear"};if(na()(n)){var u="scale".concat(nd()(n));return{scale:(s[u]||f.x)(),realScaleType:s[u]?u:"point"}}return no()(n)?{scale:n}:{scale:f.x(),realScaleType:"point"}},oo=function(t){var e=t.domain();if(e&&!(e.length<=2)){var r=e.length,n=t.range(),o=Math.min(n[0],n[1])-1e-4,i=Math.max(n[0],n[1])+1e-4,a=t(e[0]),u=t(e[r-1]);(ai||ui)&&t.domain([e[0],e[r-1]])}},oi=function(t,e){if(!t)return null;for(var r=0,n=t.length;rn)&&(o[1]=n),o[0]>n&&(o[0]=n),o[1]=0?(t[a][r][0]=o,t[a][r][1]=o+u,o=t[a][r][1]):(t[a][r][0]=i,t[a][r][1]=i+u,i=t[a][r][1])}},expand:function(t,e){if((n=t.length)>0){for(var r,n,o,i=0,a=t[0].length;i0){for(var r,n=0,o=t[e[0]],i=o.length;n0&&(n=(r=t[e[0]]).length)>0){for(var r,n,o,i=0,a=1;a=0?(t[i][r][0]=o,t[i][r][1]=o+a,o=t[i][r][1]):(t[i][r][0]=0,t[i][r][1]=0)}}},oc=function(t,e,r){var n=e.map(function(t){return t.props.dataKey}),o=ou[r];return(function(){var t=(0,r5.Z)([]),e=r6,r=r1,n=r3;function o(o){var i,a,u=Array.from(t.apply(this,arguments),r7),c=u.length,l=-1;for(let t of o)for(i=0,++l;i=0?0:o<0?o:n}return r[0]},od=function(t,e){var r,n=(null!==(r=t.type)&&void 0!==r&&r.defaultProps?nV(nV({},t.type.defaultProps),t.props):t.props).stackId;if((0,nq.P2)(n)){var o=e[n];if(o){var i=o.items.indexOf(t);return i>=0?o.stackedData[i]:null}}return null},oy=function(t,e,r){return Object.keys(t).reduce(function(n,o){var i=t[o].stackedData.reduce(function(t,n){var o=n.slice(e,r+1).reduce(function(t,e){return[nt()(e.concat([t[0]]).filter(nq.hj)),r4()(e.concat([t[1]]).filter(nq.hj))]},[1/0,-1/0]);return[Math.min(t[0],o[0]),Math.max(t[1],o[1])]},[1/0,-1/0]);return[Math.min(i[0],n[0]),Math.max(i[1],n[1])]},[1/0,-1/0]).map(function(t){return t===1/0||t===-1/0?0:t})},ov=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,om=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ob=function(t,e,r){if(no()(t))return t(e,r);if(!Array.isArray(t))return e;var n=[];if((0,nq.hj)(t[0]))n[0]=r?t[0]:Math.min(t[0],e[0]);else if(ov.test(t[0])){var o=+ov.exec(t[0])[1];n[0]=e[0]-o}else no()(t[0])?n[0]=t[0](e[0]):n[0]=e[0];if((0,nq.hj)(t[1]))n[1]=r?t[1]:Math.max(t[1],e[1]);else if(om.test(t[1])){var i=+om.exec(t[1])[1];n[1]=e[1]+i}else no()(t[1])?n[1]=t[1](e[1]):n[1]=e[1];return n},og=function(t,e,r){if(t&&t.scale&&t.scale.bandwidth){var n=t.scale.bandwidth();if(!r||n>0)return n}if(t&&e&&e.length>=2){for(var o=nb()(e,function(t){return t.coordinate}),i=1/0,a=1,u=o.length;a1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||n.x.isSsr)return{width:0,height:0};var o=(Object.keys(e=a({},r)).forEach(function(t){e[t]||delete e[t]}),e),i=JSON.stringify({text:t,copyStyle:o});if(u.widthCache[i])return u.widthCache[i];try{var s=document.getElementById(l);s||((s=document.createElement("span")).setAttribute("id",l),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var f=a(a({},c),o);Object.assign(s.style,f),s.textContent="".concat(t);var p=s.getBoundingClientRect(),h={width:p.width,height:p.height};return u.widthCache[i]=h,++u.cacheCount>2e3&&(u.cacheCount=0,u.widthCache={}),h}catch(t){return{width:0,height:0}}},f=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}}},16630:function(t,e,r){"use strict";r.d(e,{Ap:function(){return S},EL:function(){return g},Kt:function(){return w},P2:function(){return m},Rw:function(){return v},bv:function(){return O},fC:function(){return P},h1:function(){return x},hU:function(){return d},hj:function(){return y},k4:function(){return j},uY:function(){return h}});var n=r(42715),o=r.n(n),i=r(82559),a=r.n(i),u=r(13735),c=r.n(u),l=r(22345),s=r.n(l),f=r(77571),p=r.n(f),h=function(t){return 0===t?0:t>0?1:-1},d=function(t){return o()(t)&&t.indexOf("%")===t.length-1},y=function(t){return s()(t)&&!a()(t)},v=function(t){return p()(t)},m=function(t){return y(t)||o()(t)},b=0,g=function(t){var e=++b;return"".concat(t||"").concat(e)},x=function(t,e){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!y(t)&&!o()(t))return n;if(d(t)){var u=t.indexOf("%");r=e*parseFloat(t.slice(0,u))/100}else r=+t;return a()(r)&&(r=n),i&&r>e&&(r=e),r},w=function(t){if(!t)return null;var e=Object.keys(t);return e&&e.length?t[e[0]]:null},O=function(t){if(!Array.isArray(t))return!1;for(var e=t.length,r={},n=0;n2?r-2:0),o=2;ot.length)&&(e=t.length);for(var r=0,n=Array(e);r2&&void 0!==arguments[2]?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(e-(r.top||0)-(r.bottom||0)))/2},b=function(t,e,r,n,i){var a=t.width,u=t.height,s=t.startAngle,f=t.endAngle,y=(0,c.h1)(t.cx,a,a/2),v=(0,c.h1)(t.cy,u,u/2),b=m(a,u,r),g=(0,c.h1)(t.innerRadius,b,0),x=(0,c.h1)(t.outerRadius,b,.8*b);return Object.keys(e).reduce(function(t,r){var a,u=e[r],c=u.domain,m=u.reversed;if(o()(u.range))"angleAxis"===n?a=[s,f]:"radiusAxis"===n&&(a=[g,x]),m&&(a=[a[1],a[0]]);else{var b,w=function(t){if(Array.isArray(t))return t}(b=a=u.range)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{for(i=(r=r.call(t)).next;!(c=(n=i.call(r)).done)&&(u.push(n.value),2!==u.length);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(b,2)||function(t,e){if(t){if("string"==typeof t)return d(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,2)}}(b,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s=w[0],f=w[1]}var O=(0,l.Hq)(u,i),j=O.realScaleType,S=O.scale;S.domain(c).range(a),(0,l.zF)(S);var P=(0,l.g$)(S,p(p({},u),{},{realScaleType:j})),E=p(p(p({},u),P),{},{range:a,radius:x,realScaleType:j,scale:S,cx:y,cy:v,innerRadius:g,outerRadius:x,startAngle:s,endAngle:f});return p(p({},t),{},h({},r,E))},{})},g=function(t,e){var r=t.x,n=t.y;return Math.sqrt(Math.pow(r-e.x,2)+Math.pow(n-e.y,2))},x=function(t,e){var r=t.x,n=t.y,o=e.cx,i=e.cy,a=g({x:r,y:n},{x:o,y:i});if(a<=0)return{radius:a};var u=Math.acos((r-o)/a);return n>i&&(u=2*Math.PI-u),{radius:a,angle:180*u/Math.PI,angleInRadian:u}},w=function(t){var e=t.startAngle,r=t.endAngle,n=Math.min(Math.floor(e/360),Math.floor(r/360));return{startAngle:e-360*n,endAngle:r-360*n}},O=function(t,e){var r,n=x({x:t.x,y:t.y},e),o=n.radius,i=n.angle,a=e.innerRadius,u=e.outerRadius;if(ou)return!1;if(0===o)return!0;var c=w(e),l=c.startAngle,s=c.endAngle,f=i;if(l<=s){for(;f>s;)f-=360;for(;f=l&&f<=s}else{for(;f>l;)f-=360;for(;f=s&&f<=l}return r?p(p({},e),{},{radius:o,angle:f+360*Math.min(Math.floor(e.startAngle/360),Math.floor(e.endAngle/360))}):null},j=function(t){return(0,i.isValidElement)(t)||u()(t)||"boolean"==typeof t?"":t.className}},82944:function(t,e,r){"use strict";r.d(e,{$R:function(){return R},Bh:function(){return B},Gf:function(){return j},L6:function(){return N},NN:function(){return k},TT:function(){return M},eu:function(){return L},jf:function(){return _},rL:function(){return D},sP:function(){return A}});var n=r(13735),o=r.n(n),i=r(77571),a=r.n(i),u=r(42715),c=r.n(u),l=r(86757),s=r.n(l),f=r(28302),p=r.n(f),h=r(2265),d=r(14326),y=r(16630),v=r(46485),m=r(41637),b=["children"],g=["children"];function x(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var O={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},j=function(t){return"string"==typeof t?t:t?t.displayName||t.name||"Component":""},S=null,P=null,E=function t(e){if(e===S&&Array.isArray(P))return P;var r=[];return h.Children.forEach(e,function(e){a()(e)||((0,d.isFragment)(e)?r=r.concat(t(e.props.children)):r.push(e))}),P=r,S=e,r};function k(t,e){var r=[],n=[];return n=Array.isArray(e)?e.map(function(t){return j(t)}):[j(e)],E(t).forEach(function(t){var e=o()(t,"type.displayName")||o()(t,"type.name");-1!==n.indexOf(e)&&r.push(t)}),r}function A(t,e){var r=k(t,e);return r&&r[0]}var M=function(t){if(!t||!t.props)return!1;var e=t.props,r=e.width,n=e.height;return!!(0,y.hj)(r)&&!(r<=0)&&!!(0,y.hj)(n)&&!(n<=0)},T=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],_=function(t){return t&&"object"===w(t)&&"clipDot"in t},C=function(t,e,r,n){var o,i=null!==(o=null===m.ry||void 0===m.ry?void 0:m.ry[n])&&void 0!==o?o:[];return e.startsWith("data-")||!s()(t)&&(n&&i.includes(e)||m.Yh.includes(e))||r&&m.nv.includes(e)},N=function(t,e,r){if(!t||"function"==typeof t||"boolean"==typeof t)return null;var n=t;if((0,h.isValidElement)(t)&&(n=t.props),!p()(n))return null;var o={};return Object.keys(n).forEach(function(t){var i;C(null===(i=n)||void 0===i?void 0:i[t],t,e,r)&&(o[t]=n[t])}),o},D=function t(e,r){if(e===r)return!0;var n=h.Children.count(e);if(n!==h.Children.count(r))return!1;if(0===n)return!0;if(1===n)return I(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var o=0;o=0)r.push(t);else if(t){var i=j(t.type),a=e[i]||{},u=a.handler,l=a.once;if(u&&(!l||!n[i])){var s=u(t,i,o);r.push(s),n[i]=!0}}}),r},B=function(t){var e=t&&t.type;return e&&O[e]?O[e]:null},R=function(t,e){return E(e).indexOf(t)}},46485:function(t,e,r){"use strict";function n(t,e){for(var r in t)if(({}).hasOwnProperty.call(t,r)&&(!({}).hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if(({}).hasOwnProperty.call(e,n)&&!({}).hasOwnProperty.call(t,n))return!1;return!0}r.d(e,{w:function(){return n}})},38569:function(t,e,r){"use strict";r.d(e,{z:function(){return l}});var n=r(22190),o=r(85355),i=r(82944);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function c(t){for(var e=1;e=0))throw Error(`invalid digits: ${t}`);if(e>15)return a;let r=10**e;return function(t){this._+=t[0];for(let e=1,n=t.length;e1e-6){if(Math.abs(f*c-l*s)>1e-6&&i){let h=r-a,d=o-u,y=c*c+l*l,v=Math.sqrt(y),m=Math.sqrt(p),b=i*Math.tan((n-Math.acos((y+p-(h*h+d*d))/(2*v*m)))/2),g=b/m,x=b/v;Math.abs(g-1)>1e-6&&this._append`L${t+g*s},${e+g*f}`,this._append`A${i},${i},0,0,${+(f*h>s*d)},${this._x1=t+x*c},${this._y1=e+x*l}`}else this._append`L${this._x1=t},${this._y1=e}`}}arc(t,e,r,a,u,c){if(t=+t,e=+e,c=!!c,(r=+r)<0)throw Error(`negative radius: ${r}`);let l=r*Math.cos(a),s=r*Math.sin(a),f=t+l,p=e+s,h=1^c,d=c?a-u:u-a;null===this._x1?this._append`M${f},${p}`:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-p)>1e-6)&&this._append`L${f},${p}`,r&&(d<0&&(d=d%o+o),d>i?this._append`A${r},${r},0,1,${h},${t-l},${e-s}A${r},${r},0,1,${h},${this._x1=f},${this._y1=p}`:d>1e-6&&this._append`A${r},${r},0,${+(d>=n)},${h},${this._x1=t+r*Math.cos(u)},${this._y1=e+r*Math.sin(u)}`)}rect(t,e,r,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}}function c(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(null==r)e=null;else{let t=Math.floor(r);if(!(t>=0))throw RangeError(`invalid digits: ${r}`);e=t}return t},()=>new u(e)}u.prototype},59121:function(t,e,r){"use strict";r.d(e,{E:function(){return i}});var n=r(99649),o=r(63497);function i(t,e){let r=(0,n.Q)(t);return isNaN(e)?(0,o.L)(t,NaN):(e&&r.setDate(r.getDate()+e),r)}},31091:function(t,e,r){"use strict";r.d(e,{z:function(){return i}});var n=r(99649),o=r(63497);function i(t,e){let r=(0,n.Q)(t);if(isNaN(e))return(0,o.L)(t,NaN);if(!e)return r;let i=r.getDate(),a=(0,o.L)(t,r.getTime());return(a.setMonth(r.getMonth()+e+1,0),i>=a.getDate())?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}},63497:function(t,e,r){"use strict";function n(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}r.d(e,{L:function(){return n}})},99649:function(t,e,r){"use strict";function n(t){let e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):new Date("number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?t:NaN)}r.d(e,{Q:function(){return n}})},69398:function(t,e,r){"use strict";function n(t,e){if(!t)throw Error("Invariant failed")}r.d(e,{Z:function(){return n}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1274-e76373d2e507ce0d.js b/litellm/proxy/_experimental/out/_next/static/chunks/1274-e76373d2e507ce0d.js deleted file mode 100644 index 1180f8691b7..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1274-e76373d2e507ce0d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1274],{26210:function(e,t,l){l.d(t,{UQ:function(){return s.Z},X1:function(){return i.Z},_m:function(){return a.Z},oi:function(){return n.Z},xv:function(){return r.Z}});var s=l(87452),i=l(88829),a=l(72208),r=l(84264),n=l(49566)},30078:function(e,t,l){l.d(t,{Ct:function(){return s.Z},Dx:function(){return x.Z},OK:function(){return n.Z},Zb:function(){return a.Z},nP:function(){return c.Z},oi:function(){return h.Z},rj:function(){return r.Z},td:function(){return o.Z},v0:function(){return m.Z},x4:function(){return d.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var s=l(41649),i=l(78489),a=l(12514),r=l(67101),n=l(12485),m=l(18135),o=l(35242),d=l(29706),c=l(77991),u=l(84264),h=l(49566),x=l(96761)},62490:function(e,t,l){l.d(t,{Ct:function(){return s.Z},RM:function(){return n.Z},SC:function(){return c.Z},Zb:function(){return a.Z},iA:function(){return r.Z},pj:function(){return m.Z},ss:function(){return o.Z},xs:function(){return d.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var s=l(41649),i=l(78489),a=l(12514),r=l(21626),n=l(97214),m=l(28241),o=l(58834),d=l(69552),c=l(71876),u=l(84264)},47359:function(e,t,l){l.d(t,{y:function(){return n}});var s=l(11713),i=l(39760),a=l(39623);let r=(0,l(90246).n)("teams"),n=()=>{let{accessToken:e,userId:t,userRole:l}=(0,i.Z)();return(0,s.a)({queryKey:r.list({}),queryFn:async()=>await (0,a.Z)(e,t,l,null),enabled:!!e})}},33860:function(e,t,l){var s=l(57437),i=l(2265),a=l(10032),r=l(22116),n=l(37592),m=l(99981),o=l(5545),d=l(7310),c=l.n(d),u=l(19250);t.Z=e=>{let{isVisible:t,onCancel:l,onSubmit:d,accessToken:h,title:x="Add Team Member",roles:g=[{label:"admin",value:"admin",description:"Admin role. Can create team keys, add members, and manage settings."},{label:"user",value:"user",description:"User role. Can view team info, but not manage it."}],defaultRole:_="user"}=e,[b]=a.Z.useForm(),[p,v]=(0,i.useState)([]),[j,f]=(0,i.useState)(!1),[y,Z]=(0,i.useState)("user_email"),N=async(e,t)=>{if(!e){v([]);return}f(!0);try{let l=new URLSearchParams;if(l.append(t,e),null==h)return;let s=(await (0,u.userFilterUICall)(h,l)).map(e=>({label:"user_email"===t?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===t?e.user_email:e.user_id,user:e}));v(s)}catch(e){console.error("Error fetching users:",e)}finally{f(!1)}},w=(0,i.useCallback)(c()((e,t)=>N(e,t),300),[]),k=(e,t)=>{Z(t),w(e,t)},S=(e,t)=>{let l=t.user;b.setFieldsValue({user_email:l.user_email,user_id:l.user_id,role:b.getFieldValue("role")})};return(0,s.jsx)(r.Z,{title:x,open:t,onCancel:()=>{b.resetFields(),v([]),l()},footer:null,width:800,children:(0,s.jsxs)(a.Z,{form:b,onFinish:d,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:_},children:[(0,s.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,s.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>k(e,"user_email"),onSelect:(e,t)=>S(e,t),options:"user_email"===y?p:[],loading:j,allowClear:!0})}),(0,s.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,s.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,s.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>k(e,"user_id"),onSelect:(e,t)=>S(e,t),options:"user_id"===y?p:[],loading:j,allowClear:!0})}),(0,s.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,s.jsx)(n.default,{defaultValue:_,children:g.map(e=>(0,s.jsx)(n.default.Option,{value:e.value,children:(0,s.jsxs)(m.Z,{title:e.description,children:[(0,s.jsx)("span",{className:"font-medium",children:e.label}),(0,s.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,s.jsx)("div",{className:"text-right mt-4",children:(0,s.jsx)(o.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},36894:function(e,t,l){var s=l(57437),i=l(56522),a=l(10032),r=l(37592),n=l(22116),m=l(5545),o=l(2265),d=l(24199);t.Z=e=>{var t,l,c;let{visible:u,onCancel:h,onSubmit:x,initialData:g,mode:_,config:b}=e,[p]=a.Z.useForm(),[v,j]=(0,o.useState)(!1);console.log("Initial Data:",g),(0,o.useEffect)(()=>{if(u){if("edit"===_&&g){let e={...g,role:g.role||b.defaultRole,max_budget_in_team:g.max_budget_in_team||null,tpm_limit:g.tpm_limit||null,rpm_limit:g.rpm_limit||null};console.log("Setting form values:",e),p.setFieldsValue(e)}else{var e;p.resetFields(),p.setFieldsValue({role:b.defaultRole||(null===(e=b.roleOptions[0])||void 0===e?void 0:e.value)})}}},[u,g,_,p,b.defaultRole,b.roleOptions]);let f=async e=>{try{j(!0);let t=Object.entries(e).reduce((e,t)=>{let[l,s]=t;if("string"==typeof s){let t=s.trim();return""===t&&("max_budget_in_team"===l||"tpm_limit"===l||"rpm_limit"===l)?{...e,[l]:null}:{...e,[l]:t}}return{...e,[l]:s}},{});console.log("Submitting form data:",t),await Promise.resolve(x(t)),p.resetFields()}catch(e){console.error("Form submission error:",e)}finally{j(!1)}},y=e=>{switch(e.type){case"input":return(0,s.jsx)(i.o,{placeholder:e.placeholder});case"numerical":return(0,s.jsx)(d.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var t;return(0,s.jsx)(r.default,{children:null===(t=e.options)||void 0===t?void 0:t.map(e=>(0,s.jsx)(r.default.Option,{value:e.value,children:e.label},e.value))});default:return null}};return(0,s.jsx)(n.Z,{title:b.title||("add"===_?"Add Member":"Edit Member"),open:u,width:1e3,footer:null,onCancel:h,children:(0,s.jsxs)(a.Z,{form:p,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[b.showEmail&&(0,s.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,s.jsx)(i.o,{placeholder:"user@example.com"})}),b.showEmail&&b.showUserId&&(0,s.jsx)("div",{className:"text-center mb-4",children:(0,s.jsx)(i.x,{children:"OR"})}),b.showUserId&&(0,s.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,s.jsx)(i.o,{placeholder:"user_123"})}),(0,s.jsx)(a.Z.Item,{label:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{children:"Role"}),"edit"===_&&g&&(0,s.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(l=g.role,(null===(c=b.roleOptions.find(e=>e.value===l))||void 0===c?void 0:c.label)||l),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,s.jsx)(r.default,{children:"edit"===_&&g?[...b.roleOptions.filter(e=>e.value===g.role),...b.roleOptions.filter(e=>e.value!==g.role)].map(e=>(0,s.jsx)(r.default.Option,{value:e.value,children:e.label},e.value)):b.roleOptions.map(e=>(0,s.jsx)(r.default.Option,{value:e.value,children:e.label},e.value))})}),null===(t=b.additionalFields)||void 0===t?void 0:t.map(e=>(0,s.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:y(e)},e.name)),(0,s.jsxs)("div",{className:"text-right mt-6",children:[(0,s.jsx)(m.ZP,{onClick:h,className:"mr-2",disabled:v,children:"Cancel"}),(0,s.jsx)(m.ZP,{type:"default",htmlType:"submit",loading:v,children:"add"===_?v?"Adding...":"Add Member":v?"Saving...":"Save Changes"})]})]})})}},93542:function(e,t,l){l.d(t,{Z:function(){return ei}});var s=l(57437),i=l(33860),a=l(19250),r=l(59872),n=l(33304),m=l(15424),o=l(10900),d=l(30078),c=l(10032),u=l(42264),h=l(5545),x=l(4260),g=l(37592),_=l(99981),b=l(63709),p=l(30401),v=l(78867),j=l(2265),f=l(82586),y=l(21609),Z=l(95096),N=l(46468),w=l(27799),k=l(97492),S=l(68473),M=l(9114),C=l(60131),T=l(24199),I=l(97415),P=l(21425),O=l(36894),F=l(89245),L=l(78355),E=l(95704),D=l(61994),A=l(85180);let R={"/key/generate":"Member can generate a virtual key for this team","/key/service-account/generate":"Member can generate a service account key (not belonging to any user) for this team","/key/update":"Member can update a virtual key belonging to this team","/key/delete":"Member can delete a virtual key belonging to this team","/key/info":"Member can get info about a virtual key belonging to this team","/key/regenerate":"Member can regenerate a virtual key belonging to this team","/key/{key_id}/regenerate":"Member can regenerate a virtual key belonging to this team","/key/list":"Member can list virtual keys belonging to this team","/key/block":"Member can block a virtual key belonging to this team","/key/unblock":"Member can unblock a virtual key belonging to this team"},U=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",V=e=>{let t=U(e),l=R[e];if(!l){for(let[t,s]of Object.entries(R))if(e.includes(t)){l=s;break}}return l||(l="Access ".concat(e)),{method:t,endpoint:e,description:l,route:e}};var z=e=>{let{teamId:t,accessToken:l,canEditTeam:i}=e,[r,n]=(0,j.useState)([]),[m,o]=(0,j.useState)([]),[d,c]=(0,j.useState)(!0),[u,x]=(0,j.useState)(!1),[g,_]=(0,j.useState)(!1),b=async()=>{try{if(c(!0),!l)return;let e=await (0,a.getTeamPermissionsCall)(l,t),s=e.all_available_permissions||[];n(s);let i=e.team_member_permissions||[];o(i),_(!1)}catch(e){M.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{c(!1)}};(0,j.useEffect)(()=>{b()},[t,l]);let p=(e,t)=>{o(t?[...m,e]:m.filter(t=>t!==e)),_(!0)},v=async()=>{try{if(!l)return;x(!0),await (0,a.teamPermissionsUpdateCall)(l,t,m),M.Z.success("Permissions updated successfully"),_(!1)}catch(e){M.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(d)return(0,s.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let f=r.length>0;return(0,s.jsxs)(E.Zb,{className:"bg-white shadow-md rounded-md p-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,s.jsx)(E.Dx,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),i&&g&&(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)(h.ZP,{icon:(0,s.jsx)(F.Z,{}),onClick:()=>{b()},children:"Reset"}),(0,s.jsxs)(h.ZP,{onClick:v,loading:u,type:"primary",children:[(0,s.jsx)(L.Z,{})," Save Changes"]})]})]}),(0,s.jsx)(E.xv,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),f?(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(E.iA,{className:" min-w-full",children:[(0,s.jsx)(E.ss,{children:(0,s.jsxs)(E.SC,{children:[(0,s.jsx)(E.xs,{children:"Method"}),(0,s.jsx)(E.xs,{children:"Endpoint"}),(0,s.jsx)(E.xs,{children:"Description"}),(0,s.jsx)(E.xs,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,s.jsx)(E.RM,{children:r.map(e=>{let t=V(e);return(0,s.jsxs)(E.SC,{className:"hover:bg-gray-50 transition-colors",children:[(0,s.jsx)(E.pj,{children:(0,s.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===t.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:t.method})}),(0,s.jsx)(E.pj,{children:(0,s.jsx)("span",{className:"font-mono text-sm text-gray-800",children:t.endpoint})}),(0,s.jsx)(E.pj,{className:"text-gray-700",children:t.description}),(0,s.jsx)(E.pj,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,s.jsx)(D.Z,{checked:m.includes(e),onChange:t=>p(e,t.target.checked),disabled:!i})})]},e)})})]})}):(0,s.jsx)("div",{className:"py-12",children:(0,s.jsx)(A.Z,{description:"No permissions available"})})]})},B=l(78489),G=l(12514),q=l(47323),K=l(21626),J=l(97214),$=l(28241),W=l(58834),Q=l(69552),X=l(71876),Y=l(84264),H=l(53410),ee=l(74998),et=e=>{let{teamData:t,canEditTeam:l,handleMemberDelete:i,setSelectedEditMember:a,setIsEditMemberModalVisible:n,setIsAddMemberModalVisible:o}=e,d=e=>{if(null==e)return"0";if("number"==typeof e){let t=Number(e);return t===Math.floor(t)?t.toString():(0,r.pw)(t,8).replace(/\.?0+$/,"")}return"0"},c=e=>{if(!e)return 0;let l=t.team_memberships.find(t=>t.user_id===e);return(null==l?void 0:l.spend)||0},u=e=>{var l;if(!e)return null;let s=t.team_memberships.find(t=>t.user_id===e);console.log("membership=".concat(s));let i=null==s?void 0:null===(l=s.litellm_budget_table)||void 0===l?void 0:l.max_budget;return null==i?null:d(i)},h=e=>{var l,s;if(!e)return"No Limits";let i=t.team_memberships.find(t=>t.user_id===e),a=null==i?void 0:null===(l=i.litellm_budget_table)||void 0===l?void 0:l.rpm_limit,r=null==i?void 0:null===(s=i.litellm_budget_table)||void 0===s?void 0:s.tpm_limit,n=[a?"".concat(d(a)," RPM"):null,r?"".concat(d(r)," TPM"):null].filter(Boolean);return n.length>0?n.join(" / "):"No Limits"};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)(G.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(K.Z,{className:"min-w-full",children:[(0,s.jsx)(W.Z,{children:(0,s.jsxs)(X.Z,{children:[(0,s.jsx)(Q.Z,{children:"User ID"}),(0,s.jsx)(Q.Z,{children:"User Email"}),(0,s.jsx)(Q.Z,{children:"Role"}),(0,s.jsxs)(Q.Z,{children:["Team Member Spend (USD)"," ",(0,s.jsx)(_.Z,{title:"This is the amount spent by a user in the team.",children:(0,s.jsx)(m.Z,{})})]}),(0,s.jsx)(Q.Z,{children:"Team Member Budget (USD)"}),(0,s.jsxs)(Q.Z,{children:["Team Member Rate Limits"," ",(0,s.jsx)(_.Z,{title:"Rate limits for this member's usage within this team.",children:(0,s.jsx)(m.Z,{})})]}),(0,s.jsx)(Q.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,s.jsx)(J.Z,{children:t.team_info.members_with_roles.map((e,m)=>(0,s.jsxs)(X.Z,{children:[(0,s.jsx)($.Z,{children:(0,s.jsx)(Y.Z,{className:"font-mono",children:e.user_id})}),(0,s.jsx)($.Z,{children:(0,s.jsx)(Y.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,s.jsx)($.Z,{children:(0,s.jsx)(Y.Z,{className:"font-mono",children:e.role})}),(0,s.jsx)($.Z,{children:(0,s.jsxs)(Y.Z,{className:"font-mono",children:["$",(0,r.pw)(c(e.user_id),4)]})}),(0,s.jsx)($.Z,{children:(0,s.jsx)(Y.Z,{className:"font-mono",children:u(e.user_id)?"$".concat((0,r.pw)(Number(u(e.user_id)),4)):"No Limit"})}),(0,s.jsx)($.Z,{children:(0,s.jsx)(Y.Z,{className:"font-mono",children:h(e.user_id)})}),(0,s.jsx)($.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:l&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(q.Z,{icon:H.Z,size:"sm",onClick:()=>{var l,s,i;let r=t.team_memberships.find(t=>t.user_id===e.user_id);a({...e,max_budget_in_team:(null==r?void 0:null===(l=r.litellm_budget_table)||void 0===l?void 0:l.max_budget)||null,tpm_limit:(null==r?void 0:null===(s=r.litellm_budget_table)||void 0===s?void 0:s.tpm_limit)||null,rpm_limit:(null==r?void 0:null===(i=r.litellm_budget_table)||void 0===i?void 0:i.rpm_limit)||null}),n(!0)},className:"cursor-pointer hover:text-blue-600"}),(0,s.jsx)(q.Z,{icon:ee.Z,size:"sm",onClick:()=>i(e),className:"cursor-pointer hover:text-red-600"})]})})]},m))})]})})}),(0,s.jsx)(B.Z,{onClick:()=>o(!0),children:"Add Member"})]})};function el(e){let{className:t,value:l,onChange:i}=e;return(0,s.jsxs)(g.default,{className:t,value:l,onChange:i,children:[(0,s.jsx)(g.default.Option,{value:"24h",children:"Daily"}),(0,s.jsx)(g.default.Option,{value:"7d",children:"Weekly"}),(0,s.jsx)(g.default.Option,{value:"30d",children:"Monthly"})]})}let es=(e,t)=>{let l=[];return l=e?e.models.includes("all-proxy-models")?t:e.models.length>0?e.models:t:t,(0,N.Ob)(l,t)};var ei=e=>{var t,l,F,L,E,D,A,R,U,V,B,G,q,K,J,$,W,Q,X,Y,H,ee,ei,ea,er,en;let em;let{teamId:eo,onClose:ed,accessToken:ec,is_team_admin:eu,is_proxy_admin:eh,userModels:ex,editTeam:eg,premiumUser:e_=!1,onUpdate:eb}=e,[ep,ev]=(0,j.useState)(null),[ej,ef]=(0,j.useState)(!0),[ey,eZ]=(0,j.useState)(!1),[eN]=c.Z.useForm(),[ew,ek]=(0,j.useState)(!1),[eS,eM]=(0,j.useState)(null),[eC,eT]=(0,j.useState)(!1),[eI,eP]=(0,j.useState)([]),[eO,eF]=(0,j.useState)(!1),[eL,eE]=(0,j.useState)({}),[eD,eA]=(0,j.useState)([]),[eR,eU]=(0,j.useState)(null),[eV,ez]=(0,j.useState)(!1),[eB,eG]=(0,j.useState)(!1),[eq,eK]=(0,j.useState)(!1),[eJ,e$]=(0,j.useState)(null);console.log("userModels in team info",ex);let eW=eu||eh,eQ=async()=>{try{if(ef(!0),!ec)return;let e=await (0,a.teamInfoCall)(ec,eo);ev(e)}catch(e){M.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{ef(!1)}};(0,j.useEffect)(()=>{eQ()},[eo,ec]),(0,j.useEffect)(()=>{(async()=>{var e;if(!ec||!(null==ep?void 0:null===(e=ep.team_info)||void 0===e?void 0:e.organization_id)){e$(null);return}try{let e=await (0,a.organizationInfoCall)(ec,ep.team_info.organization_id);e$(e)}catch(e){console.error("Error fetching organization info:",e),e$(null)}})()},[ec,null==ep?void 0:null===(t=ep.team_info)||void 0===t?void 0:t.organization_id]);let eX=(0,j.useMemo)(()=>es(eJ,ex),[eJ,ex]);(0,j.useEffect)(()=>{(async()=>{try{if(!ec)return;let e=(await (0,a.getGuardrailsList)(ec)).guardrails.map(e=>e.guardrail_name);eA(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[ec]);let eY=async e=>{try{if(null==ec)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,a.teamMemberAddCall)(ec,eo,t),M.Z.success("Team member added successfully"),eZ(!1),eN.resetFields();let l=await (0,a.teamInfoCall)(ec,eo);ev(l),eb(l)}catch(i){var t,l,s;let e="Failed to add team member";(null==i?void 0:null===(s=i.raw)||void 0===s?void 0:null===(l=s.detail)||void 0===l?void 0:null===(t=l.error)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==i?void 0:i.message)&&(e=i.message),M.Z.fromBackend(e),console.error("Error adding team member:",i)}},eH=async e=>{try{if(null==ec)return;let t={user_email:e.user_email,user_id:e.user_id,role:e.role,max_budget_in_team:e.max_budget_in_team,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit};console.log("Updating member with values:",t),u.ZP.destroy(),await (0,a.teamMemberUpdateCall)(ec,eo,t),M.Z.success("Team member updated successfully"),ek(!1);let l=await (0,a.teamInfoCall)(ec,eo);ev(l),eb(l)}catch(s){var t,l;let e="Failed to update team member";(null==s?void 0:null===(l=s.raw)||void 0===l?void 0:null===(t=l.detail)||void 0===t?void 0:t.includes("Assigning team admins is a premium feature"))?e="Assigning admins is an enterprise-only feature. Please upgrade your LiteLLM plan to enable this.":(null==s?void 0:s.message)&&(e=s.message),ek(!1),u.ZP.destroy(),M.Z.fromBackend(e),console.error("Error updating team member:",s)}},e0=async()=>{if(eR&&ec){eG(!0);try{await (0,a.teamMemberDeleteCall)(ec,eo,eR),M.Z.success("Team member removed successfully");let e=await (0,a.teamInfoCall)(ec,eo);ev(e),eb(e)}catch(e){M.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}finally{eG(!1),ez(!1),eU(null)}}},e1=async e=>{try{let t;if(!ec)return;eK(!0);let l={};try{l=e.metadata?JSON.parse(e.metadata):{}}catch(e){M.Z.fromBackend("Invalid JSON in metadata field");return}if("string"==typeof e.secret_manager_settings&&e.secret_manager_settings.trim().length>0)try{t=JSON.parse(e.secret_manager_settings)}catch(e){M.Z.fromBackend("Invalid JSON in secret manager settings");return}let s=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,i={team_id:eo,team_alias:e.team_alias,models:e.models,tpm_limit:s(e.tpm_limit),rpm_limit:s(e.rpm_limit),max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:{...l,guardrails:e.guardrails||[],logging:e.logging_settings||[],...void 0!==t?{secret_manager_settings:t}:{}},organization_id:e.organization_id};i.max_budget=(0,n.C)(i.max_budget),i.team_member_budget_duration=e.team_member_budget_duration,void 0!==e.team_member_budget&&(i.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(i.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(i.team_member_tpm_limit=s(e.team_member_tpm_limit),i.team_member_rpm_limit=s(e.team_member_rpm_limit));let{servers:r,accessGroups:m}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},o=new Set(r||[]),d=Object.fromEntries(Object.entries(e.mcp_tool_permissions||{}).filter(e=>{let[t]=e;return o.has(t)}));i.object_permission={},r&&(i.object_permission.mcp_servers=r),m&&(i.object_permission.mcp_access_groups=m),d&&(i.object_permission.mcp_tool_permissions=d),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions;let{agents:c,accessGroups:u}=e.agents_and_groups||{agents:[],accessGroups:[]};c&&c.length>0&&(i.object_permission.agents=c),u&&u.length>0&&(i.object_permission.agent_access_groups=u),delete e.agents_and_groups,e.vector_stores&&e.vector_stores.length>0&&(i.object_permission.vector_stores=e.vector_stores),await (0,a.teamUpdateCall)(ec,i),M.Z.success("Team settings updated successfully"),eT(!1),eQ()}catch(e){console.error("Error updating team:",e)}finally{eK(!1)}};if(ej)return(0,s.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==ep?void 0:ep.team_info))return(0,s.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:e4}=ep,e2=async(e,t)=>{await (0,r.vQ)(e)&&(eE(e=>({...e,[t]:!0})),setTimeout(()=>{eE(e=>({...e,[t]:!1}))},2e3))};return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(d.zx,{icon:o.Z,variant:"light",onClick:ed,className:"mb-4",children:"Back to Teams"}),(0,s.jsx)(d.Dx,{children:e4.team_alias}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(d.xv,{className:"text-gray-500 font-mono",children:e4.team_id}),(0,s.jsx)(h.ZP,{type:"text",size:"small",icon:eL["team-id"]?(0,s.jsx)(p.Z,{size:12}):(0,s.jsx)(v.Z,{size:12}),onClick:()=>e2(e4.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eL["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,s.jsxs)(d.v0,{defaultIndex:eg?3:0,children:[(0,s.jsx)(d.td,{className:"mb-4",children:[(0,s.jsx)(d.OK,{children:"Overview"},"overview"),...eW?[(0,s.jsx)(d.OK,{children:"Members"},"members"),(0,s.jsx)(d.OK,{children:"Member Permissions"},"member-permissions"),(0,s.jsx)(d.OK,{children:"Settings"},"settings")]:[]]}),(0,s.jsxs)(d.nP,{children:[(0,s.jsx)(d.x4,{children:(0,s.jsxs)(d.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(d.Zb,{children:[(0,s.jsx)(d.xv,{children:"Budget Status"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(d.Dx,{children:["$",(0,r.pw)(e4.spend,4)]}),(0,s.jsxs)(d.xv,{children:["of ",null===e4.max_budget?"Unlimited":"$".concat((0,r.pw)(e4.max_budget,4))]}),e4.budget_duration&&(0,s.jsxs)(d.xv,{className:"text-gray-500",children:["Reset: ",e4.budget_duration]}),(0,s.jsx)("br",{}),e4.team_member_budget_table&&(0,s.jsxs)(d.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,r.pw)(e4.team_member_budget_table.max_budget,4)]})]})]}),(0,s.jsxs)(d.Zb,{children:[(0,s.jsx)(d.xv,{children:"Rate Limits"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(d.xv,{children:["TPM: ",e4.tpm_limit||"Unlimited"]}),(0,s.jsxs)(d.xv,{children:["RPM: ",e4.rpm_limit||"Unlimited"]}),e4.max_parallel_requests&&(0,s.jsxs)(d.xv,{children:["Max Parallel Requests: ",e4.max_parallel_requests]})]})]}),(0,s.jsxs)(d.Zb,{children:[(0,s.jsx)(d.xv,{children:"Models"}),(0,s.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===e4.models.length?(0,s.jsx)(d.Ct,{color:"red",children:"All proxy models"}):e4.models.map((e,t)=>(0,s.jsx)(d.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)(d.Zb,{children:[(0,s.jsx)(d.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(d.xv,{children:["User Keys: ",ep.keys.filter(e=>e.user_id).length]}),(0,s.jsxs)(d.xv,{children:["Service Account Keys: ",ep.keys.filter(e=>!e.user_id).length]}),(0,s.jsxs)(d.xv,{className:"text-gray-500",children:["Total: ",ep.keys.length]})]})]}),(0,s.jsx)(C.Z,{objectPermission:e4.object_permission,variant:"card",accessToken:ec}),(0,s.jsx)(w.Z,{loggingConfigs:(null===(l=e4.metadata)||void 0===l?void 0:l.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,s.jsx)(d.x4,{children:(0,s.jsx)(et,{teamData:ep,canEditTeam:eW,handleMemberDelete:e=>{eU(e),ez(!0)},setSelectedEditMember:eM,setIsEditMemberModalVisible:ek,setIsAddMemberModalVisible:eZ})}),eW&&(0,s.jsx)(d.x4,{children:(0,s.jsx)(z,{teamId:eo,accessToken:ec,canEditTeam:eW})}),(0,s.jsx)(d.x4,{children:(0,s.jsxs)(d.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(d.Dx,{children:"Team Settings"}),eW&&!eC&&(0,s.jsx)(d.zx,{onClick:()=>eT(!0),children:"Edit Settings"})]}),eC?(0,s.jsxs)(c.Z,{form:eN,onFinish:e1,initialValues:{...e4,team_alias:e4.team_alias,models:e4.models,tpm_limit:e4.tpm_limit,rpm_limit:e4.rpm_limit,max_budget:e4.max_budget,budget_duration:e4.budget_duration,team_member_tpm_limit:null===(F=e4.team_member_budget_table)||void 0===F?void 0:F.tpm_limit,team_member_rpm_limit:null===(L=e4.team_member_budget_table)||void 0===L?void 0:L.rpm_limit,team_member_budget:null===(E=e4.team_member_budget_table)||void 0===E?void 0:E.max_budget,team_member_budget_duration:null===(D=e4.team_member_budget_table)||void 0===D?void 0:D.budget_duration,guardrails:(null===(A=e4.metadata)||void 0===A?void 0:A.guardrails)||[],disable_global_guardrails:(null===(R=e4.metadata)||void 0===R?void 0:R.disable_global_guardrails)||!1,metadata:e4.metadata?JSON.stringify((e=>{let{logging:t,secret_manager_settings:l,...s}=e;return s})(e4.metadata),null,2):"",logging_settings:(null===(U=e4.metadata)||void 0===U?void 0:U.logging)||[],secret_manager_settings:(null===(V=e4.metadata)||void 0===V?void 0:V.secret_manager_settings)?JSON.stringify(e4.metadata.secret_manager_settings,null,2):"",organization_id:e4.organization_id,vector_stores:(null===(B=e4.object_permission)||void 0===B?void 0:B.vector_stores)||[],mcp_servers:(null===(G=e4.object_permission)||void 0===G?void 0:G.mcp_servers)||[],mcp_access_groups:(null===(q=e4.object_permission)||void 0===q?void 0:q.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(K=e4.object_permission)||void 0===K?void 0:K.mcp_servers)||[],accessGroups:(null===(J=e4.object_permission)||void 0===J?void 0:J.mcp_access_groups)||[]},mcp_tool_permissions:(null===($=e4.object_permission)||void 0===$?void 0:$.mcp_tool_permissions)||{},agents_and_groups:{agents:(null===(W=e4.object_permission)||void 0===W?void 0:W.agents)||[],accessGroups:(null===(Q=e4.object_permission)||void 0===Q?void 0:Q.agent_access_groups)||[]}},layout:"vertical",children:[(0,s.jsx)(c.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,s.jsx)(x.default,{type:""})}),(0,s.jsx)(c.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select at least one model"}],children:(0,s.jsxs)(g.default,{mode:"multiple",placeholder:"Select models",children:[(em=!1,eJ?(0===eJ.models.length||eJ.models.includes("all-proxy-models"))&&(em=!0):em=eh||ex.includes("all-proxy-models"),em?(0,s.jsx)(g.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"):null),!eJ||eJ.models.includes("no-default-models")?(0,s.jsx)(g.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"):null,Array.from(new Set(eX)).map((e,t)=>(0,s.jsx)(g.default.Option,{value:e,children:(0,N.W0)(e)},t))]})}),(0,s.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,s.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(c.Z.Item,{label:"Team Member Budget (USD)",name:"team_member_budget",tooltip:"This is the individual budget for a user in the team.",children:(0,s.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(c.Z.Item,{label:"Team Member Budget Duration",name:"team_member_budget_duration",children:(0,s.jsx)(el,{onChange:e=>eN.setFieldValue("team_member_budget_duration",e),value:eN.getFieldValue("team_member_budget_duration")})}),(0,s.jsx)(c.Z.Item,{label:"Team Member Key Duration (eg: 1d, 1mo)",name:"team_member_key_duration",tooltip:"Set a limit to the duration of a team member's key. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days), 1mo (month)",children:(0,s.jsx)(d.oi,{placeholder:"e.g., 30d"})}),(0,s.jsx)(c.Z.Item,{label:"Team Member TPM Limit",name:"team_member_tpm_limit",tooltip:"Default tokens per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,s.jsx)(c.Z.Item,{label:"Team Member RPM Limit",name:"team_member_rpm_limit",tooltip:"Default requests per minute limit for an individual team member. This limit applies to all requests the user makes within this team. Can be overridden per member.",children:(0,s.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,s.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,s.jsxs)(g.default,{placeholder:"n/a",children:[(0,s.jsx)(g.default.Option,{value:"24h",children:"daily"}),(0,s.jsx)(g.default.Option,{value:"7d",children:"weekly"}),(0,s.jsx)(g.default.Option,{value:"30d",children:"monthly"})]})}),(0,s.jsx)(c.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,s.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(c.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,s.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,s.jsx)(c.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(_.Z,{title:"Setup your first guardrail",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(m.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,s.jsx)(g.default,{mode:"tags",placeholder:"Select or enter guardrails",options:eD.map(e=>({value:e,label:e}))})}),(0,s.jsx)(c.Z.Item,{label:(0,s.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,s.jsx)(_.Z,{title:"When enabled, this team will bypass any guardrails configured to run on every request (global guardrails)",children:(0,s.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",help:"Bypass global guardrails for this team",children:(0,s.jsx)(b.Z,{checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,s.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores","aria-label":"Vector Stores",children:(0,s.jsx)(I.Z,{onChange:e=>eN.setFieldValue("vector_stores",e),value:eN.getFieldValue("vector_stores"),accessToken:ec||"",placeholder:"Select vector stores"})}),(0,s.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,s.jsx)(Z.Z,{onChange:e=>eN.setFieldValue("allowed_passthrough_routes",e),value:eN.getFieldValue("allowed_passthrough_routes"),accessToken:ec||"",placeholder:"Select pass through routes"})}),(0,s.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,s.jsx)(k.Z,{onChange:e=>eN.setFieldValue("mcp_servers_and_groups",e),value:eN.getFieldValue("mcp_servers_and_groups"),accessToken:ec||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,s.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,s.jsx)(x.default,{type:"hidden"})}),(0,s.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,t)=>e.mcp_servers_and_groups!==t.mcp_servers_and_groups||e.mcp_tool_permissions!==t.mcp_tool_permissions,children:()=>{var e;return(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsx)(S.Z,{accessToken:ec||"",selectedServers:(null===(e=eN.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:eN.getFieldValue("mcp_tool_permissions")||{},onChange:e=>eN.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,s.jsx)(c.Z.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,s.jsx)(f.Z,{onChange:e=>eN.setFieldValue("agents_and_groups",e),value:eN.getFieldValue("agents_and_groups"),accessToken:ec||"",placeholder:"Select agents or access groups (optional)"})}),(0,s.jsx)(c.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,s.jsx)(x.default,{type:"",disabled:!0})}),(0,s.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,s.jsx)(P.Z,{value:eN.getFieldValue("logging_settings"),onChange:e=>eN.setFieldValue("logging_settings",e)})}),(0,s.jsx)(c.Z.Item,{label:"Secret Manager Settings",name:"secret_manager_settings",help:e_?"Enter secret manager configuration as a JSON object.":"Premium feature - Upgrade to manage secret manager settings.",rules:[{validator:async(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject(Error("Please enter valid JSON"))}}}],children:(0,s.jsx)(x.default.TextArea,{rows:6,placeholder:'{"namespace": "admin", "mount": "secret", "path_prefix": "litellm"}',disabled:!e_})}),(0,s.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,s.jsx)(x.default.TextArea,{rows:10})}),(0,s.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,s.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,s.jsx)(d.zx,{variant:"secondary",onClick:()=>eT(!1),disabled:eq,children:"Cancel"}),(0,s.jsx)(d.zx,{type:"submit",loading:eq,children:"Save Changes"})]})})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Team Name"}),(0,s.jsx)("div",{children:e4.team_alias})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"font-mono",children:e4.team_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Created At"}),(0,s.jsx)("div",{children:new Date(e4.created_at).toLocaleString()})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Models"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:e4.models.map((e,t)=>(0,s.jsx)(d.Ct,{color:"red",children:e},t))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Rate Limits"}),(0,s.jsxs)("div",{children:["TPM: ",e4.tpm_limit||"Unlimited"]}),(0,s.jsxs)("div",{children:["RPM: ",e4.rpm_limit||"Unlimited"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Team Budget"}),(0,s.jsxs)("div",{children:["Max Budget:"," ",null!==e4.max_budget?"$".concat((0,r.pw)(e4.max_budget,4)):"No Limit"]}),(0,s.jsxs)("div",{children:["Budget Reset: ",e4.budget_duration||"Never"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(d.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,s.jsx)(_.Z,{title:"These are limits on individual team members",children:(0,s.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),(0,s.jsxs)("div",{children:["Max Budget: ",(null===(X=e4.team_member_budget_table)||void 0===X?void 0:X.max_budget)||"No Limit"]}),(0,s.jsxs)("div",{children:["Budget Duration: ",(null===(Y=e4.team_member_budget_table)||void 0===Y?void 0:Y.budget_duration)||"No Limit"]}),(0,s.jsxs)("div",{children:["Key Duration: ",(null===(H=e4.metadata)||void 0===H?void 0:H.team_member_key_duration)||"No Limit"]}),(0,s.jsxs)("div",{children:["TPM Limit: ",(null===(ee=e4.team_member_budget_table)||void 0===ee?void 0:ee.tpm_limit)||"No Limit"]}),(0,s.jsxs)("div",{children:["RPM Limit: ",(null===(ei=e4.team_member_budget_table)||void 0===ei?void 0:ei.rpm_limit)||"No Limit"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Organization ID"}),(0,s.jsx)("div",{children:e4.organization_id})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Status"}),(0,s.jsx)(d.Ct,{color:e4.blocked?"red":"green",children:e4.blocked?"Blocked":"Active"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,s.jsx)("div",{children:(null===(ea=e4.metadata)||void 0===ea?void 0:ea.disable_global_guardrails)===!0?(0,s.jsx)(d.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,s.jsx)(d.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,s.jsx)(C.Z,{objectPermission:e4.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:ec}),(0,s.jsx)(w.Z,{loggingConfigs:(null===(er=e4.metadata)||void 0===er?void 0:er.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"}),(null===(en=e4.metadata)||void 0===en?void 0:en.secret_manager_settings)&&(0,s.jsxs)("div",{className:"pt-4 border-t border-gray-200",children:[(0,s.jsx)(d.xv,{className:"font-medium",children:"Secret Manager Settings"}),(0,s.jsx)("pre",{className:"mt-2 bg-gray-50 p-3 rounded text-xs overflow-x-auto",children:JSON.stringify(e4.metadata.secret_manager_settings,null,2)})]})]})]})})]})]}),(0,s.jsx)(O.Z,{visible:ew,onCancel:()=>ek(!1),onSubmit:eH,initialData:eS,mode:"edit",config:{title:"Edit Member",showEmail:!0,showUserId:!0,roleOptions:[{label:"Admin",value:"admin"},{label:"User",value:"user"}],additionalFields:[{name:"max_budget_in_team",label:(0,s.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,s.jsx)(_.Z,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,s.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:.01,min:0,placeholder:"Budget limit for this member within this team"},{name:"tpm_limit",label:(0,s.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,s.jsx)(_.Z,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,s.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Tokens per minute limit for this member in this team"},{name:"rpm_limit",label:(0,s.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,s.jsx)(_.Z,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,s.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,s.jsx)(i.Z,{isVisible:ey,onCancel:()=>eZ(!1),onSubmit:eY,accessToken:ec}),(0,s.jsx)(y.Z,{isOpen:eV,title:"Delete Team Member",alertMessage:"Removing team members will also delete any keys created by or created for this member.",message:"Are you sure you want to remove this member from the team? This action cannot be undone.",resourceInformationTitle:"Team Member Information",resourceInformation:[{label:"User ID",value:null==eR?void 0:eR.user_id,code:!0},{label:"Email",value:null==eR?void 0:eR.user_email},{label:"Role",value:null==eR?void 0:eR.role}],onCancel:()=>{ez(!1),eU(null)},onOk:e0,confirmLoading:eB})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/137-639f92dd476d20a9.js b/litellm/proxy/_experimental/out/_next/static/chunks/137-639f92dd476d20a9.js deleted file mode 100644 index 40ab2174168..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/137-639f92dd476d20a9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[137],{1309:function(e,l,a){a.d(l,{C:function(){return t.Z}});var t=a(41649)},10137:function(e,l,a){a.d(l,{Z:function(){return lF}});var t,i,r,s,n=a(57437),o=a(2265),d=a(78489),c=a(12485),u=a(18135),m=a(35242),x=a(29706),p=a(77991),h=a(19250),g=a(57840),f=a(37592),j=a(15690),v=a(10032),y=a(3810),_=a(22116),b=a(64504);(t=r||(r={})).PresidioPII="Presidio PII",t.Bedrock="Bedrock Guardrail",t.Lakera="Lakera";let N={},w=e=>{let l={};return l.PresidioPII="Presidio PII",l.Bedrock="Bedrock Guardrail",l.Lakera="Lakera",Object.entries(e).forEach(e=>{let[a,t]=e;t&&"object"==typeof t&&"ui_friendly_name"in t&&(l[a.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=t.ui_friendly_name)}),N=l,l},k=()=>Object.keys(N).length>0?N:r,C={PresidioPII:"presidio",Bedrock:"bedrock",Lakera:"lakera_v2",LitellmContentFilter:"litellm_content_filter",ToolPermission:"tool_permission"},S=e=>{Object.entries(e).forEach(e=>{let[l,a]=e;a&&"object"==typeof a&&"ui_friendly_name"in a&&(C[l.split("_").map((e,l)=>e.charAt(0).toUpperCase()+e.slice(1)).join("")]=l)})},Z=e=>!!e&&"Presidio PII"===k()[e],P=e=>!!e&&"LiteLLM Content Filter"===k()[e],A="../ui/assets/logos/",O={"Presidio PII":"".concat(A,"presidio.png"),"Bedrock Guardrail":"".concat(A,"bedrock.svg"),Lakera:"".concat(A,"lakeraai.jpeg"),"Azure Content Safety Prompt Shield":"".concat(A,"presidio.png"),"Azure Content Safety Text Moderation":"".concat(A,"presidio.png"),"Aporia AI":"".concat(A,"aporia.png"),"PANW Prisma AIRS":"".concat(A,"palo_alto_networks.jpeg"),"Noma Security":"".concat(A,"noma_security.png"),"Javelin Guardrails":"".concat(A,"javelin.png"),"Pillar Guardrail":"".concat(A,"pillar.jpeg"),"Google Cloud Model Armor":"".concat(A,"google.svg"),"Guardrails AI":"".concat(A,"guardrails_ai.jpeg"),"Lasso Guardrail":"".concat(A,"lasso.png"),"Pangea Guardrail":"".concat(A,"pangea.png"),"AIM Guardrail":"".concat(A,"aim_security.jpeg"),"OpenAI Moderation":"".concat(A,"openai_small.svg"),EnkryptAI:"".concat(A,"enkrypt_ai.avif"),"Prompt Security":"".concat(A,"prompt_security.png"),"LiteLLM Content Filter":"".concat(A,"litellm_logo.jpg")},I=e=>{if(!e)return{logo:"",displayName:"-"};let l=Object.keys(C).find(l=>C[l].toLowerCase()===e.toLowerCase());if(!l)return{logo:"",displayName:e};let a=k()[l];return{logo:O[a]||"",displayName:a||e}};var L=a(99981),T=a(5545),z=a(61994),E=a(97416),B=a(8881),M=a(10798),F=a(49638);let{Text:G}=g.default,{Option:K}=f.default,D=e=>e.replace(/_/g," "),R=e=>{switch(e){case"MASK":return(0,n.jsx)(E.Z,{style:{marginRight:4}});case"BLOCK":return(0,n.jsx)(B.Z,{style:{marginRight:4}});default:return null}},J=e=>{let{categories:l,selectedCategories:a,onChange:t}=e;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center mb-2",children:[(0,n.jsx)(M.Z,{className:"text-gray-500 mr-1"}),(0,n.jsx)(G,{className:"text-gray-500 font-medium",children:"Filter by category"})]}),(0,n.jsx)(f.default,{mode:"multiple",placeholder:"Select categories to filter by",style:{width:"100%"},onChange:t,value:a,allowClear:!0,showSearch:!0,optionFilterProp:"children",className:"mb-4",tagRender:e=>(0,n.jsx)(y.Z,{color:"blue",closable:e.closable,onClose:e.onClose,className:"mr-2 mb-2",children:e.label}),children:l.map(e=>(0,n.jsx)(K,{value:e.category,children:e.category},e.category))})]})},V=e=>{let{onSelectAll:l,onUnselectAll:a,hasSelectedEntities:t}=e;return(0,n.jsxs)("div",{className:"bg-gray-50 p-5 rounded-lg mb-6 border border-gray-200 shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(G,{strong:!0,className:"text-gray-700 text-base",children:"Quick Actions"}),(0,n.jsx)(L.Z,{title:"Apply action to all PII types at once",children:(0,n.jsx)("div",{className:"ml-2 text-gray-400 cursor-help text-xs",children:"ⓘ"})})]}),(0,n.jsx)(T.ZP,{color:"danger",variant:"outlined",onClick:a,disabled:!t,icon:(0,n.jsx)(F.Z,{}),children:"Unselect All"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,n.jsx)(T.ZP,{color:"primary",variant:"outlined",onClick:()=>l("MASK"),className:"h-10",block:!0,icon:(0,n.jsx)(E.Z,{}),children:"Select All & Mask"}),(0,n.jsx)(T.ZP,{color:"danger",variant:"outlined",onClick:()=>l("BLOCK"),className:"h-10 hover:bg-red-100",block:!0,icon:(0,n.jsx)(B.Z,{}),children:"Select All & Block"})]})]})},U=e=>{let{entities:l,selectedEntities:a,selectedActions:t,actions:i,onEntitySelect:r,onActionSelect:s,entityToCategoryMap:o}=e;return(0,n.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,n.jsx)(G,{strong:!0,className:"flex-1 text-gray-700",children:"PII Type"}),(0,n.jsx)(G,{strong:!0,className:"w-32 text-right text-gray-700",children:"Action"})]}),(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:0===l.length?(0,n.jsx)("div",{className:"py-10 text-center text-gray-500",children:"No PII types match your filter criteria"}):l.map(e=>(0,n.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between hover:bg-gray-50 border-b ".concat(a.includes(e)?"bg-blue-50":""),children:[(0,n.jsxs)("div",{className:"flex items-center flex-1",children:[(0,n.jsx)(z.Z,{checked:a.includes(e),onChange:()=>r(e),className:"mr-3"}),(0,n.jsx)(G,{className:a.includes(e)?"font-medium text-gray-900":"text-gray-700",children:D(e)}),o.get(e)&&(0,n.jsx)(y.Z,{className:"ml-2 text-xs",color:"blue",children:o.get(e)})]}),(0,n.jsx)("div",{className:"w-32",children:(0,n.jsx)(f.default,{value:a.includes(e)&&t[e]||"MASK",onChange:l=>s(e,l),style:{width:120},disabled:!a.includes(e),className:"".concat(a.includes(e)?"":"opacity-50"),dropdownMatchSelectWidth:!1,children:i.map(e=>(0,n.jsx)(K,{value:e,children:(0,n.jsxs)("div",{className:"flex items-center",children:[R(e),e]})},e))})})]},e))})]})},{Title:W,Text:Y}=g.default;var q=e=>{let{entities:l,actions:a,selectedEntities:t,selectedActions:i,onEntitySelect:r,onActionSelect:s,entityCategories:d=[]}=e,[c,u]=(0,o.useState)([]),m=new Map;d.forEach(e=>{e.entities.forEach(l=>{m.set(l,e.category)})});let x=l.filter(e=>0===c.length||c.includes(m.get(e)||""));return(0,n.jsxs)("div",{className:"pii-configuration",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-5",children:[(0,n.jsx)("div",{className:"flex items-center",children:(0,n.jsx)(W,{level:4,className:"!m-0 font-semibold text-gray-800",children:"Configure PII Protection"})}),(0,n.jsxs)(Y,{className:"text-gray-500",children:[t.length," items selected"]})]}),(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)(J,{categories:d,selectedCategories:c,onChange:u}),(0,n.jsx)(V,{onSelectAll:e=>{l.forEach(l=>{t.includes(l)||r(l),s(l,e)})},onUnselectAll:()=>{t.forEach(e=>{r(e)})},hasSelectedEntities:t.length>0})]}),(0,n.jsx)(U,{entities:x,selectedEntities:t,selectedActions:i,actions:a,onEntitySelect:r,onActionSelect:s,entityToCategoryMap:m})]})},H=a(10353),$=a(31283),Q=a(24199),X=e=>{var l;let{selectedProvider:a,accessToken:t,providerParams:i=null,value:r=null}=e,[s,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(i),[m,x]=(0,o.useState)(null);if((0,o.useEffect)(()=>{if(i){u(i);return}let e=async()=>{if(t){d(!0),x(null);try{let e=await (0,h.getGuardrailProviderSpecificParams)(t);console.log("Provider params API response:",e),u(e),w(e),S(e)}catch(e){console.error("Error fetching provider params:",e),x("Failed to load provider parameters")}finally{d(!1)}}};i||e()},[t,i]),!a)return null;if(s)return(0,n.jsx)(H.Z,{tip:"Loading provider parameters..."});if(m)return(0,n.jsx)("div",{className:"text-red-500",children:m});let p=null===(l=C[a])||void 0===l?void 0:l.toLowerCase(),g=c&&c[p];if(console.log("Provider key:",p),console.log("Provider fields:",g),!g||0===Object.keys(g).length)return(0,n.jsx)("div",{children:"No configuration fields available for this provider."});console.log("Value:",r);let j=new Set(["patterns","blocked_words","blocked_words_file","categories","severity_threshold","pattern_redaction_format","keyword_redaction_tag"]),y=P(a),_=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2?arguments[2]:void 0;return Object.entries(e).map(e=>{let[t,i]=e,s=l?"".concat(l,".").concat(t):t,o=a?a[t]:null==r?void 0:r[t];return(console.log("Field value:",o),"ui_friendly_name"===t||"optional_params"===t&&"nested"===i.type&&i.fields||y&&j.has(t))?null:"nested"===i.type&&i.fields?(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-2 font-medium",children:t}),(0,n.jsx)("div",{className:"ml-4 border-l-2 border-gray-200 pl-4",children:_(i.fields,s,o)})]},s):(0,n.jsx)(v.Z.Item,{name:s,label:t,tooltip:i.description,rules:i.required?[{required:!0,message:"".concat(t," is required")}]:void 0,children:"select"===i.type&&i.options?(0,n.jsx)(f.default,{placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"multiselect"===i.type&&i.options?(0,n.jsx)(f.default,{mode:"multiple",placeholder:i.description,defaultValue:o||i.default_value,children:i.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"bool"===i.type||"boolean"===i.type?(0,n.jsxs)(f.default,{placeholder:i.description,defaultValue:void 0!==o?String(o):i.default_value,children:[(0,n.jsx)(f.default.Option,{value:"true",children:"True"}),(0,n.jsx)(f.default.Option,{value:"false",children:"False"})]}):"number"===i.type?(0,n.jsx)(Q.Z,{step:1,width:400,placeholder:i.description,defaultValue:void 0!==o?Number(o):void 0}):t.includes("password")||t.includes("secret")||t.includes("key")?(0,n.jsx)($.o,{placeholder:i.description,type:"password",defaultValue:o||""}):(0,n.jsx)($.o,{placeholder:i.description,type:"text",defaultValue:o||""})},s)})};return(0,n.jsx)(n.Fragment,{children:_(g)})};let{Title:ee}=g.default,el=e=>{let{field:l,fieldKey:a,fullFieldKey:t,value:i}=e,[r,s]=o.useState([]),[d,c]=o.useState(l.dict_key_options||[]);o.useEffect(()=>{if(i&&"object"==typeof i){let e=Object.keys(i);s(e.map(e=>({key:e,id:"".concat(e,"_").concat(Date.now(),"_").concat(Math.random())}))),c((l.dict_key_options||[]).filter(l=>!e.includes(l)))}},[i,l.dict_key_options]);let u=e=>{e&&(s([...r,{key:e,id:"".concat(e,"_").concat(Date.now())}]),c(d.filter(l=>l!==e)))},m=(e,l)=>{s(r.filter(l=>l.id!==e)),c([...d,l].sort())};return(0,n.jsxs)("div",{className:"space-y-3",children:[r.map(e=>(0,n.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg",children:[(0,n.jsx)("div",{className:"w-24 font-medium text-sm",children:e.key}),(0,n.jsx)("div",{className:"flex-1",children:(0,n.jsx)(v.Z.Item,{name:Array.isArray(t)?[...t,e.key]:[t,e.key],style:{marginBottom:0},initialValue:i&&"object"==typeof i?i[e.key]:void 0,normalize:"number"===l.dict_value_type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"number"===l.dict_value_type?(0,n.jsx)(Q.Z,{step:1,width:200,placeholder:"Enter ".concat(e.key," value")}):"boolean"===l.dict_value_type?(0,n.jsxs)(f.default,{placeholder:"Select ".concat(e.key," value"),children:[(0,n.jsx)(f.default.Option,{value:!0,children:"True"}),(0,n.jsx)(f.default.Option,{value:!1,children:"False"})]}):(0,n.jsx)($.o,{placeholder:"Enter ".concat(e.key," value"),type:"text"})})}),(0,n.jsx)("button",{type:"button",className:"text-red-500 hover:text-red-700 text-sm",onClick:()=>m(e.id,e.key),children:"Remove"})]},e.id)),d.length>0&&(0,n.jsxs)("div",{className:"flex items-center space-x-3 mt-2",children:[(0,n.jsx)(f.default,{placeholder:"Select category to configure",style:{width:200},onSelect:e=>e&&u(e),value:void 0,children:d.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}),(0,n.jsx)("span",{className:"text-sm text-gray-500",children:"Select a category to add threshold configuration"})]})]})};var ea=e=>{let{optionalParams:l,parentFieldKey:a,values:t}=e,i=(e,l)=>{let i="".concat(a,".").concat(e),r=null==t?void 0:t[e];return(console.log("value",r),"dict"===l.type&&l.dict_key_options)?(0,n.jsxs)("div",{className:"mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,n.jsx)("div",{className:"mb-4 font-medium text-gray-900 text-base",children:e}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:l.description}),(0,n.jsx)(el,{field:l,fieldKey:e,fullFieldKey:[a,e],value:r})]},i):(0,n.jsx)("div",{className:"mb-8 p-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:(0,n.jsx)(v.Z.Item,{name:[a,e],label:(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)("div",{className:"font-medium text-gray-900 text-base",children:e}),(0,n.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]}),rules:l.required?[{required:!0,message:"".concat(e," is required")}]:void 0,className:"mb-0",initialValue:void 0!==r?r:l.default_value,normalize:"number"===l.type?e=>{if(null==e||""===e)return;let l=Number(e);return isNaN(l)?e:l}:void 0,children:"select"===l.type&&l.options?(0,n.jsx)(f.default,{placeholder:l.description,children:l.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"multiselect"===l.type&&l.options?(0,n.jsx)(f.default,{mode:"multiple",placeholder:l.description,children:l.options.map(e=>(0,n.jsx)(f.default.Option,{value:e,children:e},e))}):"bool"===l.type||"boolean"===l.type?(0,n.jsxs)(f.default,{placeholder:l.description,children:[(0,n.jsx)(f.default.Option,{value:"true",children:"True"}),(0,n.jsx)(f.default.Option,{value:"false",children:"False"})]}):"number"===l.type?(0,n.jsx)(Q.Z,{step:1,width:400,placeholder:l.description}):e.includes("password")||e.includes("secret")||e.includes("key")?(0,n.jsx)($.o,{placeholder:l.description,type:"password"}):(0,n.jsx)($.o,{placeholder:l.description,type:"text"})})},i)};return l.fields&&0!==Object.keys(l.fields).length?(0,n.jsxs)("div",{className:"guardrail-optional-params",children:[(0,n.jsxs)("div",{className:"mb-8 pb-4 border-b border-gray-100",children:[(0,n.jsx)(ee,{level:3,className:"mb-2 font-semibold text-gray-900",children:"Optional Parameters"}),(0,n.jsx)("p",{className:"text-gray-600 text-sm",children:l.description||"Configure additional settings for this guardrail provider"})]}),(0,n.jsx)("div",{className:"space-y-8",children:Object.entries(l.fields).map(e=>{let[l,a]=e;return i(l,a)})})]}):null},et=a(9114),ei=a(5945),er=a(58760),es=a(65319),en=a(96473),eo=a(3632),ed=a(16312);let{Text:ec}=g.default,{Option:eu}=f.default;var em=e=>{let{visible:l,prebuiltPatterns:a,categories:t,selectedPatternName:i,patternAction:r,onPatternNameChange:s,onActionChange:o,onAdd:d,onCancel:c}=e;return(0,n.jsxs)(_.Z,{title:"Add prebuilt pattern",open:l,onCancel:c,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{strong:!0,children:"Pattern type"}),(0,n.jsx)(f.default,{placeholder:"Choose pattern type",value:i,onChange:s,style:{width:"100%",marginTop:8},showSearch:!0,filterOption:(e,l)=>{let t=a.find(e=>e.name===(null==l?void 0:l.value));return!!t&&(t.display_name.toLowerCase().includes(e.toLowerCase())||t.name.toLowerCase().includes(e.toLowerCase()))},children:t.map(e=>{let l=a.filter(l=>l.category===e);return 0===l.length?null:(0,n.jsx)(f.default.OptGroup,{label:e,children:l.map(e=>(0,n.jsx)(eu,{value:e.name,children:e.display_name},e.name))},e)})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ec,{strong:!0,children:"Action"}),(0,n.jsx)(ec,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,n.jsxs)(f.default,{value:r,onChange:o,style:{width:"100%"},children:[(0,n.jsx)(eu,{value:"BLOCK",children:"Block"}),(0,n.jsx)(eu,{value:"MASK",children:"Mask"})]})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(ed.z,{variant:"secondary",onClick:c,children:"Cancel"}),(0,n.jsx)(ed.z,{onClick:d,children:"Add"})]})]})};let{Text:ex}=g.default,{Option:ep}=f.default;var eh=e=>{let{visible:l,patternName:a,patternRegex:t,patternAction:i,onNameChange:r,onRegexChange:s,onActionChange:o,onAdd:d,onCancel:c}=e;return(0,n.jsxs)(_.Z,{title:"Add custom regex pattern",open:l,onCancel:c,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Pattern name"}),(0,n.jsx)(b.o,{placeholder:"e.g., internal_id, employee_code",value:a,onValueChange:r,style:{marginTop:8}})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Regex pattern"}),(0,n.jsx)(b.o,{placeholder:"e.g., ID-[0-9]{6}",value:t,onValueChange:s,style:{marginTop:8}}),(0,n.jsx)(ex,{type:"secondary",style:{fontSize:12},children:"Enter a valid regular expression to match sensitive data"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ex,{strong:!0,children:"Action"}),(0,n.jsx)(ex,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this pattern is detected"}),(0,n.jsxs)(f.default,{value:i,onChange:o,style:{width:"100%"},children:[(0,n.jsx)(ep,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ep,{value:"MASK",children:"Mask"})]})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(b.z,{variant:"secondary",onClick:c,children:"Cancel"}),(0,n.jsx)(b.z,{onClick:d,children:"Add"})]})]})},eg=a(49566),ef=a(16853);let{Text:ej}=g.default,{Option:ev}=f.default;var ey=e=>{let{visible:l,keyword:a,action:t,description:i,onKeywordChange:r,onActionChange:s,onDescriptionChange:o,onAdd:c,onCancel:u}=e;return(0,n.jsxs)(_.Z,{title:"Add blocked keyword",open:l,onCancel:u,footer:null,width:800,children:[(0,n.jsxs)(er.Z,{direction:"vertical",style:{width:"100%"},size:"large",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Keyword"}),(0,n.jsx)(eg.Z,{placeholder:"Enter sensitive keyword or phrase",value:a,onValueChange:r,style:{marginTop:8}})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Action"}),(0,n.jsx)(ej,{type:"secondary",style:{display:"block",marginTop:4,marginBottom:8},children:"Choose what action the guardrail should take when this keyword is detected"}),(0,n.jsxs)(f.default,{value:t,onChange:s,style:{width:"100%"},children:[(0,n.jsx)(ev,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ev,{value:"MASK",children:"Mask"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(ej,{strong:!0,children:"Description (optional)"}),(0,n.jsx)(ef.Z,{placeholder:"Explain why this keyword is sensitive",value:i,onValueChange:o,rows:3,style:{marginTop:8}})]})]}),(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"24px"},children:[(0,n.jsx)(d.Z,{variant:"secondary",onClick:u,children:"Cancel"}),(0,n.jsx)(d.Z,{onClick:c,children:"Add"})]})]})},e_=a(56609),eb=a(26349);let{Text:eN}=g.default,{Option:ew}=f.default;var ek=e=>{let{patterns:l,onActionChange:a,onRemove:t}=e,i=[{title:"Type",dataIndex:"type",key:"type",width:100,render:e=>(0,n.jsx)(y.Z,{color:"prebuilt"===e?"blue":"green",children:"prebuilt"===e?"Prebuilt":"Custom"})},{title:"Pattern name",dataIndex:"name",key:"name",render:(e,l)=>l.display_name||l.name},{title:"Regex pattern",dataIndex:"pattern",key:"pattern",render:e=>e?(0,n.jsxs)(eN,{code:!0,style:{fontSize:12},children:[e.substring(0,40),"..."]}):"-"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>a(l.id,e),style:{width:120},size:"small",children:[(0,n.jsx)(ew,{value:"BLOCK",children:"Block"}),(0,n.jsx)(ew,{value:"MASK",children:"Mask"})]})},{title:"",key:"actions",width:100,render:(e,l)=>(0,n.jsx)(ed.z,{type:"button",variant:"light",color:"red",size:"xs",icon:eb.Z,onClick:()=>t(l.id),children:"Delete"})}];return 0===l.length?(0,n.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No patterns added."}):(0,n.jsx)(e_.Z,{dataSource:l,columns:i,rowKey:"id",pagination:!1,size:"small"})};let{Text:eC}=g.default,{Option:eS}=f.default;var eZ=e=>{let{keywords:l,onActionChange:a,onRemove:t}=e,i=[{title:"Keyword",dataIndex:"keyword",key:"keyword"},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>a(l.id,"action",e),style:{width:120},size:"small",children:[(0,n.jsx)(eS,{value:"BLOCK",children:"Block"}),(0,n.jsx)(eS,{value:"MASK",children:"Mask"})]})},{title:"Description",dataIndex:"description",key:"description",render:e=>e||"-"},{title:"",key:"actions",width:100,render:(e,l)=>(0,n.jsx)(ed.z,{type:"button",variant:"light",color:"red",size:"xs",icon:eb.Z,onClick:()=>t(l.id),children:"Delete"})}];return 0===l.length?(0,n.jsx)("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:"No keywords added."}):(0,n.jsx)(e_.Z,{dataSource:l,columns:i,rowKey:"id",pagination:!1,size:"small"})},eP=a(44851),eA=a(38434);let{Title:eO,Text:eI}=g.default,{Option:eL}=f.default,{Panel:eT}=eP.default;var ez=e=>{var l;let{availableCategories:a,selectedCategories:t,onCategoryAdd:i,onCategoryRemove:r,onCategoryUpdate:s,accessToken:d}=e,[c,u]=o.useState(""),[m,x]=o.useState({}),[p,g]=o.useState({}),[j,v]=o.useState([]),[_,b]=o.useState(""),[N,w]=o.useState(!1),k=async e=>{if(d&&!m[e]){g(l=>({...l,[e]:!0}));try{let l=await (0,h.getCategoryYaml)(d,e);x(a=>({...a,[e]:l.yaml_content}))}catch(l){console.error("Failed to fetch YAML for category ".concat(e,":"),l)}finally{g(l=>({...l,[e]:!1}))}}};o.useEffect(()=>{if(c&&d){let e=m[c];if(e){b(e);return}w(!0),console.log("Fetching YAML for category: ".concat(c),{accessToken:d?"present":"missing"}),(0,h.getCategoryYaml)(d,c).then(e=>{console.log("Successfully fetched YAML for ".concat(c,":"),e),b(e.yaml_content),x(l=>({...l,[c]:e.yaml_content}))}).catch(e=>{console.error("Failed to fetch preview YAML for category ".concat(c,":"),e),b("")}).finally(()=>{w(!1)})}else b(""),w(!1)},[c,d]);let C=[{title:"Category",dataIndex:"display_name",key:"display_name",render:(e,l)=>{let t=a.find(e=>e.name===l.category);return(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{fontWeight:500},children:e}),(null==t?void 0:t.description)&&(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888",marginTop:"4px"},children:t.description})]})}},{title:"Action",dataIndex:"action",key:"action",width:150,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>s(l.id,"action",e),style:{width:"100%"},children:[(0,n.jsx)(eL,{value:"BLOCK",children:(0,n.jsx)(y.Z,{color:"red",children:"BLOCK"})}),(0,n.jsx)(eL,{value:"MASK",children:(0,n.jsx)(y.Z,{color:"orange",children:"MASK"})})]})},{title:"Severity Threshold",dataIndex:"severity_threshold",key:"severity_threshold",width:180,render:(e,l)=>(0,n.jsxs)(f.default,{value:e,onChange:e=>s(l.id,"severity_threshold",e),style:{width:"100%"},children:[(0,n.jsx)(eL,{value:"low",children:"Low"}),(0,n.jsx)(eL,{value:"medium",children:"Medium"}),(0,n.jsx)(eL,{value:"high",children:"High"})]})},{title:"",key:"actions",width:80,render:(e,l)=>(0,n.jsx)(ed.z,{icon:eb.Z,onClick:()=>r(l.id),variant:"secondary",size:"xs",children:"Remove"})}],S=a.filter(e=>!t.some(l=>l.category===e.name));return(0,n.jsxs)(ei.Z,{title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(eO,{level:5,style:{margin:0},children:"Content Categories"}),(0,n.jsx)(eI,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect harmful content, bias, and inappropriate advice using semantic analysis"})]}),size:"small",children:[(0,n.jsxs)("div",{style:{marginBottom:16,display:"flex",gap:8},children:[(0,n.jsx)(f.default,{placeholder:"Select a content category",value:c||void 0,onChange:u,style:{flex:1},showSearch:!0,optionLabelProp:"label",filterOption:(e,l)=>{var a,t;return(null!==(t=null==l?void 0:null===(a=l.label)||void 0===a?void 0:a.toString().toLowerCase())&&void 0!==t?t:"").includes(e.toLowerCase())},children:S.map(e=>(0,n.jsx)(eL,{value:e.name,label:e.display_name,children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{fontWeight:500},children:e.display_name}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#666",marginTop:"2px"},children:e.description})]})},e.name))}),(0,n.jsx)(ed.z,{onClick:()=>{if(!c)return;let e=a.find(e=>e.name===c);!e||t.some(e=>e.category===c)||(i({id:"category-".concat(Date.now()),category:e.name,display_name:e.display_name,action:e.default_action,severity_threshold:"medium"}),u(""),b(""))},disabled:!c,icon:en.Z,children:"Add"})]}),c&&(0,n.jsxs)("div",{style:{marginBottom:16,padding:"12px",background:"#f9f9f9",border:"1px solid #e0e0e0",borderRadius:"4px"},children:[(0,n.jsxs)("div",{style:{marginBottom:8,fontWeight:500,fontSize:"14px"},children:["Preview: ",null===(l=a.find(e=>e.name===c))||void 0===l?void 0:l.display_name]}),N?(0,n.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading YAML..."}):_?(0,n.jsx)("pre",{style:{background:"#fff",padding:"12px",borderRadius:"4px",overflow:"auto",maxHeight:"300px",fontSize:"12px",lineHeight:"1.5",margin:0,border:"1px solid #e0e0e0"},children:(0,n.jsx)("code",{children:_})}):(0,n.jsx)("div",{style:{padding:"8px",textAlign:"center",color:"#888",fontSize:"12px"},children:"Unable to load YAML content"})]}),t.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e_.Z,{dataSource:t,columns:C,pagination:!1,size:"small",rowKey:"id"}),(0,n.jsx)("div",{style:{marginTop:16},children:(0,n.jsx)(eP.default,{activeKey:j,onChange:e=>{let l=Array.isArray(e)?e:e?[e]:[],a=new Set(j);l.forEach(e=>{a.has(e)||m[e]||k(e)}),v(l)},ghost:!0,children:t.map(e=>(0,n.jsx)(eT,{header:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,n.jsx)(eA.Z,{}),(0,n.jsxs)("span",{children:["View YAML for ",e.display_name]})]}),children:p[e.category]?(0,n.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"Loading YAML..."}):m[e.category]?(0,n.jsx)("pre",{style:{background:"#f5f5f5",padding:"16px",borderRadius:"4px",overflow:"auto",maxHeight:"400px",fontSize:"12px",lineHeight:"1.5",margin:0},children:(0,n.jsx)("code",{children:m[e.category]})}):(0,n.jsx)("div",{style:{padding:"16px",textAlign:"center",color:"#888"},children:"YAML will load when expanded"})},e.category))})})]}):(0,n.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"#888",border:"1px dashed #d9d9d9",borderRadius:"4px"},children:"No content categories selected. Add categories to detect harmful content, bias, or inappropriate advice."})]})};let{Title:eE,Text:eB}=g.default;var eM=e=>{let{prebuiltPatterns:l,categories:a,selectedPatterns:t,blockedWords:i,onPatternAdd:r,onPatternRemove:s,onPatternActionChange:d,onBlockedWordAdd:c,onBlockedWordRemove:u,onBlockedWordUpdate:m,onFileUpload:x,accessToken:p,showStep:g,contentCategories:f=[],selectedContentCategories:j=[],onContentCategoryAdd:v,onContentCategoryRemove:y,onContentCategoryUpdate:_}=e,[b,N]=(0,o.useState)(!1),[w,k]=(0,o.useState)(!1),[C,S]=(0,o.useState)(!1),[Z,P]=(0,o.useState)(""),[A,O]=(0,o.useState)("BLOCK"),[I,L]=(0,o.useState)(""),[T,z]=(0,o.useState)(""),[E,B]=(0,o.useState)("BLOCK"),[M,F]=(0,o.useState)(""),[G,K]=(0,o.useState)("BLOCK"),[D,R]=(0,o.useState)(""),[J,V]=(0,o.useState)(!1),U=async e=>{V(!0);try{let l=await e.text();if(p){let e=await (0,h.validateBlockedWordsFile)(p,l);if(e.valid)x&&x(l),et.Z.success(e.message||"File uploaded successfully");else{let l=e.error||e.errors&&e.errors.join(", ")||"Invalid file";et.Z.error("Validation failed: ".concat(l))}}}catch(e){et.Z.error("Failed to upload file: ".concat(e))}finally{V(!1)}return!1};return(0,n.jsxs)("div",{className:"space-y-6",children:[!g&&(0,n.jsx)("div",{children:(0,n.jsx)(eB,{type:"secondary",children:"Configure patterns, keywords, and content categories to detect and filter sensitive information in requests and responses."})}),(!g||"patterns"===g)&&(0,n.jsxs)(ei.Z,{title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(eE,{level:5,style:{margin:0},children:"Pattern Detection"}),(0,n.jsx)(eB,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Detect sensitive information using regex patterns (SSN, credit cards, API keys, etc.)"})]}),size:"small",children:[(0,n.jsx)("div",{style:{marginBottom:16},children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ed.z,{type:"button",onClick:()=>N(!0),icon:en.Z,children:"Add prebuilt pattern"}),(0,n.jsx)(ed.z,{type:"button",onClick:()=>S(!0),variant:"secondary",icon:en.Z,children:"Add custom regex"})]})}),(0,n.jsx)(ek,{patterns:t,onActionChange:d,onRemove:s})]}),(!g||"keywords"===g)&&(0,n.jsxs)(ei.Z,{title:(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,n.jsx)(eE,{level:5,style:{margin:0},children:"Blocked Keywords"}),(0,n.jsx)(eB,{type:"secondary",style:{fontSize:14,fontWeight:400},children:"Block or mask specific sensitive terms and phrases"})]}),size:"small",children:[(0,n.jsx)("div",{style:{marginBottom:16},children:(0,n.jsxs)(er.Z,{children:[(0,n.jsx)(ed.z,{type:"button",onClick:()=>k(!0),icon:en.Z,children:"Add keyword"}),(0,n.jsx)(es.default,{beforeUpload:U,accept:".yaml,.yml",showUploadList:!1,children:(0,n.jsx)(ed.z,{type:"button",variant:"secondary",icon:eo.Z,loading:J,children:"Upload YAML file"})})]})}),(0,n.jsx)(eZ,{keywords:i,onActionChange:m,onRemove:u})]}),(!g||"categories"===g)&&f.length>0&&v&&y&&_&&(0,n.jsx)(ez,{availableCategories:f,selectedCategories:j,onCategoryAdd:v,onCategoryRemove:y,onCategoryUpdate:_,accessToken:p}),(0,n.jsx)(em,{visible:b,prebuiltPatterns:l,categories:a,selectedPatternName:Z,patternAction:A,onPatternNameChange:P,onActionChange:e=>O(e),onAdd:()=>{if(!Z){et.Z.error("Please select a pattern");return}let e=l.find(e=>e.name===Z);r({id:"pattern-".concat(Date.now()),type:"prebuilt",name:Z,display_name:null==e?void 0:e.display_name,action:A}),N(!1),P(""),O("BLOCK")},onCancel:()=>{N(!1),P(""),O("BLOCK")}}),(0,n.jsx)(eh,{visible:C,patternName:I,patternRegex:T,patternAction:E,onNameChange:L,onRegexChange:z,onActionChange:e=>B(e),onAdd:()=>{if(!I||!T){et.Z.error("Please provide pattern name and regex");return}r({id:"custom-".concat(Date.now()),type:"custom",name:I,pattern:T,action:E}),S(!1),L(""),z(""),B("BLOCK")},onCancel:()=>{S(!1),L(""),z(""),B("BLOCK")}}),(0,n.jsx)(ey,{visible:w,keyword:M,action:G,description:D,onKeywordChange:F,onActionChange:e=>K(e),onDescriptionChange:R,onAdd:()=>{if(!M){et.Z.error("Please enter a keyword");return}c({id:"word-".concat(Date.now()),keyword:M,action:G,description:D||void 0}),k(!1),F(""),R(""),K("BLOCK")},onCancel:()=>{k(!1),F(""),R(""),K("BLOCK")}})]})},eF=a(78801),eG=a(4260),eK=a(23496),eD=a(85180),eR=a(15424);let eJ={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},eV=e=>({...eJ,...e||{},rules:(null==e?void 0:e.rules)?[...e.rules]:[]});var eU=e=>{let{value:l,onChange:a,disabled:t=!1}=e,i=eV(l),r=e=>{let l={...i,...e};null==a||a(l)},s=(e,l)=>{r({rules:i.rules.map((a,t)=>t===e?{...a,...l}:a)})},o=e=>{r({rules:i.rules.filter((l,a)=>a!==e)})},d=(e,l)=>{let a=i.rules[e];if(!a)return;let t=Object.entries(a.allowed_param_patterns||{});l(t);let r={};t.forEach(e=>{let[l,a]=e;r[l]=a}),s(e,{allowed_param_patterns:Object.keys(r).length>0?r:void 0})},c=(e,l,a)=>{d(e,e=>{if(!e[l])return;let[,t]=e[l];e[l]=[a,t]})},u=(e,l,a)=>{d(e,e=>{if(!e[l])return;let[t]=e[l];e[l]=[t,a]})},m=(e,l)=>{let a=Object.entries(e.allowed_param_patterns||{});return 0===a.length?(0,n.jsx)(T.ZP,{disabled:t,size:"small",onClick:()=>s(l,{allowed_param_patterns:{"":""}}),children:"+ Restrict tool arguments (optional)"}):(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(eF.x,{className:"text-sm text-gray-600",children:"Argument constraints (dot or array paths)"}),a.map((a,i)=>{let[r,s]=a;return(0,n.jsxs)(er.Z,{align:"start",children:[(0,n.jsx)(eG.default,{disabled:t,placeholder:"messages[0].content",value:r,onChange:e=>c(l,i,e.target.value)}),(0,n.jsx)(eG.default,{disabled:t,placeholder:"^email@.*$",value:s,onChange:e=>u(l,i,e.target.value)}),(0,n.jsx)(T.ZP,{disabled:t,icon:(0,n.jsx)(eb.Z,{}),danger:!0,onClick:()=>d(l,e=>{e.splice(i,1)})})]},"".concat(e.id||l,"-").concat(i))}),(0,n.jsx)(T.ZP,{disabled:t,size:"small",onClick:()=>s(l,{allowed_param_patterns:{...e.allowed_param_patterns||{},"":""}}),children:"+ Add another constraint"})]})};return(0,n.jsxs)(eF.Z,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eF.x,{className:"text-lg font-semibold",children:"LiteLLM Tool Permission Guardrail"}),(0,n.jsx)(eF.x,{className:"text-sm text-gray-500",children:"Provide regex patterns (e.g., ^mcp__github_.*$) for tool names or types and optionally constrain payload fields."})]}),!t&&(0,n.jsx)(T.ZP,{icon:(0,n.jsx)(en.Z,{}),type:"primary",onClick:()=>{r({rules:[...i.rules,{id:"rule_".concat(Math.random().toString(36).slice(2,8)),decision:"allow",allowed_param_patterns:void 0}]})},className:"!bg-blue-600 !text-white hover:!bg-blue-500",children:"Add Rule"})]}),(0,n.jsx)(eK.Z,{}),0===i.rules.length?(0,n.jsx)(eD.Z,{description:"No tool rules added yet"}):(0,n.jsx)("div",{className:"space-y-4",children:i.rules.map((e,l)=>{var a,i;return(0,n.jsxs)(eF.Z,{className:"bg-gray-50",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsxs)(eF.x,{className:"font-semibold",children:["Rule ",l+1]}),(0,n.jsx)(T.ZP,{icon:(0,n.jsx)(eb.Z,{}),danger:!0,type:"text",disabled:t,onClick:()=>o(l),children:"Remove"})]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eF.x,{className:"text-sm font-medium",children:"Rule ID"}),(0,n.jsx)(eG.default,{disabled:t,placeholder:"unique_rule_id",value:e.id,onChange:e=>s(l,{id:e.target.value})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(eF.x,{className:"text-sm font-medium",children:"Tool Name (optional)"}),(0,n.jsx)(eG.default,{disabled:t,placeholder:"^mcp__github_.*$",value:null!==(a=e.tool_name)&&void 0!==a?a:"",onChange:e=>s(l,{tool_name:""===e.target.value.trim()?void 0:e.target.value})})]})]}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 mt-4",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(eF.x,{className:"text-sm font-medium",children:"Tool Type (optional)"}),(0,n.jsx)(eG.default,{disabled:t,placeholder:"^function$",value:null!==(i=e.tool_type)&&void 0!==i?i:"",onChange:e=>s(l,{tool_type:""===e.target.value.trim()?void 0:e.target.value})})]})}),(0,n.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,n.jsx)(eF.x,{className:"text-sm font-medium",children:"Decision"}),(0,n.jsxs)(f.default,{disabled:t,value:e.decision,style:{width:200},onChange:e=>s(l,{decision:e}),children:[(0,n.jsx)(f.default.Option,{value:"allow",children:"Allow"}),(0,n.jsx)(f.default.Option,{value:"deny",children:"Deny"})]})]}),(0,n.jsx)("div",{className:"mt-4",children:m(e,l)})]},e.id||l)})}),(0,n.jsx)(eK.Z,{}),(0,n.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(eF.x,{className:"text-sm font-medium",children:"Default action"}),(0,n.jsxs)(f.default,{disabled:t,value:i.default_action,onChange:e=>r({default_action:e}),children:[(0,n.jsx)(f.default.Option,{value:"allow",children:"Allow"}),(0,n.jsx)(f.default.Option,{value:"deny",children:"Deny"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)(eF.x,{className:"text-sm font-medium flex items-center gap-1",children:["On disallowed action",(0,n.jsx)(L.Z,{title:"Block returns an error when a forbidden tool is invoked. Rewrite strips the tool call but lets the rest of the response continue.",children:(0,n.jsx)(eR.Z,{})})]}),(0,n.jsxs)(f.default,{disabled:t,value:i.on_disallowed_action,onChange:e=>r({on_disallowed_action:e}),children:[(0,n.jsx)(f.default.Option,{value:"block",children:"Block"}),(0,n.jsx)(f.default.Option,{value:"rewrite",children:"Rewrite"})]})]})]}),(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)(eF.x,{className:"text-sm font-medium",children:"Violation message (optional)"}),(0,n.jsx)(eG.default.TextArea,{disabled:t,rows:3,placeholder:"This violates our org policy...",value:i.violation_message_template,onChange:e=>r({violation_message_template:e.target.value})})]})]})};let{Title:eW,Text:eY,Link:eq}=g.default,{Option:eH}=f.default,{Step:e$}=j.default,eQ={pre_call:"Before LLM Call - Runs before the LLM call and checks the input (Recommended)",during_call:"During LLM Call - Runs in parallel with the LLM call, with response held until check completes",post_call:"After LLM Call - Runs after the LLM call and checks only the output",logging_only:"Logging Only - Only runs on logging callbacks without affecting the LLM call",pre_mcp_call:"Before MCP Tool Call - Runs before MCP tool execution and validates tool calls",during_mcp_call:"During MCP Tool Call - Runs in parallel with MCP tool execution for monitoring"};var eX=e=>{let{visible:l,onClose:a,accessToken:t,onSuccess:i}=e,[r]=v.Z.useForm(),[s,d]=(0,o.useState)(!1),[c,u]=(0,o.useState)(null),[m,x]=(0,o.useState)(null),[p,g]=(0,o.useState)([]),[N,A]=(0,o.useState)({}),[I,L]=(0,o.useState)(0),[T,z]=(0,o.useState)(null),[E,B]=(0,o.useState)([]),[M,F]=(0,o.useState)(2),[G,K]=(0,o.useState)({}),[D,R]=(0,o.useState)([]),[J,V]=(0,o.useState)([]),[U,W]=(0,o.useState)([]),[Y,H]=(0,o.useState)({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),$=(0,o.useMemo)(()=>!!c&&"tool_permission"===(C[c]||"").toLowerCase(),[c]);(0,o.useEffect)(()=>{t&&(async()=>{try{let[e,l]=await Promise.all([(0,h.getGuardrailUISettings)(t),(0,h.getGuardrailProviderSpecificParams)(t)]);x(e),z(l),w(l),S(l)}catch(e){console.error("Error fetching guardrail data:",e),et.Z.fromBackend("Failed to load guardrail configuration")}})()},[t]);let Q=e=>{u(e),r.setFieldsValue({config:void 0,presidio_analyzer_api_base:void 0,presidio_anonymizer_api_base:void 0}),g([]),A({}),B([]),F(2),K({}),H({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""})},ee=e=>{g(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},el=(e,l)=>{A(a=>({...a,[e]:l}))},ei=async()=>{try{if(0===I&&(await r.validateFields(["guardrail_name","provider","mode","default_on"]),c)){let e=["guardrail_name","provider","mode","default_on"];"PresidioPII"===c&&e.push("presidio_analyzer_api_base","presidio_anonymizer_api_base"),await r.validateFields(e)}if(1===I&&Z(c)&&0===p.length){et.Z.fromBackend("Please select at least one PII entity to continue");return}L(I+1)}catch(e){console.error("Form validation failed:",e)}},er=()=>{L(I-1)},es=()=>{r.resetFields(),u(null),g([]),A({}),B([]),F(2),K({}),R([]),V([]),W([]),H({rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""}),L(0)},en=()=>{es(),a()},eo=async()=>{try{d(!0),await r.validateFields();let l=r.getFieldsValue(!0),s=C[l.provider],n={guardrail_name:l.guardrail_name,litellm_params:{guardrail:s,mode:l.mode,default_on:l.default_on},guardrail_info:{}};if("PresidioPII"===l.provider&&p.length>0){let e={};p.forEach(l=>{e[l]=N[l]||"MASK"}),n.litellm_params.pii_entities_config=e,l.presidio_analyzer_api_base&&(n.litellm_params.presidio_analyzer_api_base=l.presidio_analyzer_api_base),l.presidio_anonymizer_api_base&&(n.litellm_params.presidio_anonymizer_api_base=l.presidio_anonymizer_api_base)}if(P(l.provider))D.length>0&&(n.litellm_params.patterns=D.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action}))),J.length>0&&(n.litellm_params.blocked_words=J.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))),U.length>0&&(n.litellm_params.categories=U.map(e=>({category:e.category,enabled:!0,action:e.action,severity_threshold:e.severity_threshold||"medium"})));else if(l.config)try{let e=JSON.parse(l.config);n.guardrail_info=e}catch(e){et.Z.fromBackend("Invalid JSON in configuration"),d(!1);return}if("tool_permission"===s){if(0===Y.rules.length){et.Z.fromBackend("Add at least one tool permission rule"),d(!1);return}n.litellm_params.rules=Y.rules,n.litellm_params.default_action=Y.default_action,n.litellm_params.on_disallowed_action=Y.on_disallowed_action,Y.violation_message_template&&(n.litellm_params.violation_message_template=Y.violation_message_template)}if(console.log("values: ",JSON.stringify(l)),T&&c){var e;let a=null===(e=C[c])||void 0===e?void 0:e.toLowerCase();console.log("providerKey: ",a);let t=T[a]||{},i=new Set;console.log("providerSpecificParams: ",JSON.stringify(t)),Object.keys(t).forEach(e=>{"optional_params"!==e&&i.add(e)}),t.optional_params&&t.optional_params.fields&&Object.keys(t.optional_params.fields).forEach(e=>{i.add(e)}),console.log("allowedParams: ",i),i.forEach(e=>{let a=l[e];if(null==a||""===a){var t;a=null===(t=l.optional_params)||void 0===t?void 0:t[e]}null!=a&&""!==a&&(n.litellm_params[e]=a)})}if(!t)throw Error("No access token available");console.log("Sending guardrail data:",JSON.stringify(n)),await (0,h.createGuardrailCall)(t,n),et.Z.success("Guardrail created successfully"),es(),i(),a()}catch(e){console.error("Failed to create guardrail:",e),et.Z.fromBackend("Failed to create guardrail: "+(e instanceof Error?e.message:String(e)))}finally{d(!1)}},ed=()=>{var e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,n.jsx)(b.o,{placeholder:"Enter a name for this guardrail"})}),(0,n.jsx)(v.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,n.jsx)(f.default,{placeholder:"Select a guardrail provider",onChange:Q,labelInValue:!1,optionLabelProp:"label",dropdownRender:e=>e,showSearch:!0,children:Object.entries(k()).map(e=>{let[l,a]=e;return(0,n.jsx)(eH,{value:l,label:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[O[a]&&(0,n.jsx)("img",{src:O[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]}),children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[O[a]&&(0,n.jsx)("img",{src:O[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]})},l)})})}),(0,n.jsx)(v.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,n.jsx)(f.default,{optionLabelProp:"label",mode:"multiple",children:(null==m?void 0:null===(e=m.supported_modes)||void 0===e?void 0:e.map(e=>(0,n.jsx)(eH,{value:e,label:e,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:e}),"pre_call"===e&&(0,n.jsx)(y.Z,{color:"green",style:{marginLeft:"8px"},children:"Recommended"})]}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eQ[e]})]})},e)))||(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eH,{value:"pre_call",label:"pre_call",children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("strong",{children:"pre_call"})," ",(0,n.jsx)(y.Z,{color:"green",children:"Recommended"})]}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eQ.pre_call})]})}),(0,n.jsx)(eH,{value:"during_call",label:"during_call",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"during_call"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eQ.during_call})]})}),(0,n.jsx)(eH,{value:"post_call",label:"post_call",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"post_call"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eQ.post_call})]})}),(0,n.jsx)(eH,{value:"logging_only",label:"logging_only",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{children:(0,n.jsx)("strong",{children:"logging_only"})}),(0,n.jsx)("div",{style:{fontSize:"12px",color:"#888"},children:eQ.logging_only})]})})]})})}),(0,n.jsx)(v.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default.",children:(0,n.jsxs)(f.default,{children:[(0,n.jsx)(f.default.Option,{value:!0,children:"Yes"}),(0,n.jsx)(f.default.Option,{value:!1,children:"No"})]})}),!$&&!P(c)&&(0,n.jsx)(X,{selectedProvider:c,accessToken:t,providerParams:T})]})},ec=()=>m&&"PresidioPII"===c?(0,n.jsx)(q,{entities:m.supported_entities,actions:m.supported_actions,selectedEntities:p,selectedActions:N,onEntitySelect:ee,onActionSelect:el,entityCategories:m.pii_entity_categories}):null,eu=e=>{if(!m||!P(c))return null;let l=m.content_filter_settings;return l?(0,n.jsx)(eM,{prebuiltPatterns:l.prebuilt_patterns||[],categories:l.pattern_categories||[],selectedPatterns:D,blockedWords:J,onPatternAdd:e=>R([...D,e]),onPatternRemove:e=>R(D.filter(l=>l.id!==e)),onPatternActionChange:(e,l)=>{R(D.map(a=>a.id===e?{...a,action:l}:a))},onBlockedWordAdd:e=>V([...J,e]),onBlockedWordRemove:e=>V(J.filter(l=>l.id!==e)),onBlockedWordUpdate:(e,l,a)=>{V(J.map(t=>t.id===e?{...t,[l]:a}:t))},contentCategories:l.content_categories||[],selectedContentCategories:U,onContentCategoryAdd:e=>W([...U,e]),onContentCategoryRemove:e=>W(U.filter(l=>l.id!==e)),onContentCategoryUpdate:(e,l,a)=>{W(U.map(t=>t.id===e?{...t,[l]:a}:t))},accessToken:t,showStep:e}):null},em=()=>{var e;if(!c)return null;if($)return(0,n.jsx)(eU,{value:Y,onChange:H});if(!T)return null;console.log("guardrail_provider_map: ",C),console.log("selectedProvider: ",c);let l=null===(e=C[c])||void 0===e?void 0:e.toLowerCase(),a=T&&T[l];return a&&a.optional_params?(0,n.jsx)(ea,{optionalParams:a.optional_params,parentFieldKey:"optional_params"}):null};return(0,n.jsx)(_.Z,{title:"Add Guardrail",open:l,onCancel:en,footer:null,width:800,children:(0,n.jsxs)(v.Z,{form:r,layout:"vertical",initialValues:{mode:"pre_call",default_on:!1},children:[(0,n.jsxs)(j.default,{current:I,className:"mb-6",style:{overflow:"visible"},children:[(0,n.jsx)(e$,{title:"Basic Info"}),(0,n.jsx)(e$,{title:Z(c)?"PII Configuration":P(c)?"Default Categories":"Provider Configuration"}),P(c)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e$,{title:"Patterns"}),(0,n.jsx)(e$,{title:"Keywords"})]})]}),(()=>{switch(I){case 0:return ed();case 1:if(Z(c))return ec();if(P(c))return eu("categories");return em();case 2:if(P(c))return eu("patterns");return null;case 3:if(P(c))return eu("keywords");return null;default:return null}})(),(()=>{let e=I===(P(c)?4:2)-1;return(0,n.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[I>0&&(0,n.jsx)(b.z,{variant:"secondary",onClick:er,children:"Previous"}),!e&&(0,n.jsx)(b.z,{onClick:ei,children:"Next"}),e&&(0,n.jsx)(b.z,{onClick:eo,loading:s,children:"Create Guardrail"}),(0,n.jsx)(b.z,{variant:"secondary",onClick:en,children:"Cancel"})]})})()]})})},e0=a(47323),e1=a(21626),e4=a(97214),e2=a(28241),e8=a(58834),e5=a(69552),e6=a(71876),e3=a(74998),e9=a(44633),e7=a(86462),le=a(49084),ll=a(1309),la=a(71594),lt=a(24525),li=a(63709);let{Title:lr,Text:ls}=g.default,{Option:ln}=f.default;var lo=e=>{var l;let{visible:a,onClose:t,accessToken:i,onSuccess:r,guardrailId:s,initialValues:d}=e,[c]=v.Z.useForm(),[u,m]=(0,o.useState)(!1),[x,p]=(0,o.useState)((null==d?void 0:d.provider)||null),[g,j]=(0,o.useState)(null),[y,N]=(0,o.useState)([]),[w,S]=(0,o.useState)({});(0,o.useEffect)(()=>{(async()=>{try{if(!i)return;let e=await (0,h.getGuardrailUISettings)(i);j(e)}catch(e){console.error("Error fetching guardrail settings:",e),et.Z.fromBackend("Failed to load guardrail settings")}})()},[i]),(0,o.useEffect)(()=>{(null==d?void 0:d.pii_entities_config)&&Object.keys(d.pii_entities_config).length>0&&(N(Object.keys(d.pii_entities_config)),S(d.pii_entities_config))},[d]);let Z=e=>{N(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},P=(e,l)=>{S(a=>({...a,[e]:l}))},A=async()=>{try{m(!0);let e=await c.validateFields(),l=C[e.provider],a={guardrail_id:s,guardrail:{guardrail_name:e.guardrail_name,litellm_params:{guardrail:l,mode:e.mode,default_on:e.default_on},guardrail_info:{}}};if("PresidioPII"===e.provider&&y.length>0){let e={};y.forEach(l=>{e[l]=w[l]||"MASK"}),a.guardrail.litellm_params.pii_entities_config=e}else if(e.config)try{let l=JSON.parse(e.config);"Bedrock"===e.provider&&l?(l.guardrail_id&&(a.guardrail.litellm_params.guardrailIdentifier=l.guardrail_id),l.guardrail_version&&(a.guardrail.litellm_params.guardrailVersion=l.guardrail_version)):a.guardrail.guardrail_info=l}catch(e){et.Z.fromBackend("Invalid JSON in configuration"),m(!1);return}if(!i)throw Error("No access token available");console.log("Sending guardrail update data:",JSON.stringify(a));let n=await fetch("/guardrails/".concat(s),{method:"PUT",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(a)});if(!n.ok){let e=await n.text();throw Error(e||"Failed to update guardrail")}et.Z.success("Guardrail updated successfully"),r(),t()}catch(e){console.error("Failed to update guardrail:",e),et.Z.fromBackend("Failed to update guardrail: "+(e instanceof Error?e.message:String(e)))}finally{m(!1)}},I=()=>g&&x&&"PresidioPII"===x?(0,n.jsx)(q,{entities:g.supported_entities,actions:g.supported_actions,selectedEntities:y,selectedActions:w,onEntitySelect:Z,onActionSelect:P,entityCategories:g.pii_entity_categories}):null;return(0,n.jsx)(_.Z,{title:"Edit Guardrail",open:a,onCancel:t,footer:null,width:700,children:(0,n.jsxs)(v.Z,{form:c,layout:"vertical",initialValues:d,children:[(0,n.jsx)(v.Z.Item,{name:"guardrail_name",label:"Guardrail Name",rules:[{required:!0,message:"Please enter a guardrail name"}],children:(0,n.jsx)(b.o,{placeholder:"Enter a name for this guardrail"})}),(0,n.jsx)(v.Z.Item,{name:"provider",label:"Guardrail Provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,n.jsx)(f.default,{placeholder:"Select a guardrail provider",onChange:e=>{p(e),c.setFieldsValue({config:void 0}),N([]),S({})},disabled:!0,optionLabelProp:"label",children:Object.entries(k()).map(e=>{let[l,a]=e;return(0,n.jsx)(ln,{value:l,label:a,children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[O[a]&&(0,n.jsx)("img",{src:O[a],alt:"",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}}),(0,n.jsx)("span",{children:a})]})},l)})})}),(0,n.jsx)(v.Z.Item,{name:"mode",label:"Mode",tooltip:"How the guardrail should be applied",rules:[{required:!0,message:"Please select a mode"}],children:(0,n.jsx)(f.default,{children:(null==g?void 0:null===(l=g.supported_modes)||void 0===l?void 0:l.map(e=>(0,n.jsx)(ln,{value:e,children:e},e)))||(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ln,{value:"pre_call",children:"pre_call"}),(0,n.jsx)(ln,{value:"post_call",children:"post_call"})]})})}),(0,n.jsx)(v.Z.Item,{name:"default_on",label:"Always On",tooltip:"If enabled, this guardrail will be applied to all requests by default",valuePropName:"checked",children:(0,n.jsx)(li.Z,{})}),(()=>{if(!x)return null;if("PresidioPII"===x)return I();switch(x){case"Aporia":return(0,n.jsx)(v.Z.Item,{label:"Aporia Configuration",name:"config",tooltip:"JSON configuration for Aporia",children:(0,n.jsx)(eG.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aporia_api_key",\n "project_name": "your_project_name"\n}'})});case"AimSecurity":return(0,n.jsx)(v.Z.Item,{label:"Aim Security Configuration",name:"config",tooltip:"JSON configuration for Aim Security",children:(0,n.jsx)(eG.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_aim_api_key"\n}'})});case"Bedrock":return(0,n.jsx)(v.Z.Item,{label:"Amazon Bedrock Configuration",name:"config",tooltip:"JSON configuration for Amazon Bedrock guardrails",children:(0,n.jsx)(eG.default.TextArea,{rows:4,placeholder:'{\n "guardrail_id": "your_guardrail_id",\n "guardrail_version": "your_guardrail_version"\n}'})});case"GuardrailsAI":return(0,n.jsx)(v.Z.Item,{label:"Guardrails.ai Configuration",name:"config",tooltip:"JSON configuration for Guardrails.ai",children:(0,n.jsx)(eG.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_guardrails_api_key",\n "guardrail_id": "your_guardrail_id"\n}'})});case"LakeraAI":return(0,n.jsx)(v.Z.Item,{label:"Lakera AI Configuration",name:"config",tooltip:"JSON configuration for Lakera AI",children:(0,n.jsx)(eG.default.TextArea,{rows:4,placeholder:'{\n "api_key": "your_lakera_api_key"\n}'})});case"PromptInjection":return(0,n.jsx)(v.Z.Item,{label:"Prompt Injection Configuration",name:"config",tooltip:"JSON configuration for prompt injection detection",children:(0,n.jsx)(eG.default.TextArea,{rows:4,placeholder:'{\n "threshold": 0.8\n}'})});default:return(0,n.jsx)(v.Z.Item,{label:"Custom Configuration",name:"config",tooltip:"JSON configuration for your custom guardrail",children:(0,n.jsx)(eG.default.TextArea,{rows:4,placeholder:'{\n "key1": "value1",\n "key2": "value2"\n}'})})}})(),(0,n.jsxs)("div",{className:"flex justify-end space-x-2 mt-4",children:[(0,n.jsx)(b.z,{variant:"secondary",onClick:t,children:"Cancel"}),(0,n.jsx)(b.z,{onClick:A,loading:u,children:"Update Guardrail"})]})]})})};(i=s||(s={})).DB="db",i.CONFIG="config";var ld=e=>{let{guardrailsList:l,isLoading:a,onDeleteClick:t,accessToken:i,onGuardrailUpdated:r,isAdmin:c=!1,onGuardrailClick:u}=e,[m,x]=(0,o.useState)([{id:"created_at",desc:!0}]),[p,h]=(0,o.useState)(!1),[g,f]=(0,o.useState)(null),j=e=>e?new Date(e).toLocaleString():"-",v=[{header:"Guardrail ID",accessorKey:"guardrail_id",cell:e=>(0,n.jsx)(L.Z,{title:String(e.getValue()||""),children:(0,n.jsx)(d.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>e.getValue()&&u(e.getValue()),children:e.getValue()?"".concat(String(e.getValue()).slice(0,7),"..."):""})})},{header:"Name",accessorKey:"guardrail_name",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.guardrail_name,children:(0,n.jsx)("span",{className:"text-xs font-medium",children:a.guardrail_name||"-"})})}},{header:"Provider",accessorKey:"litellm_params.guardrail",cell:e=>{let{row:l}=e,{logo:a,displayName:t}=I(l.original.litellm_params.guardrail);return(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,n.jsx)("img",{src:a,alt:"".concat(t," logo"),className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,n.jsx)("span",{className:"text-xs",children:t})]})}},{header:"Mode",accessorKey:"litellm_params.mode",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)("span",{className:"text-xs",children:a.litellm_params.mode})}},{header:"Default On",accessorKey:"litellm_params.default_on",cell:e=>{var l,a;let{row:t}=e,i=t.original;return(0,n.jsx)(ll.C,{color:(null===(l=i.litellm_params)||void 0===l?void 0:l.default_on)?"green":"gray",className:"text-xs font-normal",size:"xs",children:(null===(a=i.litellm_params)||void 0===a?void 0:a.default_on)?"Default On":"Default Off"})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.created_at,children:(0,n.jsx)("span",{className:"text-xs",children:j(a.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:l}=e,a=l.original;return(0,n.jsx)(L.Z,{title:a.updated_at,children:(0,n.jsx)("span",{className:"text-xs",children:j(a.updated_at)})})}},{id:"actions",header:"Actions",cell:e=>{let{row:l}=e,a=l.original,i=a.guardrail_definition_location===s.CONFIG;return(0,n.jsx)("div",{className:"flex space-x-2",children:i?(0,n.jsx)(L.Z,{title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,n.jsx)(e0.Z,{"data-testid":"config-delete-icon",icon:e3.Z,size:"sm",className:"cursor-not-allowed text-gray-400",title:"Config guardrail cannot be deleted on the dashboard. Please delete it from the config file.","aria-label":"Delete guardrail (config)"})}):(0,n.jsx)(L.Z,{title:"Delete guardrail",children:(0,n.jsx)(e0.Z,{icon:e3.Z,size:"sm",onClick:()=>a.guardrail_id&&t(a.guardrail_id,a.guardrail_name||"Unnamed Guardrail"),className:"cursor-pointer hover:text-red-500"})})})}}],y=(0,la.b7)({data:l,columns:v,state:{sorting:m},onSortingChange:x,getCoreRowModel:(0,lt.sC)(),getSortedRowModel:(0,lt.tj)(),enableSorting:!0});return(0,n.jsxs)("div",{className:"rounded-lg custom-border relative",children:[(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)(e1.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,n.jsx)(e8.Z,{children:y.getHeaderGroups().map(e=>(0,n.jsx)(e6.Z,{children:e.headers.map(e=>(0,n.jsx)(e5.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,la.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(e9.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(e7.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(le.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,n.jsx)(e4.Z,{children:a?(0,n.jsx)(e6.Z,{children:(0,n.jsx)(e2.Z,{colSpan:v.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"Loading..."})})})}):l.length>0?y.getRowModel().rows.map(e=>(0,n.jsx)(e6.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,n.jsx)(e2.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,la.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,n.jsx)(e6.Z,{children:(0,n.jsx)(e2.Z,{colSpan:v.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No guardrails found"})})})})})]})}),g&&(0,n.jsx)(lo,{visible:p,onClose:()=>h(!1),accessToken:i,onSuccess:()=>{h(!1),f(null),r()},guardrailId:g.guardrail_id||"",initialValues:{guardrail_name:g.guardrail_name||"",provider:Object.keys(C).find(e=>C[e]===(null==g?void 0:g.litellm_params.guardrail))||"",mode:g.litellm_params.mode,default_on:g.litellm_params.default_on,pii_entities_config:g.litellm_params.pii_entities_config,...g.guardrail_info}})]})},lc=a(20347),lu=a(30078),lm=a(41649),lx=a(12514),lp=a(84264),lh=e=>{let{patterns:l,blockedWords:a,readOnly:t=!0,onPatternActionChange:i,onPatternRemove:r,onBlockedWordUpdate:s,onBlockedWordRemove:o}=e;if(0===l.length&&0===a.length)return null;let d=()=>{};return(0,n.jsxs)(n.Fragment,{children:[l.length>0&&(0,n.jsxs)(lx.Z,{className:"mt-6",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(lp.Z,{className:"text-lg font-semibold",children:"Pattern Detection"}),(0,n.jsxs)(lm.Z,{color:"blue",children:[l.length," patterns configured"]})]}),(0,n.jsx)(ek,{patterns:l,onActionChange:t?d:i||d,onRemove:t?d:r||d})]}),a.length>0&&(0,n.jsxs)(lx.Z,{className:"mt-6",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(lp.Z,{className:"text-lg font-semibold",children:"Blocked Keywords"}),(0,n.jsxs)(lm.Z,{color:"blue",children:[a.length," keywords configured"]})]}),(0,n.jsx)(eZ,{keywords:a,onActionChange:t?d:s||d,onRemove:t?d:o||d})]})]})},lg=e=>{var l;let{guardrailData:a,guardrailSettings:t,isEditing:i,accessToken:r,onDataChange:s,onUnsavedChanges:d}=e,[c,u]=(0,o.useState)([]),[m,x]=(0,o.useState)([]),[p,h]=(0,o.useState)([]),[g,f]=(0,o.useState)([]);(0,o.useEffect)(()=>{var e,l;if(null==a?void 0:null===(e=a.litellm_params)||void 0===e?void 0:e.patterns){let e=a.litellm_params.patterns.map((e,l)=>({id:"pattern-".concat(l),type:"prebuilt"===e.pattern_type?"prebuilt":"custom",name:e.pattern_name||e.name,display_name:e.display_name,pattern:e.pattern,action:e.action||"BLOCK"}));u(e),h(e)}else u([]),h([]);if(null==a?void 0:null===(l=a.litellm_params)||void 0===l?void 0:l.blocked_words){let e=a.litellm_params.blocked_words.map((e,l)=>({id:"word-".concat(l),keyword:e.keyword,action:e.action||"BLOCK",description:e.description}));x(e),f(e)}else x([]),f([])},[a]),(0,o.useEffect)(()=>{s&&s(c,m)},[c,m,s]);let j=o.useMemo(()=>{let e=JSON.stringify(c)!==JSON.stringify(p),l=JSON.stringify(m)!==JSON.stringify(g);return e||l},[c,m,p,g]);return((0,o.useEffect)(()=>{i&&d&&d(j)},[j,i,d]),(null==a?void 0:null===(l=a.litellm_params)||void 0===l?void 0:l.guardrail)!=="litellm_content_filter")?null:i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eK.Z,{orientation:"left",children:"Content Filter Configuration"}),j&&(0,n.jsx)("div",{className:"mb-4 px-4 py-3 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,n.jsx)("p",{className:"text-sm text-yellow-800 font-medium",children:'⚠️ You have unsaved changes to patterns or keywords. Remember to click "Save Changes" at the bottom.'})}),(0,n.jsx)("div",{className:"mb-6",children:t&&t.content_filter_settings&&(0,n.jsx)(eM,{prebuiltPatterns:t.content_filter_settings.prebuilt_patterns||[],categories:t.content_filter_settings.pattern_categories||[],selectedPatterns:c,blockedWords:m,onPatternAdd:e=>u([...c,e]),onPatternRemove:e=>u(c.filter(l=>l.id!==e)),onPatternActionChange:(e,l)=>u(c.map(a=>a.id===e?{...a,action:l}:a)),onBlockedWordAdd:e=>x([...m,e]),onBlockedWordRemove:e=>x(m.filter(l=>l.id!==e)),onBlockedWordUpdate:(e,l,a)=>x(m.map(t=>t.id===e?{...t,[l]:a}:t)),onFileUpload:e=>{console.log("File uploaded:",e)},accessToken:r})})]}):(0,n.jsx)(lh,{patterns:c,blockedWords:m,readOnly:!0})};let lf=(e,l)=>({patterns:e.map(e=>({pattern_type:"prebuilt"===e.type?"prebuilt":"regex",pattern_name:"prebuilt"===e.type?e.name:void 0,pattern:"custom"===e.type?e.pattern:void 0,name:e.name,action:e.action})),blocked_words:l.map(e=>({keyword:e.keyword,action:e.action,description:e.description}))});var lj=a(10900),lv=a(59872),ly=a(30401),l_=a(78867),lb=e=>{var l,a,t,i,r,s,d,c,u,m,x,p,g,j,y,_;let{guardrailId:b,onClose:N,accessToken:w,isAdmin:k}=e,[S,Z]=(0,o.useState)(null),[P,A]=(0,o.useState)(null),[O,z]=(0,o.useState)(!0),[M,F]=(0,o.useState)(!1),[G]=v.Z.useForm(),[K,D]=(0,o.useState)([]),[R,J]=(0,o.useState)({}),[V,U]=(0,o.useState)(null),[W,Y]=(0,o.useState)({}),[H,$]=(0,o.useState)(!1),Q={rules:[],default_action:"deny",on_disallowed_action:"block",violation_message_template:""},[ee,el]=(0,o.useState)(Q),[ei,er]=(0,o.useState)(!1),es=o.useRef({patterns:[],blockedWords:[]}),en=(0,o.useCallback)((e,l)=>{es.current={patterns:e,blockedWords:l}},[]),eo=async()=>{try{var e;if(z(!0),!w)return;let l=await (0,h.getGuardrailInfo)(w,b);if(Z(l),null===(e=l.litellm_params)||void 0===e?void 0:e.pii_entities_config){let e=l.litellm_params.pii_entities_config;if(D([]),J({}),Object.keys(e).length>0){let l=[],a={};Object.entries(e).forEach(e=>{let[t,i]=e;l.push(t),a[t]="string"==typeof i?i:"MASK"}),D(l),J(a)}}else D([]),J({})}catch(e){et.Z.fromBackend("Failed to load guardrail information"),console.error("Error fetching guardrail info:",e)}finally{z(!1)}},ed=async()=>{try{if(!w)return;let e=await (0,h.getGuardrailProviderSpecificParams)(w);A(e)}catch(e){console.error("Error fetching guardrail provider specific params:",e)}},ec=async()=>{try{if(!w)return;let e=await (0,h.getGuardrailUISettings)(w);U(e)}catch(e){console.error("Error fetching guardrail UI settings:",e)}};(0,o.useEffect)(()=>{ed()},[w]),(0,o.useEffect)(()=>{eo(),ec()},[b,w]),(0,o.useEffect)(()=>{if(S&&G){var e;G.setFieldsValue({guardrail_name:S.guardrail_name,...S.litellm_params,guardrail_info:S.guardrail_info?JSON.stringify(S.guardrail_info,null,2):"",...(null===(e=S.litellm_params)||void 0===e?void 0:e.optional_params)&&{optional_params:S.litellm_params.optional_params}})}},[S,P,G]);let eu=(0,o.useCallback)(()=>{var e,l,a,t,i;(null==S?void 0:null===(e=S.litellm_params)||void 0===e?void 0:e.guardrail)==="tool_permission"?el({rules:(null===(l=S.litellm_params)||void 0===l?void 0:l.rules)||[],default_action:((null===(a=S.litellm_params)||void 0===a?void 0:a.default_action)||"deny").toLowerCase(),on_disallowed_action:((null===(t=S.litellm_params)||void 0===t?void 0:t.on_disallowed_action)||"block").toLowerCase(),violation_message_template:(null===(i=S.litellm_params)||void 0===i?void 0:i.violation_message_template)||""}):el(Q),er(!1)},[S]);(0,o.useEffect)(()=>{eu()},[eu]);let em=async e=>{try{var l,a,t,i,r,s,n,o,d,c,u,m;if(!w)return;let x={litellm_params:{}};e.guardrail_name!==S.guardrail_name&&(x.guardrail_name=e.guardrail_name),e.default_on!==(null===(l=S.litellm_params)||void 0===l?void 0:l.default_on)&&(x.litellm_params.default_on=e.default_on);let p=S.guardrail_info,g=e.guardrail_info?JSON.parse(e.guardrail_info):void 0;JSON.stringify(p)!==JSON.stringify(g)&&(x.guardrail_info=g);let f=(null===(a=S.litellm_params)||void 0===a?void 0:a.pii_entities_config)||{},j={};if(K.forEach(e=>{j[e]=R[e]||"MASK"}),JSON.stringify(f)!==JSON.stringify(j)&&(x.litellm_params.pii_entities_config=j),(null===(t=S.litellm_params)||void 0===t?void 0:t.guardrail)==="litellm_content_filter"){let e=(null===(s=S.litellm_params)||void 0===s?void 0:s.patterns)||[],l=(null===(n=S.litellm_params)||void 0===n?void 0:n.blocked_words)||[],a=lf(es.current.patterns,es.current.blockedWords);JSON.stringify(e)!==JSON.stringify(a.patterns)&&(x.litellm_params.patterns=a.patterns),JSON.stringify(l)!==JSON.stringify(a.blocked_words)&&(x.litellm_params.blocked_words=a.blocked_words)}if((null===(i=S.litellm_params)||void 0===i?void 0:i.guardrail)==="tool_permission"){let e=(null===(o=S.litellm_params)||void 0===o?void 0:o.rules)||[],l=ee.rules||[],a=JSON.stringify(e)!==JSON.stringify(l),t=((null===(d=S.litellm_params)||void 0===d?void 0:d.default_action)||"deny").toLowerCase(),i=(ee.default_action||"deny").toLowerCase(),r=t!==i,s=((null===(c=S.litellm_params)||void 0===c?void 0:c.on_disallowed_action)||"block").toLowerCase(),n=(ee.on_disallowed_action||"block").toLowerCase(),m=s!==n,p=(null===(u=S.litellm_params)||void 0===u?void 0:u.violation_message_template)||"",h=ee.violation_message_template||"",g=p!==h;(ei||a||r||m||g)&&(x.litellm_params.rules=l,x.litellm_params.default_action=i,x.litellm_params.on_disallowed_action=n,x.litellm_params.violation_message_template=h||null)}let v=Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)});console.log("values: ",JSON.stringify(e)),console.log("currentProvider: ",v);let y=(null===(r=S.litellm_params)||void 0===r?void 0:r.guardrail)==="tool_permission";if(P&&v&&!y){let l=P[null===(m=C[v])||void 0===m?void 0:m.toLowerCase()]||{},a=new Set;console.log("providerSpecificParams: ",JSON.stringify(l)),Object.keys(l).forEach(e=>{"optional_params"!==e&&a.add(e)}),l.optional_params&&l.optional_params.fields&&Object.keys(l.optional_params.fields).forEach(e=>{a.add(e)}),console.log("allowedParams: ",a),a.forEach(l=>{var a,t;let i=e[l];(null==i||""===i)&&(i=null===(t=e.optional_params)||void 0===t?void 0:t[l]);let r=null===(a=S.litellm_params)||void 0===a?void 0:a[l];JSON.stringify(i)!==JSON.stringify(r)&&(null!=i&&""!==i?x.litellm_params[l]=i:null!=r&&""!==r&&(x.litellm_params[l]=null))})}if(0===Object.keys(x.litellm_params).length&&delete x.litellm_params,0===Object.keys(x).length){et.Z.info("No changes detected"),F(!1);return}await (0,h.updateGuardrailCall)(w,b,x),et.Z.success("Guardrail updated successfully"),$(!1),eo(),F(!1)}catch(e){console.error("Error updating guardrail:",e),et.Z.fromBackend("Failed to update guardrail")}};if(O)return(0,n.jsx)("div",{className:"p-4",children:"Loading..."});if(!S)return(0,n.jsx)("div",{className:"p-4",children:"Guardrail not found"});let ex=e=>e?new Date(e).toLocaleString():"-",{logo:ep,displayName:eh}=I((null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)||""),eg=async(e,l)=>{await (0,lv.vQ)(e)&&(Y(e=>({...e,[l]:!0})),setTimeout(()=>{Y(e=>({...e,[l]:!1}))},2e3))},ef="config"===S.guardrail_definition_location;return(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.zx,{icon:lj.Z,variant:"light",onClick:N,className:"mb-4",children:"Back to Guardrails"}),(0,n.jsx)(lu.Dx,{children:S.guardrail_name||"Unnamed Guardrail"}),(0,n.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,n.jsx)(lu.xv,{className:"text-gray-500 font-mono",children:S.guardrail_id}),(0,n.jsx)(T.ZP,{type:"text",size:"small",icon:W["guardrail-id"]?(0,n.jsx)(ly.Z,{size:12}):(0,n.jsx)(l_.Z,{size:12}),onClick:()=>eg(S.guardrail_id,"guardrail-id"),className:"left-2 z-10 transition-all duration-200 ".concat(W["guardrail-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,n.jsxs)(lu.v0,{children:[(0,n.jsxs)(lu.td,{className:"mb-4",children:[(0,n.jsx)(lu.OK,{children:"Overview"},"overview"),k?(0,n.jsx)(lu.OK,{children:"Settings"},"settings"):(0,n.jsx)(n.Fragment,{})]}),(0,n.jsxs)(lu.nP,{children:[(0,n.jsxs)(lu.x4,{children:[(0,n.jsxs)(lu.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,n.jsxs)(lu.Zb,{children:[(0,n.jsx)(lu.xv,{children:"Provider"}),(0,n.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[ep&&(0,n.jsx)("img",{src:ep,alt:"".concat(eh," logo"),className:"w-6 h-6",onError:e=>{e.target.style.display="none"}}),(0,n.jsx)(lu.Dx,{children:eh})]})]}),(0,n.jsxs)(lu.Zb,{children:[(0,n.jsx)(lu.xv,{children:"Mode"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(lu.Dx,{children:(null===(a=S.litellm_params)||void 0===a?void 0:a.mode)||"-"}),(0,n.jsx)(lu.Ct,{color:(null===(t=S.litellm_params)||void 0===t?void 0:t.default_on)?"green":"gray",children:(null===(i=S.litellm_params)||void 0===i?void 0:i.default_on)?"Default On":"Default Off"})]})]}),(0,n.jsxs)(lu.Zb,{children:[(0,n.jsx)(lu.xv,{children:"Created At"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(lu.Dx,{children:ex(S.created_at)}),(0,n.jsxs)(lu.xv,{children:["Last Updated: ",ex(S.updated_at)]})]})]})]}),(null===(r=S.litellm_params)||void 0===r?void 0:r.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsx)(lu.Zb,{className:"mt-6",children:(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"PII Protection"}),(0,n.jsxs)(lu.Ct,{color:"blue",children:[Object.keys(S.litellm_params.pii_entities_config).length," PII entities configured"]})]})}),(null===(s=S.litellm_params)||void 0===s?void 0:s.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsxs)(lu.Zb,{className:"mt-6",children:[(0,n.jsx)(lu.xv,{className:"mb-4 text-lg font-semibold",children:"PII Entity Configuration"}),(0,n.jsxs)("div",{className:"border rounded-lg overflow-hidden shadow-sm",children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-5 py-3 border-b flex",children:[(0,n.jsx)(lu.xv,{className:"flex-1 font-semibold text-gray-700",children:"Entity Type"}),(0,n.jsx)(lu.xv,{className:"flex-1 font-semibold text-gray-700",children:"Configuration"})]}),(0,n.jsx)("div",{className:"max-h-[400px] overflow-y-auto",children:Object.entries(null===(d=S.litellm_params)||void 0===d?void 0:d.pii_entities_config).map(e=>{let[l,a]=e;return(0,n.jsxs)("div",{className:"px-5 py-3 flex border-b hover:bg-gray-50 transition-colors",children:[(0,n.jsx)(lu.xv,{className:"flex-1 font-medium text-gray-900",children:l}),(0,n.jsx)(lu.xv,{className:"flex-1",children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 ".concat("MASK"===a?"text-blue-600":"text-red-600"),children:["MASK"===a?(0,n.jsx)(E.Z,{}):(0,n.jsx)(B.Z,{}),String(a)]})})]},l)})})]})]}),(null===(c=S.litellm_params)||void 0===c?void 0:c.guardrail)==="tool_permission"&&(0,n.jsx)(lu.Zb,{className:"mt-6",children:(0,n.jsx)(eU,{value:ee,disabled:!0})}),(0,n.jsx)(lg,{guardrailData:S,guardrailSettings:V,isEditing:!1,accessToken:w})]}),k&&(0,n.jsx)(lu.x4,{children:(0,n.jsxs)(lu.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(lu.Dx,{children:"Guardrail Settings"}),ef&&(0,n.jsx)(L.Z,{title:"Guardrail is defined in the config file and cannot be edited.",children:(0,n.jsx)(eR.Z,{})}),!M&&!ef&&(0,n.jsx)(lu.zx,{onClick:()=>F(!0),children:"Edit Settings"})]}),M?(0,n.jsxs)(v.Z,{form:G,onFinish:em,initialValues:{guardrail_name:S.guardrail_name,...S.litellm_params,guardrail_info:S.guardrail_info?JSON.stringify(S.guardrail_info,null,2):"",...(null===(u=S.litellm_params)||void 0===u?void 0:u.optional_params)&&{optional_params:S.litellm_params.optional_params}},layout:"vertical",children:[(0,n.jsx)(v.Z.Item,{label:"Guardrail Name",name:"guardrail_name",rules:[{required:!0,message:"Please input a guardrail name"}],children:(0,n.jsx)(lu.oi,{})}),(0,n.jsx)(v.Z.Item,{label:"Default On",name:"default_on",children:(0,n.jsxs)(f.default,{children:[(0,n.jsx)(f.default.Option,{value:!0,children:"Yes"}),(0,n.jsx)(f.default.Option,{value:!1,children:"No"})]})}),(null===(m=S.litellm_params)||void 0===m?void 0:m.guardrail)==="presidio"&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eK.Z,{orientation:"left",children:"PII Protection"}),(0,n.jsx)("div",{className:"mb-6",children:V&&(0,n.jsx)(q,{entities:V.supported_entities,actions:V.supported_actions,selectedEntities:K,selectedActions:R,onEntitySelect:e=>{D(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},onActionSelect:(e,l)=>{J(a=>({...a,[e]:l}))},entityCategories:V.pii_entity_categories})})]}),(0,n.jsx)(lg,{guardrailData:S,guardrailSettings:V,isEditing:!0,accessToken:w,onDataChange:en,onUnsavedChanges:$}),(0,n.jsx)(eK.Z,{orientation:"left",children:"Provider Settings"}),(null===(x=S.litellm_params)||void 0===x?void 0:x.guardrail)==="tool_permission"?(0,n.jsx)(eU,{value:ee,onChange:el}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(X,{selectedProvider:Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)})||null,accessToken:w,providerParams:P,value:S.litellm_params}),P&&(()=>{var e;let l=Object.keys(C).find(e=>{var l;return C[e]===(null===(l=S.litellm_params)||void 0===l?void 0:l.guardrail)});if(!l)return null;let a=P[null===(e=C[l])||void 0===e?void 0:e.toLowerCase()];return a&&a.optional_params?(0,n.jsx)(ea,{optionalParams:a.optional_params,parentFieldKey:"optional_params",values:S.litellm_params}):null})()]}),(0,n.jsx)(eK.Z,{orientation:"left",children:"Advanced Settings"}),(0,n.jsx)(v.Z.Item,{label:"Guardrail Information",name:"guardrail_info",children:(0,n.jsx)(eG.default.TextArea,{rows:5})}),(0,n.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,n.jsx)(T.ZP,{onClick:()=>{F(!1),$(!1),eu()},children:"Cancel"}),(0,n.jsx)(lu.zx,{children:"Save Changes"})]})]}):(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"Guardrail ID"}),(0,n.jsx)("div",{className:"font-mono",children:S.guardrail_id})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"Guardrail Name"}),(0,n.jsx)("div",{children:S.guardrail_name||"Unnamed Guardrail"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"Provider"}),(0,n.jsx)("div",{children:eh})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"Mode"}),(0,n.jsx)("div",{children:(null===(p=S.litellm_params)||void 0===p?void 0:p.mode)||"-"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"Default On"}),(0,n.jsx)(lu.Ct,{color:(null===(g=S.litellm_params)||void 0===g?void 0:g.default_on)?"green":"gray",children:(null===(j=S.litellm_params)||void 0===j?void 0:j.default_on)?"Yes":"No"})]}),(null===(y=S.litellm_params)||void 0===y?void 0:y.pii_entities_config)&&Object.keys(S.litellm_params.pii_entities_config).length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"PII Protection"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsxs)(lu.Ct,{color:"blue",children:[Object.keys(S.litellm_params.pii_entities_config).length," PII entities configured"]})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"Created At"}),(0,n.jsx)("div",{children:ex(S.created_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(lu.xv,{className:"font-medium",children:"Last Updated"}),(0,n.jsx)("div",{children:ex(S.updated_at)})]}),(null===(_=S.litellm_params)||void 0===_?void 0:_.guardrail)==="tool_permission"&&(0,n.jsx)(eU,{value:ee,disabled:!0})]})]})})]})]})]})},lN=a(96761),lw=a(35631),lk=a(29436),lC=a(41169),lS=a(23639),lZ=a(77565),lP=a(70464),lA=a(83669),lO=a(5540);let{Text:lI}=g.default;var lL=function(e){let{results:l,errors:a}=e,[t,i]=(0,o.useState)(new Set),r=e=>{let l=new Set(t);l.has(e)?l.delete(e):l.add(e),i(l)},s=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.focus(),l.select();let a=document.execCommand("copy");if(document.body.removeChild(l),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}};return l||a?(0,n.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Results"}),l&&l.map(e=>{let l=t.has(e.guardrailName);return(0,n.jsx)(lx.Z,{className:"bg-green-50 border-green-200",children:(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2 cursor-pointer flex-1",onClick:()=>r(e.guardrailName),children:[l?(0,n.jsx)(lZ.Z,{className:"text-gray-500 text-xs"}):(0,n.jsx)(lP.Z,{className:"text-gray-500 text-xs"}),(0,n.jsx)(lA.Z,{className:"text-green-600 text-lg"}),(0,n.jsx)("span",{className:"text-sm font-medium text-green-800",children:e.guardrailName})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,n.jsx)(lO.Z,{}),(0,n.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]}),!l&&(0,n.jsx)(d.Z,{size:"xs",variant:"secondary",icon:lS.Z,onClick:async()=>{await s(e.response_text)?et.Z.success("Result copied to clipboard"):et.Z.fromBackend("Failed to copy result")},children:"Copy"})]})]}),!l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-white border border-green-200 rounded p-3",children:[(0,n.jsx)("label",{className:"text-xs font-medium text-gray-600 mb-2 block",children:"Output Text"}),(0,n.jsx)("div",{className:"font-mono text-sm text-gray-900 whitespace-pre-wrap break-words",children:e.response_text})]}),(0,n.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,n.jsx)("span",{className:"font-medium",children:"Characters:"})," ",e.response_text.length]})]})]})},e.guardrailName)}),a&&a.map(e=>{let l=t.has(e.guardrailName);return(0,n.jsx)(lx.Z,{className:"bg-red-50 border-red-200",children:(0,n.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,n.jsx)("div",{className:"cursor-pointer mt-0.5",onClick:()=>r(e.guardrailName),children:l?(0,n.jsx)(lZ.Z,{className:"text-gray-500 text-xs"}):(0,n.jsx)(lP.Z,{className:"text-gray-500 text-xs"})}),(0,n.jsx)("div",{className:"text-red-600 mt-0.5",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,n.jsxs)("p",{className:"text-sm font-medium text-red-800 cursor-pointer",onClick:()=>r(e.guardrailName),children:[e.guardrailName," - Error"]}),(0,n.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-600",children:[(0,n.jsx)(lO.Z,{}),(0,n.jsxs)("span",{className:"font-medium",children:[e.latency,"ms"]})]})]}),!l&&(0,n.jsx)("p",{className:"text-sm text-red-700 mt-1",children:e.error.message})]})]})},e.guardrailName)})]}):null};let{TextArea:lT}=eG.default,{Text:lz}=g.default;var lE=function(e){let{guardrailNames:l,onSubmit:a,isLoading:t,results:i,errors:r,onClose:s}=e,[d,c]=(0,o.useState)(""),u=()=>{if(!d.trim()){et.Z.fromBackend("Please enter text to test");return}a(d)},m=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let l=document.createElement("textarea");l.value=e,l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l),l.focus(),l.select();let a=document.execCommand("copy");if(document.body.removeChild(l),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},x=async()=>{await m(d)?et.Z.success("Input copied to clipboard"):et.Z.fromBackend("Failed to copy input")};return(0,n.jsxs)("div",{className:"space-y-4 h-full flex flex-col",children:[(0,n.jsx)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:(0,n.jsx)("div",{className:"flex items-center space-x-3",children:(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Guardrails:"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:l.map(e=>(0,n.jsx)("div",{className:"inline-flex items-center space-x-1 bg-blue-50 px-3 py-1 rounded-md border border-blue-200",children:(0,n.jsx)("span",{className:"font-mono text-blue-700 font-medium text-sm",children:e})},e))})]}),(0,n.jsxs)("p",{className:"text-sm text-gray-500",children:["Test ",l.length>1?"guardrails":"guardrail"," and compare results"]})]})})}),(0,n.jsxs)("div",{className:"flex-1 overflow-auto space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Input Text"}),(0,n.jsx)(L.Z,{title:"Press Enter to submit. Use Shift+Enter for new line.",children:(0,n.jsx)(eR.Z,{className:"text-gray-400 cursor-help"})})]}),d&&(0,n.jsx)(ed.z,{size:"xs",variant:"secondary",icon:lS.Z,onClick:x,children:"Copy Input"})]}),(0,n.jsx)(lT,{value:d,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),u())},placeholder:"Enter text to test with guardrails...",rows:8,className:"font-mono text-sm"}),(0,n.jsxs)("div",{className:"flex justify-between items-center mt-1",children:[(0,n.jsxs)(lz,{className:"text-xs text-gray-500",children:["Press ",(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Enter"})," to submit • ",(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 border border-gray-300 rounded text-xs",children:"Shift+Enter"})," for new line"]}),(0,n.jsxs)(lz,{className:"text-xs text-gray-500",children:["Characters: ",d.length]})]})]}),(0,n.jsx)("div",{className:"pt-2",children:(0,n.jsx)(ed.z,{onClick:u,loading:t,disabled:!d.trim(),className:"w-full",children:t?"Testing ".concat(l.length," guardrail").concat(l.length>1?"s":"","..."):"Test ".concat(l.length," guardrail").concat(l.length>1?"s":"")})})]}),(0,n.jsx)(lL,{results:i,errors:r})]})]})},lB=e=>{let{guardrailsList:l,isLoading:a,accessToken:t,onClose:i}=e,[r,s]=(0,o.useState)(new Set),[d,c]=(0,o.useState)(""),[u,m]=(0,o.useState)([]),[x,p]=(0,o.useState)([]),[g,f]=(0,o.useState)(!1),j=l.filter(e=>{var l;return null===(l=e.guardrail_name)||void 0===l?void 0:l.toLowerCase().includes(d.toLowerCase())}),v=e=>{let l=new Set(r);l.has(e)?l.delete(e):l.add(e),s(l)},y=async e=>{if(0===r.size||!t)return;f(!0),m([]),p([]);let l=[],a=[];await Promise.all(Array.from(r).map(async i=>{let r=Date.now();try{let a=await (0,h.applyGuardrail)(t,i,e,null,null),s=Date.now()-r;l.push({guardrailName:i,response_text:a.response_text,latency:s})}catch(l){let e=Date.now()-r;console.error("Error testing guardrail ".concat(i,":"),l),a.push({guardrailName:i,error:l,latency:e})}})),m(l),p(a),f(!1),l.length>0&&et.Z.success("".concat(l.length," guardrail").concat(l.length>1?"s":""," applied successfully")),a.length>0&&et.Z.fromBackend("".concat(a.length," guardrail").concat(a.length>1?"s":""," failed"))};return(0,n.jsx)("div",{className:"w-full h-[calc(100vh-200px)]",children:(0,n.jsx)(lx.Z,{className:"h-full",children:(0,n.jsxs)("div",{className:"flex h-full",children:[(0,n.jsxs)("div",{className:"w-1/4 border-r border-gray-200 flex flex-col overflow-hidden",children:[(0,n.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,n.jsxs)("div",{className:"mb-3",children:[(0,n.jsx)(lN.Z,{className:"text-lg font-semibold mb-3",children:"Guardrails"}),(0,n.jsx)(eg.Z,{icon:lk.Z,placeholder:"Search guardrails...",value:d,onValueChange:c})]})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto",children:a?(0,n.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,n.jsx)(H.Z,{})}):0===j.length?(0,n.jsx)("div",{className:"p-4",children:(0,n.jsx)(eD.Z,{description:d?"No guardrails match your search":"No guardrails available"})}):(0,n.jsx)(lw.Z,{dataSource:j,renderItem:e=>(0,n.jsx)(lw.Z.Item,{onClick:()=>{e.guardrail_name&&v(e.guardrail_name)},className:"cursor-pointer hover:bg-gray-50 transition-colors px-4 ".concat(r.has(e.guardrail_name||"")?"bg-blue-50 border-l-4 border-l-blue-500":"border-l-4 border-l-transparent"),children:(0,n.jsx)(lw.Z.Item.Meta,{avatar:(0,n.jsx)(z.Z,{checked:r.has(e.guardrail_name||""),onClick:l=>{l.stopPropagation(),e.guardrail_name&&v(e.guardrail_name)}}),title:(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(lC.Z,{className:"text-gray-400"}),(0,n.jsx)("span",{className:"font-medium text-gray-900",children:e.guardrail_name})]}),description:(0,n.jsxs)("div",{className:"text-xs space-y-1 mt-1",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Type: "}),(0,n.jsx)("span",{className:"text-gray-600",children:e.litellm_params.guardrail})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"font-medium",children:"Mode: "}),(0,n.jsx)("span",{className:"text-gray-600",children:e.litellm_params.mode})]})]})})})})}),(0,n.jsx)("div",{className:"p-3 border-t border-gray-200 bg-gray-50",children:(0,n.jsxs)(lp.Z,{className:"text-xs text-gray-600",children:[r.size," of ",j.length," selected"]})})]}),(0,n.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,n.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,n.jsx)(lN.Z,{className:"text-xl font-semibold mb-0",children:"Guardrail Testing Playground"})}),(0,n.jsx)("div",{className:"flex-1 overflow-auto p-4",children:0===r.size?(0,n.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,n.jsx)(lC.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,n.jsx)(lp.Z,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select Guardrails to Test"}),(0,n.jsx)(lp.Z,{className:"text-center text-gray-500 max-w-md",children:"Choose one or more guardrails from the left sidebar to start testing and comparing results."})]}):(0,n.jsx)("div",{className:"h-full",children:(0,n.jsx)(lE,{guardrailNames:Array.from(r),onSubmit:y,results:u.length>0?u:null,errors:x.length>0?x:null,isLoading:g,onClose:()=>s(new Set)})})})]})]})})})},lM=a(21609),lF=e=>{let{accessToken:l,userRole:a}=e,[t,i]=(0,o.useState)([]),[r,s]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(!1),[y,_]=(0,o.useState)(null),[b,N]=(0,o.useState)(!1),[w,k]=(0,o.useState)(null),[C,S]=(0,o.useState)(0),Z=!!a&&(0,lc.tY)(a),P=async()=>{if(l){f(!0);try{let e=await (0,h.getGuardrailsList)(l);console.log("guardrails: ".concat(JSON.stringify(e))),i(e.guardrails)}catch(e){console.error("Error fetching guardrails:",e)}finally{f(!1)}}};(0,o.useEffect)(()=>{P()},[l]);let A=async()=>{if(y&&l){v(!0);try{await (0,h.deleteGuardrailCall)(l,y.guardrail_id),et.Z.success('Guardrail "'.concat(y.guardrail_name,'" deleted successfully')),await P()}catch(e){console.error("Error deleting guardrail:",e),et.Z.fromBackend("Failed to delete guardrail")}finally{v(!1),N(!1),_(null)}}},O=y&&y.litellm_params?I(y.litellm_params.guardrail).displayName:void 0;return(0,n.jsx)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:(0,n.jsxs)(u.Z,{index:C,onIndexChange:S,children:[(0,n.jsxs)(m.Z,{className:"mb-4",children:[(0,n.jsx)(c.Z,{children:"Guardrails"}),(0,n.jsx)(c.Z,{disabled:!l||0===t.length,children:"Test Playground"})]}),(0,n.jsxs)(p.Z,{children:[(0,n.jsxs)(x.Z,{children:[(0,n.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,n.jsx)(d.Z,{onClick:()=>{w&&k(null),s(!0)},disabled:!l,children:"+ Add New Guardrail"})}),w?(0,n.jsx)(lb,{guardrailId:w,onClose:()=>k(null),accessToken:l,isAdmin:Z}):(0,n.jsx)(ld,{guardrailsList:t,isLoading:g,onDeleteClick:(e,l)=>{_(t.find(l=>l.guardrail_id===e)||null),N(!0)},accessToken:l,onGuardrailUpdated:P,isAdmin:Z,onGuardrailClick:e=>k(e)}),(0,n.jsx)(eX,{visible:r,onClose:()=>{s(!1)},accessToken:l,onSuccess:()=>{P()}}),(0,n.jsx)(lM.Z,{isOpen:b,title:"Delete Guardrail",message:"Are you sure you want to delete guardrail: ".concat(null==y?void 0:y.guardrail_name,"? This action cannot be undone."),resourceInformationTitle:"Guardrail Information",resourceInformation:[{label:"Name",value:null==y?void 0:y.guardrail_name},{label:"ID",value:null==y?void 0:y.guardrail_id,code:!0},{label:"Provider",value:O},{label:"Mode",value:null==y?void 0:y.litellm_params.mode},{label:"Default On",value:(null==y?void 0:y.litellm_params.default_on)?"Yes":"No"}],onCancel:()=>{N(!1),_(null)},onOk:A,confirmLoading:j})]}),(0,n.jsx)(x.Z,{children:(0,n.jsx)(lB,{guardrailsList:t,isLoading:g,accessToken:l,onClose:()=>S(0)})})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1803-3425d0cf2a3e4677.js b/litellm/proxy/_experimental/out/_next/static/chunks/1803-3425d0cf2a3e4677.js deleted file mode 100644 index e2e86064201..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1803-3425d0cf2a3e4677.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1803,1623],{69993:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),a=r(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},s=r(55015),o=a.forwardRef(function(e,t){return a.createElement(s.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},59341:function(e,t,r){"use strict";r.d(t,{Z:function(){return D}});var n=r(5853),a=r(71049),i=r(11323),s=r(2265),o=r(66797),u=r(40099),l=r(74275),c=r(59456),d=r(93980),h=r(65573),f=r(67561),m=r(87550),p=r(628),g=r(80281),v=r(31370),b=r(20131),y=r(38929),w=r(52307),k=r(52724),x=r(7935);let C=(0,s.createContext)(null);C.displayName="GroupContext";let E=s.Fragment,O=Object.assign((0,y.yV)(function(e,t){var r;let n=(0,s.useId)(),E=(0,g.Q)(),O=(0,m.B)(),{id:M=E||"headlessui-switch-".concat(n),disabled:N=O||!1,checked:q,defaultChecked:S,onChange:j,name:P,value:D,form:L,autoFocus:F=!1,...R}=e,T=(0,s.useContext)(C),[Q,V]=(0,s.useState)(null),_=(0,s.useRef)(null),A=(0,f.T)(_,t,null===T?null:T.setSwitch,V),I=(0,l.L)(S),[Z,K]=(0,u.q)(q,j,null!=I&&I),z=(0,c.G)(),[B,H]=(0,s.useState)(!1),G=(0,d.z)(()=>{H(!0),null==K||K(!Z),z.nextFrame(()=>{H(!1)})}),W=(0,d.z)(e=>{if((0,v.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),G()}),J=(0,d.z)(e=>{e.key===k.R.Space?(e.preventDefault(),G()):e.key===k.R.Enter&&(0,b.g)(e.currentTarget)}),X=(0,d.z)(e=>e.preventDefault()),Y=(0,x.wp)(),U=(0,w.zH)(),{isFocusVisible:$,focusProps:ee}=(0,a.F)({autoFocus:F}),{isHovered:et,hoverProps:er}=(0,i.X)({isDisabled:N}),{pressed:en,pressProps:ea}=(0,o.x)({disabled:N}),ei=(0,s.useMemo)(()=>({checked:Z,disabled:N,hover:et,focus:$,active:en,autofocus:F,changing:B}),[Z,et,$,en,N,B,F]),es=(0,y.dG)({id:M,ref:A,role:"switch",type:(0,h.f)(e,Q),tabIndex:-1===e.tabIndex?0:null!=(r=e.tabIndex)?r:0,"aria-checked":Z,"aria-labelledby":Y,"aria-describedby":U,disabled:N||void 0,autoFocus:F,onClick:W,onKeyUp:J,onKeyPress:X},ee,er,ea),eo=(0,s.useCallback)(()=>{if(void 0!==I)return null==K?void 0:K(I)},[K,I]),eu=(0,y.L6)();return s.createElement(s.Fragment,null,null!=P&&s.createElement(p.Mt,{disabled:N,data:{[P]:D||"on"},overrides:{type:"checkbox",checked:Z},form:L,onReset:eo}),eu({ourProps:es,theirProps:R,slot:ei,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[r,n]=(0,s.useState)(null),[a,i]=(0,x.bE)(),[o,u]=(0,w.fw)(),l=(0,s.useMemo)(()=>({switch:r,setSwitch:n}),[r,n]),c=(0,y.L6)();return s.createElement(u,{name:"Switch.Description",value:o},s.createElement(i,{name:"Switch.Label",value:a,props:{htmlFor:null==(t=l.switch)?void 0:t.id,onClick(e){r&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},s.createElement(C.Provider,{value:l},c({ourProps:{},theirProps:e,slot:{},defaultTag:E,name:"Switch.Group"}))))},Label:x.__,Description:w.dk});var M=r(44140),N=r(26898),q=r(13241),S=r(1153),j=r(47187);let P=(0,S.fn)("Switch"),D=s.forwardRef((e,t)=>{let{checked:r,defaultChecked:a=!1,onChange:i,color:o,name:u,error:l,errorMessage:c,disabled:d,required:h,tooltip:f,id:m}=e,p=(0,n._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:o?(0,S.bM)(o,N.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:o?(0,S.bM)(o,N.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,b]=(0,M.Z)(a,r),[y,w]=(0,s.useState)(!1),{tooltipProps:k,getReferenceProps:x}=(0,j.l)(300);return s.createElement("div",{className:"flex flex-row items-center justify-start"},s.createElement(j.Z,Object.assign({text:f},k)),s.createElement("div",Object.assign({ref:(0,S.lq)([t,k.refs.setReference]),className:(0,q.q)(P("root"),"flex flex-row relative h-5")},p,x),s.createElement("input",{type:"checkbox",className:(0,q.q)(P("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:u,required:h,checked:v,onChange:e=>{e.preventDefault()}}),s.createElement(O,{checked:v,onChange:e=>{b(e),null==i||i(e)},disabled:d,className:(0,q.q)(P("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>w(!0),onBlur:()=>w(!1),id:m},s.createElement("span",{className:(0,q.q)(P("sr-only"),"sr-only")},"Switch ",v?"on":"off"),s.createElement("span",{"aria-hidden":"true",className:(0,q.q)(P("background"),v?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),s.createElement("span",{"aria-hidden":"true",className:(0,q.q)(P("round"),v?(0,q.q)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",y?(0,q.q)("ring-2",g.ringColor):"")}))),l&&c?s.createElement("p",{className:(0,q.q)(P("errorMessage"),"text-sm text-red-500 mt-1 ")},c):null)});D.displayName="Switch"},49804:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(5853),a=r(13241),i=r(1153),s=r(2265),o=r(9496);let u=(0,i.fn)("Col"),l=s.forwardRef((e,t)=>{let{numColSpan:r=1,numColSpanSm:i,numColSpanMd:l,numColSpanLg:c,children:d,className:h}=e,f=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),m=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return s.createElement("div",Object.assign({ref:t,className:(0,a.q)(u("root"),(()=>{let e=m(r,o.PT),t=m(i,o.SP),n=m(l,o.VS),s=m(c,o._w);return(0,a.q)(e,t,n,s)})(),h)},f),d)});l.displayName="Col"},35829:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853),a=r(26898),i=r(13241),s=r(1153),o=r(2265);let u=o.forwardRef((e,t)=>{let{color:r,children:u,className:l}=e,c=(0,n._T)(e,["color","children","className"]);return o.createElement("p",Object.assign({ref:t,className:(0,i.q)("font-semibold text-tremor-metric",r?(0,s.bM)(r,a.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",l)},c),u)});u.displayName="Metric"},44140:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2265);let a=(e,t)=>{let r=void 0!==t,[a,i]=(0,n.useState)(e);return[r?t:a,e=>{r||i(e)}]}},23910:function(e,t,r){var n=r(74288).Symbol;e.exports=n},54506:function(e,t,r){var n=r(23910),a=r(4479),i=r(80910),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?a(e):i(e)}},41087:function(e,t,r){var n=r(5035),a=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(a,""):e}},17071:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},4479:function(e,t,r){var n=r(23910),a=Object.prototype,i=a.hasOwnProperty,s=a.toString,o=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,o),r=e[o];try{e[o]=void 0;var n=!0}catch(e){}var a=s.call(e);return n&&(t?e[o]=r:delete e[o]),a}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,r){var n=r(17071),a="object"==typeof self&&self&&self.Object===Object&&self,i=n||a||Function("return this")();e.exports=i},5035:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},7310:function(e,t,r){var n=r(28302),a=r(11121),i=r(6660),s=Math.max,o=Math.min;e.exports=function(e,t,r){var u,l,c,d,h,f,m=0,p=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var r=u,n=l;return u=l=void 0,m=t,d=e.apply(n,r)}function y(e){var r=e-f,n=e-m;return void 0===f||r>=t||r<0||g&&n>=c}function w(){var e,r,n,i=a();if(y(i))return k(i);h=setTimeout(w,(e=i-f,r=i-m,n=t-e,g?o(n,c-r):n))}function k(e){return(h=void 0,v&&u)?b(e):(u=l=void 0,d)}function x(){var e,r=a(),n=y(r);if(u=arguments,l=this,f=r,n){if(void 0===h)return m=e=f,h=setTimeout(w,t),p?b(e):d;if(g)return clearTimeout(h),h=setTimeout(w,t),b(f)}return void 0===h&&(h=setTimeout(w,t)),d}return t=i(t)||0,n(r)&&(p=!!r.leading,c=(g="maxWait"in r)?s(i(r.maxWait)||0,t):c,v="trailing"in r?!!r.trailing:v),x.cancel=function(){void 0!==h&&clearTimeout(h),m=0,u=f=l=h=void 0},x.flush=function(){return void 0===h?d:k(a())},x}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,r){var n=r(54506),a=r(10303);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==n(e)}},11121:function(e,t,r){var n=r(74288);e.exports=function(){return n.Date.now()}},6660:function(e,t,r){var n=r(41087),a=r(28302),i=r(78371),s=0/0,o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return s;if(a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=u.test(e);return r||l.test(e)?c(e.slice(2),r?2:8):o.test(e)?s:+e}},32489:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},86669:function(e,t,r){"use strict";r.d(t,{gc:function(){return w},jF:function(){return b}});var n=r(2265);let a=e=>"boolean"==typeof e||e instanceof Boolean,i=e=>"number"==typeof e||e instanceof Number,s=e=>"bigint"==typeof e||e instanceof BigInt,o=e=>!!e&&e instanceof Date,u=e=>"string"==typeof e||e instanceof String,l=e=>Array.isArray(e),c=e=>"object"==typeof e&&null!==e,d=e=>!!e&&e instanceof Object&&"function"==typeof e;function h(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function f(e){let{field:t,value:r,data:a,lastElement:i,openBracket:s,closeBracket:o,level:u,style:l,shouldExpandNode:c,clickToExpandNode:d,outerRef:f,beforeExpandChange:m}=e,p=(0,n.useRef)(!1),[g,b]=(0,n.useState)(()=>c(u,r,t)),y=(0,n.useRef)(null);(0,n.useEffect)(()=>{p.current?b(c(u,r,t)):p.current=!0},[c]);let w=(0,n.useId)();if(0===a.length)return function(e){let{field:t,openBracket:r,closeBracket:a,lastElement:i,style:s}=e;return(0,n.createElement)("div",{className:s.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,n.createElement)("span",{className:s.label},h(t,s.quotesForFieldNames),":"),(0,n.createElement)("span",{className:s.punctuation},r),(0,n.createElement)("span",{className:s.punctuation},a),!i&&(0,n.createElement)("span",{className:s.punctuation},","))}({field:t,openBracket:s,closeBracket:o,lastElement:i,style:l});let k=g?l.collapseIcon:l.expandIcon,x=g?l.ariaLables.collapseJson:l.ariaLables.expandJson,C=u+1,E=a.length-1,O=e=>{g!==e&&(!m||m({level:u,value:r,field:t,newExpandValue:e}))&&b(e)},M=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),O("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();let t="ArrowUp"===e.key?-1:1;if(!f.current)return;let r=f.current.querySelectorAll("[role=button]"),n=-1;for(let e=0;e{var e;O(!g);let t=y.current;if(!t)return;let r=null===(e=f.current)||void 0===e?void 0:e.querySelector('[role=button][tabindex="0"]');r&&(r.tabIndex=-1),t.tabIndex=0,t.focus()};return(0,n.createElement)("div",{className:l.basicChildStyle,role:"treeitem","aria-expanded":g,"aria-selected":void 0},(0,n.createElement)("span",{className:k,onClick:N,onKeyDown:M,role:"button","aria-label":x,"aria-expanded":g,"aria-controls":g?w:void 0,ref:y,tabIndex:0===u?0:-1}),(t||""===t)&&(d?(0,n.createElement)("span",{className:l.clickableLabel,onClick:N,onKeyDown:M},h(t,l.quotesForFieldNames),":"):(0,n.createElement)("span",{className:l.label},h(t,l.quotesForFieldNames),":")),(0,n.createElement)("span",{className:l.punctuation},s),g?(0,n.createElement)("ul",{id:w,role:"group",className:l.childFieldsContainer},a.map((e,t)=>(0,n.createElement)(v,{key:e[0]||t,field:e[0],value:e[1],style:l,lastElement:t===E,level:C,shouldExpandNode:c,clickToExpandNode:d,beforeExpandChange:m,outerRef:f}))):(0,n.createElement)("span",{className:l.collapsedContent,onClick:N,onKeyDown:M}),(0,n.createElement)("span",{className:l.punctuation},o),!i&&(0,n.createElement)("span",{className:l.punctuation},","))}function m(e){let{field:t,value:r,style:n,lastElement:a,shouldExpandNode:i,clickToExpandNode:s,level:o,outerRef:u,beforeExpandChange:l}=e;return f({field:t,value:r,lastElement:a||!1,level:o,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:i,clickToExpandNode:s,data:Object.keys(r).map(e=>[e,r[e]]),outerRef:u,beforeExpandChange:l})}function p(e){let{field:t,value:r,style:n,lastElement:a,level:i,shouldExpandNode:s,clickToExpandNode:o,outerRef:u,beforeExpandChange:l}=e;return f({field:t,value:r,lastElement:a||!1,level:i,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:s,clickToExpandNode:o,data:r.map(e=>[void 0,e]),outerRef:u,beforeExpandChange:l})}function g(e){let t,{field:r,value:l,style:c,lastElement:f}=e,m=c.otherValue;if(null===l)t="null",m=c.nullValue;else if(void 0===l)t="undefined",m=c.undefinedValue;else if(u(l)){var p;p=!c.noQuotesForStringValues,t=c.stringifyStringValues?JSON.stringify(l):p?`"${l}"`:l,m=c.stringValue}else a(l)?(t=l?"true":"false",m=c.booleanValue):i(l)?(t=l.toString(),m=c.numberValue):s(l)?(t=`${l.toString()}n`,m=c.numberValue):t=o(l)?l.toISOString():d(l)?"function() { }":l.toString();return(0,n.createElement)("div",{className:c.basicChildStyle,role:"treeitem","aria-selected":void 0},(r||""===r)&&(0,n.createElement)("span",{className:c.label},h(r,c.quotesForFieldNames),":"),(0,n.createElement)("span",{className:m},t),!f&&(0,n.createElement)("span",{className:c.punctuation},","))}function v(e){let t=e.value;return l(t)?(0,n.createElement)(p,Object.assign({},e)):!c(t)||o(t)||d(t)?(0,n.createElement)(g,Object.assign({},e)):(0,n.createElement)(m,Object.assign({},e))}let b={container:"_2IvMF _GzYRV",basicChildStyle:"_2bkNM",childFieldsContainer:"_1BXBN",label:"_1MGIk",clickableLabel:"_2YKJg _1MGIk _1MFti",nullValue:"_2T6PJ",undefinedValue:"_1Gho6",stringValue:"_vGjyY",booleanValue:"_3zQKs",numberValue:"_1bQdo",otherValue:"_1xvuR",punctuation:"_3uHL6 _3eOF8",collapseIcon:"_oLqym _f10Tu _1MFti _1LId0",expandIcon:"_2AXVT _f10Tu _1MFti _1UmXx",collapsedContent:"_2KJWg _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:{collapseJson:"collapse JSON",expandJson:"expand JSON"},stringifyStringValues:!1},y=()=>!0,w=e=>{let{data:t,style:r=b,shouldExpandNode:a=y,clickToExpandNode:i=!1,beforeExpandChange:s,compactTopLevel:o,...u}=e,l=(0,n.useRef)(null);return(0,n.createElement)("div",Object.assign({"aria-label":"JSON view"},u,{className:r.container,ref:l,role:"tree"}),o&&c(t)?Object.entries(t).map(e=>{let[t,o]=e;return(0,n.createElement)(v,{key:t,field:t,value:o,style:{...b,...r},lastElement:!0,level:1,shouldExpandNode:a,clickToExpandNode:i,beforeExpandChange:s,outerRef:l})}):(0,n.createElement)(v,{value:t,style:{...b,...r},lastElement:!0,level:0,shouldExpandNode:a,clickToExpandNode:i,outerRef:l,beforeExpandChange:s}))}},52621:function(){},10900:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=a},91777:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});t.Z=a},47686:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});t.Z=a},58710:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},82182:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});t.Z=a},79814:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});t.Z=a},2356:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"}))});t.Z=a},93416:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});t.Z=a},77355:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},22452:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});t.Z=a},25327:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});t.Z=a},3497:function(e,t,r){"use strict";var n=r(2265);let a=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))});t.Z=a},2894:function(e,t,r){"use strict";r.d(t,{R:function(){return o},m:function(){return s}});var n=r(18238),a=r(7989),i=r(11255),s=class extends a.F{#e;#t;#r;#n;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#r=e.mutationCache,this.#t=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,i.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#a({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,a=!this.#n.canStart();try{if(n)t();else{this.#a({type:"pending",variables:e,isPaused:a}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#a({type:"pending",context:t,variables:e,isPaused:a})}let i=await this.#n.start();return await this.#r.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#r.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#a({type:"success",data:i}),i}catch(t){try{throw await this.#r.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#r.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#a({type:"error",error:t})}}finally{this.#r.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#r.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(e,t,r){"use strict";r.d(t,{S:function(){return p}});var n=r(45345),a=r(21733),i=r(18238),s=r(24112),o=class extends s.l{constructor(e={}){super(),this.config=e,this.#i=new Map}#i;build(e,t,r){let i=t.queryKey,s=t.queryHash??(0,n.Rm)(i,t),o=this.get(s);return o||(o=new a.A({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#i.has(e.queryHash)||(this.#i.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#i.get(e.queryHash);t&&(e.destroy(),t===e&&this.#i.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){i.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#i.get(e)}getAll(){return[...this.#i.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){i.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){i.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){i.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},u=r(2894),l=class extends s.l{constructor(e={}){super(),this.config=e,this.#s=new Set,this.#o=new Map,this.#u=0}#s;#o;#u;build(e,t,r){let n=new u.m({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#s.add(e);let t=c(e);if("string"==typeof t){let r=this.#o.get(t);r?r.push(e):this.#o.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#s.delete(e)){let t=c(e);if("string"==typeof t){let r=this.#o.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#o.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=c(e);if("string"!=typeof t)return!0;{let r=this.#o.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=c(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#o.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){i.Vr.batch(()=>{this.#s.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#s.clear(),this.#o.clear()})}getAll(){return Array.from(this.#s)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){i.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function c(e){return e.options.scope?.id}var d=r(87045),h=r(57853);function f(e){return{onFetch:(t,r)=>{let a=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[],u={pages:[],pageParams:[]},l=0,c=async()=>{let r=!1,c=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},d=(0,n.cG)(t.options,t.fetchOptions),h=async(e,a,i)=>{if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let s=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:i?"backward":"forward",meta:t.options.meta};return c(e),e})(),o=await d(s),{maxPages:u}=t.options,l=i?n.Ht:n.VX;return{pages:l(e.pages,o,u),pageParams:l(e.pageParams,a,u)}};if(i&&s.length){let e="backward"===i,t={pages:s,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:m)(a,t);u=await h(t,r,e)}else{let t=e??s.length;do{let e=0===l?o[0]??a.initialPageParam:m(a,u);if(l>0&&null==e)break;u=await h(u,e),l++}while(lt.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function m(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var p=class{#l;#r;#c;#d;#h;#f;#m;#p;constructor(e={}){this.#l=e.queryCache||new o,this.#r=e.mutationCache||new l,this.#c=e.defaultOptions||{},this.#d=new Map,this.#h=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#m=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onFocus())}),this.#p=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#m?.(),this.#m=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#l.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#r.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#l.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#l.build(this,t),a=r.state.data;return void 0===a?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#l.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),i=this.#l.get(a.queryHash),s=i?.state.data,o=(0,n.SE)(t,s);if(void 0!==o)return this.#l.build(this,a).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return i.Vr.batch(()=>this.#l.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#l.get(t.queryHash)?.state}removeQueries(e){let t=this.#l;i.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#l;return i.Vr.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(i.Vr.batch(()=>this.#l.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return i.Vr.batch(()=>(this.#l.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(i.Vr.batch(()=>this.#l.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#l.build(this,t);return r.isStaleByTime((0,n.KC)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=f(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=f(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#l}getMutationCache(){return this.#r}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#d.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#d.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#h.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#l.clear(),this.#r.clear()}}},92668:function(e,t,r){"use strict";r.d(t,{I:function(){return o}});var n=r(59121),a=r(31091),i=r(63497),s=r(99649);function o(e,t){let{years:r=0,months:o=0,weeks:u=0,days:l=0,hours:c=0,minutes:d=0,seconds:h=0}=t,f=(0,s.Q)(e),m=o||r?(0,a.z)(f,o+12*r):f,p=l||u?(0,n.E)(m,l+7*u):m;return(0,i.L)(e,p.getTime()+1e3*(h+60*(d+60*c)))}},59121:function(e,t,r){"use strict";r.d(t,{E:function(){return i}});var n=r(99649),a=r(63497);function i(e,t){let r=(0,n.Q)(e);return isNaN(t)?(0,a.L)(e,NaN):(t&&r.setDate(r.getDate()+t),r)}},31091:function(e,t,r){"use strict";r.d(t,{z:function(){return i}});var n=r(99649),a=r(63497);function i(e,t){let r=(0,n.Q)(e);if(isNaN(t))return(0,a.L)(e,NaN);if(!t)return r;let i=r.getDate(),s=(0,a.L)(e,r.getTime());return(s.setMonth(r.getMonth()+t+1,0),i>=s.getDate())?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}},63497:function(e,t,r){"use strict";function n(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}r.d(t,{L:function(){return n}})},99649:function(e,t,r){"use strict";function n(e){let t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):new Date("number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?e:NaN)}r.d(t,{Q:function(){return n}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1909-3c9de76bfc43e12c.js b/litellm/proxy/_experimental/out/_next/static/chunks/1909-3c9de76bfc43e12c.js deleted file mode 100644 index 83918eda483..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1909-3c9de76bfc43e12c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1909],{62338:function(e,s,t){t.d(s,{v:function(){return a.Z}});var a=t(40278)},16312:function(e,s,t){t.d(s,{z:function(){return a.Z}});var a=t(78489)},32176:function(e,s,t){t.d(s,{Z:function(){return g}});var a=t(57437),r=t(2265),l=t(62338),n=t(50665),i=t(19250);let c=e=>{let{key:s,info:t}=e;return{token:s,...t}};var o=t(12322),d=t(99981),u=t(16312),m=t(59872),x=t(44633),h=t(86462),p=t(39760),g=e=>{let{topKeys:s,teams:t,showTags:g=!1}=e,{accessToken:j,userRole:f,userId:_,premiumUser:y}=(0,p.Z)(),[v,k]=(0,r.useState)(!1),[b,Z]=(0,r.useState)(null),[N,w]=(0,r.useState)(void 0),[q,S]=(0,r.useState)("table"),[C,T]=(0,r.useState)(new Set),D=e=>{T(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},L=async e=>{if(j)try{let s=await (0,i.keyInfoV1Call)(j,e.api_key),t=c(s);w(t),Z(e.api_key),k(!0)}catch(e){console.error("Error fetching key info:",e)}},E=()=>{k(!1),Z(null),w(void 0)};r.useEffect(()=>{let e=e=>{"Escape"===e.key&&v&&E()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[v]);let A=[{header:"Key ID",accessorKey:"api_key",cell:e=>(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(d.Z,{title:e.getValue(),children:(0,a.jsx)(u.z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>L(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{header:"Key Alias",accessorKey:"key_alias",cell:e=>e.getValue()||"-"}],F={header:"Spend (USD)",accessorKey:"spend",cell:e=>{let s=e.getValue();return s>0&&s<.01?"<$0.01":"$".concat((0,m.pw)(s,2))}},O=g?[...A,{header:"Tags",accessorKey:"tags",cell:e=>{let s=e.getValue(),t=e.row.original.api_key,r=C.has(t);if(!s||0===s.length)return"-";let l=s.sort((e,s)=>s.usage-e.usage),n=r?l:l.slice(0,2),i=s.length>2;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[n.map((e,s)=>(0,a.jsx)(d.Z,{title:(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Tag Name:"})," ",e.tag]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend:"})," ",e.usage>0&&e.usage<.01?"<$0.01":"$".concat((0,m.pw)(e.usage,2))]})]}),children:(0,a.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[e.tag.slice(0,7),"..."]})},s)),i&&(0,a.jsx)("button",{onClick:()=>D(t),className:"ml-1 p-1 hover:bg-gray-200 rounded-full transition-colors",title:r?"Show fewer tags":"Show all tags",children:r?(0,a.jsx)(x.Z,{className:"h-3 w-3 text-gray-500"}):(0,a.jsx)(h.Z,{className:"h-3 w-3 text-gray-500"})})]})})}},F]:[...A,F],M=s.map(e=>({...e,display_key_alias:e.key_alias&&e.key_alias.length>10?"".concat(e.key_alias.slice(0,10),"..."):e.key_alias||"-"}));return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>S("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===q?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>S("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===q?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===q?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(l.v,{className:"mt-4 h-40 cursor-pointer hover:opacity-90",data:M,index:"display_key_alias",categories:["spend"],colors:["cyan"],yAxisWidth:120,tickGap:5,layout:"vertical",showLegend:!1,valueFormatter:e=>"$".concat((0,m.pw)(e,2)),onValueChange:e=>L(e),showTooltip:!0,customTooltip:e=>{var s,t;let r=null===(t=e.payload)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.payload;return(0,a.jsx)("div",{className:"relative z-50 p-3 bg-black/90 shadow-lg rounded-lg text-white max-w-xs",children:(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key Alias: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.key_alias})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Key ID: "}),(0,a.jsx)("span",{className:"font-mono text-gray-100 break-all",children:null==r?void 0:r.api_key})]}),(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("span",{className:"text-gray-300",children:"Spend: "}),(0,a.jsxs)("span",{className:"text-white font-medium",children:["$",(0,m.pw)(null==r?void 0:r.spend,2)]})]})]})})}})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,a.jsx)(o.w,{columns:O,data:s,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1,isLoading:!1})}),v&&b&&N&&(console.log("Rendering modal with:",{isModalOpen:v,selectedKey:b,keyData:N}),(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&E()},children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl relative w-11/12 max-w-6xl max-h-[90vh] overflow-y-auto min-h-[750px]",children:[(0,a.jsx)("button",{onClick:E,className:"absolute top-4 right-4 text-gray-500 hover:text-gray-700 focus:outline-none","aria-label":"Close",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("div",{className:"p-6 h-full",children:(0,a.jsx)(n.Z,{keyId:b,onClose:E,keyData:N,teams:t})})]})}))]})}},1909:function(e,s,t){t.d(s,{Z:function(){return e5}});var a=t(57437),r=t(40278),l=t(12514),n=t(49804),i=t(14042),c=t(67101),o=t(12485),d=t(18135),u=t(35242),m=t(29706),x=t(77991),h=t(21626),p=t(97214),g=t(28241),j=t(58834),f=t(69552),_=t(71876),y=t(84264),v=t(96761),k=t(51653),b=t(2265),Z=t(19250),N=t(11713),w=t(90246),q=t(20347),S=t(39760);let C=(0,w.n)("agents"),T=()=>{let{accessToken:e,userRole:s}=(0,S.Z)();return(0,N.a)({queryKey:C.list({}),queryFn:async()=>await (0,Z.getAgentsList)(e),enabled:!!e&&q.ZL.includes(s||"")})},D=(0,w.n)("customers"),L=()=>{let{accessToken:e,userRole:s}=(0,S.Z)();return(0,N.a)({queryKey:D.list({}),queryFn:async()=>await (0,Z.allEndUsersCall)(e),enabled:!!e&&q.ZL.includes(s)})};var E=t(59872),A=t(16312),F=t(75105),O=t(44851);let M={blue:"#3b82f6",cyan:"#06b6d4",indigo:"#6366f1",green:"#22c55e",red:"#ef4444",purple:"#8b5cf6"},U=e=>{let{active:s,payload:t,label:r}=e;if(s&&t&&t.length){let e=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),s=(e,s)=>{let t=s.substring(s.indexOf(".")+1);if(e.metrics&&t in e.metrics)return e.metrics[t]};return(0,a.jsxs)("div",{className:"w-56 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[(0,a.jsx)("p",{className:"text-tremor-content-strong",children:r}),t.map(t=>{var r;let l=null===(r=t.dataKey)||void 0===r?void 0:r.toString();if(!l||!t.payload)return null;let n=s(t.payload,l),i=l.includes("spend"),c=void 0!==n?i?"$".concat(n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})):n.toLocaleString():"N/A",o=M[t.color]||t.color;return(0,a.jsxs)("div",{className:"flex items-center justify-between space-x-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-2 ring-white drop-shadow-md",style:{backgroundColor:o}}),(0,a.jsx)("p",{className:"font-medium text-tremor-content dark:text-dark-tremor-content",children:e(l)})]}),(0,a.jsx)("p",{className:"font-medium text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",children:c})]},l)})]})}return null},V=e=>{let{categories:s,colors:t}=e,r=e=>e.replace("metrics.","").replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return(0,a.jsx)("div",{className:"flex items-center justify-end space-x-4",children:s.map((e,s)=>{let l=M[t[s]]||t[s];return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ring-4 ring-white",style:{backgroundColor:l}}),(0,a.jsx)("p",{className:"text-sm text-tremor-content dark:text-dark-tremor-content",children:r(e)})]},e)})})};function z(e){return e>=1e6?(e/1e6).toFixed(2)+"M":e>=1e3?e/1e3+"k":e.toString()}function I(e){return 0===e?"$0":e>=1e6?"$"+e/1e6+"M":e>=1e3?"$"+e/1e3+"k":"$"+e}var R=t(29299);let Y=e=>{var s,t;let{modelName:n,metrics:i,hidePromptCachingMetrics:o=!1}=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Requests"}),(0,a.jsx)(v.Z,{children:i.total_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Successful Requests"}),(0,a.jsx)(v.Z,{children:i.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Tokens"}),(0,a.jsx)(v.Z,{children:i.total_tokens.toLocaleString()}),(0,a.jsxs)(y.Z,{children:[Math.round(i.total_tokens/i.total_successful_requests)," avg per successful request"]})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Spend"}),(0,a.jsxs)(v.Z,{children:["$",(0,E.pw)(i.total_spend,2)]}),(0,a.jsxs)(y.Z,{children:["$",(0,E.pw)(i.total_spend/i.total_successful_requests,3)," per successful request"]})]})]}),i.top_api_keys&&i.top_api_keys.length>0&&(0,a.jsxs)(l.Z,{className:"mt-4",children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys by Spend"}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2",children:i.top_api_keys.map((e,s)=>(0,a.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"font-medium",children:e.key_alias||"".concat(e.api_key.substring(0,10),"...")}),e.team_id&&(0,a.jsxs)(y.Z,{className:"text-xs text-gray-500",children:["Team: ",e.team_id]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsxs)(y.Z,{className:"font-medium",children:["$",(0,E.pw)(e.spend,2)]}),(0,a.jsxs)(y.Z,{className:"text-xs text-gray-500",children:[e.requests.toLocaleString()," requests | ",e.tokens.toLocaleString()," tokens"]})]})]},e.api_key))})})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(V,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(F.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:z,customTooltip:U,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Requests per day"}),(0,a.jsx)(V,{categories:["metrics.api_requests"],colors:["blue"]})]}),(0,a.jsx)(r.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.api_requests"],colors:["blue"],valueFormatter:z,customTooltip:U,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Spend per day"}),(0,a.jsx)(V,{categories:["metrics.spend"],colors:["green"]})]}),(0,a.jsx)(r.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.spend"],colors:["green"],valueFormatter:e=>"$".concat((0,E.pw)(e,2,!0)),yAxisWidth:72})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Success vs Failed Requests"}),(0,a.jsx)(V,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,a.jsx)(F.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:z,stack:!0,customTooltip:U,showLegend:!1})]}),!o&&(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Prompt Caching Metrics"}),(0,a.jsx)(V,{categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"]})]}),(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsxs)(y.Z,{children:["Cache Read: ",(null===(s=i.total_cache_read_input_tokens)||void 0===s?void 0:s.toLocaleString())||0," tokens"]}),(0,a.jsxs)(y.Z,{children:["Cache Creation: ",(null===(t=i.total_cache_creation_input_tokens)||void 0===t?void 0:t.toLocaleString())||0," tokens"]})]}),(0,a.jsx)(F.Z,{className:"mt-4",data:i.daily_data,index:"date",categories:["metrics.cache_read_input_tokens","metrics.cache_creation_input_tokens"],colors:["cyan","purple"],valueFormatter:z,customTooltip:U,showLegend:!1})]})]})]})},$=e=>{let{modelMetrics:s,hidePromptCachingMetrics:t=!1}=e,r=Object.keys(s).sort((e,t)=>""===e?1:""===t?-1:s[t].total_spend-s[e].total_spend),n={total_requests:0,total_successful_requests:0,total_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,daily_data:{}};Object.values(s).forEach(e=>{n.total_requests+=e.total_requests,n.total_successful_requests+=e.total_successful_requests,n.total_tokens+=e.total_tokens,n.total_spend+=e.total_spend,n.total_cache_read_input_tokens+=e.total_cache_read_input_tokens||0,n.total_cache_creation_input_tokens+=e.total_cache_creation_input_tokens||0,e.daily_data.forEach(e=>{n.daily_data[e.date]||(n.daily_data[e.date]={prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,spend:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0}),n.daily_data[e.date].prompt_tokens+=e.metrics.prompt_tokens,n.daily_data[e.date].completion_tokens+=e.metrics.completion_tokens,n.daily_data[e.date].total_tokens+=e.metrics.total_tokens,n.daily_data[e.date].api_requests+=e.metrics.api_requests,n.daily_data[e.date].spend+=e.metrics.spend,n.daily_data[e.date].successful_requests+=e.metrics.successful_requests,n.daily_data[e.date].failed_requests+=e.metrics.failed_requests,n.daily_data[e.date].cache_read_input_tokens+=e.metrics.cache_read_input_tokens||0,n.daily_data[e.date].cache_creation_input_tokens+=e.metrics.cache_creation_input_tokens||0})});let i=Object.entries(n.daily_data).map(e=>{let[s,t]=e;return{date:s,metrics:t}}).sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime());return(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,a.jsx)(v.Z,{children:"Overall Usage"}),(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4 mb-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Requests"}),(0,a.jsx)(v.Z,{children:n.total_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Successful Requests"}),(0,a.jsx)(v.Z,{children:n.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Tokens"}),(0,a.jsx)(v.Z,{children:n.total_tokens.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(y.Z,{children:"Total Spend"}),(0,a.jsxs)(v.Z,{children:["$",(0,E.pw)(n.total_spend,2)]})]})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Total Tokens Over Time"}),(0,a.jsx)(V,{categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"]})]}),(0,a.jsx)(F.Z,{className:"mt-4",data:i,index:"date",categories:["metrics.prompt_tokens","metrics.completion_tokens","metrics.total_tokens"],colors:["blue","cyan","indigo"],valueFormatter:z,customTooltip:U,showLegend:!1})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests Over Time"}),(0,a.jsx)(F.Z,{className:"mt-4",data:i,index:"date",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["emerald","red"],valueFormatter:e=>e.toLocaleString(),stack:!0,customTooltip:U,showLegend:!1})]})]})]}),(0,a.jsx)(O.default,{defaultActiveKey:r[0],children:r.map(e=>(0,a.jsx)(O.default.Panel,{header:(0,a.jsxs)("div",{className:"flex justify-between items-center w-full",children:[(0,a.jsx)(v.Z,{children:s[e].label||"Unknown Item"}),(0,a.jsxs)("div",{className:"flex space-x-4 text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["$",(0,E.pw)(s[e].total_spend,2)]}),(0,a.jsxs)("span",{children:[s[e].total_requests.toLocaleString()," requests"]})]})]}),children:(0,a.jsx)(Y,{modelName:e||"Unknown Model",metrics:s[e],hidePromptCachingMetrics:t})},e))})]})},K=(e,s,t)=>{let a=e.metadata.key_alias||"key-hash-".concat(s),r=e.metadata.team_id;if(r){let e=(0,R.o)(r,t);return e?"".concat(a," (team: ").concat(e,")"):"".concat(a," (team_id: ").concat(r,")")}return a},P=function(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a={};return e.results.forEach(e=>{Object.entries(e.breakdown[s]||{}).forEach(r=>{let[l,n]=r;a[l]||(a[l]={label:"api_keys"===s?K(n,l,t):l,total_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0,prompt_tokens:0,completion_tokens:0,total_spend:0,total_cache_read_input_tokens:0,total_cache_creation_input_tokens:0,top_api_keys:[],daily_data:[]}),a[l].total_requests+=n.metrics.api_requests,a[l].prompt_tokens+=n.metrics.prompt_tokens,a[l].completion_tokens+=n.metrics.completion_tokens,a[l].total_tokens+=n.metrics.total_tokens,a[l].total_spend+=n.metrics.spend,a[l].total_successful_requests+=n.metrics.successful_requests,a[l].total_failed_requests+=n.metrics.failed_requests,a[l].total_cache_read_input_tokens+=n.metrics.cache_read_input_tokens||0,a[l].total_cache_creation_input_tokens+=n.metrics.cache_creation_input_tokens||0,a[l].daily_data.push({date:e.date,metrics:{prompt_tokens:n.metrics.prompt_tokens,completion_tokens:n.metrics.completion_tokens,total_tokens:n.metrics.total_tokens,api_requests:n.metrics.api_requests,spend:n.metrics.spend,successful_requests:n.metrics.successful_requests,failed_requests:n.metrics.failed_requests,cache_read_input_tokens:n.metrics.cache_read_input_tokens||0,cache_creation_input_tokens:n.metrics.cache_creation_input_tokens||0}})})}),"api_keys"!==s&&Object.entries(a).forEach(t=>{let[r,l]=t,n={};e.results.forEach(e=>{var t;let a=null===(t=e.breakdown[s])||void 0===t?void 0:t[r];a&&"api_key_breakdown"in a&&Object.entries(a.api_key_breakdown||{}).forEach(e=>{let[s,t]=e;n[s]||(n[s]={api_key:s,key_alias:t.metadata.key_alias,team_id:t.metadata.team_id,spend:0,requests:0,tokens:0}),n[s].spend+=t.metrics.spend,n[s].requests+=t.metrics.api_requests,n[s].tokens+=t.metrics.total_tokens})}),a[r].top_api_keys=Object.values(n).sort((e,s)=>s.spend-e.spend).slice(0,5)}),Object.values(a).forEach(e=>{e.daily_data.sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime())}),a};var W=t(78489),B=t(94789),H=t(49566),G=t(10032),J=t(22116),Q=t(37592),X=t(10353),ee=t(9114),es=e=>{let{isOpen:s,onClose:t,accessToken:r}=e,[l]=G.Z.useForm(),[n,i]=(0,b.useState)(!1),[c,o]=(0,b.useState)(null),[d,u]=(0,b.useState)(!1),[m,x]=(0,b.useState)("cloudzero"),[h,p]=(0,b.useState)(!1);(0,b.useEffect)(()=>{s&&r&&g()},[s,r]);let g=async()=>{u(!0);try{let e=await fetch("/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(e.ok){let s=await e.json();o(s),l.setFieldsValue({connection_id:s.connection_id})}else if(404!==e.status){let s=await e.json();ee.Z.fromBackend("Failed to load existing settings: ".concat(s.error||"Unknown error"))}}catch(e){console.error("Error loading CloudZero settings:",e),ee.Z.fromBackend("Failed to load existing settings")}finally{u(!1)}},j=async e=>{if(!r){ee.Z.fromBackend("No access token available");return}i(!0);try{let s={...e,timezone:"UTC"},t=await fetch(c?"/cloudzero/settings":"/cloudzero/init",{method:c?"PUT":"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify(s)}),a=await t.json();if(t.ok)return ee.Z.success(a.message||"CloudZero settings saved successfully"),o({api_key_masked:e.api_key.substring(0,4)+"****"+e.api_key.slice(-4),connection_id:e.connection_id,status:"configured"}),!0;return ee.Z.fromBackend(a.error||"Failed to save CloudZero settings"),!1}catch(e){return console.error("Error saving CloudZero settings:",e),ee.Z.fromBackend("Failed to save CloudZero settings"),!1}finally{i(!1)}},f=async()=>{if(!r){ee.Z.fromBackend("No access token available");return}p(!0);try{let e=await fetch("/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({limit:1e5,operation:"replace_hourly"})}),s=await e.json();e.ok?(ee.Z.success(s.message||"Export to CloudZero completed successfully"),t()):ee.Z.fromBackend(s.error||"Failed to export to CloudZero")}catch(e){console.error("Error exporting to CloudZero:",e),ee.Z.fromBackend("Failed to export to CloudZero")}finally{p(!1)}},_=async()=>{p(!0);try{ee.Z.info("CSV export functionality coming soon!"),t()}catch(e){console.error("Error exporting CSV:",e),ee.Z.fromBackend("Failed to export CSV")}finally{p(!1)}},v=async()=>{if("cloudzero"===m){if(!c){let e=await l.validateFields();if(!await j(e))return}await f()}else await _()},k=()=>{l.resetFields(),x("cloudzero"),o(null),t()},Z=[{value:"cloudzero",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/cloudzero.png",alt:"CloudZero",className:"w-5 h-5",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{children:"Export to CloudZero"})]})},{value:"csv",label:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),(0,a.jsx)("span",{children:"Export to CSV"})]})}];return(0,a.jsx)(J.Z,{title:"Export Data",open:s,onCancel:k,footer:null,width:600,destroyOnClose:!0,children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"font-medium mb-2 block",children:"Export Destination"}),(0,a.jsx)(Q.default,{value:m,onChange:x,options:Z,className:"w-full",size:"large"})]}),"cloudzero"===m&&(0,a.jsx)("div",{children:d?(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsx)(X.Z,{size:"large"})}):(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(B.Z,{title:"Existing CloudZero Configuration",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),color:"green",className:"mb-4",children:(0,a.jsxs)(y.Z,{children:["API Key: ",c.api_key_masked,(0,a.jsx)("br",{}),"Connection ID: ",c.connection_id]})}),!c&&(0,a.jsxs)(G.Z,{form:l,layout:"vertical",children:[(0,a.jsx)(G.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,a.jsx)(H.Z,{type:"password",placeholder:"Enter your CloudZero API key"})}),(0,a.jsx)(G.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter the CloudZero connection ID"}],children:(0,a.jsx)(H.Z,{placeholder:"Enter CloudZero connection ID"})})]})]})}),"csv"===m&&(0,a.jsx)(B.Z,{title:"CSV Export",icon:()=>(0,a.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})}),color:"blue",children:(0,a.jsx)(y.Z,{children:"Export your usage data as a CSV file for analysis in spreadsheet applications."})}),(0,a.jsxs)("div",{className:"flex justify-end space-x-2 pt-4",children:[(0,a.jsx)(W.Z,{variant:"secondary",onClick:k,children:"Cancel"}),(0,a.jsx)(W.Z,{onClick:v,loading:n||h,disabled:n||h,children:"cloudzero"===m?"Export to CloudZero":"Export CSV"})]})]})})},et=e=>{var s,t;let{dateRange:r,selectedFilters:l}=e;return(0,a.jsxs)("div",{className:"text-sm text-gray-500",children:[null===(s=r.from)||void 0===s?void 0:s.toLocaleDateString()," - ",null===(t=r.to)||void 0===t?void 0:t.toLocaleDateString(),l.length>0&&" \xb7 ".concat(l.length," filter").concat(l.length>1?"s":"")]})},ea=t(29967),er=e=>{let{value:s,onChange:t,entityType:r}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Export type"}),(0,a.jsx)(ea.ZP.Group,{value:s,onChange:e=>t(e.target.value),className:"w-full",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,a.jsx)(ea.ZP,{value:"daily",className:"mt-0.5"}),(0,a.jsxs)("div",{className:"ml-3 flex-1",children:[(0,a.jsx)("div",{className:"font-medium text-sm",children:"Day-by-day breakdown"}),(0,a.jsxs)("div",{className:"text-xs text-gray-500 mt-0.5",children:["Daily metrics for each ",r]})]})]}),(0,a.jsxs)("label",{className:"flex items-start p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors",children:[(0,a.jsx)(ea.ZP,{value:"daily_with_models",className:"mt-0.5"}),(0,a.jsxs)("div",{className:"ml-3 flex-1",children:[(0,a.jsxs)("div",{className:"font-medium text-sm",children:["Day-by-day by ",r," and model"]}),(0,a.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Daily metrics split by model"})]})]})]})})]})},el=e=>{let{value:s,onChange:t}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700 block mb-2",children:"Format"}),(0,a.jsx)(Q.default,{value:s,onChange:t,className:"w-full",options:[{value:"csv",label:"CSV (Excel, Google Sheets)"},{value:"json",label:"JSON (includes metadata)"}]})]})},en=t(15452),ei=t.n(en);let ec=(e,s)=>{let t=[];return e.results.forEach(e=>{Object.entries(e.breakdown.entities||{}).forEach(a=>{var r;let[l,n]=a;t.push({Date:e.date,[s]:(null===(r=n.metadata)||void 0===r?void 0:r.team_alias)||l,["".concat(s," ID")]:l,"Spend ($)":(0,E.pw)(n.metrics.spend,4),Requests:n.metrics.api_requests,"Successful Requests":n.metrics.successful_requests,"Failed Requests":n.metrics.failed_requests,"Total Tokens":n.metrics.total_tokens,"Prompt Tokens":n.metrics.prompt_tokens||0,"Completion Tokens":n.metrics.completion_tokens||0})})}),t.sort((e,s)=>new Date(e.Date).getTime()-new Date(s.Date).getTime())},eo=(e,s)=>{let t=[];return e.results.forEach(e=>{let a={};Object.entries(e.breakdown.entities||{}).forEach(s=>{var t;let[r,l]=s;null===(t=l.metadata)||void 0===t||t.team_alias,a[r]||(a[r]={}),Object.entries(e.breakdown.models||{}).forEach(e=>{let[s,t]=e;Object.entries(l.api_key_breakdown||{}).forEach(e=>{let[t,l]=e;a[r][s]||(a[r][s]={spend:0,requests:0,successful:0,failed:0,tokens:0}),a[r][s].spend+=l.metrics.spend||0,a[r][s].requests+=l.metrics.api_requests||0,a[r][s].successful+=l.metrics.successful_requests||0,a[r][s].failed+=l.metrics.failed_requests||0,a[r][s].tokens+=l.metrics.total_tokens||0})})}),Object.entries(a).forEach(a=>{var r,l;let[n,i]=a,c=null===(r=e.breakdown.entities)||void 0===r?void 0:r[n],o=(null==c?void 0:null===(l=c.metadata)||void 0===l?void 0:l.team_alias)||n;Object.entries(i).forEach(a=>{let[r,l]=a;t.push({Date:e.date,[s]:o,["".concat(s," ID")]:n,Model:r,"Spend ($)":(0,E.pw)(l.spend,4),Requests:l.requests,Successful:l.successful,Failed:l.failed,"Total Tokens":l.tokens})})})}),t.sort((e,s)=>new Date(e.Date).getTime()-new Date(s.Date).getTime())},ed=(e,s,t)=>{switch(s){case"daily":default:return ec(e,t);case"daily_with_models":return eo(e,t)}},eu=(e,s,t,a,r)=>{var l,n;return{export_date:new Date().toISOString(),entity_type:e,date_range:{from:null===(l=s.from)||void 0===l?void 0:l.toISOString(),to:null===(n=s.to)||void 0===n?void 0:n.toISOString()},filters_applied:t.length>0?t:"None",export_scope:a,summary:{total_spend:r.metadata.total_spend,total_requests:r.metadata.total_api_requests,successful_requests:r.metadata.total_successful_requests,failed_requests:r.metadata.total_failed_requests,total_tokens:r.metadata.total_tokens}}},em=(e,s,t,a)=>{let r=ed(e,s,t),l=new Blob([ei().unparse(r)],{type:"text/csv;charset=utf-8;"}),n=window.URL.createObjectURL(l),i=document.createElement("a");i.href=n;let c="".concat(a,"_usage_").concat(s,"_").concat(new Date().toISOString().split("T")[0],".csv");i.download=c,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)},ex=(e,s,t,a,r,l)=>{let n=ed(e,s,t),i=new Blob([JSON.stringify({metadata:eu(a,r,l,s,e),data:n},null,2)],{type:"application/json"}),c=window.URL.createObjectURL(i),o=document.createElement("a");o.href=c;let d="".concat(a,"_usage_").concat(s,"_").concat(new Date().toISOString().split("T")[0],".json");o.download=d,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(c)};var eh=e=>{let{isOpen:s,onClose:t,entityType:r,spendData:l,dateRange:n,selectedFilters:i,customTitle:c}=e,[o,d]=(0,b.useState)("csv"),[u,m]=(0,b.useState)("daily"),[x,h]=(0,b.useState)(!1),p=r.charAt(0).toUpperCase()+r.slice(1),g=c||"Export ".concat(p," Usage"),j=async e=>{let s=e||o;h(!0);try{"csv"===s?(em(l,u,p,r),ee.Z.success("".concat(p," usage data exported successfully as CSV"))):(ex(l,u,p,r,n,i),ee.Z.success("".concat(p," usage data exported successfully as JSON"))),t()}catch(e){console.error("Error exporting data:",e),ee.Z.fromBackend("Failed to export data")}finally{h(!1)}};return(0,a.jsx)(J.Z,{title:(0,a.jsx)("span",{className:"text-base font-semibold",children:g}),open:s,onCancel:t,footer:null,width:480,destroyOnClose:!0,children:(0,a.jsxs)("div",{className:"space-y-5 py-2",children:[(0,a.jsx)(et,{dateRange:n,selectedFilters:i}),(0,a.jsx)(er,{value:u,onChange:m,entityType:r}),(0,a.jsx)(el,{value:o,onChange:d}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-4 border-t",children:[(0,a.jsx)(A.z,{variant:"secondary",onClick:t,disabled:x,size:"sm",children:"Cancel"}),(0,a.jsx)(A.z,{onClick:()=>j(),loading:x,disabled:x,size:"sm",children:x?"Exporting...":"Export ".concat(o.toUpperCase())})]})]})})},ep=t(19431),eg=e=>{let{dateValue:s,entityType:t,spendData:r,showFilters:l=!1,filterLabel:n,filterPlaceholder:i,selectedFilters:c=[],onFiltersChange:o,filterOptions:d=[],customTitle:u,compactLayout:m=!1}=e,[x,h]=(0,b.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsxs)("div",{className:"grid ".concat(l&&d.length>0?"grid-cols-[1fr_auto]":"grid-cols-[auto]"," items-end gap-4"),children:[l&&d.length>0&&(0,a.jsxs)("div",{children:[n&&(0,a.jsx)(ep.x,{className:"mb-2",children:n}),(0,a.jsx)(Q.default,{mode:"multiple",style:{width:"100%"},placeholder:i,value:c,onChange:o,options:d,allowClear:!0})]}),(0,a.jsx)("div",{className:"justify-self-end",children:(0,a.jsx)(ep.z,{onClick:()=>h(!0),icon:()=>(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})})]})}),(0,a.jsx)(eh,{isOpen:x,onClose:()=>h(!1),entityType:t,spendData:r,dateRange:s,selectedFilters:c,customTitle:u})]})},ej=t(42673),ef=t(5540),e_=t(49634),ey=t(77398),ev=t.n(ey);let ek=[{label:"Today",shortLabel:"today",getValue:()=>({from:ev()().startOf("day").toDate(),to:ev()().endOf("day").toDate()})},{label:"Last 7 days",shortLabel:"7d",getValue:()=>({from:ev()().subtract(7,"days").startOf("day").toDate(),to:ev()().endOf("day").toDate()})},{label:"Last 30 days",shortLabel:"30d",getValue:()=>({from:ev()().subtract(30,"days").startOf("day").toDate(),to:ev()().endOf("day").toDate()})},{label:"Month to date",shortLabel:"MTD",getValue:()=>({from:ev()().startOf("month").toDate(),to:ev()().endOf("day").toDate()})},{label:"Year to date",shortLabel:"YTD",getValue:()=>({from:ev()().startOf("year").toDate(),to:ev()().endOf("day").toDate()})}];var eb=e=>{let{value:s,onValueChange:t,label:r="Select Time Range",showTimeRange:l=!0}=e,[n,i]=(0,b.useState)(!1),[c,o]=(0,b.useState)(s),[d,u]=(0,b.useState)(null),[m,x]=(0,b.useState)(""),[h,p]=(0,b.useState)(""),g=(0,b.useRef)(null),j=(0,b.useCallback)(e=>{if(!e.from||!e.to)return null;for(let s of ek){let t=s.getValue(),a=ev()(e.from).isSame(ev()(t.from),"day"),r=ev()(e.to).isSame(ev()(t.to),"day");if(a&&r)return s.shortLabel}return null},[]);(0,b.useEffect)(()=>{u(j(s))},[s,j]);let f=(0,b.useCallback)(()=>{if(!m||!h)return{isValid:!0,error:""};let e=ev()(m,"YYYY-MM-DD"),s=ev()(h,"YYYY-MM-DD");return e.isValid()&&s.isValid()?s.isBefore(e)?{isValid:!1,error:"End date cannot be before start date"}:{isValid:!0,error:""}:{isValid:!1,error:"Invalid date format"}},[m,h])();(0,b.useEffect)(()=>{s.from&&x(ev()(s.from).format("YYYY-MM-DD")),s.to&&p(ev()(s.to).format("YYYY-MM-DD")),o(s)},[s]),(0,b.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&i(!1)};return n&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[n]);let _=(0,b.useCallback)((e,s)=>{if(!e||!s)return"Select date range";let t=e=>ev()(e).format("D MMM, HH:mm");return"".concat(t(e)," - ").concat(t(s))},[]),y=(0,b.useCallback)(e=>{let s;if(!e.from)return e;let t={...e},a=new Date(e.from);return s=new Date(e.to?e.to:e.from),a.toDateString(),s.toDateString(),a.setHours(0,0,0,0),s.setHours(23,59,59,999),t.from=a,t.to=s,t},[]),v=e=>{let{from:s,to:t}=e.getValue();o({from:s,to:t}),u(e.shortLabel),x(ev()(s).format("YYYY-MM-DD")),p(ev()(t).format("YYYY-MM-DD"))},k=(0,b.useCallback)(()=>{try{if(m&&h&&f.isValid){let e=ev()(m,"YYYY-MM-DD").startOf("day"),s=ev()(h,"YYYY-MM-DD").endOf("day");if(e.isValid()&&s.isValid()){let t={from:e.toDate(),to:s.toDate()};o(t);let a=j(t);u(a)}}}catch(e){console.warn("Invalid date format:",e)}},[m,h,f.isValid,j]);return(0,b.useEffect)(()=>{k()},[k]),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[r&&(0,a.jsx)(ep.x,{className:"text-sm font-medium text-gray-700 whitespace-nowrap",children:r}),(0,a.jsxs)("div",{className:"relative",ref:g,children:[(0,a.jsx)("div",{className:"w-[300px] px-3 py-2 text-sm border border-gray-300 rounded-md bg-white cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500",onClick:()=>i(!n),children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ef.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-gray-900",children:_(s.from,s.to)})]}),(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform ".concat(n?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}),n&&(0,a.jsx)("div",{className:"absolute top-full right-0 z-[9999] min-w-[600px] mt-1 bg-white border border-gray-200 rounded-lg shadow-xl",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsxs)("div",{className:"w-1/2 border-r border-gray-200",children:[(0,a.jsx)("div",{className:"p-3 border-b border-gray-200",children:(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Relative time"})}),(0,a.jsx)("div",{className:"h-[350px] overflow-y-auto",children:ek.map(e=>{let s=d===e.shortLabel;return(0,a.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 cursor-pointer border-b border-gray-100 transition-colors ".concat(s?"bg-blue-50 hover:bg-blue-100 border-blue-200":"hover:bg-gray-50"),onClick:()=>v(e),children:[(0,a.jsx)("span",{className:"text-sm ".concat(s?"text-blue-700 font-medium":"text-gray-700"),children:e.label}),(0,a.jsx)("span",{className:"text-xs px-2 py-1 rounded capitalize ".concat(s?"text-blue-700 bg-blue-100":"text-gray-500 bg-gray-100"),children:e.shortLabel})]},e.label)})})]}),(0,a.jsxs)("div",{className:"w-1/2 relative",children:[(0,a.jsx)("div",{className:"p-3.5 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(e_.Z,{className:"text-gray-600"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:"Start and end dates"})]})}),(0,a.jsxs)("div",{className:"p-6 space-y-6 pb-20",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"Start date"}),(0,a.jsx)("input",{type:"date",value:m,onChange:e=>x(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(f.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm text-gray-700 mb-1 block",children:"End date"}),(0,a.jsx)("input",{type:"date",value:h,onChange:e=>p(e.target.value),className:"w-65 px-3 py-2 text-sm border rounded-md cursor-pointer hover:border-gray-400 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 ".concat(f.isValid?"border-gray-300":"border-red-300 focus:border-red-500 focus:ring-red-200")})]}),!f.isValid&&f.error&&(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("svg",{className:"w-4 h-4 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),(0,a.jsx)("span",{className:"text-sm text-red-700 font-medium",children:f.error})]})}),c.from&&c.to&&f.isValid&&(0,a.jsxs)("div",{className:"bg-blue-50 p-3 rounded-md space-y-1",children:[(0,a.jsxs)("div",{className:"text-xs text-blue-800",children:[(0,a.jsx)("span",{className:"font-medium",children:"From:"})," ",ev()(c.from).format("MMM D, YYYY [at] HH:mm:ss")]}),(0,a.jsxs)("div",{className:"text-xs text-blue-800",children:[(0,a.jsx)("span",{className:"font-medium",children:"To:"})," ",ev()(c.to).format("MMM D, YYYY [at] HH:mm:ss")]})]})]}),(0,a.jsx)("div",{className:"absolute bottom-4 right-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(ep.z,{variant:"secondary",onClick:()=>{o(s),s.from&&x(ev()(s.from).format("YYYY-MM-DD")),s.to&&p(ev()(s.to).format("YYYY-MM-DD")),u(j(s)),i(!1)},children:"Cancel"}),(0,a.jsx)(ep.z,{onClick:()=>{c.from&&c.to&&f.isValid&&(t(c),requestIdleCallback(()=>{t(y(c))},{timeout:100}),i(!1))},disabled:!c.from||!c.to||!f.isValid,children:"Apply"})]})})]})]})})]})]})},eZ=t(91323);let eN=e=>{let{isDateChanging:s=!1}=e;return(0,a.jsx)("div",{className:"flex items-center justify-center h-40",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,a.jsx)(eZ.S,{className:"size-5"}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"text-gray-600 text-sm font-medium",children:s?"Processing date selection...":"Loading chart data..."}),(0,a.jsx)("span",{className:"text-gray-400 text-xs mt-1",children:s?"This will only take a moment":"Fetching your data"})]})]})})};var ew=t(35829),eq=t(97765),eS=t(99981),eC=e=>{let{accessToken:s,selectedTags:t,formatAbbreviatedNumber:l}=e,[n,i]=(0,b.useState)({results:[],total_count:0,page:1,page_size:50,total_pages:0}),[c,k]=(0,b.useState)(!1),[N,w]=(0,b.useState)(1),q=async()=>{if(s){k(!0);try{let e=await (0,Z.perUserAnalyticsCall)(s,N,50,t.length>0?t:void 0);i(e)}catch(e){console.error("Failed to fetch per-user data:",e)}finally{k(!1)}}};return(0,b.useEffect)(()=>{q()},[s,t,N]),(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(v.Z,{children:"Per User Usage"}),(0,a.jsx)(eq.Z,{children:"Individual developer usage metrics"}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"User Details"}),(0,a.jsx)(o.Z,{children:"Usage Distribution"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:"User ID"}),(0,a.jsx)(f.Z,{children:"User Email"}),(0,a.jsx)(f.Z,{children:"User Agent"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Success Generations"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Total Tokens"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Failed Requests"}),(0,a.jsx)(f.Z,{className:"text-right",children:"Total Cost"})]})}),(0,a.jsx)(p.Z,{children:n.results.slice(0,10).map((e,s)=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsx)(y.Z,{className:"font-medium",children:e.user_id})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(y.Z,{children:e.user_email||"N/A"})}),(0,a.jsx)(g.Z,{children:(0,a.jsx)(y.Z,{children:e.user_agent||"Unknown"})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.successful_requests)})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.total_tokens)})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsx)(y.Z,{children:l(e.failed_requests)})}),(0,a.jsx)(g.Z,{className:"text-right",children:(0,a.jsxs)(y.Z,{children:["$",l(e.spend,4)]})})]},s))})]}),n.results.length>10&&(0,a.jsxs)("div",{className:"mt-4 flex justify-between items-center",children:[(0,a.jsxs)(y.Z,{className:"text-sm text-gray-500",children:["Showing 10 of ",n.total_count," results"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(W.Z,{size:"sm",variant:"secondary",onClick:()=>{N>1&&w(N-1)},disabled:1===N,children:"Previous"}),(0,a.jsx)(W.Z,{size:"sm",variant:"secondary",onClick:()=>{N=n.total_pages,children:"Next"})]})]})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(v.Z,{className:"text-lg",children:"User Usage Distribution"}),(0,a.jsx)(eq.Z,{children:"Number of users by successful request frequency"})]}),(0,a.jsx)(r.Z,{data:(()=>{let e=new Map;n.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)});let s=Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s}),t={"1-9 requests":{range:[1,9],agents:{}},"10-99 requests":{range:[10,99],agents:{}},"100-999 requests":{range:[100,999],agents:{}},"1K-9.9K requests":{range:[1e3,9999],agents:{}},"10K-99.9K requests":{range:[1e4,99999],agents:{}},"100K+ requests":{range:[1e5,1/0],agents:{}}};return n.results.forEach(e=>{let a=e.successful_requests,r=e.user_agent||"Unknown";s.includes(r)&&Object.entries(t).forEach(e=>{let[s,t]=e;a>=t.range[0]&&a<=t.range[1]&&(t.agents[r]||(t.agents[r]=0),t.agents[r]++)})}),Object.entries(t).map(e=>{let[t,a]=e,r={category:t};return s.forEach(e=>{r[e]=a.agents[e]||0}),r})})(),index:"category",categories:(()=>{let e=new Map;return n.results.forEach(s=>{let t=s.user_agent||"Unknown";e.set(t,(e.get(t)||0)+1)}),Array.from(e.entries()).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).slice(0,8).map(e=>{let[s]=e;return s})})(),colors:["blue","green","orange","red","purple","yellow","pink","indigo"],valueFormatter:e=>"".concat(e," users"),yAxisWidth:80,showLegend:!0,stack:!0})]})]})]})]})},eT=e=>{let{accessToken:s,userRole:t,dateValue:n,onDateChange:i}=e,[h,p]=(0,b.useState)({results:[]}),[g,j]=(0,b.useState)({results:[]}),[f,_]=(0,b.useState)({results:[]}),[k,N]=(0,b.useState)({results:[]}),[w,q]=(0,b.useState)(""),[S,C]=(0,b.useState)([]),[T,D]=(0,b.useState)([]),[L,E]=(0,b.useState)(!1),[A,F]=(0,b.useState)(!1),[O,M]=(0,b.useState)(!1),[U,V]=(0,b.useState)(!1),[z,I]=(0,b.useState)(!1),R=new Date,Y=async()=>{if(s){E(!0);try{let e=await (0,Z.tagDistinctCall)(s);C(e.results.map(e=>e.tag))}catch(e){console.error("Failed to fetch available tags:",e)}finally{E(!1)}}},$=async()=>{if(s){F(!0);try{let e=await (0,Z.tagDauCall)(s,R,w||void 0,T.length>0?T:void 0);p(e)}catch(e){console.error("Failed to fetch DAU data:",e)}finally{F(!1)}}},K=async()=>{if(s){M(!0);try{let e=await (0,Z.tagWauCall)(s,R,w||void 0,T.length>0?T:void 0);j(e)}catch(e){console.error("Failed to fetch WAU data:",e)}finally{M(!1)}}},P=async()=>{if(s){V(!0);try{let e=await (0,Z.tagMauCall)(s,R,w||void 0,T.length>0?T:void 0);_(e)}catch(e){console.error("Failed to fetch MAU data:",e)}finally{V(!1)}}},W=async()=>{if(s&&n.from&&n.to){I(!0);try{let e=await (0,Z.userAgentSummaryCall)(s,n.from,n.to,T.length>0?T:void 0);N(e)}catch(e){console.error("Failed to fetch user agent summary data:",e)}finally{I(!1)}}};(0,b.useEffect)(()=>{Y()},[s]),(0,b.useEffect)(()=>{if(!s)return;let e=setTimeout(()=>{$(),K(),P()},50);return()=>clearTimeout(e)},[s,w,T]),(0,b.useEffect)(()=>{if(!n.from||!n.to)return;let e=setTimeout(()=>{W()},50);return()=>clearTimeout(e)},[s,n,T]);let B=e=>e.startsWith("User-Agent: ")?e.replace("User-Agent: ",""):e,H=e=>e.length>15?e.substring(0,15)+"...":e,G=e=>Object.entries(e.reduce((e,s)=>(e[s.tag]=(e[s.tag]||0)+s.active_users,e),{})).sort((e,s)=>{let[,t]=e,[,a]=s;return a-t}).map(e=>{let[s]=e;return s}),J=G(h.results).slice(0,10),X=G(g.results).slice(0,10),ee=G(f.results).slice(0,10),es=(()=>{let e=[],s=new Date;for(let t=6;t>=0;t--){let a=new Date(s);a.setDate(a.getDate()-t);let r={date:a.toISOString().split("T")[0]};J.forEach(e=>{r[B(e)]=0}),e.push(r)}return h.results.forEach(s=>{let t=B(s.tag),a=e.find(e=>e.date===s.date);a&&(a[t]=s.active_users)}),e})(),et=(()=>{let e=[];for(let s=1;s<=7;s++){let t={week:"Week ".concat(s)};X.forEach(e=>{t[B(e)]=0}),e.push(t)}return g.results.forEach(s=>{let t=B(s.tag),a=s.date.match(/Week (\d+)/);if(a){let r="Week ".concat(a[1]),l=e.find(e=>e.week===r);l&&(l[t]=s.active_users)}}),e})(),ea=(()=>{let e=[];for(let s=1;s<=7;s++){let t={month:"Month ".concat(s)};ee.forEach(e=>{t[B(e)]=0}),e.push(t)}return f.results.forEach(s=>{let t=B(s.tag),a=s.date.match(/Month (\d+)/);if(a){let r="Month ".concat(a[1]),l=e.find(e=>e.month===r);l&&(l[t]=s.active_users)}}),e})(),er=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e>=1e8||e>=1e7||e>=1e6?(e/1e6).toFixed(s)+"M":e>=1e4?(e/1e3).toFixed(s)+"K":e>=1e3?(e/1e3).toFixed(s)+"K":e.toFixed(s)};return(0,a.jsxs)("div",{className:"space-y-6 mt-6",children:[(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(v.Z,{children:"Summary by User Agent"}),(0,a.jsx)(eq.Z,{children:"Performance metrics for different user agents"})]}),(0,a.jsxs)("div",{className:"w-96",children:[(0,a.jsx)(y.Z,{className:"text-sm font-medium block mb-2",children:"Filter by User Agents"}),(0,a.jsx)(Q.default,{mode:"multiple",placeholder:"All User Agents",value:T,onChange:D,style:{width:"100%"},showSearch:!0,allowClear:!0,loading:L,optionFilterProp:"label",className:"rounded-md",maxTagCount:"responsive",children:S.map(e=>{let s=B(e),t=s.length>50?"".concat(s.substring(0,50),"..."):s;return(0,a.jsx)(Q.default.Option,{value:e,label:t,title:s,children:t},e)})})]})]}),z?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsxs)(c.Z,{numItems:4,className:"gap-4",children:[(k.results||[]).slice(0,4).map((e,s)=>{let t=B(e.tag),r=H(t);return(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(eS.Z,{title:t,placement:"top",children:(0,a.jsx)(v.Z,{className:"truncate",children:r})}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:er(e.successful_requests)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:er(e.total_tokens)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsxs)(ew.Z,{className:"text-lg",children:["$",er(e.total_spend,4)]})]})]})]},s)}),Array.from({length:Math.max(0,4-(k.results||[]).length)}).map((e,s)=>(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"No Data"}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Success Requests"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Tokens"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(y.Z,{className:"text-sm text-gray-600",children:"Total Cost"}),(0,a.jsx)(ew.Z,{className:"text-lg",children:"-"})]})]})]},"empty-".concat(s)))]})]})}),(0,a.jsx)(l.Z,{children:(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"DAU/WAU/MAU"}),(0,a.jsx)(o.Z,{children:"Per User Usage (Last 30 Days)"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(v.Z,{children:"DAU, WAU & MAU per Agent"}),(0,a.jsx)(eq.Z,{children:"Active users across different time periods"})]}),(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{className:"mb-6",children:[(0,a.jsx)(o.Z,{children:"DAU"}),(0,a.jsx)(o.Z,{children:"WAU"}),(0,a.jsx)(o.Z,{children:"MAU"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Daily Active Users - Last 7 Days"})}),A?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:es,index:"date",categories:J.map(B),valueFormatter:e=>er(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Weekly Active Users - Last 7 Weeks"})}),O?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:et,index:"week",categories:X.map(B),valueFormatter:e=>er(e),yAxisWidth:60,showLegend:!0,stack:!0})]}),(0,a.jsxs)(m.Z,{children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(v.Z,{className:"text-lg",children:"Monthly Active Users - Last 7 Months"})}),U?(0,a.jsx)(eN,{isDateChanging:!1}):(0,a.jsx)(r.Z,{data:ea,index:"month",categories:ee.map(B),valueFormatter:e=>er(e),yAxisWidth:60,showLegend:!0,stack:!0})]})]})]})]}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(eC,{accessToken:s,selectedTags:T,formatAbbreviatedNumber:er})})]})]})})]})},eD=t(47375),eL=t(32176),eE=t(62338),eA=t(12322);function eF(e){let{topModels:s}=e,[t,r]=(0,b.useState)("table");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex justify-end items-center",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>r("table"),className:"px-3 py-1 text-sm rounded-md ".concat("table"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Table View"}),(0,a.jsx)("button",{onClick:()=>r("chart"),className:"px-3 py-1 text-sm rounded-md ".concat("chart"===t?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"),children:"Chart View"})]})}),"chart"===t?(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)(eE.v,{className:"mt-4 h-40",data:s,index:"key",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$".concat((0,E.pw)(e,2)),layout:"vertical",yAxisWidth:200,showLegend:!1})}):(0,a.jsx)("div",{className:"border rounded-lg overflow-auto",children:(0,a.jsx)(eA.w,{columns:[{header:"Model",accessorKey:"key",cell:e=>e.getValue()||"-"},{header:"Spend (USD)",accessorKey:"spend",cell:e=>{let s=e.getValue();return"$".concat((0,E.pw)(s,2))}},{header:"Successful",accessorKey:"successful_requests",cell:e=>{var s;return(0,a.jsx)("span",{className:"text-green-600",children:(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0})}},{header:"Failed",accessorKey:"failed_requests",cell:e=>{var s;return(0,a.jsx)("span",{className:"text-red-600",children:(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0})}},{header:"Tokens",accessorKey:"tokens",cell:e=>{var s;return(null===(s=e.getValue())||void 0===s?void 0:s.toLocaleString())||0}}],data:s,renderSubComponent:()=>(0,a.jsx)(a.Fragment,{}),getRowCanExpand:()=>!1})})]})}var eO=t(49282),eM=e=>{let{endpointData:s}=e,t=s||{},n=b.useMemo(()=>Object.entries(t).map(e=>{let[s,t]=e;return{endpoint:s,"metrics.successful_requests":t.metrics.successful_requests,"metrics.failed_requests":t.metrics.failed_requests,metrics:{successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests}}}),[t]);return(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(v.Z,{children:"Success vs Failed Requests by Endpoint"}),(0,a.jsx)(V,{categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"]})]}),(0,a.jsx)(r.Z,{className:"mt-4",data:n,index:"endpoint",categories:["metrics.successful_requests","metrics.failed_requests"],colors:["green","red"],valueFormatter:e=>e.toLocaleString(),customTooltip:U,showLegend:!1,stack:!0,yAxisWidth:60})]})},eU=t(59664),eV=function(e){let{dailyData:s,endpointData:t}=e,r=(0,b.useMemo)(()=>(null==s?void 0:s.results)&&0!==s.results.length?function(e){let s=[],t=new Set;return e.forEach(e=>{e.breakdown.endpoints&&Object.keys(e.breakdown.endpoints).forEach(e=>t.add(e))}),e.forEach(e=>{let a={date:new Date(e.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})};t.forEach(s=>{var t;let r=null===(t=e.breakdown.endpoints)||void 0===t?void 0:t[s];a[s]=(null==r?void 0:r.metrics.api_requests)||0}),s.push(a)}),s.reverse()}(s.results):[],[s]),n=(0,b.useMemo)(()=>0===r.length?[]:Object.keys(r[0]).filter(e=>"date"!==e),[r]);return(0,a.jsxs)(l.Z,{className:"mb-6",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,a.jsx)(v.Z,{children:"Endpoint Usage Trends"})}),(0,a.jsx)(eU.Z,{className:"h-80",data:r,index:"date",categories:n,colors:["blue","cyan","indigo","violet","purple","fuchsia","pink","rose","red","orange"].slice(0,n.length),valueFormatter:e=>e.toLocaleString(),showLegend:!0,showGridLines:!0,yAxisWidth:60,connectNulls:!0,curveType:"natural"})]})},ez=t(68565),eI=t(56609),eR=e=>{let{endpointData:s}=e,t=(e,s)=>0===s?0:e/s*100,r=Object.entries(s).map(e=>{let[s,a]=e;return{key:s,endpoint:s,successful_requests:a.metrics.successful_requests,failed_requests:a.metrics.failed_requests,api_requests:a.metrics.api_requests,total_tokens:a.metrics.total_tokens,spend:a.metrics.spend,successRate:t(a.metrics.successful_requests,a.metrics.api_requests)}}),l=[{title:"Endpoint",dataIndex:"endpoint",key:"endpoint",render:e=>(0,a.jsx)("span",{className:"font-medium",children:e})},{title:"Successful / Failed",key:"requests",render:(e,s)=>{let t=s.api_requests>0?s.successful_requests/s.api_requests*100:0,r=s.api_requests>0?s.failed_requests/s.api_requests*100:0,l={"0%":"#22c55e"};return t>0&&t<100&&(l["".concat(t,"%")]="#22c55e",l["".concat(t+.01,"%")]="#ef4444"),l["100%"]=r>0?"#ef4444":"#22c55e",(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)("div",{className:"flex-1 relative",children:(0,a.jsx)(ez.Z,{percent:t+r,size:"small",strokeColor:l,showInfo:!1})}),(0,a.jsxs)("div",{className:"flex items-center space-x-2 text-sm min-w-[100px]",children:[(0,a.jsx)("span",{className:"text-green-600 font-medium",children:s.successful_requests.toLocaleString()}),(0,a.jsx)("span",{className:"text-gray-400",children:"/"}),(0,a.jsx)("span",{className:"text-red-600 font-medium",children:s.failed_requests.toLocaleString()})]})]})}},{title:"Total Request",dataIndex:"api_requests",key:"api_requests",render:e=>e.toLocaleString()},{title:"Success Rate",dataIndex:"successRate",key:"successRate",render:e=>{let s=e.toFixed(2);return(0,a.jsxs)("span",{className:e>=95?"text-green-600 font-medium":e>=80?"text-yellow-600 font-medium":"text-red-600 font-medium",children:[s,"%"]})}},{title:"Total Tokens",dataIndex:"total_tokens",key:"total_tokens",render:e=>e.toLocaleString()},{title:"Spend",dataIndex:"spend",key:"spend",render:e=>"$".concat((0,E.pw)(e,2))}];return(0,a.jsx)(eI.Z,{columns:l,dataSource:r,pagination:!1})},eY=e=>{let{userSpendData:s}=e,t=(0,b.useMemo)(()=>{let e={};return(null==s?void 0:s.results)&&s.results.forEach(s=>{Object.entries(s.breakdown.endpoints||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:a.metadata||{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),e},[s]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(eR,{endpointData:t}),(0,a.jsx)(eM,{endpointData:t}),(0,a.jsx)(eV,{dailyData:s,endpointData:t})]})},e$=t(91027),eK=e=>{let{accessToken:s,entityType:t,entityId:k,userID:N,userRole:w,entityList:q,premiumUser:S,dateValue:C}=e,[T,D]=(0,b.useState)({results:[],metadata:{total_spend:0,total_api_requests:0,total_successful_requests:0,total_failed_requests:0,total_tokens:0}}),{teams:L}=(0,eO.Z)(),A=P(T,"models",L||[]),F=P(T,"api_keys",L||[]),[O,M]=(0,b.useState)([]),U=async()=>{if(!s||!C.from||!C.to)return;let e=new Date(C.from),a=new Date(C.to);if("tag"===t)D(await (0,Z.tagDailyActivityCall)(s,e,a,1,O.length>0?O:null));else if("team"===t)D(await (0,Z.teamDailyActivityCall)(s,e,a,1,O.length>0?O:null));else if("organization"===t)D(await (0,Z.organizationDailyActivityCall)(s,e,a,1,O.length>0?O:null));else if("customer"===t)D(await (0,Z.customerDailyActivityCall)(s,e,a,1,O.length>0?O:null));else if("agent"===t)D(await (0,Z.agentDailyActivityCall)(s,e,a,1,O.length>0?O:null));else throw Error("Invalid entity type")};(0,b.useEffect)(()=>{U()},[s,C,k,O]);let V=()=>{let e={};return T.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={provider:t,spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend,e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens}catch(e){console.error("Error processing provider ".concat(t,": ").concat(e))}})}),Object.values(e).filter(e=>e.spend>0).sort((e,s)=>s.spend-e.spend)},z=(e,s)=>{if(q){let s=q.find(s=>s.value===e);if(s)return s.label}return(null==s?void 0:s.team_alias)?s.team_alias:e},R=e=>0===O.length?e:e.filter(e=>O.includes(e.metadata.id)),Y=()=>{let e={};return T.results.forEach(s=>{Object.entries(s.breakdown.entities||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{alias:z(t,a.metadata),id:t}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.total_tokens+=a.metrics.total_tokens})}),R(Object.values(e).sort((e,s)=>s.metrics.spend-e.metrics.spend))},K=t.charAt(0).toUpperCase()+t.slice(1);return(0,a.jsxs)("div",{style:{width:"100%"},className:"relative",children:[(0,a.jsx)(eg,{dateValue:C,entityType:t,spendData:T,showFilters:null!==q&&q.length>0,filterLabel:"Filter by ".concat(t),filterPlaceholder:"Select ".concat(t," to filter..."),selectedFilters:O,onFiltersChange:M,filterOptions:(()=>{if(q)return q})()||void 0}),(0,a.jsxs)(d.Z,{children:[(0,a.jsx)(e$.Z,{children:(0,a.jsxs)(u.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(o.Z,{children:"Cost"}),(0,a.jsx)(o.Z,{children:"agent"===t?"Request / Token Consumption":"Model Activity"}),(0,a.jsx)(o.Z,{children:"Key Activity"}),(0,a.jsx)(o.Z,{children:"Endpoint Activity"})]})}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)(c.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsxs)(v.Z,{children:[K," Spend Overview"]}),(0,a.jsxs)(c.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Spend"}),(0,a.jsxs)(y.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,E.pw)(T.metadata.total_spend,2)]})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:T.metadata.total_api_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Successful Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:T.metadata.total_successful_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Failed Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:T.metadata.total_failed_requests.toLocaleString()})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:T.metadata.total_tokens.toLocaleString()})]})]})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Daily Spend"}),(0,a.jsx)(r.Z,{data:[...T.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:I,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload,l=Object.keys(r.breakdown.entities||{}).length;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Total Spend: $",(0,E.pw)(r.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Tokens: ",r.metrics.total_tokens]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total ",K,"s: ",l]}),(0,a.jsxs)("div",{className:"mt-2 border-t pt-2",children:[(0,a.jsxs)("p",{className:"font-semibold",children:["Spend by ",K,":"]}),Object.entries(r.breakdown.entities||{}).sort((e,s)=>{let[,t]=e,[,a]=s,r=t.metrics.spend;return a.metrics.spend-r}).slice(0,5).map(e=>{let[s,t]=e;return(0,a.jsxs)("p",{className:"text-sm text-gray-600",children:[z(s,t.metadata),": $",(0,E.pw)(t.metrics.spend,2)]},s)}),l>5&&(0,a.jsxs)("p",{className:"text-sm text-gray-500 italic",children:["...and ",l-5," more"]})]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,a.jsxs)(v.Z,{children:["Spend Per ",K]}),(0,a.jsx)(eq.Z,{className:"text-xs",children:"Showing Top 5 by Spend"}),(0,a.jsxs)("div",{className:"flex items-center text-sm text-gray-500",children:[(0,a.jsxs)("span",{children:["Get Started by Tracking cost per ",K," "]}),(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/enterprise#spend-tracking",className:"text-blue-500 hover:text-blue-700 ml-1",children:"here"})]})]}),(0,a.jsxs)(c.Z,{numItems:2,className:"gap-6",children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(r.Z,{className:"mt-4 h-52",data:Y().slice(0,5).map(e=>({...e,metadata:{...e.metadata,alias_display:e.metadata.alias&&e.metadata.alias.length>15?"".concat(e.metadata.alias.slice(0,15),"..."):e.metadata.alias}})),index:"metadata.alias_display",categories:["metrics.spend"],colors:["cyan"],valueFormatter:I,layout:"vertical",showLegend:!1,yAxisWidth:150,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.metadata.alias}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,E.pw)(r.metrics.spend,4)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.metrics.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.metrics.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens.toLocaleString()]})]})}})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)("div",{className:"h-52 overflow-y-auto",children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:K}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:Y().filter(e=>e.metrics.spend>0).map(e=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:e.metadata.alias}),(0,a.jsxs)(g.Z,{children:["$",(0,E.pw)(e.metrics.spend,4)]}),(0,a.jsx)(g.Z,{className:"text-green-600",children:e.metrics.successful_requests.toLocaleString()}),(0,a.jsx)(g.Z,{className:"text-red-600",children:e.metrics.failed_requests.toLocaleString()}),(0,a.jsx)(g.Z,{children:e.metrics.total_tokens.toLocaleString()})]},e.metadata.id))})]})})})]})]})})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys"}),(0,a.jsx)(eL.Z,{topKeys:(()=>{console.log("debugTags",{spendData:T});let e={};return T.results.forEach(s=>{let{breakdown:t}=s,{entities:a}=t;console.log("debugTags",{entities:a});let r=Object.keys(a).reduce((e,s)=>{let{api_key_breakdown:t}=a[s];return Object.keys(t).forEach(a=>{let r={tag:s,usage:t[a].metrics.spend};e[a]?e[a].push(r):e[a]=[r]}),e},{});console.log("debugTags",{tagDictionary:r}),Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:a.metadata.team_id||null,tags:r[t]||[]}},console.log("debugTags",{keySpend:e})),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||"-",spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),teams:null,showTags:"tag"===t})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"agent"===t?"Top Agents":"Top Models"}),(0,a.jsx)(eF,{topModels:(()=>{let e={};return T.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={spend:0,requests:0,successful_requests:0,failed_requests:0,tokens:0});try{e[t].spend+=a.metrics.spend}catch(e){console.error("Error adding spend for ".concat(t,": ").concat(e,", got metrics: ").concat(JSON.stringify(a)))}e[t].requests+=a.metrics.api_requests,e[t].successful_requests+=a.metrics.successful_requests,e[t].failed_requests+=a.metrics.failed_requests,e[t].tokens+=a.metrics.total_tokens})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,...t}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})()})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsx)(l.Z,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsx)(v.Z,{children:"Provider Usage"}),(0,a.jsxs)(c.Z,{numItems:2,children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(i.Z,{className:"mt-4 h-40",data:V(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,E.pw)(e,2)),colors:["cyan","blue","indigo","violet","purple"]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:"Provider"}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:V().map(e=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ej.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(g.Z,{children:["$",(0,E.pw)(e.spend,2)]}),(0,a.jsx)(g.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(g.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(g.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:A,hidePromptCachingMetrics:"agent"===t})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:F,hidePromptCachingMetrics:"agent"===t})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(eY,{userSpendData:T})})]})]})]})},eP=t(64739),eW=t(37527),eB=t(41361),eH=t(40312),eG=t(71891),eJ=t(69993),eQ=t(48231),eX=t(9775),e0=t(33866);let e1=[{value:"global",label:"Global Usage",showForAdmin:"Global Usage",showForNonAdmin:"Your Usage",description:"View usage across all resources",descriptionForAdmin:"View usage across all resources",descriptionForNonAdmin:"View your usage",icon:(0,a.jsx)(eP.Z,{style:{fontSize:"16px"}})},{value:"organization",label:"Organization Usage",showForAdmin:"Organization Usage",showForNonAdmin:"Your Organization Usage",description:"View organization-level usage",descriptionForAdmin:"View usage across all organizations",descriptionForNonAdmin:"View your organization's usage",icon:(0,a.jsx)(eW.Z,{style:{fontSize:"16px"}})},{value:"team",label:"Team Usage",description:"View usage by team",icon:(0,a.jsx)(eB.Z,{style:{fontSize:"16px"}})},{value:"customer",label:"Customer Usage",description:"View usage by customer accounts",icon:(0,a.jsx)(eH.Z,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"tag",label:"Tag Usage",description:"View usage grouped by tags",icon:(0,a.jsx)(eG.Z,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"agent",label:"Agent Usage (A2A)",description:"View usage by AI agents",icon:(0,a.jsx)(eJ.Z,{style:{fontSize:"16px"}}),adminOnly:!0},{value:"user-agent-activity",label:"User Agent Activity",description:"View detailed user agent activity logs",icon:(0,a.jsx)(eQ.Z,{style:{fontSize:"16px"}}),adminOnly:!0}],e2=e=>{let{value:s,onChange:t,isAdmin:r,title:l="Usage View",description:n="Select the usage data you want to view","data-id":i}=e,c=e1.filter(e=>!e.adminOnly||!!r).map(e=>{let s=e.label,t=e.description;return e.showForAdmin&&e.showForNonAdmin&&(s=r?e.showForAdmin:e.showForNonAdmin),e.descriptionForAdmin&&e.descriptionForNonAdmin&&(t=r?e.descriptionForAdmin:e.descriptionForNonAdmin),{value:e.value,label:s,description:t,icon:e.icon,badgeText:e.badgeText}});return(0,a.jsx)("div",{className:"w-full","data-id":i,children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-start gap-4",children:[(0,a.jsxs)("div",{className:"flex items-stretch gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"flex-shrink-0 flex items-center",children:(0,a.jsx)(eX.Z,{style:{fontSize:"32px"}})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-0.5 leading-tight",children:l}),(0,a.jsx)("p",{className:"text-xs text-gray-600 leading-tight",children:n})]})]}),(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)(Q.default,{value:s,onChange:t,className:"w-54 sm:w-64 md:w-72",size:"large",options:c.map(e=>({value:e.value,label:e.label})),optionRender:e=>{let s=c.find(s=>s.value===e.value);return s?(0,a.jsxs)("div",{className:"flex items-center gap-2 py-1",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:s.icon}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900",children:s.label}),(0,a.jsx)("div",{className:"text-xs text-gray-600 mt-0.5",children:s.description})]}),s.badgeText&&(0,a.jsx)("div",{className:"items-center",children:(0,a.jsx)(e0.Z,{color:"blue",count:s.badgeText})})]}):e.label},labelRender:e=>{let s=c.find(s=>s.value===e.value);return s?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{children:s.icon}),(0,a.jsx)("span",{className:"text-sm",children:s.label})]}):e.label}})})]})})},e4=(0,w.n)("users"),e6=()=>{let{accessToken:e,userId:s,userRole:t}=(0,S.Z)();return(0,N.a)({queryKey:e4.detail(s),queryFn:async()=>{let a=await (0,Z.userInfoCall)(e,s,t,!1,null,null);return console.log("userInfo: ".concat(JSON.stringify(a))),a.user_info},enabled:!!(e&&s&&t)})};var e5=e=>{var s,t,N,w,C,D,F,O,M,U,V;let{teams:z,organizations:R}=e,{accessToken:Y,userRole:K,userId:W,premiumUser:B}=(0,S.Z)(),[H,G]=(0,b.useState)({results:[],metadata:{}}),[J,Q]=(0,b.useState)(!1),[X,ee]=(0,b.useState)(!1),et=(0,b.useMemo)(()=>new Date(Date.now()-6048e5),[]),ea=(0,b.useMemo)(()=>new Date,[]),[er,el]=(0,b.useState)({from:et,to:ea}),[en,ei]=(0,b.useState)([]),{data:ec=[]}=L(),{data:eo}=T(),{data:ed}=e6();console.log("currentUser: ".concat(JSON.stringify(ed))),console.log("currentUser max budget: ".concat(null==ed?void 0:ed.max_budget));let[eu,em]=(0,b.useState)("groups"),[ex,ep]=(0,b.useState)(!1),[eg,ef]=(0,b.useState)(!1),[e_,ey]=(0,b.useState)(!0),[ev,ek]=(0,b.useState)(!0),[eZ,ew]=(0,b.useState)("global"),[eq,eS]=(0,b.useState)(!0),eC=async()=>{Y&&ei(Object.values(await (0,Z.tagListCall)(Y)).map(e=>({label:e.name,value:e.name})))};(0,b.useEffect)(()=>{eC()},[Y]);let eE=(null===(s=H.metadata)||void 0===s?void 0:s.total_spend)||0,eA=()=>{let e={};return H.results.forEach(s=>{Object.entries(s.breakdown.providers||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{provider:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}})},eF=(0,b.useCallback)(async()=>{if(!Y||!er.from||!er.to)return;Q(!0);let e=new Date(er.from),s=new Date(er.to);try{try{let t=await (0,Z.userDailyActivityAggregatedCall)(Y,e,s);G(t);return}catch(e){}let t=await (0,Z.userDailyActivityCall)(Y,e,s);if(t.metadata.total_pages<=1){G(t);return}let a=[...t.results],r={...t.metadata};for(let l=2;l<=t.metadata.total_pages;l++){let t=await (0,Z.userDailyActivityCall)(Y,e,s,l);a.push(...t.results),t.metadata&&(r.total_spend+=t.metadata.total_spend||0,r.total_api_requests+=t.metadata.total_api_requests||0,r.total_successful_requests+=t.metadata.total_successful_requests||0,r.total_failed_requests+=t.metadata.total_failed_requests||0,r.total_tokens+=t.metadata.total_tokens||0)}G({results:a,metadata:r})}catch(e){console.error("Error fetching user spend data:",e)}finally{Q(!1),ee(!1)}},[Y,er.from,er.to]),eO=(0,b.useCallback)(e=>{ee(!0),Q(!0),el(e)},[]);(0,b.useEffect)(()=>{if(!er.from||!er.to)return;let e=setTimeout(()=>{eF()},50);return()=>clearTimeout(e)},[eF]);let eM=P(H,"models",z),eU=P(H,"api_keys",z),eV=P(H,"mcp_servers",z);return(0,a.jsxs)("div",{style:{width:"100%"},className:"p-8 relative",children:[(0,a.jsx)("div",{className:"flex items-end justify-between gap-6 mb-6",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-end justify-between gap-6 mb-4 w-full",children:[(0,a.jsx)(e2,{value:eZ,onChange:e=>ew(e),isAdmin:q.ZL.includes(K||"")}),(0,a.jsx)(eb,{value:er,onValueChange:eO})]}),"global"===eZ&&(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(e$.Z,{children:(0,a.jsxs)(u.Z,{variant:"solid",className:"mt-1",children:[(0,a.jsx)(o.Z,{children:"Cost"}),(0,a.jsx)(o.Z,{children:"Model Activity"}),(0,a.jsx)(o.Z,{children:"Key Activity"}),(0,a.jsx)(o.Z,{children:"MCP Server Activity"}),(0,a.jsx)(o.Z,{children:"Endpoint Activity"})]})}),(0,a.jsx)(A.z,{onClick:()=>ef(!0),icon:()=>(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),children:"Export Data"})]}),(0,a.jsxs)(x.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsxs)(c.Z,{numItems:2,className:"gap-2 w-full",children:[(0,a.jsxs)(n.Z,{numColSpan:2,children:[(0,a.jsxs)(y.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend"," ",er.from&&er.to&&(0,a.jsxs)(a.Fragment,{children:[er.from.toLocaleDateString("en-US",{month:"short",day:"numeric",year:er.from.getFullYear()!==er.to.getFullYear()?"numeric":void 0})," - ",er.to.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),(0,a.jsx)(eD.Z,{userSpend:eE,selectedTeam:null,userMaxBudget:(null==ed?void 0:ed.max_budget)||null})]}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Usage Metrics"}),(0,a.jsxs)(c.Z,{numItems:5,className:"gap-4 mt-4",children:[(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:(null===(N=H.metadata)||void 0===N?void 0:null===(t=N.total_api_requests)||void 0===t?void 0:t.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Successful Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-green-600",children:(null===(C=H.metadata)||void 0===C?void 0:null===(w=C.total_successful_requests)||void 0===w?void 0:w.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Failed Requests"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2 text-red-600",children:(null===(F=H.metadata)||void 0===F?void 0:null===(D=F.total_failed_requests)||void 0===D?void 0:D.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Total Tokens"}),(0,a.jsx)(y.Z,{className:"text-2xl font-bold mt-2",children:(null===(M=H.metadata)||void 0===M?void 0:null===(O=M.total_tokens)||void 0===O?void 0:O.toLocaleString())||0})]}),(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Average Cost per Request"}),(0,a.jsxs)(y.Z,{className:"text-2xl font-bold mt-2",children:["$",(0,E.pw)((eE||0)/((null===(U=H.metadata)||void 0===U?void 0:U.total_api_requests)||1),4)]})]})]})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{children:[(0,a.jsx)(v.Z,{children:"Daily Spend"}),J?(0,a.jsx)(eN,{isDateChanging:X}):(0,a.jsx)(r.Z,{data:[...H.results].sort((e,s)=>new Date(e.date).getTime()-new Date(s.date).getTime()),index:"date",categories:["metrics.spend"],colors:["cyan"],valueFormatter:I,yAxisWidth:100,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.date}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,E.pw)(r.metrics.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Requests: ",r.metrics.api_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Successful: ",r.metrics.successful_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Failed: ",r.metrics.failed_requests]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.metrics.total_tokens]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsx)(v.Z,{children:"Top Virtual Keys"}),(0,a.jsx)(eL.Z,{topKeys:(()=>{let e={};return H.results.forEach(s=>{Object.entries(s.breakdown.api_keys||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{key_alias:a.metadata.key_alias,team_id:null,tags:a.metadata.tags||[]}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests,e[t].metrics.failed_requests+=a.metrics.failed_requests,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),console.log("debugTags",{keySpend:e,userSpendData:H}),Object.entries(e).map(e=>{let[s,t]=e;return{api_key:s,key_alias:t.metadata.key_alias||"-",tags:t.metadata.tags||[],spend:t.metrics.spend}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),teams:null})]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(v.Z,{children:"groups"===eu?"Top Public Model Names":"Top Litellm Models"}),(0,a.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("groups"===eu?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>em("groups"),children:"Public Model Name"}),(0,a.jsx)("button",{className:"px-3 py-1 text-sm rounded-md transition-colors ".concat("individual"===eu?"bg-white shadow-sm text-gray-900":"text-gray-600 hover:text-gray-900"),onClick:()=>em("individual"),children:"Litellm Model Name"})]})]}),J?(0,a.jsx)(eN,{isDateChanging:X}):(0,a.jsx)(r.Z,{className:"mt-4 h-40",data:"groups"===eu?(()=>{let e={};return H.results.forEach(s=>{Object.entries(s.breakdown.model_groups||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})():(()=>{let e={};return H.results.forEach(s=>{Object.entries(s.breakdown.models||{}).forEach(s=>{let[t,a]=s;e[t]||(e[t]={metrics:{spend:0,prompt_tokens:0,completion_tokens:0,total_tokens:0,api_requests:0,successful_requests:0,failed_requests:0,cache_read_input_tokens:0,cache_creation_input_tokens:0},metadata:{},api_key_breakdown:{}}),e[t].metrics.spend+=a.metrics.spend,e[t].metrics.prompt_tokens+=a.metrics.prompt_tokens,e[t].metrics.completion_tokens+=a.metrics.completion_tokens,e[t].metrics.total_tokens+=a.metrics.total_tokens,e[t].metrics.api_requests+=a.metrics.api_requests,e[t].metrics.successful_requests+=a.metrics.successful_requests||0,e[t].metrics.failed_requests+=a.metrics.failed_requests||0,e[t].metrics.cache_read_input_tokens+=a.metrics.cache_read_input_tokens||0,e[t].metrics.cache_creation_input_tokens+=a.metrics.cache_creation_input_tokens||0})}),Object.entries(e).map(e=>{let[s,t]=e;return{key:s,spend:t.metrics.spend,requests:t.metrics.api_requests,successful_requests:t.metrics.successful_requests,failed_requests:t.metrics.failed_requests,tokens:t.metrics.total_tokens}}).sort((e,s)=>s.spend-e.spend).slice(0,5)})(),index:"key",categories:["spend"],colors:["cyan"],valueFormatter:I,layout:"vertical",yAxisWidth:200,showLegend:!1,customTooltip:e=>{let{payload:s,active:t}=e;if(!t||!(null==s?void 0:s[0]))return null;let r=s[0].payload;return(0,a.jsxs)("div",{className:"bg-white p-4 shadow-lg rounded-lg border",children:[(0,a.jsx)("p",{className:"font-bold",children:r.key}),(0,a.jsxs)("p",{className:"text-cyan-500",children:["Spend: $",(0,E.pw)(r.spend,2)]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Total Requests: ",r.requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-green-600",children:["Successful: ",r.successful_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-red-600",children:["Failed: ",r.failed_requests.toLocaleString()]}),(0,a.jsxs)("p",{className:"text-gray-600",children:["Tokens: ",r.tokens.toLocaleString()]})]})}})]})}),(0,a.jsx)(n.Z,{numColSpan:2,children:(0,a.jsxs)(l.Z,{className:"h-full",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsx)(v.Z,{children:"Spend by Provider"})}),J?(0,a.jsx)(eN,{isDateChanging:X}):(0,a.jsxs)(c.Z,{numItems:2,children:[(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsx)(i.Z,{className:"mt-4 h-40",data:eA(),index:"provider",category:"spend",valueFormatter:e=>"$".concat((0,E.pw)(e,2)),colors:["cyan"]})}),(0,a.jsx)(n.Z,{numColSpan:1,children:(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(j.Z,{children:(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(f.Z,{children:"Provider"}),(0,a.jsx)(f.Z,{children:"Spend"}),(0,a.jsx)(f.Z,{className:"text-green-600",children:"Successful"}),(0,a.jsx)(f.Z,{className:"text-red-600",children:"Failed"}),(0,a.jsx)(f.Z,{children:"Tokens"})]})}),(0,a.jsx)(p.Z,{children:eA().filter(e=>e.spend>0).map(e=>(0,a.jsxs)(_.Z,{children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[e.provider&&(0,a.jsx)("img",{src:(0,ej.dr)(e.provider).logo,alt:"".concat(e.provider," logo"),className:"w-4 h-4",onError:s=>{let t=s.target,a=t.parentElement;if(a){var r;let s=document.createElement("div");s.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",s.textContent=(null===(r=e.provider)||void 0===r?void 0:r.charAt(0))||"-",a.replaceChild(s,t)}}}),(0,a.jsx)("span",{children:e.provider})]})}),(0,a.jsxs)(g.Z,{children:["$",(0,E.pw)(e.spend,2)]}),(0,a.jsx)(g.Z,{className:"text-green-600",children:e.successful_requests.toLocaleString()}),(0,a.jsx)(g.Z,{className:"text-red-600",children:e.failed_requests.toLocaleString()}),(0,a.jsx)(g.Z,{children:e.tokens.toLocaleString()})]},e.provider))})]})})]})]})})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:eM})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:eU})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)($,{modelMetrics:eV})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(eY,{userSpendData:H})})]})]}),"organization"===eZ&&(0,a.jsxs)(a.Fragment,{children:[e_&&(0,a.jsx)(k.Z,{banner:!0,type:"info",message:"Organization usage is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>ey(!1),className:"mb-5"}),(0,a.jsx)(eK,{accessToken:Y,entityType:"organization",userID:W,userRole:K,dateValue:er,entityList:(null==R?void 0:R.map(e=>({label:e.organization_alias,value:e.organization_id})))||null,premiumUser:B})]}),"team"===eZ&&(0,a.jsx)(eK,{accessToken:Y,entityType:"team",userID:W,userRole:K,entityList:(null==z?void 0:z.map(e=>({label:e.team_alias,value:e.team_id})))||null,premiumUser:B,dateValue:er}),"customer"===eZ&&(0,a.jsxs)(a.Fragment,{children:[ev&&(0,a.jsx)(k.Z,{banner:!0,type:"info",message:"Customer usage is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>ek(!1),className:"mb-5"}),(0,a.jsx)(eK,{accessToken:Y,entityType:"customer",userID:W,userRole:K,entityList:(null==ec?void 0:ec.map(e=>({label:e.alias||e.user_id,value:e.user_id})))||null,premiumUser:B,dateValue:er})]}),"tag"===eZ&&(0,a.jsx)(eK,{accessToken:Y,entityType:"tag",userID:W,userRole:K,entityList:en,premiumUser:B,dateValue:er}),"agent"===eZ&&(0,a.jsxs)(a.Fragment,{children:[eq&&(0,a.jsx)(k.Z,{banner:!0,type:"info",message:"Agent usage (A2A) is a new feature.",description:"Spend is tracked from feature launch and previous data isn't backfilled, so only future usage appears here.",closable:!0,onClose:()=>eS(!1),className:"mb-5"}),(0,a.jsx)(eK,{accessToken:Y,entityType:"agent",userID:W,userRole:K,entityList:(null==eo?void 0:null===(V=eo.agents)||void 0===V?void 0:V.map(e=>({label:e.agent_name,value:e.agent_id})))||null,premiumUser:B,dateValue:er})," "]}),"user-agent-activity"===eZ&&(0,a.jsx)(eT,{accessToken:Y,userRole:K,dateValue:er})]})}),(0,a.jsx)(es,{isOpen:ex,onClose:()=>ep(!1),accessToken:Y}),(0,a.jsx)(eh,{isOpen:eg,onClose:()=>ef(!1),entityType:"team",spendData:{results:H.results,metadata:H.metadata},dateRange:er,selectedFilters:[],customTitle:"Export Usage Data"})]})}},91027:function(e,s,t){t.d(s,{Z:function(){return o}});var a=t(57437),r=t(33866),l=t(2265),n=t(9245);function i(e){let s=s=>{"disableShowNewBadge"===s.key&&e()},t=s=>{let{key:t}=s.detail;"disableShowNewBadge"===t&&e()};return window.addEventListener("storage",s),window.addEventListener(n.Qg,t),()=>{window.removeEventListener("storage",s),window.removeEventListener(n.Qg,t)}}function c(){return"true"===(0,n.le)("disableShowNewBadge")}function o(e){let{children:s}=e;return(0,l.useSyncExternalStore)(i,c)?s?(0,a.jsx)(a.Fragment,{children:s}):null:s?(0,a.jsx)(r.Z,{color:"blue",count:"New",children:s}):(0,a.jsx)(r.Z,{color:"blue",count:"New"})}},91323:function(e,s,t){t.d(s,{S:function(){return n}});var a=t(57437),r=t(2265),l=t(10012);function n(e){var s,t;let{className:n="",...i}=e,c=(0,r.useId)();return s=()=>{let e=document.getAnimations().filter(e=>e instanceof CSSAnimation&&"spin"===e.animationName),s=e.find(e=>{var s;return(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))===c}),t=e.find(e=>{var s;return e.effect instanceof KeyframeEffect&&(null===(s=e.effect.target)||void 0===s?void 0:s.getAttribute("data-spinner-id"))!==c});s&&t&&(s.currentTime=t.currentTime)},t=[c],(0,r.useLayoutEffect)(s,t),(0,a.jsxs)("svg",{"data-spinner-id":c,className:(0,l.cx)("pointer-events-none size-12 animate-spin text-current",n),fill:"none",viewBox:"0 0 24 24",...i,children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},47375:function(e,s,t){var a=t(57437),r=t(2265),l=t(19250),n=t(59872),i=t(39760);s.Z=e=>{let{userSpend:s,userMaxBudget:t,selectedTeam:c}=e,{accessToken:o,userRole:d,userId:u}=(0,i.Z)(),[m,x]=(0,r.useState)(null!==s?s:0),[h,p]=(0,r.useState)(c?Number((0,n.pw)(c.max_budget,4)):null);(0,r.useEffect)(()=>{if(c){if("Default Team"===c.team_alias)p(t);else{let e=!1;if(c.team_memberships)for(let s of c.team_memberships)s.user_id===u&&"max_budget"in s.litellm_budget_table&&null!==s.litellm_budget_table.max_budget&&(p(s.litellm_budget_table.max_budget),e=!0);e||p(c.max_budget)}}else p(t)},[c,t]);let[g,j]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e=async()=>{if(!o||!u||!d)return};(async()=>{try{if(null===u||null===d)return;if(null!==o){let e=(await (0,l.modelAvailableCall)(o,u,d)).data.map(e=>e.id);console.log("available_model_names:",e),j(e)}}catch(e){console.error("Error fetching user models:",e)}})(),e()},[d,o,u]),(0,r.useEffect)(()=>{null!==s&&x(s)},[s]);let f=[];c&&c.models&&(f=c.models),f&&f.includes("all-proxy-models")?(console.log("user models:",g),f=g):f&&f.includes("all-team-models")?f=c.models:f&&0===f.length&&(f=g);let _=null!==h?"$".concat((0,n.pw)(Number(h),4)," limit"):"No limit",y=void 0!==m?(0,n.pw)(m,4):null;return console.log("spend in view user spend: ".concat(m)),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsxs)("div",{className:"flex justify-between gap-x-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Total Spend"}),(0,a.jsxs)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:["$",y]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content",children:"Max Budget"}),(0,a.jsx)("p",{className:"text-2xl text-tremor-content-strong dark:text-dark-tremor-content-strong font-semibold",children:_})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1918-00295dde1099fe9a.js b/litellm/proxy/_experimental/out/_next/static/chunks/1918-00295dde1099fe9a.js deleted file mode 100644 index 9cb3ea4dafa..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1918-00295dde1099fe9a.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1918,7688],{5540:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},45246:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},89245:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},8881:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},3632:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},35291:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},58747:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(5853),o=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(5853),o=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}},41649:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var n=r(5853),o=r(2265),a=r(47187),l=r(7084),i=r(26898),c=r(13241),s=r(1153);let u={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},d={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},m=(0,s.fn)("Badge"),p=o.forwardRef((e,t)=>{let{color:r,icon:p,size:f=l.u8.SM,tooltip:b,className:g,children:v}=e,h=(0,n._T)(e,["color","icon","size","tooltip","className","children"]),w=p||null,{tooltipProps:y,getReferenceProps:k}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,s.lq)([t,y.refs.setReference]),className:(0,c.q)(m("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",r?(0,c.q)((0,s.bM)(r,i.K.background).bgColor,(0,s.bM)(r,i.K.iconText).textColor,(0,s.bM)(r,i.K.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):(0,c.q)("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),u[f].paddingX,u[f].paddingY,u[f].fontSize,g)},k,h),o.createElement(a.Z,Object.assign({text:b},y)),w?o.createElement(w,{className:(0,c.q)(m("icon"),"shrink-0 -ml-1 mr-1.5",d[f].height,d[f].width)}):null,o.createElement("span",{className:(0,c.q)(m("text"),"whitespace-nowrap")},v))});p.displayName="Badge"},47323:function(e,t,r){"use strict";r.d(t,{Z:function(){return b}});var n=r(5853),o=r(2265),a=r(47187),l=r(7084),i=r(13241),c=r(1153),s=r(26898);let u={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},d={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},m={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,c.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,c.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,i.q)((0,c.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,c.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,i.q)((0,c.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,c.bM)(t,s.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,i.q)((0,c.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,c.bM)(t,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,i.q)((0,c.bM)(t,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,c.bM)(t,s.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,i.q)((0,c.bM)(t,s.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},f=(0,c.fn)("Icon"),b=o.forwardRef((e,t)=>{let{icon:r,variant:s="simple",tooltip:b,size:g=l.u8.SM,color:v,className:h}=e,w=(0,n._T)(e,["icon","variant","tooltip","size","color","className"]),y=p(s,v),{tooltipProps:k,getReferenceProps:x}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,c.lq)([t,k.refs.setReference]),className:(0,i.q)(f("root"),"inline-flex shrink-0 items-center justify-center",y.bgColor,y.textColor,y.borderColor,y.ringColor,m[s].rounded,m[s].border,m[s].shadow,m[s].ring,u[g].paddingX,u[g].paddingY,h)},x,w),o.createElement(a.Z,Object.assign({text:b},k)),o.createElement(r,{className:(0,i.q)(f("icon"),"shrink-0",d[g].height,d[g].width)}))});b.displayName="Icon"},30150:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(5853),o=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},l=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var i=r(13241),c=r(1153),s=r(69262);let u="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",m=o.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:m=!0,disabled:p,onValueChange:f,onChange:b}=e,g=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),v=(0,o.useRef)(null),[h,w]=o.useState(!1),y=o.useCallback(()=>{w(!0)},[]),k=o.useCallback(()=>{w(!1)},[]),[x,C]=o.useState(!1),E=o.useCallback(()=>{C(!0)},[]),O=o.useCallback(()=>{C(!1)},[]);return o.createElement(s.Z,Object.assign({type:"number",ref:(0,c.lq)([v,t]),disabled:p,makeInputClassName:(0,c.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=v.current)||void 0===t?void 0:t.value;null==r||r(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&y(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&k(),"ArrowUp"===e.key&&O()},onChange:e=>{p||(null==f||f(parseFloat(e.target.value)),null==b||b(e))},stepper:m?o.createElement("div",{className:(0,i.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepDown(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(l,{"data-testid":"step-down",className:(h?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=v.current)||void 0===e||e.stepUp(),null===(t=v.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.q)(!p&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(x?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});m.displayName="NumberInput"},27281:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var n=r(5853),o=r(58747),a=r(2265),l=r(4537),i=r(13241),c=r(1153),s=r(96398),u=r(51975),d=r(85238),m=r(44140);let p=(0,c.fn)("Select"),f=a.forwardRef((e,t)=>{let{defaultValue:r="",value:c,onValueChange:f,placeholder:b="Select...",disabled:g=!1,icon:v,enableClear:h=!1,required:w,children:y,name:k,error:x=!1,errorMessage:C,className:E,id:O}=e,j=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),S=(0,a.useRef)(null),N=a.Children.toArray(y),[Z,M]=(0,m.Z)(r,c),P=(0,a.useMemo)(()=>{let e=a.Children.toArray(y).filter(a.isValidElement);return(0,s.sl)(e)},[y]);return a.createElement("div",{className:(0,i.q)("w-full min-w-[10rem] text-tremor-default",E)},a.createElement("div",{className:"relative"},a.createElement("select",{title:"select-hidden",required:w,className:(0,i.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:Z,onChange:e=>{e.preventDefault()},name:k,disabled:g,id:O,onFocus:()=>{let e=S.current;e&&e.focus()}},a.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},b),N.map(e=>{let t=e.props.value,r=e.props.children;return a.createElement("option",{className:"hidden",key:t,value:t},r)})),a.createElement(u.Ri,Object.assign({as:"div",ref:t,defaultValue:Z,value:Z,onChange:e=>{null==f||f(e),M(e)},disabled:g,id:O},j),e=>{var t;let{value:r}=e;return a.createElement(a.Fragment,null,a.createElement(u.Y4,{ref:S,className:(0,i.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",v?"pl-10":"pl-3",(0,s.um)((0,s.Uh)(r),g,x))},v&&a.createElement("span",{className:(0,i.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},a.createElement(v,{className:(0,i.q)(p("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),a.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=P.get(r))&&void 0!==t?t:b),a.createElement("span",{className:(0,i.q)("absolute inset-y-0 right-0 flex items-center mr-3")},a.createElement(o.Z,{className:(0,i.q)(p("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),h&&Z?a.createElement("button",{type:"button",className:(0,i.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),M(""),null==f||f("")}},a.createElement(l.Z,{className:(0,i.q)(p("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,a.createElement(d.u,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},a.createElement(u.O_,{anchor:"bottom start",className:(0,i.q)("z-10 w-[var(--button-width)] divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},y)))})),x&&C?a.createElement("p",{className:(0,i.q)("errorMessage","text-sm text-rose-500 mt-1")},C):null)});f.displayName="Select"},59341:function(e,t,r){"use strict";r.d(t,{Z:function(){return T}});var n=r(5853),o=r(71049),a=r(11323),l=r(2265),i=r(66797),c=r(40099),s=r(74275),u=r(59456),d=r(93980),m=r(65573),p=r(67561),f=r(87550),b=r(628),g=r(80281),v=r(31370),h=r(20131),w=r(38929),y=r(52307),k=r(52724),x=r(7935);let C=(0,l.createContext)(null);C.displayName="GroupContext";let E=l.Fragment,O=Object.assign((0,w.yV)(function(e,t){var r;let n=(0,l.useId)(),E=(0,g.Q)(),O=(0,f.B)(),{id:j=E||"headlessui-switch-".concat(n),disabled:S=O||!1,checked:N,defaultChecked:Z,onChange:M,name:P,value:T,form:L,autoFocus:z=!1,...R}=e,I=(0,l.useContext)(C),[B,D]=(0,l.useState)(null),q=(0,l.useRef)(null),H=(0,p.T)(q,t,null===I?null:I.setSwitch,D),F=(0,s.L)(Z),[W,V]=(0,c.q)(N,M,null!=F&&F),A=(0,u.G)(),[_,K]=(0,l.useState)(!1),X=(0,d.z)(()=>{K(!0),null==V||V(!W),A.nextFrame(()=>{K(!1)})}),Y=(0,d.z)(e=>{if((0,v.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),X()}),U=(0,d.z)(e=>{e.key===k.R.Space?(e.preventDefault(),X()):e.key===k.R.Enter&&(0,h.g)(e.currentTarget)}),G=(0,d.z)(e=>e.preventDefault()),$=(0,x.wp)(),J=(0,y.zH)(),{isFocusVisible:Q,focusProps:ee}=(0,o.F)({autoFocus:z}),{isHovered:et,hoverProps:er}=(0,a.X)({isDisabled:S}),{pressed:en,pressProps:eo}=(0,i.x)({disabled:S}),ea=(0,l.useMemo)(()=>({checked:W,disabled:S,hover:et,focus:Q,active:en,autofocus:z,changing:_}),[W,et,Q,en,S,_,z]),el=(0,w.dG)({id:j,ref:H,role:"switch",type:(0,m.f)(e,B),tabIndex:-1===e.tabIndex?0:null!=(r=e.tabIndex)?r:0,"aria-checked":W,"aria-labelledby":$,"aria-describedby":J,disabled:S||void 0,autoFocus:z,onClick:Y,onKeyUp:U,onKeyPress:G},ee,er,eo),ei=(0,l.useCallback)(()=>{if(void 0!==F)return null==V?void 0:V(F)},[V,F]),ec=(0,w.L6)();return l.createElement(l.Fragment,null,null!=P&&l.createElement(b.Mt,{disabled:S,data:{[P]:T||"on"},overrides:{type:"checkbox",checked:W},form:L,onReset:ei}),ec({ourProps:el,theirProps:R,slot:ea,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[r,n]=(0,l.useState)(null),[o,a]=(0,x.bE)(),[i,c]=(0,y.fw)(),s=(0,l.useMemo)(()=>({switch:r,setSwitch:n}),[r,n]),u=(0,w.L6)();return l.createElement(c,{name:"Switch.Description",value:i},l.createElement(a,{name:"Switch.Label",value:o,props:{htmlFor:null==(t=s.switch)?void 0:t.id,onClick(e){r&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},l.createElement(C.Provider,{value:s},u({ourProps:{},theirProps:e,slot:{},defaultTag:E,name:"Switch.Group"}))))},Label:x.__,Description:y.dk});var j=r(44140),S=r(26898),N=r(13241),Z=r(1153),M=r(47187);let P=(0,Z.fn)("Switch"),T=l.forwardRef((e,t)=>{let{checked:r,defaultChecked:o=!1,onChange:a,color:i,name:c,error:s,errorMessage:u,disabled:d,required:m,tooltip:p,id:f}=e,b=(0,n._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:i?(0,Z.bM)(i,S.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:i?(0,Z.bM)(i,S.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[v,h]=(0,j.Z)(o,r),[w,y]=(0,l.useState)(!1),{tooltipProps:k,getReferenceProps:x}=(0,M.l)(300);return l.createElement("div",{className:"flex flex-row items-center justify-start"},l.createElement(M.Z,Object.assign({text:p},k)),l.createElement("div",Object.assign({ref:(0,Z.lq)([t,k.refs.setReference]),className:(0,N.q)(P("root"),"flex flex-row relative h-5")},b,x),l.createElement("input",{type:"checkbox",className:(0,N.q)(P("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:c,required:m,checked:v,onChange:e=>{e.preventDefault()}}),l.createElement(O,{checked:v,onChange:e=>{h(e),null==a||a(e)},disabled:d,className:(0,N.q)(P("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>y(!0),onBlur:()=>y(!1),id:f},l.createElement("span",{className:(0,N.q)(P("sr-only"),"sr-only")},"Switch ",v?"on":"off"),l.createElement("span",{"aria-hidden":"true",className:(0,N.q)(P("background"),v?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),l.createElement("span",{"aria-hidden":"true",className:(0,N.q)(P("round"),v?(0,N.q)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",w?(0,N.q)("ring-2",g.ringColor):"")}))),s&&u?l.createElement("p",{className:(0,N.q)(P("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});T.displayName="Switch"},87452:function(e,t,r){"use strict";r.d(t,{Z:function(){return d},r:function(){return u}});var n=r(5853),o=r(91054);r(42698),r(64016);var a=r(8710);r(33232);var l=r(13241),i=r(1153),c=r(2265);let s=(0,i.fn)("Accordion"),u=(0,c.createContext)({isOpen:!1}),d=c.forwardRef((e,t)=>{var r;let{defaultOpen:i=!1,children:d,className:m}=e,p=(0,n._T)(e,["defaultOpen","children","className"]),f=null!==(r=(0,c.useContext)(a.Z))&&void 0!==r?r:(0,l.q)("rounded-tremor-default border");return c.createElement(o.pJ,Object.assign({as:"div",ref:t,className:(0,l.q)(s("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",f,m),defaultOpen:i},p),e=>{let{open:t}=e;return c.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(5853),o=r(2265),a=r(91054),l=r(13241);let i=(0,r(1153).fn)("AccordionBody"),c=o.forwardRef((e,t)=>{let{children:r,className:c}=e,s=(0,n._T)(e,["children","className"]);return o.createElement(a.pJ.Panel,Object.assign({ref:t,className:(0,l.q)(i("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",c)},s),r)});c.displayName="AccordionBody"},72208:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853),o=r(2265),a=r(91054);let l=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var i=r(87452),c=r(13241);let s=(0,r(1153).fn)("AccordionHeader"),u=o.forwardRef((e,t)=>{let{children:r,className:u}=e,d=(0,n._T)(e,["children","className"]),{isOpen:m}=(0,o.useContext)(i.r);return o.createElement(a.pJ.Button,Object.assign({ref:t,className:(0,c.q)(s("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),o.createElement("div",{className:(0,c.q)(s("children"),"flex flex-1 text-inherit mr-4")},r),o.createElement("div",null,o.createElement(l,{className:(0,c.q)(s("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",m?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},49804:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(5853),o=r(13241),a=r(1153),l=r(2265),i=r(9496);let c=(0,a.fn)("Col"),s=l.forwardRef((e,t)=>{let{numColSpan:r=1,numColSpanSm:a,numColSpanMd:s,numColSpanLg:u,children:d,className:m}=e,p=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),f=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return l.createElement("div",Object.assign({ref:t,className:(0,o.q)(c("root"),(()=>{let e=f(r,i.PT),t=f(a,i.SP),n=f(s,i.VS),l=f(u,i._w);return(0,o.q)(e,t,n,l)})(),m)},p),d)});s.displayName="Col"},97765:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(5853),o=r(26898),a=r(13241),l=r(1153),i=r(2265);let c=i.forwardRef((e,t)=>{let{color:r,children:c,className:s}=e,u=(0,n._T)(e,["color","children","className"]);return i.createElement("p",Object.assign({ref:t,className:(0,a.q)(r?(0,l.bM)(r,o.K.lightText).textColor:"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis",s)},u),c)});c.displayName="Subtitle"},44140:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(2265);let o=(e,t)=>{let r=void 0!==t,[o,a]=(0,n.useState)(e);return[r?t:o,e=>{r||a(e)}]}},92570:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=e=>e?"function"==typeof e?e():e:null},33866:function(e,t,r){"use strict";r.d(t,{Z:function(){return L}});var n=r(2265),o=r(36760),a=r.n(o),l=r(66632),i=r(93350),c=r(19722),s=r(71744),u=r(93463),d=r(12918),m=r(18536),p=r(71140),f=r(99320);let b=new u.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=new u.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),v=new u.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),h=new u.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),w=new u.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),y=new u.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),k=e=>{let{componentCls:t,iconCls:r,antCls:n,badgeShadowSize:o,textFontSize:a,textFontSizeSM:l,statusSize:i,dotSize:c,textFontWeight:s,indicatorHeight:p,indicatorHeightSM:f,marginXS:k,calc:x}=e,C="".concat(n,"-scroll-number"),E=(0,m.Z)(e,(e,r)=>{let{darkColor:n}=r;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:n,["&:not(".concat(t,"-count)")]:{color:n},"a:hover &":{background:n}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:p,height:p,color:e.badgeTextColor,fontWeight:s,fontSize:a,lineHeight:(0,u.bf)(p),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:x(p).div(2).equal(),boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor),transition:"background ".concat(e.motionDurationMid),a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},["".concat(t,"-count-sm")]:{minWidth:f,height:f,fontSize:l,lineHeight:(0,u.bf)(f),borderRadius:x(f).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,u.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:c,minWidth:c,height:c,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,u.bf)(o)," ").concat(e.badgeShadowColor)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(C,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(r,"-spin")]:{animationName:y,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(t,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(t,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:i,height:i,verticalAlign:"middle",borderRadius:"50%"},["".concat(t,"-status-success")]:{backgroundColor:e.colorSuccess},["".concat(t,"-status-processing")]:{overflow:"visible",color:e.colorInfo,backgroundColor:e.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:b,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(t,"-status-default")]:{backgroundColor:e.colorTextPlaceholder},["".concat(t,"-status-error")]:{backgroundColor:e.colorError},["".concat(t,"-status-warning")]:{backgroundColor:e.colorWarning},["".concat(t,"-status-text")]:{marginInlineStart:k,color:e.colorText,fontSize:e.fontSize}}}),E),{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:g,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["".concat(t,"-zoom-leave")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:h,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:w,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(C,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(C,"-custom-component, ").concat(C)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[C]:{overflow:"hidden",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack),["".concat(C,"-only")]:{position:"relative",display:"inline-block",height:p,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(C,"-only-unit")]:{height:p,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(C,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(C,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},x=e=>{let{fontHeight:t,lineWidth:r,marginXS:n,colorBorderBg:o}=e,a=e.colorTextLightSolid,l=e.colorError,i=e.colorErrorHover;return(0,p.IX)(e,{badgeFontHeight:t,badgeShadowSize:r,badgeTextColor:a,badgeColor:l,badgeColorHover:i,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:n,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},C=e=>{let{fontSize:t,lineHeight:r,fontSizeSM:n,lineWidth:o}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*r)-2*o,indicatorHeightSM:t,dotSize:n/2,textFontSize:n,textFontSizeSM:n,textFontWeight:"normal",statusSize:n/2}};var E=(0,f.I$)("Badge",e=>k(x(e)),C);let O=e=>{let{antCls:t,badgeFontHeight:r,marginXS:n,badgeRibbonOffset:o,calc:a}=e,l="".concat(t,"-ribbon"),i=(0,m.Z)(e,(e,t)=>{let{darkColor:r}=t;return{["&".concat(l,"-color-").concat(e)]:{background:r,color:r}}});return{["".concat(t,"-ribbon-wrapper")]:{position:"relative"},[l]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,d.Wf)(e)),{position:"absolute",top:n,padding:"0 ".concat((0,u.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,u.bf)(r),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(l,"-text")]:{color:e.badgeTextColor},["".concat(l,"-corner")]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:"".concat((0,u.bf)(a(o).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),i),{["&".concat(l,"-placement-end")]:{insetInlineEnd:a(o).mul(-1).equal(),borderEndEndRadius:0,["".concat(l,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(l,"-placement-start")]:{insetInlineStart:a(o).mul(-1).equal(),borderEndStartRadius:0,["".concat(l,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var j=(0,f.I$)(["Badge","Ribbon"],e=>O(x(e)),C);let S=e=>{let t;let{prefixCls:r,value:o,current:l,offset:i=0}=e;return i&&(t={position:"absolute",top:"".concat(i,"00%"),left:0}),n.createElement("span",{style:t,className:a()("".concat(r,"-only-unit"),{current:l})},o)};var N=e=>{let t,r;let{prefixCls:o,count:a,value:l}=e,i=Number(l),c=Math.abs(a),[s,u]=n.useState(i),[d,m]=n.useState(c),p=()=>{u(i),m(c)};if(n.useEffect(()=>{let e=setTimeout(p,1e3);return()=>clearTimeout(e)},[i]),s===i||Number.isNaN(i)||Number.isNaN(s))t=[n.createElement(S,Object.assign({},e,{key:i,current:!0}))],r={transition:"none"};else{t=[];let o=i+10,a=[];for(let e=i;e<=o;e+=1)a.push(e);let l=de%10===s);t=(l<0?a.slice(0,u+1):a.slice(u)).map((t,r)=>n.createElement(S,Object.assign({},e,{key:t,value:t%10,offset:l<0?r-u:r,current:r===u}))),r={transform:"translateY(".concat(-function(e,t,r){let n=e,o=0;for(;(n+10)%10!==t;)n+=r,o+=r;return o}(s,i,l),"00%)")}}return n.createElement("span",{className:"".concat(o,"-only"),style:r,onTransitionEnd:p},t)},Z=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let M=n.forwardRef((e,t)=>{let{prefixCls:r,count:o,className:l,motionClassName:i,style:u,title:d,show:m,component:p="sup",children:f}=e,b=Z(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=n.useContext(s.E_),v=g("scroll-number",r),h=Object.assign(Object.assign({},b),{"data-show":m,style:u,className:a()(v,l,i),title:d}),w=o;if(o&&Number(o)%1==0){let e=String(o).split("");w=n.createElement("bdi",null,e.map((t,r)=>n.createElement(N,{prefixCls:v,count:Number(o),value:t,key:e.length-r})))}return((null==u?void 0:u.borderColor)&&(h.style=Object.assign(Object.assign({},u),{boxShadow:"0 0 0 1px ".concat(u.borderColor," inset")})),f)?(0,c.Tm)(f,e=>({className:a()("".concat(v,"-custom-component"),null==e?void 0:e.className,i)})):n.createElement(p,Object.assign({},h,{ref:t}),w)});var P=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let T=n.forwardRef((e,t)=>{var r,o,u,d,m;let{prefixCls:p,scrollNumberPrefixCls:f,children:b,status:g,text:v,color:h,count:w=null,overflowCount:y=99,dot:k=!1,size:x="default",title:C,offset:O,style:j,className:S,rootClassName:N,classNames:Z,styles:T,showZero:L=!1}=e,z=P(e,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:R,direction:I,badge:B}=n.useContext(s.E_),D=R("badge",p),[q,H,F]=E(D),W=w>y?"".concat(y,"+"):w,V="0"===W||0===W||"0"===v||0===v,A=null===w||V&&!L,_=(null!=g||null!=h)&&A,K=null!=g||!V,X=k&&!V,Y=X?"":W,U=(0,n.useMemo)(()=>((null==Y||""===Y)&&(null==v||""===v)||V&&!L)&&!X,[Y,V,L,X,v]),G=(0,n.useRef)(w);U||(G.current=w);let $=G.current,J=(0,n.useRef)(Y);U||(J.current=Y);let Q=J.current,ee=(0,n.useRef)(X);U||(ee.current=X);let et=(0,n.useMemo)(()=>{if(!O)return Object.assign(Object.assign({},null==B?void 0:B.style),j);let e={marginTop:O[1]};return"rtl"===I?e.left=Number.parseInt(O[0],10):e.right=-Number.parseInt(O[0],10),Object.assign(Object.assign(Object.assign({},e),null==B?void 0:B.style),j)},[I,O,j,null==B?void 0:B.style]),er=null!=C?C:"string"==typeof $||"number"==typeof $?$:void 0,en=!U&&(0===v?L:!!v&&!0!==v),eo=en?n.createElement("span",{className:"".concat(D,"-status-text")},v):null,ea=$&&"object"==typeof $?(0,c.Tm)($,e=>({style:Object.assign(Object.assign({},et),e.style)})):void 0,el=(0,i.o2)(h,!1),ei=a()(null==Z?void 0:Z.indicator,null===(r=null==B?void 0:B.classNames)||void 0===r?void 0:r.indicator,{["".concat(D,"-status-dot")]:_,["".concat(D,"-status-").concat(g)]:!!g,["".concat(D,"-color-").concat(h)]:el}),ec={};h&&!el&&(ec.color=h,ec.background=h);let es=a()(D,{["".concat(D,"-status")]:_,["".concat(D,"-not-a-wrapper")]:!b,["".concat(D,"-rtl")]:"rtl"===I},S,N,null==B?void 0:B.className,null===(o=null==B?void 0:B.classNames)||void 0===o?void 0:o.root,null==Z?void 0:Z.root,H,F);if(!b&&_&&(v||K||!A)){let e=et.color;return q(n.createElement("span",Object.assign({},z,{className:es,style:Object.assign(Object.assign(Object.assign({},null==T?void 0:T.root),null===(u=null==B?void 0:B.styles)||void 0===u?void 0:u.root),et)}),n.createElement("span",{className:ei,style:Object.assign(Object.assign(Object.assign({},null==T?void 0:T.indicator),null===(d=null==B?void 0:B.styles)||void 0===d?void 0:d.indicator),ec)}),en&&n.createElement("span",{style:{color:e},className:"".concat(D,"-status-text")},v)))}return q(n.createElement("span",Object.assign({ref:t},z,{className:es,style:Object.assign(Object.assign({},null===(m=null==B?void 0:B.styles)||void 0===m?void 0:m.root),null==T?void 0:T.root)}),b,n.createElement(l.ZP,{visible:!U,motionName:"".concat(D,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,r;let{className:o}=e,l=R("scroll-number",f),i=ee.current,c=a()(null==Z?void 0:Z.indicator,null===(t=null==B?void 0:B.classNames)||void 0===t?void 0:t.indicator,{["".concat(D,"-dot")]:i,["".concat(D,"-count")]:!i,["".concat(D,"-count-sm")]:"small"===x,["".concat(D,"-multiple-words")]:!i&&Q&&Q.toString().length>1,["".concat(D,"-status-").concat(g)]:!!g,["".concat(D,"-color-").concat(h)]:el}),s=Object.assign(Object.assign(Object.assign({},null==T?void 0:T.indicator),null===(r=null==B?void 0:B.styles)||void 0===r?void 0:r.indicator),et);return h&&!el&&((s=s||{}).background=h),n.createElement(M,{prefixCls:l,show:!U,motionClassName:o,className:c,count:Q,title:er,style:s,key:"scrollNumber"},ea)}),eo))});T.Ribbon=e=>{let{className:t,prefixCls:r,style:o,color:l,children:c,text:u,placement:d="end",rootClassName:m}=e,{getPrefixCls:p,direction:f}=n.useContext(s.E_),b=p("ribbon",r),g="".concat(b,"-wrapper"),[v,h,w]=j(b,g),y=(0,i.o2)(l,!1),k=a()(b,"".concat(b,"-placement-").concat(d),{["".concat(b,"-rtl")]:"rtl"===f,["".concat(b,"-color-").concat(l)]:y},t),x={},C={};return l&&!y&&(x.background=l,C.color=l),v(n.createElement("div",{className:a()(g,m,h,w)},c,n.createElement("div",{className:a()(k,h),style:Object.assign(Object.assign({},x),o)},n.createElement("span",{className:"".concat(b,"-text")},u),n.createElement("div",{className:"".concat(b,"-corner"),style:C}))))};var L=T},69410:function(e,t,r){"use strict";var n=r(54998);t.Z=n.Z},867:function(e,t,r){"use strict";r.d(t,{Z:function(){return O}});var n=r(2265),o=r(54537),a=r(36760),l=r.n(a),i=r(50506),c=r(18694),s=r(71744),u=r(79326),d=r(59367),m=r(92570),p=r(5545),f=r(51248),b=r(55274),g=r(37381),v=r(20435),h=r(99320);let w=e=>{let{componentCls:t,iconCls:r,antCls:n,zIndexPopup:o,colorText:a,colorWarning:l,marginXXS:i,marginXS:c,fontSize:s,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:o,["&".concat(n,"-popover")]:{fontSize:s},["".concat(t,"-message")]:{marginBottom:c,display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(t,"-message-icon ").concat(r)]:{color:l,fontSize:s,lineHeight:1,marginInlineEnd:c},["".concat(t,"-title")]:{fontWeight:u,color:d,"&:only-child":{fontWeight:"normal"}},["".concat(t,"-description")]:{marginTop:i,color:a}},["".concat(t,"-buttons")]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:c}}}}};var y=(0,h.I$)("Popconfirm",e=>w(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),k=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let x=e=>{let{prefixCls:t,okButtonProps:r,cancelButtonProps:a,title:l,description:i,cancelText:c,okText:u,okType:v="primary",icon:h=n.createElement(o.Z,null),showCancel:w=!0,close:y,onConfirm:k,onCancel:x,onPopupClick:C}=e,{getPrefixCls:E}=n.useContext(s.E_),[O]=(0,b.Z)("Popconfirm",g.Z.Popconfirm),j=(0,m.Z)(l),S=(0,m.Z)(i);return n.createElement("div",{className:"".concat(t,"-inner-content"),onClick:C},n.createElement("div",{className:"".concat(t,"-message")},h&&n.createElement("span",{className:"".concat(t,"-message-icon")},h),n.createElement("div",{className:"".concat(t,"-message-text")},j&&n.createElement("div",{className:"".concat(t,"-title")},j),S&&n.createElement("div",{className:"".concat(t,"-description")},S))),n.createElement("div",{className:"".concat(t,"-buttons")},w&&n.createElement(p.ZP,Object.assign({onClick:x,size:"small"},a),c||(null==O?void 0:O.cancelText)),n.createElement(d.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,f.nx)(v)),r),actionFn:k,close:y,prefixCls:E("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},u||(null==O?void 0:O.okText))))};var C=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let E=n.forwardRef((e,t)=>{var r,a;let{prefixCls:d,placement:m="top",trigger:p="click",okType:f="primary",icon:b=n.createElement(o.Z,null),children:g,overlayClassName:v,onOpenChange:h,onVisibleChange:w,overlayStyle:k,styles:E,classNames:O}=e,j=C(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:S,className:N,style:Z,classNames:M,styles:P}=(0,s.dj)("popconfirm"),[T,L]=(0,i.Z)(!1,{value:null!==(r=e.open)&&void 0!==r?r:e.visible,defaultValue:null!==(a=e.defaultOpen)&&void 0!==a?a:e.defaultVisible}),z=(e,t)=>{L(e,!0),null==w||w(e),null==h||h(e,t)},R=S("popconfirm",d),I=l()(R,N,v,M.root,null==O?void 0:O.root),B=l()(M.body,null==O?void 0:O.body),[D]=y(R);return D(n.createElement(u.Z,Object.assign({},(0,c.Z)(j,["title"]),{trigger:p,placement:m,onOpenChange:(t,r)=>{let{disabled:n=!1}=e;n||z(t,r)},open:T,ref:t,classNames:{root:I,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},P.root),Z),k),null==E?void 0:E.root),body:Object.assign(Object.assign({},P.body),null==E?void 0:E.body)},content:n.createElement(x,Object.assign({okType:f,icon:b},e,{prefixCls:R,close:e=>{z(!1,e)},onConfirm:t=>{var r;return null===(r=e.onConfirm)||void 0===r?void 0:r.call(void 0,t)},onCancel:t=>{var r;z(!1,t),null===(r=e.onCancel)||void 0===r||r.call(void 0,t)}})),"data-popover-inject":!0}),g))});E._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:r,className:o,style:a}=e,i=k(e,["prefixCls","placement","className","style"]),{getPrefixCls:c}=n.useContext(s.E_),u=c("popconfirm",t),[d]=y(u);return d(n.createElement(v.ZP,{placement:r,className:l()(u,o),style:a,content:n.createElement(x,Object.assign({prefixCls:u},i))}))};var O=E},20435:function(e,t,r){"use strict";r.d(t,{aV:function(){return d}});var n=r(2265),o=r(36760),a=r.n(o),l=r(5769),i=r(92570),c=r(71744),s=r(72262),u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let d=e=>{let{title:t,content:r,prefixCls:o}=e;return t||r?n.createElement(n.Fragment,null,t&&n.createElement("div",{className:"".concat(o,"-title")},t),r&&n.createElement("div",{className:"".concat(o,"-inner-content")},r)):null},m=e=>{let{hashId:t,prefixCls:r,className:o,style:c,placement:s="top",title:u,content:m,children:p}=e,f=(0,i.Z)(u),b=(0,i.Z)(m),g=a()(t,r,"".concat(r,"-pure"),"".concat(r,"-placement-").concat(s),o);return n.createElement("div",{className:g,style:c},n.createElement("div",{className:"".concat(r,"-arrow")}),n.createElement(l.G,Object.assign({},e,{className:t,prefixCls:r}),p||n.createElement(d,{prefixCls:r,title:f,content:b})))};t.ZP=e=>{let{prefixCls:t,className:r}=e,o=u(e,["prefixCls","className"]),{getPrefixCls:l}=n.useContext(c.E_),i=l("popover",t),[d,p,f]=(0,s.Z)(i);return d(n.createElement(m,Object.assign({},o,{prefixCls:i,hashId:p,className:a()(r,f)})))}},79326:function(e,t,r){"use strict";var n=r(2265),o=r(36760),a=r.n(o),l=r(50506),i=r(95814),c=r(92570),s=r(68710),u=r(19722),d=r(71744),m=r(99981),p=r(20435),f=r(72262),b=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let g=n.forwardRef((e,t)=>{var r,o;let{prefixCls:g,title:v,content:h,overlayClassName:w,placement:y="top",trigger:k="hover",children:x,mouseEnterDelay:C=.1,mouseLeaveDelay:E=.1,onOpenChange:O,overlayStyle:j={},styles:S,classNames:N}=e,Z=b(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:M,className:P,style:T,classNames:L,styles:z}=(0,d.dj)("popover"),R=M("popover",g),[I,B,D]=(0,f.Z)(R),q=M(),H=a()(w,B,D,P,L.root,null==N?void 0:N.root),F=a()(L.body,null==N?void 0:N.body),[W,V]=(0,l.Z)(!1,{value:null!==(r=e.open)&&void 0!==r?r:e.visible,defaultValue:null!==(o=e.defaultOpen)&&void 0!==o?o:e.defaultVisible}),A=(e,t)=>{V(e,!0),null==O||O(e,t)},_=e=>{e.keyCode===i.Z.ESC&&A(!1,e)},K=(0,c.Z)(v),X=(0,c.Z)(h);return I(n.createElement(m.Z,Object.assign({placement:y,trigger:k,mouseEnterDelay:C,mouseLeaveDelay:E},Z,{prefixCls:R,classNames:{root:H,body:F},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},z.root),T),j),null==S?void 0:S.root),body:Object.assign(Object.assign({},z.body),null==S?void 0:S.body)},ref:t,open:W,onOpenChange:e=>{A(e)},overlay:K||X?n.createElement(p.aV,{prefixCls:R,title:K,content:X}):null,transitionName:(0,s.m)(q,"zoom-big",Z.transitionName),"data-popover-inject":!0}),(0,u.Tm)(x,{onKeyDown:e=>{var t,r;(0,n.isValidElement)(x)&&(null===(r=null==x?void 0:(t=x.props).onKeyDown)||void 0===r||r.call(t,e)),_(e)}})))});g._InternalPanelDoNotUseOrYouWillBeFired=p.ZP,t.Z=g},72262:function(e,t,r){"use strict";var n=r(12918),o=r(691),a=r(88260),l=r(34442),i=r(53454),c=r(99320),s=r(71140);let u=e=>{let{componentCls:t,popoverColor:r,titleMinWidth:o,fontWeightStrong:l,innerPadding:i,boxShadowSecondary:c,colorTextHeading:s,borderRadiusLG:u,zIndexPopup:d,titleMarginBottom:m,colorBgElevated:p,popoverBg:f,titleBorderBottom:b,innerContentPadding:g,titlePadding:v}=e;return[{[t]:Object.assign(Object.assign({},(0,n.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:d,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":p,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},["".concat(t,"-content")]:{position:"relative"},["".concat(t,"-inner")]:{backgroundColor:f,backgroundClip:"padding-box",borderRadius:u,boxShadow:c,padding:i},["".concat(t,"-title")]:{minWidth:o,marginBottom:m,color:s,fontWeight:l,borderBottom:b,padding:v},["".concat(t,"-inner-content")]:{color:r,padding:g}})},(0,a.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",["".concat(t,"-content")]:{display:"inline-block"}}}]},d=e=>{let{componentCls:t}=e;return{[t]:i.i.map(r=>{let n=e["".concat(r,"6")];return{["&".concat(t,"-").concat(r)]:{"--antd-arrow-background-color":n,["".concat(t,"-inner")]:{backgroundColor:n},["".concat(t,"-arrow")]:{background:"transparent"}}}})}};t.Z=(0,c.I$)("Popover",e=>{let{colorBgElevated:t,colorText:r}=e,n=(0,s.IX)(e,{popoverBg:t,popoverColor:r});return[u(n),d(n),(0,o._y)(n,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:r,fontHeight:n,padding:o,wireframe:i,zIndexPopupBase:c,borderRadiusLG:s,marginXS:u,lineType:d,colorSplit:m,paddingSM:p}=e,f=r-n;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:c+30},(0,l.w)(e)),(0,a.wZ)({contentRadius:s,limitVerticalRadius:!0})),{innerPadding:i?0:12,titleMarginBottom:i?0:u,titlePadding:i?"".concat(f/2,"px ").concat(o,"px ").concat(f/2-t,"px"):0,titleBorderBottom:i?"".concat(t,"px ").concat(d," ").concat(m):"none",innerContentPadding:i?"".concat(p,"px ").concat(o,"px"):0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]})},47451:function(e,t,r){"use strict";var n=r(77774);t.Z=n.Z},3810:function(e,t,r){"use strict";r.d(t,{Z:function(){return M}});var n=r(2265),o=r(36760),a=r.n(o),l=r(18694),i=r(93350),c=r(53445),s=r(19722),u=r(6694),d=r(71744),m=r(93463),p=r(54558),f=r(12918),b=r(71140),g=r(99320);let v=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:o,calc:a}=e,l=a(n).sub(r).equal(),i=a(t).sub(r).equal();return{[o]:Object.assign(Object.assign({},(0,f.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:l,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(o,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(o,"-close-icon")]:{marginInlineStart:i,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(o,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(e.iconCls,"-close, ").concat(e.iconCls,"-close:hover")]:{color:e.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(o,"-checkable-checked):hover")]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(e.iconCls," + span, > span + ").concat(e.iconCls)]:{marginInlineStart:l}}),["".concat(o,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},h=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,o=e.fontSizeSM;return(0,b.IX)(e,{tagFontSize:o,tagLineHeight:(0,m.bf)(n(e.lineHeightSM).mul(o).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},w=e=>({defaultBg:new p.t(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var y=(0,g.I$)("Tag",e=>v(h(e)),w),k=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let x=n.forwardRef((e,t)=>{let{prefixCls:r,style:o,className:l,checked:i,children:c,icon:s,onChange:u,onClick:m}=e,p=k(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:f,tag:b}=n.useContext(d.E_),g=f("tag",r),[v,h,w]=y(g),x=a()(g,"".concat(g,"-checkable"),{["".concat(g,"-checkable-checked")]:i},null==b?void 0:b.className,l,h,w);return v(n.createElement("span",Object.assign({},p,{ref:t,style:Object.assign(Object.assign({},o),null==b?void 0:b.style),className:x,onClick:e=>{null==u||u(!i),null==m||m(e)}}),s,n.createElement("span",null,c)))});var C=r(18536);let E=e=>(0,C.Z)(e,(t,r)=>{let{textColor:n,lightBorderColor:o,lightColor:a,darkColor:l}=r;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:n,background:a,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:l,borderColor:l},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var O=(0,g.bk)(["Tag","preset"],e=>E(h(e)),w);let j=(e,t,r)=>{let n="string"!=typeof r?r:r.charAt(0).toUpperCase()+r.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:e["color".concat(r)],background:e["color".concat(n,"Bg")],borderColor:e["color".concat(n,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var S=(0,g.bk)(["Tag","status"],e=>{let t=h(e);return[j(t,"success","Success"),j(t,"processing","Info"),j(t,"error","Error"),j(t,"warning","Warning")]},w),N=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let Z=n.forwardRef((e,t)=>{let{prefixCls:r,className:o,rootClassName:m,style:p,children:f,icon:b,color:g,onClose:v,bordered:h=!0,visible:w}=e,k=N(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:x,direction:C,tag:E}=n.useContext(d.E_),[j,Z]=n.useState(!0),M=(0,l.Z)(k,["closeIcon","closable"]);n.useEffect(()=>{void 0!==w&&Z(w)},[w]);let P=(0,i.o2)(g),T=(0,i.yT)(g),L=P||T,z=Object.assign(Object.assign({backgroundColor:g&&!L?g:void 0},null==E?void 0:E.style),p),R=x("tag",r),[I,B,D]=y(R),q=a()(R,null==E?void 0:E.className,{["".concat(R,"-").concat(g)]:L,["".concat(R,"-has-color")]:g&&!L,["".concat(R,"-hidden")]:!j,["".concat(R,"-rtl")]:"rtl"===C,["".concat(R,"-borderless")]:!h},o,m,B,D),H=e=>{e.stopPropagation(),null==v||v(e),e.defaultPrevented||Z(!1)},[,F]=(0,c.b)((0,c.w)(e),(0,c.w)(E),{closable:!1,closeIconRender:e=>{let t=n.createElement("span",{className:"".concat(R,"-close-icon"),onClick:H},e);return(0,s.wm)(e,t,e=>({onClick:t=>{var r;null===(r=null==e?void 0:e.onClick)||void 0===r||r.call(e,t),H(t)},className:a()(null==e?void 0:e.className,"".concat(R,"-close-icon"))}))}}),W="function"==typeof k.onClick||f&&"a"===f.type,V=b||null,A=V?n.createElement(n.Fragment,null,V,f&&n.createElement("span",null,f)):f,_=n.createElement("span",Object.assign({},M,{ref:t,className:q,style:z}),A,F,P&&n.createElement(O,{key:"preset",prefixCls:R}),T&&n.createElement(S,{key:"status",prefixCls:R}));return I(W?n.createElement(u.Z,{component:"Tag"},_):_)});Z.CheckableTag=x;var M=Z},23910:function(e,t,r){var n=r(74288).Symbol;e.exports=n},54506:function(e,t,r){var n=r(23910),o=r(4479),a=r(80910),l=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?o(e):a(e)}},41087:function(e,t,r){var n=r(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},17071:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},4479:function(e,t,r){var n=r(23910),o=Object.prototype,a=o.hasOwnProperty,l=o.toString,i=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,i),r=e[i];try{e[i]=void 0;var n=!0}catch(e){}var o=l.call(e);return n&&(t?e[i]=r:delete e[i]),o}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,r){var n=r(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},5035:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},7310:function(e,t,r){var n=r(28302),o=r(11121),a=r(6660),l=Math.max,i=Math.min;e.exports=function(e,t,r){var c,s,u,d,m,p,f=0,b=!1,g=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){var r=c,n=s;return c=s=void 0,f=t,d=e.apply(n,r)}function w(e){var r=e-p,n=e-f;return void 0===p||r>=t||r<0||g&&n>=u}function y(){var e,r,n,a=o();if(w(a))return k(a);m=setTimeout(y,(e=a-p,r=a-f,n=t-e,g?i(n,u-r):n))}function k(e){return(m=void 0,v&&c)?h(e):(c=s=void 0,d)}function x(){var e,r=o(),n=w(r);if(c=arguments,s=this,p=r,n){if(void 0===m)return f=e=p,m=setTimeout(y,t),b?h(e):d;if(g)return clearTimeout(m),m=setTimeout(y,t),h(p)}return void 0===m&&(m=setTimeout(y,t)),d}return t=a(t)||0,n(r)&&(b=!!r.leading,u=(g="maxWait"in r)?l(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),x.cancel=function(){void 0!==m&&clearTimeout(m),f=0,c=p=s=m=void 0},x.flush=function(){return void 0===m?d:k(o())},x}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,r){var n=r(54506),o=r(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},11121:function(e,t,r){var n=r(74288);e.exports=function(){return n.Date.now()}},6660:function(e,t,r){var n=r(41087),o=r(28302),a=r(78371),l=0/0,i=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return l;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=c.test(e);return r||s.test(e)?u(e.slice(2),r?2:8):i.test(e)?l:+e}},30401:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("copy",[["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"}]])},87769:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},42208:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},32489:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},10900:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=o},91777:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});t.Z=o},86462:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});t.Z=o},47686:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});t.Z=o},44633:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=o},82182:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});t.Z=o},79814:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});t.Z=o},15731:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},45589:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))});t.Z=o},53410:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});t.Z=o},93416:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});t.Z=o},91126:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},77355:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},22452:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});t.Z=o},23628:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))});t.Z=o},25327:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});t.Z=o},49084:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=o},74998:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});t.Z=o},3497:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))});t.Z=o},91054:function(e,t,r){"use strict";let n,o;r.d(t,{pJ:function(){return T}});var a,l=r(71049),i=r(11323),c=r(2265),s=r(66797),u=r(93980),d=r(65573),m=r(67561),p=r(98218),f=r(33443),b=r(28294),g=r(31370),v=r(72468),h=r(5664),w=r(38929);let y=null!=(a=c.startTransition)?a:function(e){e()};var k=r(52724),x=((n=x||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),C=((o=C||{})[o.ToggleDisclosure=0]="ToggleDisclosure",o[o.CloseDisclosure=1]="CloseDisclosure",o[o.SetButtonId=2]="SetButtonId",o[o.SetPanelId=3]="SetPanelId",o[o.SetButtonElement=4]="SetButtonElement",o[o.SetPanelElement=5]="SetPanelElement",o);let E={0:e=>({...e,disclosureState:(0,v.E)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId},4:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},5:(e,t)=>e.panelElement===t.element?e:{...e,panelElement:t.element}},O=(0,c.createContext)(null);function j(e){let t=(0,c.useContext)(O);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,j),t}return t}O.displayName="DisclosureContext";let S=(0,c.createContext)(null);S.displayName="DisclosureAPIContext";let N=(0,c.createContext)(null);function Z(e,t){return(0,v.E)(t.type,E,e,t)}N.displayName="DisclosurePanelContext";let M=c.Fragment,P=w.VN.RenderStrategy|w.VN.Static,T=Object.assign((0,w.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,o=(0,c.useRef)(null),a=(0,m.T)(t,(0,m.h)(e=>{o.current=e},void 0===e.as||e.as===c.Fragment)),l=(0,c.useReducer)(Z,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:i,buttonId:s},d]=l,p=(0,u.z)(e=>{d({type:1});let t=(0,h.r)(o);if(!t||!s)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(s):t.getElementById(s);null==r||r.focus()}),g=(0,c.useMemo)(()=>({close:p}),[p]),y=(0,c.useMemo)(()=>({open:0===i,close:p}),[i,p]),k=(0,w.L6)();return c.createElement(O.Provider,{value:l},c.createElement(S.Provider,{value:g},c.createElement(f.Z,{value:p},c.createElement(b.up,{value:(0,v.E)(i,{0:b.ZM.Open,1:b.ZM.Closed})},k({ourProps:{ref:a},theirProps:n,slot:y,defaultTag:M,name:"Disclosure"})))))}),{Button:(0,w.yV)(function(e,t){let r=(0,c.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:o=!1,autoFocus:a=!1,...p}=e,[f,b]=j("Disclosure.Button"),v=(0,c.useContext)(N),h=null!==v&&v===f.panelId,y=(0,c.useRef)(null),x=(0,m.T)(y,t,(0,u.z)(e=>{if(!h)return b({type:4,element:e})}));(0,c.useEffect)(()=>{if(!h)return b({type:2,buttonId:n}),()=>{b({type:2,buttonId:null})}},[n,b,h]);let C=(0,u.z)(e=>{var t;if(h){if(1===f.disclosureState)return;switch(e.key){case k.R.Space:case k.R.Enter:e.preventDefault(),e.stopPropagation(),b({type:0}),null==(t=f.buttonElement)||t.focus()}}else switch(e.key){case k.R.Space:case k.R.Enter:e.preventDefault(),e.stopPropagation(),b({type:0})}}),E=(0,u.z)(e=>{e.key===k.R.Space&&e.preventDefault()}),O=(0,u.z)(e=>{var t;(0,g.P)(e.currentTarget)||o||(h?(b({type:0}),null==(t=f.buttonElement)||t.focus()):b({type:0}))}),{isFocusVisible:S,focusProps:Z}=(0,l.F)({autoFocus:a}),{isHovered:M,hoverProps:P}=(0,i.X)({isDisabled:o}),{pressed:T,pressProps:L}=(0,s.x)({disabled:o}),z=(0,c.useMemo)(()=>({open:0===f.disclosureState,hover:M,active:T,disabled:o,focus:S,autofocus:a}),[f,M,T,S,o,a]),R=(0,d.f)(e,f.buttonElement),I=h?(0,w.dG)({ref:x,type:R,disabled:o||void 0,autoFocus:a,onKeyDown:C,onClick:O},Z,P,L):(0,w.dG)({ref:x,id:n,type:R,"aria-expanded":0===f.disclosureState,"aria-controls":f.panelElement?f.panelId:void 0,disabled:o||void 0,autoFocus:a,onKeyDown:C,onKeyUp:E,onClick:O},Z,P,L);return(0,w.L6)()({ourProps:I,theirProps:p,slot:z,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,w.yV)(function(e,t){let r=(0,c.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:o=!1,...a}=e,[l,i]=j("Disclosure.Panel"),{close:s}=function e(t){let r=(0,c.useContext)(S);if(null===r){let r=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r}("Disclosure.Panel"),[d,f]=(0,c.useState)(null),g=(0,m.T)(t,(0,u.z)(e=>{y(()=>i({type:5,element:e}))}),f);(0,c.useEffect)(()=>(i({type:3,panelId:n}),()=>{i({type:3,panelId:null})}),[n,i]);let v=(0,b.oJ)(),[h,k]=(0,p.Y)(o,d,null!==v?(v&b.ZM.Open)===b.ZM.Open:0===l.disclosureState),x=(0,c.useMemo)(()=>({open:0===l.disclosureState,close:s}),[l.disclosureState,s]),C={ref:g,id:n,...(0,p.X)(k)},E=(0,w.L6)();return c.createElement(b.uu,null,c.createElement(N.Provider,{value:l.panelId},E({ourProps:C,theirProps:a,slot:x,defaultTag:"div",features:P,visible:h,name:"Disclosure.Panel"})))})})},85238:function(e,t,r){"use strict";let n;r.d(t,{u:function(){return N}});var o=r(2265),a=r(59456),l=r(93980),i=r(25289),c=r(73389),s=r(43507),u=r(180),d=r(67561),m=r(98218),p=r(28294),f=r(95504),b=r(72468),g=r(38929);function v(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:C)!==o.Fragment||1===o.Children.count(e.children)}let h=(0,o.createContext)(null);h.displayName="TransitionContext";var w=((n=w||{}).Visible="visible",n.Hidden="hidden",n);let y=(0,o.createContext)(null);function k(e){return"children"in e?k(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function x(e,t){let r=(0,s.E)(e),n=(0,o.useRef)([]),c=(0,i.t)(),u=(0,a.G)(),d=(0,l.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.l4.Hidden,o=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==o&&((0,b.E)(t,{[g.l4.Unmount](){n.current.splice(o,1)},[g.l4.Hidden](){n.current[o].state="hidden"}}),u.microTask(()=>{var e;!k(n)&&c.current&&(null==(e=r.current)||e.call(r))}))}),m=(0,l.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>d(e,g.l4.Unmount)}),p=(0,o.useRef)([]),f=(0,o.useRef)(Promise.resolve()),v=(0,o.useRef)({enter:[],leave:[]}),h=(0,l.z)((e,r,n)=>{p.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{p.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(v.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?f.current=f.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),w=(0,l.z)((e,t,r)=>{Promise.all(v.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=p.current.shift())||e()}).then(()=>r(t))});return(0,o.useMemo)(()=>({children:n,register:m,unregister:d,onStart:h,onStop:w,wait:f,chains:v}),[m,d,n,h,w,v,f])}y.displayName="NestingContext";let C=o.Fragment,E=g.VN.RenderStrategy,O=(0,g.yV)(function(e,t){let{show:r,appear:n=!1,unmount:a=!0,...i}=e,s=(0,o.useRef)(null),m=v(e),f=(0,d.T)(...m?[s,t]:null===t?[]:[t]);(0,u.H)();let b=(0,p.oJ)();if(void 0===r&&null!==b&&(r=(b&p.ZM.Open)===p.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[w,C]=(0,o.useState)(r?"visible":"hidden"),O=x(()=>{r||C("hidden")}),[S,N]=(0,o.useState)(!0),Z=(0,o.useRef)([r]);(0,c.e)(()=>{!1!==S&&Z.current[Z.current.length-1]!==r&&(Z.current.push(r),N(!1))},[Z,r]);let M=(0,o.useMemo)(()=>({show:r,appear:n,initial:S}),[r,n,S]);(0,c.e)(()=>{r?C("visible"):k(O)||null===s.current||C("hidden")},[r,O]);let P={unmount:a},T=(0,l.z)(()=>{var t;S&&N(!1),null==(t=e.beforeEnter)||t.call(e)}),L=(0,l.z)(()=>{var t;S&&N(!1),null==(t=e.beforeLeave)||t.call(e)}),z=(0,g.L6)();return o.createElement(y.Provider,{value:O},o.createElement(h.Provider,{value:M},z({ourProps:{...P,as:o.Fragment,children:o.createElement(j,{ref:f,...P,...i,beforeEnter:T,beforeLeave:L})},theirProps:{},defaultTag:o.Fragment,features:E,visible:"visible"===w,name:"Transition"})))}),j=(0,g.yV)(function(e,t){var r,n;let{transition:a=!0,beforeEnter:i,afterEnter:s,beforeLeave:w,afterLeave:O,enter:j,enterFrom:S,enterTo:N,entered:Z,leave:M,leaveFrom:P,leaveTo:T,...L}=e,[z,R]=(0,o.useState)(null),I=(0,o.useRef)(null),B=v(e),D=(0,d.T)(...B?[I,t,R]:null===t?[]:[t]),q=null==(r=L.unmount)||r?g.l4.Unmount:g.l4.Hidden,{show:H,appear:F,initial:W}=function(){let e=(0,o.useContext)(h);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[V,A]=(0,o.useState)(H?"visible":"hidden"),_=function(){let e=(0,o.useContext)(y);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:K,unregister:X}=_;(0,c.e)(()=>K(I),[K,I]),(0,c.e)(()=>{if(q===g.l4.Hidden&&I.current){if(H&&"visible"!==V){A("visible");return}return(0,b.E)(V,{hidden:()=>X(I),visible:()=>K(I)})}},[V,I,K,X,H,q]);let Y=(0,u.H)();(0,c.e)(()=>{if(B&&Y&&"visible"===V&&null===I.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,V,Y,B]);let U=W&&!F,G=F&&H&&W,$=(0,o.useRef)(!1),J=x(()=>{$.current||(A("hidden"),X(I))},_),Q=(0,l.z)(e=>{$.current=!0,J.onStart(I,e?"enter":"leave",e=>{"enter"===e?null==i||i():"leave"===e&&(null==w||w())})}),ee=(0,l.z)(e=>{let t=e?"enter":"leave";$.current=!1,J.onStop(I,t,e=>{"enter"===e?null==s||s():"leave"===e&&(null==O||O())}),"leave"!==t||k(J)||(A("hidden"),X(I))});(0,o.useEffect)(()=>{B&&a||(Q(H),ee(H))},[H,B,a]);let et=!(!a||!B||!Y||U),[,er]=(0,m.Y)(et,z,H,{start:Q,end:ee}),en=(0,g.oA)({ref:D,className:(null==(n=(0,f.A)(L.className,G&&j,G&&S,er.enter&&j,er.enter&&er.closed&&S,er.enter&&!er.closed&&N,er.leave&&M,er.leave&&!er.closed&&P,er.leave&&er.closed&&T,!er.transition&&H&&Z))?void 0:n.trim())||void 0,...(0,m.X)(er)}),eo=0;"visible"===V&&(eo|=p.ZM.Open),"hidden"===V&&(eo|=p.ZM.Closed),er.enter&&(eo|=p.ZM.Opening),er.leave&&(eo|=p.ZM.Closing);let ea=(0,g.L6)();return o.createElement(y.Provider,{value:J},o.createElement(p.up,{value:eo},ea({ourProps:en,theirProps:L,defaultTag:C,features:E,visible:"visible"===V,name:"Transition.Child"})))}),S=(0,g.yV)(function(e,t){let r=null!==(0,o.useContext)(h),n=null!==(0,p.oJ)();return o.createElement(o.Fragment,null,!r&&n?o.createElement(O,{ref:t,...e}):o.createElement(j,{ref:t,...e}))}),N=Object.assign(O,{Child:S,Root:O})},33443:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2265);let o=(0,n.createContext)(()=>{});function a(e){let{value:t,children:r}=e;return n.createElement(o.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1994-a4d0b99849c16b62.js b/litellm/proxy/_experimental/out/_next/static/chunks/1994-a4d0b99849c16b62.js deleted file mode 100644 index 3211472683d..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1994-a4d0b99849c16b62.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1994],{61994:function(e,n,t){t.d(n,{Z:function(){return O}});var o=t(2265),a=t(36760),r=t.n(a),c=t(20873),l=t(28791),i=t(6694),s=t(34709),u=t(71744),d=t(86586),b=t(64024),p=t(39109);let f=o.createContext(null);var v=t(23159),m=t(66531),h=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>n.indexOf(o)&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);an.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t};let g=o.forwardRef((e,n)=>{var t;let{prefixCls:a,className:g,rootClassName:C,children:y,indeterminate:k=!1,style:x,onMouseEnter:O,onMouseLeave:E,skipGroup:S=!1,disabled:w}=e,Z=h(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:P,direction:N,checkbox:j}=o.useContext(u.E_),I=o.useContext(f),{isFormItemInput:R}=o.useContext(p.aM),z=o.useContext(d.Z),B=null!==(t=(null==I?void 0:I.disabled)||w)&&void 0!==t?t:z,D=o.useRef(Z.value),M=o.useRef(null),_=(0,l.sQ)(n,M);o.useEffect(()=>{null==I||I.registerValue(Z.value)},[]),o.useEffect(()=>{if(!S)return Z.value!==D.current&&(null==I||I.cancelValue(D.current),null==I||I.registerValue(Z.value),D.current=Z.value),()=>null==I?void 0:I.cancelValue(Z.value)},[Z.value]),o.useEffect(()=>{var e;(null===(e=M.current)||void 0===e?void 0:e.input)&&(M.current.input.indeterminate=k)},[k]);let W=P("checkbox",a),q=(0,b.Z)(W),[H,T,G]=(0,v.ZP)(W,q),V=Object.assign({},Z);I&&!S&&(V.onChange=function(){for(var e=arguments.length,n=Array(e),t=0;tn.indexOf(o)&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,o=Object.getOwnPropertySymbols(e);an.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]]);return t};let x=o.forwardRef((e,n)=>{let{defaultValue:t,children:a,options:c=[],prefixCls:l,className:i,rootClassName:s,style:d,onChange:p}=e,m=k(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:h,direction:x}=o.useContext(u.E_),[O,E]=o.useState(m.value||t||[]),[S,w]=o.useState([]);o.useEffect(()=>{"value"in m&&E(m.value||[])},[m.value]);let Z=o.useMemo(()=>c.map(e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e),[c]),P=e=>{w(n=>n.filter(n=>n!==e))},N=e=>{w(n=>[].concat((0,C.Z)(n),[e]))},j=e=>{let n=O.indexOf(e.value),t=(0,C.Z)(O);-1===n?t.push(e.value):t.splice(n,1),"value"in m||E(t),null==p||p(t.filter(e=>S.includes(e)).sort((e,n)=>Z.findIndex(n=>n.value===e)-Z.findIndex(e=>e.value===n)))},I=h("checkbox",l),R="".concat(I,"-group"),z=(0,b.Z)(I),[B,D,M]=(0,v.ZP)(I,z),_=(0,y.Z)(m,["value","disabled"]),W=c.length?Z.map(e=>o.createElement(g,{prefixCls:I,key:e.value.toString(),disabled:"disabled"in e?e.disabled:m.disabled,value:e.value,checked:O.includes(e.value),onChange:e.onChange,className:r()("".concat(R,"-item"),e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):a,q=o.useMemo(()=>({toggleOption:j,value:O,disabled:m.disabled,name:m.name,registerValue:N,cancelValue:P}),[j,O,m.disabled,m.name,N,P]),H=r()(R,{["".concat(R,"-rtl")]:"rtl"===x},i,s,M,z,D);return B(o.createElement("div",Object.assign({className:H,style:d},_,{ref:n}),o.createElement(f.Provider,{value:q},W)))});g.Group=x,g.__ANT_CHECKBOX=!0;var O=g},23159:function(e,n,t){t.d(n,{C2:function(){return i}});var o=t(93463),a=t(12918),r=t(71140),c=t(99320);let l=e=>{let{checkboxCls:n}=e,t="".concat(n,"-wrapper");return[{["".concat(n,"-group")]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,["> ".concat(e.antCls,"-row")]:{flex:1}}),[t]:Object.assign(Object.assign({},(0,a.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},["& + ".concat(t)]:{marginInlineStart:0},["&".concat(t,"-in-form-item")]:{'input[type="checkbox"]':{width:14,height:14}}}),[n]:Object.assign(Object.assign({},(0,a.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",["".concat(n,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,["&:focus-visible + ".concat(n,"-inner")]:(0,a.oN)(e)},["".concat(n,"-inner")]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:"".concat((0,o.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:"all ".concat(e.motionDurationSlow),"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:"".concat((0,o.bf)(e.lineWidthBold)," solid ").concat(e.colorWhite),borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:"all ".concat(e.motionDurationFast," ").concat(e.motionEaseInBack,", opacity ").concat(e.motionDurationFast)}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{["\n ".concat(t,":not(").concat(t,"-disabled),\n ").concat(n,":not(").concat(n,"-disabled)\n ")]:{["&:hover ".concat(n,"-inner")]:{borderColor:e.colorPrimary}},["".concat(t,":not(").concat(t,"-disabled)")]:{["&:hover ".concat(n,"-checked:not(").concat(n,"-disabled) ").concat(n,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},["&:hover ".concat(n,"-checked:not(").concat(n,"-disabled):after")]:{borderColor:e.colorPrimaryHover}}},{["".concat(n,"-checked")]:{["".concat(n,"-inner")]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack," ").concat(e.motionDurationFast)}}},["\n ".concat(t,"-checked:not(").concat(t,"-disabled),\n ").concat(n,"-checked:not(").concat(n,"-disabled)\n ")]:{["&:hover ".concat(n,"-inner")]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[n]:{"&-indeterminate":{"&":{["".concat(n,"-inner")]:{backgroundColor:"".concat(e.colorBgContainer),borderColor:"".concat(e.colorBorder),"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},["&:hover ".concat(n,"-inner")]:{backgroundColor:"".concat(e.colorBgContainer),borderColor:"".concat(e.colorPrimary)}}}}},{["".concat(t,"-disabled")]:{cursor:"not-allowed"},["".concat(n,"-disabled")]:{["&, ".concat(n,"-input")]:{cursor:"not-allowed",pointerEvents:"none"},["".concat(n,"-inner")]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},["&".concat(n,"-indeterminate ").concat(n,"-inner::after")]:{background:e.colorTextDisabled}}}]};function i(e,n){return l((0,r.IX)(n,{checkboxCls:".".concat(e),checkboxSize:n.controlInteractiveSize}))}n.ZP=(0,c.I$)("Checkbox",(e,n)=>{let{prefixCls:t}=n;return[i(t,e)]})},66531:function(e,n,t){t.d(n,{Z:function(){return r}});var o=t(2265),a=t(53346);function r(e){let n=o.useRef(null),t=()=>{a.Z.cancel(n.current),n.current=null};return[()=>{t(),n.current=(0,a.Z)(()=>{n.current=null})},o=>{n.current&&(o.stopPropagation(),t()),null==e||e(o)}]}},20873:function(e,n,t){var o=t(1119),a=t(31686),r=t(11993),c=t(26365),l=t(6989),i=t(36760),s=t.n(i),u=t(50506),d=t(2265),b=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],p=(0,d.forwardRef)(function(e,n){var t=e.prefixCls,i=void 0===t?"rc-checkbox":t,p=e.className,f=e.style,v=e.checked,m=e.disabled,h=e.defaultChecked,g=e.type,C=void 0===g?"checkbox":g,y=e.title,k=e.onChange,x=(0,l.Z)(e,b),O=(0,d.useRef)(null),E=(0,d.useRef)(null),S=(0,u.Z)(void 0!==h&&h,{value:v}),w=(0,c.Z)(S,2),Z=w[0],P=w[1];(0,d.useImperativeHandle)(n,function(){return{focus:function(e){var n;null===(n=O.current)||void 0===n||n.focus(e)},blur:function(){var e;null===(e=O.current)||void 0===e||e.blur()},input:O.current,nativeElement:E.current}});var N=s()(i,p,(0,r.Z)((0,r.Z)({},"".concat(i,"-checked"),Z),"".concat(i,"-disabled"),m));return d.createElement("span",{className:N,title:y,style:f,ref:E},d.createElement("input",(0,o.Z)({},x,{className:"".concat(i,"-input"),ref:O,onChange:function(n){m||("checked"in e||P(n.target.checked),null==k||k({target:(0,a.Z)((0,a.Z)({},e),{},{type:C,checked:n.target.checked}),stopPropagation:function(){n.stopPropagation()},preventDefault:function(){n.preventDefault()},nativeEvent:n.nativeEvent}))},disabled:m,checked:!!Z,type:C})),d.createElement("span",{className:"".concat(i,"-inner")}))});n.Z=p}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2117-bb4323b3c0b11a1f.js b/litellm/proxy/_experimental/out/_next/static/chunks/2117-bb4323b3c0b11a1f.js deleted file mode 100644 index fae288cfede..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2117-bb4323b3c0b11a1f.js +++ /dev/null @@ -1,2 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2117],{65157:function(e,t){"use strict";function n(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return n}})},91572:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}),"canParse"in URL||(URL.canParse=function(e,t){try{return new URL(e,t),!0}catch(e){return!1}})},1634:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return u}});let r=n(68498),o=n(33068);function u(e,t){return(0,o.normalizePathTrailingSlash)((0,r.addPathPrefix)(e,""))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75266:function(e,t){"use strict";function n(e){var t,n;t=self.__next_s,n=()=>{e()},t&&t.length?t.reduce((e,t)=>{let[n,r]=t;return e.then(()=>new Promise((e,t)=>{let o=document.createElement("script");if(r)for(let e in r)"children"!==e&&o.setAttribute(e,r[e]);n?(o.src=n,o.onload=()=>e(),o.onerror=t):r&&(o.innerHTML=r.children,setTimeout(e)),document.head.appendChild(o)}))},Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{n()}):n()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appBootstrap",{enumerable:!0,get:function(){return n}}),window.next={version:"14.2.33",appDir:!0},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83079:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return o}});let r=n(12846);async function o(e,t){let n=(0,r.getServerActionDispatcher)();if(!n)throw Error("Invariant: missing action dispatcher.");return new Promise((r,o)=>{n({actionId:e,actionArgs:t,resolve:r,reject:o})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},92304:function(e,t,n){"use strict";let r,o;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return x}});let u=n(47043),l=n(53099),a=n(57437);n(91572);let i=u._(n(34040)),c=l._(n(2265)),s=n(6671),f=n(48701),d=u._(n(61404)),p=n(83079),h=n(89721),y=n(2103);n(70647);let _=window.console.error;window.console.error=function(){for(var e=arguments.length,t=Array(e),n=0;n{if((0,h.isNextRouterError)(e.error)){e.preventDefault();return}});let v=document,b=new TextEncoder,g=!1,m=!1,R=null;function P(e){if(0===e[0])r=[];else if(1===e[0]){if(!r)throw Error("Unexpected server data: missing bootstrap script.");o?o.enqueue(b.encode(e[1])):r.push(e[1])}else 2===e[0]&&(R=e[1])}let j=function(){o&&!m&&(o.close(),m=!0,r=void 0),g=!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",j,!1):j();let O=self.__next_f=self.__next_f||[];O.forEach(P),O.push=P;let E=new ReadableStream({start(e){r&&(r.forEach(t=>{e.enqueue(b.encode(t))}),g&&!m&&(e.close(),m=!0,r=void 0)),o=e}}),S=(0,s.createFromReadableStream)(E,{callServer:p.callServer});function w(){return(0,c.use)(S)}let M=c.default.StrictMode;function T(e){let{children:t}=e;return t}function x(){let e=(0,y.createMutableActionQueue)(),t=(0,a.jsx)(M,{children:(0,a.jsx)(f.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,a.jsx)(y.ActionQueueContext.Provider,{value:e,children:(0,a.jsx)(T,{children:(0,a.jsx)(w,{})})})})}),n=window.__next_root_layout_missing_tags,r=!!(null==n?void 0:n.length),o={onRecoverableError:d.default};"__next_error__"===document.documentElement.id||r?i.default.createRoot(v,o).render(t):c.default.startTransition(()=>i.default.hydrateRoot(v,t,{...o,formState:R}))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54278:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(19506),(0,n(75266).appBootstrap)(()=>{let{hydrate:e}=n(92304);n(12846),n(4707),e()}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19506:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(65157);{let e=n.u;n.u=function(){for(var t=arguments.length,n=Array(t),r=0;r(l(function(){var e;let t=document.getElementsByName(u)[0];if(null==t?void 0:null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(u);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(u)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[a,i]=(0,r.useState)(""),c=(0,r.useRef)();return(0,r.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==c.current&&c.current!==e&&i(e),c.current=e},[t]),n?(0,o.createPortal)(a,n):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6866:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION:function(){return r},FLIGHT_PARAMETERS:function(){return i},NEXT_DID_POSTPONE_HEADER:function(){return s},NEXT_ROUTER_PREFETCH_HEADER:function(){return u},NEXT_ROUTER_STATE_TREE:function(){return o},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return a},RSC_HEADER:function(){return n}});let n="RSC",r="Next-Action",o="Next-Router-State-Tree",u="Next-Router-Prefetch",l="Next-Url",a="text/x-component",i=[[n],[o],[u]],c="_rsc",s="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12846:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createEmptyCacheNode:function(){return C},default:function(){return I},getServerActionDispatcher:function(){return S},urlToUrlWithoutFlightMarker:function(){return M}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(61956),a=n(24673),i=n(33456),c=n(79060),s=n(47744),f=n(61060),d=n(82952),p=n(86146),h=n(1634),y=n(6495),_=n(4123),v=n(39320),b=n(38137),g=n(6866),m=n(35076),R=n(11283),P=n(84541),j="undefined"==typeof window,O=j?null:new Map,E=null;function S(){return E}let w={};function M(e){let t=new URL(e,location.origin);if(t.searchParams.delete(g.NEXT_RSC_UNION_QUERY),t.pathname.endsWith(".txt")){let{pathname:e}=t,n=e.endsWith("/index.txt")?10:4;t.pathname=e.slice(0,-n)}return t}function T(e){return e.origin!==window.location.origin}function x(e){let{appRouterState:t,sync:n}=e;return(0,u.useInsertionEffect)(()=>{let{tree:e,pushRef:r,canonicalUrl:o}=t,u={...r.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};r.pendingPush&&(0,i.createHrefFromUrl)(new URL(window.location.href))!==o?(r.pendingPush=!1,window.history.pushState(u,"",o)):window.history.replaceState(u,"",o),n(t)},[t,n]),null}function C(){return{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null}}function A(e){null==e&&(e={});let t=window.history.state,n=null==t?void 0:t.__NA;n&&(e.__NA=n);let r=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return r&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=r),e}function N(e){let{headCacheNode:t}=e,n=null!==t?t.head:null,r=null!==t?t.prefetchHead:null,o=null!==r?r:n;return(0,u.useDeferredValue)(n,o)}function D(e){let t,{buildId:n,initialHead:r,initialTree:i,urlParts:f,initialSeedData:g,couldBeIntercepted:S,assetPrefix:M,missingSlots:C}=e,D=(0,u.useMemo)(()=>(0,d.createInitialRouterState)({buildId:n,initialSeedData:g,urlParts:f,initialTree:i,initialParallelRoutes:O,location:j?null:window.location,initialHead:r,couldBeIntercepted:S}),[n,g,f,i,r,S]),[I,U,k]=(0,s.useReducerWithReduxDevtools)(D);(0,u.useEffect)(()=>{O=null},[]);let{canonicalUrl:F}=(0,s.useUnwrapState)(I),{searchParams:L,pathname:H}=(0,u.useMemo)(()=>{let e=new URL(F,"undefined"==typeof window?"http://n":window.location.href);return{searchParams:e.searchParams,pathname:(0,R.hasBasePath)(e.pathname)?(0,m.removeBasePath)(e.pathname):e.pathname}},[F]),G=(0,u.useCallback)(e=>{let{previousTree:t,serverResponse:n}=e;(0,u.startTransition)(()=>{U({type:a.ACTION_SERVER_PATCH,previousTree:t,serverResponse:n})})},[U]),$=(0,u.useCallback)((e,t,n)=>{let r=new URL((0,h.addBasePath)(e),location.href);return U({type:a.ACTION_NAVIGATE,url:r,isExternalUrl:T(r),locationSearch:location.search,shouldScroll:null==n||n,navigateType:t})},[U]);E=(0,u.useCallback)(e=>{(0,u.startTransition)(()=>{U({...e,type:a.ACTION_SERVER_ACTION})})},[U]);let z=(0,u.useMemo)(()=>({back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{let n;if(!(0,p.isBot)(window.navigator.userAgent)){try{n=new URL((0,h.addBasePath)(e),window.location.href)}catch(t){throw Error("Cannot prefetch '"+e+"' because it cannot be converted to a URL.")}T(n)||(0,u.startTransition)(()=>{var e;U({type:a.ACTION_PREFETCH,url:n,kind:null!=(e=null==t?void 0:t.kind)?e:a.PrefetchKind.FULL})})}},replace:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;$(e,"replace",null==(n=t.scroll)||n)})},push:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;$(e,"push",null==(n=t.scroll)||n)})},refresh:()=>{(0,u.startTransition)(()=>{U({type:a.ACTION_REFRESH,origin:window.location.origin})})},fastRefresh:()=>{throw Error("fastRefresh can only be used in development mode. Please use refresh instead.")}}),[U,$]);(0,u.useEffect)(()=>{window.next&&(window.next.router=z)},[z]),(0,u.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&(w.pendingMpaPath=void 0,U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[U]);let{pushRef:B}=(0,s.useUnwrapState)(I);if(B.mpaNavigation){if(w.pendingMpaPath!==F){let e=window.location;B.pendingPush?e.assign(F):e.replace(F),w.pendingMpaPath=F}(0,u.use)(b.unresolvedThenable)}(0,u.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),n=e=>{var t;let n=window.location.href,r=null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(null!=e?e:n,n),tree:r})})};window.history.pushState=function(t,r,o){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=A(t),o&&n(o)),e(t,r,o)},window.history.replaceState=function(e,r,o){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=A(e),o&&n(o)),t(e,r,o)};let r=e=>{let{state:t}=e;if(t){if(!t.__NA){window.location.reload();return}(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:t.__PRIVATE_NEXTJS_INTERNALS_TREE})})}};return window.addEventListener("popstate",r),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",r)}},[U]);let{cache:W,tree:K,nextUrl:V,focusAndScrollRef:Y}=(0,s.useUnwrapState)(I),X=(0,u.useMemo)(()=>(0,v.findHeadInCache)(W,K[1]),[W,K]),q=(0,u.useMemo)(()=>(function e(t,n){for(let r of(void 0===n&&(n={}),Object.values(t[1]))){let t=r[0],o=Array.isArray(t),u=o?t[1]:t;!u||u.startsWith(P.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?n[t[0]]=t[1].split("/"):o&&(n[t[0]]=t[1]),n=e(r,n))}return n})(K),[K]);if(null!==X){let[e,n]=X;t=(0,o.jsx)(N,{headCacheNode:e},n)}else t=null;let J=(0,o.jsxs)(_.RedirectBoundary,{children:[t,W.rsc,(0,o.jsx)(y.AppRouterAnnouncer,{tree:K})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x,{appRouterState:(0,s.useUnwrapState)(I),sync:k}),(0,o.jsx)(c.PathParamsContext.Provider,{value:q,children:(0,o.jsx)(c.PathnameContext.Provider,{value:H,children:(0,o.jsx)(c.SearchParamsContext.Provider,{value:L,children:(0,o.jsx)(l.GlobalLayoutRouterContext.Provider,{value:{buildId:n,changeByServerResponse:G,tree:K,focusAndScrollRef:Y,nextUrl:V},children:(0,o.jsx)(l.AppRouterContext.Provider,{value:z,children:(0,o.jsx)(l.LayoutRouterContext.Provider,{value:{childNodes:W.parallelRoutes,tree:K,url:F,loading:W.loading},children:J})})})})})})]})}function I(e){let{globalErrorComponent:t,...n}=e;return(0,o.jsx)(f.ErrorBoundary,{errorComponent:t,children:(0,o.jsx)(D,{...n})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bailoutToClientRendering",{enumerable:!0,get:function(){return u}});let r=n(18993),o=n(51845);function u(e){let t=o.staticGenerationAsyncStorage.getStore();if((null==t||!t.forceStatic)&&(null==t?void 0:t.isStaticGeneration))throw new r.BailoutToCSRError(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19107:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientPageRoot",{enumerable:!0,get:function(){return u}});let r=n(57437),o=n(54535);function u(e){let{Component:t,props:n}=e;return n.searchParams=(0,o.createDynamicallyTrackedSearchParams)(n.searchParams||{}),(0,r.jsx)(t,{...n})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ErrorBoundary:function(){return h},ErrorBoundaryHandler:function(){return f},GlobalError:function(){return d},default:function(){return p}});let r=n(47043),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(89721),i=n(51845),c={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}};function s(e){let{error:t}=e,n=i.staticGenerationAsyncStorage.getStore();if((null==n?void 0:n.isRevalidate)||(null==n?void 0:n.isStaticGeneration))throw console.error(t),t;return null}class f extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,o.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function d(e){let{error:t}=e,n=null==t?void 0:t.digest;return(0,o.jsxs)("html",{id:"__next_error__",children:[(0,o.jsx)("head",{}),(0,o.jsxs)("body",{children:[(0,o.jsx)(s,{error:t}),(0,o.jsx)("div",{style:c.error,children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{style:c.text,children:"Application error: a "+(n?"server":"client")+"-side exception has occurred (see the "+(n?"server logs":"browser console")+" for more information)."}),n?(0,o.jsx)("p",{style:c.text,children:"Digest: "+n}):null]})})]})]})}let p=d;function h(e){let{errorComponent:t,errorStyles:n,errorScripts:r,children:u}=e,a=(0,l.usePathname)();return t?(0,o.jsx)(f,{pathname:a,errorComponent:t,errorStyles:n,errorScripts:r,children:u}):(0,o.jsx)(o.Fragment,{children:u})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},46177:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DynamicServerError:function(){return r},isDynamicServerError:function(){return o}});let n="DYNAMIC_SERVER_USAGE";class r extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},89721:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return u}});let r=n(98200),o=n(88968);function u(e){return e&&e.digest&&((0,o.isRedirectError)(e)||(0,r.isNotFoundError)(e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4707:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return E}});let r=n(47043),o=n(53099),u=n(57437),l=o._(n(2265)),a=r._(n(54887)),i=n(61956),c=n(44848),s=n(38137),f=n(61060),d=n(76015),p=n(7092),h=n(4123),y=n(80),_=n(73171),v=n(78505),b=n(28077),g=["bottom","height","left","right","top","width","x","y"];function m(e,t){let n=e.getBoundingClientRect();return n.top>=0&&n.top<=t}class R extends l.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){var n;if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,n)=>(0,d.matchSegment)(t,e[n]))))return;let r=null,o=e.hashFragment;if(o&&(r="top"===o?document.body:null!=(n=document.getElementById(o))?n:document.getElementsByName(o)[0]),r||(r="undefined"==typeof window?null:a.default.findDOMNode(this)),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return g.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,p.handleSmoothScroll)(()=>{if(o){r.scrollIntoView();return}let e=document.documentElement,t=e.clientHeight;!m(r,t)&&(e.scrollTop=0,m(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function P(e){let{segmentPath:t,children:n}=e,r=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,u.jsx)(R,{segmentPath:t,focusAndScrollRef:r.focusAndScrollRef,children:n})}function j(e){let{parallelRouterKey:t,url:n,childNodes:r,segmentPath:o,tree:a,cacheKey:f}=e,p=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!p)throw Error("invariant global layout router not mounted");let{buildId:h,changeByServerResponse:y,tree:_}=p,v=r.get(f);if(void 0===v){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};v=e,r.set(f,e)}let g=null!==v.prefetchRsc?v.prefetchRsc:v.rsc,m=(0,l.useDeferredValue)(v.rsc,g),R="object"==typeof m&&null!==m&&"function"==typeof m.then?(0,l.use)(m):m;if(!R){let e=v.lazyData;if(null===e){let t=function e(t,n){if(t){let[r,o]=t,u=2===t.length;if((0,d.matchSegment)(n[0],r)&&n[1].hasOwnProperty(o)){if(u){let t=e(void 0,n[1][o]);return[n[0],{...n[1],[o]:[t[0],t[1],t[2],"refetch"]}]}return[n[0],{...n[1],[o]:e(t.slice(2),n[1][o])}]}}return n}(["",...o],_),r=(0,b.hasInterceptionRouteInCurrentTree)(_);v.lazyData=e=(0,c.fetchServerResponse)(new URL(n,location.origin),t,r?p.nextUrl:null,h),v.lazyDataResolved=!1}let t=(0,l.use)(e);v.lazyDataResolved||(setTimeout(()=>{(0,l.startTransition)(()=>{y({previousTree:_,serverResponse:t})})}),v.lazyDataResolved=!0),(0,l.use)(s.unresolvedThenable)}return(0,u.jsx)(i.LayoutRouterContext.Provider,{value:{tree:a[1][t],childNodes:v.parallelRoutes,url:n,loading:v.loading},children:R})}function O(e){let{children:t,hasLoading:n,loading:r,loadingStyles:o,loadingScripts:a}=e;return n?(0,u.jsx)(l.Suspense,{fallback:(0,u.jsxs)(u.Fragment,{children:[o,a,r]}),children:t}):(0,u.jsx)(u.Fragment,{children:t})}function E(e){let{parallelRouterKey:t,segmentPath:n,error:r,errorStyles:o,errorScripts:a,templateStyles:c,templateScripts:s,template:d,notFound:p,notFoundStyles:b}=e,g=(0,l.useContext)(i.LayoutRouterContext);if(!g)throw Error("invariant expected layout router to be mounted");let{childNodes:m,tree:R,url:E,loading:S}=g,w=m.get(t);w||(w=new Map,m.set(t,w));let M=R[1][t][0],T=(0,_.getSegmentValue)(M),x=[M];return(0,u.jsx)(u.Fragment,{children:x.map(e=>{let l=(0,_.getSegmentValue)(e),g=(0,v.createRouterCacheKey)(e);return(0,u.jsxs)(i.TemplateContext.Provider,{value:(0,u.jsx)(P,{segmentPath:n,children:(0,u.jsx)(f.ErrorBoundary,{errorComponent:r,errorStyles:o,errorScripts:a,children:(0,u.jsx)(O,{hasLoading:!!S,loading:null==S?void 0:S[0],loadingStyles:null==S?void 0:S[1],loadingScripts:null==S?void 0:S[2],children:(0,u.jsx)(y.NotFoundBoundary,{notFound:p,notFoundStyles:b,children:(0,u.jsx)(h.RedirectBoundary,{children:(0,u.jsx)(j,{parallelRouterKey:t,url:E,tree:R,childNodes:w,segmentPath:n,cacheKey:g,isActive:T===l})})})})})}),children:[c,s,d]},(0,v.createRouterCacheKey)(e,!0))})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76015:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{canSegmentBeOverridden:function(){return u},matchSegment:function(){return o}});let r=n(87417),o=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1],u=(e,t)=>{var n;return!Array.isArray(e)&&!!Array.isArray(t)&&(null==(n=(0,r.getSegmentParam)(e))?void 0:n.param)===t[0]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35475:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return i.RedirectType},ServerInsertedHTMLContext:function(){return c.ServerInsertedHTMLContext},notFound:function(){return i.notFound},permanentRedirect:function(){return i.permanentRedirect},redirect:function(){return i.redirect},useParams:function(){return p},usePathname:function(){return f},useRouter:function(){return d},useSearchParams:function(){return s},useSelectedLayoutSegment:function(){return y},useSelectedLayoutSegments:function(){return h},useServerInsertedHTML:function(){return c.useServerInsertedHTML}});let r=n(2265),o=n(61956),u=n(79060),l=n(73171),a=n(84541),i=n(52646),c=n(55501);function s(){let e=(0,r.useContext)(u.SearchParamsContext),t=(0,r.useMemo)(()=>e?new i.ReadonlyURLSearchParams(e):null,[e]);if("undefined"==typeof window){let{bailoutToClientRendering:e}=n(96149);e("useSearchParams()")}return t}function f(){return(0,r.useContext)(u.PathnameContext)}function d(){let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function p(){return(0,r.useContext)(u.PathParamsContext)}function h(e){void 0===e&&(e="children");let t=(0,r.useContext)(o.LayoutRouterContext);return t?function e(t,n,r,o){let u;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)u=t[1][n];else{var i;let e=t[1];u=null!=(i=e.children)?i:Object.values(e)[0]}if(!u)return o;let c=u[0],s=(0,l.getSegmentValue)(c);return!s||s.startsWith(a.PAGE_SEGMENT_KEY)?o:(o.push(s),e(u,n,!1,o))}(t.tree,e):null}function y(e){void 0===e&&(e="children");let t=h(e);if(!t||0===t.length)return null;let n="children"===e?t[0]:t[t.length-1];return n===a.DEFAULT_SEGMENT_KEY?null:n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return l},RedirectType:function(){return r.RedirectType},notFound:function(){return o.notFound},permanentRedirect:function(){return r.permanentRedirect},redirect:function(){return r.redirect}});let r=n(88968),o=n(98200);class u extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class l extends URLSearchParams{append(){throw new u}delete(){throw new u}set(){throw new u}sort(){throw new u}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NotFoundBoundary",{enumerable:!0,get:function(){return s}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(98200);n(31765);let i=n(61956);class c extends u.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,a.isNotFoundError)(e))return{notFoundTriggered:!0};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.notFoundTriggered?{notFoundTriggered:!1,previousPathname:e.pathname}:{notFoundTriggered:t.notFoundTriggered,previousPathname:e.pathname}}render(){return this.state.notFoundTriggered?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("meta",{name:"robots",content:"noindex"}),!1,this.props.notFoundStyles,this.props.notFound]}):this.props.children}constructor(e){super(e),this.state={notFoundTriggered:!!e.asNotFound,previousPathname:e.pathname}}}function s(e){let{notFound:t,notFoundStyles:n,asNotFound:r,children:a}=e,s=(0,l.usePathname)(),f=(0,u.useContext)(i.MissingSlotContext);return t?(0,o.jsx)(c,{pathname:s,notFound:t,notFoundStyles:n,asNotFound:r,missingSlots:f,children:a}):(0,o.jsx)(o.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98200:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isNotFoundError:function(){return o},notFound:function(){return r}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},29744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return c}});let r=n(2522),o=n(90675);var u=o._("_maxConcurrency"),l=o._("_runningCount"),a=o._("_queue"),i=o._("_processNext");class c{enqueue(e){let t,n;let o=new Promise((e,r)=>{t=e,n=r}),u=async()=>{try{r._(this,l)[l]++;let n=await e();t(n)}catch(e){n(e)}finally{r._(this,l)[l]--,r._(this,i)[i]()}};return r._(this,a)[a].push({promiseFn:o,task:u}),r._(this,i)[i](),o}bump(e){let t=r._(this,a)[a].findIndex(t=>t.promiseFn===e);if(t>-1){let e=r._(this,a)[a].splice(t,1)[0];r._(this,a)[a].unshift(e),r._(this,i)[i](!0)}}constructor(e=5){Object.defineProperty(this,i,{value:s}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),r._(this,u)[u]=e,r._(this,l)[l]=0,r._(this,a)[a]=[]}}function s(e){if(void 0===e&&(e=!1),(r._(this,l)[l]0){var t;null==(t=r._(this,a)[a].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4123:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectBoundary:function(){return s},RedirectErrorBoundary:function(){return c}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(35475),a=n(88968);function i(e){let{redirect:t,reset:n,redirectType:r}=e,o=(0,l.useRouter)();return(0,u.useEffect)(()=>{u.default.startTransition(()=>{r===a.RedirectType.push?o.push(t,{}):o.replace(t,{}),n()})},[t,r,n,o]),null}class c extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isRedirectError)(e))return{redirect:(0,a.getURLFromRedirectError)(e),redirectType:(0,a.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,o.jsx)(i,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function s(e){let{children:t}=e,n=(0,l.useRouter)();return(0,o.jsx)(c,{router:n,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5001:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return n}}),(r=n||(n={}))[r.SeeOther=303]="SeeOther",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},88968:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return c},getRedirectStatusCodeFromError:function(){return y},getRedirectTypeFromError:function(){return h},getURLFromRedirectError:function(){return p},isRedirectError:function(){return d},permanentRedirect:function(){return f},redirect:function(){return s}});let u=n(20544),l=n(90295),a=n(5001),i="NEXT_REDIRECT";function c(e,t,n){void 0===n&&(n=a.RedirectStatusCode.TemporaryRedirect);let r=Error(i);r.digest=i+";"+t+";"+e+";"+n+";";let o=u.requestAsyncStorage.getStore();return o&&(r.mutableCookies=o.mutableCookies),r}function s(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.TemporaryRedirect)}function f(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.PermanentRedirect)}function d(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,n,r,o]=e.digest.split(";",4),u=Number(o);return t===i&&("replace"===n||"push"===n)&&"string"==typeof r&&!isNaN(u)&&u in a.RedirectStatusCode}function p(e){return d(e)?e.digest.split(";",3)[2]:null}function h(e){if(!d(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function y(e){if(!d(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36423:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(53099),o=n(57437),u=r._(n(2265)),l=n(61956);function a(){let e=(0,u.useContext)(l.TemplateContext);return(0,o.jsx)(o.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20544:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getExpectedRequestStore:function(){return o},requestAsyncStorage:function(){return r.requestAsyncStorage}});let r=n(25575);function o(e){let t=r.requestAsyncStorage.getStore();if(t)return t;throw Error("`"+e+"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},22356:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return u}});let r=n(27420),o=n(92576);function u(e,t,n,u){let[l,a,i]=n.slice(-3);if(null===a)return!1;if(3===n.length){let n=a[2],o=a[3];t.loading=o,t.rsc=n,t.prefetchRsc=null,(0,r.fillLazyItemsTillLeafWithHead)(t,e,l,a,i,u)}else t.rsc=e.rsc,t.prefetchRsc=e.prefetchRsc,t.parallelRoutes=new Map(e.parallelRoutes),t.loading=e.loading,(0,o.fillCacheWithNewSubTreeData)(t,e,n,u);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81935:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyRouterStatePatchToTree",{enumerable:!0,get:function(){return function e(t,n,r,a){let i;let[c,s,f,d,p]=n;if(1===t.length){let e=l(n,r,t);return(0,u.addRefreshMarkerToActiveParallelSegments)(e,a),e}let[h,y]=t;if(!(0,o.matchSegment)(h,c))return null;if(2===t.length)i=l(s[y],r,t);else if(null===(i=e(t.slice(2),s[y],r,a)))return null;let _=[t[0],{...s,[y]:i},f,d];return p&&(_[4]=!0),(0,u.addRefreshMarkerToActiveParallelSegments)(_,a),_}}});let r=n(84541),o=n(76015),u=n(50232);function l(e,t,n){let[u,a]=e,[i,c]=t;if(i===r.DEFAULT_SEGMENT_KEY&&u!==r.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(u,i)){let t={};for(let e in a)void 0!==c[e]?t[e]=l(a[e],c[e],n):t[e]=a[e];for(let e in c)t[e]||(t[e]=c[e]);let r=[u,t];return e[2]&&(r[2]=e[2]),e[3]&&(r[3]=e[3]),e[4]&&(r[4]=e[4]),r}return t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65556:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clearCacheNodeDataForSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l),s=t.parallelRoutes.get(l);s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s));let f=null==c?void 0:c.get(i),d=s.get(i);if(u){d&&d.lazyData&&d!==f||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}if(!d||!f){d||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}return d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved,loading:d.loading},s.set(i,d)),e(d,f,o.slice(2))}}});let r=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5410:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{computeChangedPath:function(){return s},extractPathFromFlightRouterState:function(){return c}});let r=n(91182),o=n(84541),u=n(76015),l=e=>"/"===e[0]?e.slice(1):e,a=e=>"string"==typeof e?"children"===e?"":e:e[1];function i(e){return e.reduce((e,t)=>""===(t=l(t))||(0,o.isGroupSegment)(t)?e:e+"/"+t,"")||"/"}function c(e){var t;let n=Array.isArray(e[0])?e[0][1]:e[0];if(n===o.DEFAULT_SEGMENT_KEY||r.INTERCEPTION_ROUTE_MARKERS.some(e=>n.startsWith(e)))return;if(n.startsWith(o.PAGE_SEGMENT_KEY))return"";let u=[a(n)],l=null!=(t=e[1])?t:{},s=l.children?c(l.children):void 0;if(void 0!==s)u.push(s);else for(let[e,t]of Object.entries(l)){if("children"===e)continue;let n=c(t);void 0!==n&&u.push(n)}return i(u)}function s(e,t){let n=function e(t,n){let[o,l]=t,[i,s]=n,f=a(o),d=a(i);if(r.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)||d.startsWith(e)))return"";if(!(0,u.matchSegment)(o,i)){var p;return null!=(p=c(n))?p:""}for(let t in l)if(s[t]){let n=e(l[t],s[t]);if(null!==n)return a(i)+"/"+n}return null}(e,t);return null==n||"/"===n?n:i(n.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33456:function(e,t){"use strict";function n(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82952:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return c}});let r=n(33456),o=n(27420),u=n(5410),l=n(60305),a=n(24673),i=n(50232);function c(e){var t;let{buildId:n,initialTree:c,initialSeedData:s,urlParts:f,initialParallelRoutes:d,location:p,initialHead:h,couldBeIntercepted:y}=e,_=f.join("/"),v=!p,b={lazyData:null,rsc:s[2],prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:v?new Map:d,lazyDataResolved:!1,loading:s[3]},g=p?(0,r.createHrefFromUrl)(p):_;(0,i.addRefreshMarkerToActiveParallelSegments)(c,g);let m=new Map;(null===d||0===d.size)&&(0,o.fillLazyItemsTillLeafWithHead)(b,void 0,c,s,h);let R={buildId:n,tree:c,cache:b,prefetchCache:m,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:g,nextUrl:null!=(t=(0,u.extractPathFromFlightRouterState)(c)||(null==p?void 0:p.pathname))?t:null};if(p){let e=new URL(""+p.pathname+p.search,p.origin),t=[["",c,null,null]];(0,l.createPrefetchCacheEntryForInitialLoad)({url:e,kind:a.PrefetchKind.AUTO,data:[t,void 0,!1,y],tree:R.tree,prefetchCache:R.prefetchCache,nextUrl:R.nextUrl})}return R}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},78505:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return o}});let r=n(84541);function o(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?e[0]+"|"+e[1]+"|"+e[2]:t&&e.startsWith(r.PAGE_SEGMENT_KEY)?r.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44848:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fetchServerResponse",{enumerable:!0,get:function(){return f}});let r=n(6866),o=n(12846),u=n(83079),l=n(24673),a=n(37207),i=n(91311),{createFromFetch:c}=n(6671);function s(e){return[(0,o.urlToUrlWithoutFlightMarker)(e).toString(),void 0,!1,!1]}async function f(e,t,n,f,d){let p={[r.RSC_HEADER]:"1",[r.NEXT_ROUTER_STATE_TREE]:(0,i.prepareFlightRouterStateForRequest)(t)};d===l.PrefetchKind.AUTO&&(p[r.NEXT_ROUTER_PREFETCH_HEADER]="1"),n&&(p[r.NEXT_URL]=n);let h=(0,a.hexHash)([p[r.NEXT_ROUTER_PREFETCH_HEADER]||"0",p[r.NEXT_ROUTER_STATE_TREE],p[r.NEXT_URL]].join(","));try{var y;let t=new URL(e);t.pathname.endsWith("/")?t.pathname+="index.txt":t.pathname+=".txt",t.searchParams.set(r.NEXT_RSC_UNION_QUERY,h);let n=await fetch(t,{credentials:"same-origin",headers:p}),l=(0,o.urlToUrlWithoutFlightMarker)(n.url),a=n.redirected?l:void 0,i=n.headers.get("content-type")||"",d=!!n.headers.get(r.NEXT_DID_POSTPONE_HEADER),_=!!(null==(y=n.headers.get("vary"))?void 0:y.includes(r.NEXT_URL)),v=i===r.RSC_CONTENT_TYPE_HEADER;if(v||(v=i.startsWith("text/plain")),!v||!n.ok)return e.hash&&(l.hash=e.hash),s(l.toString());let[b,g]=await c(Promise.resolve(n),{callServer:u.callServer});if(f!==b)return s(n.url);return[g,a,d,_]}catch(t){return console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),[e.toString(),void 0,!1,!1]}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},92576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillCacheWithNewSubTreeData",{enumerable:!0,get:function(){return function e(t,n,l,a){let i=l.length<=5,[c,s]=l,f=(0,u.createRouterCacheKey)(s),d=n.parallelRoutes.get(c);if(!d)return;let p=t.parallelRoutes.get(c);p&&p!==d||(p=new Map(d),t.parallelRoutes.set(c,p));let h=d.get(f),y=p.get(f);if(i){if(!y||!y.lazyData||y===h){let e=l[3];y={lazyData:null,rsc:e[2],prefetchRsc:null,head:null,prefetchHead:null,loading:e[3],parallelRoutes:h?new Map(h.parallelRoutes):new Map,lazyDataResolved:!1},h&&(0,r.invalidateCacheByRouterState)(y,h,l[2]),(0,o.fillLazyItemsTillLeafWithHead)(y,h,l[2],e,l[4],a),p.set(f,y)}return}y&&h&&(y===h&&(y={lazyData:y.lazyData,rsc:y.rsc,prefetchRsc:y.prefetchRsc,head:y.head,prefetchHead:y.prefetchHead,parallelRoutes:new Map(y.parallelRoutes),lazyDataResolved:!1,loading:y.loading},p.set(f,y)),e(y,h,l.slice(2),a))}}});let r=n(94377),o=n(27420),u=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},27420:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,n,u,l,a,i){if(0===Object.keys(u[1]).length){t.head=a;return}for(let c in u[1]){let s;let f=u[1][c],d=f[0],p=(0,r.createRouterCacheKey)(d),h=null!==l&&void 0!==l[1][c]?l[1][c]:null;if(n){let r=n.parallelRoutes.get(c);if(r){let n;let u=(null==i?void 0:i.kind)==="auto"&&i.status===o.PrefetchCacheEntryStatus.reusable,l=new Map(r),s=l.get(p);n=null!==h?{lazyData:null,rsc:h[2],prefetchRsc:null,head:null,prefetchHead:null,loading:h[3],parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1}:u&&s?{lazyData:s.lazyData,rsc:s.rsc,prefetchRsc:s.prefetchRsc,head:s.head,prefetchHead:s.prefetchHead,parallelRoutes:new Map(s.parallelRoutes),lazyDataResolved:s.lazyDataResolved,loading:s.loading}:{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1,loading:null},l.set(p,n),e(n,s,f,h||null,a,i),t.parallelRoutes.set(c,l);continue}}if(null!==h){let e=h[2],t=h[3];s={lazyData:null,rsc:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:t}}else s={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};let y=t.parallelRoutes.get(c);y?y.set(p,s):t.parallelRoutes.set(c,new Map([[p,s]])),e(s,void 0,f,h,a,i)}}}});let r=n(78505),o=n(24673);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44510:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return u}});let r=n(5410);function o(e){return void 0!==e}function u(e,t){var n,u,l;let a=null==(u=t.shouldScroll)||u,i=e.nextUrl;if(o(t.patchedTree)){let n=(0,r.computeChangedPath)(e.tree,t.patchedTree);n?i=n:i||(i=e.canonicalUrl)}return{buildId:e.buildId,canonicalUrl:o(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:o(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:o(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:o(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!a&&(!!o(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:!!t.hashFragment&&e.canonicalUrl.split("#",1)[0]===(null==(n=t.canonicalUrl)?void 0:n.split("#",1)[0]),hashFragment:a?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:a?null!=(l=null==t?void 0:t.scrollableSegments)?l:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:o(t.patchedTree)?t.patchedTree:e.tree,nextUrl:i}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77831:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return o}});let r=n(95967);function o(e,t,n){return(0,r.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77058:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l);if(!c)return;let s=t.parallelRoutes.get(l);if(s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s)),u){s.delete(i);return}let f=c.get(i),d=s.get(i);d&&f&&(d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved},s.set(i,d)),e(d,f,o.slice(2)))}}});let r=n(78505);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},94377:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return o}});let r=n(78505);function o(e,t,n){for(let o in n[1]){let u=n[1][o][0],l=(0,r.createRouterCacheKey)(u),a=t.parallelRoutes.get(o);if(a){let t=new Map(a);t.delete(l),e.parallelRoutes.set(o,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63237:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,n){let r=t[0],o=n[0];if(Array.isArray(r)&&Array.isArray(o)){if(r[0]!==o[0]||r[2]!==o[2])return!0}else if(r!==o)return!0;if(t[4])return!n[4];if(n[4])return!0;let u=Object.values(t[1])[0],l=Object.values(n[1])[0];return!u||!l||e(u,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},56118:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{abortTask:function(){return c},listenForDynamicRequest:function(){return a},updateCacheNodeOnNavigation:function(){return function e(t,n,a,c,s){let f=n[1],d=a[1],p=c[1],h=t.parallelRoutes,y=new Map(h),_={},v=null;for(let t in d){let n;let a=d[t],c=f[t],b=h.get(t),g=p[t],m=a[0],R=(0,u.createRouterCacheKey)(m),P=void 0!==c?c[0]:void 0,j=void 0!==b?b.get(R):void 0;if(null!==(n=m===r.PAGE_SEGMENT_KEY?l(a,void 0!==g?g:null,s):m===r.DEFAULT_SEGMENT_KEY?void 0!==c?{route:c,node:null,children:null}:l(a,void 0!==g?g:null,s):void 0!==P&&(0,o.matchSegment)(m,P)&&void 0!==j&&void 0!==c?null!=g?e(j,c,a,g,s):function(e){let t=i(e,null,null);return{route:e,node:t,children:null}}(a):l(a,void 0!==g?g:null,s))){null===v&&(v=new Map),v.set(t,n);let e=n.node;if(null!==e){let n=new Map(b);n.set(R,e),y.set(t,n)}_[t]=n.route}else _[t]=a}if(null===v)return null;let b={lazyData:null,rsc:t.rsc,prefetchRsc:t.prefetchRsc,head:t.head,prefetchHead:t.prefetchHead,loading:t.loading,parallelRoutes:y,lazyDataResolved:!1};return{route:function(e,t){let n=[e[0],t];return 2 in e&&(n[2]=e[2]),3 in e&&(n[3]=e[3]),4 in e&&(n[4]=e[4]),n}(a,_),node:b,children:v}}},updateCacheNodeOnPopstateRestoration:function(){return function e(t,n){let r=n[1],o=t.parallelRoutes,l=new Map(o);for(let t in r){let n=r[t],a=n[0],i=(0,u.createRouterCacheKey)(a),c=o.get(t);if(void 0!==c){let r=c.get(i);if(void 0!==r){let o=e(r,n),u=new Map(c);u.set(i,o),l.set(t,u)}}}let a=t.rsc,i=d(a)&&"pending"===a.status;return{lazyData:null,rsc:a,head:t.head,prefetchHead:i?t.prefetchHead:null,prefetchRsc:i?t.prefetchRsc:null,loading:i?t.loading:null,parallelRoutes:l,lazyDataResolved:!1}}}});let r=n(84541),o=n(76015),u=n(78505);function l(e,t,n){let r=i(e,t,n);return{route:e,node:r,children:null}}function a(e,t){t.then(t=>{for(let n of t[0]){let t=n.slice(0,-3),r=n[n.length-3],l=n[n.length-2],a=n[n.length-1];"string"!=typeof t&&function(e,t,n,r,l){let a=e;for(let e=0;e{c(e,t)})}function i(e,t,n){let r=e[1],o=null!==t?t[1]:null,l=new Map;for(let e in r){let t=r[e],a=null!==o?o[e]:null,c=t[0],s=(0,u.createRouterCacheKey)(c),f=i(t,void 0===a?null:a,n),d=new Map;d.set(s,f),l.set(e,d)}let a=0===l.size,c=null!==t?t[2]:null,s=null!==t?t[3]:null;return{lazyData:null,parallelRoutes:l,prefetchRsc:void 0!==c?c:null,prefetchHead:a?n:null,loading:void 0!==s?s:null,rsc:p(),head:a?p():null,lazyDataResolved:!1}}function c(e,t){let n=e.node;if(null===n)return;let r=e.children;if(null===r)s(e.route,n,t);else for(let e of r.values())c(e,t);e.node=null}function s(e,t,n){let r=e[1],o=t.parallelRoutes;for(let e in r){let t=r[e],l=o.get(e);if(void 0===l)continue;let a=t[0],i=(0,u.createRouterCacheKey)(a),c=l.get(i);void 0!==c&&s(t,c,n)}let l=t.rsc;d(l)&&(null===n?l.resolve(null):l.reject(n));let a=t.head;d(a)&&a.resolve(null)}let f=Symbol();function d(e){return e&&e.tag===f}function p(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.status="pending",n.resolve=t=>{"pending"===n.status&&(n.status="fulfilled",n.value=t,e(t))},n.reject=e=>{"pending"===n.status&&(n.status="rejected",n.reason=e,t(e))},n.tag=f,n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},60305:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createPrefetchCacheEntryForInitialLoad:function(){return c},getOrCreatePrefetchCacheEntry:function(){return i},prunePrefetchCache:function(){return f}});let r=n(33456),o=n(44848),u=n(24673),l=n(24819);function a(e,t){let n=(0,r.createHrefFromUrl)(e,!1);return t?t+"%"+n:n}function i(e){let t,{url:n,nextUrl:r,tree:o,buildId:l,prefetchCache:i,kind:c}=e,f=a(n,r),d=i.get(f);if(d)t=d;else{let e=a(n),r=i.get(e);r&&(t=r)}return t?(t.status=h(t),t.kind!==u.PrefetchKind.FULL&&c===u.PrefetchKind.FULL)?s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:null!=c?c:u.PrefetchKind.TEMPORARY}):(c&&t.kind===u.PrefetchKind.TEMPORARY&&(t.kind=c),t):s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:c||u.PrefetchKind.TEMPORARY})}function c(e){let{nextUrl:t,tree:n,prefetchCache:r,url:o,kind:l,data:i}=e,[,,,c]=i,s=c?a(o,t):a(o),f={treeAtTimeOfPrefetch:n,data:Promise.resolve(i),kind:l,prefetchTime:Date.now(),lastUsedTime:Date.now(),key:s,status:u.PrefetchCacheEntryStatus.fresh};return r.set(s,f),f}function s(e){let{url:t,kind:n,tree:r,nextUrl:i,buildId:c,prefetchCache:s}=e,f=a(t),d=l.prefetchQueue.enqueue(()=>(0,o.fetchServerResponse)(t,r,i,c,n).then(e=>{let[,,,n]=e;return n&&function(e){let{url:t,nextUrl:n,prefetchCache:r}=e,o=a(t),u=r.get(o);if(!u)return;let l=a(t,n);r.set(l,u),r.delete(o)}({url:t,nextUrl:i,prefetchCache:s}),e})),p={treeAtTimeOfPrefetch:r,data:d,kind:n,prefetchTime:Date.now(),lastUsedTime:null,key:f,status:u.PrefetchCacheEntryStatus.fresh};return s.set(f,p),p}function f(e){for(let[t,n]of e)h(n)===u.PrefetchCacheEntryStatus.expired&&e.delete(t)}let d=1e3*Number("30"),p=1e3*Number("300");function h(e){let{kind:t,prefetchTime:n,lastUsedTime:r}=e;return Date.now()<(null!=r?r:n)+d?r?u.PrefetchCacheEntryStatus.reusable:u.PrefetchCacheEntryStatus.fresh:"auto"===t&&Date.now(){let[n,f]=t,h=!1;if(E.lastUsedTime||(E.lastUsedTime=Date.now(),h=!0),"string"==typeof n)return _(e,R,n,O);if(document.getElementById("__next-page-redirect"))return _(e,R,j,O);let b=e.tree,g=e.cache,w=[];for(let t of n){let n=t.slice(0,-4),r=t.slice(-3)[0],c=["",...n],f=(0,u.applyRouterStatePatchToTree)(c,b,r,j);if(null===f&&(f=(0,u.applyRouterStatePatchToTree)(c,S,r,j)),null!==f){if((0,a.isNavigatingToNewRootLayout)(b,f))return _(e,R,j,O);let u=(0,d.createEmptyCacheNode)(),m=!1;for(let e of(E.status!==i.PrefetchCacheEntryStatus.stale||h?m=(0,s.applyFlightData)(g,u,t,E):(m=function(e,t,n,r){let o=!1;for(let u of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.loading=t.loading,e.parallelRoutes=new Map(t.parallelRoutes),v(r).map(e=>[...n,...e])))(0,y.clearCacheNodeDataForSegmentPath)(e,t,u),o=!0;return o}(u,g,n,r),E.lastUsedTime=Date.now()),(0,l.shouldHardNavigate)(c,b)?(u.rsc=g.rsc,u.prefetchRsc=g.prefetchRsc,(0,o.invalidateCacheBelowFlightSegmentPath)(u,g,n),R.cache=u):m&&(R.cache=u,g=u),b=f,v(r))){let t=[...n,...e];t[t.length-1]!==p.DEFAULT_SEGMENT_KEY&&w.push(t)}}}return R.patchedTree=b,R.canonicalUrl=f?(0,r.createHrefFromUrl)(f):j,R.pendingPush=O,R.scrollableSegments=w,R.hashFragment=P,R.shouldScroll=m,(0,c.handleMutable)(e,R)},()=>e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24819:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{prefetchQueue:function(){return l},prefetchReducer:function(){return a}});let r=n(6866),o=n(29744),u=n(60305),l=new o.PromiseQueue(5);function a(e,t){(0,u.prunePrefetchCache)(e.prefetchCache);let{url:n}=t;return n.searchParams.delete(r.NEXT_RSC_UNION_QUERY),(0,u.getOrCreatePrefetchCacheEntry)({url:n,nextUrl:e.nextUrl,prefetchCache:e.prefetchCache,kind:t.kind,tree:e.tree,buildId:e.buildId}),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},99601:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return h}});let r=n(44848),o=n(33456),u=n(81935),l=n(63237),a=n(95967),i=n(44510),c=n(27420),s=n(12846),f=n(77831),d=n(28077),p=n(50232);function h(e,t){let{origin:n}=t,h={},y=e.canonicalUrl,_=e.tree;h.preserveCustomHistoryState=!1;let v=(0,s.createEmptyCacheNode)(),b=(0,d.hasInterceptionRouteInCurrentTree)(e.tree);return v.lazyData=(0,r.fetchServerResponse)(new URL(y,n),[_[0],_[1],_[2],"refetch"],b?e.nextUrl:null,e.buildId),v.lazyData.then(async n=>{let[r,s]=n;if("string"==typeof r)return(0,a.handleExternalUrl)(e,h,r,e.pushRef.pendingPush);for(let n of(v.lazyData=null,r)){if(3!==n.length)return console.log("REFRESH FAILED"),e;let[r]=n,i=(0,u.applyRouterStatePatchToTree)([""],_,r,e.canonicalUrl);if(null===i)return(0,f.handleSegmentMismatch)(e,t,r);if((0,l.isNavigatingToNewRootLayout)(_,i))return(0,a.handleExternalUrl)(e,h,y,e.pushRef.pendingPush);let d=s?(0,o.createHrefFromUrl)(s):void 0;s&&(h.canonicalUrl=d);let[g,m]=n.slice(-2);if(null!==g){let e=g[2];v.rsc=e,v.prefetchRsc=null,(0,c.fillLazyItemsTillLeafWithHead)(v,void 0,r,g,m),h.prefetchCache=new Map}await (0,p.refreshInactiveParallelSegments)({state:e,updatedTree:i,updatedCache:v,includeNextUrl:b,canonicalUrl:h.canonicalUrl||e.canonicalUrl}),h.cache=v,h.patchedTree=i,h.canonicalUrl=y,_=i}return(0,i.handleMutable)(e,h)},()=>e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return u}});let r=n(33456),o=n(5410);function u(e,t){var n;let{url:u,tree:l}=t,a=(0,r.createHrefFromUrl)(u),i=l||e.tree,c=e.cache;return{buildId:e.buildId,canonicalUrl:a,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:c,prefetchCache:e.prefetchCache,tree:i,nextUrl:null!=(n=(0,o.extractPathFromFlightRouterState)(i))?n:u.pathname}}n(56118),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13722:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return m}});let r=n(83079),o=n(6866),u=n(1634),l=n(33456),a=n(95967),i=n(81935),c=n(63237),s=n(44510),f=n(27420),d=n(12846),p=n(28077),h=n(77831),y=n(50232),_=n(91311),{createFromFetch:v,encodeReply:b}=n(6671);async function g(e,t,n){let l,{actionId:a,actionArgs:i}=n,c=await b(i),s=await fetch("",{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION]:a,[o.NEXT_ROUTER_STATE_TREE]:(0,_.prepareFlightRouterStateForRequest)(e.tree),...t?{[o.NEXT_URL]:t}:{}},body:c}),f=s.headers.get("x-action-redirect");try{let e=JSON.parse(s.headers.get("x-action-revalidated")||"[[],0,0]");l={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){l={paths:[],tag:!1,cookie:!1}}let d=f?new URL((0,u.addBasePath)(f),new URL(e.canonicalUrl,window.location.href)):void 0;if(s.headers.get("content-type")===o.RSC_CONTENT_TYPE_HEADER){let e=await v(Promise.resolve(s),{callServer:r.callServer});if(f){let[,t]=null!=e?e:[];return{actionFlightData:t,redirectLocation:d,revalidatedParts:l}}let[t,[,n]]=null!=e?e:[];return{actionResult:t,actionFlightData:n,redirectLocation:d,revalidatedParts:l}}return{redirectLocation:d,revalidatedParts:l}}function m(e,t){let{resolve:n,reject:r}=t,o={},u=e.canonicalUrl,_=e.tree;o.preserveCustomHistoryState=!1;let v=e.nextUrl&&(0,p.hasInterceptionRouteInCurrentTree)(e.tree)?e.nextUrl:null;return o.inFlightServerAction=g(e,v,t),o.inFlightServerAction.then(async r=>{let{actionResult:p,actionFlightData:b,redirectLocation:g}=r;if(g&&(e.pushRef.pendingPush=!0,o.pendingPush=!0),!b)return(n(p),g)?(0,a.handleExternalUrl)(e,o,g.href,e.pushRef.pendingPush):e;if("string"==typeof b)return(0,a.handleExternalUrl)(e,o,b,e.pushRef.pendingPush);if(o.inFlightServerAction=null,g){let e=(0,l.createHrefFromUrl)(g,!1);o.canonicalUrl=e}for(let n of b){if(3!==n.length)return console.log("SERVER ACTION APPLY FAILED"),e;let[r]=n,s=(0,i.applyRouterStatePatchToTree)([""],_,r,g?(0,l.createHrefFromUrl)(g):e.canonicalUrl);if(null===s)return(0,h.handleSegmentMismatch)(e,t,r);if((0,c.isNavigatingToNewRootLayout)(_,s))return(0,a.handleExternalUrl)(e,o,u,e.pushRef.pendingPush);let[p,b]=n.slice(-2),m=null!==p?p[2]:null;if(null!==m){let t=(0,d.createEmptyCacheNode)();t.rsc=m,t.prefetchRsc=null,(0,f.fillLazyItemsTillLeafWithHead)(t,void 0,r,p,b),await (0,y.refreshInactiveParallelSegments)({state:e,updatedTree:s,updatedCache:t,includeNextUrl:!!v,canonicalUrl:o.canonicalUrl||e.canonicalUrl}),o.cache=t,o.prefetchCache=new Map}o.patchedTree=s,_=s}return n(p),(0,s.handleMutable)(e,o)},t=>(r(t),e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},68448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return f}});let r=n(33456),o=n(81935),u=n(63237),l=n(95967),a=n(22356),i=n(44510),c=n(12846),s=n(77831);function f(e,t){let{serverResponse:n}=t,[f,d]=n,p={};if(p.preserveCustomHistoryState=!1,"string"==typeof f)return(0,l.handleExternalUrl)(e,p,f,e.pushRef.pendingPush);let h=e.tree,y=e.cache;for(let n of f){let i=n.slice(0,-4),[f]=n.slice(-3,-2),_=(0,o.applyRouterStatePatchToTree)(["",...i],h,f,e.canonicalUrl);if(null===_)return(0,s.handleSegmentMismatch)(e,t,f);if((0,u.isNavigatingToNewRootLayout)(h,_))return(0,l.handleExternalUrl)(e,p,e.canonicalUrl,e.pushRef.pendingPush);let v=d?(0,r.createHrefFromUrl)(d):void 0;v&&(p.canonicalUrl=v);let b=(0,c.createEmptyCacheNode)();(0,a.applyFlightData)(y,b,n),p.patchedTree=_,p.cache=b,y=b,h=_}return(0,i.handleMutable)(e,p)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},50232:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{addRefreshMarkerToActiveParallelSegments:function(){return function e(t,n){let[r,o,,l]=t;for(let a in r.includes(u.PAGE_SEGMENT_KEY)&&"refresh"!==l&&(t[2]=n,t[3]="refresh"),o)e(o[a],n)}},refreshInactiveParallelSegments:function(){return l}});let r=n(22356),o=n(44848),u=n(84541);async function l(e){let t=new Set;await a({...e,rootTree:e.updatedTree,fetchedSegments:t})}async function a(e){let{state:t,updatedTree:n,updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c=n,canonicalUrl:s}=e,[,f,d,p]=n,h=[];if(d&&d!==s&&"refresh"===p&&!i.has(d)){i.add(d);let e=(0,o.fetchServerResponse)(new URL(d,location.origin),[c[0],c[1],c[2],"refetch"],l?t.nextUrl:null,t.buildId).then(e=>{let t=e[0];if("string"!=typeof t)for(let e of t)(0,r.applyFlightData)(u,u,e)});h.push(e)}for(let e in f){let n=a({state:t,updatedTree:f[e],updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c,canonicalUrl:s});h.push(n)}await Promise.all(h)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24673:function(e,t){"use strict";var n,r,o,u;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_FAST_REFRESH:function(){return f},ACTION_NAVIGATE:function(){return a},ACTION_PREFETCH:function(){return s},ACTION_REFRESH:function(){return l},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return d},ACTION_SERVER_PATCH:function(){return c},PrefetchCacheEntryStatus:function(){return r},PrefetchKind:function(){return n},isThenable:function(){return p}});let l="refresh",a="navigate",i="restore",c="server-patch",s="prefetch",f="fast-refresh",d="server-action";function p(e){return e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}(o=n||(n={})).AUTO="auto",o.FULL="full",o.TEMPORARY="temporary",(u=r||(r={})).fresh="fresh",u.reusable="reusable",u.expired="expired",u.stale="stale",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91450:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return f}});let r=n(24673),o=n(95967),u=n(68448),l=n(77784),a=n(99601),i=n(24819),c=n(44529),s=n(13722),f="undefined"==typeof window?function(e,t){return e}:function(e,t){switch(t.type){case r.ACTION_NAVIGATE:return(0,o.navigateReducer)(e,t);case r.ACTION_SERVER_PATCH:return(0,u.serverPatchReducer)(e,t);case r.ACTION_RESTORE:return(0,l.restoreReducer)(e,t);case r.ACTION_REFRESH:return(0,a.refreshReducer)(e,t);case r.ACTION_FAST_REFRESH:return(0,c.fastRefreshReducer)(e,t);case r.ACTION_PREFETCH:return(0,i.prefetchReducer)(e,t);case r.ACTION_SERVER_ACTION:return(0,s.serverActionReducer)(e,t);default:throw Error("Unknown action")}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53728:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,n){let[o,u]=n,[l,a]=t;return(0,r.matchSegment)(l,o)?!(t.length<=2)&&e(t.slice(2),u[a]):!!Array.isArray(l)}}});let r=n(76015);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54535:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createDynamicallyTrackedSearchParams:function(){return a},createUntrackedSearchParams:function(){return l}});let r=n(51845),o=n(86999),u=n(30650);function l(e){let t=r.staticGenerationAsyncStorage.getStore();return t&&t.forceStatic?{}:e}function a(e){let t=r.staticGenerationAsyncStorage.getStore();return t?t.forceStatic?{}:t.isStaticGeneration||t.dynamicShouldError?new Proxy({},{get:(e,n,r)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),u.ReflectAdapter.get(e,n,r)),has:(e,n)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),Reflect.has(e,n)),ownKeys:e=>((0,o.trackDynamicDataAccessed)(t,"searchParams"),Reflect.ownKeys(e))}):e:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51845:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r.staticGenerationAsyncStorage}});let r=n(20030);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36864:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{StaticGenBailoutError:function(){return r},isStaticGenBailoutError:function(){return o}});let n="NEXT_STATIC_GEN_BAILOUT";class r extends Error{constructor(...e){super(...e),this.code=n}}function o(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38137:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unresolvedThenable",{enumerable:!0,get:function(){return n}});let n={then:()=>{}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},47744:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{useReducerWithReduxDevtools:function(){return i},useUnwrapState:function(){return a}});let r=n(53099)._(n(2265)),o=n(24673),u=n(2103);function l(e){if(e instanceof Map){let t={};for(let[n,r]of e.entries()){if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r._bundlerConfig){t[n]="FlightData";continue}}t[n]=l(r)}return t}if("object"==typeof e&&null!==e){let t={};for(let n in e){let r=e[n];if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r.hasOwnProperty("_bundlerConfig")){t[n]="FlightData";continue}}t[n]=l(r)}return t}return Array.isArray(e)?e.map(l):e}function a(e){return(0,o.isThenable)(e)?(0,r.use)(e):e}let i="undefined"!=typeof window?function(e){let[t,n]=r.default.useState(e),o=(0,r.useContext)(u.ActionQueueContext);if(!o)throw Error("Invariant: Missing ActionQueueContext");let a=(0,r.useRef)(),i=(0,r.useRef)();return(0,r.useEffect)(()=>{if(!a.current&&!1!==i.current){if(void 0===i.current&&void 0===window.__REDUX_DEVTOOLS_EXTENSION__){i.current=!1;return}return a.current=window.__REDUX_DEVTOOLS_EXTENSION__.connect({instanceId:8e3,name:"next-router"}),a.current&&(a.current.init(l(e)),o&&(o.devToolsInstance=a.current)),()=>{a.current=void 0}}},[e,o]),[t,(0,r.useCallback)(t=>{o.state||(o.state=e),o.dispatch(t,n)},[o,e]),(0,r.useCallback)(e=>{a.current&&a.current.send({type:"RENDER_SYNC"},l(e))},[])]}:function(e){return[e,()=>{},()=>{}]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91311:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"prepareFlightRouterStateForRequest",{enumerable:!0,get:function(){return o}});let r=n(84541);function o(e,t){return t?encodeURIComponent(JSON.stringify(e)):encodeURIComponent(JSON.stringify(function e(t){let[n,o,,u,l]=t,a="string"==typeof n&&n.startsWith(r.PAGE_SEGMENT_KEY+"?")?r.PAGE_SEGMENT_KEY:n,i={};for(let[t,n]of Object.entries(o))i[t]=e(n);let c=[a,i,null,u&&"refresh"!==u?u:null];return void 0!==l&&(c[4]=l),c}(e)))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11283:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});let r=n(10580);function o(e){return(0,r.pathHasPrefix)(e,"")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33068:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return u}});let r=n(26674),o=n(63381),u=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:n,hash:u}=(0,o.parsePath)(e);return""+(0,r.removeTrailingSlash)(t)+n+u};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(18993);function o(e){let t="function"==typeof reportError?reportError:e=>{window.console.error(e)};(0,r.isBailoutToCSRError)(e)||t(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},35076:function(e,t,n){"use strict";function r(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return r}}),n(11283),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},12010:function(e,t){"use strict";function n(e,t){var n=e.length;for(e.push(t);0>>1,o=e[r];if(0>>1;ru(i,n))cu(s,i)?(e[r]=s,e[c]=n,r=c):(e[r]=i,e[a]=n,r=a);else if(cu(s,n))e[r]=s,e[c]=n,r=c;else break}}return t}function u(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,a=performance;t.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var s=[],f=[],d=1,p=null,h=3,y=!1,_=!1,v=!1,b="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,m="undefined"!=typeof setImmediate?setImmediate:null;function R(e){for(var t=r(f);null!==t;){if(null===t.callback)o(f);else if(t.startTime<=e)o(f),t.sortIndex=t.expirationTime,n(s,t);else break;t=r(f)}}function P(e){if(v=!1,R(e),!_){if(null!==r(s))_=!0,C();else{var t=r(f);null!==t&&A(P,t.startTime-e)}}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var j=!1,O=-1,E=5,S=-1;function w(){return!(t.unstable_now()-Se&&w());){var a=p.callback;if("function"==typeof a){p.callback=null,h=p.priorityLevel;var i=a(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof i){p.callback=i,R(e),n=!0;break t}p===r(s)&&o(s),R(e)}else o(s);p=r(s)}if(null!==p)n=!0;else{var c=r(f);null!==c&&A(P,c.startTime-e),n=!1}}break e}finally{p=null,h=u,y=!1}n=void 0}}finally{n?l():j=!1}}}if("function"==typeof m)l=function(){m(M)};else if("undefined"!=typeof MessageChannel){var T=new MessageChannel,x=T.port2;T.port1.onmessage=M,l=function(){x.postMessage(null)}}else l=function(){b(M,0)};function C(){j||(j=!0,l())}function A(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){_||y||(_=!0,C())},t.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=u,n(f,e),null===r(s)&&e===r(f)&&(v?(g(O),O=-1):v=!0,A(P,u-l))):(e.sortIndex=a,n(s,e),_||y||(_=!0,C())),e},t.unstable_shouldYield=w,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},71767:function(e,t,n){"use strict";e.exports=n(12010)},60934:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getPathname:function(){return r},isFullStringUrl:function(){return o},parseUrl:function(){return u}});let n="http://n";function r(e){return new URL(e,n).pathname}function o(e){return/https?:\/\//.test(e)}function u(e){let t;try{t=new URL(e,n)}catch{}return t}},86999:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{Postpone:function(){return d},createPostponedAbortSignal:function(){return b},createPrerenderState:function(){return c},formatDynamicAPIAccesses:function(){return _},markCurrentScopeAsDynamic:function(){return s},trackDynamicDataAccessed:function(){return f},trackDynamicFetch:function(){return p},usedDynamicAPIs:function(){return y}});let o=(r=n(2265))&&r.__esModule?r:{default:r},u=n(46177),l=n(36864),a=n(60934),i="function"==typeof o.default.unstable_postpone;function c(e){return{isDebugSkeleton:e,dynamicAccesses:[]}}function s(e,t){let n=(0,a.getPathname)(e.urlPathname);if(!e.isUnstableCacheCallback){if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}}function f(e,t){let n=(0,a.getPathname)(e.urlPathname);if(e.isUnstableCacheCallback)throw Error(`Route ${n} used "${t}" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "${t}" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}function d({reason:e,prerenderState:t,pathname:n}){h(t,e,n)}function p(e,t){e.prerenderState&&h(e.prerenderState,t,e.urlPathname)}function h(e,t,n){v();let r=`Route ${n} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;e.dynamicAccesses.push({stack:e.isDebugSkeleton?Error().stack:void 0,expression:t}),o.default.unstable_postpone(r)}function y(e){return e.dynamicAccesses.length>0}function _(e){return e.dynamicAccesses.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" ()")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}: -${t}`))}function v(){if(!i)throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js")}function b(e){v();let t=new AbortController;try{o.default.unstable_postpone(e)}catch(e){t.abort(e)}return t.signal}},87417:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentParam",{enumerable:!0,get:function(){return o}});let r=n(91182);function o(e){let t=r.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t));return(t&&(e=e.slice(t.length)),e.startsWith("[[...")&&e.endsWith("]]"))?{type:"optional-catchall",param:e.slice(5,-2)}:e.startsWith("[...")&&e.endsWith("]")?{type:t?"catchall-intercepted":"catchall",param:e.slice(4,-1)}:e.startsWith("[")&&e.endsWith("]")?{type:t?"dynamic-intercepted":"dynamic",param:e.slice(1,-1)}:null}},70647:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HMR_ACTIONS_SENT_TO_BROWSER",{enumerable:!0,get:function(){return n}}),(r=n||(n={})).ADDED_PAGE="addedPage",r.REMOVED_PAGE="removedPage",r.RELOAD_PAGE="reloadPage",r.SERVER_COMPONENT_CHANGES="serverComponentChanges",r.MIDDLEWARE_CHANGES="middlewareChanges",r.CLIENT_CHANGES="clientChanges",r.SERVER_ONLY_CHANGES="serverOnlyChanges",r.SYNC="sync",r.BUILT="built",r.BUILDING="building",r.DEV_PAGES_MANIFEST_UPDATE="devPagesManifestUpdate",r.TURBOPACK_MESSAGE="turbopack-message",r.SERVER_ERROR="serverError",r.TURBOPACK_CONNECTED="turbopack-connected"},91182:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return o},extractInterceptionRouteInformation:function(){return l},isInterceptionRouteAppPath:function(){return u}});let r=n(20926),o=["(..)(..)","(.)","(..)","(...)"];function u(e){return void 0!==e.split("/").find(e=>o.find(t=>e.startsWith(t)))}function l(e){let t,n,u;for(let r of e.split("/"))if(n=o.find(e=>r.startsWith(e))){[t,u]=e.split(n,2);break}if(!t||!n||!u)throw Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`);switch(t=(0,r.normalizeAppPath)(t),n){case"(.)":u="/"===t?`/${u}`:t+"/"+u;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);u=t.split("/").slice(0,-1).concat(u).join("/");break;case"(...)":u="/"+u;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);u=l.slice(0,-2).concat(u).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:u}}},30650:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,n){let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},61956:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return l},LayoutRouterContext:function(){return u},MissingSlotContext:function(){return i},TemplateContext:function(){return a}});let r=n(47043)._(n(2265)),o=r.default.createContext(null),u=r.default.createContext(null),l=r.default.createContext(null),a=r.default.createContext(null),i=r.default.createContext(new Set)},37207:function(e,t){"use strict";function n(e){let t=5381;for(let n=0;n>>0}function r(e){return n(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{djb2Hash:function(){return n},hexHash:function(){return r}})},48701:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});let r=n(47043)._(n(2265)).default.createContext({})},79060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PathParamsContext:function(){return l},PathnameContext:function(){return u},SearchParamsContext:function(){return o}});let r=n(2265),o=(0,r.createContext)(null),u=(0,r.createContext)(null),l=(0,r.createContext)(null)},18993:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{BailoutToCSRError:function(){return r},isBailoutToCSRError:function(){return o}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class r extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},78162:function(e,t){"use strict";function n(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return n}})},2103:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ActionQueueContext:function(){return a},createMutableActionQueue:function(){return s}});let r=n(53099),o=n(24673),u=n(91450),l=r._(n(2265)),a=l.default.createContext(null);function i(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending?c({actionQueue:e,action:e.pending,setState:t}):e.needsRefresh&&(e.needsRefresh=!1,e.dispatch({type:o.ACTION_REFRESH,origin:window.location.origin},t)))}async function c(e){let{actionQueue:t,action:n,setState:r}=e,u=t.state;if(!u)throw Error("Invariant: Router state not initialized");t.pending=n;let l=n.payload,a=t.action(u,l);function c(e){n.discarded||(t.state=e,t.devToolsInstance&&t.devToolsInstance.send(l,e),i(t,r),n.resolve(e))}(0,o.isThenable)(a)?a.then(c,e=>{i(t,r),n.reject(e)}):c(a)}function s(){let e={state:null,dispatch:(t,n)=>(function(e,t,n){let r={resolve:n,reject:()=>{}};if(t.type!==o.ACTION_RESTORE){let e=new Promise((e,t)=>{r={resolve:e,reject:t}});(0,l.startTransition)(()=>{n(e)})}let u={payload:t,next:null,resolve:r.resolve,reject:r.reject};null===e.pending?(e.last=u,c({actionQueue:e,action:u,setState:n})):t.type===o.ACTION_NAVIGATE||t.type===o.ACTION_RESTORE?(e.pending.discarded=!0,e.last=u,e.pending.payload.type===o.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),c({actionQueue:e,action:u,setState:n})):(null!==e.last&&(e.last.next=u),e.last=u)})(e,t,n),action:async(e,t)=>{if(null===e)throw Error("Invariant: Router state not initialized");return(0,u.reducer)(e,t)},pending:null,last:null};return e}},68498:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return o}});let r=n(63381);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:n,query:o,hash:u}=(0,r.parsePath)(e);return""+t+n+o+u}},20926:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{normalizeAppPath:function(){return u},normalizeRscURL:function(){return l}});let r=n(78162),o=n(84541);function u(e){return(0,r.ensureLeadingSlash)(e.split("/").reduce((e,t,n,r)=>!t||(0,o.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&n===r.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},7092:function(e,t){"use strict";function n(e,t){if(void 0===t&&(t={}),t.onlyHashChange){e();return}let n=document.documentElement,r=n.style.scrollBehavior;n.style.scrollBehavior="auto",t.dontForceLayout||n.getClientRects(),e(),n.style.scrollBehavior=r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return n}})},86146:function(e,t){"use strict";function n(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return n}})},63381:function(e,t){"use strict";function n(e){let t=e.indexOf("#"),n=e.indexOf("?"),r=n>-1&&(t<0||n-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return n}})},10580:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return o}});let r=n(63381);function o(e,t){if("string"!=typeof e)return!1;let{pathname:n}=(0,r.parsePath)(e);return n===t||n.startsWith(t+"/")}},26674:function(e,t){"use strict";function n(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return n}})},84541:function(e,t){"use strict";function n(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});let r="__PAGE__",o="__DEFAULT__"},55501:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return o},useServerInsertedHTML:function(){return u}});let r=n(53099)._(n(2265)),o=r.default.createContext(null);function u(e){let t=(0,r.useContext)(o);t&&t(e)}},31765:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},47149:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54832:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return u}});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}}let o=globalThis.AsyncLocalStorage;function u(){return o?new o:new r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25575:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20030:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(54832).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34040:function(e,t,n){"use strict";var r=n(54887);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},54887:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(84417)},97950:function(e,t,n){"use strict";var r=n(54887),o={stream:!0},u=new Map;function l(e){var t=n(e);return"function"!=typeof t.then||"fulfilled"===t.status?null:(t.then(function(e){t.status="fulfilled",t.value=e},function(e){t.status="rejected",t.reason=e}),t)}function a(){}var i=new Map,c=n.u;n.u=function(e){var t=i.get(e);return void 0!==t?t:c(e)};var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,f=Symbol.for("react.element"),d=Symbol.for("react.lazy"),p=Symbol.iterator,h=Array.isArray,y=Object.getPrototypeOf,_=Object.prototype,v=new WeakMap;function b(e,t,n,r){this.status=e,this.value=t,this.reason=n,this._response=r}function g(e){switch(e.status){case"resolved_model":S(e);break;case"resolved_module":w(e)}switch(e.status){case"fulfilled":return e.value;case"pending":case"blocked":case"cyclic":throw e;default:throw e.reason}}function m(e,t){for(var n=0;nh?(_=h,h=3,p++):(_=0,h=3);continue;case 2:44===(m=d[p++])?h=4:v=v<<4|(96d.length&&(m=-1)}var O=d.byteOffset+p;if(-1e?({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||e:"Not set";s.Z=e=>{let{value:s,onChange:t,className:i="",style:n={}}=e;return(0,l.jsxs)(a.default,{style:{width:"100%",...n},value:s||void 0,onChange:t,className:i,placeholder:"n/a",allowClear:!0,children:[(0,l.jsx)(r,{value:"24h",children:"daily"}),(0,l.jsx)(r,{value:"7d",children:"weekly"}),(0,l.jsx)(r,{value:"30d",children:"monthly"})]})}},84376:function(e,s,t){var l=t(57437);t(2265);var a=t(37592);s.Z=e=>{let{teams:s,value:t,onChange:r,disabled:i}=e;return console.log("disabled",i),(0,l.jsx)(a.default,{showSearch:!0,placeholder:"Search or select a team",value:t,onChange:r,disabled:i,allowClear:!0,filterOption:(e,t)=>{if(!t)return!1;let l=null==s?void 0:s.find(e=>e.team_id===t.key);if(!l)return!1;let a=e.toLowerCase().trim(),r=(l.team_alias||"").toLowerCase(),i=(l.team_id||"").toLowerCase();return r.includes(a)||i.includes(a)},optionFilterProp:"children",children:null==s?void 0:s.map(e=>(0,l.jsxs)(a.default.Option,{value:e.team_id,children:[(0,l.jsx)("span",{className:"font-medium",children:e.team_alias})," ",(0,l.jsxs)("span",{className:"text-gray-500",children:["(",e.team_id,")"]})]},e.team_id))})}},7765:function(e,s,t){t.d(s,{Z:function(){return K}});var l=t(57437),a=t(2265),r=t(37592),i=t(10032),n=t(4260),d=t(5545),o=t(22116),c=t(87452),m=t(88829),u=t(72208),x=t(78489),h=t(57365),f=t(84264),p=t(49566),j=t(96761),g=t(98187),v=t(19250),b=t(19431),y=t(57840),N=t(65319),w=t(56609),_=t(73879),C=t(34310),k=t(38434),S=t(26349),Z=t(35291),U=t(3632),I=t(15452),V=t.n(I),L=t(71157),P=t(44643),R=t(88532),E=t(29233),O=t(9114),T=e=>{let{accessToken:s,teams:t,possibleUIRoles:r,onUsersCreated:i}=e,[n,d]=(0,a.useState)(!1),[c,m]=(0,a.useState)([]),[u,x]=(0,a.useState)(!1),[h,f]=(0,a.useState)(null),[p,j]=(0,a.useState)(null),[g,I]=(0,a.useState)(null),[T,z]=(0,a.useState)(null),[F,B]=(0,a.useState)(null),[D,M]=(0,a.useState)("http://localhost:4000");(0,a.useEffect)(()=>{(async()=>{try{let e=await (0,v.getProxyUISettings)(s);B(e)}catch(e){console.error("Error fetching UI settings:",e)}})(),M(new URL("/",window.location.href).toString())},[s]);let A=async()=>{x(!0);let e=c.map(e=>({...e,status:"pending"}));m(e);let t=!1;for(let i=0;ie.trim()).filter(Boolean),0===e.teams.length&&delete e.teams),n.models&&"string"==typeof n.models&&""!==n.models.trim()&&(e.models=n.models.split(",").map(e=>e.trim()).filter(Boolean),0===e.models.length&&delete e.models),n.max_budget&&""!==n.max_budget.toString().trim()){let s=parseFloat(n.max_budget.toString());!isNaN(s)&&s>0&&(e.max_budget=s)}n.budget_duration&&""!==n.budget_duration.trim()&&(e.budget_duration=n.budget_duration.trim()),n.metadata&&"string"==typeof n.metadata&&""!==n.metadata.trim()&&(e.metadata=n.metadata.trim()),console.log("Sending user data:",e);let a=await (0,v.userCreateCall)(s,null,e);if(console.log("Full response:",a),a&&(a.key||a.user_id)){t=!0,console.log("Success case triggered");let e=(null===(l=a.data)||void 0===l?void 0:l.user_id)||a.user_id;try{if(null==F?void 0:F.SSO_ENABLED){let e=new URL("/ui",D).toString();m(s=>s.map((s,t)=>t===i?{...s,status:"success",key:a.key||a.user_id,invitation_link:e}:s))}else{let t=await (0,v.invitationCreateCall)(s,e),l=new URL("/ui?invitation_id=".concat(t.id),D).toString();m(e=>e.map((e,s)=>s===i?{...e,status:"success",key:a.key||a.user_id,invitation_link:l}:e))}}catch(e){console.error("Error creating invitation:",e),m(e=>e.map((e,s)=>s===i?{...e,status:"success",key:a.key||a.user_id,error:"User created but failed to generate invitation link"}:e))}}else{console.log("Error case triggered");let e=(null==a?void 0:a.error)||"Failed to create user";console.log("Error message:",e),m(s=>s.map((s,t)=>t===i?{...s,status:"failed",error:e}:s))}}catch(s){console.error("Caught error:",s);let e=(null==s?void 0:null===(r=s.response)||void 0===r?void 0:null===(a=r.data)||void 0===a?void 0:a.error)||(null==s?void 0:s.message)||String(s);m(s=>s.map((s,t)=>t===i?{...s,status:"failed",error:e}:s))}}x(!1),t&&i&&i()};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.z,{className:"mb-0",onClick:()=>d(!0),children:"+ Bulk Invite Users"}),(0,l.jsx)(o.Z,{title:"Bulk Invite Users",visible:n,width:800,onCancel:()=>d(!1),bodyStyle:{maxHeight:"70vh",overflow:"auto"},footer:null,children:(0,l.jsx)("div",{className:"flex flex-col",children:0===c.length?(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center mb-4",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"1"}),(0,l.jsx)("h3",{className:"text-lg font-medium",children:"Download and fill the template"})]}),(0,l.jsxs)("div",{className:"ml-11 mb-6",children:[(0,l.jsx)("p",{className:"mb-4",children:"Add multiple users at once by following these steps:"}),(0,l.jsxs)("ol",{className:"list-decimal list-inside space-y-2 ml-2 mb-4",children:[(0,l.jsx)("li",{children:"Download our CSV template"}),(0,l.jsx)("li",{children:"Add your users' information to the spreadsheet"}),(0,l.jsx)("li",{children:"Save the file and upload it here"}),(0,l.jsx)("li",{children:"After creation, download the results file containing the Virtual Keys for each user"})]}),(0,l.jsxs)("div",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 mb-4",children:[(0,l.jsx)("h4",{className:"font-medium mb-2",children:"Template Column Names"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"user_email"}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:"User's email address (required)"})]})]}),(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500 mt-1.5 mr-2 flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"user_role"}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:'User\'s role (one of: "proxy_admin", "proxy_admin_viewer", "internal_user", "internal_user_viewer")'})]})]}),(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"teams"}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated team IDs (e.g., "team-1,team-2")'})]})]}),(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"max_budget"}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:'Maximum budget as a number (e.g., "100")'})]})]}),(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"budget_duration"}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:'Budget reset period (e.g., "30d", "1mo")'})]})]}),(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-300 mt-1.5 mr-2 flex-shrink-0"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"font-medium",children:"models"}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:'Comma-separated allowed models (e.g., "gpt-3.5-turbo,gpt-4")'})]})]})]})]}),(0,l.jsxs)(b.z,{onClick:()=>{let e=new Blob([V().unparse([["user_email","user_role","teams","max_budget","budget_duration","models"],["user@example.com","internal_user","team-id-1,team-id-2","100","30d","gpt-3.5-turbo,gpt-4"]])],{type:"text/csv"}),s=window.URL.createObjectURL(e),t=document.createElement("a");t.href=s,t.download="bulk_users_template.csv",document.body.appendChild(t),t.click(),document.body.removeChild(t),window.URL.revokeObjectURL(s)},size:"lg",className:"w-full md:w-auto",children:[(0,l.jsx)(_.Z,{className:"mr-2"})," Download CSV Template"]})]}),(0,l.jsxs)("div",{className:"flex items-center mb-4",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"2"}),(0,l.jsx)("h3",{className:"text-lg font-medium",children:"Upload your completed CSV"})]}),(0,l.jsxs)("div",{className:"ml-11",children:[T?(0,l.jsxs)("div",{className:"mb-4 p-4 rounded-md border ".concat(g?"bg-red-50 border-red-200":"bg-blue-50 border-blue-200"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center",children:[g?(0,l.jsx)(C.Z,{className:"text-red-500 text-xl mr-3"}):(0,l.jsx)(k.Z,{className:"text-blue-500 text-xl mr-3"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(y.default.Text,{strong:!0,className:g?"text-red-800":"text-blue-800",children:T.name}),(0,l.jsxs)(y.default.Text,{className:"block text-xs ".concat(g?"text-red-600":"text-blue-600"),children:[(T.size/1024).toFixed(1)," KB • ",new Date().toLocaleDateString()]})]})]}),(0,l.jsxs)(b.z,{size:"xs",variant:"secondary",onClick:()=>{z(null),m([]),f(null),j(null),I(null)},className:"flex items-center",children:[(0,l.jsx)(S.Z,{className:"mr-1"})," Remove"]})]}),g?(0,l.jsxs)("div",{className:"mt-3 text-red-600 text-sm flex items-start",children:[(0,l.jsx)(Z.Z,{className:"mr-2 mt-0.5"}),(0,l.jsx)("span",{children:g})]}):!p&&(0,l.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,l.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-1.5",children:(0,l.jsx)("div",{className:"bg-blue-500 h-1.5 rounded-full w-full animate-pulse"})}),(0,l.jsx)("span",{className:"ml-2 text-xs text-blue-600",children:"Processing..."})]})]}):(0,l.jsx)(N.default,{beforeUpload:e=>((f(null),j(null),I(null),z(e),"text/csv"===e.type||e.name.endsWith(".csv"))?e.size>5242880?I("File is too large (".concat((e.size/1048576).toFixed(1)," MB). Please upload a CSV file smaller than 5MB.")):V().parse(e,{complete:e=>{if(!e.data||0===e.data.length){j("The CSV file appears to be empty. Please upload a file with data."),m([]);return}if(1===e.data.length){j("The CSV file only contains headers but no user data. Please add user data to your CSV."),m([]);return}let s=e.data[0];if(0===s.length||1===s.length&&""===s[0]){j("The CSV file doesn't contain any column headers. Please make sure your CSV has headers."),m([]);return}let l=["user_email","user_role"].filter(e=>!s.includes(e));if(l.length>0){j("Your CSV is missing these required columns: ".concat(l.join(", "),". Please add these columns to your CSV file.")),m([]);return}try{let l=e.data.slice(1).map((e,l)=>{var a,r,i,n,d,o;if(0===e.length||1===e.length&&""===e[0])return null;if(e.length=parseFloat(c.max_budget.toString())&&m.push("Max budget must be greater than 0")),c.budget_duration&&!c.budget_duration.match(/^\d+[dhmwy]$|^\d+mo$/)&&m.push('Invalid budget duration format "'.concat(c.budget_duration,'". Use format like "30d", "1mo", "2w", "6h"')),c.teams&&"string"==typeof c.teams&&t&&t.length>0){let e=t.map(e=>e.team_id),s=c.teams.split(",").map(e=>e.trim()).filter(s=>!e.includes(s));s.length>0&&m.push("Unknown team(s): ".concat(s.join(", ")))}return m.length>0&&(c.isValid=!1,c.error=m.join(", ")),c}).filter(Boolean),a=l.filter(e=>e.isValid);m(l),0===l.length?j("No valid data rows found in the CSV file. Please check your file format."):0===a.length?f("No valid users found in the CSV. Please check the errors below and fix your CSV file."):a.length{f("Failed to parse CSV file: ".concat(e.message)),m([])},header:!1}):(I("Invalid file type: ".concat(e.name,". Please upload a CSV file (.csv extension).")),O.Z.fromBackend("Invalid file type. Please upload a CSV file.")),!1),accept:".csv",maxCount:1,showUploadList:!1,children:(0,l.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-blue-500 transition-colors cursor-pointer",children:[(0,l.jsx)(U.Z,{className:"text-3xl text-gray-400 mb-2"}),(0,l.jsx)("p",{className:"mb-1",children:"Drag and drop your CSV file here"}),(0,l.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"or"}),(0,l.jsx)(b.z,{size:"sm",children:"Browse files"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mt-4",children:"Only CSV files (.csv) are supported"})]})}),p&&(0,l.jsx)("div",{className:"mb-4 p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)(R.Z,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(y.default.Text,{strong:!0,className:"text-yellow-800",children:"CSV Structure Error"}),(0,l.jsx)(y.default.Paragraph,{className:"text-yellow-700 mt-1 mb-0",children:p}),(0,l.jsx)(y.default.Paragraph,{className:"text-yellow-700 mt-2 mb-0",children:"Please download our template and ensure your CSV follows the required format."})]})]})})]})]}):(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center mb-4",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center mr-3",children:"3"}),(0,l.jsx)("h3",{className:"text-lg font-medium",children:c.some(e=>"success"===e.status||"failed"===e.status)?"User Creation Results":"Review and create users"})]}),h&&(0,l.jsx)("div",{className:"ml-11 mb-4 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)(Z.Z,{className:"text-red-500 mr-2 mt-1"}),(0,l.jsxs)("div",{children:[(0,l.jsx)(b.x,{className:"text-red-600 font-medium",children:h}),c.some(e=>!e.isValid)&&(0,l.jsxs)("ul",{className:"mt-2 list-disc list-inside text-red-600 text-sm",children:[(0,l.jsx)("li",{children:"Check the table below for specific errors in each row"}),(0,l.jsx)("li",{children:"Common issues include invalid email formats, missing required fields, or incorrect role values"}),(0,l.jsx)("li",{children:"Fix these issues in your CSV file and upload again"})]})]})]})}),(0,l.jsxs)("div",{className:"ml-11",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,l.jsx)("div",{className:"flex items-center",children:c.some(e=>"success"===e.status||"failed"===e.status)?(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(b.x,{className:"text-lg font-medium mr-3",children:"Creation Summary"}),(0,l.jsxs)(b.x,{className:"text-sm bg-green-100 text-green-800 px-2 py-1 rounded mr-2",children:[c.filter(e=>"success"===e.status).length," Successful"]}),c.some(e=>"failed"===e.status)&&(0,l.jsxs)(b.x,{className:"text-sm bg-red-100 text-red-800 px-2 py-1 rounded",children:[c.filter(e=>"failed"===e.status).length," Failed"]})]}):(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(b.x,{className:"text-lg font-medium mr-3",children:"User Preview"}),(0,l.jsxs)(b.x,{className:"text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded",children:[c.filter(e=>e.isValid).length," of ",c.length," users valid"]})]})}),!c.some(e=>"success"===e.status||"failed"===e.status)&&(0,l.jsxs)("div",{className:"flex space-x-3",children:[(0,l.jsx)(b.z,{onClick:()=>{m([]),f(null)},variant:"secondary",children:"Back"}),(0,l.jsx)(b.z,{onClick:A,disabled:0===c.filter(e=>e.isValid).length||u,children:u?"Creating...":"Create ".concat(c.filter(e=>e.isValid).length," Users")})]})]}),c.some(e=>"success"===e.status)&&(0,l.jsx)("div",{className:"mb-4 p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,l.jsxs)("div",{className:"flex items-start",children:[(0,l.jsx)("div",{className:"mr-3 mt-1",children:(0,l.jsx)(P.Z,{className:"h-5 w-5 text-blue-500"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)(b.x,{className:"font-medium text-blue-800",children:"User creation complete"}),(0,l.jsxs)(b.x,{className:"block text-sm text-blue-700 mt-1",children:[(0,l.jsx)("span",{className:"font-medium",children:"Next step:"})," Download the credentials file containing Virtual Keys and invitation links. Users will need these Virtual Keys to make LLM requests through LiteLLM."]})]})]})}),(0,l.jsx)(w.Z,{dataSource:c,columns:[{title:"Row",dataIndex:"rowNumber",key:"rowNumber",width:80},{title:"Email",dataIndex:"user_email",key:"user_email"},{title:"Role",dataIndex:"user_role",key:"user_role"},{title:"Teams",dataIndex:"teams",key:"teams"},{title:"Budget",dataIndex:"max_budget",key:"max_budget"},{title:"Status",key:"status",render:(e,s)=>s.isValid?s.status&&"pending"!==s.status?"success"===s.status?(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(P.Z,{className:"h-5 w-5 text-green-500 mr-2"}),(0,l.jsx)("span",{className:"text-green-500",children:"Success"})]}),s.invitation_link&&(0,l.jsx)("div",{className:"mt-1",children:(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("span",{className:"text-xs text-gray-500 truncate max-w-[150px]",children:s.invitation_link}),(0,l.jsx)(E.CopyToClipboard,{text:s.invitation_link,onCopy:()=>O.Z.success("Invitation link copied!"),children:(0,l.jsx)("button",{className:"ml-1 text-blue-500 text-xs hover:text-blue-700",children:"Copy"})})]})})]}):(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(L.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,l.jsx)("span",{className:"text-red-500",children:"Failed"})]}),s.error&&(0,l.jsx)("span",{className:"text-sm text-red-500 ml-7",children:JSON.stringify(s.error)})]}):(0,l.jsx)("span",{className:"text-gray-500",children:"Pending"}):(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)(L.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,l.jsx)("span",{className:"text-red-500",children:"Invalid"})]}),s.error&&(0,l.jsx)("span",{className:"text-sm text-red-500 ml-7",children:s.error})]})}],size:"small",pagination:{pageSize:5},scroll:{y:300},rowClassName:e=>e.isValid?"":"bg-red-50"}),!c.some(e=>"success"===e.status||"failed"===e.status)&&(0,l.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,l.jsx)(b.z,{onClick:()=>{m([]),f(null)},variant:"secondary",className:"mr-3",children:"Back"}),(0,l.jsx)(b.z,{onClick:A,disabled:0===c.filter(e=>e.isValid).length||u,children:u?"Creating...":"Create ".concat(c.filter(e=>e.isValid).length," Users")})]}),c.some(e=>"success"===e.status||"failed"===e.status)&&(0,l.jsxs)("div",{className:"flex justify-end mt-4",children:[(0,l.jsx)(b.z,{onClick:()=>{m([]),f(null)},variant:"secondary",className:"mr-3",children:"Start New Bulk Import"}),(0,l.jsxs)(b.z,{onClick:()=>{let e=c.map(e=>({user_email:e.user_email,user_role:e.user_role,status:e.status,key:e.key||"",invitation_link:e.invitation_link||"",error:e.error||""})),s=new Blob([V().unparse(e)],{type:"text/csv"}),t=window.URL.createObjectURL(s),l=document.createElement("a");l.href=t,l.download="bulk_users_results.csv",document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(t)},variant:"primary",className:"flex items-center",children:[(0,l.jsx)(_.Z,{className:"mr-2"})," Download User Credentials"]})]})]})]})})})]})},z=t(99981),F=t(15424),B=t(46468),D=t(29827),M=t(84376);let{Option:A}=r.default,q=()=>"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let s=16*Math.random()|0;return("x"==e?s:3&s|8).toString(16)});var K=e=>{let{userID:s,accessToken:t,teams:b,possibleUIRoles:y,onUserCreated:N,isEmbedded:w=!1}=e,_=(0,D.NL)(),[C,k]=(0,a.useState)(null),[S]=i.Z.useForm(),[Z,U]=(0,a.useState)(!1),[I,V]=(0,a.useState)(!1),[L,P]=(0,a.useState)([]),[R,E]=(0,a.useState)(!1),[A,K]=(0,a.useState)(null),[J,W]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=async()=>{try{let e=await (0,v.modelAvailableCall)(t,s,"any"),l=[];for(let s=0;s{var l,a,r;try{O.Z.info("Making API Call"),w||U(!0),e.models&&0!==e.models.length||"proxy_admin"===e.user_role||(console.log("formValues.user_role",e.user_role),e.models=["no-default-models"]),console.log("formValues in create user:",e);let a=await (0,v.userCreateCall)(t,null,e);await _.invalidateQueries({queryKey:["userList"]}),console.log("user create Response:",a),V(!0);let r=(null===(l=a.data)||void 0===l?void 0:l.user_id)||a.user_id;if(N&&w){N(r),S.resetFields();return}if(null==C?void 0:C.SSO_ENABLED){let e={id:q(),user_id:r,is_accepted:!1,accepted_at:null,expires_at:new Date(Date.now()+6048e5),created_at:new Date,created_by:s,updated_at:new Date,updated_by:s,has_user_setup_sso:!0};K(e),E(!0)}else(0,v.invitationCreateCall)(t,r).then(e=>{e.has_user_setup_sso=!1,K(e),E(!0)});O.Z.success("API user Created"),S.resetFields(),localStorage.removeItem("userData"+s)}catch(s){let e=(null===(r=s.response)||void 0===r?void 0:null===(a=r.data)||void 0===a?void 0:a.detail)||(null==s?void 0:s.message)||"Error creating the user";O.Z.fromBackend(e),console.error("Error creating the user:",s)}};return w?(0,l.jsxs)(i.Z,{form:S,onFinish:$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsx)(i.Z.Item,{label:"User Email",name:"user_email",children:(0,l.jsx)(p.Z,{placeholder:""})}),(0,l.jsx)(i.Z.Item,{label:"User Role",name:"user_role",children:(0,l.jsx)(r.default,{children:y&&Object.entries(y).map(e=>{let[s,{ui_label:t,description:a}]=e;return(0,l.jsx)(h.Z,{value:s,title:t,children:(0,l.jsxs)("div",{className:"flex",children:[t," ",(0,l.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,l.jsx)(i.Z.Item,{label:"Team",name:"team_id",children:(0,l.jsx)(r.default,{placeholder:"Select Team",style:{width:"100%"},children:(0,l.jsx)(M.Z,{teams:b})})}),(0,l.jsx)(i.Z.Item,{label:"Metadata",name:"metadata",children:(0,l.jsx)(n.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(d.ZP,{htmlType:"submit",children:"Create User"})})]}):(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(x.Z,{className:"mb-0",onClick:()=>U(!0),children:"+ Invite User"}),(0,l.jsx)(T,{accessToken:t,teams:b,possibleUIRoles:y}),(0,l.jsxs)(o.Z,{title:"Invite User",visible:Z,width:800,footer:null,onOk:()=>{U(!1),S.resetFields()},onCancel:()=>{U(!1),V(!1),S.resetFields()},children:[(0,l.jsx)(f.Z,{className:"mb-1",children:"Create a User who can own keys"}),(0,l.jsxs)(i.Z,{form:S,onFinish:$,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsx)(i.Z.Item,{label:"User Email",name:"user_email",children:(0,l.jsx)(p.Z,{placeholder:""})}),(0,l.jsx)(i.Z.Item,{label:(0,l.jsxs)("span",{children:["Global Proxy Role"," ",(0,l.jsx)(z.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,l.jsx)(F.Z,{})})]}),name:"user_role",children:(0,l.jsx)(r.default,{children:y&&Object.entries(y).map(e=>{let[s,{ui_label:t,description:a}]=e;return(0,l.jsx)(h.Z,{value:s,title:t,children:(0,l.jsxs)("div",{className:"flex",children:[t," ",(0,l.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,l.jsx)(i.Z.Item,{label:"Team",className:"gap-2",name:"team_id",help:"If selected, user will be added as a 'user' role to the team.",children:(0,l.jsx)(M.Z,{teams:b})}),(0,l.jsx)(i.Z.Item,{label:"Metadata",name:"metadata",children:(0,l.jsx)(n.default.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,l.jsxs)(c.Z,{children:[(0,l.jsx)(u.Z,{children:(0,l.jsx)(j.Z,{children:"Personal Key Creation"})}),(0,l.jsx)(m.Z,{children:(0,l.jsx)(i.Z.Item,{className:"gap-2",label:(0,l.jsxs)("span",{children:["Models"," ",(0,l.jsx)(z.Z,{title:"Models user has access to, outside of team scope.",children:(0,l.jsx)(F.Z,{style:{marginLeft:"4px"}})})]}),name:"models",help:"Models user has access to, outside of team scope.",children:(0,l.jsxs)(r.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,l.jsx)(r.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,l.jsx)(r.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),L.map(e=>(0,l.jsx)(r.default.Option,{value:e,children:(0,B.W0)(e)},e))]})})})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(d.ZP,{htmlType:"submit",children:"Create User"})})]})]}),I&&(0,l.jsx)(g.Z,{isInvitationLinkModalVisible:R,setIsInvitationLinkModalVisible:E,baseUrl:J||"",invitationLinkData:A})]})}},98187:function(e,s,t){t.d(s,{Z:function(){return o}});var l=t(57437);t(2265);var a=t(57840),r=t(22116),i=t(29233),n=t(19431),d=t(9114);function o(e){let{isInvitationLinkModalVisible:s,setIsInvitationLinkModalVisible:t,baseUrl:o,invitationLinkData:c,modalType:m="invitation"}=e,{Title:u,Paragraph:x}=a.default,h=()=>{if(!o)return"";let e=new URL(o).pathname,s=e&&"/"!==e?"".concat(e,"/ui"):"ui";if(null==c?void 0:c.has_user_setup_sso)return new URL(s,o).toString();let t="".concat(s,"?invitation_id=").concat(null==c?void 0:c.id);return"resetPassword"===m&&(t+="&action=reset_password"),new URL(t,o).toString()};return(0,l.jsxs)(r.Z,{title:"invitation"===m?"Invitation Link":"Reset Password Link",visible:s,width:800,footer:null,onOk:()=>{t(!1)},onCancel:()=>{t(!1)},children:[(0,l.jsx)(x,{children:"invitation"===m?"Copy and send the generated link to onboard this user to the proxy.":"Copy and send the generated link to the user to reset their password."}),(0,l.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,l.jsx)(n.x,{className:"text-base",children:"User ID"}),(0,l.jsx)(n.x,{children:null==c?void 0:c.user_id})]}),(0,l.jsxs)("div",{className:"flex justify-between pt-5 pb-2",children:[(0,l.jsx)(n.x,{children:"invitation"===m?"Invitation Link":"Reset Password Link"}),(0,l.jsx)(n.x,{children:(0,l.jsx)(n.x,{children:h()})})]}),(0,l.jsx)("div",{className:"flex justify-end mt-5",children:(0,l.jsx)(i.CopyToClipboard,{text:h(),onCopy:()=>d.Z.success("Copied!"),children:(0,l.jsx)(n.z,{variant:"primary",children:"invitation"===m?"Copy invitation link":"Copy password reset link"})})})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2512-088e26ac9d573932.js b/litellm/proxy/_experimental/out/_next/static/chunks/2512-088e26ac9d573932.js deleted file mode 100644 index e4988d21b7f..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2512-088e26ac9d573932.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2512],{47323:function(t,o,e){e.d(o,{Z:function(){return b}});var n=e(5853),c=e(2265),i=e(47187),a=e(7084),r=e(13241),l=e(1153),s=e(26898);let d={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},m={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},g={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(t,o)=>{switch(t){case"simple":return{textColor:o?(0,l.bM)(o,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:o?(0,l.bM)(o,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:o?(0,r.q)((0,l.bM)(o,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:o?(0,l.bM)(o,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:o?(0,r.q)((0,l.bM)(o,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:o?(0,l.bM)(o,s.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:o?(0,r.q)((0,l.bM)(o,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:o?(0,l.bM)(o,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:o?(0,r.q)((0,l.bM)(o,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:o?(0,l.bM)(o,s.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:o?(0,r.q)((0,l.bM)(o,s.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},u=(0,l.fn)("Icon"),b=c.forwardRef((t,o)=>{let{icon:e,variant:s="simple",tooltip:b,size:h=a.u8.SM,color:f,className:v}=t,C=(0,n._T)(t,["icon","variant","tooltip","size","color","className"]),S=p(s,f),{tooltipProps:k,getReferenceProps:y}=(0,i.l)();return c.createElement("span",Object.assign({ref:(0,l.lq)([o,k.refs.setReference]),className:(0,r.q)(u("root"),"inline-flex shrink-0 items-center justify-center",S.bgColor,S.textColor,S.borderColor,S.ringColor,g[s].rounded,g[s].border,g[s].shadow,g[s].ring,d[h].paddingX,d[h].paddingY,v)},y,C),c.createElement(i.Z,Object.assign({text:b},k)),c.createElement(e,{className:(0,r.q)(u("icon"),"shrink-0",m[h].height,m[h].width)}))});b.displayName="Icon"},15690:function(t,o,e){e.d(o,{default:function(){return F}});var n=e(2265),c=e(9738),i=e(49638),a=e(36760),r=e.n(a),l=e(1119),s=e(31686),d=e(11993),m=e(6989),g=e(95814),p=["className","prefixCls","style","active","status","iconPrefix","icon","wrapperStyle","stepNumber","disabled","description","title","subTitle","progressDot","stepIcon","tailContent","icons","stepIndex","onStepClick","onClick","render"];function u(t){return"string"==typeof t}var b=function(t){var o,e,c,i,a,b=t.className,h=t.prefixCls,f=t.style,v=t.active,C=t.status,S=t.iconPrefix,k=t.icon,y=(t.wrapperStyle,t.stepNumber),w=t.disabled,x=t.description,I=t.title,q=t.subTitle,O=t.progressDot,E=t.stepIcon,z=t.tailContent,T=t.icons,j=t.stepIndex,N=t.onStepClick,H=t.onClick,M=t.render,B=(0,m.Z)(t,p),W={};N&&!w&&(W.role="button",W.tabIndex=0,W.onClick=function(t){null==H||H(t),N(j)},W.onKeyDown=function(t){var o=t.which;(o===g.Z.ENTER||o===g.Z.SPACE)&&N(j)});var X=r()("".concat(h,"-item"),"".concat(h,"-item-").concat(C||"wait"),b,(a={},(0,d.Z)(a,"".concat(h,"-item-custom"),k),(0,d.Z)(a,"".concat(h,"-item-active"),v),(0,d.Z)(a,"".concat(h,"-item-disabled"),!0===w),a)),Z=(0,s.Z)({},f),P=n.createElement("div",(0,l.Z)({},B,{className:X,style:Z}),n.createElement("div",(0,l.Z)({onClick:H},W,{className:"".concat(h,"-item-container")}),n.createElement("div",{className:"".concat(h,"-item-tail")},z),n.createElement("div",{className:"".concat(h,"-item-icon")},(c=r()("".concat(h,"-icon"),"".concat(S,"icon"),(o={},(0,d.Z)(o,"".concat(S,"icon-").concat(k),k&&u(k)),(0,d.Z)(o,"".concat(S,"icon-check"),!k&&"finish"===C&&(T&&!T.finish||!T)),(0,d.Z)(o,"".concat(S,"icon-cross"),!k&&"error"===C&&(T&&!T.error||!T)),o)),i=n.createElement("span",{className:"".concat(h,"-icon-dot")}),e=O?"function"==typeof O?n.createElement("span",{className:"".concat(h,"-icon")},O(i,{index:y-1,status:C,title:I,description:x})):n.createElement("span",{className:"".concat(h,"-icon")},i):k&&!u(k)?n.createElement("span",{className:"".concat(h,"-icon")},k):T&&T.finish&&"finish"===C?n.createElement("span",{className:"".concat(h,"-icon")},T.finish):T&&T.error&&"error"===C?n.createElement("span",{className:"".concat(h,"-icon")},T.error):k||"finish"===C||"error"===C?n.createElement("span",{className:c}):n.createElement("span",{className:"".concat(h,"-icon")},y),E&&(e=E({index:y-1,status:C,title:I,description:x,node:e})),e)),n.createElement("div",{className:"".concat(h,"-item-content")},n.createElement("div",{className:"".concat(h,"-item-title")},I,q&&n.createElement("div",{title:"string"==typeof q?q:void 0,className:"".concat(h,"-item-subtitle")},q)),x&&n.createElement("div",{className:"".concat(h,"-item-description")},x))));return M&&(P=M(P)||null),P},h=["prefixCls","style","className","children","direction","type","labelPlacement","iconPrefix","status","size","current","progressDot","stepIcon","initial","icons","onChange","itemRender","items"];function f(t){var o,e=t.prefixCls,c=void 0===e?"rc-steps":e,i=t.style,a=void 0===i?{}:i,g=t.className,p=(t.children,t.direction),u=t.type,f=void 0===u?"default":u,v=t.labelPlacement,C=t.iconPrefix,S=void 0===C?"rc":C,k=t.status,y=void 0===k?"process":k,w=t.size,x=t.current,I=void 0===x?0:x,q=t.progressDot,O=t.stepIcon,E=t.initial,z=void 0===E?0:E,T=t.icons,j=t.onChange,N=t.itemRender,H=t.items,M=(0,m.Z)(t,h),B="inline"===f,W=B||void 0!==q&&q,X=B?"horizontal":void 0===p?"horizontal":p,Z=B?void 0:w,P=r()(c,"".concat(c,"-").concat(X),g,(o={},(0,d.Z)(o,"".concat(c,"-").concat(Z),Z),(0,d.Z)(o,"".concat(c,"-label-").concat(W?"vertical":void 0===v?"horizontal":v),"horizontal"===X),(0,d.Z)(o,"".concat(c,"-dot"),!!W),(0,d.Z)(o,"".concat(c,"-navigation"),"navigation"===f),(0,d.Z)(o,"".concat(c,"-inline"),B),o)),D=function(t){j&&I!==t&&j(t)};return n.createElement("div",(0,l.Z)({className:P,style:a},M),(void 0===H?[]:H).filter(function(t){return t}).map(function(t,o){var e=(0,s.Z)({},t),i=z+o;return"error"===y&&o===I-1&&(e.className="".concat(c,"-next-error")),e.status||(i===I?e.status=y:i{let{componentCls:o,customIconTop:e,customIconSize:n,customIconFontSize:c}=t;return{["".concat(o,"-item-custom")]:{["> ".concat(o,"-item-container > ").concat(o,"-item-icon")]:{height:"auto",background:"none",border:0,["> ".concat(o,"-icon")]:{top:e,width:n,height:n,fontSize:c,lineHeight:(0,w.bf)(n)}}},["&:not(".concat(o,"-vertical)")]:{["".concat(o,"-item-custom")]:{["".concat(o,"-item-icon")]:{width:"auto",background:"none"}}}}},E=t=>{let{componentCls:o}=t;return{["".concat(o,"-horizontal")]:{["".concat("".concat(o,"-item"),"-tail")]:{transform:"translateY(-50%)"}}}},z=t=>{let{componentCls:o,inlineDotSize:e,inlineTitleColor:n,inlineTailColor:c}=t,i=t.calc(t.paddingXS).add(t.lineWidth).equal(),a={["".concat(o,"-item-container ").concat(o,"-item-content ").concat(o,"-item-title")]:{color:n}};return{["&".concat(o,"-inline")]:{width:"auto",display:"inline-flex",["".concat(o,"-item")]:{flex:"none","&-container":{padding:"".concat((0,w.bf)(i)," ").concat((0,w.bf)(t.paddingXXS)," 0"),margin:"0 ".concat((0,w.bf)(t.calc(t.marginXXS).div(2).equal())),borderRadius:t.borderRadiusSM,cursor:"pointer",transition:"background-color ".concat(t.motionDurationMid),"&:hover":{background:t.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:e,height:e,marginInlineStart:"calc(50% - ".concat((0,w.bf)(t.calc(e).div(2).equal()),")"),["> ".concat(o,"-icon")]:{top:0},["".concat(o,"-icon-dot")]:{borderRadius:t.calc(t.fontSizeSM).div(4).equal(),"&::after":{display:"none"}}},"&-content":{width:"auto",marginTop:t.calc(t.marginXS).sub(t.lineWidth).equal()},"&-title":{color:n,fontSize:t.fontSizeSM,lineHeight:t.lineHeightSM,fontWeight:"normal",marginBottom:t.calc(t.marginXXS).div(2).equal()},"&-description":{display:"none"},"&-tail":{marginInlineStart:0,top:t.calc(e).div(2).add(i).equal(),transform:"translateY(-50%)","&:after":{width:"100%",height:t.lineWidth,borderRadius:0,marginInlineStart:0,background:c}},["&:first-child ".concat(o,"-item-tail")]:{width:"50%",marginInlineStart:"50%"},["&:last-child ".concat(o,"-item-tail")]:{display:"block",width:"50%"},"&-wait":Object.assign({["".concat(o,"-item-icon ").concat(o,"-icon ").concat(o,"-icon-dot")]:{backgroundColor:t.colorBorderBg,border:"".concat((0,w.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c)}},a),"&-finish":Object.assign({["".concat(o,"-item-tail::after")]:{backgroundColor:c},["".concat(o,"-item-icon ").concat(o,"-icon ").concat(o,"-icon-dot")]:{backgroundColor:c,border:"".concat((0,w.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(c)}},a),"&-error":a,"&-active, &-process":Object.assign({["".concat(o,"-item-icon")]:{width:e,height:e,marginInlineStart:"calc(50% - ".concat((0,w.bf)(t.calc(e).div(2).equal()),")"),top:0}},a),["&:not(".concat(o,"-item-active) > ").concat(o,"-item-container[role='button']:hover")]:{["".concat(o,"-item-title")]:{color:n}}}}}},T=t=>{let{componentCls:o,iconSize:e,lineHeight:n,iconSizeSM:c}=t;return{["&".concat(o,"-label-vertical")]:{["".concat(o,"-item")]:{overflow:"visible","&-tail":{marginInlineStart:t.calc(e).div(2).add(t.controlHeightLG).equal(),padding:"0 ".concat((0,w.bf)(t.paddingLG))},"&-content":{display:"block",width:t.calc(e).div(2).add(t.controlHeightLG).mul(2).equal(),marginTop:t.marginSM,textAlign:"center"},"&-icon":{display:"inline-block",marginInlineStart:t.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:"none"}},"&-subtitle":{display:"block",marginBottom:t.marginXXS,marginInlineStart:0,lineHeight:n}},["&".concat(o,"-small:not(").concat(o,"-dot)")]:{["".concat(o,"-item")]:{"&-icon":{marginInlineStart:t.calc(e).sub(c).div(2).add(t.controlHeightLG).equal()}}}}}},j=t=>{let{componentCls:o,navContentMaxWidth:e,navArrowColor:n,stepsNavActiveColor:c,motionDurationSlow:i}=t;return{["&".concat(o,"-navigation")]:{paddingTop:t.paddingSM,["&".concat(o,"-small")]:{["".concat(o,"-item")]:{"&-container":{marginInlineStart:t.calc(t.marginSM).mul(-1).equal()}}},["".concat(o,"-item")]:{overflow:"visible",textAlign:"center","&-container":{display:"inline-block",height:"100%",marginInlineStart:t.calc(t.margin).mul(-1).equal(),paddingBottom:t.paddingSM,textAlign:"start",transition:"opacity ".concat(i),["".concat(o,"-item-content")]:{maxWidth:e},["".concat(o,"-item-title")]:Object.assign(Object.assign({maxWidth:"100%",paddingInlineEnd:0},x.vS),{"&::after":{display:"none"}})},["&:not(".concat(o,"-item-active)")]:{["".concat(o,"-item-container[role='button']")]:{cursor:"pointer","&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:"none"}},"&::after":{position:"absolute",top:"calc(50% - ".concat((0,w.bf)(t.calc(t.paddingSM).div(2).equal()),")"),insetInlineStart:"100%",display:"inline-block",width:t.fontSizeIcon,height:t.fontSizeIcon,borderTop:"".concat((0,w.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(n),borderBottom:"none",borderInlineStart:"none",borderInlineEnd:"".concat((0,w.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(n),transform:"translateY(-50%) translateX(-50%) rotate(45deg)",content:'""'},"&::before":{position:"absolute",bottom:0,insetInlineStart:"50%",display:"inline-block",width:0,height:t.lineWidthBold,backgroundColor:c,transition:"width ".concat(i,", inset-inline-start ").concat(i),transitionTimingFunction:"ease-out",content:'""'}},["".concat(o,"-item").concat(o,"-item-active::before")]:{insetInlineStart:0,width:"100%"}},["&".concat(o,"-navigation").concat(o,"-vertical")]:{["> ".concat(o,"-item")]:{marginInlineEnd:0,"&::before":{display:"none"},["&".concat(o,"-item-active::before")]:{top:0,insetInlineEnd:0,insetInlineStart:"unset",display:"block",width:t.calc(t.lineWidth).mul(3).equal(),height:"calc(100% - ".concat((0,w.bf)(t.marginLG),")")},"&::after":{position:"relative",insetInlineStart:"50%",display:"block",width:t.calc(t.controlHeight).mul(.25).equal(),height:t.calc(t.controlHeight).mul(.25).equal(),marginBottom:t.marginXS,textAlign:"center",transform:"translateY(-50%) translateX(-50%) rotate(135deg)"},"&:last-child":{"&::after":{display:"none"}},["> ".concat(o,"-item-container > ").concat(o,"-item-tail")]:{visibility:"hidden"}}},["&".concat(o,"-navigation").concat(o,"-horizontal")]:{["> ".concat(o,"-item > ").concat(o,"-item-container > ").concat(o,"-item-tail")]:{visibility:"hidden"}}}},N=t=>{let{antCls:o,componentCls:e,iconSize:n,iconSizeSM:c,processIconColor:i,marginXXS:a,lineWidthBold:r,lineWidth:l,paddingXXS:s}=t,d=t.calc(n).add(t.calc(r).mul(4).equal()).equal(),m=t.calc(c).add(t.calc(t.lineWidth).mul(4).equal()).equal();return{["&".concat(e,"-with-progress")]:{["".concat(e,"-item")]:{paddingTop:s,["&-process ".concat(e,"-item-container ").concat(e,"-item-icon ").concat(e,"-icon")]:{color:i}},["&".concat(e,"-vertical > ").concat(e,"-item ")]:{paddingInlineStart:s,["> ".concat(e,"-item-container > ").concat(e,"-item-tail")]:{top:a,insetInlineStart:t.calc(n).div(2).sub(l).add(s).equal()}},["&, &".concat(e,"-small")]:{["&".concat(e,"-horizontal ").concat(e,"-item:first-child")]:{paddingBottom:s,paddingInlineStart:s}},["&".concat(e,"-small").concat(e,"-vertical > ").concat(e,"-item > ").concat(e,"-item-container > ").concat(e,"-item-tail")]:{insetInlineStart:t.calc(c).div(2).sub(l).add(s).equal()},["&".concat(e,"-label-vertical ").concat(e,"-item ").concat(e,"-item-tail")]:{top:t.calc(n).div(2).add(s).equal()},["".concat(e,"-item-icon")]:{position:"relative",["".concat(o,"-progress")]:{position:"absolute",insetInlineStart:"50%",top:"50%",transform:"translate(-50%, -50%)","&-inner":{width:"".concat((0,w.bf)(d)," !important"),height:"".concat((0,w.bf)(d)," !important")}}},["&".concat(e,"-small")]:{["&".concat(e,"-label-vertical ").concat(e,"-item ").concat(e,"-item-tail")]:{top:t.calc(c).div(2).add(s).equal()},["".concat(e,"-item-icon ").concat(o,"-progress-inner")]:{width:"".concat((0,w.bf)(m)," !important"),height:"".concat((0,w.bf)(m)," !important")}}}}},H=t=>{let{componentCls:o,descriptionMaxWidth:e,lineHeight:n,dotCurrentSize:c,dotSize:i,motionDurationSlow:a}=t;return{["&".concat(o,"-dot, &").concat(o,"-dot").concat(o,"-small")]:{["".concat(o,"-item")]:{"&-title":{lineHeight:n},"&-tail":{top:t.calc(t.dotSize).sub(t.calc(t.lineWidth).mul(3).equal()).div(2).equal(),width:"100%",marginTop:0,marginBottom:0,marginInline:"".concat((0,w.bf)(t.calc(e).div(2).equal())," 0"),padding:0,"&::after":{width:"calc(100% - ".concat((0,w.bf)(t.calc(t.marginSM).mul(2).equal()),")"),height:t.calc(t.lineWidth).mul(3).equal(),marginInlineStart:t.marginSM}},"&-icon":{width:i,height:i,marginInlineStart:t.calc(t.descriptionMaxWidth).sub(i).div(2).equal(),paddingInlineEnd:0,lineHeight:(0,w.bf)(i),background:"transparent",border:0,["".concat(o,"-icon-dot")]:{position:"relative",float:"left",width:"100%",height:"100%",borderRadius:100,transition:"all ".concat(a),"&::after":{position:"absolute",top:t.calc(t.marginSM).mul(-1).equal(),insetInlineStart:t.calc(i).sub(t.calc(t.controlHeightLG).mul(1.5).equal()).div(2).equal(),width:t.calc(t.controlHeightLG).mul(1.5).equal(),height:t.controlHeight,background:"transparent",content:'""'}}},"&-content":{width:e},["&-process ".concat(o,"-item-icon")]:{position:"relative",top:t.calc(i).sub(c).div(2).equal(),width:c,height:c,lineHeight:(0,w.bf)(c),background:"none",marginInlineStart:t.calc(t.descriptionMaxWidth).sub(c).div(2).equal()},["&-process ".concat(o,"-icon")]:{["&:first-child ".concat(o,"-icon-dot")]:{insetInlineStart:0}}}},["&".concat(o,"-vertical").concat(o,"-dot")]:{["".concat(o,"-item-icon")]:{marginTop:t.calc(t.controlHeight).sub(i).div(2).equal(),marginInlineStart:0,background:"none"},["".concat(o,"-item-process ").concat(o,"-item-icon")]:{marginTop:t.calc(t.controlHeight).sub(c).div(2).equal(),top:0,insetInlineStart:t.calc(i).sub(c).div(2).equal(),marginInlineStart:0},["".concat(o,"-item > ").concat(o,"-item-container > ").concat(o,"-item-tail")]:{top:t.calc(t.controlHeight).sub(i).div(2).equal(),insetInlineStart:0,margin:0,padding:"".concat((0,w.bf)(t.calc(i).add(t.paddingXS).equal())," 0 ").concat((0,w.bf)(t.paddingXS)),"&::after":{marginInlineStart:t.calc(i).sub(t.lineWidth).div(2).equal()}},["&".concat(o,"-small")]:{["".concat(o,"-item-icon")]:{marginTop:t.calc(t.controlHeightSM).sub(i).div(2).equal()},["".concat(o,"-item-process ").concat(o,"-item-icon")]:{marginTop:t.calc(t.controlHeightSM).sub(c).div(2).equal()},["".concat(o,"-item > ").concat(o,"-item-container > ").concat(o,"-item-tail")]:{top:t.calc(t.controlHeightSM).sub(i).div(2).equal()}},["".concat(o,"-item:first-child ").concat(o,"-icon-dot")]:{insetInlineStart:0},["".concat(o,"-item-content")]:{width:"inherit"}}}},M=t=>{let{componentCls:o}=t;return{["&".concat(o,"-rtl")]:{direction:"rtl",["".concat(o,"-item")]:{"&-subtitle":{float:"left"}},["&".concat(o,"-navigation")]:{["".concat(o,"-item::after")]:{transform:"rotate(-45deg)"}},["&".concat(o,"-vertical")]:{["> ".concat(o,"-item")]:{"&::after":{transform:"rotate(225deg)"},["".concat(o,"-item-icon")]:{float:"right"}}},["&".concat(o,"-dot")]:{["".concat(o,"-item-icon ").concat(o,"-icon-dot, &").concat(o,"-small ").concat(o,"-item-icon ").concat(o,"-icon-dot")]:{float:"right"}}}}},B=t=>{let{componentCls:o,iconSizeSM:e,fontSizeSM:n,fontSize:c,colorTextDescription:i}=t;return{["&".concat(o,"-small")]:{["&".concat(o,"-horizontal:not(").concat(o,"-label-vertical) ").concat(o,"-item")]:{paddingInlineStart:t.paddingSM,"&:first-child":{paddingInlineStart:0}},["".concat(o,"-item-icon")]:{width:e,height:e,marginTop:0,marginBottom:0,marginInline:"0 ".concat((0,w.bf)(t.marginXS)),fontSize:n,lineHeight:(0,w.bf)(e),textAlign:"center",borderRadius:e},["".concat(o,"-item-title")]:{paddingInlineEnd:t.paddingSM,fontSize:c,lineHeight:(0,w.bf)(e),"&::after":{top:t.calc(e).div(2).equal()}},["".concat(o,"-item-description")]:{color:i,fontSize:c},["".concat(o,"-item-tail")]:{top:t.calc(e).div(2).sub(t.paddingXXS).equal()},["".concat(o,"-item-custom ").concat(o,"-item-icon")]:{width:"inherit",height:"inherit",lineHeight:"inherit",background:"none",border:0,borderRadius:0,["> ".concat(o,"-icon")]:{fontSize:e,lineHeight:(0,w.bf)(e),transform:"none"}}}}},W=t=>{let{componentCls:o,iconSizeSM:e,iconSize:n}=t;return{["&".concat(o,"-vertical")]:{display:"flex",flexDirection:"column",["> ".concat(o,"-item")]:{display:"block",flex:"1 0 auto",paddingInlineStart:0,overflow:"visible",["".concat(o,"-item-icon")]:{float:"left",marginInlineEnd:t.margin},["".concat(o,"-item-content")]:{display:"block",minHeight:t.calc(t.controlHeight).mul(1.5).equal(),overflow:"hidden"},["".concat(o,"-item-title")]:{lineHeight:(0,w.bf)(n)},["".concat(o,"-item-description")]:{paddingBottom:t.paddingSM}},["> ".concat(o,"-item > ").concat(o,"-item-container > ").concat(o,"-item-tail")]:{position:"absolute",top:0,insetInlineStart:t.calc(n).div(2).sub(t.lineWidth).equal(),width:t.lineWidth,height:"100%",padding:"".concat((0,w.bf)(t.calc(t.marginXXS).mul(1.5).add(n).equal())," 0 ").concat((0,w.bf)(t.calc(t.marginXXS).mul(1.5).equal())),"&::after":{width:t.lineWidth,height:"100%"}},["> ".concat(o,"-item:not(:last-child) > ").concat(o,"-item-container > ").concat(o,"-item-tail")]:{display:"block"},[" > ".concat(o,"-item > ").concat(o,"-item-container > ").concat(o,"-item-content > ").concat(o,"-item-title")]:{"&::after":{display:"none"}},["&".concat(o,"-small ").concat(o,"-item-container")]:{["".concat(o,"-item-tail")]:{position:"absolute",top:0,insetInlineStart:t.calc(e).div(2).sub(t.lineWidth).equal(),padding:"".concat((0,w.bf)(t.calc(t.marginXXS).mul(1.5).add(e).equal())," 0 ").concat((0,w.bf)(t.calc(t.marginXXS).mul(1.5).equal()))},["".concat(o,"-item-title")]:{lineHeight:(0,w.bf)(e)}}}}};let X=(t,o)=>{let e="".concat(o.componentCls,"-item"),n="".concat(t,"IconColor"),c="".concat(t,"TitleColor"),i="".concat(t,"DescriptionColor"),a="".concat(t,"TailColor"),r="".concat(t,"IconBgColor"),l="".concat(t,"IconBorderColor"),s="".concat(t,"DotColor");return{["".concat(e,"-").concat(t," ").concat(e,"-icon")]:{backgroundColor:o[r],borderColor:o[l],["> ".concat(o.componentCls,"-icon")]:{color:o[n],["".concat(o.componentCls,"-icon-dot")]:{background:o[s]}}},["".concat(e,"-").concat(t).concat(e,"-custom ").concat(e,"-icon")]:{["> ".concat(o.componentCls,"-icon")]:{color:o[s]}},["".concat(e,"-").concat(t," > ").concat(e,"-container > ").concat(e,"-content > ").concat(e,"-title")]:{color:o[c],"&::after":{backgroundColor:o[a]}},["".concat(e,"-").concat(t," > ").concat(e,"-container > ").concat(e,"-content > ").concat(e,"-description")]:{color:o[i]},["".concat(e,"-").concat(t," > ").concat(e,"-container > ").concat(e,"-tail::after")]:{backgroundColor:o[a]}}},Z=t=>{let{componentCls:o,motionDurationSlow:e}=t,n="".concat(o,"-item"),c="".concat(n,"-icon");return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[n]:{position:"relative",display:"inline-block",flex:1,overflow:"hidden",verticalAlign:"top","&:last-child":{flex:"none",["> ".concat(n,"-container > ").concat(n,"-tail, > ").concat(n,"-container > ").concat(n,"-content > ").concat(n,"-title::after")]:{display:"none"}}},["".concat(n,"-container")]:{outline:"none",["&:focus-visible ".concat(c)]:(0,x.oN)(t)},["".concat(c,", ").concat(n,"-content")]:{display:"inline-block",verticalAlign:"top"},[c]:{width:t.iconSize,height:t.iconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:t.marginXS,fontSize:t.iconFontSize,fontFamily:t.fontFamily,lineHeight:(0,w.bf)(t.iconSize),textAlign:"center",borderRadius:t.iconSize,border:"".concat((0,w.bf)(t.lineWidth)," ").concat(t.lineType," transparent"),transition:"background-color ".concat(e,", border-color ").concat(e),["".concat(o,"-icon")]:{position:"relative",top:t.iconTop,color:t.colorPrimary,lineHeight:1}},["".concat(n,"-tail")]:{position:"absolute",top:t.calc(t.iconSize).div(2).equal(),insetInlineStart:0,width:"100%","&::after":{display:"inline-block",width:"100%",height:t.lineWidth,background:t.colorSplit,borderRadius:t.lineWidth,transition:"background ".concat(e),content:'""'}},["".concat(n,"-title")]:{position:"relative",display:"inline-block",paddingInlineEnd:t.padding,color:t.colorText,fontSize:t.fontSizeLG,lineHeight:(0,w.bf)(t.titleLineHeight),"&::after":{position:"absolute",top:t.calc(t.titleLineHeight).div(2).equal(),insetInlineStart:"100%",display:"block",width:9999,height:t.lineWidth,background:t.processTailColor,content:'""'}},["".concat(n,"-subtitle")]:{display:"inline",marginInlineStart:t.marginXS,color:t.colorTextDescription,fontWeight:"normal",fontSize:t.fontSize},["".concat(n,"-description")]:{color:t.colorTextDescription,fontSize:t.fontSize}},X("wait",t)),X("process",t)),{["".concat(n,"-process > ").concat(n,"-container > ").concat(n,"-title")]:{fontWeight:t.fontWeightStrong}}),X("finish",t)),X("error",t)),{["".concat(n).concat(o,"-next-error > ").concat(o,"-item-title::after")]:{background:t.colorError},["".concat(n,"-disabled")]:{cursor:"not-allowed"}})},P=t=>{let{componentCls:o,motionDurationSlow:e}=t;return{["& ".concat(o,"-item")]:{["&:not(".concat(o,"-item-active)")]:{["& > ".concat(o,"-item-container[role='button']")]:{cursor:"pointer",["".concat(o,"-item")]:{["&-title, &-subtitle, &-description, &-icon ".concat(o,"-icon")]:{transition:"color ".concat(e)}},"&:hover":{["".concat(o,"-item")]:{"&-title, &-subtitle, &-description":{color:t.colorPrimary}}}},["&:not(".concat(o,"-item-process)")]:{["& > ".concat(o,"-item-container[role='button']:hover")]:{["".concat(o,"-item")]:{"&-icon":{borderColor:t.colorPrimary,["".concat(o,"-icon")]:{color:t.colorPrimary}}}}}}},["&".concat(o,"-horizontal:not(").concat(o,"-label-vertical)")]:{["".concat(o,"-item")]:{paddingInlineStart:t.padding,whiteSpace:"nowrap","&:first-child":{paddingInlineStart:0},["&:last-child ".concat(o,"-item-title")]:{paddingInlineEnd:0},"&-tail":{display:"none"},"&-description":{maxWidth:t.descriptionMaxWidth,whiteSpace:"normal"}}}}},D=t=>{let{componentCls:o}=t;return{[o]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,x.Wf)(t)),{display:"flex",width:"100%",fontSize:0,textAlign:"initial"}),Z(t)),P(t)),O(t)),B(t)),W(t)),E(t)),T(t)),H(t)),j(t)),M(t)),N(t)),z(t))}};var L=(0,I.I$)("Steps",t=>{let{colorTextDisabled:o,controlHeightLG:e,colorTextLightSolid:n,colorText:c,colorPrimary:i,colorTextDescription:a,colorTextQuaternary:r,colorError:l,colorBorderSecondary:s,colorSplit:d}=t;return D((0,q.IX)(t,{processIconColor:n,processTitleColor:c,processDescriptionColor:c,processIconBgColor:i,processIconBorderColor:i,processDotColor:i,processTailColor:d,waitTitleColor:a,waitDescriptionColor:a,waitTailColor:d,waitDotColor:o,finishIconColor:i,finishTitleColor:c,finishDescriptionColor:a,finishTailColor:i,finishDotColor:i,errorIconColor:n,errorTitleColor:l,errorDescriptionColor:l,errorTailColor:d,errorIconBgColor:l,errorIconBorderColor:l,errorDotColor:l,stepsNavActiveColor:i,stepsProgressSize:e,inlineDotSize:6,inlineTitleColor:r,inlineTailColor:s}))},t=>({titleLineHeight:t.controlHeight,customIconSize:t.controlHeight,customIconTop:0,customIconFontSize:t.controlHeightSM,iconSize:t.controlHeight,iconTop:-.5,iconFontSize:t.fontSize,iconSizeSM:t.fontSizeHeading3,dotSize:t.controlHeight/4,dotCurrentSize:t.controlHeightLG/4,navArrowColor:t.colorTextDisabled,navContentMaxWidth:"unset",descriptionMaxWidth:140,waitIconColor:t.wireframe?t.colorTextDisabled:t.colorTextLabel,waitIconBgColor:t.wireframe?t.colorBgContainer:t.colorFillContent,waitIconBorderColor:t.wireframe?t.colorTextDisabled:"transparent",finishIconBgColor:t.wireframe?t.colorBgContainer:t.controlItemBgActive,finishIconBorderColor:t.wireframe?t.colorPrimary:t.controlItemBgActive})),R=e(45287),A=function(t,o){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>o.indexOf(n)&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,n=Object.getOwnPropertySymbols(t);co.indexOf(n[c])&&Object.prototype.propertyIsEnumerable.call(t,n[c])&&(e[n[c]]=t[n[c]]);return e};let K=t=>{let{percent:o,size:e,className:a,rootClassName:l,direction:s,items:d,responsive:m=!0,current:g=0,children:p,style:u}=t,b=A(t,["percent","size","className","rootClassName","direction","items","responsive","current","children","style"]),{xs:h}=(0,S.Z)(m),{getPrefixCls:w,direction:x,className:I,style:q}=(0,v.dj)("steps"),O=n.useMemo(()=>m&&h?"vertical":s,[m,h,s]),E=(0,C.Z)(e),z=w("steps",t.prefixCls),[T,j,N]=L(z),H="inline"===t.type,M=w("",t.iconPrefix),B=d||(0,R.Z)(p).map(t=>{if(n.isValidElement(t)){let{props:o}=t;return Object.assign({},o)}return null}).filter(t=>t),W=H?void 0:o,X=Object.assign(Object.assign({},q),u),Z=r()(I,{["".concat(z,"-rtl")]:"rtl"===x,["".concat(z,"-with-progress")]:void 0!==W},a,l,j,N),P={finish:n.createElement(c.Z,{className:"".concat(z,"-finish-icon")}),error:n.createElement(i.Z,{className:"".concat(z,"-error-icon")})};return T(n.createElement(f,Object.assign({icons:P},b,{style:X,current:g,size:E,items:B,itemRender:H?(t,o)=>t.description?n.createElement(y.Z,{title:t.description},o):o:void 0,stepIcon:t=>{let{node:o,status:e}=t;return"process"===e&&void 0!==W?n.createElement("div",{className:"".concat(z,"-progress-icon")},n.createElement(k.Z,{type:"circle",percent:W,size:"small"===E?32:40,strokeWidth:4,format:()=>null}),o):o},direction:O,prefixCls:z,iconPrefix:M,className:Z})))};K.Step=f.Step;var F=K},3810:function(t,o,e){e.d(o,{Z:function(){return T}});var n=e(2265),c=e(36760),i=e.n(c),a=e(18694),r=e(93350),l=e(53445),s=e(19722),d=e(6694),m=e(71744),g=e(93463),p=e(54558),u=e(12918),b=e(71140),h=e(99320);let f=t=>{let{paddingXXS:o,lineWidth:e,tagPaddingHorizontal:n,componentCls:c,calc:i}=t,a=i(n).sub(e).equal(),r=i(o).sub(e).equal();return{[c]:Object.assign(Object.assign({},(0,u.Wf)(t)),{display:"inline-block",height:"auto",marginInlineEnd:t.marginXS,paddingInline:a,fontSize:t.tagFontSize,lineHeight:t.tagLineHeight,whiteSpace:"nowrap",background:t.defaultBg,border:"".concat((0,g.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorder),borderRadius:t.borderRadiusSM,opacity:1,transition:"all ".concat(t.motionDurationMid),textAlign:"start",position:"relative",["&".concat(c,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:t.defaultColor},["".concat(c,"-close-icon")]:{marginInlineStart:r,fontSize:t.tagIconSize,color:t.colorIcon,cursor:"pointer",transition:"all ".concat(t.motionDurationMid),"&:hover":{color:t.colorTextHeading}},["&".concat(c,"-has-color")]:{borderColor:"transparent",["&, a, a:hover, ".concat(t.iconCls,"-close, ").concat(t.iconCls,"-close:hover")]:{color:t.colorTextLightSolid}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",["&:not(".concat(c,"-checkable-checked):hover")]:{color:t.colorPrimary,backgroundColor:t.colorFillSecondary},"&:active, &-checked":{color:t.colorTextLightSolid},"&-checked":{backgroundColor:t.colorPrimary,"&:hover":{backgroundColor:t.colorPrimaryHover}},"&:active":{backgroundColor:t.colorPrimaryActive}},"&-hidden":{display:"none"},["> ".concat(t.iconCls," + span, > span + ").concat(t.iconCls)]:{marginInlineStart:a}}),["".concat(c,"-borderless")]:{borderColor:"transparent",background:t.tagBorderlessBg}}},v=t=>{let{lineWidth:o,fontSizeIcon:e,calc:n}=t,c=t.fontSizeSM;return(0,b.IX)(t,{tagFontSize:c,tagLineHeight:(0,g.bf)(n(t.lineHeightSM).mul(c).equal()),tagIconSize:n(e).sub(n(o).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:t.defaultBg})},C=t=>({defaultBg:new p.t(t.colorFillQuaternary).onBackground(t.colorBgContainer).toHexString(),defaultColor:t.colorText});var S=(0,h.I$)("Tag",t=>f(v(t)),C),k=function(t,o){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>o.indexOf(n)&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,n=Object.getOwnPropertySymbols(t);co.indexOf(n[c])&&Object.prototype.propertyIsEnumerable.call(t,n[c])&&(e[n[c]]=t[n[c]]);return e};let y=n.forwardRef((t,o)=>{let{prefixCls:e,style:c,className:a,checked:r,children:l,icon:s,onChange:d,onClick:g}=t,p=k(t,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:u,tag:b}=n.useContext(m.E_),h=u("tag",e),[f,v,C]=S(h),y=i()(h,"".concat(h,"-checkable"),{["".concat(h,"-checkable-checked")]:r},null==b?void 0:b.className,a,v,C);return f(n.createElement("span",Object.assign({},p,{ref:o,style:Object.assign(Object.assign({},c),null==b?void 0:b.style),className:y,onClick:t=>{null==d||d(!r),null==g||g(t)}}),s,n.createElement("span",null,l)))});var w=e(18536);let x=t=>(0,w.Z)(t,(o,e)=>{let{textColor:n,lightBorderColor:c,lightColor:i,darkColor:a}=e;return{["".concat(t.componentCls).concat(t.componentCls,"-").concat(o)]:{color:n,background:i,borderColor:c,"&-inverse":{color:t.colorTextLightSolid,background:a,borderColor:a},["&".concat(t.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var I=(0,h.bk)(["Tag","preset"],t=>x(v(t)),C);let q=(t,o,e)=>{let n="string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1);return{["".concat(t.componentCls).concat(t.componentCls,"-").concat(o)]:{color:t["color".concat(e)],background:t["color".concat(n,"Bg")],borderColor:t["color".concat(n,"Border")],["&".concat(t.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var O=(0,h.bk)(["Tag","status"],t=>{let o=v(t);return[q(o,"success","Success"),q(o,"processing","Info"),q(o,"error","Error"),q(o,"warning","Warning")]},C),E=function(t,o){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>o.indexOf(n)&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,n=Object.getOwnPropertySymbols(t);co.indexOf(n[c])&&Object.prototype.propertyIsEnumerable.call(t,n[c])&&(e[n[c]]=t[n[c]]);return e};let z=n.forwardRef((t,o)=>{let{prefixCls:e,className:c,rootClassName:g,style:p,children:u,icon:b,color:h,onClose:f,bordered:v=!0,visible:C}=t,k=E(t,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:y,direction:w,tag:x}=n.useContext(m.E_),[q,z]=n.useState(!0),T=(0,a.Z)(k,["closeIcon","closable"]);n.useEffect(()=>{void 0!==C&&z(C)},[C]);let j=(0,r.o2)(h),N=(0,r.yT)(h),H=j||N,M=Object.assign(Object.assign({backgroundColor:h&&!H?h:void 0},null==x?void 0:x.style),p),B=y("tag",e),[W,X,Z]=S(B),P=i()(B,null==x?void 0:x.className,{["".concat(B,"-").concat(h)]:H,["".concat(B,"-has-color")]:h&&!H,["".concat(B,"-hidden")]:!q,["".concat(B,"-rtl")]:"rtl"===w,["".concat(B,"-borderless")]:!v},c,g,X,Z),D=t=>{t.stopPropagation(),null==f||f(t),t.defaultPrevented||z(!1)},[,L]=(0,l.b)((0,l.w)(t),(0,l.w)(x),{closable:!1,closeIconRender:t=>{let o=n.createElement("span",{className:"".concat(B,"-close-icon"),onClick:D},t);return(0,s.wm)(t,o,t=>({onClick:o=>{var e;null===(e=null==t?void 0:t.onClick)||void 0===e||e.call(t,o),D(o)},className:i()(null==t?void 0:t.className,"".concat(B,"-close-icon"))}))}}),R="function"==typeof k.onClick||u&&"a"===u.type,A=b||null,K=A?n.createElement(n.Fragment,null,A,u&&n.createElement("span",null,u)):u,F=n.createElement("span",Object.assign({},T,{ref:o,className:P,style:M}),K,L,j&&n.createElement(I,{key:"preset",prefixCls:B}),N&&n.createElement(O,{key:"status",prefixCls:B}));return W(R?n.createElement(d.Z,{component:"Tag"},F):F)});z.CheckableTag=y;var T=z},44633:function(t,o,e){var n=e(2265);let c=n.forwardRef(function(t,o){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:o},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});o.Z=c},49084:function(t,o,e){var n=e(2265);let c=n.forwardRef(function(t,o){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:o},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});o.Z=c}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2618-e3b2304a0f9519ff.js b/litellm/proxy/_experimental/out/_next/static/chunks/2618-e3b2304a0f9519ff.js deleted file mode 100644 index 8d7d667d278..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2618-e3b2304a0f9519ff.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2618],{87602:function(e,r,o){function t(){for(var e,r,o=0,t="",l=arguments.length;o"boolean"==typeof e?`${e}`:0===e?"0":e,n=e=>{let r=function(){for(var r,o,l=arguments.length,n=Array(l),a=0;a{let t=Object.fromEntries(Object.entries(e||{}).filter(e=>{let[r]=e;return!["class","className"].includes(r)}));return r(o.map(e=>e(t)),null==e?void 0:e.class,null==e?void 0:e.className)}},cva:e=>o=>{var t;if((null==e?void 0:e.variants)==null)return r(null==e?void 0:e.base,null==o?void 0:o.class,null==o?void 0:o.className);let{variants:n,defaultVariants:a}=e,s=Object.keys(n).map(e=>{let r=null==o?void 0:o[e],t=null==a?void 0:a[e],s=l(r)||l(t);return n[e][s]}),i={...a,...o&&Object.entries(o).reduce((e,r)=>{let[o,t]=r;return void 0===t?e:{...e,[o]:t}},{})},d=null==e?void 0:null===(t=e.compoundVariants)||void 0===t?void 0:t.reduce((e,r)=>{let{class:o,className:t,...l}=r;return Object.entries(l).every(e=>{let[r,o]=e,t=i[r];return Array.isArray(o)?o.includes(t):t===o})?[...e,o,t]:e},[]);return r(null==e?void 0:e.base,s,d,null==o?void 0:o.class,null==o?void 0:o.className)},cx:r}},{compose:a,cva:s,cx:i}=n()},53335:function(e,r,o){o.d(r,{m6:function(){return ev}});let t=(e,r)=>{let o=Array(e.length+r.length);for(let r=0;r({classGroupId:e,validator:r}),n=(e=new Map,r=null,o)=>({nextPart:e,validators:r,classGroupId:o}),a=[],s=e=>{let r=c(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:l}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return d(e);let o=e.split("-"),t=""===o[0]&&o.length>1?1:0;return i(o,t,r)},getConflictingClassGroupIds:(e,r)=>{if(r){let r=l[e],n=o[e];return r?n?t(n,r):r:n||a}return o[e]||a}}},i=(e,r,o)=>{if(0==e.length-r)return o.classGroupId;let t=e[r],l=o.nextPart.get(t);if(l){let o=i(e,r+1,l);if(o)return o}let n=o.validators;if(null===n)return;let a=0===r?e.join("-"):e.slice(r).join("-"),s=n.length;for(let e=0;e-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{let r=e.slice(1,-1),o=r.indexOf(":"),t=r.slice(0,o);return t?"arbitrary.."+t:void 0})(),c=e=>{let{theme:r,classGroups:o}=e;return m(o,r)},m=(e,r)=>{let o=n();for(let t in e)p(e[t],o,t,r);return o},p=(e,r,o,t)=>{let l=e.length;for(let n=0;n{if("string"==typeof e){b(e,r,o);return}if("function"==typeof e){f(e,r,o,t);return}g(e,r,o,t)},b=(e,r,o)=>{(""===e?r:h(r,e)).classGroupId=o},f=(e,r,o,t)=>{if(k(e)){p(e(t),r,o,t);return}null===r.validators&&(r.validators=[]),r.validators.push(l(o,e))},g=(e,r,o,t)=>{let l=Object.entries(e),n=l.length;for(let e=0;e{let o=e,t=r.split("-"),l=t.length;for(let e=0;e"isThemeGetter"in e&&!0===e.isThemeGetter,v=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,o=Object.create(null),t=Object.create(null),l=(l,n)=>{o[l]=n,++r>e&&(r=0,t=o,o=Object.create(null))};return{get(e){let r=o[e];return void 0!==r?r:void 0!==(r=t[e])?(l(e,r),r):void 0},set(e,r){e in o?o[e]=r:l(e,r)}}},x=[],w=(e,r,o,t,l)=>({modifiers:e,hasImportantModifier:r,baseClassName:o,maybePostfixModifierPosition:t,isExternal:l}),y=e=>{let{prefix:r,experimentalParseClassName:o}=e,t=e=>{let r;let o=[],t=0,l=0,n=0,a=e.length;for(let s=0;sn?r-n:void 0)};if(r){let e=r+":",o=t;t=r=>r.startsWith(e)?o(r.slice(e.length)):w(x,!1,r,void 0,!0)}if(o){let e=t;t=r=>o({className:r,parseClassName:e})}return t},z=e=>{let r=new Map;return e.orderSensitiveModifiers.forEach((e,o)=>{r.set(e,1e6+o)}),e=>{let o=[],t=[];for(let l=0;l0&&(t.sort(),o.push(...t),t=[]),o.push(n)):t.push(n)}return t.length>0&&(t.sort(),o.push(...t)),o}},j=e=>({cache:v(e.cacheSize),parseClassName:y(e),sortModifiers:z(e),...s(e)}),N=/\s+/,O=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:l,sortModifiers:n}=r,a=[],s=e.trim().split(N),i="";for(let e=s.length-1;e>=0;e-=1){let r=s[e],{isExternal:d,modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:u}=o(r);if(d){i=r+(i.length>0?" "+i:i);continue}let b=!!u,f=t(b?p.substring(0,u):p);if(!f){if(!b||!(f=t(p))){i=r+(i.length>0?" "+i:i);continue}b=!1}let g=0===c.length?"":1===c.length?c[0]:n(c).join(":"),h=m?g+"!":g,k=h+f;if(a.indexOf(k)>-1)continue;a.push(k);let v=l(f,b);for(let e=0;e0?" "+i:i)}return i},C=(...e)=>{let r,o,t=0,l="";for(;t{let r;if("string"==typeof e)return e;let o="";for(let t=0;t{let r=r=>r[e]||W;return r.isThemeGetter=!0,r},A=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,M=/^\d+\/\d+$/,_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,E=/\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$/,S=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,P=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,T=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,q=e=>M.test(e),Z=e=>!!e&&!Number.isNaN(Number(e)),D=e=>!!e&&Number.isInteger(Number(e)),V=e=>e.endsWith("%")&&Z(e.slice(0,-1)),B=e=>_.test(e),F=()=>!0,H=e=>E.test(e)&&!S.test(e),J=()=>!1,K=e=>P.test(e),L=e=>T.test(e),Q=e=>!U(e)&&!et(e),R=e=>ec(e,eb,J),U=e=>A.test(e),X=e=>ec(e,ef,H),Y=e=>ec(e,eg,Z),ee=e=>ec(e,ep,J),er=e=>ec(e,eu,L),eo=e=>ec(e,ek,K),et=e=>I.test(e),el=e=>em(e,ef),en=e=>em(e,eh),ea=e=>em(e,ep),es=e=>em(e,eb),ei=e=>em(e,eu),ed=e=>em(e,ek,!0),ec=(e,r,o)=>{let t=A.exec(e);return!!t&&(t[1]?r(t[1]):o(t[2]))},em=(e,r,o=!1)=>{let t=I.exec(e);return!!t&&(t[1]?r(t[1]):o)},ep=e=>"position"===e||"percentage"===e,eu=e=>"image"===e||"url"===e,eb=e=>"length"===e||"size"===e||"bg-size"===e,ef=e=>"length"===e,eg=e=>"number"===e,eh=e=>"family-name"===e,ek=e=>"shadow"===e,ev=((e,...r)=>{let o,t,l,n;let a=e=>{let r=t(e);if(r)return r;let n=O(e,o);return l(e,n),n};return n=s=>(t=(o=j(r.reduce((e,r)=>r(e),e()))).cache.get,l=o.cache.set,n=a,a(s)),(...e)=>n(C(...e))})(()=>{let e=$("color"),r=$("font"),o=$("text"),t=$("font-weight"),l=$("tracking"),n=$("leading"),a=$("breakpoint"),s=$("container"),i=$("spacing"),d=$("radius"),c=$("shadow"),m=$("inset-shadow"),p=$("text-shadow"),u=$("drop-shadow"),b=$("blur"),f=$("perspective"),g=$("aspect"),h=$("ease"),k=$("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),et,U],y=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],j=()=>[et,U,i],N=()=>[q,"full","auto",...j()],O=()=>[D,"none","subgrid",et,U],C=()=>["auto",{span:["full",D,et,U]},D,et,U],G=()=>[D,"auto",et,U],W=()=>["auto","min","max","fr",et,U],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],I=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...j()],_=()=>[q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],E=()=>[e,et,U],S=()=>[...x(),ea,ee,{position:[et,U]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",es,R,{size:[et,U]}],H=()=>[V,el,X],J=()=>["","none","full",d,et,U],K=()=>["",Z,el,X],L=()=>["solid","dashed","dotted","double"],ec=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],em=()=>[Z,V,ea,ee],ep=()=>["","none",b,et,U],eu=()=>["none",Z,et,U],eb=()=>["none",Z,et,U],ef=()=>[Z,et,U],eg=()=>[q,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[B],breakpoint:[B],color:[F],container:[B],"drop-shadow":[B],ease:["in","out","in-out"],font:[Q],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[B],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[B],shadow:[B],spacing:["px",Z],text:[B],"text-shadow":[B],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",q,U,et,g]}],container:["container"],columns:[{columns:[Z,U,et,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:w()}],overflow:[{overflow:y()}],"overflow-x":[{"overflow-x":y()}],"overflow-y":[{"overflow-y":y()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:N()}],"inset-x":[{"inset-x":N()}],"inset-y":[{"inset-y":N()}],start:[{start:N()}],end:[{end:N()}],top:[{top:N()}],right:[{right:N()}],bottom:[{bottom:N()}],left:[{left:N()}],visibility:["visible","invisible","collapse"],z:[{z:[D,"auto",et,U]}],basis:[{basis:[q,"full","auto",s,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Z,q,"auto","initial","none",U]}],grow:[{grow:["",Z,et,U]}],shrink:[{shrink:["",Z,et,U]}],order:[{order:[D,"first","last","none",et,U]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...I(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...I(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:_()}],w:[{w:[s,"screen",..._()]}],"min-w":[{"min-w":[s,"screen","none",..._()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},..._()]}],h:[{h:["screen","lh",..._()]}],"min-h":[{"min-h":["screen","lh","none",..._()]}],"max-h":[{"max-h":["screen","lh",..._()]}],"font-size":[{text:["base",o,el,X]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[t,et,Y]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",V,U]}],"font-family":[{font:[en,U,r]}],"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:[l,et,U]}],"line-clamp":[{"line-clamp":[Z,"none",et,Y]}],leading:[{leading:[n,...j()]}],"list-image":[{"list-image":["none",et,U]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",et,U]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:[Z,"from-font","auto",et,X]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Z,"auto",et,U]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",et,U]}],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",et,U]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:S()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},D,et,U],radial:["",et,U],conic:[D,et,U]},ei,er]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...L(),"hidden","none"]}],"divide-style":[{divide:[...L(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...L(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Z,et,U]}],"outline-w":[{outline:["",Z,el,X]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",c,ed,eo]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",m,ed,eo]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Z,X]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",p,ed,eo]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Z,et,U]}],"mix-blend":[{"mix-blend":[...ec(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ec()}],"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":[Z]}],"mask-image-linear-from-pos":[{"mask-linear-from":em()}],"mask-image-linear-to-pos":[{"mask-linear-to":em()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":em()}],"mask-image-t-to-pos":[{"mask-t-to":em()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":em()}],"mask-image-r-to-pos":[{"mask-r-to":em()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":em()}],"mask-image-b-to-pos":[{"mask-b-to":em()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":em()}],"mask-image-l-to-pos":[{"mask-l-to":em()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":em()}],"mask-image-x-to-pos":[{"mask-x-to":em()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":em()}],"mask-image-y-to-pos":[{"mask-y-to":em()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[et,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":em()}],"mask-image-radial-to-pos":[{"mask-radial-to":em()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":x()}],"mask-image-conic-pos":[{"mask-conic":[Z]}],"mask-image-conic-from-pos":[{"mask-conic-from":em()}],"mask-image-conic-to-pos":[{"mask-conic-to":em()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:S()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",et,U]}],filter:[{filter:["","none",et,U]}],blur:[{blur:ep()}],brightness:[{brightness:[Z,et,U]}],contrast:[{contrast:[Z,et,U]}],"drop-shadow":[{"drop-shadow":["","none",u,ed,eo]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Z,et,U]}],"hue-rotate":[{"hue-rotate":[Z,et,U]}],invert:[{invert:["",Z,et,U]}],saturate:[{saturate:[Z,et,U]}],sepia:[{sepia:["",Z,et,U]}],"backdrop-filter":[{"backdrop-filter":["","none",et,U]}],"backdrop-blur":[{"backdrop-blur":ep()}],"backdrop-brightness":[{"backdrop-brightness":[Z,et,U]}],"backdrop-contrast":[{"backdrop-contrast":[Z,et,U]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Z,et,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Z,et,U]}],"backdrop-invert":[{"backdrop-invert":["",Z,et,U]}],"backdrop-opacity":[{"backdrop-opacity":[Z,et,U]}],"backdrop-saturate":[{"backdrop-saturate":[Z,et,U]}],"backdrop-sepia":[{"backdrop-sepia":["",Z,et,U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",et,U]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Z,"initial",et,U]}],ease:[{ease:["linear","initial",h,et,U]}],delay:[{delay:[Z,et,U]}],animate:[{animate:["none",k,et,U]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,et,U]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:eu()}],"rotate-x":[{"rotate-x":eu()}],"rotate-y":[{"rotate-y":eu()}],"rotate-z":[{"rotate-z":eu()}],scale:[{scale:eb()}],"scale-x":[{"scale-x":eb()}],"scale-y":[{"scale-y":eb()}],"scale-z":[{"scale-z":eb()}],"scale-3d":["scale-3d"],skew:[{skew:ef()}],"skew-x":[{"skew-x":ef()}],"skew-y":[{"skew-y":ef()}],transform:[{transform:[et,U,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eg()}],"translate-x":[{"translate-x":eg()}],"translate-y":[{"translate-y":eg()}],"translate-z":[{"translate-z":eg()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"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",et,U]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",et,U]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Z,el,X,Y]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["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-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["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-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2703-dd215da2f0e066a4.js b/litellm/proxy/_experimental/out/_next/static/chunks/2703-dd215da2f0e066a4.js deleted file mode 100644 index b000d4fd17e..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2703-dd215da2f0e066a4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2703],{12363:function(e,s,a){a.d(s,{d:function(){return r},n:function(){return l}});var t=a(2265);let l=()=>{let[e,s]=(0,t.useState)("http://localhost:4000");return(0,t.useEffect)(()=>{{let{protocol:e,host:a}=window.location;s("".concat(e,"//").concat(a))}},[]),e},r=25},30841:function(e,s,a){a.d(s,{IE:function(){return r},LO:function(){return l},cT:function(){return n}});var t=a(19250);let l=async e=>{if(!e)return[];try{let{aliases:s}=await (0,t.keyAliasesCall)(e);return Array.from(new Set((s||[]).filter(Boolean)))}catch(e){return console.error("Error fetching all key aliases:",e),[]}},r=async(e,s)=>{if(!e)return[];try{let a=[],l=1,r=!0;for(;r;){let n=await (0,t.teamListCall)(e,s||null,null);a=[...a,...n],l{if(!e)return[];try{let s=[],a=1,l=!0;for(;l;){let r=await (0,t.organizationListCall)(e);s=[...s,...r],a{let{options:s,onApplyFilters:a,onResetFilters:o,initialValues:m={},buttonLabel:x="Filters"}=e,[u,h]=(0,l.useState)(!1),[g,p]=(0,l.useState)(m),[j,f]=(0,l.useState)({}),[v,b]=(0,l.useState)({}),[y,N]=(0,l.useState)({}),[w,_]=(0,l.useState)({}),k=(0,l.useCallback)(c()(async(e,s)=>{if(s.isSearchable&&s.searchFn){b(e=>({...e,[s.name]:!0}));try{let a=await s.searchFn(e);f(e=>({...e,[s.name]:a}))}catch(e){console.error("Error searching:",e),f(e=>({...e,[s.name]:[]}))}finally{b(e=>({...e,[s.name]:!1}))}}},300),[]),S=(0,l.useCallback)(async e=>{if(e.isSearchable&&e.searchFn&&!w[e.name]){b(s=>({...s,[e.name]:!0})),_(s=>({...s,[e.name]:!0}));try{let s=await e.searchFn("");f(a=>({...a,[e.name]:s}))}catch(s){console.error("Error loading initial options:",s),f(s=>({...s,[e.name]:[]}))}finally{b(s=>({...s,[e.name]:!1}))}}},[w]);(0,l.useEffect)(()=>{u&&s.forEach(e=>{e.isSearchable&&!w[e.name]&&S(e)})},[u,s,S,w]);let C=(e,s)=>{let t={...g,[e]:s};p(t),a(t)},L=(e,s)=>{e&&s.isSearchable&&!w[s.name]&&S(s)};return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,t.jsx)(r.ZP,{icon:(0,t.jsx)(d.Z,{className:"h-4 w-4"}),onClick:()=>h(!u),className:"flex items-center gap-2",children:x}),(0,t.jsx)(r.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),p(e),o()},children:"Reset Filters"})]}),u&&(0,t.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-4 mb-6",children:["Team ID","Status","Organization ID","Key Alias","User ID","End User","Error Code","Key Hash","Model"].map(e=>{let a=s.find(s=>s.label===e||s.name===e);return a?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("label",{className:"text-sm text-gray-600",children:a.label||a.name}),a.isSearchable?(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search ".concat(a.label||a.name,"..."),value:g[a.name]||void 0,onChange:e=>C(a.name,e),onDropdownVisibleChange:e=>L(e,a),onSearch:e=>{N(s=>({...s,[a.name]:e})),a.searchFn&&k(e,a)},filterOption:!1,loading:v[a.name],options:j[a.name]||[],allowClear:!0,notFoundContent:v[a.name]?"Loading...":"No results found"}):a.options?(0,t.jsx)(n.default,{className:"w-full",placeholder:"Select ".concat(a.label||a.name,"..."),value:g[a.name]||void 0,onChange:e=>C(a.name,e),allowClear:!0,children:a.options.map(e=>(0,t.jsx)(n.default.Option,{value:e.value,children:e.label},e.value))}):(0,t.jsx)(i.default,{className:"w-full",placeholder:"Enter ".concat(a.label||a.name,"..."),value:g[a.name]||"",onChange:e=>C(a.name,e.target.value),allowClear:!0})]},a.name):null})})]})}},22703:function(e,s,a){a.d(s,{I:function(){return eC},Z:function(){return eS}});var t=a(57437),l=a(77398),r=a.n(l),n=a(11713),i=a(2265),d=a(29827),o=a(19250),c=a(12322),m=a(59872),x=a(41649),u=a(78489),h=a(99981),g=a(42673);let p=e=>{try{return new Date(e).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}).replace(",","")}catch(e){return"Error converting time"}},j=e=>{let{utcTime:s}=e;return(0,t.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:p(s)})},f=(e,s)=>{var a,t;return(null===(t=e.metadata)||void 0===t?void 0:null===(a=t.mcp_tool_call_metadata)||void 0===a?void 0:a.mcp_server_logo_url)?e.metadata.mcp_tool_call_metadata.mcp_server_logo_url:s?(0,g.dr)(s).logo:""},v=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,t.jsx)(()=>{let[e,a]=i.useState(s.getIsExpanded()),l=i.useCallback(()=>{a(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,t.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,t.jsx)("svg",{className:"w-4 h-4 transform transition-transform duration-75 ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,t.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Time",accessorKey:"startTime",cell:e=>(0,t.jsx)(j,{utcTime:e.getValue()})},{header:"Status",accessorKey:"metadata.status",cell:e=>{let s="failure"!==(e.getValue()||"Success").toLowerCase();return(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat(s?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:s?"Success":"Failure"})}},{header:"Session ID",accessorKey:"session_id",cell:e=>{let s=String(e.getValue()||""),a=e.row.original.onSessionClick;return(0,t.jsx)(h.Z,{title:String(e.getValue()||""),children:(0,t.jsx)(u.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal text-xs max-w-[15ch] truncate block",onClick:()=>null==a?void 0:a(s),children:String(e.getValue()||"")})})}},{header:"Request ID",accessorKey:"request_id",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||""),children:(0,t.jsx)("span",{className:"font-mono text-xs max-w-[15ch] truncate block",children:String(e.getValue()||"")})})},{header:"Cost",accessorKey:"spend",cell:e=>(0,t.jsx)(h.Z,{title:"$".concat(String(e.getValue()||0)," "),children:(0,t.jsx)("span",{children:(0,m.GS)(e.getValue()||0)})})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Team Name",accessorKey:"metadata.user_api_key_team_alias",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Key Hash",accessorKey:"metadata.user_api_key",cell:e=>{let s=String(e.getValue()||"-"),a=e.row.original.onKeyHashClick;return(0,t.jsx)(h.Z,{title:s,children:(0,t.jsx)("span",{className:"font-mono max-w-[15ch] truncate block cursor-pointer hover:text-blue-600",onClick:()=>null==a?void 0:a(s),children:s})})}},{header:"Key Name",accessorKey:"metadata.user_api_key_alias",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Model",accessorKey:"model",cell:e=>{let s=e.row.original,a=s.custom_llm_provider,l=String(e.getValue()||"");return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[a&&(0,t.jsx)("img",{src:f(s,a),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(h.Z,{title:l,children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:l})})]})}},{header:"Tokens",accessorKey:"total_tokens",cell:e=>{let s=e.row.original;return(0,t.jsxs)("span",{className:"text-sm",children:[String(s.total_tokens||"0"),(0,t.jsxs)("span",{className:"text-gray-400 text-xs ml-1",children:["(",String(s.prompt_tokens||"0"),"+",String(s.completion_tokens||"0"),")"]})]})}},{header:"Internal User",accessorKey:"user",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"End User",accessorKey:"end_user",cell:e=>(0,t.jsx)(h.Z,{title:String(e.getValue()||"-"),children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:String(e.getValue()||"-")})})},{header:"Tags",accessorKey:"request_tags",cell:e=>{let s=e.getValue();if(!s||0===Object.keys(s).length)return"-";let a=Object.entries(s),l=a[0],r=a.slice(1);return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:(0,t.jsx)(h.Z,{title:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:a.map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{children:[s,": ",String(a)]},s)})}),children:(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[l[0],": ",String(l[1]),r.length>0&&" +".concat(r.length)]})})})}}],b=e=>(0,t.jsx)(x.Z,{color:"gray",className:"flex items-center gap-1",children:(0,t.jsx)("span",{className:"whitespace-nowrap text-xs",children:e})}),y=[{id:"expander",header:()=>null,cell:e=>{let{row:s}=e;return(0,t.jsx)(()=>{let[e,a]=i.useState(s.getIsExpanded()),l=i.useCallback(()=>{a(e=>!e),s.getToggleExpandedHandler()()},[s]);return s.getCanExpand()?(0,t.jsx)("button",{onClick:l,style:{cursor:"pointer"},"aria-label":e?"Collapse row":"Expand row",className:"w-6 h-6 flex items-center justify-center focus:outline-none",children:(0,t.jsx)("svg",{className:"w-4 h-4 transform transition-transform ".concat(e?"rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}):(0,t.jsx)("span",{className:"w-6 h-6 flex items-center justify-center",children:"●"})},{})}},{header:"Timestamp",accessorKey:"updated_at",cell:e=>(0,t.jsx)(j,{utcTime:e.getValue()})},{header:"Table Name",accessorKey:"table_name",cell:e=>{let s=e.getValue(),a=s;switch(s){case"LiteLLM_VerificationToken":a="Keys";break;case"LiteLLM_TeamTable":a="Teams";break;case"LiteLLM_OrganizationTable":a="Organizations";break;case"LiteLLM_UserTable":a="Users";break;case"LiteLLM_ProxyModelTable":a="Models";break;default:a=s}return(0,t.jsx)("span",{children:a})}},{header:"Action",accessorKey:"action",cell:e=>(0,t.jsx)("span",{children:b(e.getValue())})},{header:"Changed By",accessorKey:"changed_by",cell:e=>{let s=e.row.original.changed_by,a=e.row.original.changed_by_api_key;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("div",{className:"font-medium",children:s}),a&&(0,t.jsx)(h.Z,{title:a,children:(0,t.jsxs)("div",{className:"text-xs text-muted-foreground max-w-[15ch] truncate",children:[" ",a]})})]})}},{header:"Affected Item ID",accessorKey:"object_id",cell:e=>(0,t.jsx)(()=>{let s=e.getValue(),[a,l]=(0,i.useState)(!1);if(!s)return(0,t.jsx)(t.Fragment,{children:"-"});let r=async()=>{try{await navigator.clipboard.writeText(String(s)),l(!0),setTimeout(()=>l(!1),1500)}catch(e){console.error("Failed to copy object ID: ",e)}};return(0,t.jsx)(h.Z,{title:a?"Copied!":String(s),children:(0,t.jsx)("span",{className:"max-w-[20ch] truncate block cursor-pointer hover:text-blue-600",onClick:r,children:String(s)})})},{})}],N=async(e,s,a,t)=>{console.log("prefetchLogDetails called with",e.length,"logs");let l=e.map(e=>{if(e.request_id)return console.log("Prefetching details for request_id:",e.request_id),t.prefetchQuery({queryKey:["logDetails",e.request_id,s],queryFn:async()=>{console.log("Fetching details for",e.request_id);let t=await (0,o.uiSpendLogDetailsCall)(a,e.request_id,s);return console.log("Received details for",e.request_id,":",t?"success":"failed"),t},staleTime:6e5,gcTime:6e5})});try{let e=await Promise.all(l);return console.log("All prefetch promises completed:",e.length),e}catch(e){throw console.error("Error in prefetchLogDetails:",e),e}};var w=a(9114),_=a(86669);function k(e){let{row:s,hasMessages:a,hasResponse:l,hasError:r,errorInfo:n,getRawRequest:i,formattedResponse:d}=e,o=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let a=document.execCommand("copy");if(document.body.removeChild(s),!a)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},c=async()=>{await o(JSON.stringify(i(),null,2))?w.Z.success("Request copied to clipboard"):w.Z.fromBackend("Failed to copy request")},m=async()=>{await o(JSON.stringify(d(),null,2))?w.Z.success("Response copied to clipboard"):w.Z.fromBackend("Failed to copy response")};return(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 w-full max-w-full overflow-hidden box-border",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request"}),(0,t.jsx)("button",{onClick:c,className:"p-1 hover:bg-gray-200 rounded",title:"Copy request",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-96 w-full max-w-full box-border",children:(0,t.jsx)("div",{className:"[&_[role='tree']]:bg-white [&_[role='tree']]:text-slate-900",children:(0,t.jsx)(_.gc,{data:i(),style:_.jF,clickToExpandNode:!0})})})]}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsxs)("h3",{className:"text-lg font-medium",children:["Response",r&&(0,t.jsxs)("span",{className:"ml-2 text-sm text-red-600",children:["• HTTP code ",(null==n?void 0:n.error_code)||400]})]}),(0,t.jsx)("button",{onClick:m,className:"p-1 hover:bg-gray-200 rounded",title:"Copy response",disabled:!l,children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-96 w-full max-w-full box-border",children:l?(0,t.jsx)("div",{className:"[&_[role='tree']]:bg-white [&_[role='tree']]:text-slate-900",children:(0,t.jsx)(_.gc,{data:d(),style:_.jF,clickToExpandNode:!0})}):(0,t.jsx)("div",{className:"text-gray-500 text-sm italic text-center py-4",children:"Response data not available"})})]})]})}a(52621);let S=e=>{var s;let{errorInfo:a}=e,[l,r]=i.useState({}),[n,d]=i.useState(!1),o=e=>{r(s=>({...s,[e]:!s[e]}))},c=a.traceback&&(s=a.traceback)?Array.from(s.matchAll(/File "([^"]+)", line (\d+)/g)).map(e=>{let a=e[1],t=e[2],l=a.split("/").pop()||a,r=e.index||0,n=s.indexOf('File "',r+1),i=n>-1?s.substring(r,n).trim():s.substring(r).trim(),d=i.split("\n"),o="";return d.length>1&&(o=d[d.length-1].trim()),{filePath:a,fileName:l,lineNumber:t,code:o,inFunction:i.includes(" in ")?i.split(" in ")[1].split("\n")[0]:""}}):[];return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"p-4 border-b",children:(0,t.jsxs)("h3",{className:"text-lg font-medium flex items-center text-red-600",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Error Details"]})}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"bg-red-50 rounded-md p-4 mb-4",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"text-red-800 font-medium w-20",children:"Type:"}),(0,t.jsx)("span",{className:"text-red-700",children:a.error_class||"Unknown Error"})]}),(0,t.jsxs)("div",{className:"flex mt-2",children:[(0,t.jsx)("span",{className:"text-red-800 font-medium w-20 flex-shrink-0",children:"Message:"}),(0,t.jsx)("span",{className:"text-red-700 break-words whitespace-pre-wrap",children:a.error_message||"Unknown error occurred"})]})]}),a.traceback&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,t.jsx)("h4",{className:"font-medium",children:"Traceback"}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)("button",{onClick:()=>{let e=!n;if(d(e),c.length>0){let s={};c.forEach((a,t)=>{s[t]=e}),r(s)}},className:"text-gray-500 hover:text-gray-700 flex items-center text-sm",children:n?"Collapse All":"Expand All"}),(0,t.jsxs)("button",{onClick:()=>navigator.clipboard.writeText(a.traceback||""),className:"text-gray-500 hover:text-gray-700 flex items-center",title:"Copy traceback",children:[(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),(0,t.jsx)("span",{className:"ml-1",children:"Copy"})]})]})]}),(0,t.jsx)("div",{className:"bg-white rounded-md border border-gray-200 overflow-hidden shadow-sm",children:c.map((e,s)=>(0,t.jsxs)("div",{className:"border-b border-gray-200 last:border-b-0",children:[(0,t.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between cursor-pointer hover:bg-gray-50",onClick:()=>o(s),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"text-gray-400 mr-2 w-12 text-right",children:e.lineNumber}),(0,t.jsx)("span",{className:"text-gray-600 font-medium",children:e.fileName}),(0,t.jsx)("span",{className:"text-gray-500 mx-1",children:"in"}),(0,t.jsx)("span",{className:"text-indigo-600 font-medium",children:e.inFunction||e.fileName})]}),(0,t.jsx)("svg",{className:"w-5 h-5 text-gray-500 transition-transform ".concat(l[s]?"transform rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(l[s]||!1)&&e.code&&(0,t.jsx)("div",{className:"px-12 py-2 font-mono text-sm text-gray-800 bg-gray-50 overflow-x-auto border-t border-gray-100",children:e.code})]},s))})]})]})]})};var C=a(20347);let L=e=>{let{show:s}=e;return s?(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start",children:[(0,t.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,t.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Request/Response Data Not Available"}),(0,t.jsxs)("p",{className:"text-sm text-blue-700 mt-1",children:["To view request and response details, enable prompt storage in your LiteLLM configuration by adding the following to your ",(0,t.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded",children:"proxy_config.yaml"})," file:"]}),(0,t.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"general_settings:\n store_model_in_db: true\n store_prompts_in_spend_logs: true"}),(0,t.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change."})]})]}):null};var E=a(50665),M=a(12514),D=a(35829),T=a(84264),A=a(96761),O=a(10900),R=a(5545),I=a(30401),H=a(78867);let K=e=>{let{sessionId:s,logs:a,onBack:l}=e,[r,n]=(0,i.useState)(null),[d,o]=(0,i.useState)({}),x=a.reduce((e,s)=>e+(s.spend||0),0),g=a.reduce((e,s)=>e+(s.total_tokens||0),0),p=a.reduce((e,s)=>{var a,t;return e+((null===(t=s.metadata)||void 0===t?void 0:null===(a=t.additional_usage_values)||void 0===a?void 0:a.cache_read_input_tokens)||0)},0),j=a.reduce((e,s)=>{var a,t;return e+((null===(t=s.metadata)||void 0===t?void 0:null===(a=t.additional_usage_values)||void 0===a?void 0:a.cache_creation_input_tokens)||0)},0),f=g+p+j,b=a.length>0?new Date(a[0].startTime):new Date;(((a.length>0?new Date(a[a.length-1].endTime):new Date).getTime()-b.getTime())/1e3).toFixed(2),a.map(e=>({time:new Date(e.startTime).toISOString(),tokens:e.total_tokens||0,cost:e.spend||0}));let y=async(e,s)=>{await (0,m.vQ)(e)&&(o(e=>({...e,[s]:!0})),setTimeout(()=>{o(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)(u.Z,{icon:O.Z,variant:"light",onClick:l,className:"mb-4",children:"Back to All Logs"}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-gray-900",children:"Session Details"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)("p",{className:"text-sm text-gray-500 font-mono",children:s}),(0,t.jsx)(R.ZP,{type:"text",size:"small",icon:d["session-id"]?(0,t.jsx)(I.Z,{size:12}):(0,t.jsx)(H.Z,{size:12}),onClick:()=>y(s,"session-id"),className:"left-2 z-10 transition-all duration-200 ".concat(d["session-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,t.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/ui_logs_sessions",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-blue-600 hover:text-blue-800 flex items-center gap-1",children:["Get started with session management here",(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[(0,t.jsxs)(M.Z,{children:[(0,t.jsx)(T.Z,{children:"Total Requests"}),(0,t.jsx)(D.Z,{children:a.length})]}),(0,t.jsxs)(M.Z,{children:[(0,t.jsx)(T.Z,{children:"Total Cost"}),(0,t.jsxs)(D.Z,{children:["$",(0,m.pw)(x,6)]})]}),(0,t.jsx)(h.Z,{title:(0,t.jsxs)("div",{className:"text-white min-w-[200px]",children:[(0,t.jsx)("div",{className:"text-lg font-medium mb-3",children:"Usage breakdown"}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-base font-medium mb-2",children:"Input usage:"}),(0,t.jsxs)("div",{className:"space-y-2 text-sm text-gray-300",children:[(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(a.reduce((e,s)=>e+(s.prompt_tokens||0),0))})]}),p>0&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input_cached_tokens:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(p)})]}),j>0&&(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"input_cache_creation_tokens:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(j)})]})]})]}),(0,t.jsxs)("div",{className:"border-t border-gray-600 pt-3",children:[(0,t.jsx)("div",{className:"text-base font-medium mb-2",children:"Output usage:"}),(0,t.jsx)("div",{className:"space-y-2 text-sm text-gray-300",children:(0,t.jsxs)("div",{className:"flex justify-between",children:[(0,t.jsx)("span",{children:"output:"}),(0,t.jsx)("span",{className:"ml-8",children:(0,m.pw)(a.reduce((e,s)=>e+(s.completion_tokens||0),0))})]})})]}),(0,t.jsx)("div",{className:"border-t border-gray-600 pt-3",children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-base font-medium",children:"Total usage:"}),(0,t.jsx)("span",{className:"text-sm text-gray-300",children:(0,m.pw)(f)})]})})]})]}),placement:"top",overlayStyle:{minWidth:"300px"},children:(0,t.jsxs)(M.Z,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(T.Z,{children:"Total Tokens"}),(0,t.jsx)("span",{className:"text-gray-400 text-sm",children:"ⓘ"})]}),(0,t.jsx)(D.Z,{children:(0,m.pw)(f)})]})})]}),(0,t.jsx)(A.Z,{children:"Session Logs"}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(c.w,{columns:v,data:a,renderSubComponent:eC,getRowCanExpand:()=>!0,loadingMessage:"Loading logs...",noDataMessage:"No logs found"})})]})};function F(e){let{data:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({});if(!s||0===s.length)return null;let d=e=>new Date(1e3*e).toLocaleString(),o=(e,s)=>"".concat(((s-e)*1e3).toFixed(2),"ms"),c=(e,s)=>{let a="".concat(e,"-").concat(s);n(e=>({...e,[a]:!e[a]}))};return(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>l(!a),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 text-gray-600 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Vector Store Requests"})]}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:a?"Click to collapse":"Click to expand"})]}),a&&(0,t.jsx)("div",{className:"p-4",children:s.map((e,s)=>(0,t.jsxs)("div",{className:"mb-6 last:mb-0",children:[(0,t.jsx)("div",{className:"bg-white rounded-lg border p-4 mb-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Query:"}),(0,t.jsx)("span",{className:"font-mono",children:e.query})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Vector Store ID:"}),(0,t.jsx)("span",{className:"font-mono",children:e.vector_store_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,t.jsx)("span",{className:"flex items-center",children:(()=>{let{logo:s,displayName:a}=(0,g.dr)(e.custom_llm_provider);return(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)("img",{src:s,alt:"".concat(a," logo"),className:"h-5 w-5 mr-2"}),a]})})()})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,t.jsx)("span",{children:d(e.start_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,t.jsx)("span",{children:d(e.end_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsx)("span",{children:o(e.start_time,e.end_time)})]})]})]})}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Search Results"}),(0,t.jsx)("div",{className:"space-y-2",children:e.vector_store_search_response.data.map((e,a)=>{let l=r["".concat(s,"-").concat(a)]||!1;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center p-3 bg-gray-50 cursor-pointer",onClick:()=>c(s,a),children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(l?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("span",{className:"font-medium mr-2",children:["Result ",a+1]}),(0,t.jsxs)("span",{className:"text-gray-500 text-sm",children:["Score: ",(0,t.jsx)("span",{className:"font-mono",children:e.score.toFixed(4)})]})]})]}),l&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:e.content.map((e,s)=>(0,t.jsxs)("div",{className:"mb-2 last:mb-0",children:[(0,t.jsx)("div",{className:"text-xs text-gray-500 mb-1",children:e.type}),(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all bg-gray-50 p-2 rounded",children:e.text})]},s))})]},a)})})]},s))})]})}let q=e=>e>=.8?"text-green-600":"text-yellow-600";var Y=e=>{let{entities:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({}),d=e=>{n(s=>({...s,[e]:!s[e]}))};return s&&0!==s.length?(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center mb-2 cursor-pointer",onClick:()=>l(!a),children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h4",{className:"font-medium",children:["Detected Entities (",s.length,")"]})]}),a&&(0,t.jsx)("div",{className:"space-y-2",children:s.map((e,s)=>{let a=r[s]||!1;return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>d(s),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)("span",{className:"font-medium mr-2",children:e.entity_type}),(0,t.jsxs)("span",{className:"font-mono ".concat(q(e.score)),children:["Score: ",e.score.toFixed(2)]})]}),(0,t.jsxs)("span",{className:"text-xs text-gray-500",children:["Position: ",e.start,"-",e.end]})]}),a&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Entity Type:"}),(0,t.jsx)("span",{children:e.entity_type})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Position:"}),(0,t.jsxs)("span",{children:["Characters ",e.start,"-",e.end]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Confidence:"}),(0,t.jsx)("span",{className:q(e.score),children:e.score.toFixed(2)})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[e.recognition_metadata&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Recognizer:"}),(0,t.jsx)("span",{children:e.recognition_metadata.recognizer_name})]}),(0,t.jsxs)("div",{className:"flex overflow-hidden",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Identifier:"}),(0,t.jsx)("span",{className:"truncate text-xs font-mono",children:e.recognition_metadata.recognizer_identifier})]})]}),e.analysis_explanation&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Explanation:"}),(0,t.jsx)("span",{children:e.analysis_explanation})]})]})]})})]},s)})})]}):null};let P=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"slate";return(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat({green:"bg-green-100 text-green-800",red:"bg-red-100 text-red-800",blue:"bg-blue-50 text-blue-700",slate:"bg-slate-100 text-slate-800",amber:"bg-amber-100 text-amber-800"}[s]),children:e})},Z=e=>e?P("detected","red"):P("not detected","slate"),B=e=>{let{title:s,count:a,defaultOpen:l=!0,right:r,children:n}=e,[d,o]=(0,i.useState)(l);return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>o(e=>!e),children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(d?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h5",{className:"font-medium",children:[s," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]}),(0,t.jsx)("div",{children:r})]}),d&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:n})]})},U=e=>{let{label:s,children:a,mono:l}=e;return(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:s}),(0,t.jsx)("span",{className:l?"font-mono text-sm break-all":"",children:a})]})},V=()=>(0,t.jsx)("div",{className:"my-3 border-t"});var W=e=>{var s,a,l,r,n,i,d,o,c,m;let{response:x}=e;if(!x)return null;let u=null!==(n=null!==(r=x.outputs)&&void 0!==r?r:x.output)&&void 0!==n?n:[],h="GUARDRAIL_INTERVENED"===x.action?"red":"green",g=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(s=x.guardrailCoverage)||void 0===s?void 0:s.textCharacters)&&P("text guarded ".concat(null!==(i=x.guardrailCoverage.textCharacters.guarded)&&void 0!==i?i:0,"/").concat(null!==(d=x.guardrailCoverage.textCharacters.total)&&void 0!==d?d:0),"blue"),(null===(a=x.guardrailCoverage)||void 0===a?void 0:a.images)&&P("images guarded ".concat(null!==(o=x.guardrailCoverage.images.guarded)&&void 0!==o?o:0,"/").concat(null!==(c=x.guardrailCoverage.images.total)&&void 0!==c?c:0),"blue")]}),p=x.usage&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(x.usage).map(e=>{let[s,a]=e;return"number"==typeof a?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[s,": ",a]},s):null})});return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"border rounded-lg p-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U,{label:"Action:",children:P(null!==(m=x.action)&&void 0!==m?m:"N/A",h)}),x.actionReason&&(0,t.jsx)(U,{label:"Action Reason:",children:x.actionReason}),x.blockedResponse&&(0,t.jsx)(U,{label:"Blocked Response:",children:(0,t.jsx)("span",{className:"italic",children:x.blockedResponse})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U,{label:"Coverage:",children:g}),(0,t.jsx)(U,{label:"Usage:",children:p})]})]}),u.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V,{}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Outputs"}),(0,t.jsx)("div",{className:"space-y-2",children:u.map((e,s)=>{var a;return(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsx)("div",{className:"text-sm whitespace-pre-wrap",children:null!==(a=e.text)&&void 0!==a?a:(0,t.jsx)("em",{children:"(non-text output)"})})},s)})})]})]}),(null===(l=x.assessments)||void 0===l?void 0:l.length)?(0,t.jsx)("div",{className:"space-y-3",children:x.assessments.map((e,s)=>{var a,l,r,n,i,d,o,c,m,x,u,h,g,p,j,f,v,b,y,N,w,_,k,S;let C=(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.wordPolicy&&P("word","slate"),e.contentPolicy&&P("content","slate"),e.topicPolicy&&P("topic","slate"),e.sensitiveInformationPolicy&&P("sensitive-info","slate"),e.contextualGroundingPolicy&&P("contextual-grounding","slate"),e.automatedReasoningPolicy&&P("automated-reasoning","slate")]});return(0,t.jsxs)(B,{title:"Assessment #".concat(s+1),defaultOpen:!0,right:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(null===(a=e.invocationMetrics)||void 0===a?void 0:a.guardrailProcessingLatency)!=null&&P("".concat(e.invocationMetrics.guardrailProcessingLatency," ms"),"amber"),C]}),children:[e.wordPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Word Policy"}),(null!==(f=null===(l=e.wordPolicy.customWords)||void 0===l?void 0:l.length)&&void 0!==f?f:0)>0&&(0,t.jsx)(B,{title:"Custom Words",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.customWords.map((e,s)=>{var a;return(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match})]}),Z(e.detected)]},s)})})}),(null!==(v=null===(r=e.wordPolicy.managedWordLists)||void 0===r?void 0:r.length)&&void 0!==v?v:0)>0&&(0,t.jsx)(B,{title:"Managed Word Lists",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.wordPolicy.managedWordLists.map((e,s)=>{var a;return(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-mono text-sm break-all",children:e.match}),e.type&&P(e.type,"slate")]}),Z(e.detected)]},s)})})})]}),(null===(i=e.contentPolicy)||void 0===i?void 0:null===(n=i.filters)||void 0===n?void 0:n.length)?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Content Policy"}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"min-w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-gray-600",children:[(0,t.jsx)("th",{className:"py-1 pr-4",children:"Type"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Action"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Detected"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Strength"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Confidence"})]})}),(0,t.jsx)("tbody",{children:e.contentPolicy.filters.map((e,s)=>{var a,l,r,n;return(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(a=e.type)&&void 0!==a?a:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:P(null!==(l=e.action)&&void 0!==l?l:"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:Z(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(r=e.filterStrength)&&void 0!==r?r:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(n=e.confidence)&&void 0!==n?n:"—"})]},s)})})]})})]}):null,(null===(o=e.contextualGroundingPolicy)||void 0===o?void 0:null===(d=o.filters)||void 0===d?void 0:d.length)?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Contextual Grounding"}),(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"min-w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-gray-600",children:[(0,t.jsx)("th",{className:"py-1 pr-4",children:"Type"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Action"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Detected"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Score"}),(0,t.jsx)("th",{className:"py-1 pr-4",children:"Threshold"})]})}),(0,t.jsx)("tbody",{children:e.contextualGroundingPolicy.filters.map((e,s)=>{var a,l,r,n;return(0,t.jsxs)("tr",{className:"border-t",children:[(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(a=e.type)&&void 0!==a?a:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:P(null!==(l=e.action)&&void 0!==l?l:"—",e.detected?"red":"slate")}),(0,t.jsx)("td",{className:"py-1 pr-4",children:Z(e.detected)}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(r=e.score)&&void 0!==r?r:"—"}),(0,t.jsx)("td",{className:"py-1 pr-4",children:null!==(n=e.threshold)&&void 0!==n?n:"—"})]},s)})})]})})]}):null,e.sensitiveInformationPolicy&&(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Sensitive Information"}),(null!==(b=null===(c=e.sensitiveInformationPolicy.piiEntities)||void 0===c?void 0:c.length)&&void 0!==b?b:0)>0&&(0,t.jsx)(B,{title:"PII Entities",defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.piiEntities.map((e,s)=>{var a;return(0,t.jsxs)("div",{className:"flex justify-between items-center p-2 bg-gray-50 rounded",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),e.type&&P(e.type,"slate"),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]}),Z(e.detected)]},s)})})}),(null!==(y=null===(m=e.sensitiveInformationPolicy.regexes)||void 0===m?void 0:m.length)&&void 0!==y?y:0)>0&&(0,t.jsx)(B,{title:"Custom Regexes",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.sensitiveInformationPolicy.regexes.map((e,s)=>{var a,l;return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-2 bg-gray-50 rounded gap-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:null!==(l=e.name)&&void 0!==l?l:"regex"}),(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.regex})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[Z(e.detected),e.match&&(0,t.jsx)("span",{className:"font-mono text-xs break-all",children:e.match})]})]},s)})})})]}),(null===(u=e.topicPolicy)||void 0===u?void 0:null===(x=u.topics)||void 0===x?void 0:x.length)?(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)("h6",{className:"font-medium mb-2",children:"Topic Policy"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.topicPolicy.topics.map((e,s)=>{var a,l;return(0,t.jsx)("div",{className:"px-3 py-1.5 bg-gray-50 rounded-md text-xs",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[P(null!==(a=e.action)&&void 0!==a?a:"N/A",e.detected?"red":"slate"),(0,t.jsx)("span",{className:"font-medium",children:null!==(l=e.name)&&void 0!==l?l:"topic"}),e.type&&P(e.type,"slate"),Z(e.detected)]})},s)})})]}):null,e.invocationMetrics&&(0,t.jsx)(B,{title:"Invocation Metrics",defaultOpen:!1,children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(U,{label:"Latency (ms)",children:null!==(N=e.invocationMetrics.guardrailProcessingLatency)&&void 0!==N?N:"—"}),(0,t.jsx)(U,{label:"Coverage:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(h=e.invocationMetrics.guardrailCoverage)||void 0===h?void 0:h.textCharacters)&&P("text ".concat(null!==(w=e.invocationMetrics.guardrailCoverage.textCharacters.guarded)&&void 0!==w?w:0,"/").concat(null!==(_=e.invocationMetrics.guardrailCoverage.textCharacters.total)&&void 0!==_?_:0),"blue"),(null===(g=e.invocationMetrics.guardrailCoverage)||void 0===g?void 0:g.images)&&P("images ".concat(null!==(k=e.invocationMetrics.guardrailCoverage.images.guarded)&&void 0!==k?k:0,"/").concat(null!==(S=e.invocationMetrics.guardrailCoverage.images.total)&&void 0!==S?S:0),"blue")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(U,{label:"Usage:",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.invocationMetrics.usage&&Object.entries(e.invocationMetrics.usage).map(e=>{let[s,a]=e;return"number"==typeof a?(0,t.jsxs)("span",{className:"px-2 py-1 bg-slate-100 text-slate-800 rounded-md text-xs font-medium",children:[s,": ",a]},s):null})})})})]})}),(null===(j=e.automatedReasoningPolicy)||void 0===j?void 0:null===(p=j.findings)||void 0===p?void 0:p.length)?(0,t.jsx)(B,{title:"Automated Reasoning Findings",defaultOpen:!1,children:(0,t.jsx)("div",{className:"space-y-2",children:e.automatedReasoningPolicy.findings.map((e,s)=>(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-2 text-xs overflow-x-auto",children:JSON.stringify(e,null,2)},s))})}):null]},s)})}):null,(0,t.jsx)(B,{title:"Raw Bedrock Guardrail Response",defaultOpen:!1,children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(x,null,2)})})]})};let z=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"slate";return(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat({green:"bg-green-100 text-green-800",red:"bg-red-100 text-red-800",blue:"bg-blue-50 text-blue-700",slate:"bg-slate-100 text-slate-800",amber:"bg-amber-100 text-amber-800"}[s]),children:e})},J=e=>{let{title:s,count:a,defaultOpen:l=!0,children:r}=e,[n,d]=(0,i.useState)(l);return(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>d(e=>!e),children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(n?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsxs)("h5",{className:"font-medium",children:[s," ","number"==typeof a&&(0,t.jsxs)("span",{className:"text-gray-500 font-normal",children:["(",a,")"]})]})]})}),n&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:r})]})},G=e=>{let{label:s,children:a,mono:l}=e;return(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:s}),(0,t.jsx)("span",{className:l?"font-mono text-sm break-all":"",children:a})]})};var Q=e=>{let{response:s}=e;if(!s||"string"==typeof s)return"string"==typeof s&&s?(0,t.jsx)("div",{className:"bg-white rounded-lg border border-red-200 p-4",children:(0,t.jsxs)("div",{className:"text-red-800",children:[(0,t.jsx)("h5",{className:"font-medium mb-2",children:"Error"}),(0,t.jsx)("p",{className:"text-sm",children:s})]})}):null;let a=Array.isArray(s)?s:[];if(0===a.length)return(0,t.jsx)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:(0,t.jsx)("div",{className:"text-gray-600 text-sm",children:"No detections found"})});let l=a.filter(e=>"pattern"===e.type),r=a.filter(e=>"blocked_word"===e.type),n=a.filter(e=>"category_keyword"===e.type),i=a.filter(e=>"BLOCK"===e.action).length,d=a.filter(e=>"MASK"===e.action).length,o=a.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(G,{label:"Total Detections:",children:(0,t.jsx)("span",{className:"font-semibold",children:o})}),(0,t.jsx)(G,{label:"Actions:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[i>0&&z("".concat(i," blocked"),"red"),d>0&&z("".concat(d," masked"),"blue"),0===i&&0===d&&z("passed","green")]})})]}),(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)(G,{label:"By Type:",children:(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[l.length>0&&z("".concat(l.length," patterns"),"slate"),r.length>0&&z("".concat(r.length," keywords"),"slate"),n.length>0&&z("".concat(n.length," categories"),"slate")]})})})]})}),l.length>0&&(0,t.jsx)(J,{title:"Patterns Matched",count:l.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:l.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(G,{label:"Pattern:",children:e.pattern_name||"unknown"})}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(G,{label:"Action:",children:z(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),r.length>0&&(0,t.jsx)(J,{title:"Blocked Words Detected",count:r.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:r.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(G,{label:"Keyword:",mono:!0,children:e.keyword||"unknown"}),e.description&&(0,t.jsx)(G,{label:"Description:",children:e.description})]}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(G,{label:"Action:",children:z(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),n.length>0&&(0,t.jsx)(J,{title:"Category Keywords Detected",count:n.length,defaultOpen:!0,children:(0,t.jsx)("div",{className:"space-y-2",children:n.map((e,s)=>(0,t.jsx)("div",{className:"p-3 bg-gray-50 rounded-md",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(G,{label:"Category:",children:e.category||"unknown"}),(0,t.jsx)(G,{label:"Keyword:",mono:!0,children:e.keyword||"unknown"}),e.severity&&(0,t.jsx)(G,{label:"Severity:",children:z(e.severity,"high"===e.severity?"red":"medium"===e.severity?"amber":"slate")})]}),(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsx)(G,{label:"Action:",children:z(e.action,"BLOCK"===e.action?"red":"blue")})})]})},s))})}),(0,t.jsx)(J,{title:"Raw Detection Data",defaultOpen:!1,children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(a,null,2)})})]})};let $=e=>new Date(1e3*e).toLocaleString(),X=new Set(["presidio","bedrock","litellm_content_filter"]),ee=e=>{let{response:s}=e,[a,l]=(0,i.useState)(!1);return(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer hover:bg-gray-100",onClick:()=>l(!a),children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-5 h-5 mr-2 transition-transform ".concat(a?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)("h5",{className:"font-medium",children:"Raw Guardrail Response"})]})}),a&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:(0,t.jsx)("pre",{className:"bg-gray-50 rounded p-3 text-xs overflow-x-auto",children:JSON.stringify(s,null,2)})})]})})},es=e=>{var s,a;let{entry:l,index:r,total:n}=e,i=null!==(s=l.guardrail_provider)&&void 0!==s?s:"presidio",d=null!==(a=l.guardrail_status)&&void 0!==a?a:"unknown",o="success"===d.toLowerCase(),c=l.masked_entity_count||{},m=Object.values(c).reduce((e,s)=>e+("number"==typeof s?s:0),0),x=l.guardrail_response,u=Array.isArray(x)?x:[],g="bedrock"!==i||null===x||"object"!=typeof x||Array.isArray(x)?void 0:x;return(0,t.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[n>1&&(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("h4",{className:"text-base font-semibold",children:["Guardrail #",r+1,(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:l.guardrail_name})]}),(0,t.jsx)("span",{className:"px-2 py-0.5 bg-gray-100 text-gray-600 rounded-md text-xs capitalize",children:i})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail Name:"}),(0,t.jsx)("span",{className:"font-mono break-words",children:l.guardrail_name})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Mode:"}),(0,t.jsx)("span",{className:"font-mono break-words",children:l.guardrail_mode})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,t.jsx)(h.Z,{title:o?null:"Guardrail failed to run.",placement:"top",arrow:!0,destroyTooltipOnHide:!0,children:(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block ".concat(o?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:d})})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,t.jsx)("span",{children:$(l.start_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,t.jsx)("span",{children:$(l.end_time)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsxs)("span",{children:[l.duration.toFixed(4),"s"]})]})]})]}),m>0&&(0,t.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,t.jsx)("h5",{className:"font-medium mb-2",children:"Masked Entity Summary"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(c).map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[s,": ",a]},s)})})]}),"presidio"===i&&u.length>0&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(Y,{entities:u})}),"bedrock"===i&&g&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(W,{response:g})}),"litellm_content_filter"===i&&x&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(Q,{response:x})}),i&&!X.has(i)&&x&&(0,t.jsx)(ee,{response:x})]})};var ea=e=>{let{data:s}=e,a=Array.isArray(s)?s.filter(e=>!!e):s?[s]:[],[l,r]=(0,i.useState)(!0),n=1===a.length?a[0].guardrail_name:"".concat(a.length," guardrails"),d=Array.from(new Set(a.map(e=>e.guardrail_status))).every(e=>"success"===(null!=e?e:"").toLowerCase()),o=a.reduce((e,s)=>e+Object.values(s.masked_entity_count||{}).reduce((e,s)=>e+("number"==typeof s?s:0),0),0);return 0===a.length?null:(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow mb-6",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b cursor-pointer hover:bg-gray-50",onClick:()=>r(!l),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-5 h-5 text-gray-600 transition-transform ".concat(l?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Guardrail Information"}),(0,t.jsx)(h.Z,{title:d?null:"Guardrail failed to run.",placement:"top",arrow:!0,destroyTooltipOnHide:!0,children:(0,t.jsx)("span",{className:"ml-2 px-2 py-1 rounded-md text-xs font-medium inline-block ".concat(d?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:d?"success":"failure"})}),(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:n}),o>0&&(0,t.jsxs)("span",{className:"ml-2 px-2 py-1 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[o," masked ",1===o?"entity":"entities"]})]}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:l?"Click to collapse":"Click to expand"})]}),l&&(0,t.jsx)("div",{className:"p-4 space-y-6",children:a.map((e,s)=>{var l;return(0,t.jsx)(es,{entry:e,index:s,total:a.length},"".concat(null!==(l=e.guardrail_name)&&void 0!==l?l:"guardrail","-").concat(s))})})]})},et=a(87452),el=a(88829),er=a(72208);let en=e=>null==e?"-":"$".concat((0,m.pw)(e,8)),ei=e=>null==e?"-":"".concat((100*e).toFixed(2),"%"),ed=e=>{var s;let{costBreakdown:a,totalSpend:l}=e;if(!a)return null;let r=void 0!==a.discount_percent&&0!==a.discount_percent||void 0!==a.discount_amount&&0!==a.discount_amount,n=void 0!==a.margin_percent&&0!==a.margin_percent||void 0!==a.margin_fixed_amount&&0!==a.margin_fixed_amount||void 0!==a.margin_total_amount&&0!==a.margin_total_amount;return void 0!==a.input_cost||void 0!==a.output_cost||r||n?(0,t.jsx)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:(0,t.jsxs)(et.Z,{children:[(0,t.jsx)(er.Z,{className:"p-4 border-b hover:bg-gray-50 transition-colors text-left",children:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:"Cost Breakdown"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mr-4",children:[(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Total:"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:en(l)})]})]})}),(0,t.jsx)(el.Z,{className:"px-0",children:(0,t.jsxs)("div",{className:"p-6 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2 max-w-2xl",children:[(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Input Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:en(a.input_cost)})]}),(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Output Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:en(a.output_cost)})]}),void 0!==a.tool_usage_cost&&a.tool_usage_cost>0&&(0,t.jsxs)("div",{className:"flex text-sm",children:[(0,t.jsx)("span",{className:"text-gray-600 font-medium w-1/3",children:"Tool Usage Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:en(a.tool_usage_cost)})]})]}),(0,t.jsx)("div",{className:"pt-2 border-t border-gray-100 max-w-2xl",children:(0,t.jsxs)("div",{className:"flex text-sm font-semibold",children:[(0,t.jsx)("span",{className:"text-gray-900 w-1/3",children:"Original LLM Cost:"}),(0,t.jsx)("span",{className:"text-gray-900",children:en(a.original_cost)})]})}),(r||n)&&(0,t.jsxs)("div",{className:"pt-2 space-y-2 max-w-2xl",children:[r&&(0,t.jsxs)("div",{className:"space-y-2",children:[void 0!==a.discount_percent&&0!==a.discount_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsxs)("span",{className:"font-medium w-1/3",children:["Discount (",ei(a.discount_percent),"):"]}),(0,t.jsxs)("span",{className:"text-gray-900",children:["-",en(a.discount_amount)]})]}),void 0!==a.discount_amount&&void 0===a.discount_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Discount Amount:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:["-",en(a.discount_amount)]})]})]}),n&&(0,t.jsxs)("div",{className:"space-y-2",children:[void 0!==a.margin_percent&&0!==a.margin_percent&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsxs)("span",{className:"font-medium w-1/3",children:["Margin (",ei(a.margin_percent),"):"]}),(0,t.jsxs)("span",{className:"text-gray-900",children:["+",en((a.margin_total_amount||0)-(a.margin_fixed_amount||0))]})]}),void 0!==a.margin_fixed_amount&&0!==a.margin_fixed_amount&&(0,t.jsxs)("div",{className:"flex text-sm text-gray-600",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Margin:"}),(0,t.jsxs)("span",{className:"text-gray-900",children:["+",en(a.margin_fixed_amount)]})]})]})]}),(0,t.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-200 max-w-2xl",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{className:"font-bold text-sm text-gray-900 w-1/3",children:"Final Calculated Cost:"}),(0,t.jsx)("span",{className:"text-sm font-bold text-gray-900",children:en(null!==(s=a.total_cost)&&void 0!==s?s:l)})]})})]})})]})}):null};var eo=a(23048),ec=a(30841),em=a(7310),ex=a.n(em),eu=a(12363);let eh={TEAM_ID:"Team ID",KEY_HASH:"Key Hash",REQUEST_ID:"Request ID",MODEL:"Model",USER_ID:"User ID",END_USER:"End User",STATUS:"Status",KEY_ALIAS:"Key Alias",ERROR_CODE:"Error Code"};var eg=a(59341),ep=a(12485),ej=a(18135),ef=a(35242),ev=a(29706),eb=a(77991),ey=a(92280);let eN="".concat("../ui/assets/","audit-logs-preview.png");function ew(e){let{userID:s,userRole:a,token:l,accessToken:d,isActive:x,premiumUser:u,allTeams:h}=e,[g,p]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),j=(0,i.useRef)(null),f=(0,i.useRef)(null),[v,b]=(0,i.useState)(1),[N]=(0,i.useState)(50),[w,_]=(0,i.useState)({}),[k,S]=(0,i.useState)(""),[C,L]=(0,i.useState)(""),[E,M]=(0,i.useState)(""),[D,T]=(0,i.useState)("all"),[A,O]=(0,i.useState)("all"),[R,I]=(0,i.useState)(!1),[H,K]=(0,i.useState)(!1),F=(0,n.a)({queryKey:["all_audit_logs",d,l,a,s,g],queryFn:async()=>{if(!d||!l||!a||!s)return[];let e=r()(g).utc().format("YYYY-MM-DD HH:mm:ss"),t=r()().utc().format("YYYY-MM-DD HH:mm:ss"),n=[],i=1,c=1;do{let s=await (0,o.uiAuditLogsCall)(d,e,t,i,50);n=n.concat(s.audit_logs),c=s.total_pages,i++}while(i<=c);return n},enabled:!!d&&!!l&&!!a&&!!s&&x,refetchInterval:5e3,refetchIntervalInBackground:!0}),q=(0,i.useCallback)(async e=>{if(d)try{let s=(await (0,o.keyListCall)(d,null,null,e,null,null,1,10)).keys.find(s=>s.key_alias===e);s?L(s.token):L("")}catch(e){console.error("Error fetching key hash for alias:",e),L("")}},[d]);(0,i.useEffect)(()=>{if(!d)return;let e=!1,s=!1;w["Team ID"]?k!==w["Team ID"]&&(S(w["Team ID"]),e=!0):""!==k&&(S(""),e=!0),w["Key Hash"]?C!==w["Key Hash"]&&(L(w["Key Hash"]),s=!0):w["Key Alias"]?q(w["Key Alias"]):""!==C&&(L(""),s=!0),(e||s)&&b(1)},[w,d,q,k,C]),(0,i.useEffect)(()=>{b(1)},[k,C,g,E,D,A]),(0,i.useEffect)(()=>{function e(e){j.current&&!j.current.contains(e.target)&&I(!1),f.current&&!f.current.contains(e.target)&&K(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let Y=(0,i.useMemo)(()=>F.data?F.data.filter(e=>{var s,a,t,l,r,n,i;let d=!0,o=!0,c=!0,m=!0,x=!0;if(k){let r="string"==typeof e.before_value?null===(s=JSON.parse(e.before_value))||void 0===s?void 0:s.team_id:null===(a=e.before_value)||void 0===a?void 0:a.team_id,n="string"==typeof e.updated_values?null===(t=JSON.parse(e.updated_values))||void 0===t?void 0:t.team_id:null===(l=e.updated_values)||void 0===l?void 0:l.team_id;d=r===k||n===k}if(C)try{let s="string"==typeof e.before_value?JSON.parse(e.before_value):e.before_value,a="string"==typeof e.updated_values?JSON.parse(e.updated_values):e.updated_values,t=null==s?void 0:s.token,l=null==a?void 0:a.token;o="string"==typeof t&&t.includes(C)||"string"==typeof l&&l.includes(C)}catch(e){o=!1}if(E&&(c=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(E.toLowerCase())),"all"!==D&&(m=(null===(n=e.action)||void 0===n?void 0:n.toLowerCase())===D.toLowerCase()),"all"!==A){let s="";switch(A){case"keys":s="litellm_verificationtoken";break;case"teams":s="litellm_teamtable";break;case"users":s="litellm_usertable";break;default:s=A}x=(null===(i=e.table_name)||void 0===i?void 0:i.toLowerCase())===s}return d&&o&&c&&m&&x}):[],[F.data,k,C,E,D,A]),P=Y.length,Z=Math.ceil(P/N)||1,B=(0,i.useMemo)(()=>{let e=(v-1)*N,s=e+N;return Y.slice(e,s)},[Y,v,N]),U=!F.data||0===F.data.length,V=(0,i.useCallback)(e=>{let{row:s}=e;return(0,t.jsx)(e=>{let{rowData:s}=e,{before_value:a,updated_values:l,table_name:r,action:n}=s,i=(e,s)=>{if(!e||0===Object.keys(e).length)return(0,t.jsx)(ey.x,{children:"N/A"});if(s){let s=Object.keys(e),a=["token","spend","max_budget"];if(s.every(e=>a.includes(e))&&s.length>0)return(0,t.jsxs)("div",{children:[s.includes("token")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Token:"})," ",e.token||"N/A"]}),s.includes("spend")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Spend:"})," ",void 0!==e.spend?"$".concat((0,m.pw)(e.spend,6)):"N/A"]}),s.includes("max_budget")&&(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Max Budget:"})," ",void 0!==e.max_budget?"$".concat((0,m.pw)(e.max_budget,6)):"N/A"]})]});if(e["No differing fields detected in 'before' state"]||e["No differing fields detected in 'updated' state"]||e["No fields changed"])return(0,t.jsx)(ey.x,{children:e[Object.keys(e)[0]]})}return(0,t.jsx)("pre",{className:"p-2 bg-gray-50 border rounded text-xs overflow-auto max-h-60",children:JSON.stringify(e,null,2)})},d=a,o=l;if(("updated"===n||"rotated"===n)&&a&&l&&("LiteLLM_TeamTable"===r||"LiteLLM_UserTable"===r||"LiteLLM_VerificationToken"===r)){let e={},s={};new Set([...Object.keys(a),...Object.keys(l)]).forEach(t=>{JSON.stringify(a[t])!==JSON.stringify(l[t])&&(a.hasOwnProperty(t)&&(e[t]=a[t]),l.hasOwnProperty(t)&&(s[t]=l[t]))}),Object.keys(a).forEach(t=>{l.hasOwnProperty(t)||e.hasOwnProperty(t)||(e[t]=a[t],s[t]=void 0)}),Object.keys(l).forEach(t=>{a.hasOwnProperty(t)||s.hasOwnProperty(t)||(s[t]=l[t],e[t]=void 0)}),d=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},o=Object.keys(s).length>0?s:{"No differing fields detected in 'updated' state":"N/A"},0===Object.keys(e).length&&0===Object.keys(s).length&&(d={"No fields changed":"N/A"},o={"No fields changed":"N/A"})}return(0,t.jsxs)("div",{className:"-mx-4 p-4 bg-slate-100 border-y border-slate-300 grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Before Value:"}),i(d,"LiteLLM_VerificationToken"===r)]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-semibold mb-2 text-sm text-slate-700",children:"Updated Value:"}),i(o,"LiteLLM_VerificationToken"===r)]})]})},{rowData:s.original})},[]);if(!u)return(0,t.jsxs)("div",{style:{textAlign:"center",marginTop:"20px"},children:[(0,t.jsx)("h1",{style:{display:"block",marginBottom:"10px"},children:"✨ Enterprise Feature."}),(0,t.jsx)(ey.x,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,t.jsx)(ey.x,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,t.jsx)("img",{src:eN,alt:"Audit Logs Preview",style:{maxWidth:"100%",maxHeight:"700px",borderRadius:"8px",boxShadow:"0 4px 8px rgba(0,0,0,0.1)",margin:"0 auto"},onError:e=>{console.error("Failed to load audit logs preview image"),e.target.style.display="none"}})]});let W=P>0?(v-1)*N+1:0,z=Math.min(v*N,P);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4"}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsxs)("div",{className:"border-b px-6 py-4",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold py-4",children:"Audit Logs"}),(0,t.jsx)(e=>{let{show:s}=e;return s?(0,t.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 flex items-start mb-6",children:[(0,t.jsx)("div",{className:"text-blue-500 mr-3 flex-shrink-0 mt-0.5",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,t.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,t.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-blue-800",children:"Audit Logs Not Available"}),(0,t.jsx)("p",{className:"text-sm text-blue-700 mt-1",children:"To enable audit logging, add the following configuration to your LiteLLM proxy configuration file:"}),(0,t.jsx)("pre",{className:"mt-2 bg-white p-3 rounded border border-blue-200 text-xs font-mono overflow-auto",children:"litellm_settings:\n store_audit_logs: true"}),(0,t.jsx)("p",{className:"text-xs text-blue-700 mt-2",children:"Note: This will only affect new requests after the configuration change and proxy restart."})]})]}):null},{show:U}),(0,t.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0",children:[(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("input",{type:"text",placeholder:"Search by Object ID...",value:E,onChange:e=>M(e.target.value),className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,t.jsxs)("button",{onClick:()=>{F.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,t.jsx)("svg",{className:"w-4 h-4 ".concat(F.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,t.jsx)("span",{children:"Refresh"})]})]})}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("div",{className:"relative",ref:j,children:[(0,t.jsx)("label",{htmlFor:"actionFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Action:"}),(0,t.jsxs)("button",{id:"actionFilterDisplay",onClick:()=>I(!R),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,t.jsxs)("span",{children:["all"===D&&"All Actions","created"===D&&"Created","updated"===D&&"Updated","deleted"===D&&"Deleted","rotated"===D&&"Rotated"]}),(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),R&&(0,t.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,t.jsx)("div",{className:"space-y-1",children:[{label:"All Actions",value:"all"},{label:"Created",value:"created"},{label:"Updated",value:"updated"},{label:"Deleted",value:"deleted"},{label:"Rotated",value:"rotated"}].map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(D===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{T(e.value),I(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("div",{className:"relative",ref:f,children:[(0,t.jsx)("label",{htmlFor:"tableFilterDisplay",className:"mr-2 text-sm font-medium text-gray-700 sr-only",children:"Table:"}),(0,t.jsxs)("button",{id:"tableFilterDisplay",onClick:()=>K(!H),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 bg-white w-40 text-left justify-between",children:[(0,t.jsxs)("span",{children:["all"===A&&"All Tables","keys"===A&&"Keys","teams"===A&&"Teams","users"===A&&"Users"]}),(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),H&&(0,t.jsx)("div",{className:"absolute left-0 mt-2 w-40 bg-white rounded-lg shadow-lg border p-1 z-50",children:(0,t.jsx)("div",{className:"space-y-1",children:[{label:"All Tables",value:"all"},{label:"Keys",value:"keys"},{label:"Teams",value:"teams"},{label:"Users",value:"users"}].map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(A===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{O(e.value),K(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing ",F.isLoading?"...":W," -"," ",F.isLoading?"...":z," of"," ",F.isLoading?"...":P," results"]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",F.isLoading?"...":v," of"," ",F.isLoading?"...":Z]}),(0,t.jsx)("button",{onClick:()=>b(e=>Math.max(1,e-1)),disabled:F.isLoading||1===v,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,t.jsx)("button",{onClick:()=>b(e=>Math.min(Z,e+1)),disabled:F.isLoading||v===Z,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),(0,t.jsx)(c.w,{columns:y,data:B,renderSubComponent:V,getRowCanExpand:()=>!0})]})]})}let e_=(e,s,a)=>{if(e)return"".concat(r()(s).format("MMM D, h:mm A")," - ").concat(r()(a).format("MMM D, h:mm A"));let t=r()(),l=r()(s),n=t.diff(l,"minutes");if(n>=0&&n<2)return"Last 1 Minute";if(n>=2&&n<16)return"Last 15 Minutes";if(n>=16&&n<61)return"Last Hour";let i=t.diff(l,"hours");return i>=1&&i<5?"Last 4 Hours":i>=5&&i<25?"Last 24 Hours":i>=25&&i<169?"Last 7 Days":"".concat(l.format("MMM D")," - ").concat(t.format("MMM D"))};var ek=a(9309);function eS(e){var s,a,l;let{accessToken:m,token:x,userRole:u,userID:h,allTeams:g,premiumUser:p}=e,[j,f]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),[w,_]=(0,i.useState)(!1),[k,S]=(0,i.useState)(1),[L]=(0,i.useState)(50),M=(0,i.useRef)(null),D=(0,i.useRef)(null),T=(0,i.useRef)(null),[A,O]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[R,I]=(0,i.useState)(r()().format("YYYY-MM-DDTHH:mm")),[H,F]=(0,i.useState)(!1),[q,Y]=(0,i.useState)(!1),[P,Z]=(0,i.useState)(""),[B,U]=(0,i.useState)(""),[V,W]=(0,i.useState)(""),[z,J]=(0,i.useState)(""),[G,Q]=(0,i.useState)(""),[$,X]=(0,i.useState)(null),[ee,es]=(0,i.useState)(null),[ea,et]=(0,i.useState)(""),[el,er]=(0,i.useState)(""),[en,ei]=(0,i.useState)(u&&C.lo.includes(u)),[ed,em]=(0,i.useState)("request logs"),[ey,eN]=(0,i.useState)(null),[ek,eS]=(0,i.useState)(null),eL=(0,d.NL)(),[eE,eM]=(0,i.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,i.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(eE))},[eE]);let[eD,eT]=(0,i.useState)({value:24,unit:"hours"});(0,i.useEffect)(()=>{(async()=>{ee&&m&&X({...(await (0,o.keyInfoV1Call)(m,ee)).info,token:ee,api_key:ee})})()},[ee,m]),(0,i.useEffect)(()=>{function e(e){M.current&&!M.current.contains(e.target)&&_(!1),D.current&&!D.current.contains(e.target)&&y(!1),T.current&&!T.current.contains(e.target)&&Y(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,i.useEffect)(()=>{u&&C.lo.includes(u)&&ei(!0)},[u]);let eA=(0,n.a)({queryKey:["logs","table",k,L,A,R,V,z,en?h:null,ea,G],queryFn:async()=>{if(!m||!x||!u||!h)return{data:[],total:0,page:1,page_size:L,total_pages:0};let e=r()(A).utc().format("YYYY-MM-DD HH:mm:ss"),s=H?r()(R).utc().format("YYYY-MM-DD HH:mm:ss"):r()().utc().format("YYYY-MM-DD HH:mm:ss"),a=await (0,o.uiSpendLogsCall)(m,z||void 0,V||void 0,void 0,e,s,k,L,en?h:void 0,el,ea,G);return await N(a.data,e,m,eL),a.data=a.data.map(s=>{let a=eL.getQueryData(["logDetails",s.request_id,e]);return(null==a?void 0:a.messages)&&(null==a?void 0:a.response)&&(s.messages=a.messages,s.response=a.response),s}),a},enabled:!!m&&!!x&&!!u&&!!h&&"request logs"===ed,refetchInterval:!!eE&&1===k&&15e3,refetchIntervalInBackground:!0}),eO=eA.data||{data:[],total:0,page:1,page_size:L||10,total_pages:1},{filters:eR,filteredLogs:eI,allTeams:eH,allKeyAliases:eK,handleFilterChange:eF,handleFilterReset:eq}=function(e){let{logs:s,accessToken:a,startTime:t,endTime:l,pageSize:d=eu.d,isCustomDate:c,setCurrentPage:m,userID:x,userRole:u}=e,h=(0,i.useMemo)(()=>({[eh.TEAM_ID]:"",[eh.KEY_HASH]:"",[eh.REQUEST_ID]:"",[eh.MODEL]:"",[eh.USER_ID]:"",[eh.END_USER]:"",[eh.STATUS]:"",[eh.KEY_ALIAS]:"",[eh.ERROR_CODE]:""}),[]),[g,p]=(0,i.useState)(h),[j,f]=(0,i.useState)({data:[],total:0,page:1,page_size:50,total_pages:0}),v=(0,i.useRef)(0),b=(0,i.useCallback)(async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!a)return;console.log("Filters being sent to API:",e);let n=Date.now();v.current=n;let i=r()(t).utc().format("YYYY-MM-DD HH:mm:ss"),m=c?r()(l).utc().format("YYYY-MM-DD HH:mm:ss"):r()().utc().format("YYYY-MM-DD HH:mm:ss");try{let t=await (0,o.uiSpendLogsCall)(a,e[eh.KEY_HASH]||void 0,e[eh.TEAM_ID]||void 0,e[eh.REQUEST_ID]||void 0,i,m,s,d,e[eh.USER_ID]||void 0,e[eh.END_USER]||void 0,e[eh.STATUS]||void 0,e[eh.MODEL]||void 0,e[eh.KEY_ALIAS]||void 0,e[eh.ERROR_CODE]||void 0);n===v.current&&t.data&&f(t)}catch(e){console.error("Error searching users:",e)}},[a,t,l,c,d]),y=(0,i.useMemo)(()=>ex()((e,s)=>b(e,s),300),[b]);(0,i.useEffect)(()=>()=>y.cancel(),[y]);let N=(0,n.a)({queryKey:["allKeys"],queryFn:async()=>{if(!a)throw Error("Access token required");return await (0,ec.LO)(a)},enabled:!!a}).data||[],w=(0,i.useMemo)(()=>!!(g[eh.KEY_ALIAS]||g[eh.KEY_HASH]||g[eh.REQUEST_ID]||g[eh.USER_ID]||g[eh.END_USER]||g[eh.ERROR_CODE]),[g]),_=(0,i.useMemo)(()=>{if(!s||!s.data)return{data:[],total:0,page:1,page_size:50,total_pages:0};if(w)return s;let e=[...s.data];return g[eh.TEAM_ID]&&(e=e.filter(e=>e.team_id===g[eh.TEAM_ID])),g[eh.STATUS]&&(e=e.filter(e=>"success"===g[eh.STATUS]?!e.status||"success"===e.status:e.status===g[eh.STATUS])),g[eh.MODEL]&&(e=e.filter(e=>e.model===g[eh.MODEL])),g[eh.KEY_HASH]&&(e=e.filter(e=>e.api_key===g[eh.KEY_HASH])),g[eh.END_USER]&&(e=e.filter(e=>e.end_user===g[eh.END_USER])),g[eh.ERROR_CODE]&&(e=e.filter(e=>{let s=(e.metadata||{}).error_information;return s&&s.error_code===g[eh.ERROR_CODE]})),{data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages}},[s,g,w]),k=(0,i.useMemo)(()=>w?j&&j.data&&j.data.length>0?j:s||{data:[],total:0,page:1,page_size:50,total_pages:0}:_,[w,j,_,s]),{data:S}=(0,n.a)({queryKey:["allTeamsForLogFilters",a],queryFn:async()=>a&&await (0,ec.IE)(a)||[],enabled:!!a});return{filters:g,filteredLogs:k,allKeyAliases:N,allTeams:S,handleFilterChange:e=>{p(s=>{let a={...s,...e};for(let e of Object.keys(h))e in a||(a[e]=h[e]);return JSON.stringify(a)!==JSON.stringify(s)&&(m(1),y(a,1)),a})},handleFilterReset:()=>{p(h),f({data:[],total:0,page:1,page_size:50,total_pages:0}),y(h,1)}}}({logs:eO,accessToken:m,startTime:A,endTime:R,pageSize:L,isCustomDate:H,setCurrentPage:S,userID:h,userRole:u}),eY=(0,i.useCallback)(async e=>{if(m)try{let s=(await (0,o.keyListCall)(m,null,null,e,null,null,k,L)).keys.find(s=>s.key_alias===e);s&&J(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[m,k,L]);(0,i.useEffect)(()=>{m&&(eR["Team ID"]?W(eR["Team ID"]):W(""),et(eR.Status||""),Q(eR.Model||""),er(eR["End User"]||""),eR["Key Hash"]?J(eR["Key Hash"]):eR["Key Alias"]?eY(eR["Key Alias"]):J(""))},[eR,m,eY]);let eP=(0,n.a)({queryKey:["sessionLogs",ek],queryFn:async()=>{if(!m||!ek)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,o.sessionSpendLogsCall)(m,ek);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!m&&!!ek});if((0,i.useEffect)(()=>{var e;(null===(e=eA.data)||void 0===e?void 0:e.data)&&ey&&!eA.data.data.some(e=>e.request_id===ey)&&eN(null)},[null===(s=eA.data)||void 0===s?void 0:s.data,ey]),!m||!x||!u||!h)return null;let eZ=eI.data.filter(e=>!j||e.request_id.includes(j)||e.model.includes(j)||e.user&&e.user.includes(j)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>es(e),onSessionClick:e=>{e&&eS(e)}}))||[],eB=(null===(l=eP.data)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:a.map(e=>({...e,onKeyHashClick:e=>es(e),onSessionClick:e=>{}})))||[],eU=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=new Set;return e.forEach(e=>{let t=e.metadata||{};if("failure"===t.status&&t.error_information){let e=t.error_information.error_code;e&&(!s||e.toLowerCase().includes(s.toLowerCase()))&&a.add(e)}}),Array.from(a).map(e=>({label:e,value:e}))},eV=[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>g&&0!==g.length?g.filter(s=>s.team_id.toLowerCase().includes(e.toLowerCase())||s.team_alias&&s.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Status",label:"Status",isSearchable:!1,options:[{label:"Success",value:"success"},{label:"Failure",value:"failure"}]},{name:"Model",label:"Model",isSearchable:!1},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>m?(await (0,ec.LO)(m)).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e})):[]},{name:"End User",label:"End User",isSearchable:!0,searchFn:async e=>{if(!m)return[];let s=await (0,o.allEndUsersCall)(m);return((null==s?void 0:s.map(e=>e.user_id))||[]).filter(s=>s.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))}},{name:"Error Code",label:"Error Code",isSearchable:!0,searchFn:async e=>eU(eO.data,e)},{name:"Key Hash",label:"Key Hash",isSearchable:!1}];if(ek&&eP.data)return(0,t.jsx)("div",{className:"w-full p-6",children:(0,t.jsx)(K,{sessionId:ek,logs:eP.data.data,onBack:()=>eS(null)})});let eW=[{label:"Last 15 Minutes",value:15,unit:"minutes"},{label:"Last Hour",value:1,unit:"hours"},{label:"Last 4 Hours",value:4,unit:"hours"},{label:"Last 24 Hours",value:24,unit:"hours"},{label:"Last 7 Days",value:7,unit:"days"}],ez=eW.find(e=>e.value===eD.value&&e.unit===eD.unit),eJ=H?e_(H,A,R):null==ez?void 0:ez.label;return(0,t.jsx)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:(0,t.jsxs)(ej.Z,{defaultIndex:0,onIndexChange:e=>em(0===e?"request logs":"audit logs"),children:[(0,t.jsxs)(ef.Z,{children:[(0,t.jsx)(ep.Z,{children:"Request Logs"}),(0,t.jsx)(ep.Z,{children:"Audit Logs"})]}),(0,t.jsxs)(eb.Z,{children:[(0,t.jsxs)(ev.Z,{children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("h1",{className:"text-xl font-semibold",children:ek?(0,t.jsxs)(t.Fragment,{children:["Session: ",(0,t.jsx)("span",{className:"font-mono",children:ek}),(0,t.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>eS(null),children:"← Back to All Logs"})]}):"Request Logs"})}),$&&ee&&$.api_key===ee?(0,t.jsx)(E.Z,{keyId:ee,keyData:$,teams:g,onClose:()=>es(null),backButtonText:"Back to Logs"}):ek?(0,t.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,t.jsx)(c.w,{columns:v,data:eB,renderSubComponent:eC,getRowCanExpand:()=>!0})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo.Z,{options:eV,onApplyFilters:eF,onResetFilters:eq}),(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full box-border",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4 w-full max-w-full box-border",children:(0,t.jsxs)("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between space-y-4 md:space-y-0 w-full max-w-full box-border",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 w-full max-w-full box-border",children:[(0,t.jsxs)("div",{className:"relative w-64 min-w-0 flex-shrink-0",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by Request ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:j,onChange:e=>f(e.target.value)}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-shrink",children:[(0,t.jsxs)("div",{className:"relative z-50",ref:T,children:[(0,t.jsxs)("button",{onClick:()=>Y(!q),className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),eJ]}),q&&(0,t.jsx)("div",{className:"absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-lg border p-2 z-50",children:(0,t.jsxs)("div",{className:"space-y-1",children:[eW.map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eJ===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{I(r()().format("YYYY-MM-DDTHH:mm")),O(r()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eT({value:e.value,unit:e.unit}),F(!1),Y(!1)},children:e.label},e.label)),(0,t.jsx)("div",{className:"border-t my-2"}),(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(H?"bg-blue-50 text-blue-600":""),onClick:()=>F(!H),children:"Custom Range"})]})})]}),(0,t.jsx)(()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Live Tail"}),(0,t.jsx)(eg.Z,{color:"green",checked:eE,defaultChecked:!0,onChange:eM})]}),{}),(0,t.jsxs)("button",{onClick:()=>{eA.refetch()},className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",title:"Refresh data",children:[(0,t.jsx)("svg",{className:"w-4 h-4 ".concat(eA.isFetching?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,t.jsx)("span",{children:"Refresh"})]})]}),H&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:A,onChange:e=>{O(e.target.value),S(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})}),(0,t.jsx)("span",{className:"text-gray-500",children:"to"}),(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:R,onChange:e=>{I(e.target.value),S(1)},className:"px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700 whitespace-nowrap",children:["Showing ",eA.isLoading?"...":eI?(k-1)*L+1:0," -"," ",eA.isLoading?"...":eI?Math.min(k*L,eI.total):0," ","of ",eA.isLoading?"...":eI?eI.total:0," results"]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)("span",{className:"text-sm text-gray-700 min-w-[90px]",children:["Page ",eA.isLoading?"...":k," of"," ",eA.isLoading?"...":eI?eI.total_pages:1]}),(0,t.jsx)("button",{onClick:()=>S(e=>Math.max(1,e-1)),disabled:eA.isLoading||1===k,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,t.jsx)("button",{onClick:()=>S(e=>Math.min(eI.total_pages||1,e+1)),disabled:eA.isLoading||k===(eI.total_pages||1),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}),eE&&1===k&&(0,t.jsxs)("div",{className:"mb-4 px-4 py-2 bg-green-50 border border-greem-200 rounded-md flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("span",{className:"text-sm text-green-700",children:"Auto-refreshing every 15 seconds"})}),(0,t.jsx)("button",{onClick:()=>eM(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,t.jsx)(c.w,{columns:v,data:eZ,renderSubComponent:eC,getRowCanExpand:()=>!0})]})]})]}),(0,t.jsx)(ev.Z,{children:(0,t.jsx)(ew,{userID:h,userRole:u,token:x,accessToken:m,isActive:"audit logs"===ed,premiumUser:p,allTeams:g})})]})]})})}function eC(e){var s,a,l,r,n,i,d,o,c,x,u,g;let{row:p}=e,j=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},f=p.original.metadata||{},v="failure"===f.status,b=v?f.error_information:null,y=p.original.messages&&(Array.isArray(p.original.messages)?p.original.messages.length>0:Object.keys(p.original.messages).length>0),N=p.original.response&&Object.keys(j(p.original.response)).length>0,w=f.vector_store_request_metadata&&Array.isArray(f.vector_store_request_metadata)&&f.vector_store_request_metadata.length>0,_=null===(s=p.original.metadata)||void 0===s?void 0:s.guardrail_information,C=Array.isArray(_)?_:_?[_]:[],E=C.length>0,M=C.reduce((e,s)=>{let a=null==s?void 0:s.masked_entity_count;return a?e+Object.values(a).reduce((e,s)=>"number"==typeof s?e+s:e,0):e},0),D=1===C.length?null!==(g=null===(a=C[0])||void 0===a?void 0:a.guardrail_name)&&void 0!==g?g:"-":C.length>1?"".concat(C.length," guardrails"):"-",T=(0,ek.aS)(p.original.request_id,64);return(0,t.jsxs)("div",{className:"p-6 bg-gray-50 space-y-6 w-full max-w-full overflow-hidden box-border",children:[(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow w-full max-w-full overflow-hidden",children:[(0,t.jsx)("div",{className:"p-4 border-b",children:(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request Details"})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 w-full max-w-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Request ID:"}),p.original.request_id.length>64?(0,t.jsx)(h.Z,{title:p.original.request_id,children:(0,t.jsx)("span",{className:"font-mono text-sm",children:T})}):(0,t.jsx)("span",{className:"font-mono text-sm",children:p.original.request_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Model:"}),(0,t.jsx)("span",{children:p.original.model})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Model ID:"}),(0,t.jsx)("span",{children:p.original.model_id})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Call Type:"}),(0,t.jsx)("span",{children:p.original.call_type})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Provider:"}),(0,t.jsx)("span",{children:p.original.custom_llm_provider||"-"})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"API Base:"}),(0,t.jsx)(h.Z,{title:p.original.api_base||"-",children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:p.original.api_base||"-"})})]}),(null==p?void 0:null===(l=p.original)||void 0===l?void 0:l.requester_ip_address)&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"IP Address:"}),(0,t.jsx)("span",{children:null==p?void 0:null===(r=p.original)||void 0===r?void 0:r.requester_ip_address})]}),E&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Guardrail:"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-mono",children:D}),M>0&&(0,t.jsxs)("span",{className:"ml-2 px-2 py-0.5 bg-blue-50 text-blue-700 rounded-md text-xs font-medium",children:[M," masked"]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Tokens:"}),(0,t.jsxs)("span",{children:[p.original.total_tokens," (",p.original.prompt_tokens," prompt tokens +"," ",p.original.completion_tokens," completion tokens)"]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Read Tokens:"}),(0,t.jsx)("span",{children:(0,m.pw)((null===(i=p.original.metadata)||void 0===i?void 0:null===(n=i.additional_usage_values)||void 0===n?void 0:n.cache_read_input_tokens)||0)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Creation Tokens:"}),(0,t.jsx)("span",{children:(0,m.pw)(null===(d=p.original.metadata)||void 0===d?void 0:d.additional_usage_values.cache_creation_input_tokens)})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cost:"}),(0,t.jsxs)("span",{children:["$",(0,m.pw)(p.original.spend||0,6)]})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Cache Hit:"}),(0,t.jsx)("span",{children:p.original.cache_hit})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Status:"}),(0,t.jsx)("span",{className:"px-2 py-1 rounded-md text-xs font-medium inline-block text-center w-16 ".concat("failure"!==((null===(o=p.original.metadata)||void 0===o?void 0:o.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(c=p.original.metadata)||void 0===c?void 0:c.status)||"Success").toLowerCase()?"Success":"Failure"})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Start Time:"}),(0,t.jsx)("span",{children:p.original.startTime})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"End Time:"}),(0,t.jsx)("span",{children:p.original.endTime})]}),(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"Duration:"}),(0,t.jsxs)("span",{children:[p.original.duration," s."]})]}),(null===(x=p.original.metadata)||void 0===x?void 0:x.litellm_overhead_time_ms)!==void 0&&(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)("span",{className:"font-medium w-1/3",children:"LiteLLM Overhead:"}),(0,t.jsxs)("span",{children:[p.original.metadata.litellm_overhead_time_ms," ms"]})]})]})]})]}),(0,t.jsx)(ed,{costBreakdown:null===(u=p.original.metadata)||void 0===u?void 0:u.cost_breakdown,totalSpend:p.original.spend||0}),(0,t.jsx)(L,{show:!y&&!N}),(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden",children:(0,t.jsx)(k,{row:p,hasMessages:y,hasResponse:N,hasError:v,errorInfo:b,getRawRequest:()=>{var e;return(null===(e=p.original)||void 0===e?void 0:e.proxy_server_request)?j(p.original.proxy_server_request):j(p.original.messages)},formattedResponse:()=>v&&b?{error:{message:b.error_message||"An error occurred",type:b.error_class||"error",code:b.error_code||"unknown",param:null}}:j(p.original.response)})}),E&&(0,t.jsx)(ea,{data:_}),w&&(0,t.jsx)(F,{data:f.vector_store_request_metadata}),v&&b&&(0,t.jsx)(S,{errorInfo:b}),p.original.request_tags&&Object.keys(p.original.request_tags).length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"flex justify-between items-center p-4 border-b",children:(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Request Tags"})}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(p.original.request_tags).map(e=>{let[s,a]=e;return(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded-full text-xs",children:[s,": ",String(a)]},s)})})})]}),p.original.metadata&&Object.keys(p.original.metadata).length>0&&(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center p-4 border-b",children:[(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Metadata"}),(0,t.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(p.original.metadata,null,2))},className:"p-1 hover:bg-gray-200 rounded",title:"Copy metadata",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]}),(0,t.jsx)("div",{className:"p-4 overflow-auto max-h-64",children:(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:JSON.stringify(p.original.metadata,null,2)})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3492-e51306a03d83393c.js b/litellm/proxy/_experimental/out/_next/static/chunks/3492-e51306a03d83393c.js deleted file mode 100644 index 3945f65e2b7..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3492-e51306a03d83393c.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3492],{88009:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},11429:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M766.4 744.3c43.7 0 79.4-36.2 79.4-80.5 0-53.5-79.4-140.8-79.4-140.8S687 610.3 687 663.8c0 44.3 35.7 80.5 79.4 80.5zm-377.1-44.1c7.1 7.1 18.6 7.1 25.6 0l256.1-256c7.1-7.1 7.1-18.6 0-25.6l-256-256c-.6-.6-1.3-1.2-2-1.7l-78.2-78.2a9.11 9.11 0 00-12.8 0l-48 48a9.11 9.11 0 000 12.8l67.2 67.2-207.8 207.9c-7.1 7.1-7.1 18.6 0 25.6l255.9 256zm12.9-448.6l178.9 178.9H223.4l178.8-178.9zM904 816H120c-4.4 0-8 3.6-8 8v80c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-80c0-4.4-3.6-8-8-8z"}}]},name:"bg-colors",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},99458:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-792 72h752v120H136V232zm752 560H136V440h752v352zm-237-64h165c4.4 0 8-3.6 8-8v-72c0-4.4-3.6-8-8-8H651c-4.4 0-8 3.6-8 8v72c0 4.4 3.6 8 8 8z"}}]},name:"credit-card",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},60216:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0010.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 00-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}}]},name:"file-excel",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},45246:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M719.4 499.1l-296.1-215A15.9 15.9 0 00398 297v430c0 13.1 14.8 20.5 25.3 12.9l296.1-215a15.9 15.9 0 000-25.8zm-257.6 134V390.9L628.5 512 461.8 633.1z"}}]},name:"play-circle",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},89245:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},8881:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},l=r(55015),c=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},59341:function(e,t,r){"use strict";r.d(t,{Z:function(){return L}});var n=r(5853),o=r(71049),a=r(11323),l=r(2265),c=r(66797),i=r(40099),s=r(74275),u=r(59456),d=r(93980),h=r(65573),m=r(67561),p=r(87550),f=r(628),g=r(80281),b=r(31370),k=r(20131),v=r(38929),y=r(52307),w=r(52724),x=r(7935);let E=(0,l.createContext)(null);E.displayName="GroupContext";let Z=l.Fragment,M=Object.assign((0,v.yV)(function(e,t){var r;let n=(0,l.useId)(),Z=(0,g.Q)(),M=(0,p.B)(),{id:C=Z||"headlessui-switch-".concat(n),disabled:O=M||!1,checked:z,defaultChecked:N,onChange:j,name:S,value:L,form:R,autoFocus:V=!1,...H}=e,q=(0,l.useContext)(E),[F,B]=(0,l.useState)(null),_=(0,l.useRef)(null),I=(0,m.T)(_,t,null===q?null:q.setSwitch,B),P=(0,s.L)(N),[T,A]=(0,i.q)(z,j,null!=P&&P),D=(0,u.G)(),[W,K]=(0,l.useState)(!1),G=(0,d.z)(()=>{K(!0),null==A||A(!T),D.nextFrame(()=>{K(!1)})}),J=(0,d.z)(e=>{if((0,b.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),G()}),U=(0,d.z)(e=>{e.key===w.R.Space?(e.preventDefault(),G()):e.key===w.R.Enter&&(0,k.g)(e.currentTarget)}),Y=(0,d.z)(e=>e.preventDefault()),X=(0,x.wp)(),$=(0,y.zH)(),{isFocusVisible:Q,focusProps:ee}=(0,o.F)({autoFocus:V}),{isHovered:et,hoverProps:er}=(0,a.X)({isDisabled:O}),{pressed:en,pressProps:eo}=(0,c.x)({disabled:O}),ea=(0,l.useMemo)(()=>({checked:T,disabled:O,hover:et,focus:Q,active:en,autofocus:V,changing:W}),[T,et,Q,en,O,W,V]),el=(0,v.dG)({id:C,ref:I,role:"switch",type:(0,h.f)(e,F),tabIndex:-1===e.tabIndex?0:null!=(r=e.tabIndex)?r:0,"aria-checked":T,"aria-labelledby":X,"aria-describedby":$,disabled:O||void 0,autoFocus:V,onClick:J,onKeyUp:U,onKeyPress:Y},ee,er,eo),ec=(0,l.useCallback)(()=>{if(void 0!==P)return null==A?void 0:A(P)},[A,P]),ei=(0,v.L6)();return l.createElement(l.Fragment,null,null!=S&&l.createElement(f.Mt,{disabled:O,data:{[S]:L||"on"},overrides:{type:"checkbox",checked:T},form:R,onReset:ec}),ei({ourProps:el,theirProps:H,slot:ea,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[r,n]=(0,l.useState)(null),[o,a]=(0,x.bE)(),[c,i]=(0,y.fw)(),s=(0,l.useMemo)(()=>({switch:r,setSwitch:n}),[r,n]),u=(0,v.L6)();return l.createElement(i,{name:"Switch.Description",value:c},l.createElement(a,{name:"Switch.Label",value:o,props:{htmlFor:null==(t=s.switch)?void 0:t.id,onClick(e){r&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},l.createElement(E.Provider,{value:s},u({ourProps:{},theirProps:e,slot:{},defaultTag:Z,name:"Switch.Group"}))))},Label:x.__,Description:y.dk});var C=r(44140),O=r(26898),z=r(13241),N=r(1153),j=r(47187);let S=(0,N.fn)("Switch"),L=l.forwardRef((e,t)=>{let{checked:r,defaultChecked:o=!1,onChange:a,color:c,name:i,error:s,errorMessage:u,disabled:d,required:h,tooltip:m,id:p}=e,f=(0,n._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:c?(0,N.bM)(c,O.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:c?(0,N.bM)(c,O.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[b,k]=(0,C.Z)(o,r),[v,y]=(0,l.useState)(!1),{tooltipProps:w,getReferenceProps:x}=(0,j.l)(300);return l.createElement("div",{className:"flex flex-row items-center justify-start"},l.createElement(j.Z,Object.assign({text:m},w)),l.createElement("div",Object.assign({ref:(0,N.lq)([t,w.refs.setReference]),className:(0,z.q)(S("root"),"flex flex-row relative h-5")},f,x),l.createElement("input",{type:"checkbox",className:(0,z.q)(S("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:i,required:h,checked:b,onChange:e=>{e.preventDefault()}}),l.createElement(M,{checked:b,onChange:e=>{k(e),null==a||a(e)},disabled:d,className:(0,z.q)(S("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",d?"cursor-not-allowed":""),onFocus:()=>y(!0),onBlur:()=>y(!1),id:p},l.createElement("span",{className:(0,z.q)(S("sr-only"),"sr-only")},"Switch ",b?"on":"off"),l.createElement("span",{"aria-hidden":"true",className:(0,z.q)(S("background"),b?g.bgColor:"bg-tremor-border dark:bg-dark-tremor-border","pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out")}),l.createElement("span",{"aria-hidden":"true",className:(0,z.q)(S("round"),b?(0,z.q)(g.bgColor,"translate-x-5 border-tremor-background dark:border-dark-tremor-background"):"translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-tremor-background dark:border-dark-tremor-background","pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",v?(0,z.q)("ring-2",g.ringColor):"")}))),s&&u?l.createElement("p",{className:(0,z.q)(S("errorMessage"),"text-sm text-red-500 mt-1 ")},u):null)});L.displayName="Switch"},96889:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853),o=r(2265),a=r(26898),l=r(13241),c=r(1153);let i=(0,c.fn)("BarList");function s(e,t){let{data:r=[],color:s,valueFormatter:u=c.Cj,showAnimation:d=!1,onValueChange:h,sortOrder:m="descending",className:p}=e,f=(0,n._T)(e,["data","color","valueFormatter","showAnimation","onValueChange","sortOrder","className"]),g=h?"button":"div",b=o.useMemo(()=>"none"===m?r:[...r].sort((e,t)=>"ascending"===m?e.value-t.value:t.value-e.value),[r,m]),k=o.useMemo(()=>{let e=Math.max(...b.map(e=>e.value),0);return b.map(t=>0===t.value?0:Math.max(t.value/e*100,2))},[b]);return o.createElement("div",Object.assign({ref:t,className:(0,l.q)(i("root"),"flex justify-between space-x-6",p),"aria-sort":m},f),o.createElement("div",{className:(0,l.q)(i("bars"),"relative w-full space-y-1.5")},b.map((e,t)=>{var r,n,u;let m=e.icon;return o.createElement(g,{key:null!==(r=e.key)&&void 0!==r?r:t,onClick:()=>{null==h||h(e)},className:(0,l.q)(i("bar"),"group w-full flex items-center rounded-tremor-small",h?["cursor-pointer","hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-subtle/40"]:"")},o.createElement("div",{className:(0,l.q)("flex items-center rounded transition-all bg-opacity-40","h-8",e.color||s?[(0,c.bM)(null!==(n=e.color)&&void 0!==n?n:s,a.K.background).bgColor,h?"group-hover:bg-opacity-30":""]:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle/60",!h||e.color||s?"":"group-hover:bg-tremor-brand-subtle/30 group-hover:dark:bg-dark-tremor-brand-subtle/70",t===b.length-1?"mb-0":"",d?"duration-500":""),style:{width:"".concat(k[t],"%"),transition:d?"all 1s":""}},o.createElement("div",{className:(0,l.q)("absolute left-2 pr-4 flex max-w-full")},m?o.createElement(m,{className:(0,l.q)(i("barIcon"),"flex-none h-5 w-5 mr-2","text-tremor-content","dark:text-dark-tremor-content")}):null,e.href?o.createElement("a",{href:e.href,target:null!==(u=e.target)&&void 0!==u?u:"_blank",rel:"noreferrer",className:(0,l.q)(i("barLink"),"whitespace-nowrap hover:underline truncate text-tremor-default",h?"cursor-pointer":"","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis"),onClick:e=>e.stopPropagation()},e.name):o.createElement("p",{className:(0,l.q)(i("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name))))})),o.createElement("div",{className:i("labels")},b.map((e,t)=>{var r;return o.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:t,className:(0,l.q)(i("labelWrapper"),"flex justify-end items-center","h-8",t===b.length-1?"mb-0":"mb-1.5")},o.createElement("p",{className:(0,l.q)(i("labelText"),"whitespace-nowrap leading-none truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))})))}s.displayName="BarList";let u=o.forwardRef(s)},69410:function(e,t,r){"use strict";var n=r(54998);t.Z=n.Z},13817:function(e,t,r){"use strict";r.d(t,{default:function(){return w}});var n=r(83145),o=r(2265),a=r(36760),l=r.n(a),c=r(18694),i=r(71744),s=r(80856),u=r(45287),d=r(32186),h=r(25437),m=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};function p(e){let{suffixCls:t,tagName:r,displayName:n}=e;return e=>o.forwardRef((n,a)=>o.createElement(e,Object.assign({ref:a,suffixCls:t,tagName:r},n)))}let f=o.forwardRef((e,t)=>{let{prefixCls:r,suffixCls:n,className:a,tagName:c}=e,s=m(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:u}=o.useContext(i.E_),d=u("layout",r),[p,f,g]=(0,h.ZP)(d),b=n?"".concat(d,"-").concat(n):d;return p(o.createElement(c,Object.assign({className:l()(r||b,a,f,g),ref:t},s)))}),g=o.forwardRef((e,t)=>{let{direction:r}=o.useContext(i.E_),[a,p]=o.useState([]),{prefixCls:f,className:g,rootClassName:b,children:k,hasSider:v,tagName:y,style:w}=e,x=m(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),E=(0,c.Z)(x,["suffixCls"]),{getPrefixCls:Z,className:M,style:C}=(0,i.dj)("layout"),O=Z("layout",f),z="boolean"==typeof v?v:!!a.length||(0,u.Z)(k).some(e=>e.type===d.Z),[N,j,S]=(0,h.ZP)(O),L=l()(O,{["".concat(O,"-has-sider")]:z,["".concat(O,"-rtl")]:"rtl"===r},M,g,b,j,S),R=o.useMemo(()=>({siderHook:{addSider:e=>{p(t=>[].concat((0,n.Z)(t),[e]))},removeSider:e=>{p(t=>t.filter(t=>t!==e))}}}),[]);return N(o.createElement(s.V.Provider,{value:R},o.createElement(y,Object.assign({ref:t,className:L,style:Object.assign(Object.assign({},C),w)},E),k)))}),b=p({tagName:"div",displayName:"Layout"})(g),k=p({suffixCls:"header",tagName:"header",displayName:"Header"})(f),v=p({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(f),y=p({suffixCls:"content",tagName:"main",displayName:"Content"})(f);b.Header=k,b.Footer=v,b.Content=y,b.Sider=d.Z,b._InternalSiderContext=d.D;var w=b},867:function(e,t,r){"use strict";r.d(t,{Z:function(){return M}});var n=r(2265),o=r(54537),a=r(36760),l=r.n(a),c=r(50506),i=r(18694),s=r(71744),u=r(79326),d=r(59367),h=r(92570),m=r(5545),p=r(51248),f=r(55274),g=r(37381),b=r(20435),k=r(99320);let v=e=>{let{componentCls:t,iconCls:r,antCls:n,zIndexPopup:o,colorText:a,colorWarning:l,marginXXS:c,marginXS:i,fontSize:s,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:o,["&".concat(n,"-popover")]:{fontSize:s},["".concat(t,"-message")]:{marginBottom:i,display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(t,"-message-icon ").concat(r)]:{color:l,fontSize:s,lineHeight:1,marginInlineEnd:i},["".concat(t,"-title")]:{fontWeight:u,color:d,"&:only-child":{fontWeight:"normal"}},["".concat(t,"-description")]:{marginTop:c,color:a}},["".concat(t,"-buttons")]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:i}}}}};var y=(0,k.I$)("Popconfirm",e=>v(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),w=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let x=e=>{let{prefixCls:t,okButtonProps:r,cancelButtonProps:a,title:l,description:c,cancelText:i,okText:u,okType:b="primary",icon:k=n.createElement(o.Z,null),showCancel:v=!0,close:y,onConfirm:w,onCancel:x,onPopupClick:E}=e,{getPrefixCls:Z}=n.useContext(s.E_),[M]=(0,f.Z)("Popconfirm",g.Z.Popconfirm),C=(0,h.Z)(l),O=(0,h.Z)(c);return n.createElement("div",{className:"".concat(t,"-inner-content"),onClick:E},n.createElement("div",{className:"".concat(t,"-message")},k&&n.createElement("span",{className:"".concat(t,"-message-icon")},k),n.createElement("div",{className:"".concat(t,"-message-text")},C&&n.createElement("div",{className:"".concat(t,"-title")},C),O&&n.createElement("div",{className:"".concat(t,"-description")},O))),n.createElement("div",{className:"".concat(t,"-buttons")},v&&n.createElement(m.ZP,Object.assign({onClick:x,size:"small"},a),i||(null==M?void 0:M.cancelText)),n.createElement(d.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,p.nx)(b)),r),actionFn:w,close:y,prefixCls:Z("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},u||(null==M?void 0:M.okText))))};var E=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let Z=n.forwardRef((e,t)=>{var r,a;let{prefixCls:d,placement:h="top",trigger:m="click",okType:p="primary",icon:f=n.createElement(o.Z,null),children:g,overlayClassName:b,onOpenChange:k,onVisibleChange:v,overlayStyle:w,styles:Z,classNames:M}=e,C=E(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:O,className:z,style:N,classNames:j,styles:S}=(0,s.dj)("popconfirm"),[L,R]=(0,c.Z)(!1,{value:null!==(r=e.open)&&void 0!==r?r:e.visible,defaultValue:null!==(a=e.defaultOpen)&&void 0!==a?a:e.defaultVisible}),V=(e,t)=>{R(e,!0),null==v||v(e),null==k||k(e,t)},H=O("popconfirm",d),q=l()(H,z,b,j.root,null==M?void 0:M.root),F=l()(j.body,null==M?void 0:M.body),[B]=y(H);return B(n.createElement(u.Z,Object.assign({},(0,i.Z)(C,["title"]),{trigger:m,placement:h,onOpenChange:(t,r)=>{let{disabled:n=!1}=e;n||V(t,r)},open:L,ref:t,classNames:{root:q,body:F},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},S.root),N),w),null==Z?void 0:Z.root),body:Object.assign(Object.assign({},S.body),null==Z?void 0:Z.body)},content:n.createElement(x,Object.assign({okType:p,icon:f},e,{prefixCls:H,close:e=>{V(!1,e)},onConfirm:t=>{var r;return null===(r=e.onConfirm)||void 0===r?void 0:r.call(void 0,t)},onCancel:t=>{var r;V(!1,t),null===(r=e.onCancel)||void 0===r||r.call(void 0,t)}})),"data-popover-inject":!0}),g))});Z._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:r,className:o,style:a}=e,c=w(e,["prefixCls","placement","className","style"]),{getPrefixCls:i}=n.useContext(s.E_),u=i("popconfirm",t),[d]=y(u);return d(n.createElement(b.ZP,{placement:r,className:l()(u,o),style:a,content:n.createElement(x,Object.assign({prefixCls:u},c))}))};var M=Z},47451:function(e,t,r){"use strict";var n=r(77774);t.Z=n.Z},45235:function(e,t,r){"use strict";r.d(t,{Z:function(){return Z}});var n=r(2265),o=r(74126),a=r(53346),l=r(19722),c=r(36760),i=r.n(c),s=r(18242),u=r(71744),d=r(50337),h=e=>{let t;let{value:r,formatter:o,precision:a,decimalSeparator:l,groupSeparator:c="",prefixCls:i}=e;if("function"==typeof o)t=o(r);else{let e=String(r),o=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(o&&"-"!==e){let e=o[1],r=o[2]||"0",s=o[4]||"";r=r.replace(/\B(?=(\d{3})+(?!\d))/g,c),"number"==typeof a&&(s=s.padEnd(a,"0").slice(0,a>0?a:0)),s&&(s="".concat(l).concat(s)),t=[n.createElement("span",{key:"int",className:"".concat(i,"-content-value-int")},e,r),s&&n.createElement("span",{key:"decimal",className:"".concat(i,"-content-value-decimal")},s)]}else t=e}return n.createElement("span",{className:"".concat(i,"-content-value")},t)},m=r(12918),p=r(99320),f=r(71140);let g=e=>{let{componentCls:t,marginXXS:r,padding:n,colorTextDescription:o,titleFontSize:a,colorTextHeading:l,contentFontSize:c,fontFamily:i}=e;return{[t]:Object.assign(Object.assign({},(0,m.Wf)(e)),{["".concat(t,"-title")]:{marginBottom:r,color:o,fontSize:a},["".concat(t,"-skeleton")]:{paddingTop:n},["".concat(t,"-content")]:{color:l,fontSize:c,fontFamily:i,["".concat(t,"-content-value")]:{display:"inline-block",direction:"ltr"},["".concat(t,"-content-prefix, ").concat(t,"-content-suffix")]:{display:"inline-block"},["".concat(t,"-content-prefix")]:{marginInlineEnd:r},["".concat(t,"-content-suffix")]:{marginInlineStart:r}}})}};var b=(0,p.I$)("Statistic",e=>g((0,f.IX)(e,{})),e=>{let{fontSizeHeading3:t,fontSize:r}=e;return{titleFontSize:r,contentFontSize:t}}),k=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let v=n.forwardRef((e,t)=>{let{prefixCls:r,className:o,rootClassName:a,style:l,valueStyle:c,value:m=0,title:p,valueRender:f,prefix:g,suffix:v,loading:y=!1,formatter:w,precision:x,decimalSeparator:E=".",groupSeparator:Z=",",onMouseEnter:M,onMouseLeave:C}=e,O=k(e,["prefixCls","className","rootClassName","style","valueStyle","value","title","valueRender","prefix","suffix","loading","formatter","precision","decimalSeparator","groupSeparator","onMouseEnter","onMouseLeave"]),{getPrefixCls:z,direction:N,className:j,style:S}=(0,u.dj)("statistic"),L=z("statistic",r),[R,V,H]=b(L),q=n.createElement(h,{decimalSeparator:E,groupSeparator:Z,prefixCls:L,formatter:w,precision:x,value:m}),F=i()(L,{["".concat(L,"-rtl")]:"rtl"===N},j,o,a,V,H),B=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:B.current}));let _=(0,s.Z)(O,{aria:!0,data:!0});return R(n.createElement("div",Object.assign({},_,{ref:B,className:F,style:Object.assign(Object.assign({},S),l),onMouseEnter:M,onMouseLeave:C}),p&&n.createElement("div",{className:"".concat(L,"-title")},p),n.createElement(d.Z,{paragraph:!1,loading:y,className:"".concat(L,"-skeleton"),active:!0},n.createElement("div",{style:c,className:"".concat(L,"-content")},g&&n.createElement("span",{className:"".concat(L,"-content-prefix")},g),f?f(q):q,v&&n.createElement("span",{className:"".concat(L,"-content-suffix")},v)))))}),y=[["Y",31536e6],["M",2592e6],["D",864e5],["H",36e5],["m",6e4],["s",1e3],["S",1]];var w=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},x=e=>{let{value:t,format:r="HH:mm:ss",onChange:c,onFinish:i,type:s}=e,u=w(e,["value","format","onChange","onFinish","type"]),d="countdown"===s,[h,m]=n.useState(null),p=(0,o.zX)(()=>{let e=Date.now(),r=new Date(t).getTime();return m({}),null==c||c(d?r-e:e-r),!d||!(r{let e;let t=()=>{e=(0,a.Z)(()=>{p()&&t()})};return t(),()=>a.Z.cancel(e)},[t,d]),n.useEffect(()=>{m({})},[]),n.createElement(v,Object.assign({},u,{value:t,valueRender:e=>(0,l.Tm)(e,{title:void 0}),formatter:(e,t)=>h?function(e,t,r){let{format:n=""}=t,o=new Date(e).getTime(),a=Date.now();return function(e,t){let r=e,n=/\[[^\]]*]/g,o=(t.match(n)||[]).map(e=>e.slice(1,-1)),a=t.replace(n,"[]"),l=y.reduce((e,t)=>{let[n,o]=t;if(e.includes(n)){let t=Math.floor(r/o);return r-=t*o,e.replace(RegExp("".concat(n,"+"),"g"),e=>{let r=e.length;return t.toString().padStart(r,"0")})}return e},a),c=0;return l.replace(n,()=>{let e=o[c];return c+=1,e})}(r?Math.max(o-a,0):Math.max(a-o,0),n)}(e,Object.assign(Object.assign({},t),{format:r}),d):"-"}))},E=n.memo(e=>n.createElement(x,Object.assign({},e,{type:"countdown"})));v.Timer=x,v.Countdown=E;var Z=v},76858:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},82222:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("bot",[["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"}]])},40875:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},41671:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},5136:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]])},64935:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},96362:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},87769:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},42208:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},3577:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},29202:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},33245:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},54001:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},51817:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},11:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},21047:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},33276:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},69076:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},73247:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},96137:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},88906:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},15868:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},80221:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]])},18930:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},70525:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},76865:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},17689:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},49663:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},79862:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]])},92369:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},95805:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},11239:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},86669:function(e,t,r){"use strict";r.d(t,{gc:function(){return y},jF:function(){return k}});var n=r(2265);let o=e=>"boolean"==typeof e||e instanceof Boolean,a=e=>"number"==typeof e||e instanceof Number,l=e=>"bigint"==typeof e||e instanceof BigInt,c=e=>!!e&&e instanceof Date,i=e=>"string"==typeof e||e instanceof String,s=e=>Array.isArray(e),u=e=>"object"==typeof e&&null!==e,d=e=>!!e&&e instanceof Object&&"function"==typeof e;function h(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function m(e){let{field:t,value:r,data:o,lastElement:a,openBracket:l,closeBracket:c,level:i,style:s,shouldExpandNode:u,clickToExpandNode:d,outerRef:m,beforeExpandChange:p}=e,f=(0,n.useRef)(!1),[g,k]=(0,n.useState)(()=>u(i,r,t)),v=(0,n.useRef)(null);(0,n.useEffect)(()=>{f.current?k(u(i,r,t)):f.current=!0},[u]);let y=(0,n.useId)();if(0===o.length)return function(e){let{field:t,openBracket:r,closeBracket:o,lastElement:a,style:l}=e;return(0,n.createElement)("div",{className:l.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,n.createElement)("span",{className:l.label},h(t,l.quotesForFieldNames),":"),(0,n.createElement)("span",{className:l.punctuation},r),(0,n.createElement)("span",{className:l.punctuation},o),!a&&(0,n.createElement)("span",{className:l.punctuation},","))}({field:t,openBracket:l,closeBracket:c,lastElement:a,style:s});let w=g?s.collapseIcon:s.expandIcon,x=g?s.ariaLables.collapseJson:s.ariaLables.expandJson,E=i+1,Z=o.length-1,M=e=>{g!==e&&(!p||p({level:i,value:r,field:t,newExpandValue:e}))&&k(e)},C=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),M("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();let t="ArrowUp"===e.key?-1:1;if(!m.current)return;let r=m.current.querySelectorAll("[role=button]"),n=-1;for(let e=0;e{var e;M(!g);let t=v.current;if(!t)return;let r=null===(e=m.current)||void 0===e?void 0:e.querySelector('[role=button][tabindex="0"]');r&&(r.tabIndex=-1),t.tabIndex=0,t.focus()};return(0,n.createElement)("div",{className:s.basicChildStyle,role:"treeitem","aria-expanded":g,"aria-selected":void 0},(0,n.createElement)("span",{className:w,onClick:O,onKeyDown:C,role:"button","aria-label":x,"aria-expanded":g,"aria-controls":g?y:void 0,ref:v,tabIndex:0===i?0:-1}),(t||""===t)&&(d?(0,n.createElement)("span",{className:s.clickableLabel,onClick:O,onKeyDown:C},h(t,s.quotesForFieldNames),":"):(0,n.createElement)("span",{className:s.label},h(t,s.quotesForFieldNames),":")),(0,n.createElement)("span",{className:s.punctuation},l),g?(0,n.createElement)("ul",{id:y,role:"group",className:s.childFieldsContainer},o.map((e,t)=>(0,n.createElement)(b,{key:e[0]||t,field:e[0],value:e[1],style:s,lastElement:t===Z,level:E,shouldExpandNode:u,clickToExpandNode:d,beforeExpandChange:p,outerRef:m}))):(0,n.createElement)("span",{className:s.collapsedContent,onClick:O,onKeyDown:C}),(0,n.createElement)("span",{className:s.punctuation},c),!a&&(0,n.createElement)("span",{className:s.punctuation},","))}function p(e){let{field:t,value:r,style:n,lastElement:o,shouldExpandNode:a,clickToExpandNode:l,level:c,outerRef:i,beforeExpandChange:s}=e;return m({field:t,value:r,lastElement:o||!1,level:c,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:a,clickToExpandNode:l,data:Object.keys(r).map(e=>[e,r[e]]),outerRef:i,beforeExpandChange:s})}function f(e){let{field:t,value:r,style:n,lastElement:o,level:a,shouldExpandNode:l,clickToExpandNode:c,outerRef:i,beforeExpandChange:s}=e;return m({field:t,value:r,lastElement:o||!1,level:a,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:l,clickToExpandNode:c,data:r.map(e=>[void 0,e]),outerRef:i,beforeExpandChange:s})}function g(e){let t,{field:r,value:s,style:u,lastElement:m}=e,p=u.otherValue;if(null===s)t="null",p=u.nullValue;else if(void 0===s)t="undefined",p=u.undefinedValue;else if(i(s)){var f;f=!u.noQuotesForStringValues,t=u.stringifyStringValues?JSON.stringify(s):f?`"${s}"`:s,p=u.stringValue}else o(s)?(t=s?"true":"false",p=u.booleanValue):a(s)?(t=s.toString(),p=u.numberValue):l(s)?(t=`${s.toString()}n`,p=u.numberValue):t=c(s)?s.toISOString():d(s)?"function() { }":s.toString();return(0,n.createElement)("div",{className:u.basicChildStyle,role:"treeitem","aria-selected":void 0},(r||""===r)&&(0,n.createElement)("span",{className:u.label},h(r,u.quotesForFieldNames),":"),(0,n.createElement)("span",{className:p},t),!m&&(0,n.createElement)("span",{className:u.punctuation},","))}function b(e){let t=e.value;return s(t)?(0,n.createElement)(f,Object.assign({},e)):!u(t)||c(t)||d(t)?(0,n.createElement)(g,Object.assign({},e)):(0,n.createElement)(p,Object.assign({},e))}let k={container:"_2IvMF _GzYRV",basicChildStyle:"_2bkNM",childFieldsContainer:"_1BXBN",label:"_1MGIk",clickableLabel:"_2YKJg _1MGIk _1MFti",nullValue:"_2T6PJ",undefinedValue:"_1Gho6",stringValue:"_vGjyY",booleanValue:"_3zQKs",numberValue:"_1bQdo",otherValue:"_1xvuR",punctuation:"_3uHL6 _3eOF8",collapseIcon:"_oLqym _f10Tu _1MFti _1LId0",expandIcon:"_2AXVT _f10Tu _1MFti _1UmXx",collapsedContent:"_2KJWg _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1,ariaLables:{collapseJson:"collapse JSON",expandJson:"expand JSON"},stringifyStringValues:!1},v=()=>!0,y=e=>{let{data:t,style:r=k,shouldExpandNode:o=v,clickToExpandNode:a=!1,beforeExpandChange:l,compactTopLevel:c,...i}=e,s=(0,n.useRef)(null);return(0,n.createElement)("div",Object.assign({"aria-label":"JSON view"},i,{className:r.container,ref:s,role:"tree"}),c&&u(t)?Object.entries(t).map(e=>{let[t,c]=e;return(0,n.createElement)(b,{key:t,field:t,value:c,style:{...k,...r},lastElement:!0,level:1,shouldExpandNode:o,clickToExpandNode:a,beforeExpandChange:l,outerRef:s})}):(0,n.createElement)(b,{value:t,style:{...k,...r},lastElement:!0,level:0,shouldExpandNode:o,clickToExpandNode:a,outerRef:s,beforeExpandChange:l}))}},1479:function(e,t){"use strict";t.Z={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}}},52621:function(){},82422:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}))});t.Z=o},51853:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"}))});t.Z=o},3477:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});t.Z=o},71437:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))});t.Z=o},82376:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))});t.Z=o},2356:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"}))});t.Z=o},45589:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"}))});t.Z=o},91126:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},17732:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"}))});t.Z=o},3837:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))});t.Z=o},21770:function(e,t,r){"use strict";r.d(t,{D:function(){return u}});var n=r(2265),o=r(2894),a=r(18238),l=r(24112),c=r(45345),i=class extends l.l{#e;#t=void 0;#r;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,c.VS)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,c.Ym)(t.mutationKey)!==(0,c.Ym)(this.options.mutationKey)?this.reset():this.#r?.state.status==="pending"&&this.#r.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#r?.removeObserver(this)}onMutationUpdate(e){this.#o(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#r?.removeObserver(this),this.#r=void 0,this.#o(),this.#a()}mutate(e,t){return this.#n=t,this.#r?.removeObserver(this),this.#r=this.#e.getMutationCache().build(this.#e,this.options),this.#r.addObserver(this),this.#r.execute(e)}#o(){let e=this.#r?.state??(0,o.R)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){a.Vr.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,r=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#n.onSuccess?.(e.data,t,r,n),this.#n.onSettled?.(e.data,null,t,r,n)):e?.type==="error"&&(this.#n.onError?.(e.error,t,r,n),this.#n.onSettled?.(void 0,e.error,t,r,n))}this.listeners.forEach(e=>{e(this.#t)})})}},s=r(29827);function u(e,t){let r=(0,s.NL)(t),[o]=n.useState(()=>new i(r,e));n.useEffect(()=>{o.setOptions(e)},[o,e]);let l=n.useSyncExternalStore(n.useCallback(e=>o.subscribe(a.Vr.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),u=n.useCallback((e,t)=>{o.mutate(e,t).catch(c.ZT)},[o]);if(l.error&&(0,c.L3)(o.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3507-14fb4e6cd377d7da.js b/litellm/proxy/_experimental/out/_next/static/chunks/3507-14fb4e6cd377d7da.js deleted file mode 100644 index 06df3144c2e..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3507-14fb4e6cd377d7da.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3507],{89245:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},69993:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},78355:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"},l=r(55015),i=o.forwardRef(function(e,t){return o.createElement(l.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},58747:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(5853),o=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"}))}},4537:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(5853),o=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z"}))}},41649:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var n=r(5853),o=r(2265),a=r(47187),l=r(7084),i=r(26898),s=r(13241),c=r(1153);let d={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},u={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},m=(0,c.fn)("Badge"),f=o.forwardRef((e,t)=>{let{color:r,icon:f,size:p=l.u8.SM,tooltip:h,className:b,children:g}=e,v=(0,n._T)(e,["color","icon","size","tooltip","className","children"]),w=f||null,{tooltipProps:k,getReferenceProps:x}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,c.lq)([t,k.refs.setReference]),className:(0,s.q)(m("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",r?(0,s.q)((0,c.bM)(r,i.K.background).bgColor,(0,c.bM)(r,i.K.iconText).textColor,(0,c.bM)(r,i.K.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):(0,s.q)("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),d[p].paddingX,d[p].paddingY,d[p].fontSize,b)},x,v),o.createElement(a.Z,Object.assign({text:h},k)),w?o.createElement(w,{className:(0,s.q)(m("icon"),"shrink-0 -ml-1 mr-1.5",u[p].height,u[p].width)}):null,o.createElement("span",{className:(0,s.q)(m("text"),"whitespace-nowrap")},g))});f.displayName="Badge"},47323:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(5853),o=r(2265),a=r(47187),l=r(7084),i=r(13241),s=r(1153),c=r(26898);let d={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},u={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},m={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},f=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,i.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,i.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,i.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:t?(0,s.bM)(t,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,i.q)((0,s.bM)(t,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,s.bM)(t,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,i.q)((0,s.bM)(t,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},p=(0,s.fn)("Icon"),h=o.forwardRef((e,t)=>{let{icon:r,variant:c="simple",tooltip:h,size:b=l.u8.SM,color:g,className:v}=e,w=(0,n._T)(e,["icon","variant","tooltip","size","color","className"]),k=f(c,g),{tooltipProps:x,getReferenceProps:y}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,s.lq)([t,x.refs.setReference]),className:(0,i.q)(p("root"),"inline-flex shrink-0 items-center justify-center",k.bgColor,k.textColor,k.borderColor,k.ringColor,m[c].rounded,m[c].border,m[c].shadow,m[c].ring,d[b].paddingX,d[b].paddingY,v)},y,w),o.createElement(a.Z,Object.assign({text:h},x)),o.createElement(r,{className:(0,i.q)(p("icon"),"shrink-0",u[b].height,u[b].width)}))});h.displayName="Icon"},30150:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n=r(5853),o=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M12 4v16m8-8H4"}))},l=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),o.createElement("path",{d:"M20 12H4"}))};var i=r(13241),s=r(1153),c=r(69262);let d="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",u="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",m=o.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:m=!0,disabled:f,onValueChange:p,onChange:h}=e,b=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,o.useRef)(null),[v,w]=o.useState(!1),k=o.useCallback(()=>{w(!0)},[]),x=o.useCallback(()=>{w(!1)},[]),[y,E]=o.useState(!1),C=o.useCallback(()=>{E(!0)},[]),M=o.useCallback(()=>{E(!1)},[]);return o.createElement(c.Z,Object.assign({type:"number",ref:(0,s.lq)([g,t]),disabled:f,makeInputClassName:(0,s.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=g.current)||void 0===t?void 0:t.value;null==r||r(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&k(),"ArrowUp"===e.key&&C()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&M()},onChange:e=>{f||(null==p||p(parseFloat(e.target.value)),null==h||h(e))},stepper:m?o.createElement("div",{className:(0,i.q)("flex justify-center align-middle")},o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=g.current)||void 0===e||e.stepDown(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.q)(!f&&u,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(l,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),o.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;f||(null===(e=g.current)||void 0===e||e.stepUp(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,i.q)(!f&&u,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},o.createElement(a,{"data-testid":"step-up",className:(y?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},b))});m.displayName="NumberInput"},27281:function(e,t,r){"use strict";r.d(t,{Z:function(){return p}});var n=r(5853),o=r(58747),a=r(2265),l=r(4537),i=r(13241),s=r(1153),c=r(96398),d=r(51975),u=r(85238),m=r(44140);let f=(0,s.fn)("Select"),p=a.forwardRef((e,t)=>{let{defaultValue:r="",value:s,onValueChange:p,placeholder:h="Select...",disabled:b=!1,icon:g,enableClear:v=!1,required:w,children:k,name:x,error:y=!1,errorMessage:E,className:C,id:M}=e,S=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),N=(0,a.useRef)(null),j=a.Children.toArray(k),[L,Z]=(0,m.Z)(r,s),O=(0,a.useMemo)(()=>{let e=a.Children.toArray(k).filter(a.isValidElement);return(0,c.sl)(e)},[k]);return a.createElement("div",{className:(0,i.q)("w-full min-w-[10rem] text-tremor-default",C)},a.createElement("div",{className:"relative"},a.createElement("select",{title:"select-hidden",required:w,className:(0,i.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:L,onChange:e=>{e.preventDefault()},name:x,disabled:b,id:M,onFocus:()=>{let e=N.current;e&&e.focus()}},a.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},h),j.map(e=>{let t=e.props.value,r=e.props.children;return a.createElement("option",{className:"hidden",key:t,value:t},r)})),a.createElement(d.Ri,Object.assign({as:"div",ref:t,defaultValue:L,value:L,onChange:e=>{null==p||p(e),Z(e)},disabled:b,id:M},S),e=>{var t;let{value:r}=e;return a.createElement(a.Fragment,null,a.createElement(d.Y4,{ref:N,className:(0,i.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-2","border-tremor-border shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:border-dark-tremor-border dark:shadow-dark-tremor-input dark:focus:border-dark-tremor-brand-subtle dark:focus:ring-dark-tremor-brand-muted",g?"pl-10":"pl-3",(0,c.um)((0,c.Uh)(r),b,y))},g&&a.createElement("span",{className:(0,i.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},a.createElement(g,{className:(0,i.q)(f("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),a.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=O.get(r))&&void 0!==t?t:h),a.createElement("span",{className:(0,i.q)("absolute inset-y-0 right-0 flex items-center mr-3")},a.createElement(o.Z,{className:(0,i.q)(f("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&L?a.createElement("button",{type:"button",className:(0,i.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),Z(""),null==p||p("")}},a.createElement(l.Z,{className:(0,i.q)(f("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,a.createElement(u.u,{enter:"transition ease duration-100 transform",enterFrom:"opacity-0 -translate-y-4",enterTo:"opacity-100 translate-y-0",leave:"transition ease duration-100 transform",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 -translate-y-4"},a.createElement(d.O_,{anchor:"bottom start",className:(0,i.q)("z-10 w-[var(--button-width)] divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]","bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown","dark:bg-dark-tremor-background dark:border-dark-tremor-border dark:divide-dark-tremor-border dark:shadow-dark-tremor-dropdown")},k)))})),y&&E?a.createElement("p",{className:(0,i.q)("errorMessage","text-sm text-rose-500 mt-1")},E):null)});p.displayName="Select"},87452:function(e,t,r){"use strict";r.d(t,{Z:function(){return u},r:function(){return d}});var n=r(5853),o=r(91054);r(42698),r(64016);var a=r(8710);r(33232);var l=r(13241),i=r(1153),s=r(2265);let c=(0,i.fn)("Accordion"),d=(0,s.createContext)({isOpen:!1}),u=s.forwardRef((e,t)=>{var r;let{defaultOpen:i=!1,children:u,className:m}=e,f=(0,n._T)(e,["defaultOpen","children","className"]),p=null!==(r=(0,s.useContext)(a.Z))&&void 0!==r?r:(0,l.q)("rounded-tremor-default border");return s.createElement(o.pJ,Object.assign({as:"div",ref:t,className:(0,l.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",p,m),defaultOpen:i},f),e=>{let{open:t}=e;return s.createElement(d.Provider,{value:{isOpen:t}},u)})});u.displayName="Accordion"},88829:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(5853),o=r(2265),a=r(91054),l=r(13241);let i=(0,r(1153).fn)("AccordionBody"),s=o.forwardRef((e,t)=>{let{children:r,className:s}=e,c=(0,n._T)(e,["children","className"]);return o.createElement(a.pJ.Panel,Object.assign({ref:t,className:(0,l.q)(i("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",s)},c),r)});s.displayName="AccordionBody"},72208:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});var n=r(5853),o=r(2265),a=r(91054);let l=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var i=r(87452),s=r(13241);let c=(0,r(1153).fn)("AccordionHeader"),d=o.forwardRef((e,t)=>{let{children:r,className:d}=e,u=(0,n._T)(e,["children","className"]),{isOpen:m}=(0,o.useContext)(i.r);return o.createElement(a.pJ.Button,Object.assign({ref:t,className:(0,s.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",d)},u),o.createElement("div",{className:(0,s.q)(c("children"),"flex flex-1 text-inherit mr-4")},r),o.createElement("div",null,o.createElement(l,{className:(0,s.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",m?"transition-all":"transition-all -rotate-180")})))});d.displayName="AccordionHeader"},67982:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(5853),o=r(13241),a=r(1153),l=r(2265);let i=(0,a.fn)("Divider"),s=l.forwardRef((e,t)=>{let{className:r,children:a}=e,s=(0,n._T)(e,["className","children"]);return l.createElement("div",Object.assign({ref:t,className:(0,o.q)(i("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",r)},s),a?l.createElement(l.Fragment,null,l.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),l.createElement("div",{className:(0,o.q)("text-inherit whitespace-nowrap")},a),l.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):l.createElement("div",{className:(0,o.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});s.displayName="Divider"},49804:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(5853),o=r(13241),a=r(1153),l=r(2265),i=r(9496);let s=(0,a.fn)("Col"),c=l.forwardRef((e,t)=>{let{numColSpan:r=1,numColSpanSm:a,numColSpanMd:c,numColSpanLg:d,children:u,className:m}=e,f=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),p=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"";return l.createElement("div",Object.assign({ref:t,className:(0,o.q)(s("root"),(()=>{let e=p(r,i.PT),t=p(a,i.SP),n=p(c,i.VS),l=p(d,i._w);return(0,o.q)(e,t,n,l)})(),m)},f),u)});c.displayName="Col"},96761:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(5853),o=r(26898),a=r(13241),l=r(1153),i=r(2265);let s=i.forwardRef((e,t)=>{let{color:r,children:s,className:c}=e,d=(0,n._T)(e,["color","children","className"]);return i.createElement("p",Object.assign({ref:t,className:(0,a.q)("font-medium text-tremor-title",r?(0,l.bM)(r,o.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",c)},d),s)});s.displayName="Title"},44140:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(2265);let o=(e,t)=>{let r=void 0!==t,[o,a]=(0,n.useState)(e);return[r?t:o,e=>{r||a(e)}]}},23496:function(e,t,r){"use strict";r.d(t,{Z:function(){return g}});var n=r(2265),o=r(36760),a=r.n(o),l=r(71744),i=r(33759),s=r(93463),c=r(12918),d=r(99320),u=r(71140);let m=e=>{let{componentCls:t}=e;return{[t]:{"&-horizontal":{["&".concat(t)]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}},f=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:r,colorSplit:n,lineWidth:o,textPaddingInline:a,orientationMargin:l,verticalMarginInline:i}=e;return{[t]:Object.assign(Object.assign({},(0,c.Wf)(e)),{borderBlockStart:"".concat((0,s.bf)(o)," solid ").concat(n),"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:i,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:"".concat((0,s.bf)(o)," solid ").concat(n)},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:"".concat((0,s.bf)(e.marginLG)," 0")},["&-horizontal".concat(t,"-with-text")]:{display:"flex",alignItems:"center",margin:"".concat((0,s.bf)(e.dividerHorizontalWithTextGutterMargin)," 0"),color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:"0 ".concat(n),"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:"".concat((0,s.bf)(o)," solid transparent"),borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},["&-horizontal".concat(t,"-with-text-start")]:{"&::before":{width:"calc(".concat(l," * 100%)")},"&::after":{width:"calc(100% - ".concat(l," * 100%)")}},["&-horizontal".concat(t,"-with-text-end")]:{"&::before":{width:"calc(100% - ".concat(l," * 100%)")},"&::after":{width:"calc(".concat(l," * 100%)")}},["".concat(t,"-inner-text")]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:n,borderStyle:"dashed",borderWidth:"".concat((0,s.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dashed")]:{"&::before, &::after":{borderStyle:"dashed none none"}},["&-vertical".concat(t,"-dashed")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:n,borderStyle:"dotted",borderWidth:"".concat((0,s.bf)(o)," 0 0")},["&-horizontal".concat(t,"-with-text").concat(t,"-dotted")]:{"&::before, &::after":{borderStyle:"dotted none none"}},["&-vertical".concat(t,"-dotted")]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},["&-plain".concat(t,"-with-text")]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},["&-horizontal".concat(t,"-with-text-start").concat(t,"-no-default-orientation-margin-start")]:{"&::before":{width:0},"&::after":{width:"100%"},["".concat(t,"-inner-text")]:{paddingInlineStart:r}},["&-horizontal".concat(t,"-with-text-end").concat(t,"-no-default-orientation-margin-end")]:{"&::before":{width:"100%"},"&::after":{width:0},["".concat(t,"-inner-text")]:{paddingInlineEnd:r}}})}};var p=(0,d.I$)("Divider",e=>{let t=(0,u.IX)(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[f(t),m(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),h=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};let b={small:"sm",middle:"md"};var g=e=>{let{getPrefixCls:t,direction:r,className:o,style:s}=(0,l.dj)("divider"),{prefixCls:c,type:d="horizontal",orientation:u="center",orientationMargin:m,className:f,rootClassName:g,children:v,dashed:w,variant:k="solid",plain:x,style:y,size:E}=e,C=h(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","variant","plain","style","size"]),M=t("divider",c),[S,N,j]=p(M),L=b[(0,i.Z)(E)],Z=!!v,O=n.useMemo(()=>"left"===u?"rtl"===r?"end":"start":"right"===u?"rtl"===r?"start":"end":u,[r,u]),z="start"===O&&null!=m,T="end"===O&&null!=m,R=a()(M,o,N,j,"".concat(M,"-").concat(d),{["".concat(M,"-with-text")]:Z,["".concat(M,"-with-text-").concat(O)]:Z,["".concat(M,"-dashed")]:!!w,["".concat(M,"-").concat(k)]:"solid"!==k,["".concat(M,"-plain")]:!!x,["".concat(M,"-rtl")]:"rtl"===r,["".concat(M,"-no-default-orientation-margin-start")]:z,["".concat(M,"-no-default-orientation-margin-end")]:T,["".concat(M,"-").concat(L)]:!!L},f,g),I=n.useMemo(()=>"number"==typeof m?m:/^\d+$/.test(m)?Number(m):m,[m]);return S(n.createElement("div",Object.assign({className:R,style:Object.assign(Object.assign({},s),y)},C,{role:"separator"}),v&&"vertical"!==d&&n.createElement("span",{className:"".concat(M,"-inner-text"),style:{marginInlineStart:z?I:void 0,marginInlineEnd:T?I:void 0}},v)))}},23910:function(e,t,r){var n=r(74288).Symbol;e.exports=n},54506:function(e,t,r){var n=r(23910),o=r(4479),a=r(80910),l=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":l&&l in Object(e)?o(e):a(e)}},41087:function(e,t,r){var n=r(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},17071:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},4479:function(e,t,r){var n=r(23910),o=Object.prototype,a=o.hasOwnProperty,l=o.toString,i=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,i),r=e[i];try{e[i]=void 0;var n=!0}catch(e){}var o=l.call(e);return n&&(t?e[i]=r:delete e[i]),o}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,r){var n=r(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},5035:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},7310:function(e,t,r){var n=r(28302),o=r(11121),a=r(6660),l=Math.max,i=Math.min;e.exports=function(e,t,r){var s,c,d,u,m,f,p=0,h=!1,b=!1,g=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var r=s,n=c;return s=c=void 0,p=t,u=e.apply(n,r)}function w(e){var r=e-f,n=e-p;return void 0===f||r>=t||r<0||b&&n>=d}function k(){var e,r,n,a=o();if(w(a))return x(a);m=setTimeout(k,(e=a-f,r=a-p,n=t-e,b?i(n,d-r):n))}function x(e){return(m=void 0,g&&s)?v(e):(s=c=void 0,u)}function y(){var e,r=o(),n=w(r);if(s=arguments,c=this,f=r,n){if(void 0===m)return p=e=f,m=setTimeout(k,t),h?v(e):u;if(b)return clearTimeout(m),m=setTimeout(k,t),v(f)}return void 0===m&&(m=setTimeout(k,t)),u}return t=a(t)||0,n(r)&&(h=!!r.leading,d=(b="maxWait"in r)?l(a(r.maxWait)||0,t):d,g="trailing"in r?!!r.trailing:g),y.cancel=function(){void 0!==m&&clearTimeout(m),p=0,s=f=c=m=void 0},y.flush=function(){return void 0===m?u:x(o())},y}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,r){var n=r(54506),o=r(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},11121:function(e,t,r){var n=r(74288);e.exports=function(){return n.Date.now()}},6660:function(e,t,r){var n=r(41087),o=r(28302),a=r(78371),l=0/0,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return l;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||c.test(e)?d(e.slice(2),r?2:8):i.test(e)?l:+e}},79205:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(2265);let o=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),l=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},s=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var c={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let d=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:l,className:d="",children:u,iconNode:m,...f}=e;return(0,n.createElement)("svg",{ref:t,...c,width:o,height:o,stroke:r,strokeWidth:l?24*Number(a)/Number(o):a,className:i("lucide",d),...!u&&!s(f)&&{"aria-hidden":"true"},...f},[...m.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(u)?u:[u]])}),u=(e,t)=>{let r=(0,n.forwardRef)((r,a)=>{let{className:s,...c}=r;return(0,n.createElement)(d,{ref:a,iconNode:t,className:i("lucide-".concat(o(l(e))),"lucide-".concat(e),s),...c})});return r.displayName=l(e),r}},30401:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("copy",[["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"}]])},3577:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},69076:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},73247:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},88906:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},76865:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},92369:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},32489:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},91777:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});t.Z=o},86462:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});t.Z=o},47686:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});t.Z=o},44633:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=o},82182:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});t.Z=o},79814:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});t.Z=o},3477:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"}))});t.Z=o},53410:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});t.Z=o},93416:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});t.Z=o},91126:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},77355:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},22452:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});t.Z=o},23628:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))});t.Z=o},25327:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});t.Z=o},74998:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});t.Z=o},3497:function(e,t,r){"use strict";var n=r(2265);let o=n.forwardRef(function(e,t){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))});t.Z=o},91054:function(e,t,r){"use strict";let n,o;r.d(t,{pJ:function(){return z}});var a,l=r(71049),i=r(11323),s=r(2265),c=r(66797),d=r(93980),u=r(65573),m=r(67561),f=r(98218),p=r(33443),h=r(28294),b=r(31370),g=r(72468),v=r(5664),w=r(38929);let k=null!=(a=s.startTransition)?a:function(e){e()};var x=r(52724),y=((n=y||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),E=((o=E||{})[o.ToggleDisclosure=0]="ToggleDisclosure",o[o.CloseDisclosure=1]="CloseDisclosure",o[o.SetButtonId=2]="SetButtonId",o[o.SetPanelId=3]="SetPanelId",o[o.SetButtonElement=4]="SetButtonElement",o[o.SetPanelElement=5]="SetPanelElement",o);let C={0:e=>({...e,disclosureState:(0,g.E)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId},4:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},5:(e,t)=>e.panelElement===t.element?e:{...e,panelElement:t.element}},M=(0,s.createContext)(null);function S(e){let t=(0,s.useContext)(M);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,S),t}return t}M.displayName="DisclosureContext";let N=(0,s.createContext)(null);N.displayName="DisclosureAPIContext";let j=(0,s.createContext)(null);function L(e,t){return(0,g.E)(t.type,C,e,t)}j.displayName="DisclosurePanelContext";let Z=s.Fragment,O=w.VN.RenderStrategy|w.VN.Static,z=Object.assign((0,w.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,o=(0,s.useRef)(null),a=(0,m.T)(t,(0,m.h)(e=>{o.current=e},void 0===e.as||e.as===s.Fragment)),l=(0,s.useReducer)(L,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:i,buttonId:c},u]=l,f=(0,d.z)(e=>{u({type:1});let t=(0,v.r)(o);if(!t||!c)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(c):t.getElementById(c);null==r||r.focus()}),b=(0,s.useMemo)(()=>({close:f}),[f]),k=(0,s.useMemo)(()=>({open:0===i,close:f}),[i,f]),x=(0,w.L6)();return s.createElement(M.Provider,{value:l},s.createElement(N.Provider,{value:b},s.createElement(p.Z,{value:f},s.createElement(h.up,{value:(0,g.E)(i,{0:h.ZM.Open,1:h.ZM.Closed})},x({ourProps:{ref:a},theirProps:n,slot:k,defaultTag:Z,name:"Disclosure"})))))}),{Button:(0,w.yV)(function(e,t){let r=(0,s.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:o=!1,autoFocus:a=!1,...f}=e,[p,h]=S("Disclosure.Button"),g=(0,s.useContext)(j),v=null!==g&&g===p.panelId,k=(0,s.useRef)(null),y=(0,m.T)(k,t,(0,d.z)(e=>{if(!v)return h({type:4,element:e})}));(0,s.useEffect)(()=>{if(!v)return h({type:2,buttonId:n}),()=>{h({type:2,buttonId:null})}},[n,h,v]);let E=(0,d.z)(e=>{var t;if(v){if(1===p.disclosureState)return;switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),h({type:0}),null==(t=p.buttonElement)||t.focus()}}else switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),h({type:0})}}),C=(0,d.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),M=(0,d.z)(e=>{var t;(0,b.P)(e.currentTarget)||o||(v?(h({type:0}),null==(t=p.buttonElement)||t.focus()):h({type:0}))}),{isFocusVisible:N,focusProps:L}=(0,l.F)({autoFocus:a}),{isHovered:Z,hoverProps:O}=(0,i.X)({isDisabled:o}),{pressed:z,pressProps:T}=(0,c.x)({disabled:o}),R=(0,s.useMemo)(()=>({open:0===p.disclosureState,hover:Z,active:z,disabled:o,focus:N,autofocus:a}),[p,Z,z,N,o,a]),I=(0,u.f)(e,p.buttonElement),B=v?(0,w.dG)({ref:y,type:I,disabled:o||void 0,autoFocus:a,onKeyDown:E,onClick:M},L,O,T):(0,w.dG)({ref:y,id:n,type:I,"aria-expanded":0===p.disclosureState,"aria-controls":p.panelElement?p.panelId:void 0,disabled:o||void 0,autoFocus:a,onKeyDown:E,onKeyUp:C,onClick:M},L,O,T);return(0,w.L6)()({ourProps:B,theirProps:f,slot:R,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,w.yV)(function(e,t){let r=(0,s.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:o=!1,...a}=e,[l,i]=S("Disclosure.Panel"),{close:c}=function e(t){let r=(0,s.useContext)(N);if(null===r){let r=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r}("Disclosure.Panel"),[u,p]=(0,s.useState)(null),b=(0,m.T)(t,(0,d.z)(e=>{k(()=>i({type:5,element:e}))}),p);(0,s.useEffect)(()=>(i({type:3,panelId:n}),()=>{i({type:3,panelId:null})}),[n,i]);let g=(0,h.oJ)(),[v,x]=(0,f.Y)(o,u,null!==g?(g&h.ZM.Open)===h.ZM.Open:0===l.disclosureState),y=(0,s.useMemo)(()=>({open:0===l.disclosureState,close:c}),[l.disclosureState,c]),E={ref:b,id:n,...(0,f.X)(x)},C=(0,w.L6)();return s.createElement(h.uu,null,s.createElement(j.Provider,{value:l.panelId},C({ourProps:E,theirProps:a,slot:y,defaultTag:"div",features:O,visible:v,name:"Disclosure.Panel"})))})})},85238:function(e,t,r){"use strict";let n;r.d(t,{u:function(){return j}});var o=r(2265),a=r(59456),l=r(93980),i=r(25289),s=r(73389),c=r(43507),d=r(180),u=r(67561),m=r(98218),f=r(28294),p=r(95504),h=r(72468),b=r(38929);function g(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:E)!==o.Fragment||1===o.Children.count(e.children)}let v=(0,o.createContext)(null);v.displayName="TransitionContext";var w=((n=w||{}).Visible="visible",n.Hidden="hidden",n);let k=(0,o.createContext)(null);function x(e){return"children"in e?x(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function y(e,t){let r=(0,c.E)(e),n=(0,o.useRef)([]),s=(0,i.t)(),d=(0,a.G)(),u=(0,l.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.l4.Hidden,o=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==o&&((0,h.E)(t,{[b.l4.Unmount](){n.current.splice(o,1)},[b.l4.Hidden](){n.current[o].state="hidden"}}),d.microTask(()=>{var e;!x(n)&&s.current&&(null==(e=r.current)||e.call(r))}))}),m=(0,l.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>u(e,b.l4.Unmount)}),f=(0,o.useRef)([]),p=(0,o.useRef)(Promise.resolve()),g=(0,o.useRef)({enter:[],leave:[]}),v=(0,l.z)((e,r,n)=>{f.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{f.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(g.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?p.current=p.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),w=(0,l.z)((e,t,r)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=f.current.shift())||e()}).then(()=>r(t))});return(0,o.useMemo)(()=>({children:n,register:m,unregister:u,onStart:v,onStop:w,wait:p,chains:g}),[m,u,n,v,w,g,p])}k.displayName="NestingContext";let E=o.Fragment,C=b.VN.RenderStrategy,M=(0,b.yV)(function(e,t){let{show:r,appear:n=!1,unmount:a=!0,...i}=e,c=(0,o.useRef)(null),m=g(e),p=(0,u.T)(...m?[c,t]:null===t?[]:[t]);(0,d.H)();let h=(0,f.oJ)();if(void 0===r&&null!==h&&(r=(h&f.ZM.Open)===f.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[w,E]=(0,o.useState)(r?"visible":"hidden"),M=y(()=>{r||E("hidden")}),[N,j]=(0,o.useState)(!0),L=(0,o.useRef)([r]);(0,s.e)(()=>{!1!==N&&L.current[L.current.length-1]!==r&&(L.current.push(r),j(!1))},[L,r]);let Z=(0,o.useMemo)(()=>({show:r,appear:n,initial:N}),[r,n,N]);(0,s.e)(()=>{r?E("visible"):x(M)||null===c.current||E("hidden")},[r,M]);let O={unmount:a},z=(0,l.z)(()=>{var t;N&&j(!1),null==(t=e.beforeEnter)||t.call(e)}),T=(0,l.z)(()=>{var t;N&&j(!1),null==(t=e.beforeLeave)||t.call(e)}),R=(0,b.L6)();return o.createElement(k.Provider,{value:M},o.createElement(v.Provider,{value:Z},R({ourProps:{...O,as:o.Fragment,children:o.createElement(S,{ref:p,...O,...i,beforeEnter:z,beforeLeave:T})},theirProps:{},defaultTag:o.Fragment,features:C,visible:"visible"===w,name:"Transition"})))}),S=(0,b.yV)(function(e,t){var r,n;let{transition:a=!0,beforeEnter:i,afterEnter:c,beforeLeave:w,afterLeave:M,enter:S,enterFrom:N,enterTo:j,entered:L,leave:Z,leaveFrom:O,leaveTo:z,...T}=e,[R,I]=(0,o.useState)(null),B=(0,o.useRef)(null),P=g(e),q=(0,u.T)(...P?[B,t,I]:null===t?[]:[t]),D=null==(r=T.unmount)||r?b.l4.Unmount:b.l4.Hidden,{show:A,appear:H,initial:V}=function(){let e=(0,o.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[W,F]=(0,o.useState)(A?"visible":"hidden"),K=function(){let e=(0,o.useContext)(k);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:_,unregister:X}=K;(0,s.e)(()=>_(B),[_,B]),(0,s.e)(()=>{if(D===b.l4.Hidden&&B.current){if(A&&"visible"!==W){F("visible");return}return(0,h.E)(W,{hidden:()=>X(B),visible:()=>_(B)})}},[W,B,_,X,A,D]);let Y=(0,d.H)();(0,s.e)(()=>{if(P&&Y&&"visible"===W&&null===B.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[B,W,Y,P]);let U=V&&!H,G=H&&A&&V,J=(0,o.useRef)(!1),$=y(()=>{J.current||(F("hidden"),X(B))},K),Q=(0,l.z)(e=>{J.current=!0,$.onStart(B,e?"enter":"leave",e=>{"enter"===e?null==i||i():"leave"===e&&(null==w||w())})}),ee=(0,l.z)(e=>{let t=e?"enter":"leave";J.current=!1,$.onStop(B,t,e=>{"enter"===e?null==c||c():"leave"===e&&(null==M||M())}),"leave"!==t||x($)||(F("hidden"),X(B))});(0,o.useEffect)(()=>{P&&a||(Q(A),ee(A))},[A,P,a]);let et=!(!a||!P||!Y||U),[,er]=(0,m.Y)(et,R,A,{start:Q,end:ee}),en=(0,b.oA)({ref:q,className:(null==(n=(0,p.A)(T.className,G&&S,G&&N,er.enter&&S,er.enter&&er.closed&&N,er.enter&&!er.closed&&j,er.leave&&Z,er.leave&&!er.closed&&O,er.leave&&er.closed&&z,!er.transition&&A&&L))?void 0:n.trim())||void 0,...(0,m.X)(er)}),eo=0;"visible"===W&&(eo|=f.ZM.Open),"hidden"===W&&(eo|=f.ZM.Closed),er.enter&&(eo|=f.ZM.Opening),er.leave&&(eo|=f.ZM.Closing);let ea=(0,b.L6)();return o.createElement(k.Provider,{value:$},o.createElement(f.up,{value:eo},ea({ourProps:en,theirProps:T,defaultTag:E,features:C,visible:"visible"===W,name:"Transition.Child"})))}),N=(0,b.yV)(function(e,t){let r=null!==(0,o.useContext)(v),n=null!==(0,f.oJ)();return o.createElement(o.Fragment,null,!r&&n?o.createElement(M,{ref:t,...e}):o.createElement(S,{ref:t,...e}))}),j=Object.assign(M,{Child:N,Root:M})},33443:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2265);let o=(0,n.createContext)(()=>{});function a(e){let{value:t,children:r}=e;return n.createElement(o.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3862-d5d4e83b9e0293bc.js b/litellm/proxy/_experimental/out/_next/static/chunks/3862-d5d4e83b9e0293bc.js deleted file mode 100644 index 5a13dc7740f..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3862-d5d4e83b9e0293bc.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3862],{64748:function(e,s,l){l.d(s,{Ct:function(){return t.Z},Dx:function(){return m.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return o.Z},td:function(){return c.Z},v0:function(){return i.Z},x4:function(){return d.Z},xv:function(){return x.Z},zx:function(){return a.Z}});var t=l(41649),a=l(78489),r=l(12514),n=l(12485),i=l(18135),c=l(35242),d=l(29706),o=l(77991),x=l(84264),m=l(96761)},78801:function(e,s,l){l.d(s,{Z:function(){return t.Z},x:function(){return a.Z}});var t=l(12514),a=l(84264)},58927:function(e,s,l){l.d(s,{J:function(){return t.Z}});var t=l(47323)},53862:function(e,s,l){l.d(s,{Z:function(){return J}});var t=l(57437),a=l(41649),r=l(78489),n=l(84264),i=l(99981),c=l(3810),d=l(23639),o=l(15424),x=l(2265),m=l(15690),u=l(10032),h=l(61994),p=l(5545),g=l(22116),j=l(96761),v=l(19250),b=l(9114);let{Step:N}=m.default;var f=e=>{let{visible:s,onClose:l,accessToken:r,agentHubData:i,onSuccess:c}=e,[d,o]=(0,x.useState)(0),[f,y]=(0,x.useState)(new Set),[_,k]=(0,x.useState)(!1),[Z]=u.Z.useForm(),w=()=>{o(0),y(new Set),Z.resetFields(),l()},C=(e,s)=>{let l=new Set(f);s?l.add(e):l.delete(e),y(l)},S=e=>{e?y(new Set(i.map(e=>e.agent_id||e.name))):y(new Set)};(0,x.useEffect)(()=>{s&&i.length>0&&y(new Set(i.filter(e=>!0===e.is_public).map(e=>e.agent_id||e.name)))},[s,i]);let M=async()=>{if(0===f.size){b.Z.fromBackend("Please select at least one agent to make public");return}k(!0);try{let e=Array.from(f);await (0,v.makeAgentsPublicCall)(r,e),b.Z.success("Successfully made ".concat(e.length," agent(s) public!")),w(),c()}catch(e){console.error("Error making agents public:",e),b.Z.fromBackend("Failed to make agents public. Please try again.")}finally{k(!1)}},P=()=>{let e=i.length>0&&i.every(e=>f.has(e.agent_id||e.name)),s=f.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(j.Z,{children:"Select Agents to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(h.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===i.length,children:["Select All ",i.length>0&&"(".concat(i.length,")")]})})]}),(0,t.jsx)(n.Z,{className:"text-sm text-gray-600",children:"Select the agents you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these agents."}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===i.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(n.Z,{children:"No agents available."})}):i.map(e=>{let s=e.agent_id||e.name;return(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(h.Z,{checked:f.has(s),onChange:e=>C(s,e.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:e.name}),(0,t.jsxs)(a.Z,{color:"blue",size:"sm",children:["v",e.version]})]}),(0,t.jsx)(n.Z,{className:"text-xs text-gray-600 mt-1",children:e.description}),e.skills&&e.skills.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.skills.slice(0,3).map(e=>(0,t.jsx)(a.Z,{color:"purple",size:"xs",children:e.name},e.id)),e.skills.length>3&&(0,t.jsxs)(n.Z,{className:"text-xs text-gray-500",children:["+",e.skills.length-3," more"]})]})]})]},s)})})}),f.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(n.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:f.size})," agent",1!==f.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(j.Z,{children:"Confirm Making Agents Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(n.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these agents public, anyone who can go to the"," ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:"Agents to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(f).map(e=>{let s=i.find(s=>(s.agent_id||s.name)===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:(null==s?void 0:s.name)||e}),s&&(0,t.jsxs)(a.Z,{color:"blue",size:"xs",children:["v",s.version]})]}),(null==s?void 0:s.description)&&(0,t.jsx)(n.Z,{className:"text-xs text-gray-600 mt-1",children:s.description})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(n.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:f.size})," agent",1!==f.size?"s":""," will be made public"]})})]});return(0,t.jsx)(g.Z,{title:"Make Agents Public",open:s,onCancel:w,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(u.Z,{form:Z,layout:"vertical",children:[(0,t.jsxs)(m.default,{current:d,className:"mb-6",children:[(0,t.jsx)(N,{title:"Select Agents"}),(0,t.jsx)(N,{title:"Confirm"})]}),(()=>{switch(d){case 0:return P();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(p.ZP,{onClick:0===d?w:()=>{1===d&&o(0)},children:0===d?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===d&&(0,t.jsx)(p.ZP,{onClick:()=>{if(0===d){if(0===f.size){b.Z.fromBackend("Please select at least one agent to make public");return}o(1)}},disabled:0===f.size,children:"Next"}),1===d&&(0,t.jsx)(p.ZP,{onClick:M,loading:_,children:"Make Public"})]})]})]})})};let{Step:y}=m.default;var _=e=>{let{visible:s,onClose:l,accessToken:r,mcpHubData:i,onSuccess:c}=e,[d,o]=(0,x.useState)(0),[N,f]=(0,x.useState)(new Set),[_,k]=(0,x.useState)(!1),[Z]=u.Z.useForm(),w=()=>{o(0),f(new Set),Z.resetFields(),l()},C=(e,s)=>{let l=new Set(N);s?l.add(e):l.delete(e),f(l)},S=e=>{e?f(new Set(i.map(e=>e.server_id))):f(new Set)};(0,x.useEffect)(()=>{s&&i.length>0&&f(new Set(i.filter(e=>{var s;return(null===(s=e.mcp_info)||void 0===s?void 0:s.is_public)===!0}).map(e=>e.server_id)))},[s]);let M=async()=>{if(0===N.size){b.Z.fromBackend("Please select at least one MCP server to make public");return}k(!0);try{let e=Array.from(N);await (0,v.makeMCPPublicCall)(r,e),b.Z.success("Successfully made ".concat(e.length," MCP server(s) public!")),w(),c()}catch(e){console.error("Error making MCP servers public:",e),b.Z.fromBackend("Failed to make MCP servers public. Please try again.")}finally{k(!1)}},P=()=>{let e=i.length>0&&i.every(e=>N.has(e.server_id)),s=N.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(j.Z,{children:"Select MCP Servers to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(h.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===i.length,children:["Select All ",i.length>0&&"(".concat(i.length,")")]})})]}),(0,t.jsx)(n.Z,{className:"text-sm text-gray-600",children:"Select the MCP servers you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these servers."}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===i.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(n.Z,{children:"No MCP servers available."})}):i.map(e=>{var s;let l=(null===(s=e.mcp_info)||void 0===s?void 0:s.is_public)===!0;return(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(h.Z,{checked:N.has(e.server_id),onChange:s=>C(e.server_id,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:e.server_name}),l&&(0,t.jsx)(a.Z,{color:"emerald",size:"sm",children:"Public"}),(0,t.jsx)(a.Z,{color:"blue",size:"sm",children:e.transport}),(0,t.jsx)(a.Z,{color:"active"===e.status||"healthy"===e.status?"green":"inactive"===e.status||"unhealthy"===e.status?"red":"gray",size:"sm",children:e.status||"unknown"})]}),(0,t.jsx)(n.Z,{className:"text-xs text-gray-600 mt-1",children:e.description||e.url}),e.allowed_tools&&e.allowed_tools.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowed_tools.slice(0,3).map((e,s)=>(0,t.jsx)(a.Z,{color:"purple",size:"xs",children:e},s)),e.allowed_tools.length>3&&(0,t.jsxs)(n.Z,{className:"text-xs text-gray-500",children:["+",e.allowed_tools.length-3," more"]})]})]})]},e.server_id)})})}),N.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(n.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:N.size})," MCP server",1!==N.size?"s":""," selected"]})})]})},z=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(j.Z,{children:"Confirm Making MCP Servers Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(n.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these MCP servers public, anyone who can go to the"," ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:"MCP Servers to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(N).map(e=>{let s=i.find(s=>s.server_id===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:(null==s?void 0:s.server_name)||e}),s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Z,{color:"blue",size:"xs",children:s.transport}),(0,t.jsx)(a.Z,{color:"active"===s.status||"healthy"===s.status?"green":"inactive"===s.status||"unhealthy"===s.status?"red":"gray",size:"xs",children:s.status||"unknown"})]})]}),(null==s?void 0:s.description)&&(0,t.jsx)(n.Z,{className:"text-xs text-gray-600 mt-1",children:s.description}),(null==s?void 0:s.url)&&(0,t.jsx)(n.Z,{className:"text-xs text-gray-500 mt-1",children:s.url})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(n.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:N.size})," MCP server",1!==N.size?"s":""," will be made public"]})})]});return(0,t.jsx)(g.Z,{title:"Make MCP Servers Public",open:s,onCancel:w,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(u.Z,{form:Z,layout:"vertical",children:[(0,t.jsxs)(m.default,{current:d,className:"mb-6",children:[(0,t.jsx)(y,{title:"Select Servers"}),(0,t.jsx)(y,{title:"Confirm"})]}),(()=>{switch(d){case 0:return P();case 1:return z();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(p.ZP,{onClick:0===d?w:()=>{1===d&&o(0)},children:0===d?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===d&&(0,t.jsx)(p.ZP,{onClick:()=>{if(0===d){if(0===N.size){b.Z.fromBackend("Please select at least one MCP server to make public");return}o(1)}},disabled:0===N.size,children:"Next"}),1===d&&(0,t.jsx)(p.ZP,{onClick:M,loading:_,children:"Make Public"})]})]})]})})},k=l(78801),Z=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:a=!0,className:r=""}=e,[n,i]=(0,x.useState)(""),[c,d]=(0,x.useState)(""),[o,m]=(0,x.useState)(""),[u,h]=(0,x.useState)(""),p=(0,x.useRef)([]),g=(0,x.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(n.toLowerCase()),l=""===c||e.providers.includes(c),t=""===o||e.mode===o,a=""===u||Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).some(e=>{let[s]=e;return s.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")===u});return s&&l&&t&&a}))||[],[s,n,c,o,u]);(0,x.useEffect)(()=>{(g.length!==p.current.length||g.some((e,s)=>{var l;return e.model_group!==(null===(l=p.current[s])||void 0===l?void 0:l.model_group)}))&&(p.current=g,l(g))},[g,l]);let j=(0,t.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(k.x,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,t.jsx)("input",{type:"text",placeholder:"Search model names...",value:n,onChange:e=>i(e.target.value),className:"border rounded px-3 py-2 w-64 h-10 text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(k.x,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,t.jsxs)("select",{value:c,onChange:e=>d(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Providers"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.providers.forEach(e=>s.add(e))}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(k.x,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,t.jsxs)("select",{value:o,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Modes"}),s&&(e=>{let s=new Set;return e.forEach(e=>{e.mode&&s.add(e.mode)}),Array.from(s)})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(k.x,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,t.jsxs)("select",{value:u,onChange:e=>h(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,t.jsx)("option",{value:"",className:"text-sm text-gray-600",children:"All Features"}),s&&(e=>{let s=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).forEach(e=>{let[l]=e,t=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(t)})}),Array.from(s).sort()})(s).map(e=>(0,t.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(n||c||o||u)&&(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsx)("button",{onClick:()=>{i(""),d(""),m(""),h("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return a?(0,t.jsx)(k.Z,{className:"mb-6 ".concat(r),children:j}):(0,t.jsx)("div",{className:r,children:j})};let{Step:w}=m.default;var C=e=>{let{visible:s,onClose:l,accessToken:r,modelHubData:i,onSuccess:c}=e,[d,o]=(0,x.useState)(0),[N,f]=(0,x.useState)(new Set),[y,_]=(0,x.useState)([]),[k,C]=(0,x.useState)(!1),[S]=u.Z.useForm(),M=()=>{o(0),f(new Set),_([]),S.resetFields(),l()},P=(e,s)=>{let l=new Set(N);s?l.add(e):l.delete(e),f(l)},z=e=>{e?f(new Set(y.map(e=>e.model_group))):f(new Set)},A=(0,x.useCallback)(e=>{_(e)},[]);(0,x.useEffect)(()=>{s&&i.length>0&&(_(i),f(new Set(i.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,i]);let F=async()=>{if(0===N.size){b.Z.fromBackend("Please select at least one model to make public");return}C(!0);try{let e=Array.from(N);await (0,v.makeModelGroupPublic)(r,e),b.Z.success("Successfully made ".concat(e.length," model group(s) public!")),M(),c()}catch(e){console.error("Error making model groups public:",e),b.Z.fromBackend("Failed to make model groups public. Please try again.")}finally{C(!1)}},L=()=>{let e=y.length>0&&y.every(e=>N.has(e.model_group)),s=N.size>0&&!e;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(j.Z,{children:"Select Models to Make Public"}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsxs)(h.Z,{checked:e,indeterminate:s,onChange:e=>z(e.target.checked),disabled:0===y.length,children:["Select All ",y.length>0&&"(".concat(y.length,")")]})})]}),(0,t.jsx)(n.Z,{className:"text-sm text-gray-600",children:"Select the models you want to be visible on the public model hub. Users will still require a valid Virtual Key to use these models."}),(0,t.jsx)(Z,{modelHubData:i,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,t.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,t.jsx)("div",{className:"space-y-3",children:0===y.length?(0,t.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,t.jsx)(n.Z,{children:"No models match the current filters."})}):y.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,t.jsx)(h.Z,{checked:N.has(e.model_group),onChange:s=>P(e.model_group,s.target.checked)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,t.jsx)(a.Z,{color:"green",size:"sm",children:e.mode})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,t.jsx)(a.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),N.size>0&&(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(n.Z,{className:"text-sm text-blue-800",children:[(0,t.jsx)("strong",{children:N.size})," model",1!==N.size?"s":""," selected"]})})]})},T=()=>(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(j.Z,{children:"Confirm Making Models Public"}),(0,t.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,t.jsxs)(n.Z,{className:"text-sm text-yellow-800",children:[(0,t.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the"," ",(0,t.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(n.Z,{className:"font-medium",children:"Models to be made public:"}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,t.jsx)("div",{className:"space-y-2",children:Array.from(N).map(e=>{let s=i.find(s=>s.model_group===e);return(0,t.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Z,{className:"font-medium",children:e}),s&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,t.jsx)(a.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(n.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,t.jsx)("strong",{children:N.size})," model",1!==N.size?"s":""," will be made public"]})})]});return(0,t.jsx)(g.Z,{title:"Make Models Public",open:s,onCancel:M,footer:null,width:1200,maskClosable:!1,children:(0,t.jsxs)(u.Z,{form:S,layout:"vertical",children:[(0,t.jsxs)(m.default,{current:d,className:"mb-6",children:[(0,t.jsx)(w,{title:"Select Models"}),(0,t.jsx)(w,{title:"Confirm"})]}),(()=>{switch(d){case 0:return L();case 1:return T();default:return null}})(),(0,t.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,t.jsx)(p.ZP,{onClick:0===d?M:()=>{1===d&&o(0)},children:0===d?"Cancel":"Previous"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[0===d&&(0,t.jsx)(p.ZP,{onClick:()=>{if(0===d){if(0===N.size){b.Z.fromBackend("Please select at least one model to make public");return}o(1)}},disabled:0===N.size,children:"Next"}),1===d&&(0,t.jsx)(p.ZP,{onClick:F,loading:k,children:"Make Public"})]})]})]})})};let S=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),M=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),P=e=>"$".concat((1e6*e).toFixed(2)),z=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),A=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],x=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium text-sm",children:a.model_group}),(0,t.jsx)(i.Z,{title:"Copy model name",children:(0,t.jsx)(d.Z,{onClick:()=>s(a.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(n.Z,{className:"text-xs text-gray-600",children:a.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),t=s.original.providers.join(", ");return l.localeCompare(t)},cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,t.jsx)(c.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,t.jsxs)(n.Z,{className:"text-xs text-gray-500",children:["+",l.providers.length-2]})]})},meta:{className:"hidden md:table-cell"}},{header:"Mode",accessorKey:"mode",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return l.mode?(0,t.jsx)(a.Z,{color:"green",size:"sm",children:l.mode}):(0,t.jsx)(n.Z,{className:"text-gray-500",children:"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Tokens",accessorKey:"max_input_tokens",enableSorting:!0,sortingFn:(e,s)=>(e.original.max_input_tokens||0)+(e.original.max_output_tokens||0)-((s.original.max_input_tokens||0)+(s.original.max_output_tokens||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)("div",{className:"space-y-1",children:(0,t.jsxs)(n.Z,{className:"text-xs",children:[l.max_input_tokens?z(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?z(l.max_output_tokens):"-"]})})},meta:{className:"hidden lg:table-cell"}},{header:"Cost/1M",accessorKey:"input_cost_per_token",enableSorting:!0,sortingFn:(e,s)=>(e.original.input_cost_per_token||0)+(e.original.output_cost_per_token||0)-((s.original.input_cost_per_token||0)+(s.original.output_cost_per_token||0)),cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(n.Z,{className:"text-xs",children:l.input_cost_per_token?P(l.input_cost_per_token):"-"}),(0,t.jsx)(n.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?P(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=M(s.original),r=["green","blue","purple","orange","red","yellow"];return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(n.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,t.jsx)(a.Z,{color:r[s%r.length],size:"xs",children:S(e)},e))})}},{header:"Public",accessorKey:"is_public_model_group",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public_model_group?1:0)-(!0===s.original.is_public_model_group?1:0),cell:e=>{let{row:s}=e;return!0===s.original.is_public_model_group?(0,t.jsx)(a.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(a.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(r.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:o.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?x.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):x};var F=l(39957),L=l(20347),T=l(86462),D=l(47686),O=l(77355),E=l(3477),K=l(95704),U=l(27648),I=e=>{let{accessToken:s,userRole:l}=e,[a,r]=(0,x.useState)([]),[n,i]=(0,x.useState)({url:"",displayName:""}),[c,d]=(0,x.useState)(null),[o,m]=(0,x.useState)(!1),[u,h]=(0,x.useState)(!0),[p,g]=(0,x.useState)(!1),[j,N]=(0,x.useState)([]),f=async()=>{if(s)try{m(!0);let e=await (0,v.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map(e=>{var s,l;let[t,a]=e;return"object"==typeof a&&null!==a&&"url"in a?{id:"".concat(null!==(s=a.index)&&void 0!==s?s:0,"-").concat(t),displayName:t,url:a.url,index:null!==(l=a.index)&&void 0!==l?l:0}:{id:"0-".concat(t),displayName:t,url:a,index:0}}).sort((e,s)=>{var l,t;return(null!==(l=e.index)&&void 0!==l?l:0)-(null!==(t=s.index)&&void 0!==t?t:0)}).map((e,s)=>({...e,id:"".concat(s,"-").concat(e.displayName)}));r(l)}else r([])}catch(e){console.error("Error fetching useful links:",e),r([])}finally{m(!1)}};if((0,x.useEffect)(()=>{f()},[s]),!(0,L.tY)(l||""))return null;let y=async e=>{if(!s)return!1;try{let l={};return e.forEach((e,s)=>{l[e.displayName]={url:e.url,index:s}}),await (0,v.updateUsefulLinksCall)(s,l),!0}catch(e){return console.error("Error saving links:",e),b.Z.fromBackend("Failed to save links - ".concat(e)),!1}},_=async()=>{if(!n.url||!n.displayName)return;try{new URL(n.url)}catch(e){b.Z.fromBackend("Please enter a valid URL");return}if(a.some(e=>e.displayName===n.displayName)){b.Z.fromBackend("A link with this display name already exists");return}let e=[...a,{id:"".concat(Date.now(),"-").concat(n.displayName),displayName:n.displayName,url:n.url}];await y(e)&&(r(e),i({url:"",displayName:""}),b.Z.success("Link added successfully"))},k=e=>{d({...e})},Z=async()=>{if(!c)return;try{new URL(c.url)}catch(e){b.Z.fromBackend("Please enter a valid URL");return}if(a.some(e=>e.id!==c.id&&e.displayName===c.displayName)){b.Z.fromBackend("A link with this display name already exists");return}let e=a.map(e=>e.id===c.id?c:e);await y(e)&&(r(e),d(null),b.Z.success("Link updated successfully"))},w=()=>{d(null)},C=async e=>{let s=a.filter(s=>s.id!==e);await y(s)&&(r(s),b.Z.success("Link deleted successfully"))},S=e=>{window.open(e,"_blank")},M=async()=>{await y(a)&&(g(!1),N([]),b.Z.success("Link order saved successfully"))},P=e=>{if(0===e)return;let s=[...a];[s[e-1],s[e]]=[s[e],s[e-1]],r(s)},z=e=>{if(e===a.length-1)return;let s=[...a];[s[e],s[e+1]]=[s[e+1],s[e]],r(s)};return(0,t.jsxs)(K.Zb,{className:"mb-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>h(!u),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(K.Dx,{className:"mb-0",children:"Link Management"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,t.jsx)("div",{className:"flex items-center",children:u?(0,t.jsx)(T.Z,{className:"w-5 h-5 text-gray-500"}):(0,t.jsx)(D.Z,{className:"w-5 h-5 text-gray-500"})})]}),u&&(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(K.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,t.jsx)("input",{type:"text",value:n.displayName,onChange:e=>i({...n,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,t.jsx)("input",{type:"text",value:n.url,onChange:e=>i({...n,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,t.jsx)("div",{className:"flex items-end",children:(0,t.jsxs)("button",{onClick:_,disabled:!n.url||!n.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(n.url&&n.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,t.jsx)(O.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)(K.xv,{className:"text-sm font-medium text-gray-700",children:"Manage Existing Links"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsxs)(U.default,{href:"".concat((0,v.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"text-xs bg-blue-50 text-blue-600 px-3 py-1.5 rounded hover:bg-blue-100 flex items-center",title:"Open Public Model Hub",children:["Public Model Hub",(0,t.jsx)(E.Z,{className:"w-4 h-4 ml-1"})]}),p?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:M,className:"text-xs bg-green-600 text-white px-3 py-1.5 rounded hover:bg-green-700",children:"Save Order"}),(0,t.jsx)("button",{onClick:()=>{r([...j]),g(!1),N([])},className:"text-xs bg-gray-50 text-gray-600 px-3 py-1.5 rounded hover:bg-gray-100",children:"Cancel"})]}):(0,t.jsx)("button",{onClick:()=>{c&&d(null),N([...a]),g(!0)},className:"text-xs bg-purple-50 text-purple-600 px-3 py-1.5 rounded hover:bg-purple-100 flex items-center",children:"Rearrange Order"})]})]}),(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(K.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(K.ss,{children:(0,t.jsxs)(K.SC,{children:[(0,t.jsx)(K.xs,{className:"py-1 h-8",children:"Display Name"}),(0,t.jsx)(K.xs,{className:"py-1 h-8",children:"URL"}),(0,t.jsx)(K.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,t.jsxs)(K.RM,{children:[a.map((e,s)=>(0,t.jsx)(K.SC,{className:"h-8",children:c&&c.id===e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(K.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:c.displayName,onChange:e=>d({...c,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(K.pj,{className:"py-0.5",children:(0,t.jsx)("input",{type:"text",value:c.url,onChange:e=>d({...c,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,t.jsx)(K.pj,{className:"py-0.5 whitespace-nowrap",children:(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:Z,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,t.jsx)("button",{onClick:w,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(K.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,t.jsx)(K.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,t.jsx)(K.pj,{className:"py-0.5 whitespace-nowrap",children:p?(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(F.Z,{variant:"Up",onClick:()=>P(s),tooltipText:"Move up",disabled:0===s,disabledTooltipText:"Already at the top",dataTestId:"move-up-".concat(e.id)}),(0,t.jsx)(F.Z,{variant:"Down",onClick:()=>z(s),tooltipText:"Move down",disabled:s===a.length-1,disabledTooltipText:"Already at the bottom",dataTestId:"move-down-".concat(e.id)})]}):(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)(F.Z,{variant:"Open",onClick:()=>S(e.url),tooltipText:"Open link",dataTestId:"open-link-".concat(e.id)}),(0,t.jsx)(F.Z,{variant:"Edit",onClick:()=>k(e),tooltipText:"Edit link",dataTestId:"edit-link-".concat(e.id)}),(0,t.jsx)(F.Z,{variant:"Delete",onClick:()=>C(e.id),tooltipText:"Delete link",dataTestId:"delete-link-".concat(e.id)})]})})]})},e.id)),0===a.length&&(0,t.jsx)(K.SC,{children:(0,t.jsx)(K.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})},H=l(8048),B=l(87526),R=l(64748),Y=l(78867),V=l(99376),W=l(17906),J=e=>{var s,l,m,u;let{accessToken:h,publicPage:p,premiumUser:j,userRole:N}=e,[y,k]=(0,x.useState)(!1),[w,S]=(0,x.useState)(null),[M,P]=(0,x.useState)(!0),[z,F]=(0,x.useState)(!1),[T,D]=(0,x.useState)(!1),[O,E]=(0,x.useState)(null),[K,U]=(0,x.useState)([]),[J,q]=(0,x.useState)(!1),[G,$]=(0,x.useState)(null),[Q,X]=(0,x.useState)(!1),[ee,es]=(0,x.useState)(!0),[el,et]=(0,x.useState)(null),[ea,er]=(0,x.useState)(!1),[en,ei]=(0,x.useState)(null),[ec,ed]=(0,x.useState)(!0),[eo,ex]=(0,x.useState)(null),[em,eu]=(0,x.useState)(!1),[eh,ep]=(0,x.useState)(!1),eg=(0,V.useRouter)();(0,x.useEffect)(()=>{let e=async e=>{try{P(!0);let s=await (0,v.modelHubCall)(e);console.log("ModelHubData:",s),S(s.data),(0,v.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&k(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{P(!1)}},s=async()=>{try{var e,s;P(!0),await (0,v.getUiConfig)();let l=await (0,v.modelHubPublicModelsCall)();console.log("ModelHubData:",l),console.log("First model structure:",l[0]),console.log("Model has model_group?",null===(e=l[0])||void 0===e?void 0:e.model_group),console.log("Model has providers?",null===(s=l[0])||void 0===s?void 0:s.providers),S(l),k(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{P(!1)}};h?e(h):p&&s()},[h,p]),(0,x.useEffect)(()=>{let e=async()=>{if(h)try{es(!0);let e=await (0,v.getAgentsList)(h);console.log("AgentHubData:",e);let s=e.agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.litellm_params.is_public}));$(s)}catch(e){console.error("There was an error fetching the agent data",e)}finally{es(!1)}};p||e()},[p,h]),(0,x.useEffect)(()=>{let e=async()=>{if(h)try{ed(!0);let e=await (0,v.fetchMCPServers)(h);console.log("MCPHubData:",e),ei(e)}catch(e){console.error("There was an error fetching the MCP server data",e)}finally{ed(!1)}};p||e()},[p,h]);let ej=()=>{h&&q(!0)},ev=()=>{h&&X(!0)},eb=()=>{h&&ep(!0)},eN=()=>{F(!1),D(!1),E(null),er(!1),et(null),eu(!1),ex(null)},ef=()=>{F(!1),D(!1),E(null),er(!1),et(null),eu(!1),ex(null)},ey=e=>{navigator.clipboard.writeText(e),b.Z.success("Copied to clipboard!")},e_=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),ek=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),eZ=e=>"$".concat((1e6*e).toFixed(2)),ew=(0,x.useCallback)(e=>{U(e)},[]);return(console.log("publicPage: ",p),console.log("publicPageAllowed: ",y),p&&y)?(0,t.jsx)(B.Z,{accessToken:h}):(0,t.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==p?(0,t.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{className:"flex flex-col items-start",children:[(0,t.jsx)(R.Dx,{className:"text-center",children:"AI Hub"}),(0,L.tY)(N||"")?(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Make models, agents, and MCP servers public for developers to know what's available."}):(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)(R.xv,{children:"Model Hub URL:"}),(0,t.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,t.jsx)(R.xv,{className:"mr-2",children:"".concat((0,v.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,t.jsx)("button",{onClick:()=>ey("".concat((0,v.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,t.jsx)(Y.Z,{size:16,className:"text-gray-600"})})]})]})]}),(0,L.tY)(N||"")&&(0,t.jsx)("div",{className:"mt-8 mb-2",children:(0,t.jsx)(I,{accessToken:h,userRole:N})}),(0,t.jsxs)(R.v0,{children:[(0,t.jsxs)(R.td,{className:"mb-4",children:[(0,t.jsx)(R.OK,{children:"Model Hub"}),(0,t.jsx)(R.OK,{children:"Agent Hub"}),(0,t.jsx)(R.OK,{children:"MCP Hub"})]}),(0,t.jsxs)(R.nP,{children:[(0,t.jsxs)(R.x4,{children:[(0,t.jsxs)(R.Zb,{children:[!1==p&&(0,L.tY)(N||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(R.zx,{onClick:()=>ej(),children:"Select Models to Make Public"})}),(0,t.jsx)(Z,{modelHubData:w||[],onFilteredDataChange:ew}),(0,t.jsx)(H.C,{columns:A(e=>{E(e),F(!0)},ey,p),data:K,isLoading:M,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(R.xv,{className:"text-sm text-gray-600",children:["Showing ",K.length," of ",(null==w?void 0:w.length)||0," models"]})})]}),(0,t.jsxs)(R.x4,{children:[(0,t.jsxs)(R.Zb,{children:[!1==p&&(0,L.tY)(N||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(R.zx,{onClick:()=>ev(),children:"Select Agents to Make Public"})}),(0,t.jsx)(H.C,{columns:function(e,s){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],[{header:"Agent Name",accessorKey:"name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium text-sm",children:a.name}),(0,t.jsx)(i.Z,{title:"Copy agent name",children:(0,t.jsx)(d.Z,{onClick:()=>s(a.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(n.Z,{className:"text-xs text-gray-600",children:a.description})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(n.Z,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"Version",accessorKey:"version",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsxs)(a.Z,{color:"blue",size:"sm",children:["v",l.version]})},meta:{className:"hidden lg:table-cell"}},{header:"Protocol",accessorKey:"protocolVersion",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(n.Z,{className:"text-xs",children:l.protocolVersion||"-"})},meta:{className:"hidden lg:table-cell"}},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original.skills||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(n.Z,{className:"text-xs font-medium",children:[l.length," skill",1!==l.length?"s":""]}),l.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map(e=>(0,t.jsx)(c.Z,{color:"purple",className:"text-xs",children:e.name},e.id)),l.length>2&&(0,t.jsxs)(n.Z,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})}},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=Object.entries(s.original.capabilities||{}).filter(e=>{let[s,l]=e;return!0===l}).map(e=>{let[s]=e;return s});return(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,t.jsx)(n.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map(e=>(0,t.jsx)(a.Z,{color:"green",size:"xs",children:e},e))})}},{header:"I/O Modes",accessorKey:"defaultInputModes",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original,a=l.defaultInputModes||[],r=l.defaultOutputModes||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)(n.Z,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"In:"})," ",a.join(", ")||"-"]}),(0,t.jsxs)(n.Z,{className:"text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:"Out:"})," ",r.join(", ")||"-"]})]})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"is_public",enableSorting:!0,sortingFn:(e,s)=>(!0===e.original.is_public?1:0)-(!0===s.original.is_public?1:0),cell:e=>{let{row:s}=e;return console.log("CHECKPOINT 1: ".concat(JSON.stringify(s.original))),!0===s.original.is_public?(0,t.jsx)(a.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(a.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(r.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:o.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{et(e),er(!0)},ey,p),data:G||[],isLoading:ee,defaultSorting:[{id:"name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(R.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==G?void 0:G.length)||0," agent",(null==G?void 0:G.length)!==1?"s":""]})})]}),(0,t.jsxs)(R.x4,{children:[(0,t.jsxs)(R.Zb,{children:[!1==p&&(0,L.tY)(N||"")&&(0,t.jsx)("div",{className:"flex justify-end mb-4",children:(0,t.jsx)(R.zx,{onClick:()=>eb(),children:"Select MCP Servers to Make Public"})}),(0,t.jsx)(H.C,{columns:function(e,s){return arguments.length>2&&void 0!==arguments[2]&&arguments[2],[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"font-medium text-sm",children:a.server_name}),(0,t.jsx)(i.Z,{title:"Copy server name",children:(0,t.jsx)(d.Z,{onClick:()=>s(a.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(n.Z,{className:"text-xs text-gray-600",children:a.description||"-"})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(n.Z,{className:"text-xs line-clamp-2",children:l.description||"-"})},meta:{className:"hidden md:table-cell"}},{header:"URL",accessorKey:"url",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,a=l.original;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.Z,{className:"text-xs truncate max-w-xs",children:a.url}),(0,t.jsx)(i.Z,{title:"Copy URL",children:(0,t.jsx)(d.Z,{onClick:()=>s(a.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs flex-shrink-0"})})]})},meta:{className:"hidden lg:table-cell"}},{header:"Transport",accessorKey:"transport",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(a.Z,{color:"blue",size:"sm",children:l.transport})},meta:{className:"hidden md:table-cell"}},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original,r="none"===l.auth_type?"gray":"green";return(0,t.jsx)(a.Z,{color:r,size:"sm",children:l.auth_type})},meta:{className:"hidden md:table-cell"}},{header:"Status",accessorKey:"status",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original,r={active:"green",inactive:"red",unknown:"gray",healthy:"green",unhealthy:"red"}[l.status]||"gray";return(0,t.jsx)(a.Z,{color:r,size:"sm",children:l.status||"unknown"})}},{header:"Tools",accessorKey:"allowed_tools",enableSorting:!1,cell:e=>{let{row:s}=e,l=s.original.allowed_tools||[];return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)(n.Z,{className:"text-xs font-medium",children:l.length>0?"".concat(l.length," tool").concat(1!==l.length?"s":""):"All tools"}),l.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map((e,s)=>(0,t.jsx)(c.Z,{color:"purple",className:"text-xs",children:e},s)),l.length>2&&(0,t.jsxs)(n.Z,{className:"text-xs text-gray-500",children:["+",l.length-2]})]})]})},meta:{className:"hidden lg:table-cell"}},{header:"Created By",accessorKey:"created_by",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,t.jsx)(n.Z,{className:"text-xs",children:l.created_by||"-"})},meta:{className:"hidden xl:table-cell"}},{header:"Public",accessorKey:"mcp_info.is_public",enableSorting:!0,sortingFn:(e,s)=>{var l,t;return((null===(l=e.original.mcp_info)||void 0===l?void 0:l.is_public)===!0?1:0)-((null===(t=s.original.mcp_info)||void 0===t?void 0:t.is_public)===!0?1:0)},cell:e=>{var s;let{row:l}=e;return(null===(s=l.original.mcp_info)||void 0===s?void 0:s.is_public)===!0?(0,t.jsx)(a.Z,{color:"green",size:"xs",children:"Yes"}):(0,t.jsx)(a.Z,{color:"gray",size:"xs",children:"No"})},meta:{className:"hidden md:table-cell"}},{header:"Details",id:"details",enableSorting:!1,cell:s=>{let{row:l}=s,a=l.original;return(0,t.jsxs)(r.Z,{size:"xs",variant:"secondary",onClick:()=>e(a),icon:o.Z,children:[(0,t.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,t.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ex(e),eu(!0)},ey,p),data:en||[],isLoading:ec,defaultSorting:[{id:"server_name",desc:!1}]})]}),(0,t.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,t.jsxs)(R.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==en?void 0:en.length)||0," MCP server",(null==en?void 0:en.length)!==1?"s":""]})})]})]})]})]}):(0,t.jsxs)(R.Zb,{className:"mx-auto max-w-xl mt-10",children:[(0,t.jsx)(R.xv,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,t.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,t.jsx)(g.Z,{title:"Public Model Hub",width:600,visible:T,footer:null,onOk:eN,onCancel:ef,children:(0,t.jsxs)("div",{className:"pt-5 pb-5",children:[(0,t.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,t.jsx)(R.xv,{className:"text-base mr-2",children:"Shareable Link:"}),(0,t.jsx)(R.xv,{className:"max-w-sm ml-2 bg-gray-200 pr-2 pl-2 pt-1 pb-1 text-center rounded",children:"".concat((0,v.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(R.zx,{onClick:()=>{eg.replace("/model_hub_table?key=".concat(h))},children:"See Page"})})]})}),(0,t.jsx)(g.Z,{title:(null==O?void 0:O.model_group)||"Model Details",width:1e3,visible:z,footer:null,onOk:eN,onCancel:ef,children:O&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Model Group:"}),(0,t.jsx)(R.xv,{children:O.model_group})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Mode:"}),(0,t.jsx)(R.xv,{children:O.mode||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Providers:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:O.providers.map(e=>(0,t.jsx)(R.Ct,{color:"blue",children:e},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,t.jsx)(R.xv,{children:(null===(s=O.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,t.jsx)(R.xv,{children:(null===(l=O.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,t.jsx)(R.xv,{children:O.input_cost_per_token?eZ(O.input_cost_per_token):"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,t.jsx)(R.xv,{children:O.output_cost_per_token?eZ(O.output_cost_per_token):"Not specified"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=ek(O),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,t.jsx)(R.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,t.jsx)(R.Ct,{color:s[l%s.length],children:e_(e)},e))})()})]}),(O.tpm||O.rpm)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[O.tpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,t.jsx)(R.xv,{children:O.tpm.toLocaleString()})]}),O.rpm&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,t.jsx)(R.xv,{children:O.rpm.toLocaleString()})]})]})]}),O.supported_openai_params&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:O.supported_openai_params.map(e=>(0,t.jsx)(R.Ct,{color:"green",children:e},e))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(W.Z,{language:"python",className:"text-sm",children:'import openai\n\nclient = openai.OpenAI(\n api_key="your_api_key",\n base_url="http://0.0.0.0:4000" # Your LiteLLM Proxy URL\n)\n\nresponse = client.chat.completions.create(\n model="'.concat(O.model_group,'",\n messages=[\n {\n "role": "user",\n "content": "Hello, how are you?"\n }\n ]\n)\n\nprint(response.choices[0].message.content)')})]})]})}),(0,t.jsx)(g.Z,{title:(null==el?void 0:el.name)||"Agent Details",width:1e3,visible:ea,footer:null,onOk:eN,onCancel:ef,children:el&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Name:"}),(0,t.jsx)(R.xv,{children:el.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Version:"}),(0,t.jsxs)(R.Ct,{color:"blue",children:["v",el.version]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Protocol Version:"}),(0,t.jsx)(R.xv,{children:el.protocolVersion})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(R.xv,{className:"truncate",children:el.url}),(0,t.jsx)(d.Z,{onClick:()=>ey(el.url),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Description:"}),(0,t.jsx)(R.xv,{className:"mt-1",children:el.description})]})]}),el.capabilities&&Object.keys(el.capabilities).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(el.capabilities).filter(e=>{let[s,l]=e;return!0===l}).map(e=>{let[s]=e;return(0,t.jsx)(R.Ct,{color:"green",children:s},s)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Input Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(m=el.defaultInputModes)||void 0===m?void 0:m.map(e=>(0,t.jsx)(R.Ct,{color:"blue",children:e},e)))||(0,t.jsx)(R.xv,{children:"Not specified"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Output Modes:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(u=el.defaultOutputModes)||void 0===u?void 0:u.map(e=>(0,t.jsx)(R.Ct,{color:"purple",children:e},e)))||(0,t.jsx)(R.xv,{children:"Not specified"})})]})]})]}),el.skills&&el.skills.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,t.jsx)("div",{className:"space-y-4",children:el.skills.map(e=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium text-base",children:e.name}),(0,t.jsxs)(R.xv,{className:"text-xs text-gray-500",children:["ID: ",e.id]})]}),e.tags&&e.tags.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map(e=>(0,t.jsx)(R.Ct,{color:"purple",size:"xs",children:e},e))})]}),(0,t.jsx)(R.xv,{className:"text-sm mb-2",children:e.description}),e.examples&&e.examples.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-xs font-medium text-gray-700",children:"Examples:"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.examples.map((e,s)=>(0,t.jsx)(R.Ct,{color:"gray",size:"xs",children:e},s))})]})]},e.id))})]}),el.supportsAuthenticatedExtendedCard&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Additional Features"}),(0,t.jsx)(R.Ct,{color:"green",children:"Supports Authenticated Extended Card"})]})]})}),(0,t.jsx)(g.Z,{title:(null==eo?void 0:eo.server_name)||"MCP Server Details",width:1e3,visible:em,footer:null,onOk:eN,onCancel:ef,children:eo&&(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Server Name:"}),(0,t.jsx)(R.xv,{children:eo.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Server ID:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(R.xv,{className:"text-xs truncate",children:eo.server_id}),(0,t.jsx)(d.Z,{onClick:()=>ey(eo.server_id),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]}),eo.alias&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Alias:"}),(0,t.jsx)(R.xv,{children:eo.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Transport:"}),(0,t.jsx)(R.Ct,{color:"blue",children:eo.transport})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Auth Type:"}),(0,t.jsx)(R.Ct,{color:"none"===eo.auth_type?"gray":"green",children:eo.auth_type})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Status:"}),(0,t.jsx)(R.Ct,{color:"active"===eo.status||"healthy"===eo.status?"green":"inactive"===eo.status||"unhealthy"===eo.status?"red":"gray",children:eo.status||"unknown"})]})]}),eo.description&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Description:"}),(0,t.jsx)(R.xv,{className:"mt-1",children:eo.description})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Connection Details"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"URL:"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,t.jsx)(R.xv,{className:"text-sm break-all bg-gray-100 p-2 rounded flex-1",children:eo.url}),(0,t.jsx)(d.Z,{onClick:()=>ey(eo.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 flex-shrink-0"})]})]}),eo.command&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Command:"}),(0,t.jsx)(R.xv,{className:"text-sm bg-gray-100 p-2 rounded mt-1 font-mono",children:eo.command})]})]})]}),eo.allowed_tools&&eo.allowed_tools.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Allowed Tools"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.allowed_tools.map((e,s)=>(0,t.jsx)(R.Ct,{color:"purple",children:e},s))})]}),eo.teams&&eo.teams.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.teams.map((e,s)=>(0,t.jsx)(R.Ct,{color:"blue",children:e},s))})]}),eo.mcp_access_groups&&eo.mcp_access_groups.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Access Groups"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.mcp_access_groups.map((e,s)=>(0,t.jsx)(R.Ct,{color:"green",children:e},s))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Metadata"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Created By:"}),(0,t.jsx)(R.xv,{children:eo.created_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Updated By:"}),(0,t.jsx)(R.xv,{children:eo.updated_by})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Created At:"}),(0,t.jsx)(R.xv,{className:"text-sm",children:new Date(eo.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Updated At:"}),(0,t.jsx)(R.xv,{className:"text-sm",children:new Date(eo.updated_at).toLocaleString()})]}),eo.last_health_check&&(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"font-medium",children:"Last Health Check:"}),(0,t.jsx)(R.xv,{className:"text-sm",children:new Date(eo.last_health_check).toLocaleString()})]})]}),eo.health_check_error&&(0,t.jsxs)("div",{className:"mt-2 p-2 bg-red-50 rounded",children:[(0,t.jsx)(R.xv,{className:"font-medium text-red-700",children:"Health Check Error:"}),(0,t.jsx)(R.xv,{className:"text-sm text-red-600 mt-1",children:eo.health_check_error})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(R.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,t.jsx)(W.Z,{language:"python",className:"text-sm",children:'from fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eo.server_name,'": {\n "url": "http://localhost:4000/').concat(eo.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())')})]})]})}),(0,t.jsx)(C,{visible:J,onClose:()=>q(!1),accessToken:h||"",modelHubData:w||[],onSuccess:()=>{h&&(async()=>{try{let e=await (0,v.modelHubCall)(h);S(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}}),(0,t.jsx)(f,{visible:Q,onClose:()=>X(!1),accessToken:h||"",agentHubData:G||[],onSuccess:()=>{h&&(async()=>{try{let e=(await (0,v.getAgentsList)(h)).agents.map(e=>({agent_id:e.agent_id,...e.agent_card_params,is_public:e.is_public}));$(e)}catch(e){console.error("Error refreshing agent data:",e)}})()}}),(0,t.jsx)(_,{visible:eh,onClose:()=>ep(!1),accessToken:h||"",mcpHubData:en||[],onSuccess:()=>{h&&(async()=>{try{let e=await (0,v.fetchMCPServers)(h);ei(e)}catch(e){console.error("Error refreshing MCP server data:",e)}})()}})]})}},39957:function(e,s,l){l.d(s,{Z:function(){return g}});var t=l(57437),a=l(53410),r=l(74998),n=l(91126),i=l(23628),c=l(44633),d=l(86462),o=l(3477),x=l(99981),m=l(10012),u=l(58927);function h(e){let{icon:s,onClick:l,className:a,disabled:r,dataTestId:n}=e;return r?(0,t.jsx)(u.J,{icon:s,size:"sm",className:"opacity-50 cursor-not-allowed","data-testid":n}):(0,t.jsx)(u.J,{icon:s,size:"sm",onClick:l,className:(0,m.cx)("cursor-pointer",a),"data-testid":n})}l(2265);let p={Edit:{icon:a.Z,className:"hover:text-blue-600"},Delete:{icon:r.Z,className:"hover:text-red-600"},Test:{icon:n.Z,className:"hover:text-blue-600"},Regenerate:{icon:i.Z,className:"hover:text-green-600"},Up:{icon:c.Z,className:"hover:text-blue-600"},Down:{icon:d.Z,className:"hover:text-blue-600"},Open:{icon:o.Z,className:"hover:text-green-600"}};function g(e){let{onClick:s,tooltipText:l,disabled:a=!1,disabledTooltipText:r,dataTestId:n,variant:i}=e,{icon:c,className:d}=p[i];return(0,t.jsx)(x.Z,{title:a?r:l,children:(0,t.jsx)("span",{children:(0,t.jsx)(h,{icon:c,onClick:s,className:d,disabled:a,dataTestId:n})})})}},10012:function(e,s,l){l.d(s,{cx:function(){return n}});var t=l(49096),a=l(53335);let{cva:r,cx:n,compose:i}=(0,t.ZD)({hooks:{onComplete:e=>(0,a.m6)(e)}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4242-1670159d75c167a5.js b/litellm/proxy/_experimental/out/_next/static/chunks/4242-1670159d75c167a5.js deleted file mode 100644 index 2ea5928e269..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/4242-1670159d75c167a5.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4242],{34310:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM472 744a40 40 0 1080 0 40 40 0 10-80 0zm16-104h48c4.4 0 8-3.6 8-8V448c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v184c0 4.4 3.6 8 8 8z"}}]},name:"file-exclamation",theme:"outlined"},s=r(55015),a=i.forwardRef(function(e,t){return i.createElement(s.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},38434:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},s=r(55015),a=i.forwardRef(function(e,t){return i.createElement(s.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},3632:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},s=r(55015),a=i.forwardRef(function(e,t){return i.createElement(s.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},35291:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"},s=r(55015),a=i.forwardRef(function(e,t){return i.createElement(s.Z,(0,n.Z)({},e,{ref:t,icon:o}))})},41649:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(5853),i=r(2265),o=r(47187),s=r(7084),a=r(26898),l=r(13241),u=r(1153);let c={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},d={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},f=(0,u.fn)("Badge"),h=i.forwardRef((e,t)=>{let{color:r,icon:h,size:p=s.u8.SM,tooltip:m,className:g,children:y}=e,v=(0,n._T)(e,["color","icon","size","tooltip","className","children"]),b=h||null,{tooltipProps:_,getReferenceProps:k}=(0,o.l)();return i.createElement("span",Object.assign({ref:(0,u.lq)([t,_.refs.setReference]),className:(0,l.q)(f("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",r?(0,l.q)((0,u.bM)(r,a.K.background).bgColor,(0,u.bM)(r,a.K.iconText).textColor,(0,u.bM)(r,a.K.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):(0,l.q)("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),c[p].paddingX,c[p].paddingY,c[p].fontSize,g)},k,v),i.createElement(o.Z,Object.assign({text:m},_)),b?i.createElement(b,{className:(0,l.q)(f("icon"),"shrink-0 -ml-1 mr-1.5",d[p].height,d[p].width)}):null,i.createElement("span",{className:(0,l.q)(f("text"),"whitespace-nowrap")},y))});h.displayName="Badge"},30150:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var n=r(5853),i=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return i.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),i.createElement("path",{d:"M12 4v16m8-8H4"}))},s=e=>{var t=(0,n._T)(e,[]);return i.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),i.createElement("path",{d:"M20 12H4"}))};var a=r(13241),l=r(1153),u=r(69262);let c="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",d="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",f=i.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:f=!0,disabled:h,onValueChange:p,onChange:m}=e,g=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),y=(0,i.useRef)(null),[v,b]=i.useState(!1),_=i.useCallback(()=>{b(!0)},[]),k=i.useCallback(()=>{b(!1)},[]),[w,E]=i.useState(!1),x=i.useCallback(()=>{E(!0)},[]),C=i.useCallback(()=>{E(!1)},[]);return i.createElement(u.Z,Object.assign({type:"number",ref:(0,l.lq)([y,t]),disabled:h,makeInputClassName:(0,l.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=y.current)||void 0===t?void 0:t.value;null==r||r(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&_(),"ArrowUp"===e.key&&x()},onKeyUp:e=>{"ArrowDown"===e.key&&k(),"ArrowUp"===e.key&&C()},onChange:e=>{h||(null==p||p(parseFloat(e.target.value)),null==m||m(e))},stepper:f?i.createElement("div",{className:(0,a.q)("flex justify-center align-middle")},i.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;h||(null===(e=y.current)||void 0===e||e.stepDown(),null===(t=y.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,a.q)(!h&&d,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},i.createElement(s,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),i.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;h||(null===(e=y.current)||void 0===e||e.stepUp(),null===(t=y.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,a.q)(!h&&d,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},i.createElement(o,{"data-testid":"step-up",className:(w?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},g))});f.displayName="NumberInput"},87452:function(e,t,r){"use strict";r.d(t,{Z:function(){return d},r:function(){return c}});var n=r(5853),i=r(91054);r(42698),r(64016);var o=r(8710);r(33232);var s=r(13241),a=r(1153),l=r(2265);let u=(0,a.fn)("Accordion"),c=(0,l.createContext)({isOpen:!1}),d=l.forwardRef((e,t)=>{var r;let{defaultOpen:a=!1,children:d,className:f}=e,h=(0,n._T)(e,["defaultOpen","children","className"]),p=null!==(r=(0,l.useContext)(o.Z))&&void 0!==r?r:(0,s.q)("rounded-tremor-default border");return l.createElement(i.pJ,Object.assign({as:"div",ref:t,className:(0,s.q)(u("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",p,f),defaultOpen:a},h),e=>{let{open:t}=e;return l.createElement(c.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(5853),i=r(2265),o=r(91054),s=r(13241);let a=(0,r(1153).fn)("AccordionBody"),l=i.forwardRef((e,t)=>{let{children:r,className:l}=e,u=(0,n._T)(e,["children","className"]);return i.createElement(o.pJ.Panel,Object.assign({ref:t,className:(0,s.q)(a("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",l)},u),r)});l.displayName="AccordionBody"},72208:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(5853),i=r(2265),o=r(91054);let s=e=>{var t=(0,n._T)(e,[]);return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),i.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var a=r(87452),l=r(13241);let u=(0,r(1153).fn)("AccordionHeader"),c=i.forwardRef((e,t)=>{let{children:r,className:c}=e,d=(0,n._T)(e,["children","className"]),{isOpen:f}=(0,i.useContext)(a.r);return i.createElement(o.pJ.Button,Object.assign({ref:t,className:(0,l.q)(u("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",c)},d),i.createElement("div",{className:(0,l.q)(u("children"),"flex flex-1 text-inherit mr-4")},r),i.createElement("div",null,i.createElement(s,{className:(0,l.q)(u("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",f?"transition-all":"transition-all -rotate-180")})))});c.displayName="AccordionHeader"},30401:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("copy",[["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"}]])},15452:function(e,t){var r,n,i;n=[],void 0!==(i="function"==typeof(r=function e(){var t,r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:{},n=!r.document&&!!r.postMessage,i=r.IS_PAPA_WORKER||!1,o={},s=0,a={};function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new h(t),(this._handle.streamer=this)._config=t}).call(this,e),this.parseChunk=function(e,t){var n=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0=this._config.preview,i)r.postMessage({results:o,workerId:a.WORKER_ID,finished:n});else if(k(this._config.chunk)&&!t){if(this._config.chunk(o,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=o=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(o.data),this._completeResults.errors=this._completeResults.errors.concat(o.errors),this._completeResults.meta=o.meta),this._completed||!n||!k(this._config.complete)||o&&o.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||o&&o.meta.paused||this._nextChunk(),o}this._halted=!0},this._sendError=function(e){k(this._config.error)?this._config.error(e):i&&this._config.error&&r.postMessage({workerId:a.WORKER_ID,error:e,finished:!1})}}function u(e){var t;(e=e||{}).chunkSize||(e.chunkSize=a.RemoteChunkSize),l.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),n||(t.onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e,r,i=this._config.downloadRequestHeaders;for(r in i)t.setRequestHeader(r,i[r])}this._config.chunkSize&&(e=this._start+this._config.chunkSize-1,t.setRequestHeader("Range","bytes="+this._start+"-"+e));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===t.status&&this._chunkError()}},this._chunkLoaded=function(){let e;4===t.readyState&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(null!==(e=(e=t).getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function c(e){(e=e||{}).chunkSize||(e.chunkSize=a.LocalChunkSize),l.call(this,e);var t,r,n="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,n?((t=new FileReader).onload=_(this._chunkLoaded,this),t.onerror=_(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function d(e){var t;l.call(this,e=e||{}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,r;if(!this._finished)return t=(e=this._config.chunkSize)?(r=t.substring(0,e),t.substring(e)):(r=t,""),this._finished=!t,this.parseChunk(r)}}function f(e){l.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){n&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r=!0},this._streamData=_(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),r&&(r=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=_(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=_(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=_(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function h(e){var t,r,n,i,o=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,s=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,u=0,c=0,d=!1,f=!1,h=[],g={data:[],errors:[],meta:{}};function y(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function v(){if(g&&n&&(w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!y(e)})),_()){if(g){if(Array.isArray(g.data[0])){for(var t,r=0;_()&&r=h.length?"__parsed_extra":h[i]:a,u=l=e.transform?e.transform(l,a):l,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===u||"TRUE"===u||"false"!==u&&"FALSE"!==u&&((e=>{if(o.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(u)?parseFloat(u):s.test(u)?new Date(u):""===u?null:u):u);"__parsed_extra"===a?(n[a]=n[a]||[],n[a].push(l)):n[a]=l}return e.header&&(i>h.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+h.length+" fields but parsed "+i,c+r):ie.preview?r.abort():(g.data=g.data[0],i(g,l))))}),this.parse=function(i,o,s){var l=e.quoteChar||'"',l=(e.newline||(e.newline=this.guessLineEndings(i,l)),n=!1,e.delimiter?k(e.delimiter)&&(e.delimiter=e.delimiter(i),g.meta.delimiter=e.delimiter):((l=((t,r,n,i,o)=>{var s,l,u,c;o=o||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var d=0;d=r.length/2?"\r\n":"\r"}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(e){var t=(e=e||{}).delimiter,r=e.newline,n=e.comments,i=e.step,o=e.preview,s=e.fastMode,l=null,u=!1,c=null==e.quoteChar?'"':e.quoteChar,d=c;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof t||-1=o)return N(!0);break}x.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:E.length,index:f}),T++}}else if(n&&0===C.length&&a.substring(f,f+_)===n){if(-1===D)return N();f=D+b,D=a.indexOf(r,f),I=a.indexOf(t,f)}else if(-1!==I&&(I=o)return N(!0)}return z();function P(e){E.push(e),O=f}function M(e){return -1!==e&&(e=a.substring(T+1,e))&&""===e.trim()?e.length:0}function z(e){return g||(void 0===e&&(e=a.substring(f)),C.push(e),f=y,P(C),w&&F()),N()}function A(e){f=e,P(C),C=[],D=a.indexOf(r,f)}function N(n){if(e.header&&!m&&E.length&&!u){var i=E[0],o=Object.create(null),s=new Set(i);let t=!1;for(let r=0;r{if("object"==typeof t){if("string"!=typeof t.delimiter||a.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(i=t.delimiter),("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(r=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(u=t.skipEmptyLines),"string"==typeof t.newline&&(o=t.newline),"string"==typeof t.quoteChar&&(s=t.quoteChar),"boolean"==typeof t.header&&(n=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");c=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+s),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),RegExp(p(s),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return h(null,e,u);if("object"==typeof e[0])return h(c||Object.keys(e[0]),e,u)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||c),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),h(e.fields||[],e.data||[],u);throw Error("Unable to serialize unrecognized input");function h(e,t,r){var s="",a=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0{for(var r=0;r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,s),n=i.default.Children.only(t);return i.default.cloneElement(n,u(u({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r({...e,disclosureState:(0,y.E)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},2:(e,t)=>e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId},3:(e,t)=>e.panelId===t.panelId?e:{...e,panelId:t.panelId},4:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},5:(e,t)=>e.panelElement===t.element?e:{...e,panelElement:t.element}},C=(0,l.createContext)(null);function O(e){let t=(0,l.useContext)(C);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,O),t}return t}C.displayName="DisclosureContext";let S=(0,l.createContext)(null);S.displayName="DisclosureAPIContext";let R=(0,l.createContext)(null);function I(e,t){return(0,y.E)(t.type,x,e,t)}R.displayName="DisclosurePanelContext";let D=l.Fragment,j=b.VN.RenderStrategy|b.VN.Static,T=Object.assign((0,b.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,i=(0,l.useRef)(null),o=(0,f.T)(t,(0,f.h)(e=>{i.current=e},void 0===e.as||e.as===l.Fragment)),s=(0,l.useReducer)(I,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:a,buttonId:u},d]=s,h=(0,c.z)(e=>{d({type:1});let t=(0,v.r)(i);if(!t||!u)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(u):t.getElementById(u);null==r||r.focus()}),g=(0,l.useMemo)(()=>({close:h}),[h]),_=(0,l.useMemo)(()=>({open:0===a,close:h}),[a,h]),k=(0,b.L6)();return l.createElement(C.Provider,{value:s},l.createElement(S.Provider,{value:g},l.createElement(p.Z,{value:h},l.createElement(m.up,{value:(0,y.E)(a,{0:m.ZM.Open,1:m.ZM.Closed})},k({ourProps:{ref:o},theirProps:n,slot:_,defaultTag:D,name:"Disclosure"})))))}),{Button:(0,b.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:i=!1,autoFocus:o=!1,...h}=e,[p,m]=O("Disclosure.Button"),y=(0,l.useContext)(R),v=null!==y&&y===p.panelId,_=(0,l.useRef)(null),w=(0,f.T)(_,t,(0,c.z)(e=>{if(!v)return m({type:4,element:e})}));(0,l.useEffect)(()=>{if(!v)return m({type:2,buttonId:n}),()=>{m({type:2,buttonId:null})}},[n,m,v]);let E=(0,c.z)(e=>{var t;if(v){if(1===p.disclosureState)return;switch(e.key){case k.R.Space:case k.R.Enter:e.preventDefault(),e.stopPropagation(),m({type:0}),null==(t=p.buttonElement)||t.focus()}}else switch(e.key){case k.R.Space:case k.R.Enter:e.preventDefault(),e.stopPropagation(),m({type:0})}}),x=(0,c.z)(e=>{e.key===k.R.Space&&e.preventDefault()}),C=(0,c.z)(e=>{var t;(0,g.P)(e.currentTarget)||i||(v?(m({type:0}),null==(t=p.buttonElement)||t.focus()):m({type:0}))}),{isFocusVisible:S,focusProps:I}=(0,s.F)({autoFocus:o}),{isHovered:D,hoverProps:j}=(0,a.X)({isDisabled:i}),{pressed:T,pressProps:L}=(0,u.x)({disabled:i}),P=(0,l.useMemo)(()=>({open:0===p.disclosureState,hover:D,active:T,disabled:i,focus:S,autofocus:o}),[p,D,T,S,i,o]),M=(0,d.f)(e,p.buttonElement),z=v?(0,b.dG)({ref:w,type:M,disabled:i||void 0,autoFocus:o,onKeyDown:E,onClick:C},I,j,L):(0,b.dG)({ref:w,id:n,type:M,"aria-expanded":0===p.disclosureState,"aria-controls":p.panelElement?p.panelId:void 0,disabled:i||void 0,autoFocus:o,onKeyDown:E,onKeyUp:x,onClick:C},I,j,L);return(0,b.L6)()({ourProps:z,theirProps:h,slot:P,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,b.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:i=!1,...o}=e,[s,a]=O("Disclosure.Panel"),{close:u}=function e(t){let r=(0,l.useContext)(S);if(null===r){let r=Error("<".concat(t," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(r,e),r}return r}("Disclosure.Panel"),[d,p]=(0,l.useState)(null),g=(0,f.T)(t,(0,c.z)(e=>{_(()=>a({type:5,element:e}))}),p);(0,l.useEffect)(()=>(a({type:3,panelId:n}),()=>{a({type:3,panelId:null})}),[n,a]);let y=(0,m.oJ)(),[v,k]=(0,h.Y)(i,d,null!==y?(y&m.ZM.Open)===m.ZM.Open:0===s.disclosureState),w=(0,l.useMemo)(()=>({open:0===s.disclosureState,close:u}),[s.disclosureState,u]),E={ref:g,id:n,...(0,h.X)(k)},x=(0,b.L6)();return l.createElement(m.uu,null,l.createElement(R.Provider,{value:s.panelId},x({ourProps:E,theirProps:o,slot:w,defaultTag:"div",features:j,visible:v,name:"Disclosure.Panel"})))})})},33443:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(2265);let i=(0,n.createContext)(()=>{});function o(e){let{value:t,children:r}=e;return n.createElement(i.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4375-5cfcda7839272f23.js b/litellm/proxy/_experimental/out/_next/static/chunks/4375-5cfcda7839272f23.js deleted file mode 100644 index ad1a2542b3b..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/4375-5cfcda7839272f23.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4375],{58643:function(e,l,t){t.d(l,{OK:function(){return s.Z},nP:function(){return n.Z},td:function(){return r.Z},v0:function(){return a.Z},x4:function(){return i.Z}});var s=t(12485),a=t(18135),r=t(35242),i=t(29706),n=t(77991)},55584:function(e,l,t){t.d(l,{L:function(){return o}});var s=t(19250),a=t(11713),r=t(90246),i=t(39760);let n=(0,r.n)("uiSettings"),o=()=>{let{accessToken:e}=(0,i.Z)();return(0,a.a)({queryKey:n.list({}),queryFn:async()=>await (0,s.getUiSettings)(e),enabled:!!e,staleTime:36e5,gcTime:36e5})}},64375:function(e,l,t){t.d(l,{Z:function(){return lU}});var s=t(57437),a=t(19250),r=t(11713),i=t(90246),n=t(39760);let o=(0,i.n)("credentials"),d=()=>{let{accessToken:e}=(0,n.Z)();return(0,r.a)({queryKey:o.list({}),queryFn:async()=>await (0,a.credentialListCall)(e),enabled:!!e})},c=(0,i.n)("modelCostMap"),m=()=>(0,r.a)({queryKey:c.list({}),queryFn:async()=>await (0,a.modelCostMap)(),staleTime:6e4,gcTime:6e4}),u=(0,i.n)("models");(0,i.n)("modelHub");let h=()=>{let{accessToken:e,userId:l,userRole:t}=(0,n.Z)();return(0,r.a)({queryKey:u.list({filters:{...l&&{userId:l},...t&&{userRole:t}}}),queryFn:async()=>await (0,a.modelInfoCall)(e,l,t),enabled:!!(e&&l&&t)})};var x=t(55584),p=t(47359),g=t(8048),f=t(45589),j=t(74998),v=t(41649),_=t(78489),y=t(47323),b=t(99981),N=t(2265),w=t(42673);let Z=e=>{let{provider:l,className:t="w-4 h-4"}=e,[a,r]=(0,N.useState)(!1),{logo:i}=(0,w.dr)(l);return a||!i?(0,s.jsx)("div",{className:"".concat(t," rounded-full bg-gray-200 flex items-center justify-center text-xs"),children:(null==l?void 0:l.charAt(0))||"-"}):(0,s.jsx)("img",{src:i,alt:"".concat(l," logo"),className:t,onError:()=>r(!0)})},C=(e,l,t,a,r,i,n,o,d,c)=>[{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model ID"}),accessorKey:"model_info.id",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(b.Z,{title:t.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>a(t.model_info.id),children:t.model_info.id})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Information"}),accessorKey:"model_name",size:250,cell:e=>{let{row:l}=e,t=l.original,a=i(l.original)||"-",r=(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Provider:"})," ",t.provider||"-"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"Public Model Name:"})," ",a]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"LiteLLM Model Name:"})," ",t.litellm_model_name||"-"]})]});return(0,s.jsx)(b.Z,{title:r,children:(0,s.jsxs)("div",{className:"flex items-start space-x-2 min-w-0 w-full max-w-[250px]",children:[(0,s.jsx)("div",{className:"flex-shrink-0 mt-0.5",children:t.provider?(0,s.jsx)(Z,{provider:t.provider}):(0,s.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,s.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate max-w-[210px]",children:a}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5 max-w-[210px]",children:t.litellm_model_name||"-"})]})]})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Credentials"}),accessorKey:"litellm_credential_name",size:180,cell:e=>{var l;let{row:t}=e,a=null===(l=t.original.litellm_params)||void 0===l?void 0:l.litellm_credential_name;return a?(0,s.jsx)(b.Z,{title:"Credential: ".concat(a),children:(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs truncate",title:a,children:a})]})}):(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4 text-gray-300 flex-shrink-0"}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"No credentials"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Created By"}),accessorKey:"model_info.created_by",sortingFn:"datetime",size:160,cell:e=>{var l;let{row:t}=e,a=t.original,r=!(null===(l=a.model_info)||void 0===l?void 0:l.db_model),i=a.model_info.created_by,n=a.model_info.created_at?new Date(a.model_info.created_at).toLocaleDateString():null;return(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[160px]",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-gray-900 truncate",title:r?"Defined in config":i||"Unknown",children:r?"Defined in config":i||"Unknown"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 truncate mt-0.5",title:r?"Config file":n||"Unknown date",children:r?"-":n||"Unknown date"})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Updated At"}),accessorKey:"model_info.updated_at",sortingFn:"datetime",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("span",{className:"text-xs",children:t.model_info.updated_at?new Date(t.model_info.updated_at).toLocaleDateString():"-"})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Costs"}),accessorKey:"input_cost",size:120,cell:e=>{let{row:l}=e,t=l.original,a=t.input_cost,r=t.output_cost;return a||r?(0,s.jsx)(b.Z,{title:"Cost per 1M tokens",children:(0,s.jsxs)("div",{className:"flex flex-col min-w-0 max-w-[120px]",children:[a&&(0,s.jsxs)("div",{className:"text-xs font-medium text-gray-900 truncate",children:["In: $",a]}),r&&(0,s.jsxs)("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:["Out: $",r]})]})}):(0,s.jsx)("div",{className:"max-w-[120px]",children:(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"-"})})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Team ID"}),accessorKey:"model_info.team_id",cell:e=>{let{row:l}=e,t=l.original;return t.model_info.team_id?(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(b.Z,{title:t.model_info.team_id,children:(0,s.jsxs)(_.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>r(t.model_info.team_id),children:[t.model_info.team_id.slice(0,7),"..."]})})}):"-"}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Model Access Group"}),accessorKey:"model_info.model_access_group",enableSorting:!1,cell:e=>{let{row:l}=e,t=l.original,a=t.model_info.access_groups;if(!a||0===a.length)return"-";let r=t.model_info.id,i=d.has(r),n=a.length>1,o=()=>{let e=new Set(d);i?e.delete(r):e.add(r),c(e)};return(0,s.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,s.jsx)(v.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:a[0]}),(i||!n&&2===a.length)&&a.slice(1).map((e,l)=>(0,s.jsx)(v.Z,{size:"xs",color:"blue",className:"text-xs px-1.5 py-0.5 h-5 leading-tight flex-shrink-0",children:e},l+1)),n&&(0,s.jsx)("button",{onClick:e=>{e.stopPropagation(),o()},className:"text-xs text-blue-600 hover:text-blue-800 px-1 py-0.5 rounded hover:bg-blue-50 h-5 leading-tight flex-shrink-0 whitespace-nowrap",children:i?"−":"+".concat(a.length-1)})]})}},{header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Status"}),accessorKey:"model_info.db_model",cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)("div",{className:"\n inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium\n ".concat(t.model_info.db_model?"bg-blue-50 text-blue-600":"bg-gray-100 text-gray-600","\n "),children:t.model_info.db_model?"DB Model":"Config Model"})}},{id:"actions",header:()=>(0,s.jsx)("span",{className:"text-sm font-semibold",children:"Actions"}),cell:t=>{var r,i;let{row:n}=t,o=n.original,d="Admin"===e||(null===(r=o.model_info)||void 0===r?void 0:r.created_by)===l,c=!(null===(i=o.model_info)||void 0===i?void 0:i.db_model);return(0,s.jsx)("div",{className:"flex items-center justify-end gap-2 pr-4",children:c?(0,s.jsx)(b.Z,{title:"Config model cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,s.jsx)(y.Z,{icon:j.Z,size:"sm",className:"opacity-50 cursor-not-allowed"})}):(0,s.jsx)(b.Z,{title:"Delete model",children:(0,s.jsx)(y.Z,{icon:j.Z,size:"sm",onClick:()=>{d&&a(o.model_info.id)},className:d?"cursor-pointer hover:text-red-600":"opacity-50 cursor-not-allowed"})})})}}],k=e=>{var l;return(null==e?void 0:null===(l=e.model_info)||void 0===l?void 0:l.team_public_model_name)?e.model_info.team_public_model_name:(null==e?void 0:e.model_name)||"-"};var S=t(15424),A=t(67101),E=t(27281),P=t(57365),F=t(29706),L=t(84264);let M=(e,l)=>{if(!(null==e?void 0:e.data))return{data:[]};let t=JSON.parse(JSON.stringify(e.data));for(let e=0;e{let[l]=e;return"model"!==l&&"api_base"!==l}))),t[e].provider=c,t[e].input_cost=m,t[e].output_cost=u,t[e].litellm_model_name=n,t[e].input_cost&&(t[e].input_cost=(1e6*Number(t[e].input_cost)).toFixed(2)),t[e].output_cost&&(t[e].output_cost=(1e6*Number(t[e].output_cost)).toFixed(2)),t[e].max_tokens=h,t[e].max_input_tokens=x,t[e].api_base=null==i?void 0:null===(r=i.litellm_params)||void 0===r?void 0:r.api_base,t[e].cleanedLitellmParams=p}return{data:t}};var I=t(50337),T=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,availableModelAccessGroups:r,setSelectedModelId:i,setSelectedTeamId:o}=e,{data:d,isLoading:c}=h(),{data:u,isLoading:x}=m(),{userId:f,userRole:j,premiumUser:v}=(0,n.Z)(),{data:_}=(0,p.y)(),y=e=>null!=u&&"object"==typeof u&&e in u?u[e].litellm_provider:"openai",b=(0,N.useMemo)(()=>d?M(d,y):{data:[]},[d,u]),[w,Z]=(0,N.useState)(""),[T,R]=(0,N.useState)("current_team"),[O,q]=(0,N.useState)("personal"),[V,D]=(0,N.useState)(!1),[z,B]=(0,N.useState)(null),[U,G]=(0,N.useState)(new Set),[H,K]=(0,N.useState)({pageIndex:0,pageSize:50}),J=c||x,W=(0,N.useMemo)(()=>b&&b.data&&0!==b.data.length?b.data.filter(e=>{var t,s,a,r,i,n;let o=""===w||e.model_name.toLowerCase().includes(w.toLowerCase()),d="all"===l||e.model_name===l||!l||"wildcard"===l&&(null===(t=e.model_name)||void 0===t?void 0:t.includes("*")),c="all"===z||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(z))||!z,m=!0;if("current_team"===T){if("personal"===O)m=(null===(a=e.model_info)||void 0===a?void 0:a.direct_access)===!0;else{let l=(null===(i=e.model_info)||void 0===i?void 0:null===(r=i.access_via_team_ids)||void 0===r?void 0:r.includes(O.team_id))===!0,t=(null===(n=O.models)||void 0===n?void 0:n.some(l=>{var t,s;return null===(s=e.model_info)||void 0===s?void 0:null===(t=s.access_groups)||void 0===t?void 0:t.includes(l)}))===!0;m=l||t}}return o&&d&&c&&m}):[],[b,w,l,z,O,T]);return(0,N.useEffect)(()=>{K(e=>({...e,pageIndex:0}))},[w,l,z,O,T]),(0,s.jsx)(F.Z,{children:(0,s.jsx)(A.Z,{children:(0,s.jsx)("div",{className:"flex flex-col space-y-4",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,s.jsxs)("div",{className:"border-b px-6 py-4 bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(L.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),J?(0,s.jsx)(I.Z.Input,{active:!0,style:{width:320,height:36}}):(0,s.jsxs)(E.Z,{className:"w-80",defaultValue:"personal",value:"personal"===O?"personal":O.team_id,onValueChange:e=>{if("personal"===e)q("personal");else{let l=null==_?void 0:_.find(l=>l.team_id===e);l&&q(l)}},children:[(0,s.jsx)(P.Z,{value:"personal",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Personal"})]})}),null==_?void 0:_.filter(e=>e.team_id).map(e=>(0,s.jsx)(P.Z,{value:e.team_id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:e.team_alias?"".concat(e.team_alias.slice(0,30),"..."):"Team ".concat(e.team_id.slice(0,30),"...")})]})},e.team_id))]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)(L.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),J?(0,s.jsx)(I.Z.Input,{active:!0,style:{width:256,height:36}}):(0,s.jsxs)(E.Z,{className:"w-64",defaultValue:"current_team",value:T,onValueChange:e=>R(e),children:[(0,s.jsx)(P.Z,{value:"current_team",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-purple-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"Current Team Models"})]})}),(0,s.jsx)(P.Z,{value:"all",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-gray-500 rounded-full"}),(0,s.jsx)("span",{className:"font-medium",children:"All Available Models"})]})})]})]})]}),"current_team"===T&&(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,s.jsx)(S.Z,{className:"text-gray-400 mt-0.5 flex-shrink-0 text-xs"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"personal"===O?(0,s.jsxs)("span",{children:["To access these models: Create a Virtual Key without selecting a team on the"," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]}):(0,s.jsxs)("span",{children:['To access these models: Create a Virtual Key and select Team as "',"string"!=typeof O?O.team_alias||O.team_id:"",'" on the'," ",(0,s.jsx)("a",{href:"/public?login=success&page=api-keys",className:"text-gray-600 hover:text-gray-800 underline",children:"Virtual Keys page"})]})})]})]}),(0,s.jsx)("div",{className:"border-b px-6 py-4",children:(0,s.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("div",{className:"relative w-64",children:[(0,s.jsx)("input",{type:"text",placeholder:"Search model names...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:w,onChange:e=>Z(e.target.value)}),(0,s.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(V?"bg-gray-100":""),onClick:()=>D(!V),children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters"]}),(0,s.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{Z(""),t("all"),B(null),q("personal"),R("current_team"),K({pageIndex:0,pageSize:50})},children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),V&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(E.Z,{value:null!=l?l:"all",onValueChange:e=>t("all"===e?"all":e),placeholder:"Filter by Public Model Name",children:[(0,s.jsx)(P.Z,{value:"all",children:"All Models"}),(0,s.jsx)(P.Z,{value:"wildcard",children:"Wildcard Models (*)"}),a.map((e,l)=>(0,s.jsx)(P.Z,{value:e,children:e},l))]})}),(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(E.Z,{value:null!=z?z:"all",onValueChange:e=>B("all"===e?null:e),placeholder:"Filter by Model Access Group",children:[(0,s.jsx)(P.Z,{value:"all",children:"All Model Access Groups"}),r.map((e,l)=>(0,s.jsx)(P.Z,{value:e,children:e},l))]})})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[J?(0,s.jsx)(I.Z.Input,{active:!0,style:{width:184,height:20}}):(0,s.jsx)("span",{className:"text-sm text-gray-700",children:W.length>0?"Showing ".concat(H.pageIndex*H.pageSize+1," - ").concat(Math.min((H.pageIndex+1)*H.pageSize,W.length)," of ").concat(W.length," results"):"Showing 0 results"}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[J?(0,s.jsx)(I.Z.Button,{active:!0,style:{width:84,height:30}}):(0,s.jsx)("button",{onClick:()=>K(e=>({...e,pageIndex:e.pageIndex-1})),disabled:0===H.pageIndex,className:"px-3 py-1 text-sm border rounded-md ".concat(0===H.pageIndex?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),J?(0,s.jsx)(I.Z.Button,{active:!0,style:{width:56,height:30}}):(0,s.jsx)("button",{onClick:()=>K(e=>({...e,pageIndex:e.pageIndex+1})),disabled:H.pageIndex>=Math.ceil(W.length/H.pageSize)-1,className:"px-3 py-1 text-sm border rounded-md ".concat(H.pageIndex>=Math.ceil(W.length/H.pageSize)-1?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,s.jsx)(g.C,{columns:C(j,f,v,i,o,k,()=>{},()=>{},U,G),data:W,isLoading:!1,pagination:H,onPaginationChange:K,enablePagination:!0})]})})})})},R=t(96761),O=t(19015);let q={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var V=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,globalRetryPolicy:r,setGlobalRetryPolicy:i,defaultRetry:n,modelGroupRetryPolicy:o,setModelGroupRetryPolicy:d,handleSaveRetrySettings:c}=e;return(0,s.jsxs)(F.Z,{children:[(0,s.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(L.Z,{children:"Retry Policy Scope:"}),(0,s.jsxs)(E.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===l?"global":l||a[0],onValueChange:e=>t(e),children:[(0,s.jsx)(P.Z,{value:"global",children:"Global Default"}),a.map((e,l)=>(0,s.jsx)(P.Z,{value:e,onClick:()=>t(e),children:e},l))]})]})}),"global"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(R.Z,{children:"Global Retry Policy"}),(0,s.jsx)(L.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(R.Z,{children:["Retry Policy for ",l]}),(0,s.jsx)(L.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),q&&(0,s.jsx)("table",{children:(0,s.jsx)("tbody",{children:Object.entries(q).map((e,t)=>{var a,c,m,u;let h,[x,p]=e;if("global"===l)h=null!==(a=null==r?void 0:r[p])&&void 0!==a?a:n;else{let e=null==o?void 0:null===(c=o[l])||void 0===c?void 0:c[p];h=null!=e?e:null!==(m=null==r?void 0:r[p])&&void 0!==m?m:n}return(0,s.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)(L.Z,{children:x}),"global"!==l&&(0,s.jsxs)(L.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(u=null==r?void 0:r[p])&&void 0!==u?u:n,")"]})]}),(0,s.jsx)("td",{children:(0,s.jsx)(O.Z,{className:"ml-5",value:h,min:0,step:1,onChange:e=>{"global"===l?i(l=>null==e?l:{...null!=l?l:{},[p]:e}):d(t=>{var s;let a=null!==(s=null==t?void 0:t[l])&&void 0!==s?s:{};return{...null!=t?t:{},[l]:{...a,[p]:e}}})}})})]},t)})})}),(0,s.jsx)(_.Z,{className:"mt-6 mr-8",onClick:c,children:"Save"})]})},D=t(57840),z=t(58760),B=t(867),U=t(5545),G=t(5945),H=t(3810),K=t(22116),J=t(89245),W=t(5540),Y=t(8881),$=t(9114);let{Text:Q}=D.default;var X=e=>{let{accessToken:l,onReloadSuccess:t,buttonText:r="Reload Price Data",showIcon:i=!0,size:n="middle",type:o="primary",className:d=""}=e,[c,m]=(0,N.useState)(!1),[u,h]=(0,N.useState)(!1),[x,p]=(0,N.useState)(!1),[g,f]=(0,N.useState)(!1),[j,v]=(0,N.useState)(6),[_,y]=(0,N.useState)(null),[b,w]=(0,N.useState)(!1);(0,N.useEffect)(()=>{Z();let e=setInterval(()=>{Z()},3e4);return()=>clearInterval(e)},[l]);let Z=async()=>{if(l){w(!0);try{console.log("Fetching reload status...");let e=await (0,a.getModelCostMapReloadStatus)(l);console.log("Received status:",e),y(e)}catch(e){console.error("Failed to fetch reload status:",e),y({scheduled:!1,interval_hours:null,last_run:null,next_run:null})}finally{w(!1)}}},C=async()=>{if(!l){$.Z.fromBackend("No access token available");return}m(!0);try{let e=await (0,a.reloadModelCostMap)(l);"success"===e.status?($.Z.success("Price data reloaded successfully! ".concat(e.models_count||0," models updated.")),null==t||t(),await Z()):$.Z.fromBackend("Failed to reload price data")}catch(e){console.error("Error reloading price data:",e),$.Z.fromBackend("Failed to reload price data. Please try again.")}finally{m(!1)}},k=async()=>{if(!l){$.Z.fromBackend("No access token available");return}if(j<=0){$.Z.fromBackend("Hours must be greater than 0");return}h(!0);try{let e=await (0,a.scheduleModelCostMapReload)(l,j);"success"===e.status?($.Z.success("Periodic reload scheduled for every ".concat(j," hours")),f(!1),await Z()):$.Z.fromBackend("Failed to schedule periodic reload")}catch(e){console.error("Error scheduling reload:",e),$.Z.fromBackend("Failed to schedule periodic reload. Please try again.")}finally{h(!1)}},S=async()=>{if(!l){$.Z.fromBackend("No access token available");return}p(!0);try{let e=await (0,a.cancelModelCostMapReload)(l);"success"===e.status?($.Z.success("Periodic reload cancelled successfully"),await Z()):$.Z.fromBackend("Failed to cancel periodic reload")}catch(e){console.error("Error cancelling reload:",e),$.Z.fromBackend("Failed to cancel periodic reload. Please try again.")}finally{p(!1)}},A=e=>{if(!e)return"Never";try{return new Date(e).toLocaleString()}catch(l){return e}};return(0,s.jsxs)("div",{className:d,children:[(0,s.jsxs)(z.Z,{direction:"horizontal",size:"middle",style:{marginBottom:16},children:[(0,s.jsx)(B.Z,{title:"Hard Refresh Price Data",description:"This will immediately fetch the latest pricing information from the remote source. Continue?",onConfirm:C,okText:"Yes",cancelText:"No",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"}},children:(0,s.jsx)(U.ZP,{type:o,size:n,loading:c,icon:i?(0,s.jsx)(J.Z,{}):void 0,style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem",transition:"all 0.2s ease-in-out"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#4f46e5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#6366f1"},children:r})}),(null==_?void 0:_.scheduled)?(0,s.jsx)(U.ZP,{type:"default",size:n,danger:!0,icon:(0,s.jsx)(Y.Z,{}),loading:x,onClick:S,style:{borderColor:"#ff4d4f",color:"#ff4d4f",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Cancel Periodic Reload"}):(0,s.jsx)(U.ZP,{type:"default",size:n,icon:(0,s.jsx)(W.Z,{}),onClick:()=>f(!0),style:{borderColor:"#d9d9d9",color:"#6366f1",fontWeight:"500",borderRadius:"0.375rem",padding:"0.375rem 0.75rem",height:"auto",fontSize:"0.875rem",lineHeight:"1.25rem"},children:"Set Up Periodic Reload"})]}),_&&(0,s.jsx)(G.Z,{size:"small",style:{backgroundColor:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:8},children:(0,s.jsxs)(z.Z,{direction:"vertical",size:"small",style:{width:"100%"},children:[_.scheduled?(0,s.jsx)("div",{children:(0,s.jsxs)(H.Z,{color:"green",icon:(0,s.jsx)(W.Z,{}),children:["Scheduled every ",_.interval_hours," hours"]})}):(0,s.jsx)(Q,{type:"secondary",children:"No periodic reload scheduled"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(Q,{type:"secondary",style:{fontSize:"12px"},children:"Last run:"}),(0,s.jsx)(Q,{style:{fontSize:"12px"},children:A(_.last_run)})]}),_.scheduled&&(0,s.jsxs)(s.Fragment,{children:[_.next_run&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(Q,{type:"secondary",style:{fontSize:"12px"},children:"Next run:"}),(0,s.jsx)(Q,{style:{fontSize:"12px"},children:A(_.next_run)})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(Q,{type:"secondary",style:{fontSize:"12px"},children:"Status:"}),(0,s.jsx)(H.Z,{color:(null==_?void 0:_.scheduled)?_.last_run?"success":"processing":"default",children:(null==_?void 0:_.scheduled)?_.last_run?"Active":"Ready":"Not scheduled"})]})]})]})}),(0,s.jsxs)(K.Z,{title:"Set Up Periodic Reload",open:g,onOk:k,onCancel:()=>f(!1),confirmLoading:u,okText:"Schedule",cancelText:"Cancel",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"}},children:[(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(Q,{children:"Set up automatic reload of price data every:"})}),(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(O.Z,{min:1,max:168,value:j,onChange:e=>v(e||6),addonAfter:"hours",style:{width:"100%"}})}),(0,s.jsx)("div",{children:(0,s.jsxs)(Q,{type:"secondary",children:["This will automatically fetch the latest pricing data from the remote source every ",j," hours."]})})]})]})},ee=()=>{let{accessToken:e}=(0,n.Z)(),{refetch:l}=m();return(0,s.jsx)(F.Z,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(R.Z,{children:"Price Data Management"}),(0,s.jsx)(L.Z,{className:"text-tremor-content",children:"Manage model pricing data and configure automatic reload schedules"})]}),(0,s.jsx)(X,{accessToken:e,onReloadSuccess:()=>{l()},buttonText:"Reload Price Data",size:"middle",type:"primary",className:"w-full"})]})})};let el=async(e,l,t)=>{try{var s,a;console.log("handling submit for formValues:",e);let l=e.model_mappings||[];if("model_mappings"in e&&delete e.model_mappings,e.model&&e.model.includes("all-wildcard")){let t=e.custom_llm_provider,a=(null!==(s=w.fK[t])&&void 0!==s?s:t.toLowerCase())+"/*";e.model_name=a,l.push({public_name:a,litellm_model:a}),e.model=a}let t=[];for(let s of l){let l={},r={},i=s.public_name;for(let[t,i]of(l.model=s.litellm_model,e.input_cost_per_token&&(e.input_cost_per_token=Number(e.input_cost_per_token)/1e6),e.output_cost_per_token&&(e.output_cost_per_token=Number(e.output_cost_per_token)/1e6),l.model=s.litellm_model,console.log("formValues add deployment:",e),Object.entries(e)))if(""!==i&&"custom_pricing"!==t&&"pricing_model"!==t&&"cache_control"!==t){if("model_name"==t)l.model=i;else if("custom_llm_provider"==t){console.log("custom_llm_provider:",i);let e=null!==(a=w.fK[i])&&void 0!==a?a:i.toLowerCase();l.custom_llm_provider=e,console.log("custom_llm_provider mappingResult:",e)}else if("model"==t)continue;else if("base_model"===t)r[t]=i;else if("team_id"===t)r.team_id=i;else if("model_access_group"===t)r.access_groups=i;else if("mode"==t)console.log("placing mode in modelInfo"),r.mode=i,delete l.mode;else if("custom_model_name"===t)l.model=i;else if("litellm_extra_params"==t){console.log("litellm_extra_params:",i);let e={};if(i&&void 0!=i){try{e=JSON.parse(i)}catch(e){throw $.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[t,s]of Object.entries(e))l[t]=s}}else if("model_info_params"==t){console.log("model_info_params:",i);let e={};if(i&&void 0!=i){try{e=JSON.parse(i)}catch(e){throw $.Z.fromBackend("Failed to parse LiteLLM Extra Params: "+e),Error("Failed to parse litellm_extra_params: "+e)}for(let[l,t]of Object.entries(e))r[l]=t}}else if("input_cost_per_token"===t||"output_cost_per_token"===t||"input_cost_per_second"===t){i&&(l[t]=Number(i));continue}else l[t]=i}t.push({litellmParamsObj:l,modelInfoObj:r,modelName:i})}return t}catch(e){$.Z.fromBackend("Failed to create model: "+e)}},et=async(e,l,t,s)=>{try{let r=await el(e,l,t);if(!r||0===r.length)return;for(let e of r){let{litellmParamsObj:t,modelInfoObj:s,modelName:r}=e,i={model_name:r,litellm_params:t,model_info:s},n=await (0,a.modelCreateCall)(l,i);console.log("response for model create call: ".concat(n.data))}s&&s(),t.resetFields()}catch(e){$.Z.fromBackend("Failed to add model: "+e)}};var es=t(53410),ea=t(62490),er=t(10032),ei=t(21609),en=t(31283),eo=t(37592);let ed=(0,i.n)("providerFields"),ec=()=>(0,r.a)({queryKey:ed.list({}),queryFn:async()=>await (0,a.getProviderCreateMetadata)(),staleTime:864e5,gcTime:864e5});var em=t(3632),eu=t(56522),eh=t(47451),ex=t(69410),ep=t(65319),eg=t(4260);let{Link:ef}=D.default,ej=e=>{var l,t,s,a,r;let i="password"===e.field_type?"password":"select"===e.field_type?"select":"upload"===e.field_type?"upload":"textarea"===e.field_type?"textarea":"text";return{key:e.key,label:e.label,placeholder:null!==(l=e.placeholder)&&void 0!==l?l:void 0,tooltip:null!==(t=e.tooltip)&&void 0!==t?t:void 0,required:null!==(s=e.required)&&void 0!==s&&s,type:i,options:null!==(a=e.options)&&void 0!==a?a:void 0,defaultValue:null!==(r=e.default_value)&&void 0!==r?r:void 0}},ev={};var e_=e=>{let{selectedProvider:l,uploadProps:t}=e,a=w.Cl[l],r=er.Z.useFormInstance(),{data:i,isLoading:n,error:o}=ec(),d=N.useMemo(()=>{if(!i)return null;let e={};return i.forEach(l=>{let t=l.provider_display_name,s=l.credential_fields.map(ej);e[t]=s,l.provider&&(e[l.provider]=s),l.litellm_provider&&(e[l.litellm_provider]=s)}),e},[i]);N.useEffect(()=>{d&&Object.assign(ev,d)},[d]);let c=N.useMemo(()=>{var e;let t=null!==(e=ev[a])&&void 0!==e?e:ev[l];if(t)return t;if(!i)return[];let s=i.find(e=>e.provider_display_name===a||e.provider===l||e.litellm_provider===l);if(!s)return[];let r=s.credential_fields.map(ej);return ev[s.provider_display_name]=r,s.provider&&(ev[s.provider]=r),s.litellm_provider&&(ev[s.litellm_provider]=r),r},[a,l,i]),m={name:"file",accept:".json",beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;console.log("Setting field value from JSON, length: ".concat(l.length)),r.setFieldsValue({vertex_credentials:l}),console.log("Form values after setting:",r.getFieldsValue())}},l.readAsText(e)}return!1},onChange(e){console.log("Upload onChange triggered in ProviderSpecificFields"),console.log("Current form values:",r.getFieldsValue()),"uploading"!==e.file.status&&console.log(e.file,e.fileList)}};return(0,s.jsxs)(s.Fragment,{children:[n&&0===c.length&&(0,s.jsx)(eh.Z,{children:(0,s.jsx)(ex.Z,{span:24,children:(0,s.jsx)(eu.x,{className:"mb-2",children:"Loading provider fields..."})})}),o&&0===c.length&&(0,s.jsx)(eh.Z,{children:(0,s.jsx)(ex.Z,{span:24,children:(0,s.jsx)(eu.x,{className:"mb-2 text-red-500",children:o instanceof Error?o.message:"Failed to load provider credential fields"})})}),c.map(e=>{var l;return(0,s.jsxs)(N.Fragment,{children:[(0,s.jsx)(er.Z.Item,{label:e.label,name:e.key,rules:e.required?[{required:!0,message:"Required"}]:void 0,tooltip:e.tooltip,className:"vertex_credentials"===e.key?"mb-0":void 0,children:"select"===e.type?(0,s.jsx)(eo.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,s.jsx)(eo.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,s.jsx)(ep.default,{...m,onChange:l=>{(null==t?void 0:t.onChange)&&t.onChange(l),setTimeout(()=>{let l=r.getFieldValue(e.key);console.log("".concat(e.key," value after upload:"),JSON.stringify(l))},500)},children:(0,s.jsx)(U.ZP,{icon:(0,s.jsx)(em.Z,{}),children:"Click to Upload"})}):"textarea"===e.type?(0,s.jsx)(eg.default.TextArea,{placeholder:e.placeholder,defaultValue:e.defaultValue,rows:6,style:{fontFamily:"monospace",fontSize:"12px"}}):(0,s.jsx)(eu.o,{placeholder:e.placeholder,type:"password"===e.type?"password":"text",defaultValue:e.defaultValue})}),"vertex_credentials"===e.key&&(0,s.jsx)(eh.Z,{children:(0,s.jsx)(ex.Z,{children:(0,s.jsx)(eu.x,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,s.jsxs)(eh.Z,{children:[(0,s.jsx)(ex.Z,{span:10}),(0,s.jsx)(ex.Z,{span:10,children:(0,s.jsxs)(eu.x,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,s.jsx)(ef,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})]})};let{Link:ey}=D.default;var eb=e=>{let{open:l,onCancel:t,onAddCredential:a,uploadProps:r}=e,[i]=er.Z.useForm(),[n,o]=(0,N.useState)(w.Cl.OpenAI);return(0,s.jsx)(K.Z,{title:"Add New Credential",open:l,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,s.jsxs)(er.Z,{form:i,onFinish:e=>{a(Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{})),i.resetFields()},layout:"vertical",children:[(0,s.jsx)(er.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],children:(0,s.jsx)(en.o,{placeholder:"Enter a friendly name for these credentials"})}),(0,s.jsx)(er.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(eo.default,{showSearch:!0,onChange:e=>{o(e),i.setFieldValue("custom_llm_provider",e)},children:Object.entries(w.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(eo.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:w.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(e_,{selectedProvider:n,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(b.Z,{title:"Get help on our github",children:(0,s.jsx)(ey,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(U.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(U.ZP,{htmlType:"submit",children:"Add Credential"})]})]})]})})};let{Link:eN}=D.default;function ew(e){let{open:l,onCancel:t,onUpdateCredential:a,uploadProps:r,existingCredential:i}=e,[n]=er.Z.useForm(),[o,d]=(0,N.useState)(w.Cl.Anthropic);return(0,N.useEffect)(()=>{if(i){let e=Object.entries(i.credential_values||{}).reduce((e,l)=>{let[t,s]=l;return e[t]=null!=s?s:null,e},{});n.setFieldsValue({credential_name:i.credential_name,custom_llm_provider:i.credential_info.custom_llm_provider,...e}),d(i.credential_info.custom_llm_provider)}},[i]),(0,s.jsx)(K.Z,{title:"Edit Credential",open:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,destroyOnHidden:!0,children:(0,s.jsxs)(er.Z,{form:n,onFinish:e=>{a(Object.entries(e).reduce((e,l)=>{let[t,s]=l;return""!==s&&null!=s&&(e[t]=s),e},{})),n.resetFields()},layout:"vertical",children:[(0,s.jsx)(er.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==i?void 0:i.credential_name,children:(0,s.jsx)(en.o,{placeholder:"Enter a friendly name for these credentials",disabled:null!=i&&!!i.credential_name})}),(0,s.jsx)(er.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"Helper to auto-populate provider specific fields",children:(0,s.jsx)(eo.default,{showSearch:!0,onChange:e=>{d(e),n.setFieldValue("custom_llm_provider",e)},children:Object.entries(w.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(eo.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:w.cd[t],alt:"".concat(l," logo"),className:"w-5 h-5",onError:e=>{let l=e.target,s=l.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,l)}}}),(0,s.jsx)("span",{children:t})]})},l)})})}),(0,s.jsx)(e_,{selectedProvider:o,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(b.Z,{title:"Get help on our github",children:(0,s.jsx)(eN,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(U.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(U.ZP,{htmlType:"submit",children:"Update Credential"})]})]})]})})}var eZ=e=>{var l;let{uploadProps:t}=e,{accessToken:r}=(0,n.Z)(),{data:i,refetch:o}=d(),c=(null==i?void 0:i.credentials)||[],[m,u]=(0,N.useState)(!1),[h,x]=(0,N.useState)(!1),[p,g]=(0,N.useState)(null),[f,v]=(0,N.useState)(null),[_,y]=(0,N.useState)(!1),[b,w]=(0,N.useState)(!1),[Z]=er.Z.useForm(),C=["credential_name","custom_llm_provider"],k=async e=>{if(!r)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!C.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),t={credential_name:e.credential_name,credential_values:l,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,a.credentialUpdateCall)(r,e.credential_name,t),$.Z.success("Credential updated successfully"),x(!1),await o()},S=async e=>{if(!r)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!C.includes(l)}).reduce((e,l)=>{let[t,s]=l;return{...e,[t]:s}},{}),t={credential_name:e.credential_name,credential_values:l,credential_info:{custom_llm_provider:e.custom_llm_provider}};await (0,a.credentialCreateCall)(r,t),$.Z.success("Credential added successfully"),u(!1),await o()},A=e=>{let l={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=l[e.toLowerCase()]||l.default;return(0,s.jsx)(ea.Ct,{color:t,size:"xs",children:e})},E=async()=>{if(r&&f){w(!0);try{await (0,a.credentialDeleteCall)(r,f.credential_name),$.Z.success("Credential deleted successfully"),await o()}catch(e){$.Z.error("Failed to delete credential")}finally{v(null),y(!1),w(!1)}}},P=e=>{v(e),y(!0)};return(0,s.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto p-2",children:[(0,s.jsx)(ea.zx,{onClick:()=>u(!0),children:"Add Credential"}),(0,s.jsx)("div",{className:"flex justify-between items-center mt-4 mb-4",children:(0,s.jsx)(ea.xv,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,s.jsx)(ea.Zb,{children:(0,s.jsxs)(ea.iA,{children:[(0,s.jsx)(ea.ss,{children:(0,s.jsxs)(ea.SC,{children:[(0,s.jsx)(ea.xs,{children:"Credential Name"}),(0,s.jsx)(ea.xs,{children:"Provider"}),(0,s.jsx)(ea.xs,{children:"Actions"})]})}),(0,s.jsx)(ea.RM,{children:c&&0!==c.length?c.map((e,l)=>{var t;return(0,s.jsxs)(ea.SC,{children:[(0,s.jsx)(ea.pj,{children:e.credential_name}),(0,s.jsx)(ea.pj,{children:A((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,s.jsxs)(ea.pj,{children:[(0,s.jsx)(ea.zx,{icon:es.Z,variant:"light",size:"sm",onClick:()=>{g(e),x(!0)}}),(0,s.jsx)(ea.zx,{icon:j.Z,variant:"light",size:"sm",onClick:()=>P(e),className:"ml-2"})]})]},l)}):(0,s.jsx)(ea.SC,{children:(0,s.jsx)(ea.pj,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),m&&(0,s.jsx)(eb,{onAddCredential:S,open:m,onCancel:()=>u(!1),uploadProps:t}),h&&(0,s.jsx)(ew,{open:h,existingCredential:p,onUpdateCredential:k,uploadProps:t,onCancel:()=>x(!1)}),(0,s.jsx)(ei.Z,{isOpen:_,onCancel:()=>{v(null),y(!1)},onOk:E,title:"Delete Credential?",message:"Are you sure you want to delete this credential? This action cannot be undone and may break existing integrations.",resourceInformationTitle:"Credential Information",resourceInformation:[{label:"Credential Name",value:null==f?void 0:f.credential_name},{label:"Provider",value:(null==f?void 0:null===(l=f.credential_info)||void 0===l?void 0:l.custom_llm_provider)||"-"}],confirmLoading:b,requiredConfirmation:null==f?void 0:f.credential_name})]})},eC=t(20347),ek=t(23628),eS=t(29827),eA=t(49804),eE=t(12485),eP=t(18135),eF=t(35242),eL=t(77991),eM=t(34419),eI=t(58643),eT=t(29),eR=t.n(eT),eO=t(23496),eq=t(35291),eV=t(23639);let{Text:eD}=D.default;var ez=e=>{let{formValues:l,accessToken:t,testMode:r,modelName:i="this model",onClose:n,onTestComplete:o}=e,[d,c]=N.useState(null),[m,u]=N.useState(null),[h,x]=N.useState(null),[p,g]=N.useState(!0),[f,j]=N.useState(!1),[v,_]=N.useState(!1),y=async()=>{g(!0),_(!1),c(null),u(null),x(null),j(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",l);let r=await el(l,t,null);if(!r){console.log("No result from prepareModelAddRequest"),c("Failed to prepare model data. Please check your form inputs."),j(!1),g(!1);return}console.log("Result from prepareModelAddRequest:",r);let{litellmParamsObj:i,modelInfoObj:n,modelName:o}=r[0],d=await (0,a.testConnectionRequest)(t,i,n,null==n?void 0:n.mode);if("success"===d.status)$.Z.success("Connection test successful!"),c(null),j(!0);else{var e,s;let l=(null===(e=d.result)||void 0===e?void 0:e.error)||d.message||"Unknown error";c(l),u(i),x(null===(s=d.result)||void 0===s?void 0:s.raw_request_typed_dict),j(!1)}}catch(e){console.error("Test connection error:",e),c(e instanceof Error?e.message:String(e)),j(!1)}finally{g(!1),o&&o()}};N.useEffect(()=>{let e=setTimeout(()=>{y()},200);return()=>clearTimeout(e)},[]);let b=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",w="string"==typeof d?b(d):(null==d?void 0:d.message)?b(d.message):"Unknown error",Z=h?((e,l,t)=>{let s=JSON.stringify(l,null,2).split("\n").map(e=>" ".concat(e)).join("\n"),a=Object.entries(t).map(e=>{let[l,t]=e;return"-H '".concat(l,": ").concat(t,"'")}).join(" \\\n ");return"curl -X POST \\\n ".concat(e," \\\n ").concat(a?"".concat(a," \\\n "):"","-H 'Content-Type: application/json' \\\n -d '{\n").concat(s,"\n }'")})(h.raw_request_api_base,h.raw_request_body,h.raw_request_headers||{}):"";return(0,s.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[p?(0,s.jsxs)("div",{style:{textAlign:"center",padding:"32px 20px"},className:"jsx-dc9a0e2d897fe63b",children:[(0,s.jsx)("div",{style:{marginBottom:"16px"},className:"jsx-dc9a0e2d897fe63b loading-spinner",children:(0,s.jsx)("div",{style:{border:"3px solid #f3f3f3",borderTop:"3px solid #1890ff",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite",margin:"0 auto"},className:"jsx-dc9a0e2d897fe63b"})}),(0,s.jsxs)(eD,{style:{fontSize:"16px"},children:["Testing connection to ",i,"..."]}),(0,s.jsx)(eR(),{id:"dc9a0e2d897fe63b",children:"@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}"})]}):f?(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 20px"},children:[(0,s.jsx)("div",{style:{color:"#52c41a",fontSize:"24px",display:"flex",alignItems:"center"},children:(0,s.jsx)("svg",{viewBox:"64 64 896 896",focusable:"false","data-icon":"check-circle",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})})}),(0,s.jsxs)(eD,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",i," successful!"]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"20px"},children:[(0,s.jsx)(eq.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,s.jsxs)(eD,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",i," failed"]})]}),(0,s.jsxs)("div",{style:{backgroundColor:"#fff2f0",border:"1px solid #ffccc7",borderRadius:"8px",padding:"16px",marginBottom:"20px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.03)"},children:[(0,s.jsxs)(eD,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,s.jsx)(eD,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:w}),d&&(0,s.jsx)("div",{style:{marginTop:"12px"},children:(0,s.jsx)(U.ZP,{type:"link",onClick:()=>_(!v),style:{paddingLeft:0,height:"auto"},children:v?"Hide Details":"Show Details"})})]}),v&&(0,s.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,s.jsx)(eD,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"Troubleshooting Details"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"200px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:"string"==typeof d?d:JSON.stringify(d,null,2)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(eD,{strong:!0,style:{display:"block",marginBottom:"8px",fontSize:"15px"},children:"API Request"}),(0,s.jsx)("pre",{style:{backgroundColor:"#f5f5f5",padding:"16px",borderRadius:"8px",fontSize:"13px",maxHeight:"250px",overflow:"auto",border:"1px solid #e8e8e8",lineHeight:"1.5"},children:Z||"No request data available"}),(0,s.jsx)(U.ZP,{style:{marginTop:"8px"},icon:(0,s.jsx)(eV.Z,{}),onClick:()=>{navigator.clipboard.writeText(Z||""),$.Z.success("Copied to clipboard")},children:"Copy to Clipboard"})]})]})}),(0,s.jsx)(eO.Z,{style:{margin:"24px 0 16px"}}),(0,s.jsx)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,s.jsx)(U.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,s.jsx)(S.Z,{}),children:"View Documentation"})})]})};let eB=async(e,l,t,s)=>{try{console.log("=== AUTO ROUTER SUBMIT HANDLER CALLED ==="),console.log("handling auto router submit for formValues:",e),console.log("Access token:",l?"Present":"Missing"),console.log("Form:",t?"Present":"Missing"),console.log("Callback:",s?"Present":"Missing");let r={model_name:e.auto_router_name,litellm_params:{model:"auto_router/".concat(e.auto_router_name),auto_router_config:JSON.stringify(e.auto_router_config),auto_router_default_model:e.auto_router_default_model},model_info:{}};e.auto_router_embedding_model&&"custom"!==e.auto_router_embedding_model?r.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(r.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(r.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(r.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",r),console.log("Auto router config (stringified):",r.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:l?"Present":"Missing",config:r});let i=await (0,a.modelCreateCall)(l,r);console.log("response for auto router create call:",i),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),$.Z.fromBackend("Failed to add auto router: "+e)}};var eU=t(10703),eG=t(44851),eH=t(96473),eK=t(70464),eJ=t(26349),eW=t(92280);let{TextArea:eY}=eg.default,{Panel:e$}=eG.default;var eQ=e=>{let{modelInfo:l,value:t,onChange:a}=e,[r,i]=(0,N.useState)([]),[n,o]=(0,N.useState)(!1),[d,c]=(0,N.useState)([]);(0,N.useEffect)(()=>{if(null==t?void 0:t.routes){let e=t.routes.map((e,l)=>({id:e.id||"route-".concat(l,"-").concat(Date.now()),model:e.name||e.model||"",utterances:e.utterances||[],description:e.description||"",score_threshold:e.score_threshold||.5}));i(e),c(e.map(e=>e.id))}else i([]),c([])},[t]);let m=e=>{let l=r.filter(l=>l.id!==e);i(l),h(l),c(l=>l.filter(l=>l!==e))},u=(e,l,t)=>{let s=r.map(s=>s.id===e?{...s,[l]:t}:s);i(s),h(s)},h=e=>{let l={routes:e.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))};null==a||a(l)},x=l.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsxs)("div",{className:"w-full max-w-none",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(eW.x,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,s.jsx)(b.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,s.jsx)(S.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(U.ZP,{type:"primary",icon:(0,s.jsx)(eH.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),l=[...r,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];i(l),h(l),c(l=>[...l,e])},className:"bg-blue-600 hover:bg-blue-700",children:"Add Route"})]}),0===r.length?(0,s.jsx)("div",{className:"text-center py-12 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200 mb-6",children:(0,s.jsx)(eW.x,{children:"No routes configured. Click “Add Route” to get started."})}):(0,s.jsx)("div",{className:"space-y-3 mb-6 w-full",children:r.map((e,l)=>(0,s.jsx)(G.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,s.jsx)(eG.default,{ghost:!0,expandIcon:e=>{let{isActive:l}=e;return(0,s.jsx)(eK.Z,{rotate:l?180:0})},activeKey:d,onChange:e=>c(Array.isArray(e)?e:[e].filter(Boolean)),items:[{key:e.id,label:(0,s.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,s.jsxs)(eW.x,{className:"font-medium text-base",children:["Route ",l+1,": ",e.model||"Unnamed"]}),(0,s.jsx)(U.ZP,{type:"text",danger:!0,icon:(0,s.jsx)(eJ.Z,{}),onClick:l=>{l.stopPropagation(),m(e.id)},className:"mr-2"})]}),children:(0,s.jsxs)("div",{className:"px-6 pb-6 w-full",children:[(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(eW.x,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,s.jsx)(eo.default,{value:e.model,onChange:l=>u(e.id,"model",l),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:x})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(eW.x,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,s.jsx)(eY,{value:e.description,onChange:l=>u(e.id,"description",l.target.value),placeholder:"Describe when this route should be used...",rows:2,style:{width:"100%"}})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(eW.x,{className:"text-sm font-medium",children:"Score Threshold"}),(0,s.jsx)(b.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,s.jsx)(S.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(O.Z,{value:e.score_threshold,onChange:l=>u(e.id,"score_threshold",l||0),min:0,max:1,step:.1,style:{width:"100%"},placeholder:"0.5"})]}),(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(eW.x,{className:"text-sm font-medium",children:"Example Utterances"}),(0,s.jsx)(b.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,s.jsx)(S.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(eW.x,{className:"text-xs text-gray-500 mb-2",children:"Type an utterance and press Enter to add it. You can also paste multiple lines."}),(0,s.jsx)(eo.default,{mode:"tags",value:e.utterances,onChange:l=>u(e.id,"utterances",l),placeholder:"Type an utterance and press Enter...",style:{width:"100%"},tokenSeparators:["\n"],maxTagCount:"responsive",allowClear:!0})]})]})}]})},e.id))}),(0,s.jsxs)("div",{className:"border-t pt-6 w-full",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4 w-full",children:[(0,s.jsx)(eW.x,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,s.jsx)(U.ZP,{type:"link",onClick:()=>o(!n),className:"text-blue-600 p-0",children:n?"Hide":"Show"})]}),n&&(0,s.jsx)(G.Z,{className:"bg-gray-50 w-full",children:(0,s.jsx)("pre",{className:"text-sm overflow-auto max-h-64 w-full",children:JSON.stringify({routes:r.map(e=>({name:e.model,utterances:e.utterances,description:e.description,score_threshold:e.score_threshold}))},null,2)})})]})]})};let{Title:eX,Link:e0}=D.default;var e1=e=>{let{form:l,handleOk:t,accessToken:r,userRole:i}=e,[n,o]=(0,N.useState)(!1),[d,c]=(0,N.useState)(!1),[m,u]=(0,N.useState)(""),[h,x]=(0,N.useState)([]),[p,g]=(0,N.useState)([]),[f,j]=(0,N.useState)(!1),[v,_]=(0,N.useState)(!1),[y,w]=(0,N.useState)(null);(0,N.useEffect)(()=>{(async()=>{x((await (0,a.modelAvailableCall)(r,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[r]),(0,N.useEffect)(()=>{(async()=>{try{let e=await (0,eU.p)(r);console.log("Fetched models for auto router:",e),g(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[r]);let Z=eC.ZL.includes(i),C=async()=>{c(!0),u("test-".concat(Date.now())),o(!0)},k=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",y);let e=l.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){$.Z.fromBackend("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){$.Z.fromBackend("Please select a Default Model");return}if(l.setFieldsValue({custom_llm_provider:"auto_router",model:e.auto_router_name,api_key:"not_required_for_auto_router"}),!y||!y.routes||0===y.routes.length){$.Z.fromBackend("Please configure at least one route for the auto router");return}if(y.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){$.Z.fromBackend("Please ensure all routes have a target model, description, and at least one utterance");return}l.validateFields().then(e=>{console.log("Form validation passed, submitting with values:",e);let s={...e,auto_router_config:y};console.log("Final submit values:",s),eB(s,r,l,t)}).catch(e=>{console.error("Validation failed:",e);let l=e.errorFields||[];if(l.length>0){let e=l.map(e=>{let l=e.name[0];return({auto_router_name:"Auto Router Name",auto_router_default_model:"Default Model",auto_router_embedding_model:"Embedding Model"})[l]||l});$.Z.fromBackend("Please fill in the following required fields: ".concat(e.join(", ")))}else $.Z.fromBackend("Please fill in all required fields")})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eX,{level:2,children:"Add Auto Router"}),(0,s.jsx)(eu.x,{className:"text-gray-600 mb-6",children:"Create an auto router with intelligent routing logic that automatically selects the best model based on user input patterns and semantic matching."}),(0,s.jsx)(G.Z,{children:(0,s.jsxs)(er.Z,{form:l,onFinish:k,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,s.jsx)(er.Z.Item,{rules:[{required:!0,message:"Auto router name is required"}],label:"Auto Router Name",name:"auto_router_name",tooltip:"Unique name for this auto router configuration",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(eu.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full mb-4",children:(0,s.jsx)(eQ,{modelInfo:p,value:y,onChange:e=>{w(e),l.setFieldValue("auto_router_config",e)}})}),(0,s.jsx)(er.Z.Item,{rules:[{required:!0,message:"Default model is required"}],label:"Default Model",name:"auto_router_default_model",tooltip:"Fallback model to use when auto routing logic cannot determine the best model",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(eo.default,{placeholder:"Select a default model",onChange:e=>{j("custom"===e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0})}),(0,s.jsx)(er.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",tooltip:"Optional: Embedding model to use for semantic routing decisions",labelCol:{span:10},labelAlign:"left",children:(0,s.jsx)(eo.default,{value:l.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{_("custom"===e),l.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(p.map(e=>e.model_group))).map(e=>({value:e,label:e})),{value:"custom",label:"Enter custom model name"}],style:{width:"100%"},showSearch:!0,allowClear:!0})}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),Z&&(0,s.jsx)(er.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to control who can access this auto router",children:(0,s.jsx)(eo.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:h.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(b.Z,{title:"Get help on our github",children:(0,s.jsx)(D.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(U.ZP,{onClick:C,loading:d,children:"Test Connect"}),(0,s.jsx)(U.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",y),console.log("Current form values:",l.getFieldsValue()),k()},children:"Add Auto Router"})]})]})]})}),(0,s.jsx)(K.Z,{title:"Connection Test Results",open:n,onCancel:()=>{o(!1),c(!1)},footer:[(0,s.jsx)(U.ZP,{onClick:()=>{o(!1),c(!1)},children:"Close"},"close")],width:700,children:n&&(0,s.jsx)(ez,{formValues:l.getFieldsValue(),accessToken:r,testMode:"chat",modelName:l.getFieldValue("auto_router_name"),onClose:()=>{o(!1),c(!1)},onTestComplete:()=>c(!1)},m)})]})};let e2=(0,i.n)("guardrails"),e4=()=>{let{accessToken:e,userId:l,userRole:t}=(0,n.Z)();return(0,r.a)({queryKey:e2.list({}),queryFn:async()=>(await (0,a.getGuardrailsList)(e)).guardrails.map(e=>e.guardrail_name),enabled:!!(e&&l&&t)})},e5=(0,i.n)("tags"),e6=()=>{let{accessToken:e,userId:l,userRole:t}=(0,n.Z)();return(0,r.a)({queryKey:e5.list({}),queryFn:async()=>await (0,a.tagListCall)(e),enabled:!!(e&&l&&t)})};var e3=t(59341),e8=t(51653),e9=t(84376),e7=t(63709),le=t(26210),ll=t(34766),lt=t(45246),ls=t(24199);let{Text:la}=D.default;var lr=e=>{let{form:l,showCacheControl:t,onCacheControlChange:a}=e,r=e=>{let t=l.getFieldValue("litellm_extra_params");try{let s=t?JSON.parse(t):{};e.length>0?s.cache_control_injection_points=e:delete s.cache_control_injection_points,Object.keys(s).length>0?l.setFieldValue("litellm_extra_params",JSON.stringify(s,null,2)):l.setFieldValue("litellm_extra_params","")}catch(e){console.error("Error updating cache control points:",e)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(er.Z.Item,{label:"Cache Control Injection Points",name:"cache_control",valuePropName:"checked",className:"mb-4",tooltip:"Tell litellm where to inject cache control checkpoints. You can specify either by role (to apply to all messages of that role) or by specific message index.",children:(0,s.jsx)(e7.Z,{onChange:a,className:"bg-gray-600"})}),t&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(la,{className:"text-sm text-gray-500 block mb-4",children:"Providers like Anthropic, Bedrock API require users to specify where to inject cache control checkpoints, litellm can automatically add them for you as a cost saving feature."}),(0,s.jsx)(er.Z.List,{name:"cache_control_injection_points",initialValue:[{location:"message"}],children:(e,t)=>{let{add:a,remove:i}=t;return(0,s.jsxs)(s.Fragment,{children:[e.map((t,a)=>(0,s.jsxs)("div",{className:"flex items-center mb-4 gap-4",children:[(0,s.jsx)(er.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,s.jsx)(eo.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,s.jsx)(er.Z.Item,{...t,label:"Role",name:[t.name,"role"],className:"mb-0",style:{width:"180px"},tooltip:"LiteLLM will mark all messages of this role as cacheable",children:(0,s.jsx)(eo.default,{placeholder:"Select a role",allowClear:!0,options:[{value:"user",label:"User"},{value:"system",label:"System"},{value:"assistant",label:"Assistant"}],onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),(0,s.jsx)(er.Z.Item,{...t,label:"Index",name:[t.name,"index"],className:"mb-0",style:{width:"180px"},tooltip:"(Optional) If set litellm will mark the message at this index as cacheable",children:(0,s.jsx)(ls.Z,{type:"number",placeholder:"Optional",step:1,onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,s.jsx)(lt.Z,{className:"text-red-500 cursor-pointer text-lg ml-12",onClick:()=>{i(t.name),setTimeout(()=>{r(l.getFieldValue("cache_control_points"))},0)}})]},t.key)),(0,s.jsx)(er.Z.Item,{children:(0,s.jsxs)("button",{type:"button",className:"flex items-center justify-center w-full border border-dashed border-gray-300 py-2 px-4 text-gray-600 hover:text-blue-600 hover:border-blue-300 transition-all rounded",onClick:()=>a(),children:[(0,s.jsx)(eH.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})},li=t(9309);let{Link:ln}=D.default;var lo=e=>{let{showAdvancedSettings:l,setShowAdvancedSettings:t,teams:a,guardrailsList:r,tagsList:i}=e,[n]=er.Z.useForm(),[o,d]=N.useState(!1),[c,m]=N.useState("per_token"),[u,h]=N.useState(!1),x=(e,l)=>l&&(isNaN(Number(l))||0>Number(l))?Promise.reject("Please enter a valid positive number"):Promise.resolve();return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(le.UQ,{className:"mt-2 mb-4",children:[(0,s.jsx)(le._m,{children:(0,s.jsx)("b",{children:"Advanced Settings"})}),(0,s.jsx)(le.X1,{children:(0,s.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,s.jsx)(er.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,s.jsx)(e7.Z,{onChange:e=>{d(e),e||n.setFieldsValue({input_cost_per_token:void 0,output_cost_per_token:void 0,input_cost_per_second:void 0})},className:"bg-gray-600"})}),(0,s.jsx)(er.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(b.Z,{title:"Apply safety guardrails to this key to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(S.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",className:"mt-4",help:"Select existing guardrails. Go to 'Guardrails' tab to create new guardrails.",children:(0,s.jsx)(eo.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:r.map(e=>({value:e,label:e}))})}),(0,s.jsx)(er.Z.Item,{label:"Tags",name:"tags",className:"mb-4",children:(0,s.jsx)(eo.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",options:Object.values(i).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}),o&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(er.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,s.jsx)(eo.default,{defaultValue:"per_token",onChange:e=>m(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(er.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(le.oi,{})}),(0,s.jsx)(er.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(le.oi,{})})]}):(0,s.jsx)(er.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:x}],className:"mb-4",children:(0,s.jsx)(le.oi,{})})]}),(0,s.jsx)(er.Z.Item,{label:"Use in pass through routes",name:"use_in_pass_through",valuePropName:"checked",className:"mb-4 mt-4",tooltip:(0,s.jsxs)("span",{children:["Allow using these credentials in pass through routes."," ",(0,s.jsx)(ln,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,s.jsx)(e7.Z,{onChange:e=>{let l=n.getFieldValue("litellm_extra_params");try{let t=l?JSON.parse(l):{};e?t.use_in_pass_through=!0:delete t.use_in_pass_through,Object.keys(t).length>0?n.setFieldValue("litellm_extra_params",JSON.stringify(t,null,2)):n.setFieldValue("litellm_extra_params","")}catch(l){e?n.setFieldValue("litellm_extra_params",JSON.stringify({use_in_pass_through:!0},null,2)):n.setFieldValue("litellm_extra_params","")}},className:"bg-gray-600"})}),(0,s.jsx)(lr,{form:n,showCacheControl:u,onCacheControlChange:e=>{if(h(e),!e){let e=n.getFieldValue("litellm_extra_params");try{let l=e?JSON.parse(e):{};delete l.cache_control_injection_points,Object.keys(l).length>0?n.setFieldValue("litellm_extra_params",JSON.stringify(l,null,2)):n.setFieldValue("litellm_extra_params","")}catch(e){n.setFieldValue("litellm_extra_params","")}}}}),(0,s.jsx)(er.Z.Item,{label:"LiteLLM Params",name:"litellm_extra_params",tooltip:"Optional litellm params used for making a litellm.completion() call.",className:"mb-4 mt-4",rules:[{validator:li.Ac}],children:(0,s.jsx)(ll.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,s.jsxs)(eh.Z,{className:"mb-4",children:[(0,s.jsx)(ex.Z,{span:10}),(0,s.jsx)(ex.Z,{span:10,children:(0,s.jsxs)(le.xv,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,s.jsx)(ln,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,s.jsx)(er.Z.Item,{label:"Model Info",name:"model_info_params",tooltip:"Optional model info params. Returned when calling `/model/info` endpoint.",className:"mb-0",rules:[{validator:li.Ac}],children:(0,s.jsx)(ll.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},ld=t(56609),lc=t(67187);let lm=e=>{let{content:l,children:t,width:a="auto",className:r=""}=e,[i,n]=(0,N.useState)(!1),[o,d]=(0,N.useState)("top"),c=(0,N.useRef)(null),m=()=>{if(c.current){let e=c.current.getBoundingClientRect(),l=e.top,t=window.innerHeight-e.bottom;l<300&&t>300?d("bottom"):d("top")}};return(0,s.jsxs)("div",{className:"relative inline-block",ref:c,children:[t||(0,s.jsx)(lc.Z,{className:"ml-1 text-gray-500 cursor-help",onMouseEnter:()=>{m(),n(!0)},onMouseLeave:()=>n(!1)}),i&&(0,s.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 z-50 bg-black/90 text-white p-2 rounded-md text-sm font-normal shadow-lg ".concat(r),style:{["top"===o?"bottom":"top"]:"100%",width:a,marginBottom:"top"===o?"8px":"0",marginTop:"bottom"===o?"8px":"0"},children:[l,(0,s.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 w-0 h-0",style:{top:"top"===o?"100%":"auto",bottom:"bottom"===o?"100%":"auto",borderTop:"top"===o?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderBottom:"bottom"===o?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent"}})]})]})};var lu=()=>{let e=er.Z.useFormInstance(),[l,t]=(0,N.useState)(0),a=er.Z.useWatch("model",e)||[],r=Array.isArray(a)?a:[a],i=er.Z.useWatch("custom_model_name",e),n=!r.includes("all-wildcard"),o=er.Z.useWatch("custom_llm_provider",e);if((0,N.useEffect)(()=>{if(i&&r.includes("custom")){let l=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?o===w.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:e);e.setFieldValue("model_mappings",l),t(e=>e+1)}},[i,r,o,e]),(0,N.useEffect)(()=>{if(r.length>0&&!r.includes("all-wildcard")){let l=e.getFieldValue("model_mappings")||[];if(l.length!==r.length||!r.every(e=>l.some(l=>"custom"===e?"custom"===l.litellm_model||l.litellm_model===i:o===w.Cl.Azure?l.litellm_model==="azure/".concat(e):l.litellm_model===e))){let l=r.map(e=>"custom"===e&&i?o===w.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:o===w.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});e.setFieldValue("model_mappings",l),t(e=>e+1)}}},[r,i,o,e]),!n)return null;let d=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"mb-2 font-normal",children:"The name you specify in your API calls to LiteLLM Proxy"}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Example:"})," If you name your public model"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"example-name"}),", and choose"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"openai/qwen-plus-latest"})," as the LiteLLM model"]}),(0,s.jsxs)("div",{className:"mb-2 font-normal",children:[(0,s.jsx)("strong",{children:"Usage:"})," You make an API call to the LiteLLM proxy with"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:'model = "example-name"'})]}),(0,s.jsxs)("div",{className:"font-normal",children:[(0,s.jsx)("strong",{children:"Result:"})," LiteLLM sends"," ",(0,s.jsx)("code",{className:"bg-gray-700 px-1 py-0.5 rounded text-xs",children:"qwen-plus-latest"})," to the provider"]})]}),c=(0,s.jsx)("div",{children:"The model name LiteLLM will send to the LLM API"}),m=[{title:(0,s.jsxs)("span",{className:"flex items-center",children:["Public Model Name",(0,s.jsx)(lm,{content:d,width:"500px"})]}),dataIndex:"public_name",key:"public_name",render:(l,t,a)=>(0,s.jsx)(en.o,{value:l,onChange:l=>{let t=[...e.getFieldValue("model_mappings")];t[a].public_name=l.target.value,e.setFieldValue("model_mappings",t)}})},{title:(0,s.jsxs)("span",{className:"flex items-center",children:["LiteLLM Model Name",(0,s.jsx)(lm,{content:c,width:"360px"})]}),dataIndex:"litellm_model",key:"litellm_model"}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(er.Z.Item,{label:"Model Mappings",name:"model_mappings",tooltip:"Map public model names to LiteLLM model names for load balancing",labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",rules:[{required:!0,validator:async(e,l)=>{if(!l||0===l.length)throw Error("At least one model mapping is required");if(l.filter(e=>!e.public_name||""===e.public_name.trim()).length>0)throw Error("All model mappings must have valid public names")}}],children:(0,s.jsx)(ld.Z,{dataSource:e.getFieldValue("model_mappings"),columns:m,pagination:!1,size:"small"},l)})})},lh=e=>{let{selectedProvider:l,providerModels:t,getPlaceholder:a}=e,r=er.Z.useFormInstance(),i=e=>{let t=e.target.value,s=(r.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?l===w.Cl.Azure?{public_name:t,litellm_model:"azure/".concat(t)}:{public_name:t,litellm_model:t}:e);r.setFieldsValue({model_mappings:s})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(er.Z.Item,{label:"LiteLLM Model Name(s)",tooltip:"The model name LiteLLM will send to the LLM API",className:"mb-0",children:[(0,s.jsx)(er.Z.Item,{name:"model",rules:[{required:!0,message:"Please enter ".concat(l===w.Cl.Azure?"a deployment name":"at least one model",".")}],noStyle:!0,children:l===w.Cl.Azure||l===w.Cl.OpenAI_Compatible||l===w.Cl.Ollama?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(eu.o,{placeholder:a(l),onChange:l===w.Cl.Azure?e=>{let l=e.target.value,t=l?[{public_name:l,litellm_model:"azure/".concat(l)}]:[];r.setFieldsValue({model:l,model_mappings:t})}:void 0})}):t.length>0?(0,s.jsx)(eo.default,{mode:"multiple",allowClear:!0,showSearch:!0,placeholder:"Select models",onChange:e=>{let t=Array.isArray(e)?e:[e];if(t.includes("all-wildcard"))r.setFieldsValue({model_name:void 0,model_mappings:[]});else if(JSON.stringify(r.getFieldValue("model"))!==JSON.stringify(t)){let e=t.map(e=>l===w.Cl.Azure?{public_name:e,litellm_model:"azure/".concat(e)}:{public_name:e,litellm_model:e});r.setFieldsValue({model:t,model_mappings:e})}},optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{label:"Custom Model Name (Enter below)",value:"custom"},{label:"All ".concat(l," Models (Wildcard)"),value:"all-wildcard"},...t.map(e=>({label:e,value:e}))],style:{width:"100%"}}):(0,s.jsx)(eu.o,{placeholder:a(l)})}),(0,s.jsx)(er.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.model!==l.model,children:e=>{let{getFieldValue:t}=e,a=t("model")||[];return(Array.isArray(a)?a:[a]).includes("custom")&&(0,s.jsx)(er.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,s.jsx)(eu.o,{placeholder:l===w.Cl.Azure?"Enter Azure deployment name":"Enter custom model name",onChange:i})})}})]}),(0,s.jsxs)(eh.Z,{children:[(0,s.jsx)(ex.Z,{span:10}),(0,s.jsx)(ex.Z,{span:14,children:(0,s.jsx)(eu.x,{className:"mb-3 mt-1",children:l===w.Cl.Azure?"Your deployment name will be saved as the public model name, and LiteLLM will use 'azure/deployment-name' internally":"The model name LiteLLM will send to the LLM API"})})]})]})};let lx=[{value:"chat",label:"Chat - /chat/completions"},{value:"completion",label:"Completion - /completions"},{value:"embedding",label:"Embedding - /embeddings"},{value:"audio_speech",label:"Audio Speech - /audio/speech"},{value:"audio_transcription",label:"Audio Transcription - /audio/transcriptions"},{value:"image_generation",label:"Image Generation - /images/generations"},{value:"video_generation",label:"Video Generation - /videos"},{value:"rerank",label:"Rerank - /rerank"},{value:"realtime",label:"Realtime - /realtime"},{value:"batch",label:"Batch - /batch"},{value:"ocr",label:"OCR - /ocr"}],{Title:lp,Link:lg}=D.default;var lf=e=>{let{form:l,handleOk:t,selectedProvider:r,setSelectedProvider:i,providerModels:o,setProviderModelsFn:d,getPlaceholder:c,uploadProps:m,showAdvancedSettings:u,setShowAdvancedSettings:h,teams:x,credentials:p}=e,[g,f]=(0,N.useState)("chat"),[j,v]=(0,N.useState)(!1),[_,y]=(0,N.useState)(!1),[C,k]=(0,N.useState)(""),{accessToken:S,userRole:A,premiumUser:E,userId:P}=(0,n.Z)(),{data:F,isLoading:M,error:I}=ec(),{data:T,isLoading:R,error:O}=e4(),{data:q,isLoading:V,error:z}=e6(),B=async()=>{y(!0),k("test-".concat(Date.now())),v(!0)},[H,J]=(0,N.useState)(!1),[W,Y]=(0,N.useState)([]),[$,Q]=(0,N.useState)(null);(0,N.useEffect)(()=>{(async()=>{Y((await (0,a.modelAvailableCall)(S,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[S]);let X=(0,N.useMemo)(()=>F?[...F].sort((e,l)=>e.provider_display_name.localeCompare(l.provider_display_name)):[],[F]),ee=I?I instanceof Error?I.message:"Failed to load providers":null,el=eC.ZL.includes(A),et=(0,eC.yV)(x,P);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lp,{level:2,children:"Add Model"}),(0,s.jsx)(G.Z,{children:(0,s.jsx)(er.Z,{form:l,onFinish:async e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),await t().then(()=>{Q(null)})},onFinishFailed:e=>{console.log("\uD83D\uDCA5 Form onFinishFailed triggered:",e)},labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:(0,s.jsxs)(s.Fragment,{children:[et&&!el&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(er.Z.Item,{label:"Select Team",name:"team_id",rules:[{required:!0,message:"Please select a team to continue"}],tooltip:"Select the team for which you want to add this model",children:(0,s.jsx)(e9.Z,{teams:x,onChange:e=>{Q(e)}})}),!$&&(0,s.jsx)(e8.Z,{message:"Team Selection Required",description:"As a team admin, you need to select your team first before adding models.",type:"info",showIcon:!0,className:"mb-4"})]}),(el||et&&$)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(er.Z.Item,{rules:[{required:!0,message:"Required"}],label:"Provider:",name:"custom_llm_provider",tooltip:"E.g. OpenAI, Azure OpenAI, Anthropic, Bedrock, etc.",labelCol:{span:10},labelAlign:"left",children:(0,s.jsxs)(eo.default,{virtual:!1,showSearch:!0,loading:M,placeholder:M?"Loading providers...":"Select a provider",optionFilterProp:"data-label",onChange:e=>{i(e),d(e),l.setFieldsValue({custom_llm_provider:e}),l.setFieldsValue({model:[],model_name:void 0})},children:[ee&&0===X.length&&(0,s.jsx)(eo.default.Option,{value:"",children:ee},"__error"),X.map(e=>{let l=e.provider_display_name,t=e.provider;return w.cd[l],(0,s.jsx)(eo.default.Option,{value:t,"data-label":l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(Z,{provider:t,className:"w-5 h-5"}),(0,s.jsx)("span",{children:l})]})},t)})]})}),(0,s.jsx)(lh,{selectedProvider:r,providerModels:o,getPlaceholder:c}),(0,s.jsx)(lu,{}),(0,s.jsx)(er.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,s.jsx)(eo.default,{style:{width:"100%"},value:g,onChange:e=>f(e),options:lx})}),(0,s.jsxs)(eh.Z,{children:[(0,s.jsx)(ex.Z,{span:10}),(0,s.jsx)(ex.Z,{span:10,children:(0,s.jsxs)(L.Z,{className:"mb-5 mt-1",children:[(0,s.jsx)("strong",{children:"Optional"})," - LiteLLM endpoint to use when health checking this model"," ",(0,s.jsx)(lg,{href:"https://docs.litellm.ai/docs/proxy/health#health",target:"_blank",children:"Learn more"})]})})]}),(0,s.jsx)("div",{className:"mb-4",children:(0,s.jsx)(D.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,s.jsx)(er.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",initialValue:null,children:(0,s.jsx)(eo.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,l)=>{var t;return(null!==(t=null==l?void 0:l.label)&&void 0!==t?t:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...p.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,s.jsx)(er.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.litellm_credential_name!==l.litellm_credential_name||e.provider!==l.provider,children:e=>{let{getFieldValue:l}=e,t=l("litellm_credential_name");return(console.log("\uD83D\uDD11 Credential Name Changed:",t),t)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,s.jsx)(e_,{selectedProvider:r,uploadProps:m})]})}}),(0,s.jsxs)("div",{className:"flex items-center my-4",children:[(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,s.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"Additional Model Info Settings"}),(0,s.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(el||!et)&&(0,s.jsx)(er.Z.Item,{label:"Team-BYOK Model",tooltip:"Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys.",className:"mb-4",children:(0,s.jsx)(b.Z,{title:E?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,s.jsx)(e3.Z,{checked:H,onChange:e=>{J(e),e||l.setFieldValue("team_id",void 0)},disabled:!E})})}),H&&(el||!et)&&(0,s.jsx)(er.Z.Item,{label:"Select Team",name:"team_id",className:"mb-4",tooltip:"Only keys for this team will be able to call this model.",rules:[{required:H&&!el,message:"Please select a team."}],children:(0,s.jsx)(e9.Z,{teams:x,disabled:!E})}),el&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(er.Z.Item,{label:"Model Access Group",name:"model_access_group",className:"mb-4",tooltip:"Use model access groups to give users access to select models, and add new ones to the group over time.",children:(0,s.jsx)(eo.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:W.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,s.jsx)(lo,{showAdvancedSettings:u,setShowAdvancedSettings:h,teams:x,guardrailsList:T||[],tagsList:q||{}})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(b.Z,{title:"Get help on our github",children:(0,s.jsx)(D.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(U.ZP,{onClick:B,loading:_,children:"Test Connect"}),(0,s.jsx)(U.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})}),(0,s.jsx)(K.Z,{title:"Connection Test Results",open:j,onCancel:()=>{v(!1),y(!1)},footer:[(0,s.jsx)(U.ZP,{onClick:()=>{v(!1),y(!1)},children:"Close"},"close")],width:700,children:j&&(0,s.jsx)(ez,{formValues:l.getFieldsValue(),accessToken:S,testMode:g,modelName:l.getFieldValue("model_name")||l.getFieldValue("model"),onClose:()=>{v(!1),y(!1)},onTestComplete:()=>y(!1)},C)})]})},lj=e=>{let{form:l,handleOk:t,selectedProvider:a,setSelectedProvider:r,providerModels:i,setProviderModelsFn:n,getPlaceholder:o,uploadProps:d,showAdvancedSettings:c,setShowAdvancedSettings:m,teams:u,credentials:h,accessToken:x,userRole:p}=e,[g]=er.Z.useForm();return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(eI.v0,{className:"w-full",children:[(0,s.jsxs)(eI.td,{className:"mb-4",children:[(0,s.jsx)(eI.OK,{children:"Add Model"}),(0,s.jsx)(eI.OK,{children:"Add Auto Router"})]}),(0,s.jsxs)(eI.nP,{children:[(0,s.jsx)(eI.x4,{children:(0,s.jsx)(lf,{form:l,handleOk:t,selectedProvider:a,setSelectedProvider:r,providerModels:i,setProviderModelsFn:n,getPlaceholder:o,uploadProps:d,showAdvancedSettings:c,setShowAdvancedSettings:m,teams:u,credentials:h})}),(0,s.jsx)(eI.x4,{children:(0,s.jsx)(e1,{form:g,handleOk:()=>{g.validateFields().then(e=>{eB(e,x,g,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:x,userRole:p})})]})]})})},lv=t(61994),l_=t(15731),ly=t(91126);let lb=(e,l,t,a,r,i,n,o,d,c,m)=>[{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lv.Z,{checked:t,indeterminate:l.length>0&&!t,onChange:e=>r(e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)("span",{children:"Model ID"})]}),accessorKey:"model_info.id",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:t}=e,r=t.original,i=r.model_name,n=l.includes(i);return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(lv.Z,{checked:n,onChange:e=>a(i,e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)(b.Z,{title:r.model_info.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>m&&m(r.model_info.id),children:r.model_info.id})})]})}},{header:"Model Name",accessorKey:"model_name",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,t=l.original,a=o(t)||t.model_name;return(0,s.jsx)("div",{className:"font-medium text-sm",children:(0,s.jsx)(b.Z,{title:a,children:(0,s.jsx)("div",{className:"truncate max-w-[200px]",children:a})})})}},{header:"Health Status",accessorKey:"health_status",enableSorting:!0,sortingFn:(e,l,t)=>{var s,a;let r=e.getValue("health_status")||"unknown",i=l.getValue("health_status")||"unknown",n={healthy:0,checking:1,unknown:2,unhealthy:3};return(null!==(s=n[r])&&void 0!==s?s:4)-(null!==(a=n[i])&&void 0!==a?a:4)},cell:l=>{var t;let{row:a}=l,r=a.original,i={status:r.health_status,loading:r.health_loading,error:r.health_error};if(i.loading)return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-2 h-2 bg-indigo-500 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}),(0,s.jsx)(eW.x,{className:"text-gray-600 text-sm",children:"Checking..."})]});let o=r.model_name,d="healthy"===i.status&&(null===(t=e[o])||void 0===t?void 0:t.successResponse);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[n(i.status),d&&c&&(0,s.jsx)(b.Z,{title:"View response details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>{var l;return c(o,null===(l=e[o])||void 0===l?void 0:l.successResponse)},className:"p-1 text-green-600 hover:text-green-800 hover:bg-green-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(l_.Z,{className:"h-4 w-4"})})})]})}},{header:"Error Details",accessorKey:"health_error",enableSorting:!1,cell:l=>{let{row:t}=l,a=t.original.model_name,r=e[a];if(!(null==r?void 0:r.error))return(0,s.jsx)(eW.x,{className:"text-gray-400 text-sm",children:"No errors"});let i=r.error,n=r.fullError||r.error;return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"max-w-[200px]",children:(0,s.jsx)(b.Z,{title:i,placement:"top",children:(0,s.jsx)(eW.x,{className:"text-red-600 text-sm truncate",children:i})})}),d&&n!==i&&(0,s.jsx)(b.Z,{title:"View full error details",placement:"top",children:(0,s.jsx)("button",{onClick:()=>d(a,i,n),className:"p-1 text-red-600 hover:text-red-800 hover:bg-red-50 rounded cursor-pointer transition-colors",children:(0,s.jsx)(l_.Z,{className:"h-4 w-4"})})})]})}},{header:"Last Check",accessorKey:"last_check",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_check")||"Never checked",a=l.getValue("last_check")||"Never checked";if("Never checked"===s&&"Never checked"===a)return 0;if("Never checked"===s)return 1;if("Never checked"===a)return -1;if("Check in progress..."===s&&"Check in progress..."===a)return 0;if("Check in progress..."===s)return -1;if("Check in progress..."===a)return 1;let r=new Date(s),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:e=>{let{row:l}=e,t=l.original;return(0,s.jsx)(eW.x,{className:"text-gray-600 text-sm",children:t.health_loading?"Check in progress...":t.last_check})}},{header:"Last Success",accessorKey:"last_success",enableSorting:!0,sortingFn:(e,l,t)=>{let s=e.getValue("last_success")||"Never succeeded",a=l.getValue("last_success")||"Never succeeded";if("Never succeeded"===s&&"Never succeeded"===a)return 0;if("Never succeeded"===s)return 1;if("Never succeeded"===a)return -1;if("None"===s&&"None"===a)return 0;if("None"===s)return 1;if("None"===a)return -1;let r=new Date(s),i=new Date(a);return isNaN(r.getTime())&&isNaN(i.getTime())?0:isNaN(r.getTime())?1:isNaN(i.getTime())?-1:i.getTime()-r.getTime()},cell:l=>{let{row:t}=l,a=e[t.original.model_name],r=(null==a?void 0:a.lastSuccess)||"None";return(0,s.jsx)(eW.x,{className:"text-gray-600 text-sm",children:r})}},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e,t=l.original,a=t.model_name,r=t.health_status&&"none"!==t.health_status,n=t.health_loading?"Checking...":r?"Re-run Health Check":"Run Health Check";return(0,s.jsx)(b.Z,{title:n,placement:"top",children:(0,s.jsx)("button",{className:"p-2 rounded-md transition-colors ".concat(t.health_loading?"text-gray-400 cursor-not-allowed bg-gray-100":"text-indigo-600 hover:text-indigo-700 hover:bg-indigo-50"),onClick:()=>{t.health_loading||i(a)},disabled:t.health_loading,children:t.health_loading?(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse"}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),(0,s.jsx)("div",{className:"w-1 h-1 bg-gray-400 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]}):r?(0,s.jsx)(ek.Z,{className:"h-4 w-4"}):(0,s.jsx)(ly.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],lN=[{pattern:/Missing .* API Key/i,replacement:"Missing API Key"},{pattern:/Connection timeout/i,replacement:"Connection timeout"},{pattern:/Network.*not.*ok/i,replacement:"Network connection failed"},{pattern:/403.*Forbidden/i,replacement:"Access forbidden - check API key permissions"},{pattern:/401.*Unauthorized/i,replacement:"Unauthorized - invalid API key"},{pattern:/429.*rate limit/i,replacement:"Rate limit exceeded"},{pattern:/500.*Internal Server Error/i,replacement:"Provider internal server error"},{pattern:/litellm\.AuthenticationError/i,replacement:"Authentication failed"},{pattern:/litellm\.RateLimitError/i,replacement:"Rate limit exceeded"},{pattern:/litellm\.APIError/i,replacement:"API error"}];var lw=e=>{let{accessToken:l,modelData:t,all_models_on_proxy:r,getDisplayModelName:i,setSelectedModelId:n}=e,[o,d]=(0,N.useState)({}),[c,m]=(0,N.useState)([]),[u,h]=(0,N.useState)(!1),[x,p]=(0,N.useState)(!1),[f,j]=(0,N.useState)(null),[y,b]=(0,N.useState)(!1),[w,Z]=(0,N.useState)(null);(0,N.useRef)(null),(0,N.useEffect)(()=>{l&&(null==t?void 0:t.data)&&(async()=>{let e={};t.data.forEach(l=>{e[l.model_name]={status:"none",lastCheck:"None",lastSuccess:"None",loading:!1,error:void 0,fullError:void 0,successResponse:void 0}});try{let s=await (0,a.latestHealthChecksCall)(l);s&&s.latest_health_checks&&"object"==typeof s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l;if(!a)return;let r=null,i=t.data.find(e=>e.model_name===s);if(i)r=i.model_name;else{let e=t.data.find(e=>e.model_info&&e.model_info.id===s);if(e)r=e.model_name;else if(a.model_name){let e=t.data.find(e=>e.model_name===a.model_name);e&&(r=e.model_name)}}if(r){let l=a.error_message||void 0;e[r]={status:a.status||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():"None",loading:!1,error:l?C(l):void 0,fullError:l,successResponse:"healthy"===a.status?a:void 0}}})}catch(e){console.warn("Failed to load health check history (using default states):",e)}d(e)})()},[l,t]);let C=e=>{var l;if(!e)return"Health check failed";let t="string"==typeof e?e:JSON.stringify(e),s=t.match(/(\w+Error):\s*(\d{3})/i);if(s)return"".concat(s[1],": ").concat(s[2]);let a=t.match(/(AuthenticationError|RateLimitError|BadRequestError|InternalServerError|TimeoutError|NotFoundError|ForbiddenError|ServiceUnavailableError|BadGatewayError|ContentPolicyViolationError|\w+Error)/i),r=t.match(/\b(400|401|403|404|408|429|500|502|503|504)\b/);if(a&&r)return"".concat(a[1],": ").concat(r[1]);if(r){let e=r[1];return"".concat({400:"BadRequestError",401:"AuthenticationError",403:"ForbiddenError",404:"NotFoundError",408:"TimeoutError",429:"RateLimitError",500:"InternalServerError",502:"BadGatewayError",503:"ServiceUnavailableError",504:"GatewayTimeoutError"}[e],": ").concat(e)}if(a){let e=a[1],l={AuthenticationError:"401",RateLimitError:"429",BadRequestError:"400",InternalServerError:"500",TimeoutError:"408",NotFoundError:"404",ForbiddenError:"403",ServiceUnavailableError:"503",BadGatewayError:"502",GatewayTimeoutError:"504",ContentPolicyViolationError:"400"}[e];return l?"".concat(e,": ").concat(l):e}for(let{pattern:e,replacement:l}of lN)if(e.test(t))return l;if(/missing.*api.*key|invalid.*key|unauthorized/i.test(t))return"AuthenticationError: 401";if(/rate.*limit|too.*many.*requests/i.test(t))return"RateLimitError: 429";if(/timeout|timed.*out/i.test(t))return"TimeoutError: 408";if(/not.*found/i.test(t))return"NotFoundError: 404";if(/forbidden|access.*denied/i.test(t))return"ForbiddenError: 403";if(/internal.*server.*error/i.test(t))return"InternalServerError: 500";let i=t.replace(/[\n\r]+/g," ").replace(/\s+/g," ").trim(),n=null===(l=i.split(/[.!?]/)[0])||void 0===l?void 0:l.trim();return n&&n.length>0?n.length>100?n.substring(0,97)+"...":n:i.length>100?i.substring(0,97)+"...":i},k=async e=>{if(l){d(l=>({...l,[e]:{...l[e],loading:!0,status:"checking"}}));try{var s,r;let i=await (0,a.individualModelHealthCheckCall)(l,e),n=new Date().toLocaleString();if(i.unhealthy_count>0&&i.unhealthy_endpoints&&i.unhealthy_endpoints.length>0){let l=(null===(s=i.unhealthy_endpoints[0])||void 0===s?void 0:s.error)||"Health check failed",t=C(l);d(s=>{var a;return{...s,[e]:{status:"unhealthy",lastCheck:n,lastSuccess:(null===(a=s[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:l}}})}else d(l=>({...l,[e]:{status:"healthy",lastCheck:n,lastSuccess:n,loading:!1,successResponse:i}}));try{let s=await (0,a.latestHealthChecksCall)(l),i=t.data.find(l=>l.model_name===e);if(i){let l=i.model_info.id,t=null===(r=s.latest_health_checks)||void 0===r?void 0:r[l];if(t){let l=t.error_message||void 0;d(s=>{var a,r,i,n,o,d,c;return{...s,[e]:{status:t.status||(null===(a=s[e])||void 0===a?void 0:a.status)||"unknown",lastCheck:t.checked_at?new Date(t.checked_at).toLocaleString():(null===(r=s[e])||void 0===r?void 0:r.lastCheck)||"None",lastSuccess:"healthy"===t.status?t.checked_at?new Date(t.checked_at).toLocaleString():(null===(i=s[e])||void 0===i?void 0:i.lastSuccess)||"None":(null===(n=s[e])||void 0===n?void 0:n.lastSuccess)||"None",loading:!1,error:l?C(l):null===(o=s[e])||void 0===o?void 0:o.error,fullError:l||(null===(d=s[e])||void 0===d?void 0:d.fullError),successResponse:"healthy"===t.status?t:null===(c=s[e])||void 0===c?void 0:c.successResponse}}})}}}catch(e){console.debug("Could not fetch updated status from database (non-critical):",e)}}catch(a){let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=C(t);d(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}}},S=async()=>{let e=c.length>0?c:r,s=e.reduce((e,l)=>(e[l]={...o[l],loading:!0,status:"checking"},e),{});d(e=>({...e,...s}));let i={},n=e.map(async e=>{if(l)try{let s=await (0,a.individualModelHealthCheckCall)(l,e);i[e]=s;let r=new Date().toLocaleString();if(s.unhealthy_count>0&&s.unhealthy_endpoints&&s.unhealthy_endpoints.length>0){var t;let l=(null===(t=s.unhealthy_endpoints[0])||void 0===t?void 0:t.error)||"Health check failed",a=C(l);d(t=>{var s;return{...t,[e]:{status:"unhealthy",lastCheck:r,lastSuccess:(null===(s=t[e])||void 0===s?void 0:s.lastSuccess)||"None",loading:!1,error:a,fullError:l}}})}else d(l=>({...l,[e]:{status:"healthy",lastCheck:r,lastSuccess:r,loading:!1,successResponse:s}}))}catch(a){console.error("Health check failed for ".concat(e,":"),a);let l=new Date().toLocaleString(),t=a instanceof Error?a.message:String(a),s=C(t);d(a=>{var r;return{...a,[e]:{status:"unhealthy",lastCheck:l,lastSuccess:(null===(r=a[e])||void 0===r?void 0:r.lastSuccess)||"None",loading:!1,error:s,fullError:t}}})}});await Promise.allSettled(n);try{if(!l)return;let s=await (0,a.latestHealthChecksCall)(l);s.latest_health_checks&&Object.entries(s.latest_health_checks).forEach(l=>{let[s,a]=l,r=t.data.find(e=>e.model_info.id===s);if(r&&e.includes(r.model_name)&&a){let e=r.model_name,l=a.error_message||void 0;d(t=>{let s=t[e];return{...t,[e]:{status:a.status||(null==s?void 0:s.status)||"unknown",lastCheck:a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastCheck)||"None",lastSuccess:"healthy"===a.status&&a.checked_at?new Date(a.checked_at).toLocaleString():(null==s?void 0:s.lastSuccess)||"None",loading:!1,error:l?C(l):null==s?void 0:s.error,fullError:l||(null==s?void 0:s.fullError),successResponse:"healthy"===a.status?a:null==s?void 0:s.successResponse}}})}})}catch(e){console.warn("Failed to fetch updated health statuses from database (non-critical):",e)}},A=e=>{h(e),e?m(r):m([])},E=()=>{p(!1),j(null)},P=()=>{b(!1),Z(null)};return(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(R.Z,{children:"Model Health Status"}),(0,s.jsx)(L.Z,{className:"text-gray-600 mt-1",children:"Run health checks on individual models to verify they are working correctly"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[c.length>0&&(0,s.jsx)(_.Z,{size:"sm",variant:"light",onClick:()=>A(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,s.jsx)(_.Z,{size:"sm",variant:"secondary",onClick:S,disabled:Object.values(o).some(e=>e.loading),className:"px-3 py-1 text-sm",children:c.length>0&&c.length{l?m(l=>[...l,e]):(m(l=>l.filter(l=>l!==e)),h(!1))},A,k,e=>{switch(e){case"healthy":return(0,s.jsx)(v.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,s.jsx)(v.Z,{color:"red",children:"unhealthy"});case"checking":return(0,s.jsx)(v.Z,{color:"blue",children:"checking"});case"none":return(0,s.jsx)(v.Z,{color:"gray",children:"none"});default:return(0,s.jsx)(v.Z,{color:"gray",children:"unknown"})}},i,(e,l,t)=>{j({modelName:e,cleanedError:l,fullError:t}),p(!0)},(e,l)=>{Z({modelName:e,response:l}),b(!0)},n),data:t.data.map(e=>{let l=o[e.model_name]||{status:"none",lastCheck:"None",loading:!1};return{model_name:e.model_name,model_info:e.model_info,provider:e.provider,litellm_model_name:e.litellm_model_name,health_status:l.status,last_check:l.lastCheck,last_success:l.lastSuccess||"None",health_loading:l.loading,health_error:l.error,health_full_error:l.fullError}}),isLoading:!1})}),(0,s.jsx)(K.Z,{title:f?"Health Check Error - ".concat(f.modelName):"Error Details",open:x,onCancel:E,footer:[(0,s.jsx)(U.ZP,{onClick:E,children:"Close"},"close")],width:800,children:f&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Error:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,s.jsx)(L.Z,{className:"text-red-800",children:f.cleanedError})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Full Error Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:f.fullError})})]})]})}),(0,s.jsx)(K.Z,{title:w?"Health Check Response - ".concat(w.modelName):"Response Details",open:y,onCancel:P,footer:[(0,s.jsx)(U.ZP,{onClick:P,children:"Close"},"close")],width:800,children:w&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Status:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-green-50 border border-green-200 rounded-md",children:(0,s.jsx)(L.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Response Details:"}),(0,s.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md max-h-96 overflow-y-auto",children:(0,s.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:JSON.stringify(w.response,null,2)})})]})]})})]})},lZ=t(86462),lC=t(47686),lk=t(77355),lS=t(93416),lA=t(95704),lE=e=>{let{accessToken:l,initialModelGroupAlias:t={},onAliasUpdate:r}=e,[i,n]=(0,N.useState)([]),[o,d]=(0,N.useState)({aliasName:"",targetModelGroup:""}),[c,m]=(0,N.useState)(null),[u,h]=(0,N.useState)(!0);(0,N.useEffect)(()=>{n(Object.entries(t).map((e,l)=>{var t;let[s,a]=e;return{id:"".concat(l,"-").concat(s),aliasName:s,targetModelGroup:"string"==typeof a?a:null!==(t=null==a?void 0:a.model)&&void 0!==t?t:""}}))},[t]);let x=async e=>{if(!l)return console.error("Access token is missing"),!1;try{let t={};return e.forEach(e=>{t[e.aliasName]=e.targetModelGroup}),console.log("Saving model group alias:",t),await (0,a.setCallbacksCall)(l,{router_settings:{model_group_alias:t}}),r&&r(t),!0}catch(e){return console.error("Failed to save model group alias settings:",e),$.Z.fromBackend("Failed to save model group alias settings"),!1}},p=async()=>{if(!o.aliasName||!o.targetModelGroup){$.Z.fromBackend("Please provide both alias name and target model group");return}if(i.some(e=>e.aliasName===o.aliasName)){$.Z.fromBackend("An alias with this name already exists");return}let e=[...i,{id:"".concat(Date.now(),"-").concat(o.aliasName),aliasName:o.aliasName,targetModelGroup:o.targetModelGroup}];await x(e)&&(n(e),d({aliasName:"",targetModelGroup:""}),$.Z.success("Alias added successfully"))},g=e=>{m({...e})},f=async()=>{if(!c)return;if(!c.aliasName||!c.targetModelGroup){$.Z.fromBackend("Please provide both alias name and target model group");return}if(i.some(e=>e.id!==c.id&&e.aliasName===c.aliasName)){$.Z.fromBackend("An alias with this name already exists");return}let e=i.map(e=>e.id===c.id?c:e);await x(e)&&(n(e),m(null),$.Z.success("Alias updated successfully"))},v=()=>{m(null)},_=async e=>{let l=i.filter(l=>l.id!==e);await x(l)&&(n(l),$.Z.success("Alias deleted successfully"))},y=i.reduce((e,l)=>(e[l.aliasName]=l.targetModelGroup,e),{});return(0,s.jsxs)(lA.Zb,{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>h(!u),children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(lA.Dx,{className:"mb-0",children:"Model Group Alias Settings"}),(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Create aliases for your model groups to simplify API calls. For example, you can create an alias 'gpt-4o' that points to 'gpt-4o-mini-openai' model group."})]}),(0,s.jsx)("div",{className:"flex items-center",children:u?(0,s.jsx)(lZ.Z,{className:"w-5 h-5 text-gray-500"}):(0,s.jsx)(lC.Z,{className:"w-5 h-5 text-gray-500"})})]}),u&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(lA.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Alias"}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Alias Name"}),(0,s.jsx)("input",{type:"text",value:o.aliasName,onChange:e=>d({...o,aliasName:e.target.value}),placeholder:"e.g., gpt-4o",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Target Model Group"}),(0,s.jsx)("input",{type:"text",value:o.targetModelGroup,onChange:e=>d({...o,targetModelGroup:e.target.value}),placeholder:"e.g., gpt-4o-mini-openai",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,s.jsx)("div",{className:"flex items-end",children:(0,s.jsxs)("button",{onClick:p,disabled:!o.aliasName||!o.targetModelGroup,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(o.aliasName&&o.targetModelGroup?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,s.jsx)(lk.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,s.jsx)(lA.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Aliases"}),(0,s.jsx)("div",{className:"rounded-lg custom-border relative mb-6",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(lA.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(lA.ss,{children:(0,s.jsxs)(lA.SC,{children:[(0,s.jsx)(lA.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,s.jsx)(lA.xs,{className:"py-1 h-8",children:"Target Model Group"}),(0,s.jsx)(lA.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,s.jsxs)(lA.RM,{children:[i.map(e=>(0,s.jsx)(lA.SC,{className:"h-8",children:c&&c.id===e.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lA.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:c.aliasName,onChange:e=>m({...c,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lA.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:c.targetModelGroup,onChange:e=>m({...c,targetModelGroup:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lA.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:f,className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:"Save"}),(0,s.jsx)("button",{onClick:v,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lA.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,s.jsx)(lA.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModelGroup}),(0,s.jsx)(lA.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:()=>g(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,s.jsx)(lS.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>_(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,s.jsx)(j.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===i.length&&(0,s.jsx)(lA.SC,{children:(0,s.jsx)(lA.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No aliases added yet. Add a new alias above."})})]})]})})}),(0,s.jsxs)(lA.Zb,{children:[(0,s.jsx)(lA.Dx,{className:"mb-4",children:"Configuration Example"}),(0,s.jsx)(lA.xv,{className:"text-gray-600 mb-4",children:"Here's how your current aliases would look in the config.yaml:"}),(0,s.jsx)("div",{className:"bg-gray-100 rounded-lg p-4 font-mono text-sm",children:(0,s.jsxs)("div",{className:"text-gray-700",children:["router_settings:",(0,s.jsx)("br",{}),"\xa0\xa0model_group_alias:",0===Object.keys(y).length?(0,s.jsxs)("span",{className:"text-gray-500",children:[(0,s.jsx)("br",{}),"\xa0\xa0\xa0\xa0# No aliases configured yet"]}):Object.entries(y).map(e=>{let[l,t]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("br",{}),'\xa0\xa0\xa0\xa0"',l,'": "',t,'"']},l)})]})})]})]})]})},lP=t(10900),lF=t(12514),lL=t(49566),lM=t(30401),lI=t(78867),lT=t(59872),lR=e=>{let{isVisible:l,onCancel:t,onSuccess:r,modelData:i,accessToken:n,userRole:o}=e,[d]=er.Z.useForm(),[c,m]=(0,N.useState)(!1),[u,h]=(0,N.useState)([]),[x,p]=(0,N.useState)([]),[g,f]=(0,N.useState)(!1),[j,v]=(0,N.useState)(!1),[_,y]=(0,N.useState)(null);(0,N.useEffect)(()=>{l&&i&&b()},[l,i]),(0,N.useEffect)(()=>{let e=async()=>{if(n)try{let e=await (0,a.modelAvailableCall)(n,"","",!1,null,!0,!0);h(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(n)try{let e=await (0,eU.p)(n);p(e)}catch(e){console.error("Error fetching model info:",e)}};l&&(e(),t())},[l,n]);let b=()=>{try{var e,l,t,s,a,r;let n=null;(null===(e=i.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(n="string"==typeof i.litellm_params.auto_router_config?JSON.parse(i.litellm_params.auto_router_config):i.litellm_params.auto_router_config),y(n),d.setFieldsValue({auto_router_name:i.model_name,auto_router_default_model:(null===(l=i.litellm_params)||void 0===l?void 0:l.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=i.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(s=i.model_info)||void 0===s?void 0:s.access_groups)||[]});let o=new Set(x.map(e=>e.model_group));f(!o.has(null===(a=i.litellm_params)||void 0===a?void 0:a.auto_router_default_model)),v(!o.has(null===(r=i.litellm_params)||void 0===r?void 0:r.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),$.Z.fromBackend("Error loading auto router configuration")}},w=async()=>{try{m(!0);let e=await d.validateFields(),l={...i.litellm_params,auto_router_config:JSON.stringify(_),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},s={...i.model_info,access_groups:e.model_access_group||[]},o={model_name:e.auto_router_name,litellm_params:l,model_info:s};await (0,a.modelPatchUpdateCall)(n,o,i.model_info.id);let c={...i,model_name:e.auto_router_name,litellm_params:l,model_info:s};$.Z.success("Auto router configuration updated successfully"),r(c),t()}catch(e){console.error("Error updating auto router:",e),$.Z.fromBackend("Failed to update auto router configuration")}finally{m(!1)}},Z=x.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsx)(K.Z,{title:"Edit Auto Router Configuration",open:l,onCancel:t,footer:[(0,s.jsx)(U.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,s.jsx)(U.ZP,{loading:c,onClick:w,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(eu.x,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,s.jsxs)(er.Z,{form:d,layout:"vertical",className:"space-y-4",children:[(0,s.jsx)(er.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,s.jsx)(eu.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(eQ,{modelInfo:x,value:_,onChange:e=>{y(e)}})}),(0,s.jsx)(er.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,s.jsx)(eo.default,{placeholder:"Select a default model",onChange:e=>{f("custom"===e)},options:[...Z,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,s.jsx)(er.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,s.jsx)(eo.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{v("custom"===e)},options:[...Z,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===o&&(0,s.jsx)(er.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,s.jsx)(eo.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:u.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};let{Title:lO,Link:lq}=D.default;var lV=e=>{let{isVisible:l,onCancel:t,onAddCredential:a,existingCredential:r,setIsCredentialModalOpen:i}=e,[n]=er.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(r))),(0,s.jsx)(K.Z,{title:"Reuse Credentials",visible:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,children:(0,s.jsxs)(er.Z,{form:n,onFinish:e=>{a(e),n.resetFields(),i(!1)},layout:"vertical",children:[(0,s.jsx)(er.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],initialValue:null==r?void 0:r.credential_name,children:(0,s.jsx)(en.o,{placeholder:"Enter a friendly name for these credentials"})}),Object.entries((null==r?void 0:r.credential_values)||{}).map(e=>{let[l,t]=e;return(0,s.jsx)(er.Z.Item,{label:l,name:l,initialValue:t,children:(0,s.jsx)(en.o,{placeholder:"Enter ".concat(l),disabled:!0})},l)}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(b.Z,{title:"Get help on our github",children:(0,s.jsx)(lq,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(U.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(U.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})};function lD(e){var l,t,r,i,n,o,d,c,m,u,x,p,g,v,y,Z,C,E,P,M,I,T,O,q,V,D,z,B,G,H,J,W,Y,Q,X;let{modelId:ee,onClose:el,modelData:et,accessToken:es,userID:ea,userRole:en,onModelUpdate:ed,modelAccessGroups:ec}=e,[em]=er.Z.useForm(),[eu,eh]=(0,N.useState)(null),[ex,ep]=(0,N.useState)(!1),[ef,ej]=(0,N.useState)(!1),[ev,e_]=(0,N.useState)(!1),[ey,eb]=(0,N.useState)(!1),[eN,ew]=(0,N.useState)(!1),[eZ,eC]=(0,N.useState)(!1),[eS,eA]=(0,N.useState)(null),[eM,eI]=(0,N.useState)(!1),[eT,eR]=(0,N.useState)({}),[eO,eq]=(0,N.useState)(!1),[eV,eD]=(0,N.useState)([]),[ez,eB]=(0,N.useState)({}),eU=("Admin"===en||(null==et?void 0:null===(l=et.model_info)||void 0===l?void 0:l.created_by)===ea)&&(null==et?void 0:null===(t=et.model_info)||void 0===t?void 0:t.db_model),eG="Admin"===en,eH=(null==et?void 0:null===(r=et.litellm_params)||void 0===r?void 0:r.auto_router_config)!=null,{data:eK}=h();console.log("modelsInfoData, ",eK);let eJ=(null==et?void 0:null===(i=et.litellm_params)||void 0===i?void 0:i.litellm_credential_name)!=null&&(null==et?void 0:null===(n=et.litellm_params)||void 0===n?void 0:n.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eJ),console.log("modelData.litellm_params.litellm_credential_name, ",null==et?void 0:null===(o=et.litellm_params)||void 0===o?void 0:o.litellm_credential_name),console.log("tagsList, ",null===(d=et.litellm_params)||void 0===d?void 0:d.tags),(0,N.useEffect)(()=>{let e=async()=>{var e,l,t,s,r,i,n;if(!es)return;let o=await (0,a.modelInfoV1Call)(es,ee);console.log("modelInfoResponse, ",o);let d=o.data[0];d&&!d.litellm_model_name&&(d={...d,litellm_model_name:null!==(n=null!==(i=null!==(r=null==d?void 0:null===(l=d.litellm_params)||void 0===l?void 0:l.litellm_model_name)&&void 0!==r?r:null==d?void 0:null===(t=d.litellm_params)||void 0===t?void 0:t.model)&&void 0!==i?i:null==d?void 0:null===(s=d.model_info)||void 0===s?void 0:s.key)&&void 0!==n?n:null}),eh(d),(null==d?void 0:null===(e=d.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&eI(!0)},l=async()=>{if(es)try{let e=(await (0,a.getGuardrailsList)(es)).guardrails.map(e=>e.guardrail_name);eD(e)}catch(e){console.error("Failed to fetch guardrails:",e)}},t=async()=>{if(es)try{let e=await (0,a.tagListCall)(es);eB(e)}catch(e){console.error("Failed to fetch tags:",e)}};(async()=>{if(console.log("accessToken, ",es),!es||eJ)return;let e=await (0,a.credentialGetCall)(es,null,ee);console.log("existingCredentialResponse, ",e),eA({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),l(),t()},[es,ee]);let eW=async e=>{var l;if(console.log("values, ",e),!es)return;let t={credential_name:e.credential_name,model_id:ee,credential_info:{custom_llm_provider:null===(l=eu.litellm_params)||void 0===l?void 0:l.custom_llm_provider}};$.Z.info("Storing credential.."),console.log("credentialResponse, ",await (0,a.credentialCreateCall)(es,t)),$.Z.success("Credential stored successfully")},eY=async e=>{try{var l;let t;if(!es)return;ew(!0),console.log("values.model_name, ",e.model_name);let s={};try{s=e.litellm_extra_params?JSON.parse(e.litellm_extra_params):{}}catch(e){$.Z.fromBackend("Invalid JSON in LiteLLM Params"),ew(!1);return}let r={...e.litellm_params,...s,model:e.litellm_model_name,api_base:e.api_base,custom_llm_provider:e.custom_llm_provider,organization:e.organization,tpm:e.tpm,rpm:e.rpm,max_retries:e.max_retries,timeout:e.timeout,stream_timeout:e.stream_timeout,input_cost_per_token:e.input_cost/1e6,output_cost_per_token:e.output_cost/1e6,tags:e.tags};e.guardrails&&(r.guardrails=e.guardrails),e.cache_control&&(null===(l=e.cache_control_injection_points)||void 0===l?void 0:l.length)>0?r.cache_control_injection_points=e.cache_control_injection_points:delete r.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):et.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group}),void 0!==e.health_check_model&&(t={...t,health_check_model:e.health_check_model})}catch(e){$.Z.fromBackend("Invalid JSON in Model Info");return}let i={model_name:e.model_name,litellm_params:r,model_info:t};await (0,a.modelPatchUpdateCall)(es,i,ee);let n={...eu,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:r,model_info:t};eh(n),ed&&ed(n),$.Z.success("Model settings updated successfully"),eb(!1),eC(!1)}catch(e){console.error("Error updating model:",e),$.Z.fromBackend("Failed to update model settings")}finally{ew(!1)}};if(!et)return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(_.Z,{icon:lP.Z,variant:"light",onClick:el,className:"mb-4",children:"Back to Models"}),(0,s.jsx)(L.Z,{children:"Model not found"})]});let e$=async()=>{if(es)try{var e,l,t;$.Z.info("Testing connection...");let s=await (0,a.testConnectionRequest)(es,{custom_llm_provider:eu.litellm_params.custom_llm_provider,litellm_credential_name:eu.litellm_params.litellm_credential_name,model:eu.litellm_model_name},{mode:null===(e=eu.model_info)||void 0===e?void 0:e.mode},null===(l=eu.model_info)||void 0===l?void 0:l.mode);if("success"===s.status)$.Z.success("Connection test successful!");else throw Error((null==s?void 0:null===(t=s.result)||void 0===t?void 0:t.error)||(null==s?void 0:s.message)||"Unknown error")}catch(e){e instanceof Error?$.Z.error("Error testing connection: "+(0,li.aS)(e.message,100)):$.Z.error("Error testing connection: "+String(e))}},eQ=async()=>{try{if(ej(!0),!es)return;await (0,a.modelDeleteCall)(es,ee),$.Z.success("Model deleted successfully"),ed&&ed({deleted:!0,model_info:{id:ee}}),el()}catch(e){console.error("Error deleting the model:",e),$.Z.fromBackend("Failed to delete model")}finally{ej(!1),ep(!1)}},eX=async(e,l)=>{await (0,lT.vQ)(e)&&(eR(e=>({...e,[l]:!0})),setTimeout(()=>{eR(e=>({...e,[l]:!1}))},2e3))},e0=et.litellm_model_name.includes("*");return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(_.Z,{icon:lP.Z,variant:"light",onClick:el,className:"mb-4",children:"Back to Models"}),(0,s.jsxs)(R.Z,{children:["Public Model Name: ",k(et)]}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(L.Z,{className:"text-gray-500 font-mono",children:et.model_info.id}),(0,s.jsx)(U.ZP,{type:"text",size:"small",icon:eT["model-id"]?(0,s.jsx)(lM.Z,{size:12}):(0,s.jsx)(lI.Z,{size:12}),onClick:()=>eX(et.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eT["model-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(_.Z,{variant:"secondary",icon:ek.Z,onClick:e$,className:"flex items-center gap-2","data-testid":"test-connection-button",children:"Test Connection"}),(0,s.jsx)(_.Z,{icon:f.Z,variant:"secondary",onClick:()=>e_(!0),className:"flex items-center",disabled:!eG,"data-testid":"reuse-credentials-button",children:"Re-use Credentials"}),(0,s.jsx)(_.Z,{icon:j.Z,variant:"secondary",onClick:()=>ep(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-700",disabled:!eU,"data-testid":"delete-model-button",children:"Delete Model"})]})]}),(0,s.jsxs)(eP.Z,{children:[(0,s.jsxs)(eF.Z,{className:"mb-6",children:[(0,s.jsx)(eE.Z,{children:"Overview"}),(0,s.jsx)(eE.Z,{children:"Raw JSON"})]}),(0,s.jsxs)(eL.Z,{children:[(0,s.jsxs)(F.Z,{children:[(0,s.jsxs)(A.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,s.jsxs)(lF.Z,{children:[(0,s.jsx)(L.Z,{children:"Provider"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[et.provider&&(0,s.jsx)("img",{src:(0,w.dr)(et.provider).logo,alt:"".concat(et.provider," logo"),className:"w-4 h-4",onError:e=>{let l=e.currentTarget,t=l.parentElement;if(t&&t.contains(l))try{var s;let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null===(s=et.provider)||void 0===s?void 0:s.charAt(0))||"-",t.replaceChild(e,l)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}),(0,s.jsx)(R.Z,{children:et.provider||"Not Set"})]})]}),(0,s.jsxs)(lF.Z,{children:[(0,s.jsx)(L.Z,{children:"LiteLLM Model"}),(0,s.jsx)("div",{className:"mt-2 overflow-hidden",children:(0,s.jsx)(b.Z,{title:et.litellm_model_name||"Not Set",children:(0,s.jsx)("div",{className:"break-all text-sm font-medium leading-relaxed cursor-pointer",children:et.litellm_model_name||"Not Set"})})})]}),(0,s.jsxs)(lF.Z,{children:[(0,s.jsx)(L.Z,{children:"Pricing"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(L.Z,{children:["Input: $",et.input_cost,"/1M tokens"]}),(0,s.jsxs)(L.Z,{children:["Output: $",et.output_cost,"/1M tokens"]})]})]})]}),(0,s.jsxs)("div",{className:"mb-6 text-sm text-gray-500 flex items-center gap-x-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Created At"," ",et.model_info.created_at?new Date(et.model_info.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"Not Set"]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Created By ",et.model_info.created_by||"Not Set"]})]}),(0,s.jsxs)(lF.Z,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(R.Z,{children:"Model Settings"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[eH&&eU&&!eZ&&(0,s.jsx)(_.Z,{onClick:()=>eq(!0),className:"flex items-center",children:"Edit Auto Router"}),eU?!eZ&&(0,s.jsx)(_.Z,{onClick:()=>eC(!0),className:"flex items-center",children:"Edit Settings"}):(0,s.jsx)(b.Z,{title:"Only DB models can be edited. You must be an admin or the creator of the model to edit it.",children:(0,s.jsx)(S.Z,{})})]})]}),eu?(0,s.jsx)(er.Z,{form:em,onFinish:eY,initialValues:{model_name:eu.model_name,litellm_model_name:eu.litellm_model_name,api_base:eu.litellm_params.api_base,custom_llm_provider:eu.litellm_params.custom_llm_provider,organization:eu.litellm_params.organization,tpm:eu.litellm_params.tpm,rpm:eu.litellm_params.rpm,max_retries:eu.litellm_params.max_retries,timeout:eu.litellm_params.timeout,stream_timeout:eu.litellm_params.stream_timeout,input_cost:eu.litellm_params.input_cost_per_token?1e6*eu.litellm_params.input_cost_per_token:(null===(c=eu.model_info)||void 0===c?void 0:c.input_cost_per_token)*1e6||null,output_cost:(null===(m=eu.litellm_params)||void 0===m?void 0:m.output_cost_per_token)?1e6*eu.litellm_params.output_cost_per_token:(null===(u=eu.model_info)||void 0===u?void 0:u.output_cost_per_token)*1e6||null,cache_control:null!==(x=eu.litellm_params)&&void 0!==x&&!!x.cache_control_injection_points,cache_control_injection_points:(null===(p=eu.litellm_params)||void 0===p?void 0:p.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(g=eu.model_info)||void 0===g?void 0:g.access_groups)?eu.model_info.access_groups:[],guardrails:Array.isArray(null===(v=eu.litellm_params)||void 0===v?void 0:v.guardrails)?eu.litellm_params.guardrails:[],tags:Array.isArray(null===(y=eu.litellm_params)||void 0===y?void 0:y.tags)?eu.litellm_params.tags:[],health_check_model:e0?null===(Z=eu.model_info)||void 0===Z?void 0:Z.health_check_model:null,litellm_extra_params:JSON.stringify(eu.litellm_params||{},null,2)},layout:"vertical",onValuesChange:()=>eb(!0),children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Model Name"}),eZ?(0,s.jsx)(er.Z.Item,{name:"model_name",className:"mb-0",children:(0,s.jsx)(lL.Z,{placeholder:"Enter model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eu.model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eZ?(0,s.jsx)(er.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,s.jsx)(lL.Z,{placeholder:"Enter LiteLLM model name"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:eu.litellm_model_name})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eZ?(0,s.jsx)(er.Z.Item,{name:"input_cost",className:"mb-0",children:(0,s.jsx)(ls.Z,{placeholder:"Enter input cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eu?void 0:null===(C=eu.litellm_params)||void 0===C?void 0:C.input_cost_per_token)?((null===(E=eu.litellm_params)||void 0===E?void 0:E.input_cost_per_token)*1e6).toFixed(4):(null==eu?void 0:null===(P=eu.model_info)||void 0===P?void 0:P.input_cost_per_token)?(1e6*eu.model_info.input_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eZ?(0,s.jsx)(er.Z.Item,{name:"output_cost",className:"mb-0",children:(0,s.jsx)(ls.Z,{placeholder:"Enter output cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eu?void 0:null===(M=eu.litellm_params)||void 0===M?void 0:M.output_cost_per_token)?(1e6*eu.litellm_params.output_cost_per_token).toFixed(4):(null==eu?void 0:null===(I=eu.model_info)||void 0===I?void 0:I.output_cost_per_token)?(1e6*eu.model_info.output_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"API Base"}),eZ?(0,s.jsx)(er.Z.Item,{name:"api_base",className:"mb-0",children:(0,s.jsx)(lL.Z,{placeholder:"Enter API base"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(T=eu.litellm_params)||void 0===T?void 0:T.api_base)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Custom LLM Provider"}),eZ?(0,s.jsx)(er.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,s.jsx)(lL.Z,{placeholder:"Enter custom LLM provider"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(O=eu.litellm_params)||void 0===O?void 0:O.custom_llm_provider)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Organization"}),eZ?(0,s.jsx)(er.Z.Item,{name:"organization",className:"mb-0",children:(0,s.jsx)(lL.Z,{placeholder:"Enter organization"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=eu.litellm_params)||void 0===q?void 0:q.organization)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eZ?(0,s.jsx)(er.Z.Item,{name:"tpm",className:"mb-0",children:(0,s.jsx)(ls.Z,{placeholder:"Enter TPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(V=eu.litellm_params)||void 0===V?void 0:V.tpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eZ?(0,s.jsx)(er.Z.Item,{name:"rpm",className:"mb-0",children:(0,s.jsx)(ls.Z,{placeholder:"Enter RPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(D=eu.litellm_params)||void 0===D?void 0:D.rpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Max Retries"}),eZ?(0,s.jsx)(er.Z.Item,{name:"max_retries",className:"mb-0",children:(0,s.jsx)(ls.Z,{placeholder:"Enter max retries"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(z=eu.litellm_params)||void 0===z?void 0:z.max_retries)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Timeout (seconds)"}),eZ?(0,s.jsx)(er.Z.Item,{name:"timeout",className:"mb-0",children:(0,s.jsx)(ls.Z,{placeholder:"Enter timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(B=eu.litellm_params)||void 0===B?void 0:B.timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eZ?(0,s.jsx)(er.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,s.jsx)(ls.Z,{placeholder:"Enter stream timeout"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(G=eu.litellm_params)||void 0===G?void 0:G.stream_timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Model Access Groups"}),eZ?(0,s.jsx)(er.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,s.jsx)(eo.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:null==ec?void 0:ec.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(H=eu.model_info)||void 0===H?void 0:H.access_groups)?Array.isArray(eu.model_info.access_groups)?eu.model_info.access_groups.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eu.model_info.access_groups.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},l))}):"No groups assigned":eu.model_info.access_groups:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(L.Z,{className:"font-medium",children:["Guardrails",(0,s.jsx)(b.Z,{title:"Apply safety guardrails to this model to filter content or enforce policies",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(S.Z,{style:{marginLeft:"4px"}})})})]}),eZ?(0,s.jsx)(er.Z.Item,{name:"guardrails",className:"mb-0",children:(0,s.jsx)(eo.default,{mode:"tags",showSearch:!0,placeholder:"Select existing guardrails or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:eV.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(J=eu.litellm_params)||void 0===J?void 0:J.guardrails)?Array.isArray(eu.litellm_params.guardrails)?eu.litellm_params.guardrails.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eu.litellm_params.guardrails.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:e},l))}):"No guardrails assigned":eu.litellm_params.guardrails:"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Tags"}),eZ?(0,s.jsx)(er.Z.Item,{name:"tags",className:"mb-0",children:(0,s.jsx)(eo.default,{mode:"tags",showSearch:!0,placeholder:"Select existing tags or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"},options:Object.values(ez).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(W=eu.litellm_params)||void 0===W?void 0:W.tags)?Array.isArray(eu.litellm_params.tags)?eu.litellm_params.tags.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:eu.litellm_params.tags.map((e,l)=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-purple-100 text-purple-800",children:e},l))}):"No tags assigned":eu.litellm_params.tags:"Not Set"})]}),e0&&(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Health Check Model"}),eZ?(0,s.jsx)(er.Z.Item,{name:"health_check_model",className:"mb-0",children:(0,s.jsx)(eo.default,{showSearch:!0,placeholder:"Select existing health check model",optionFilterProp:"children",allowClear:!0,options:(()=>{var e;let l=new Set;return null==eK?void 0:null===(e=eK.data)||void 0===e?void 0:e.filter(e=>e.provider===et.litellm_model_name.split("/")[0]&&e.model_name!==et.litellm_model_name).filter(e=>!l.has(e.model_name)&&(l.add(e.model_name),!0)).map(e=>({value:e.model_name,label:e.model_name}))})()})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(Y=eu.model_info)||void 0===Y?void 0:Y.health_check_model)||"Not Set"})]}),eZ?(0,s.jsx)(lr,{form:em,showCacheControl:eM,onCacheControlChange:e=>eI(e)}):(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Cache Control"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(Q=eu.litellm_params)||void 0===Q?void 0:Q.cache_control_injection_points)?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"Enabled"}),(0,s.jsx)("div",{className:"mt-2",children:eu.litellm_params.cache_control_injection_points.map((e,l)=>(0,s.jsxs)("div",{className:"text-sm text-gray-600 mb-1",children:["Location: ",e.location,",",e.role&&(0,s.jsxs)("span",{children:[" Role: ",e.role]}),void 0!==e.index&&(0,s.jsxs)("span",{children:[" Index: ",e.index]})]},l))})]}):"Disabled"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Model Info"}),eZ?(0,s.jsx)(er.Z.Item,{name:"model_info",className:"mb-0",children:(0,s.jsx)(eg.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}',defaultValue:JSON.stringify(et.model_info,null,2)})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(eu.model_info,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(L.Z,{className:"font-medium",children:["LiteLLM Params",(0,s.jsx)(b.Z,{title:"Optional litellm params used for making a litellm.completion() call. Some params are automatically added by LiteLLM.",children:(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(S.Z,{style:{marginLeft:"4px"}})})})]}),eZ?(0,s.jsx)(er.Z.Item,{name:"litellm_extra_params",rules:[{validator:li.Ac}],children:(0,s.jsx)(eg.default.TextArea,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(0,s.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(eu.litellm_params,null,2)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.Z,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:et.model_info.team_id||"Not Set"})]})]}),eZ&&(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,s.jsx)(_.Z,{variant:"secondary",onClick:()=>{em.resetFields(),eb(!1),eC(!1)},disabled:eN,children:"Cancel"}),(0,s.jsx)(_.Z,{variant:"primary",onClick:()=>em.submit(),loading:eN,children:"Save Changes"})]})]})}):(0,s.jsx)(L.Z,{children:"Loading..."})]})]}),(0,s.jsx)(F.Z,{children:(0,s.jsx)(lF.Z,{children:(0,s.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(et,null,2)})})})]})]}),(0,s.jsx)(ei.Z,{isOpen:ex,title:"Delete Model",alertMessage:"This action cannot be undone.",message:"Are you sure you want to delete this model?",resourceInformationTitle:"Model Information",resourceInformation:[{label:"Model Name",value:(null==et?void 0:et.model_name)||"Not Set"},{label:"LiteLLM Model Name",value:(null==et?void 0:et.litellm_model_name)||"Not Set"},{label:"Provider",value:(null==et?void 0:et.provider)||"Not Set"},{label:"Created By",value:(null==et?void 0:null===(X=et.model_info)||void 0===X?void 0:X.created_by)||"Not Set"}],onCancel:()=>ep(!1),onOk:eQ,confirmLoading:ef}),ev&&!eJ?(0,s.jsx)(lV,{isVisible:ev,onCancel:()=>e_(!1),onAddCredential:eW,existingCredential:eS,setIsCredentialModalOpen:e_}):(0,s.jsx)(K.Z,{open:ev,onCancel:()=>e_(!1),title:"Using Existing Credential",children:(0,s.jsx)(L.Z,{children:et.litellm_params.litellm_credential_name})}),(0,s.jsx)(lR,{isVisible:eO,onCancel:()=>eq(!1),onSuccess:e=>{eh(e),ed&&ed(e)},modelData:eu||et,accessToken:es||"",userRole:en||""})]})}var lz=t(27593),lB=t(93542),lU=e=>{var l;let{premiumUser:t,teams:r}=e,{accessToken:i,token:o,userRole:c,userId:u}=(0,n.Z)(),[p]=er.Z.useForm(),[g,f]=(0,N.useState)(""),[j,v]=(0,N.useState)([]),[_,b]=(0,N.useState)(w.Cl.Anthropic),[Z,C]=(0,N.useState)(null),[S,E]=(0,N.useState)(null),[P,I]=(0,N.useState)(null),[R,O]=(0,N.useState)(0),[q,z]=(0,N.useState)({}),[B,U]=(0,N.useState)(!1),[G,H]=(0,N.useState)(null),[K,J]=(0,N.useState)(null),[W,Y]=(0,N.useState)(0),Q=(0,eS.NL)(),{data:X,isLoading:el,refetch:es}=h(),{data:ea,isLoading:ei}=m(),{data:en,isLoading:eo}=d(),ed=(null==en?void 0:en.credentials)||[],{data:ec,isLoading:em}=(0,x.L)(),eu=(0,N.useMemo)(()=>{if(!(null==X?void 0:X.data))return[];let e=new Set;for(let l of X.data)e.add(l.model_name);return Array.from(e).sort()},[null==X?void 0:X.data]),eh=(0,N.useMemo)(()=>{if(!(null==X?void 0:X.data))return[];let e=new Set;for(let l of X.data){let t=l.model_info;if(null==t?void 0:t.access_groups)for(let l of t.access_groups)e.add(l)}return Array.from(e)},[null==X?void 0:X.data]),ex=(0,N.useMemo)(()=>{var e;return null==X?void 0:null===(e=X.data)||void 0===e?void 0:e.map(e=>e.model_name)},[null==X?void 0:X.data]),ep=e=>null!=ea&&"object"==typeof ea&&e in ea?ea[e].litellm_provider:"openai",eg=(0,N.useMemo)(()=>(null==X?void 0:X.data)?M(X,ep):{data:[]},[null==X?void 0:X.data,ep]),ef=c&&(0,eC.P4)(c),ej=c&&eC.lo.includes(c),ev=u&&(0,eC.yV)(r,u),e_=ej&&(null==ec?void 0:null===(l=ec.values)||void 0===l?void 0:l.disable_model_add_for_internal_users)===!0,ey=!ef&&(e_||!ev),eb={name:"file",accept:".json",pastable:!1,beforeUpload:e=>{if("application/json"===e.type){let l=new FileReader;l.onload=e=>{if(e.target){let l=e.target.result;p.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"done"===e.file.status?$.Z.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&$.Z.fromBackend("".concat(e.file.name," file upload failed."))}},eN=()=>{f(new Date().toLocaleString()),Q.invalidateQueries({queryKey:["models","list"]}),es()},ew=async()=>{if(i)try{let e={router_settings:{}};"global"===Z?(P&&(e.router_settings.retry_policy=P),$.Z.success("Global retry settings saved successfully")):(S&&(e.router_settings.model_group_retry_policy=S),$.Z.success("Retry settings saved successfully for ".concat(Z))),await (0,a.setCallbacksCall)(i,e)}catch(e){$.Z.fromBackend("Failed to save retry settings")}};if((0,N.useEffect)(()=>{if(!i||!o||!c||!u||!X)return;let e=async()=>{try{let e=(await (0,a.getCallbacksCall)(i,u,c)).router_settings,l=e.model_group_retry_policy,t=e.num_retries;E(l),I(e.retry_policy),O(t);let s=e.model_group_alias||{};z(s)}catch(e){console.error("Error fetching model data:",e)}};i&&o&&c&&u&&X&&e()},[i,o,c,u,X]),c&&"Admin Viewer"==c){let{Title:e,Paragraph:l}=D.default;return(0,s.jsxs)("div",{children:[(0,s.jsx)(e,{level:1,children:"Access Denied"}),(0,s.jsx)(l,{children:"Ask your proxy admin for access to view all models"})]})}let eI=async()=>{try{let e=await p.validateFields();await et(e,i,p,eN)}catch(t){var e;let l=(null===(e=t.errorFields)||void 0===e?void 0:e.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";$.Z.fromBackend("Please fill in the following required fields: ".concat(l))}};return(Object.keys(w.Cl).find(e=>w.Cl[e]===_),K)?(0,s.jsx)("div",{className:"w-full h-full",children:(0,s.jsx)(lB.Z,{teamId:K,onClose:()=>J(null),accessToken:i,is_team_admin:"Admin"===c,is_proxy_admin:"Proxy Admin"===c,userModels:ex,editTeam:!1,onUpdate:eN,premiumUser:t})}):(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(A.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(eA.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Model Management"}),eC.ZL.includes(c)?(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add and manage models for the proxy"}):(0,s.jsx)("p",{className:"text-sm text-gray-600",children:"Add models for teams you are an admin for."})]})}),(0,s.jsxs)("div",{className:"mb-4 px-4 py-3 bg-blue-50 rounded-lg border border-blue-100 flex items-center gap-4",children:[(0,s.jsx)("div",{className:"flex-shrink-0 w-10 h-10 bg-white rounded-full flex items-center justify-center border border-blue-200",children:(0,s.jsx)(eM.Z,{style:{fontSize:"18px",color:"#6366f1"}})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h4",{className:"text-gray-900 font-semibold text-sm m-0",children:"Missing a provider?"}),(0,s.jsx)("p",{className:"text-gray-500 text-xs m-0 mt-0.5",children:"The LiteLLM engineering team is constantly adding support for new LLM models, providers, endpoints. If you don't see the one you need, let us know and we'll prioritize it."})]}),(0,s.jsxs)("a",{href:"https://models.litellm.ai/?request=true",target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0 inline-flex items-center gap-2 px-4 py-2 bg-[#6366f1] hover:bg-[#5558e3] text-white text-sm font-medium rounded-lg transition-colors",children:["Request Provider",(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}),G&&!(el||ei||eo||em)?(0,s.jsx)(lD,{modelId:G,onClose:()=>{H(null)},modelData:eg.data.find(e=>e.model_info.id===G),accessToken:i,userID:u,userRole:c,onModelUpdate:e=>{Q.invalidateQueries({queryKey:["models","list"]}),eN()},modelAccessGroups:eh}):(0,s.jsxs)(eP.Z,{index:W,onIndexChange:Y,className:"gap-2 h-[75vh] w-full ",children:[(0,s.jsxs)(eF.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,s.jsxs)("div",{className:"flex",children:[eC.ZL.includes(c)?(0,s.jsx)(eE.Z,{children:"All Models"}):(0,s.jsx)(eE.Z,{children:"Your Models"}),!ey&&(0,s.jsx)(eE.Z,{children:"Add Model"}),eC.ZL.includes(c)&&(0,s.jsx)(eE.Z,{children:"LLM Credentials"}),eC.ZL.includes(c)&&(0,s.jsx)(eE.Z,{children:"Pass-Through Endpoints"}),eC.ZL.includes(c)&&(0,s.jsx)(eE.Z,{children:"Health Status"}),eC.ZL.includes(c)&&(0,s.jsx)(eE.Z,{children:"Model Retry Settings"}),eC.ZL.includes(c)&&(0,s.jsx)(eE.Z,{children:"Model Group Alias"}),eC.ZL.includes(c)&&(0,s.jsx)(eE.Z,{children:"Price Data Reload"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[g&&(0,s.jsxs)(L.Z,{children:["Last Refreshed: ",g]}),(0,s.jsx)(y.Z,{icon:ek.Z,variant:"shadow",size:"xs",className:"self-center",onClick:eN})]})]}),(0,s.jsxs)(eL.Z,{children:[(0,s.jsx)(T,{selectedModelGroup:Z,setSelectedModelGroup:C,availableModelGroups:eu,availableModelAccessGroups:eh,setSelectedModelId:H,setSelectedTeamId:J}),!ey&&(0,s.jsx)(F.Z,{className:"h-full",children:(0,s.jsx)(lj,{form:p,handleOk:eI,selectedProvider:_,setSelectedProvider:b,providerModels:j,setProviderModelsFn:e=>{v((0,w.bK)(e,ea))},getPlaceholder:w.ph,uploadProps:eb,showAdvancedSettings:B,setShowAdvancedSettings:U,teams:r,credentials:ed,accessToken:i,userRole:c})}),(0,s.jsx)(F.Z,{children:(0,s.jsx)(eZ,{uploadProps:eb})}),(0,s.jsx)(F.Z,{children:(0,s.jsx)(lz.Z,{accessToken:i,userRole:c,userID:u,modelData:eg,premiumUser:t})}),(0,s.jsx)(F.Z,{children:(0,s.jsx)(lw,{accessToken:i,modelData:eg,all_models_on_proxy:ex,getDisplayModelName:k,setSelectedModelId:H})}),(0,s.jsx)(V,{selectedModelGroup:Z,setSelectedModelGroup:C,availableModelGroups:eu,globalRetryPolicy:P,setGlobalRetryPolicy:I,defaultRetry:R,modelGroupRetryPolicy:S,setModelGroupRetryPolicy:E,handleSaveRetrySettings:ew}),(0,s.jsx)(F.Z,{children:(0,s.jsx)(lE,{accessToken:i,initialModelGroupAlias:q,onAliasUpdate:z})}),(0,s.jsx)(ee,{})]})]})]})})})}},27593:function(e,l,t){t.d(l,{Z:function(){return Y}});var s=t(57437),a=t(2265),r=t(78489),i=t(47323),n=t(84264),o=t(96761),d=t(19250),c=t(99981),m=t(33866),u=t(15731),h=t(53410),x=t(74998),p=t(59341),g=t(49566),f=t(12514),j=t(97765),v=t(37592),_=t(10032),y=t(22116),b=t(51653),N=t(24199),w=t(12660),Z=t(15424),C=t(58760),k=t(5545),S=t(45246),A=t(96473),E=t(31283),P=e=>{let{value:l={},onChange:t}=e,[r,i]=(0,a.useState)(Object.entries(l)),n=e=>{let l=r.filter((l,t)=>t!==e);i(l),null==t||t(Object.fromEntries(l))},o=(e,l,s)=>{let a=[...r];a[e]=[l,s],i(a),null==t||t(Object.fromEntries(a))};return(0,s.jsxs)("div",{children:[r.map((e,l)=>{let[t,a]=e;return(0,s.jsxs)(C.Z,{style:{display:"flex",marginBottom:8},align:"center",children:[(0,s.jsx)(E.o,{placeholder:"Header Name",value:t,onChange:e=>o(l,e.target.value,a)}),(0,s.jsx)(E.o,{placeholder:"Header Value",value:a,onChange:e=>o(l,t,e.target.value)}),(0,s.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,s.jsx)(S.Z,{onClick:()=>n(l),style:{cursor:"pointer"}})})]},l)}),(0,s.jsx)(k.ZP,{type:"dashed",onClick:()=>{i([...r,["",""]])},icon:(0,s.jsx)(A.Z,{}),children:"Add Header"})]})},F=t(77565),L=e=>{let{pathValue:l,targetValue:t,includeSubpath:a}=e,r=(0,d.getProxyBaseUrl)();return l&&t?(0,s.jsxs)(f.Z,{className:"p-5",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Preview"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-5",children:"How your requests will be routed"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"Basic routing:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:l?"".concat(r).concat(l):""})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(F.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsx)("code",{className:"font-mono text-sm text-gray-900",children:t})]})]})]}),a&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-base font-semibold text-gray-900 mb-3",children:"With subpaths:"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Your endpoint + subpath"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[l&&"".concat(r).concat(l),(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]}),(0,s.jsx)("div",{className:"text-gray-400",children:(0,s.jsx)(F.Z,{className:"text-lg"})}),(0,s.jsxs)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-lg p-3",children:[(0,s.jsx)("div",{className:"text-sm text-gray-600 mb-2",children:"Forwards to"}),(0,s.jsxs)("code",{className:"font-mono text-sm text-gray-900",children:[t,(0,s.jsx)("span",{className:"text-blue-600",children:"/v1/text-to-image/base/model"})]})]})]}),(0,s.jsxs)("div",{className:"mt-3 text-sm text-gray-600",children:["Any path after ",l," will be appended to the target URL"]})]})}),!a&&(0,s.jsx)("div",{className:"mt-4 p-3 bg-blue-50 rounded-md border border-blue-200",children:(0,s.jsxs)("div",{className:"flex items-start",children:[(0,s.jsx)(Z.Z,{className:"text-blue-500 mt-0.5 mr-2 flex-shrink-0"}),(0,s.jsxs)("div",{className:"text-sm text-blue-700",children:[(0,s.jsx)("span",{className:"font-medium",children:"Not seeing the routing you wanted?"})," Try enabling - Include Subpaths - above - this allows subroutes like"," ",(0,s.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded font-mono text-xs",children:"/api/v1/models"})," to be forwarded automatically."]})]})})]})]}):null},M=t(9114),I=t(63709),T=e=>{let{premiumUser:l,authEnabled:t,onAuthChange:a}=e;return(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Security"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-4",children:"When enabled, requests to this endpoint will require a valid LiteLLM Virtual Key"}),l?(0,s.jsx)(_.Z.Item,{name:"auth",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(I.Z,{checked:t,onChange:e=>{a(e)}})}):(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center mb-3",children:[(0,s.jsx)(I.Z,{disabled:!0,checked:!1,style:{outline:"2px solid #d1d5db",outlineOffset:"2px"}}),(0,s.jsx)("span",{className:"ml-2 text-sm text-gray-400",children:"Authentication (Premium)"})]}),(0,s.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,s.jsxs)(n.Z,{className:"text-sm text-yellow-800",children:["Setting authentication for pass-through endpoints is a LiteLLM Enterprise feature. Get a trial key"," ",(0,s.jsx)("a",{href:"https://www.litellm.ai/#pricing",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"here"}),"."]})})]})]})},R=t(67479),O=e=>{let{accessToken:l,value:t={},onChange:r,disabled:i=!1}=e,[n,d]=(0,a.useState)(Object.keys(t)),[m,u]=(0,a.useState)(t);(0,a.useEffect)(()=>{u(t),d(Object.keys(t))},[t]);let h=(e,l,t)=>{var s,a;let i=m[e]||{},n={...m,[e]:{...i,[l]:t.length>0?t:void 0}};(null===(s=n[e])||void 0===s?void 0:s.request_fields)||(null===(a=n[e])||void 0===a?void 0:a.response_fields)||(n[e]=null),u(n),r&&r(n)};return(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Guardrails"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Configure guardrails to enforce policies on requests and responses. Guardrails are opt-in for passthrough endpoints."}),(0,s.jsx)(b.Z,{message:(0,s.jsxs)("span",{children:["Field-Level Targeting"," ",(0,s.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/pass_through_guardrails#field-level-targeting",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"(Learn More)"})]}),description:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{children:"Optionally specify which fields to check. If left empty, the entire request/response is sent to the guardrail."}),(0,s.jsxs)("div",{className:"text-xs space-y-1 mt-2",children:[(0,s.jsx)("div",{className:"font-medium",children:"Common Examples:"}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"query"})," - Single field"]}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"documents[*].text"})," - All text in documents array"]}),(0,s.jsxs)("div",{children:["• ",(0,s.jsx)("code",{className:"bg-gray-100 px-1 rounded",children:"messages[*].content"})," - All message contents"]})]})]}),type:"info",showIcon:!0,className:"mb-4"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Select Guardrails",(0,s.jsx)(c.Z,{title:"Choose which guardrails should run on this endpoint. Org/team/key level guardrails will also be included.",children:(0,s.jsx)(Z.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),children:(0,s.jsx)(R.Z,{accessToken:l,value:n,onChange:e=>{d(e);let l={};e.forEach(e=>{l[e]=m[e]||null}),u(l),r&&r(l)},disabled:i})}),n.length>0&&(0,s.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Field Targeting (Optional)"}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"\uD83D\uDCA1 Tip: Leave empty to check entire payload"})]}),n.map(e=>{var l,t;return(0,s.jsxs)(f.Z,{className:"p-4 bg-gray-50",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-900 mb-3",children:e}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("label",{className:"text-xs text-gray-600 flex items-center",children:["Request Fields (pre_call)",(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Specify which request fields to check"}),(0,s.jsxs)("div",{className:"text-xs space-y-1",children:[(0,s.jsx)("div",{children:"Examples:"}),(0,s.jsx)("div",{children:"• query"}),(0,s.jsx)("div",{children:"• documents[*].text"}),(0,s.jsx)("div",{children:"• messages[*].content"})]})]}),children:(0,s.jsx)(Z.Z,{className:"ml-1 text-gray-400"})})]}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[];h(e,"request_fields",[...t,"query"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ query"}),(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[];h(e,"request_fields",[...t,"documents[*]"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ documents[*]"})]})]}),(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Type field name or use + buttons above (e.g., query, documents[*].text)",value:(null===(l=m[e])||void 0===l?void 0:l.request_fields)||[],onChange:l=>h(e,"request_fields",l),disabled:i,tokenSeparators:[","]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("label",{className:"text-xs text-gray-600 flex items-center",children:["Response Fields (post_call)",(0,s.jsx)(c.Z,{title:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Specify which response fields to check"}),(0,s.jsxs)("div",{className:"text-xs space-y-1",children:[(0,s.jsx)("div",{children:"Examples:"}),(0,s.jsx)("div",{children:"• results[*].text"}),(0,s.jsx)("div",{children:"• choices[*].message.content"})]})]}),children:(0,s.jsx)(Z.Z,{className:"ml-1 text-gray-400"})})]}),(0,s.jsx)("div",{className:"flex gap-1",children:(0,s.jsx)("button",{type:"button",onClick:()=>{var l;let t=(null===(l=m[e])||void 0===l?void 0:l.response_fields)||[];h(e,"response_fields",[...t,"results[*]"])},className:"text-xs px-2 py-1 bg-white border border-gray-300 rounded hover:bg-gray-50",disabled:i,children:"+ results[*]"})})]}),(0,s.jsx)(v.default,{mode:"tags",style:{width:"100%"},placeholder:"Type field name or use + buttons above (e.g., results[*].text)",value:(null===(t=m[e])||void 0===t?void 0:t.response_fields)||[],onChange:l=>h(e,"response_fields",l),disabled:i,tokenSeparators:[","]})]})]})]},e)})]})]})};let{Option:q}=v.default;var V=e=>{let{accessToken:l,setPassThroughItems:t,passThroughItems:i,premiumUser:n=!1}=e,[m]=_.Z.useForm(),[u,h]=(0,a.useState)(!1),[x,v]=(0,a.useState)(!1),[C,k]=(0,a.useState)(""),[S,A]=(0,a.useState)(""),[E,F]=(0,a.useState)(""),[I,R]=(0,a.useState)(!0),[q,V]=(0,a.useState)(!1),[D,z]=(0,a.useState)({}),B=()=>{m.resetFields(),A(""),F(""),R(!0),z({}),h(!1)},U=e=>{let l=e;e&&!e.startsWith("/")&&(l="/"+e),A(l),m.setFieldsValue({path:l})},G=async e=>{console.log("addPassThrough called with:",e),v(!0);try{!n&&"auth"in e&&delete e.auth,D&&Object.keys(D).length>0&&(e.guardrails=D),console.log("formValues: ".concat(JSON.stringify(e)));let s=(await (0,d.createPassThroughEndpoint)(l,e)).endpoints[0],a=[...i,s];t(a),M.Z.success("Pass-through endpoint created successfully"),m.resetFields(),A(""),F(""),R(!0),z({}),h(!1)}catch(e){M.Z.fromBackend("Error creating pass-through endpoint: "+e)}finally{v(!1)}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(r.Z,{className:"mx-auto mb-4 mt-4",onClick:()=>h(!0),children:"+ Add Pass-Through Endpoint"}),(0,s.jsx)(y.Z,{title:(0,s.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,s.jsx)(w.Z,{className:"text-xl text-blue-500"}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Pass-Through Endpoint"})]}),open:u,width:1e3,onCancel:B,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)(b.Z,{message:"What is a Pass-Through Endpoint?",description:"Route requests from your LiteLLM proxy to any external API. Perfect for custom models, image generation APIs, or any service you want to proxy through LiteLLM.",type:"info",showIcon:!0,className:"mb-6"}),(0,s.jsxs)(_.Z,{form:m,onFinish:G,layout:"vertical",className:"space-y-6",initialValues:{include_subpath:!0,path:S,target:E},children:[(0,s.jsxs)(f.Z,{className:"p-5",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Route Configuration"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-5",children:"Configure how requests to your domain will be forwarded to the target API"}),(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)(_.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Path Prefix"}),name:"path",rules:[{required:!0,message:"Path is required",pattern:/^\//}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example: /bria, /adobe-photoshop, /elasticsearch"}),className:"mb-4",children:(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsx)(g.Z,{placeholder:"bria",value:S,onChange:e=>U(e.target.value),className:"flex-1"})})}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Target URL"}),name:"target",rules:[{required:!0,message:"Target URL is required"},{type:"url",message:"Please enter a valid URL"}],extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-1",children:"Example:https://engine.prod.bria-api.com"}),className:"mb-4",children:(0,s.jsx)(g.Z,{placeholder:"https://engine.prod.bria-api.com",value:E,onChange:e=>{F(e.target.value),m.setFieldsValue({target:e.target.value})}})}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Include Subpaths"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:"Forward all subpaths to the target API (recommended for REST APIs)"})]}),(0,s.jsx)(_.Z.Item,{name:"include_subpath",valuePropName:"checked",className:"mb-0",children:(0,s.jsx)(p.Z,{checked:I,onChange:R})})]})]})]}),(0,s.jsx)(L,{pathValue:S,targetValue:E,includeSubpath:I}),(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Headers"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Add headers that will be sent with every request to the target API"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Headers",(0,s.jsx)(c.Z,{title:"Authentication and other headers to forward with requests",children:(0,s.jsx)(Z.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"headers",rules:[{required:!0,message:"Please configure the headers"}],extra:(0,s.jsxs)("div",{className:"text-xs text-gray-500 mt-2",children:[(0,s.jsx)("div",{className:"font-medium mb-1",children:"Add authentication tokens and other required headers"}),(0,s.jsx)("div",{children:"Common examples: auth_token, Authorization, x-api-key"})]}),children:(0,s.jsx)(P,{})})]}),(0,s.jsx)(T,{premiumUser:n,authEnabled:q,onAuthChange:e=>{V(e),m.setFieldsValue({auth:e})}}),(0,s.jsx)(O,{accessToken:l,value:D,onChange:z}),(0,s.jsxs)(f.Z,{className:"p-6",children:[(0,s.jsx)(o.Z,{className:"text-lg font-semibold text-gray-900 mb-2",children:"Billing"}),(0,s.jsx)(j.Z,{className:"text-gray-600 mb-6",children:"Optional cost tracking for this endpoint"}),(0,s.jsx)(_.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Cost Per Request (USD)",(0,s.jsx)(c.Z,{title:"Optional: Track costs for requests to this endpoint",children:(0,s.jsx)(Z.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:"cost_per_request",extra:(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-2",children:"The cost charged for each request through this endpoint"}),children:(0,s.jsx)(N.Z,{min:0,step:.001,precision:4,placeholder:"2.0000",size:"large"})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,s.jsx)(r.Z,{variant:"secondary",onClick:B,children:"Cancel"}),(0,s.jsx)(r.Z,{variant:"primary",loading:x,onClick:()=>{console.log("Submit button clicked"),m.submit()},children:x?"Creating...":"Add Pass-Through Endpoint"})]})]})]})})]})},D=t(30078),z=t(4260),B=t(19015),U=t(87769),G=t(42208);let H=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),i=JSON.stringify(l,null,2);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("pre",{className:"font-mono text-xs bg-gray-50 p-2 rounded max-w-md overflow-auto",children:t?i:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(U.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(G.Z,{className:"w-4 h-4 text-gray-500"})})]})};var K=e=>{let{endpointData:l,onClose:t,accessToken:r,isAdmin:i,premiumUser:n=!1,onEndpointUpdated:o}=e,[c,m]=(0,a.useState)(l),[u,h]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),[g,f]=(0,a.useState)((null==l?void 0:l.auth)||!1),[j,v]=(0,a.useState)((null==l?void 0:l.guardrails)||{}),[y]=_.Z.useForm(),b=async e=>{try{if(!r||!(null==c?void 0:c.id))return;let l={};if(e.headers)try{l="string"==typeof e.headers?JSON.parse(e.headers):e.headers}catch(e){M.Z.fromBackend("Invalid JSON format for headers");return}let t={path:c.path,target:e.target,headers:l,include_subpath:e.include_subpath,cost_per_request:e.cost_per_request,auth:n?e.auth:void 0,guardrails:j&&Object.keys(j).length>0?j:void 0};await (0,d.updatePassThroughEndpoint)(r,c.id,t),m({...c,...t}),p(!1),o&&o()}catch(e){console.error("Error updating endpoint:",e),M.Z.fromBackend("Failed to update pass through endpoint")}},N=async()=>{try{if(!r||!(null==c?void 0:c.id))return;await (0,d.deletePassThroughEndpointsCall)(r,c.id),M.Z.success("Pass through endpoint deleted successfully"),t(),o&&o()}catch(e){console.error("Error deleting endpoint:",e),M.Z.fromBackend("Failed to delete pass through endpoint")}};return u?(0,s.jsx)("div",{className:"p-4",children:"Loading..."}):c?(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(k.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,s.jsxs)(D.Dx,{children:["Pass Through Endpoint: ",c.path]}),(0,s.jsx)(D.xv,{className:"text-gray-500 font-mono",children:c.id})]})}),(0,s.jsxs)(D.v0,{children:[(0,s.jsxs)(D.td,{className:"mb-4",children:[(0,s.jsx)(D.OK,{children:"Overview"},"overview"),i?(0,s.jsx)(D.OK,{children:"Settings"},"settings"):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsxs)(D.nP,{children:[(0,s.jsxs)(D.x4,{children:[(0,s.jsxs)(D.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(D.Zb,{children:[(0,s.jsx)(D.xv,{children:"Path"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(D.Dx,{className:"font-mono",children:c.path})})]}),(0,s.jsxs)(D.Zb,{children:[(0,s.jsx)(D.xv,{children:"Target"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(D.Dx,{children:c.target})})]}),(0,s.jsxs)(D.Zb,{children:[(0,s.jsx)(D.xv,{children:"Configuration"}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(D.Ct,{color:c.include_subpath?"green":"gray",children:c.include_subpath?"Include Subpath":"Exact Path"})}),(0,s.jsx)("div",{children:(0,s.jsx)(D.Ct,{color:c.auth?"blue":"gray",children:c.auth?"Auth Required":"No Auth"})}),void 0!==c.cost_per_request&&(0,s.jsx)("div",{children:(0,s.jsxs)(D.xv,{children:["Cost per request: $",c.cost_per_request]})})]})]})]}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(L,{pathValue:c.path,targetValue:c.target,includeSubpath:c.include_subpath||!1})}),c.headers&&Object.keys(c.headers).length>0&&(0,s.jsxs)(D.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Headers"}),(0,s.jsxs)(D.Ct,{color:"blue",children:[Object.keys(c.headers).length," headers configured"]})]}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(H,{value:c.headers})})]}),c.guardrails&&Object.keys(c.guardrails).length>0&&(0,s.jsxs)(D.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Guardrails"}),(0,s.jsxs)(D.Ct,{color:"purple",children:[Object.keys(c.guardrails).length," guardrails configured"]})]}),(0,s.jsx)("div",{className:"mt-4 space-y-2",children:Object.entries(c.guardrails).map(e=>{let[l,t]=e;return(0,s.jsxs)("div",{className:"p-3 bg-gray-50 rounded",children:[(0,s.jsx)("div",{className:"font-medium text-sm",children:l}),t&&(t.request_fields||t.response_fields)&&(0,s.jsxs)("div",{className:"mt-2 text-xs text-gray-600 space-y-1",children:[t.request_fields&&(0,s.jsxs)("div",{children:["Request fields: ",t.request_fields.join(", ")]}),t.response_fields&&(0,s.jsxs)("div",{children:["Response fields: ",t.response_fields.join(", ")]})]}),!t&&(0,s.jsx)("div",{className:"text-xs text-gray-600 mt-1",children:"Uses entire payload"})]},l)})})]})]}),i&&(0,s.jsx)(D.x4,{children:(0,s.jsxs)(D.Zb,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(D.Dx,{children:"Pass Through Endpoint Settings"}),(0,s.jsx)("div",{className:"space-x-2",children:!x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(D.zx,{onClick:()=>p(!0),children:"Edit Settings"}),(0,s.jsx)(D.zx,{onClick:N,variant:"secondary",color:"red",children:"Delete Endpoint"})]})})]}),x?(0,s.jsxs)(_.Z,{form:y,onFinish:b,initialValues:{target:c.target,headers:c.headers?JSON.stringify(c.headers,null,2):"",include_subpath:c.include_subpath||!1,cost_per_request:c.cost_per_request,auth:c.auth||!1},layout:"vertical",children:[(0,s.jsx)(_.Z.Item,{label:"Target URL",name:"target",rules:[{required:!0,message:"Please input a target URL"}],children:(0,s.jsx)(D.oi,{placeholder:"https://api.example.com"})}),(0,s.jsx)(_.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,s.jsx)(z.default.TextArea,{rows:5,placeholder:'{"Authorization": "Bearer your-token", "Content-Type": "application/json"}'})}),(0,s.jsx)(_.Z.Item,{label:"Include Subpath",name:"include_subpath",valuePropName:"checked",children:(0,s.jsx)(I.Z,{})}),(0,s.jsx)(_.Z.Item,{label:"Cost per Request",name:"cost_per_request",children:(0,s.jsx)(B.Z,{min:0,step:.01,precision:2,placeholder:"0.00",addonBefore:"$"})}),(0,s.jsx)(T,{premiumUser:n,authEnabled:g,onAuthChange:e=>{f(e),y.setFieldsValue({auth:e})}}),(0,s.jsx)("div",{className:"mt-4",children:(0,s.jsx)(O,{accessToken:r||"",value:j,onChange:v})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,s.jsx)(k.ZP,{onClick:()=>p(!1),children:"Cancel"}),(0,s.jsx)(D.zx,{children:"Save Changes"})]})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Path"}),(0,s.jsx)("div",{className:"font-mono",children:c.path})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Target URL"}),(0,s.jsx)("div",{children:c.target})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Include Subpath"}),(0,s.jsx)(D.Ct,{color:c.include_subpath?"green":"gray",children:c.include_subpath?"Yes":"No"})]}),void 0!==c.cost_per_request&&(0,s.jsxs)("div",{children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Cost per Request"}),(0,s.jsxs)("div",{children:["$",c.cost_per_request]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Authentication Required"}),(0,s.jsx)(D.Ct,{color:c.auth?"green":"gray",children:c.auth?"Yes":"No"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(D.xv,{className:"font-medium",children:"Headers"}),c.headers&&Object.keys(c.headers).length>0?(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(H,{value:c.headers})}):(0,s.jsx)("div",{className:"text-gray-500",children:"No headers configured"})]})]})]})})]})]})]}):(0,s.jsx)("div",{className:"p-4",children:"Pass through endpoint not found"})},J=t(12322);let W=e=>{let{value:l}=e,[t,r]=(0,a.useState)(!1),i=JSON.stringify(l);return(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:t?i:"••••••••"}),(0,s.jsx)("button",{onClick:()=>r(!t),className:"p-1 hover:bg-gray-100 rounded",type:"button",children:t?(0,s.jsx)(U.Z,{className:"w-4 h-4 text-gray-500"}):(0,s.jsx)(G.Z,{className:"w-4 h-4 text-gray-500"})})]})};var Y=e=>{let{accessToken:l,userRole:t,userID:p,modelData:g,premiumUser:f}=e,[j,v]=(0,a.useState)([]),[_,y]=(0,a.useState)(null),[b,N]=(0,a.useState)(!1),[w,Z]=(0,a.useState)(null);(0,a.useEffect)(()=>{l&&t&&p&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{v(e.endpoints)})},[l,t,p]);let C=async e=>{Z(e),N(!0)},k=async()=>{if(null!=w&&l){try{await (0,d.deletePassThroughEndpointsCall)(l,w);let e=j.filter(e=>e.id!==w);v(e),M.Z.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),M.Z.fromBackend("Error deleting the endpoint: "+e)}N(!1),Z(null)}},S=(e,l)=>{C(e)},A=[{header:"ID",accessorKey:"id",cell:e=>(0,s.jsx)(c.Z,{title:e.row.original.id,children:(0,s.jsx)("div",{className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",onClick:()=>e.row.original.id&&y(e.row.original.id),children:e.row.original.id})})},{header:"Path",accessorKey:"path"},{header:"Target",accessorKey:"target",cell:e=>(0,s.jsx)(n.Z,{children:e.getValue()})},{header:()=>(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{children:"Authentication"}),(0,s.jsx)(c.Z,{title:"LiteLLM Virtual Key required to call endpoint",children:(0,s.jsx)(u.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),accessorKey:"auth",cell:e=>(0,s.jsx)(m.Z,{color:e.getValue()?"green":"gray",children:e.getValue()?"Yes":"No"})},{header:"Headers",accessorKey:"headers",cell:e=>(0,s.jsx)(W,{value:e.getValue()||{}})},{header:"Actions",id:"actions",cell:e=>{let{row:l}=e;return(0,s.jsxs)("div",{className:"flex space-x-1",children:[(0,s.jsx)(i.Z,{icon:h.Z,size:"sm",onClick:()=>l.original.id&&y(l.original.id),title:"Edit"}),(0,s.jsx)(i.Z,{icon:x.Z,size:"sm",onClick:()=>S(l.original.id,l.index),title:"Delete"})]})}}];if(!l)return null;if(_){console.log("selectedEndpointId",_),console.log("generalSettings",j);let e=j.find(e=>e.id===_);return e?(0,s.jsx)(K,{endpointData:e,onClose:()=>y(null),accessToken:l,isAdmin:"Admin"===t||"admin"===t,premiumUser:f,onEndpointUpdated:()=>{l&&(0,d.getPassThroughEndpointsCall)(l).then(e=>{v(e.endpoints)})}}):(0,s.jsx)("div",{children:"Endpoint not found"})}return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(o.Z,{children:"Pass Through Endpoints"}),(0,s.jsx)(n.Z,{className:"text-tremor-content",children:"Configure and manage your pass-through endpoints"})]}),(0,s.jsx)(V,{accessToken:l,setPassThroughItems:v,passThroughItems:j,premiumUser:f}),(0,s.jsx)(J.w,{data:j,columns:A,renderSubComponent:()=>(0,s.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:!1,noDataMessage:"No pass-through endpoints configured"}),b&&(0,s.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,s.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,s.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,s.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,s.jsx)("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),(0,s.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,s.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,s.jsx)("div",{className:"sm:flex sm:items-start",children:(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Pass-Through Endpoint"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this pass-through endpoint? This action cannot be undone."})})]})})}),(0,s.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)(r.Z,{onClick:k,color:"red",className:"ml-2",children:"Delete"}),(0,s.jsx)(r.Z,{onClick:()=>{N(!1),Z(null)},children:"Cancel"})]})]})]})})]})}},12322:function(e,l,t){t.d(l,{w:function(){return o}});var s=t(57437),a=t(2265),r=t(71594),i=t(24525),n=t(19130);function o(e){let{data:l=[],columns:t,getRowCanExpand:o,renderSubComponent:d,isLoading:c=!1,loadingMessage:m="\uD83D\uDE85 Loading logs...",noDataMessage:u="No logs found"}=e,h=(0,r.b7)({data:l,columns:t,getRowCanExpand:o,getRowId:(e,l)=>{var t;return null!==(t=null==e?void 0:e.request_id)&&void 0!==t?t:String(l)},getCoreRowModel:(0,i.sC)(),getExpandedRowModel:(0,i.rV)()});return(0,s.jsx)("div",{className:"rounded-lg custom-border overflow-x-auto w-full max-w-full box-border",children:(0,s.jsxs)(n.iA,{className:"[&_td]:py-0.5 [&_th]:py-1 table-fixed w-full box-border",style:{minWidth:"400px"},children:[(0,s.jsx)(n.ss,{children:h.getHeaderGroups().map(e=>(0,s.jsx)(n.SC,{children:e.headers.map(e=>(0,s.jsx)(n.xs,{className:"py-1 h-8",children:e.isPlaceholder?null:(0,r.ie)(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,s.jsx)(n.RM,{children:c?(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:m})})})}):h.getRowModel().rows.length>0?h.getRowModel().rows.map(e=>(0,s.jsxs)(a.Fragment,{children:[(0,s.jsx)(n.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(n.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,r.ie)(e.column.columnDef.cell,e.getContext())},e.id))}),e.getIsExpanded()&&(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:e.getVisibleCells().length,className:"p-0",children:(0,s.jsx)("div",{className:"w-full max-w-full overflow-hidden box-border",children:d({row:e})})})})]},e.id)):(0,s.jsx)(n.SC,{children:(0,s.jsx)(n.pj,{colSpan:t.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:u})})})})})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5144-568f2e27c5fa36d1.js b/litellm/proxy/_experimental/out/_next/static/chunks/5144-568f2e27c5fa36d1.js deleted file mode 100644 index 3dcb603a781..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5144-568f2e27c5fa36d1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5144],{95704:function(e,t,a){a.d(t,{Dx:function(){return u.Z},RM:function(){return r.Z},SC:function(){return c.Z},Zb:function(){return s.Z},iA:function(){return l.Z},pj:function(){return n.Z},ss:function(){return i.Z},xs:function(){return o.Z},xv:function(){return d.Z}});var s=a(12514),l=a(21626),r=a(97214),n=a(28241),i=a(58834),o=a(69552),c=a(71876),d=a(84264),u=a(96761)},92280:function(e,t,a){a.d(t,{x:function(){return s.Z}});var s=a(84264)},56522:function(e,t,a){a.d(t,{o:function(){return l.Z},x:function(){return s.Z}});var s=a(84264),l=a(49566)},90246:function(e,t,a){a.d(t,{n:function(){return s}});function s(e){let t=[e];return{all:t,lists:()=>[...t,"list"],list:e=>[...t,"list",{params:e}],details:()=>[...t,"detail"],detail:e=>[...t,"detail",e]}}},68474:function(e,t,a){a.d(t,{F:function(){return o}});var s=a(11713),l=a(90246),r=a(19250),n=a(39760);let i=(0,l.n)("mcpServers"),o=()=>{let{accessToken:e}=(0,n.Z)();return(0,s.a)({queryKey:i.list({}),queryFn:async()=>await (0,r.fetchMCPServers)(e),enabled:!!e})}},76191:function(e,t,a){a.d(t,{p:function(){return n}});var s=a(19250),l=a(11713);let r=(0,a(90246).n)("uiConfig"),n=()=>(0,l.a)({queryKey:r.list({}),queryFn:async()=>await (0,s.getUiConfig)(),staleTime:864e5,gcTime:864e5})},39760:function(e,t,a){var s=a(19250),l=a(3914),r=a(14474),n=a(99376),i=a(2265),o=a(76191);t.Z=()=>{var e,t,a,c,d,u;let m=(0,n.useRouter)(),{data:p,isLoading:g}=(0,o.p)(),x="undefined"!=typeof document?(0,l.e)("token"):null;(0,i.useEffect)(()=>{!g&&(!x||(null==p?void 0:p.admin_ui_disabled))&&m.replace("".concat((0,s.getProxyBaseUrl)(),"/ui/login"))},[x,m,g,p]);let h=(0,i.useMemo)(()=>{if(!x)return null;try{return(0,r.o)(x)}catch(e){return(0,l.b)(),m.replace("".concat((0,s.getProxyBaseUrl)(),"/ui/login")),null}},[x,m]);return{token:x,accessToken:null!==(e=null==h?void 0:h.key)&&void 0!==e?e:null,userId:null!==(t=null==h?void 0:h.user_id)&&void 0!==t?t:null,userEmail:null!==(a=null==h?void 0:h.user_email)&&void 0!==a?a:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(c=null==h?void 0:h.user_role)&&void 0!==c?c:null),premiumUser:null!==(d=null==h?void 0:h.premium_user)&&void 0!==d?d:null,disabledPersonalKeyCreation:null!==(u=null==h?void 0:h.disabled_non_admin_personal_key_creation)&&void 0!==u?u:null,showSSOBanner:(null==h?void 0:h.login_method)==="username_password"}}},82586:function(e,t,a){var s=a(57437),l=a(2265),r=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select agents",disabled:d=!1}=e,[u,m]=(0,l.useState)([]),[p,g]=(0,l.useState)([]),[x,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>{(async()=>{if(o){h(!0);try{let e=await (0,n.getAgentsList)(o),t=(null==e?void 0:e.agents)||[];m(t);let a=new Set;t.forEach(e=>{let t=e.agent_access_groups;t&&Array.isArray(t)&&t.forEach(e=>a.add(e))}),g(Array.from(a))}catch(e){console.error("Error fetching agents:",e)}finally{h(!1)}}})()},[o]);let f=[...p.map(e=>({label:e,value:"group:".concat(e),isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.map(e=>({label:"".concat(e.agent_name||e.agent_id),value:e.agent_id,isAccessGroup:!1,searchText:"".concat(e.agent_name||e.agent_id," ").concat(e.agent_id," Agent")}))],v=[...(null==a?void 0:a.agents)||[],...((null==a?void 0:a.accessGroups)||[]).map(e=>"group:".concat(e))];return(0,s.jsx)("div",{children:(0,s.jsx)(r.default,{mode:"multiple",placeholder:c,onChange:e=>{t({agents:e.filter(e=>!e.startsWith("group:")),accessGroups:e.filter(e=>e.startsWith("group:")).map(e=>e.replace("group:",""))})},value:v,loading:x,className:i,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:d,filterOption:(e,t)=>{var a;return((null===(a=f.find(e=>e.value===(null==t?void 0:t.value)))||void 0===a?void 0:a.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:f.map(e=>(0,s.jsx)(r.default.Option,{value:e.value,label:e.label,children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#722ed1",flexShrink:0}}),(0,s.jsx)("span",{style:{flex:1},children:e.label}),(0,s.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#722ed1",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"Agent"})]})},e.value))})})}},97434:function(e,t,a){a.d(t,{Dg:function(){return r},Lo:function(){return n},PA:function(){return c},RD:function(){return i},Z3:function(){return o}});let s="../ui/assets/logos/",l=[{id:"arize",displayName:"Arize",logo:"".concat(s,"arize.png"),supports_key_team_logging:!0,dynamic_params:{arize_api_key:"password",arize_space_id:"password"},description:"Arize Logging Integration"},{id:"braintrust",displayName:"Braintrust",logo:"".concat(s,"braintrust.png"),supports_key_team_logging:!1,dynamic_params:{braintrust_api_key:"password",braintrust_project_name:"text"},description:"Braintrust Logging Integration"},{id:"custom_callback_api",displayName:"Custom Callback API",logo:"".concat(s,"custom.svg"),supports_key_team_logging:!0,dynamic_params:{custom_callback_api_url:"text",custom_callback_api_headers:"text"},description:"Custom Callback API Logging Integration"},{id:"datadog",displayName:"Datadog",logo:"".concat(s,"datadog.png"),supports_key_team_logging:!1,dynamic_params:{dd_api_key:"password",dd_site:"text"},description:"Datadog Logging Integration"},{id:"lago",displayName:"Lago",logo:"".concat(s,"lago.svg"),supports_key_team_logging:!1,dynamic_params:{lago_api_url:"text",lago_api_key:"password"},description:"Lago Billing Logging Integration"},{id:"langfuse",displayName:"Langfuse",logo:"".concat(s,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v2 Logging Integration"},{id:"langfuse_otel",displayName:"Langfuse OTEL",logo:"".concat(s,"langfuse.png"),supports_key_team_logging:!0,dynamic_params:{langfuse_public_key:"text",langfuse_secret_key:"password",langfuse_host:"text"},description:"Langfuse v3 OTEL Logging Integration"},{id:"langsmith",displayName:"LangSmith",logo:"".concat(s,"langsmith.png"),supports_key_team_logging:!0,dynamic_params:{langsmith_api_key:"password",langsmith_project:"text",langsmith_base_url:"text",langsmith_sampling_rate:"number"},description:"Langsmith Logging Integration"},{id:"openmeter",displayName:"OpenMeter",logo:"".concat(s,"openmeter.png"),supports_key_team_logging:!1,dynamic_params:{openmeter_api_key:"password",openmeter_base_url:"text"},description:"OpenMeter Logging Integration"},{id:"otel",displayName:"Open Telemetry",logo:"".concat(s,"otel.png"),supports_key_team_logging:!1,dynamic_params:{otel_endpoint:"text",otel_headers:"text"},description:"OpenTelemetry Logging Integration"},{id:"s3",displayName:"S3",logo:"".concat(s,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{s3_bucket_name:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"S3 Bucket (AWS) Logging Integration"},{id:"SQS",displayName:"SQS",logo:"".concat(s,"aws.svg"),supports_key_team_logging:!1,dynamic_params:{sqs_queue_url:"text",aws_access_key_id:"password",aws_secret_access_key:"password",aws_region:"text"},description:"SQS Queue (AWS) Logging Integration"}],r=l.reduce((e,t)=>(e[t.displayName]=t,e),{}),n=l.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),i=l.reduce((e,t)=>(e[t.id]=t.displayName,e),{}),o=e=>e.map(e=>n[e]||e),c=e=>e.map(e=>i[e]||e)},95096:function(e,t,a){var s=a(57437),l=a(2265),r=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select pass through routes",disabled:d=!1,teamId:u}=e,[m,p]=(0,l.useState)([]),[g,x]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{(async()=>{if(o){x(!0);try{let e=await (0,n.getPassThroughEndpointsCall)(o,u);if(e.endpoints){let t=e.endpoints.map(e=>e.path);p(t)}}catch(e){console.error("Error fetching pass through routes:",e)}finally{x(!1)}}})()},[o,u]),(0,s.jsx)(r.default,{mode:"tags",placeholder:c,onChange:t,value:a,loading:g,className:i,allowClear:!0,options:m.map(e=>({label:e,value:e})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})}},46468:function(e,t,a){a.d(t,{K2:function(){return l},Ob:function(){return n},W0:function(){return r}});var s=a(19250);let l=async(e,t,a)=>{try{if(null===e||null===t)return;if(null!==a){let l=(await (0,s.modelAvailableCall)(a,e,t,!0,null,!0)).data.map(e=>e.id),r=[],n=[];return l.forEach(e=>{e.endsWith("/*")?r.push(e):n.push(e)}),[...r,...n]}}catch(e){console.error("Error fetching user models:",e)}},r=e=>{if("all-proxy-models"===e)return"All Proxy Models";if(e.endsWith("/*")){let t=e.replace("/*","");return"All ".concat(t," models")}return e},n=(e,t)=>{let a=[],s=[];return console.log("teamModels",e),console.log("allModels",t),e.forEach(e=>{if(e.endsWith("/*")){let l=e.replace("/*",""),r=t.filter(e=>e.startsWith(l+"/"));s.push(...r),a.push(e)}else s.push(e)}),[...a,...s].filter((e,t,a)=>a.indexOf(e)===t)}},97492:function(e,t,a){a.d(t,{Z:function(){return m}});var s=a(57437),l=a(11713),r=a(90246),n=a(19250),i=a(39760);let o=(0,r.n)("mcpAccessGroups"),c=()=>{let{accessToken:e}=(0,i.Z)();return(0,l.a)({queryKey:o.list({}),queryFn:async()=>await (0,n.fetchMCPAccessGroups)(e),enabled:!!e})};var d=a(68474),u=a(37592);a(2265);var m=e=>{let{onChange:t,value:a,className:l,accessToken:r,placeholder:n="Select MCP servers",disabled:i=!1}=e,{data:o=[],isLoading:m}=(0,d.F)(),{data:p=[],isLoading:g}=c(),x=[...p.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...o.map(e=>({label:"".concat(e.server_name||e.server_id," (").concat(e.server_id,")"),value:e.server_id,isAccessGroup:!1,searchText:"".concat(e.server_name||e.server_id," ").concat(e.server_id," MCP Server")}))],h=[...(null==a?void 0:a.servers)||[],...(null==a?void 0:a.accessGroups)||[]];return(0,s.jsx)("div",{children:(0,s.jsx)(u.default,{mode:"multiple",placeholder:n,onChange:e=>{t({servers:e.filter(e=>!p.includes(e)),accessGroups:e.filter(e=>p.includes(e))})},value:h,loading:m||g,className:l,allowClear:!0,showSearch:!0,style:{width:"100%"},disabled:i,filterOption:(e,t)=>{var a;return((null===(a=x.find(e=>e.value===(null==t?void 0:t.value)))||void 0===a?void 0:a.searchText)||"").toLowerCase().includes(e.toLowerCase())},children:x.map(e=>(0,s.jsx)(u.default.Option,{value:e.value,label:e.label,children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,s.jsx)("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:e.isAccessGroup?"#52c41a":"#1890ff",flexShrink:0}}),(0,s.jsx)("span",{style:{flex:1},children:e.label}),(0,s.jsx)("span",{style:{color:e.isAccessGroup?"#52c41a":"#1890ff",fontSize:"12px",fontWeight:500,opacity:.8},children:e.isAccessGroup?"Access Group":"MCP Server"})]})},e.value))})})}},68473:function(e,t,a){var s=a(57437),l=a(2265),r=a(19250),n=a(92280),i=a(10353),o=a(61994),c=a(32489),d=a(68474);t.Z=e=>{let{accessToken:t,selectedServers:a,toolPermissions:u,onChange:m,disabled:p=!1}=e,{data:g=[]}=(0,d.F)(),[x,h]=(0,l.useState)({}),[f,v]=(0,l.useState)({}),[_,y]=(0,l.useState)({}),b=(0,l.useMemo)(()=>0===a.length?[]:g.filter(e=>a.includes(e.server_id)),[g,a]),j=async e=>{v(t=>({...t,[e]:!0})),y(t=>({...t,[e]:""}));try{let a=await (0,r.listMCPTools)(t,e);a.error?(y(t=>({...t,[e]:a.message||"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))):h(t=>({...t,[e]:a.tools||[]}))}catch(t){console.error("Error fetching tools for server ".concat(e,":"),t),y(t=>({...t,[e]:"Failed to fetch tools"})),h(t=>({...t,[e]:[]}))}finally{v(t=>({...t,[e]:!1}))}};(0,l.useEffect)(()=>{b.forEach(e=>{x[e.server_id]||f[e.server_id]||j(e.server_id)})},[b]);let w=(e,t)=>{let a=u[e]||[],s=a.includes(t)?a.filter(e=>e!==t):[...a,t];m({...u,[e]:s})},N=e=>{let t=x[e]||[];m({...u,[e]:t.map(e=>e.name)})},k=e=>{m({...u,[e]:[]})};return 0===a.length?null:(0,s.jsx)("div",{className:"space-y-4",children:b.map(e=>{let t=e.server_name||e.alias||e.server_id,a=x[e.server_id]||[],l=u[e.server_id]||[],r=f[e.server_id],d=_[e.server_id];return(0,s.jsxs)("div",{className:"border rounded-lg bg-gray-50",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-4 border-b bg-white rounded-t-lg",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.x,{className:"font-semibold text-gray-900",children:t}),e.description&&(0,s.jsx)(n.x,{className:"text-sm text-gray-500",children:e.description})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>N(e.server_id),disabled:p||r,children:"Select All"}),(0,s.jsx)("button",{type:"button",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>k(e.server_id),disabled:p||r,children:"Deselect All"}),(0,s.jsx)("button",{type:"button",className:"text-gray-400 hover:text-gray-600",onClick:()=>{},children:(0,s.jsx)(c.Z,{className:"w-4 h-4"})})]})]}),(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(n.x,{className:"text-sm font-medium text-gray-700 mb-3",children:"Available Tools"}),r&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,s.jsx)(i.Z,{size:"large"}),(0,s.jsx)(n.x,{className:"ml-3 text-gray-500",children:"Loading tools..."})]}),d&&!r&&(0,s.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-center",children:[(0,s.jsx)(n.x,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,s.jsx)(n.x,{className:"text-sm text-red-500 mt-1",children:d})]}),!r&&!d&&a.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:a.map(t=>{let a=l.includes(t.name);return(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(o.Z,{checked:a,onChange:()=>w(e.server_id,t.name),disabled:p}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(n.x,{className:"font-medium text-gray-900",children:t.name}),(0,s.jsxs)(n.x,{className:"text-sm text-gray-500",children:["- ",t.description||"No description"]})]})})]},t.name)})}),!r&&!d&&0===a.length&&(0,s.jsx)("div",{className:"text-center py-6",children:(0,s.jsx)(n.x,{className:"text-gray-500",children:"No tools available"})})]})]},e.server_id)})})}},10703:function(e,t,a){a.d(t,{p:function(){return l}});var s=a(19250);let l=async e=>{try{let t=await (0,s.modelHubCall)(e);if(console.log("model_info:",t),(null==t?void 0:t.data.length)>0){let e=t.data.map(e=>({model_group:e.model_group,mode:null==e?void 0:e.mode}));return e.sort((e,t)=>e.model_group.localeCompare(t.model_group)),e}return[]}catch(e){throw console.error("Error fetching model info:",e),e}}},24199:function(e,t,a){a.d(t,{Z:function(){return r}});var s=a(57437);a(2265);var l=a(30150),r=e=>{let{step:t=.01,style:a={width:"100%"},placeholder:r="Enter a numerical value",min:n,max:i,onChange:o,...c}=e;return(0,s.jsx)(l.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:a,placeholder:r,min:n,max:i,onChange:o,...c})}},54507:function(e,t,a){a.d(t,{Z:function(){return v}});var s=a(57437);a(2265);var l=a(37592),r=a(99981),n=a(23496),i=a(15424),o=a(78489),c=a(12514),d=a(49566),u=a(91777),m=a(82182),p=a(22452),g=a(74998),x=a(97434),h=a(24199);let{Option:f}=l.default;var v=e=>{let{value:t=[],onChange:a,disabledCallbacks:v=[],onDisabledCallbacksChange:_}=e,y=Object.entries(x.Dg).filter(e=>{let[t,a]=e;return a.supports_key_team_logging}).map(e=>{let[t,a]=e;return t}),b=Object.keys(x.Dg),j=e=>{null==a||a(e)},w=e=>{j(t.filter((t,a)=>a!==e))},N=(e,a,s)=>{let l=[...t];if("callback_name"===a){let t=x.Lo[s]||s;l[e]={...l[e],[a]:t,callback_vars:{}}}else l[e]={...l[e],[a]:s};j(l)},k=(e,a,s)=>{let l=[...t];l[e]={...l[e],callback_vars:{...l[e].callback_vars,[a]:s}},j(l)},C=(e,t)=>{var a,l;if(!e.callback_name)return null;let n=null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0];if(!n)return null;let o=(null===(l=x.Dg[n])||void 0===l?void 0:l.dynamic_params)||{};return 0===Object.keys(o).length?null:(0,s.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-100",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,s.jsx)("div",{className:"w-3 h-3 bg-blue-100 rounded-full flex items-center justify-center",children:(0,s.jsx)("div",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full"})}),(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Integration Parameters"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-4",children:Object.entries(o).map(a=>{let[l,n]=a;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"text-sm font-medium text-gray-700 capitalize flex items-center space-x-1",children:[(0,s.jsx)("span",{children:l.replace(/_/g," ")}),(0,s.jsx)(r.Z,{title:"Environment variable reference recommended: os.environ/".concat(l.toUpperCase()),children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help text-xs"})}),"password"===n&&(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Sensitive"}),"number"===n&&(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:"Number"})]}),"number"===n&&(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"Value must be between 0 and 1"}),"number"===n?(0,s.jsx)(h.Z,{step:.01,width:400,placeholder:"os.environ/".concat(l.toUpperCase()),value:e.callback_vars[l]||"",onChange:e=>k(t,l,e.target.value)}):(0,s.jsx)(d.Z,{type:"password"===n?"password":"text",placeholder:"os.environ/".concat(l.toUpperCase()),value:e.callback_vars[l]||"",onChange:e=>k(t,l,e.target.value)})]},l)})})]})};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(u.Z,{className:"w-5 h-5 text-red-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Disabled Callbacks"}),(0,s.jsx)(r.Z,{title:"Select callbacks to disable for this key. Disabled callbacks will not receive any logging data.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Disabled Callbacks"}),(0,s.jsx)(l.default,{mode:"multiple",placeholder:"Select callbacks to disable",value:v,onChange:e=>{let t=(0,x.Z3)(e);null==_||_(t)},style:{width:"100%"},optionLabelProp:"label",children:b.map(e=>{var t,a;let l=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(r.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[l&&(0,s.jsx)("img",{src:l,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})}),(0,s.jsx)("div",{className:"text-xs text-gray-500",children:"Select callbacks that should be disabled for this key. These callbacks will not receive any logging data."})]})]}),(0,s.jsx)(n.Z,{}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(m.Z,{className:"w-5 h-5 text-blue-500"}),(0,s.jsx)("span",{className:"text-base font-semibold text-gray-800",children:"Logging Integrations"}),(0,s.jsx)(r.Z,{title:"Configure callback logging integrations for this team.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsx)(o.Z,{variant:"secondary",onClick:()=>{j([...t,{callback_name:"",callback_type:"success",callback_vars:{}}])},icon:p.Z,size:"sm",className:"hover:border-blue-400 hover:text-blue-500",type:"button",children:"Add Integration"})]}),(0,s.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>{var a,n;let i=e.callback_name?null===(a=Object.entries(x.Lo).find(t=>{let[a,s]=t;return s===e.callback_name}))||void 0===a?void 0:a[0]:void 0,d=i?null===(n=x.Dg[i])||void 0===n?void 0:n.logo:null;return(0,s.jsxs)(c.Z,{className:"border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200",decoration:"top",decorationColor:"blue",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[d&&(0,s.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}),(0,s.jsxs)("span",{className:"text-sm font-medium",children:[i||"New Integration"," Configuration"]})]}),(0,s.jsx)(o.Z,{variant:"light",onClick:()=>w(t),icon:g.Z,size:"xs",color:"red",className:"hover:bg-red-50",type:"button",children:"Remove"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Integration Type"}),(0,s.jsx)(l.default,{value:i,placeholder:"Select integration",onChange:e=>N(t,"callback_name",e),className:"w-full",optionLabelProp:"label",children:y.map(e=>{var t,a;let l=null===(t=x.Dg[e])||void 0===t?void 0:t.logo,n=null===(a=x.Dg[e])||void 0===a?void 0:a.description;return(0,s.jsx)(f,{value:e,label:e,children:(0,s.jsx)(r.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[l&&(0,s.jsx)("img",{src:l,alt:e,className:"w-4 h-4 object-contain",onError:t=>{let a=t.target,s=a.parentElement;if(s){let t=document.createElement("div");t.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",t.textContent=e.charAt(0),s.replaceChild(t,a)}}}),(0,s.jsx)("span",{children:e})]})})},e)})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Event Type"}),(0,s.jsxs)(l.default,{value:e.callback_type,onChange:e=>N(t,"callback_type",e),className:"w-full",children:[(0,s.jsx)(f,{value:"success",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,s.jsx)("span",{children:"Success Only"})]})}),(0,s.jsx)(f,{value:"failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full"}),(0,s.jsx)("span",{children:"Failure Only"})]})}),(0,s.jsx)(f,{value:"success_and_failure",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,s.jsx)("span",{children:"Success & Failure"})]})})]})]})]}),C(e,t)]})]},t)})}),0===t.length&&(0,s.jsxs)("div",{className:"text-center py-12 text-gray-500 border-2 border-dashed border-gray-200 rounded-lg bg-gray-50/50",children:[(0,s.jsx)(m.Z,{className:"w-12 h-12 text-gray-300 mb-3 mx-auto"}),(0,s.jsx)("div",{className:"text-base font-medium mb-1",children:"No logging integrations configured"}),(0,s.jsx)("div",{className:"text-sm text-gray-400",children:'Click "Add Integration" to configure logging for this team'})]})]})}},97415:function(e,t,a){var s=a(57437),l=a(2265),r=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:o,placeholder:c="Select vector stores",disabled:d=!1}=e,[u,m]=(0,l.useState)([]),[p,g]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{(async()=>{if(o){g(!0);try{let e=await (0,n.vectorStoreListCall)(o);e.data&&m(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{g(!1)}}})()},[o]),(0,s.jsx)("div",{children:(0,s.jsx)(r.default,{mode:"multiple",placeholder:c,onChange:t,value:a,loading:p,className:i,allowClear:!0,options:u.map(e=>({label:"".concat(e.vector_store_name||e.vector_store_id," (").concat(e.vector_store_id,")"),value:e.vector_store_id,title:e.vector_store_description||e.vector_store_id})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"},disabled:d})})}},59872:function(e,t,a){a.d(t,{GS:function(){return n},nl:function(){return l},pw:function(){return r},vQ:function(){return i}});var s=a(9114);function l(e,t){let a=structuredClone(e);for(let[e,s]of Object.entries(t))e in a&&(a[e]=s);return a}let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=!(arguments.length>3)||void 0===arguments[3]||arguments[3];if(null==e||!Number.isFinite(e)||0===e&&!s)return"-";let l={minimumFractionDigits:t,maximumFractionDigits:t};if(!a)return e.toLocaleString("en-US",l);let r=Math.abs(e),n=r,i="";return r>=1e6?(n=r/1e6,i="M"):r>=1e3&&(n=r/1e3,i="K"),"".concat(e<0?"-":"").concat(n.toLocaleString("en-US",l)).concat(i)},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;if(null==e||!Number.isFinite(e)||0===e)return"-";let a=r(e,t,!1,!1);if(0===Number(a.replace(/,/g,""))){let e=(1/10**t).toFixed(t);return"< $".concat(e)}return"$".concat(a)},i=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Copied to clipboard";if(!e)return!1;if(!navigator||!navigator.clipboard||!navigator.clipboard.writeText)return o(e,t);try{return await navigator.clipboard.writeText(e),s.Z.success(t),!0}catch(a){return console.error("Clipboard API failed: ",a),o(e,t)}},o=(e,t)=>{try{let a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.left="-999999px",a.style.top="-999999px",a.setAttribute("readonly",""),document.body.appendChild(a),a.focus(),a.select();let l=document.execCommand("copy");if(document.body.removeChild(a),l)return s.Z.success(t),!0;throw Error("execCommand failed")}catch(e){return s.Z.fromBackend("Failed to copy to clipboard"),console.error("Failed to copy: ",e),!1}}},20347:function(e,t,a){a.d(t,{LQ:function(){return r},P4:function(){return i},ZL:function(){return s},_p:function(){return c},lo:function(){return l},tY:function(){return n},yV:function(){return o}});let s=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],l=["Internal User","Internal Viewer"],r=["Internal User","Admin","proxy_admin"],n=e=>s.includes(e),i=e=>"proxy_admin"===e||"Admin"===e,o=(e,t)=>null!=e&&e.some(e=>c(e,t)),c=(e,t)=>null!=e&&null!=e.members_with_roles&&e.members_with_roles.some(e=>e.user_id===t&&"admin"===e.role)}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5695-8a460f773f836c7c.js b/litellm/proxy/_experimental/out/_next/static/chunks/5695-8a460f773f836c7c.js deleted file mode 100644 index eac5392f420..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5695-8a460f773f836c7c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5695],{65695:function(e,l,t){t.d(l,{Z:function(){return B}});var s=t(57437),a=t(2265),r=t(41649),i=t(78489),n=t(12514),c=t(47323),d=t(21626),o=t(97214),u=t(28241),m=t(58834),x=t(69552),g=t(71876),h=t(84264),f=t(58643),p=t(19250),y=t(19015),j=t(44643),b=t(74998),_=t(16312),v=t(9114),N=t(31283);let k={ttl:3600,lowest_latency_buffer:0};var w=e=>{let{routingStrategyArgs:l}=e,t={ttl:"Sliding window to look back over when calculating the average latency of a deployment. Default - 1 hour (in seconds).",lowest_latency_buffer:"Shuffle between deployments within this % of the lowest latency. Default - 0 (i.e. always pick lowest latency)."};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"max-w-3xl",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Latency-Based Configuration"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Fine-tune latency-based routing behavior"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(l||k).map(e=>{let[l,a]=e;return(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:l.replace(/_/g," ")}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:t[l]||""}),(0,s.jsx)(N.o,{name:l,defaultValue:"object"==typeof a?JSON.stringify(a,null,2):null==a?void 0:a.toString(),className:"font-mono text-sm w-full"})]})},l)})})]}),(0,s.jsx)("div",{className:"border-t border-gray-200"})]})},Z=e=>{let{routerSettings:l,routerFieldsMetadata:t}=e;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"max-w-3xl",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Reliability & Retries"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure retry logic and failure handling"})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-2 xl:grid-cols-3",children:Object.entries(l).filter(e=>{let[l,t]=e;return"fallbacks"!=l&&"context_window_fallbacks"!=l&&"routing_strategy_args"!=l&&"routing_strategy"!=l&&"enable_tag_filtering"!=l}).map(e=>{var l,a;let[r,i]=e;return(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsxs)("label",{className:"block",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:(null===(l=t[r])||void 0===l?void 0:l.ui_field_name)||r}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:(null===(a=t[r])||void 0===a?void 0:a.field_description)||""}),(0,s.jsx)(N.o,{name:r,defaultValue:"object"==typeof i?JSON.stringify(i,null,2):(null==i?void 0:i.toString())||"",placeholder:"—",className:"font-mono text-sm w-full"})]})},r)})})]})},S=t(37592),C=e=>{var l,t;let{selectedStrategy:a,availableStrategies:r,routingStrategyDescriptions:i,routerFieldsMetadata:n,onStrategyChange:c}=e;return(0,s.jsxs)("div",{className:"space-y-2 max-w-3xl",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:(null===(l=n.routing_strategy)||void 0===l?void 0:l.ui_field_name)||"Routing Strategy"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 mb-2",children:(null===(t=n.routing_strategy)||void 0===t?void 0:t.field_description)||""})]}),(0,s.jsx)("div",{className:"routing-strategy-select max-w-3xl",children:(0,s.jsx)(S.default,{value:a,onChange:c,style:{width:"100%"},size:"large",children:r.map(e=>(0,s.jsx)(S.default.Option,{value:e,label:e,children:(0,s.jsxs)("div",{className:"flex flex-col gap-0.5 py-1",children:[(0,s.jsx)("span",{className:"font-mono text-sm font-medium",children:e}),i[e]&&(0,s.jsx)("span",{className:"text-xs text-gray-500 font-normal",children:i[e]})]})},e))})})]})},F=t(59341),O=e=>{var l,t,a;let{enabled:r,routerFieldsMetadata:i,onToggle:n}=e;return(0,s.jsx)("div",{className:"space-y-3 max-w-3xl",children:(0,s.jsxs)("div",{className:"flex items-start justify-between",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:(null===(l=i.enable_tag_filtering)||void 0===l?void 0:l.ui_field_name)||"Enable Tag Filtering"}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[(null===(t=i.enable_tag_filtering)||void 0===t?void 0:t.field_description)||"",(null===(a=i.enable_tag_filtering)||void 0===a?void 0:a.link)&&(0,s.jsxs)(s.Fragment,{children:[" ",(0,s.jsx)("a",{href:i.enable_tag_filtering.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Learn more"})]})]})]}),(0,s.jsx)(F.Z,{checked:r,onChange:n,className:"ml-4"})]})})},A=e=>{let{accessToken:l,userRole:t,userID:r,modelData:i}=e,[n,c]=(0,a.useState)({}),[d,o]=(0,a.useState)(null),[u,m]=(0,a.useState)([]),[x,g]=(0,a.useState)({}),[h,f]=(0,a.useState)({}),[y,j]=(0,a.useState)(!1);(0,a.useEffect)(()=>{l&&t&&r&&((0,p.getCallbacksCall)(l,r,t).then(e=>{console.log("callbacks",e);let l=e.router_settings;"model_group_retry_policy"in l&&delete l.model_group_retry_policy,c(l),l.routing_strategy&&o(l.routing_strategy)}),(0,p.getRouterSettingsCall)(l).then(e=>{if(console.log("router settings from API",e),e.fields){let l={};e.fields.forEach(e=>{l[e.field_name]={ui_field_name:e.ui_field_name,field_description:e.field_description,options:e.options,link:e.link}}),g(l);let t=e.fields.find(e=>"routing_strategy"===e.field_name);(null==t?void 0:t.options)&&m(t.options),e.routing_strategy_descriptions&&f(e.routing_strategy_descriptions);let s=e.fields.find(e=>"enable_tag_filtering"===e.field_name);(null==s?void 0:s.field_value)!==null&&(null==s?void 0:s.field_value)!==void 0&&j(s.field_value)}}))},[l,t,r]);let b=e=>{if(!l)return;console.log("router_settings",e);let t=new Set(["allowed_fails","cooldown_time","num_retries","timeout","retry_after"]),s=new Set(["model_group_alias","retry_policy"]),a=(e,l,a)=>{if(void 0===l)return a;let r=l.trim();if("null"===r.toLowerCase())return null;if(t.has(e)){let e=Number(r);return Number.isNaN(e)?a:e}if(s.has(e)){if(""===r)return null;try{return JSON.parse(r)}catch(e){return a}}return"true"===r.toLowerCase()||"false"!==r.toLowerCase()&&r},r=Object.fromEntries(Object.entries({...e,enable_tag_filtering:y}).map(e=>{let[l,t]=e;if("routing_strategy_args"!==l&&"routing_strategy"!==l&&"enable_tag_filtering"!==l){let e=document.querySelector('input[name="'.concat(l,'"]')),s=a(l,null==e?void 0:e.value,t);return[l,s]}if("routing_strategy"===l)return[l,d];if("enable_tag_filtering"===l)return[l,y];if("routing_strategy_args"===l&&"latency-based-routing"===d){let e={},l=document.querySelector('input[name="lowest_latency_buffer"]'),t=document.querySelector('input[name="ttl"]');return(null==l?void 0:l.value)&&(e.lowest_latency_buffer=Number(l.value)),(null==t?void 0:t.value)&&(e.ttl=Number(t.value)),console.log("setRoutingStrategyArgs: ".concat(e)),["routing_strategy_args",e]}return null}).filter(e=>null!=e));console.log("updatedVariables",r);try{(0,p.setCallbacksCall)(l,{router_settings:r})}catch(e){v.Z.fromBackend("Failed to update router settings: "+e)}v.Z.success("router settings updated successfully")};return l?(0,s.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"max-w-3xl",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Routing Settings"}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure how requests are routed to deployments"})]}),n.routing_strategy&&(0,s.jsx)(C,{selectedStrategy:d||n.routing_strategy,availableStrategies:u,routingStrategyDescriptions:h,routerFieldsMetadata:x,onStrategyChange:o}),(0,s.jsx)(O,{enabled:y,routerFieldsMetadata:x,onToggle:j})]}),(0,s.jsx)("div",{className:"border-t border-gray-200"}),"latency-based-routing"===d&&(0,s.jsx)(w,{routingStrategyArgs:n.routing_strategy_args}),(0,s.jsx)(Z,{routerSettings:n,routerFieldsMetadata:x}),(0,s.jsxs)("div",{className:"border-t border-gray-200 pt-6 flex justify-end gap-3",children:[(0,s.jsx)(_.z,{variant:"secondary",size:"sm",onClick:()=>window.location.reload(),className:"text-sm",children:"Reset"}),(0,s.jsx)(_.z,{size:"sm",onClick:()=>b(n),className:"text-sm font-medium",children:"Save Changes"})]})]}):null},R=t(91126),D=t(99981),E=t(7271),I=t(10032),T=t(22116),z=t(10703),V=e=>{let{models:l,accessToken:t,routerSettings:r,setRouterSettings:i}=e,[n]=I.Z.useForm(),[c,d]=(0,a.useState)(!1),[o,u]=(0,a.useState)(""),[m,x]=(0,a.useState)([]),[g,h]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{try{let e=await (0,z.p)(t);console.log("Fetched models for fallbacks:",e),x(e)}catch(e){console.error("Error fetching model info for fallbacks:",e)}})()},[t]);let f=()=>{d(!1),n.resetFields(),h([]),u("")};return(0,s.jsxs)("div",{children:[(0,s.jsx)(_.z,{className:"mx-auto",onClick:()=>d(!0),icon:()=>(0,s.jsx)("span",{className:"mr-1",children:"+"}),children:"Add Fallbacks"}),(0,s.jsx)(T.Z,{title:(0,s.jsx)("div",{className:"pb-4 border-b border-gray-100",children:(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Fallbacks"})}),open:c,width:900,footer:null,onOk:()=>{d(!1),n.resetFields(),h([]),u("")},onCancel:f,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,s.jsxs)("div",{className:"mt-6",children:[(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsx)("p",{className:"text-gray-600",children:"Configure fallback models to improve reliability. When the primary model fails or is unavailable, requests will automatically route to the specified fallback models in order."})}),(0,s.jsxs)(I.Z,{form:n,onFinish:e=>{console.log(e);let{model_name:l,models:s}=e,a=[...r.fallbacks||[],{[l]:s}],c={...r,fallbacks:a};console.log(c);try{(0,p.setCallbacksCall)(t,{router_settings:c}),i(c)}catch(e){v.Z.fromBackend("Failed to update router settings: "+e)}v.Z.success("router settings updated successfully"),d(!1),n.resetFields(),h([]),u("")},layout:"vertical",className:"space-y-6",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,s.jsxs)(I.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Primary Model ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"model_name",rules:[{required:!0,message:"Please select the primary model that needs fallbacks"}],className:"!mb-0",children:[(0,s.jsx)(S.default,{placeholder:"Select the model that needs fallback protection",value:o||void 0,onChange:e=>{u(e);let l=g.filter(l=>l!==e);h(l),n.setFieldValue("models",l),n.setFieldValue("model_name",e)},showSearch:!0,allowClear:!0,style:{width:"100%"},children:Array.from(new Set(m.map(e=>e.model_group))).map((e,l)=>(0,s.jsx)(S.default.Option,{value:e,children:e},l))}),(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"This is the primary model that users will request"})]}),(0,s.jsx)("div",{className:"border-t border-gray-200 my-6"}),(0,s.jsxs)(I.Z.Item,{label:(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Fallback Models (select multiple) ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"models",rules:[{required:!0,message:"Please select at least one fallback model"}],className:"!mb-0",children:[(0,s.jsxs)("div",{className:"space-y-3",children:[g.length>0&&(0,s.jsxs)("div",{className:"border border-gray-200 rounded-lg p-3 bg-gray-50",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:"Fallback Order:"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map((e,l)=>(0,s.jsxs)("div",{className:"flex items-center bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm",children:[(0,s.jsxs)("span",{className:"font-medium mr-2",children:[l+1,"."]}),(0,s.jsx)("span",{children:e}),(0,s.jsx)("button",{type:"button",onClick:()=>{let l=g.filter(l=>l!==e);h(l),n.setFieldValue("models",l)},className:"ml-2 text-blue-600 hover:text-blue-800",children:"\xd7"})]},e))})]}),(0,s.jsx)(S.default,{placeholder:"Add a fallback model",value:void 0,onChange:e=>{if(e&&!g.includes(e)){let l=[...g,e];h(l),n.setFieldValue("models",l)}},showSearch:!0,allowClear:!0,style:{width:"100%"},children:Array.from(new Set(m.map(e=>e.model_group))).filter(e=>e!==o&&!g.includes(e)).sort().map(e=>(0,s.jsx)(S.default.Option,{value:e,children:e},e))})]}),(0,s.jsxs)("p",{className:"text-sm text-gray-500 mt-1",children:[(0,s.jsx)("strong",{children:"Order matters:"})," Models will be tried in the order shown above (1st, 2nd, 3rd, etc.)"]})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,s.jsx)(_.z,{variant:"secondary",onClick:f,children:"Cancel"}),(0,s.jsx)(_.z,{variant:"primary",type:"submit",children:"Add Fallbacks"})]})]})]})})]})},q=t(21609);async function L(e,l){console.log=function(){};let t=window.location.origin,a=new E.ZP.OpenAI({apiKey:l,baseURL:t,dangerouslyAllowBrowser:!0});try{v.Z.info("Testing fallback model response...");let l=await a.chat.completions.create({model:e,messages:[{role:"user",content:"Hi, this is a test message"}],mock_testing_fallbacks:!0});v.Z.success((0,s.jsxs)("span",{children:["Test model=",(0,s.jsx)("strong",{children:e}),", received model=",(0,s.jsx)("strong",{children:l.model}),". See"," ",(0,s.jsx)("a",{href:"#",onClick:()=>window.open("https://docs.litellm.ai/docs/proxy/reliability","_blank"),style:{textDecoration:"underline",color:"blue"},children:"curl"})]}))}catch(e){v.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e))}}var M=e=>{let{accessToken:l,userRole:t,userID:r,modelData:i}=e,[n,h]=(0,a.useState)({}),[f,y]=(0,a.useState)(!1),[j,_]=(0,a.useState)(null),[N,k]=(0,a.useState)(!1);(0,a.useEffect)(()=>{l&&t&&r&&(0,p.getCallbacksCall)(l,r,t).then(e=>{console.log("callbacks",e);let l=e.router_settings;"model_group_retry_policy"in l&&delete l.model_group_retry_policy,h(l)})},[l,t,r]);let w=e=>{_(e),k(!0)},Z=async()=>{if(!j||!l)return;let e=Object.keys(j)[0];if(!e)return;y(!0);let t=n.fallbacks.map(l=>{let t={...l};return e in t&&Array.isArray(t[e])&&delete t[e],t}).filter(e=>Object.keys(e).length>0),s={...n,fallbacks:t};try{await (0,p.setCallbacksCall)(l,{router_settings:s}),h(s),v.Z.success("Router settings updated successfully")}catch(e){v.Z.fromBackend("Failed to update router settings: "+e)}finally{y(!1),k(!1),_(null)}};return l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(V,{models:(null==i?void 0:i.data)?i.data.map(e=>e.model_name):[],accessToken:l,routerSettings:n,setRouterSettings:h}),(0,s.jsxs)(d.Z,{children:[(0,s.jsx)(m.Z,{children:(0,s.jsxs)(g.Z,{children:[(0,s.jsx)(x.Z,{children:"Model Name"}),(0,s.jsx)(x.Z,{children:"Fallbacks"}),(0,s.jsx)(x.Z,{children:"Actions"})]})}),(0,s.jsx)(o.Z,{children:n.fallbacks&&n.fallbacks.map((e,t)=>Object.entries(e).map(a=>{let[r,i]=a;return(0,s.jsxs)(g.Z,{children:[(0,s.jsx)(u.Z,{children:r}),(0,s.jsx)(u.Z,{children:Array.isArray(i)?i.join(", "):i}),(0,s.jsxs)(u.Z,{children:[(0,s.jsx)(D.Z,{title:"Test fallback",children:(0,s.jsx)(c.Z,{icon:R.Z,size:"sm",onClick:()=>L(Object.keys(e)[0],l||""),className:"cursor-pointer hover:text-blue-600"})}),(0,s.jsx)(D.Z,{title:"Delete fallback",children:(0,s.jsx)(c.Z,{icon:b.Z,size:"sm",onClick:()=>w(e),className:"cursor-pointer hover:text-red-600"})})]})]},t.toString()+r)}))})]}),(0,s.jsx)(q.Z,{isOpen:N,title:"Delete Fallback?",message:"Are you sure you want to delete this fallback? This action cannot be undone.",resourceInformationTitle:"Fallback Information",resourceInformation:[{label:"Model Name",value:j?Object.keys(j)[0]:"",code:!0}],onCancel:()=>{k(!1),_(null)},onOk:Z,confirmLoading:f})]}):null},B=e=>{let{accessToken:l,userRole:t,userID:_,modelData:v}=e,[N,k]=(0,a.useState)([]);(0,a.useEffect)(()=>{l&&(0,p.getGeneralSettingsCall)(l).then(e=>{k(e)})},[l]);let w=(e,l)=>{k(N.map(t=>t.field_name===e?{...t,field_value:l}:t))},Z=(e,t)=>{if(!l)return;let s=N[t].field_value;if(null!=s&&void 0!=s)try{(0,p.updateConfigFieldSetting)(l,e,s);let t=N.map(l=>l.field_name===e?{...l,stored_in_db:!0}:l);k(t)}catch(e){}},S=(e,t)=>{if(l)try{(0,p.deleteConfigFieldSetting)(l,e);let t=N.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:null}:l);k(t)}catch(e){}};return l?(0,s.jsx)("div",{className:"w-full",children:(0,s.jsxs)(f.v0,{className:"h-[75vh] w-full",children:[(0,s.jsxs)(f.td,{variant:"line",defaultValue:"1",className:"px-8 pt-4",children:[(0,s.jsx)(f.OK,{value:"1",children:"Loadbalancing"}),(0,s.jsx)(f.OK,{value:"2",children:"Fallbacks"}),(0,s.jsx)(f.OK,{value:"3",children:"General"})]}),(0,s.jsxs)(f.nP,{className:"px-8 py-6",children:[(0,s.jsx)(f.x4,{children:(0,s.jsx)(A,{accessToken:l,userRole:t,userID:_,modelData:v})}),(0,s.jsx)(f.x4,{children:(0,s.jsx)(M,{accessToken:l,userRole:t,userID:_,modelData:v})}),(0,s.jsx)(f.x4,{children:(0,s.jsx)(n.Z,{children:(0,s.jsxs)(d.Z,{children:[(0,s.jsx)(m.Z,{children:(0,s.jsxs)(g.Z,{children:[(0,s.jsx)(x.Z,{children:"Setting"}),(0,s.jsx)(x.Z,{children:"Value"}),(0,s.jsx)(x.Z,{children:"Status"}),(0,s.jsx)(x.Z,{children:"Action"})]})}),(0,s.jsx)(o.Z,{children:N.filter(e=>"TypedDictionary"!==e.field_type).map((e,l)=>(0,s.jsxs)(g.Z,{children:[(0,s.jsxs)(u.Z,{children:[(0,s.jsx)(h.Z,{children:e.field_name}),(0,s.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),(0,s.jsx)(u.Z,{children:"Integer"==e.field_type?(0,s.jsx)(y.Z,{step:1,value:e.field_value,onChange:l=>w(e.field_name,l)}):null}),(0,s.jsx)(u.Z,{children:!0==e.stored_in_db?(0,s.jsx)(r.Z,{icon:j.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,s.jsx)(r.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,s.jsx)(r.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,s.jsxs)(u.Z,{children:[(0,s.jsx)(i.Z,{onClick:()=>Z(e.field_name,l),children:"Update"}),(0,s.jsx)(c.Z,{icon:b.Z,color:"red",onClick:()=>S(e.field_name,l),children:"Reset"})]})]},l))})]})})})]})]})}):null}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5766-127b95309f7ddbc4.js b/litellm/proxy/_experimental/out/_next/static/chunks/5766-127b95309f7ddbc4.js deleted file mode 100644 index 2181574eda1..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5766-127b95309f7ddbc4.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5766,5945,1623],{16853:function(t,e,a){a.d(e,{Z:function(){return u}});var n=a(5853),i=a(96398),r=a(44140),o=a(2265),s=a(13241),c=a(1153);let l=(0,c.fn)("Textarea"),u=o.forwardRef((t,e)=>{let{value:a,defaultValue:u="",placeholder:d="Type...",error:h=!1,errorMessage:f,disabled:p=!1,className:m,onChange:g,onValueChange:b,autoHeight:y=!1}=t,v=(0,n._T)(t,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[x,O]=(0,r.Z)(u,a),w=(0,o.useRef)(null),C=(0,i.Uh)(x);return(0,o.useEffect)(()=>{let t=w.current;if(y&&t){t.style.height="60px";let e=t.scrollHeight;t.style.height=e+"px"}},[y,w,x]),o.createElement(o.Fragment,null,o.createElement("textarea",Object.assign({ref:(0,c.lq)([w,e]),value:x,placeholder:d,disabled:p,className:(0,s.q)(l("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,i.um)(C,p,h),p?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",m),"data-testid":"text-area",onChange:t=>{null==g||g(t),O(t.target.value),null==b||b(t.target.value)}},v)),h&&f?o.createElement("p",{className:(0,s.q)(l("errorMessage"),"text-sm text-red-500 mt-1")},f):null)});u.displayName="Textarea"},67982:function(t,e,a){a.d(e,{Z:function(){return c}});var n=a(5853),i=a(13241),r=a(1153),o=a(2265);let s=(0,r.fn)("Divider"),c=o.forwardRef((t,e)=>{let{className:a,children:r}=t,c=(0,n._T)(t,["className","children"]);return o.createElement("div",Object.assign({ref:e,className:(0,i.q)(s("root"),"w-full mx-auto my-6 flex justify-between gap-3 items-center text-tremor-default","text-tremor-content","dark:text-dark-tremor-content",a)},c),r?o.createElement(o.Fragment,null,o.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),o.createElement("div",{className:(0,i.q)("text-inherit whitespace-nowrap")},r),o.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):o.createElement("div",{className:(0,i.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});c.displayName="Divider"},5945:function(t,e,a){a.d(e,{Z:function(){return T}});var n=a(2265),i=a(36760),r=a.n(i),o=a(18694),s=a(71744),c=a(33759),l=a(50337),u=a(65869),d=function(t,e){var a={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(a[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);ie.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(a[n[i]]=t[n[i]]);return a},h=t=>{var{prefixCls:e,className:a,hoverable:i=!0}=t,o=d(t,["prefixCls","className","hoverable"]);let{getPrefixCls:c}=n.useContext(s.E_),l=c("card",e),u=r()("".concat(l,"-grid"),a,{["".concat(l,"-grid-hoverable")]:i});return n.createElement("div",Object.assign({},o,{className:u}))},f=a(93463),p=a(12918),m=a(99320),g=a(71140);let b=t=>{let{antCls:e,componentCls:a,headerHeight:n,headerPadding:i,tabsMarginBottom:r}=t;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:"0 ".concat((0,f.bf)(i)),color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:t.headerFontSize,background:t.headerBg,borderBottom:"".concat((0,f.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorderSecondary),borderRadius:"".concat((0,f.bf)(t.borderRadiusLG)," ").concat((0,f.bf)(t.borderRadiusLG)," 0 0")},(0,p.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},p.vS),{["\n > ".concat(a,"-typography,\n > ").concat(a,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(e,"-tabs-top")]:{clear:"both",marginBottom:r,color:t.colorText,fontWeight:"normal",fontSize:t.fontSize,"&-bar":{borderBottom:"".concat((0,f.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(t.colorBorderSecondary)}}})},y=t=>{let{cardPaddingBase:e,colorBorderSecondary:a,cardShadow:n,lineWidth:i}=t;return{width:"33.33%",padding:e,border:0,borderRadius:0,boxShadow:"\n ".concat((0,f.bf)(i)," 0 0 0 ").concat(a,",\n 0 ").concat((0,f.bf)(i)," 0 0 ").concat(a,",\n ").concat((0,f.bf)(i)," ").concat((0,f.bf)(i)," 0 0 ").concat(a,",\n ").concat((0,f.bf)(i)," 0 0 0 ").concat(a," inset,\n 0 ").concat((0,f.bf)(i)," 0 0 ").concat(a," inset;\n "),transition:"all ".concat(t.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}},v=t=>{let{componentCls:e,iconCls:a,actionsLiMargin:n,cardActionsIconSize:i,colorBorderSecondary:r,actionsBg:o}=t;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:o,borderTop:"".concat((0,f.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(r),display:"flex",borderRadius:"0 0 ".concat((0,f.bf)(t.borderRadiusLG)," ").concat((0,f.bf)(t.borderRadiusLG))},(0,p.dF)()),{"& > li":{margin:n,color:t.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:t.calc(t.cardActionsIconSize).mul(2).equal(),fontSize:t.fontSize,lineHeight:t.lineHeight,cursor:"pointer","&:hover":{color:t.colorPrimary,transition:"color ".concat(t.motionDurationMid)},["a:not(".concat(e,"-btn), > ").concat(a)]:{display:"inline-block",width:"100%",color:t.colorIcon,lineHeight:(0,f.bf)(t.fontHeight),transition:"color ".concat(t.motionDurationMid),"&:hover":{color:t.colorPrimary}},["> ".concat(a)]:{fontSize:i,lineHeight:(0,f.bf)(t.calc(i).mul(t.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,f.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(r)}}})},x=t=>Object.assign(Object.assign({margin:"".concat((0,f.bf)(t.calc(t.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,p.dF)()),{"&-avatar":{paddingInlineEnd:t.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:t.marginXS}},"&-title":Object.assign({color:t.colorTextHeading,fontWeight:t.fontWeightStrong,fontSize:t.fontSizeLG},p.vS),"&-description":{color:t.colorTextDescription}}),O=t=>{let{componentCls:e,colorFillAlter:a,headerPadding:n,bodyPadding:i}=t;return{["".concat(e,"-head")]:{padding:"0 ".concat((0,f.bf)(n)),background:a,"&-title":{fontSize:t.fontSize}},["".concat(e,"-body")]:{padding:"".concat((0,f.bf)(t.padding)," ").concat((0,f.bf)(i))}}},w=t=>{let{componentCls:e}=t;return{overflow:"hidden",["".concat(e,"-body")]:{userSelect:"none"}}},C=t=>{let{componentCls:e,cardShadow:a,cardHeadPadding:n,colorBorderSecondary:i,boxShadowTertiary:r,bodyPadding:o,extraColor:s}=t;return{[e]:Object.assign(Object.assign({},(0,p.Wf)(t)),{position:"relative",background:t.colorBgContainer,borderRadius:t.borderRadiusLG,["&:not(".concat(e,"-bordered)")]:{boxShadow:r},["".concat(e,"-head")]:b(t),["".concat(e,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:t.fontSize},["".concat(e,"-body")]:{padding:o,borderRadius:"0 0 ".concat((0,f.bf)(t.borderRadiusLG)," ").concat((0,f.bf)(t.borderRadiusLG))},["".concat(e,"-grid")]:y(t),["".concat(e,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,f.bf)(t.borderRadiusLG)," ").concat((0,f.bf)(t.borderRadiusLG)," 0 0")}},["".concat(e,"-actions")]:v(t),["".concat(e,"-meta")]:x(t)}),["".concat(e,"-bordered")]:{border:"".concat((0,f.bf)(t.lineWidth)," ").concat(t.lineType," ").concat(i),["".concat(e,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(e,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(t.motionDurationMid,", border-color ").concat(t.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:a}},["".concat(e,"-contain-grid")]:{borderRadius:"".concat((0,f.bf)(t.borderRadiusLG)," ").concat((0,f.bf)(t.borderRadiusLG)," 0 0 "),["".concat(e,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(e,"-loading) ").concat(e,"-body")]:{marginBlockStart:t.calc(t.lineWidth).mul(-1).equal(),marginInlineStart:t.calc(t.lineWidth).mul(-1).equal(),padding:0}},["".concat(e,"-contain-tabs")]:{["> div".concat(e,"-head")]:{minHeight:0,["".concat(e,"-head-title, ").concat(e,"-extra")]:{paddingTop:n}}},["".concat(e,"-type-inner")]:O(t),["".concat(e,"-loading")]:w(t),["".concat(e,"-rtl")]:{direction:"rtl"}}},S=t=>{let{componentCls:e,bodyPaddingSM:a,headerPaddingSM:n,headerHeightSM:i,headerFontSizeSM:r}=t;return{["".concat(e,"-small")]:{["> ".concat(e,"-head")]:{minHeight:i,padding:"0 ".concat((0,f.bf)(n)),fontSize:r,["> ".concat(e,"-head-wrapper")]:{["> ".concat(e,"-extra")]:{fontSize:t.fontSize}}},["> ".concat(e,"-body")]:{padding:a}},["".concat(e,"-small").concat(e,"-contain-tabs")]:{["> ".concat(e,"-head")]:{["".concat(e,"-head-title, ").concat(e,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var E=(0,m.I$)("Card",t=>{let e=(0,g.IX)(t,{cardShadow:t.boxShadowCard,cardHeadPadding:t.padding,cardPaddingBase:t.paddingLG,cardActionsIconSize:t.fontSize});return[C(e),S(e)]},t=>{var e,a;return{headerBg:"transparent",headerFontSize:t.fontSizeLG,headerFontSizeSM:t.fontSize,headerHeight:t.fontSizeLG*t.lineHeightLG+2*t.padding,headerHeightSM:t.fontSize*t.lineHeight+2*t.paddingXS,actionsBg:t.colorBgContainer,actionsLiMargin:"".concat(t.paddingSM,"px 0"),tabsMarginBottom:-t.padding-t.lineWidth,extraColor:t.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(e=t.bodyPadding)&&void 0!==e?e:t.paddingLG,headerPadding:null!==(a=t.headerPadding)&&void 0!==a?a:t.paddingLG}}),P=a(56250),q=function(t,e){var a={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(a[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);ie.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(a[n[i]]=t[n[i]]);return a};let j=t=>{let{actionClasses:e,actions:a=[],actionStyle:i}=t;return n.createElement("ul",{className:e,style:i},a.map((t,e)=>n.createElement("li",{style:{width:"".concat(100/a.length,"%")},key:"action-".concat(e)},n.createElement("span",null,t))))},k=n.forwardRef((t,e)=>{let a;let{prefixCls:i,className:d,rootClassName:f,style:p,extra:m,headStyle:g={},bodyStyle:b={},title:y,loading:v,bordered:x,variant:O,size:w,type:C,cover:S,actions:k,tabList:_,children:T,activeTabKey:M,defaultActiveTabKey:N,tabBarExtraContent:R,hoverable:D,tabProps:Q={},classNames:I,styles:z}=t,H=q(t,["prefixCls","className","rootClassName","style","extra","headStyle","bodyStyle","title","loading","bordered","variant","size","type","cover","actions","tabList","children","activeTabKey","defaultActiveTabKey","tabBarExtraContent","hoverable","tabProps","classNames","styles"]),{getPrefixCls:A,direction:L,card:F}=n.useContext(s.E_),[G]=(0,P.Z)("card",O,x),B=t=>{var e;return r()(null===(e=null==F?void 0:F.classNames)||void 0===e?void 0:e[t],null==I?void 0:I[t])},K=t=>{var e;return Object.assign(Object.assign({},null===(e=null==F?void 0:F.styles)||void 0===e?void 0:e[t]),null==z?void 0:z[t])},V=n.useMemo(()=>{let t=!1;return n.Children.forEach(T,e=>{(null==e?void 0:e.type)===h&&(t=!0)}),t},[T]),W=A("card",i),[Z,X,U]=E(W),Y=n.createElement(l.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},T),$=void 0!==M,J=Object.assign(Object.assign({},Q),{[$?"activeKey":"defaultActiveKey"]:$?M:N,tabBarExtraContent:R}),tt=(0,c.Z)(w),te=tt&&"default"!==tt?tt:"large",ta=_?n.createElement(u.default,Object.assign({size:te},J,{className:"".concat(W,"-head-tabs"),onChange:e=>{var a;null===(a=t.onTabChange)||void 0===a||a.call(t,e)},items:_.map(t=>{var{tab:e}=t;return Object.assign({label:e},q(t,["tab"]))})})):null;if(y||m||ta){let t=r()("".concat(W,"-head"),B("header")),e=r()("".concat(W,"-head-title"),B("title")),i=r()("".concat(W,"-extra"),B("extra")),o=Object.assign(Object.assign({},g),K("header"));a=n.createElement("div",{className:t,style:o},n.createElement("div",{className:"".concat(W,"-head-wrapper")},y&&n.createElement("div",{className:e,style:K("title")},y),m&&n.createElement("div",{className:i,style:K("extra")},m)),ta)}let tn=r()("".concat(W,"-cover"),B("cover")),ti=S?n.createElement("div",{className:tn,style:K("cover")},S):null,tr=r()("".concat(W,"-body"),B("body")),to=Object.assign(Object.assign({},b),K("body")),ts=n.createElement("div",{className:tr,style:to},v?Y:T),tc=r()("".concat(W,"-actions"),B("actions")),tl=(null==k?void 0:k.length)?n.createElement(j,{actionClasses:tc,actionStyle:K("actions"),actions:k}):null,tu=(0,o.Z)(H,["onTabChange"]),td=r()(W,null==F?void 0:F.className,{["".concat(W,"-loading")]:v,["".concat(W,"-bordered")]:"borderless"!==G,["".concat(W,"-hoverable")]:D,["".concat(W,"-contain-grid")]:V,["".concat(W,"-contain-tabs")]:null==_?void 0:_.length,["".concat(W,"-").concat(tt)]:tt,["".concat(W,"-type-").concat(C)]:!!C,["".concat(W,"-rtl")]:"rtl"===L},d,f,X,U),th=Object.assign(Object.assign({},null==F?void 0:F.style),p);return Z(n.createElement("div",Object.assign({ref:e},tu,{className:td,style:th}),a,ti,ts,tl))});var _=function(t,e){var a={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(a[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(t);ie.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(a[n[i]]=t[n[i]]);return a};k.Grid=h,k.Meta=t=>{let{prefixCls:e,className:a,avatar:i,title:o,description:c}=t,l=_(t,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=n.useContext(s.E_),d=u("card",e),h=r()("".concat(d,"-meta"),a),f=i?n.createElement("div",{className:"".concat(d,"-meta-avatar")},i):null,p=o?n.createElement("div",{className:"".concat(d,"-meta-title")},o):null,m=c?n.createElement("div",{className:"".concat(d,"-meta-description")},c):null,g=p||m?n.createElement("div",{className:"".concat(d,"-meta-detail")},p,m):null;return n.createElement("div",Object.assign({},l,{className:h}),f,g)};var T=k},15731:function(t,e,a){var n=a(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.Z=i},53410:function(t,e,a){var n=a(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});e.Z=i},2894:function(t,e,a){a.d(e,{R:function(){return s},m:function(){return o}});var n=a(18238),i=a(7989),r=a(11255),o=class extends i.F{#t;#e;#a;#n;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#a=t.mutationCache,this.#e=[],this.state=t.state||s(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#a.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#a.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#i({type:"continue"})},a={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,r.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#i({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#a.canRun(this)});let n="pending"===this.state.status,i=!this.#n.canStart();try{if(n)e();else{this.#i({type:"pending",variables:t,isPaused:i}),await this.#a.config.onMutate?.(t,this,a);let e=await this.options.onMutate?.(t,a);e!==this.state.context&&this.#i({type:"pending",context:e,variables:t,isPaused:i})}let r=await this.#n.start();return await this.#a.config.onSuccess?.(r,t,this.state.context,this,a),await this.options.onSuccess?.(r,t,this.state.context,a),await this.#a.config.onSettled?.(r,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(r,null,t,this.state.context,a),this.#i({type:"success",data:r}),r}catch(e){try{throw await this.#a.config.onError?.(e,t,this.state.context,this,a),await this.options.onError?.(e,t,this.state.context,a),await this.#a.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(void 0,e,t,this.state.context,a),e}finally{this.#i({type:"error",error:e})}}finally{this.#a.runNext(this)}}#i(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#a.notify({mutation:this,type:"updated",action:t})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(t,e,a){a.d(e,{S:function(){return m}});var n=a(45345),i=a(21733),r=a(18238),o=a(24112),s=class extends o.l{constructor(t={}){super(),this.config=t,this.#r=new Map}#r;build(t,e,a){let r=e.queryKey,o=e.queryHash??(0,n.Rm)(r,e),s=this.get(o);return s||(s=new i.A({client:t,queryKey:r,queryHash:o,options:t.defaultQueryOptions(e),state:a,defaultOptions:t.getQueryDefaults(r)}),this.add(s)),s}add(t){this.#r.has(t.queryHash)||(this.#r.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#r.get(t.queryHash);e&&(t.destroy(),e===t&&this.#r.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){r.Vr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#r.get(t)}getAll(){return[...this.#r.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,n._x)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,n._x)(t,e)):e}notify(t){r.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){r.Vr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){r.Vr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},c=a(2894),l=class extends o.l{constructor(t={}){super(),this.config=t,this.#o=new Set,this.#s=new Map,this.#c=0}#o;#s;#c;build(t,e,a){let n=new c.m({client:t,mutationCache:this,mutationId:++this.#c,options:t.defaultMutationOptions(e),state:a});return this.add(n),n}add(t){this.#o.add(t);let e=u(t);if("string"==typeof e){let a=this.#s.get(e);a?a.push(t):this.#s.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#o.delete(t)){let e=u(t);if("string"==typeof e){let a=this.#s.get(e);if(a){if(a.length>1){let e=a.indexOf(t);-1!==e&&a.splice(e,1)}else a[0]===t&&this.#s.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=u(t);if("string"!=typeof e)return!0;{let a=this.#s.get(e),n=a?.find(t=>"pending"===t.state.status);return!n||n===t}}runNext(t){let e=u(t);if("string"!=typeof e)return Promise.resolve();{let a=this.#s.get(e)?.find(e=>e!==t&&e.state.isPaused);return a?.continue()??Promise.resolve()}}clear(){r.Vr.batch(()=>{this.#o.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#o.clear(),this.#s.clear()})}getAll(){return Array.from(this.#o)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,n.X7)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,n.X7)(t,e))}notify(t){r.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return r.Vr.batch(()=>Promise.all(t.map(t=>t.continue().catch(n.ZT))))}};function u(t){return t.options.scope?.id}var d=a(87045),h=a(57853);function f(t){return{onFetch:(e,a)=>{let i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,o=e.state.data?.pages||[],s=e.state.data?.pageParams||[],c={pages:[],pageParams:[]},l=0,u=async()=>{let a=!1,u=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?a=!0:e.signal.addEventListener("abort",()=>{a=!0}),e.signal)})},d=(0,n.cG)(e.options,e.fetchOptions),h=async(t,i,r)=>{if(a)return Promise.reject();if(null==i&&t.pages.length)return Promise.resolve(t);let o=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:i,direction:r?"backward":"forward",meta:e.options.meta};return u(t),t})(),s=await d(o),{maxPages:c}=e.options,l=r?n.Ht:n.VX;return{pages:l(t.pages,s,c),pageParams:l(t.pageParams,i,c)}};if(r&&o.length){let t="backward"===r,e={pages:o,pageParams:s},a=(t?function(t,{pages:e,pageParams:a}){return e.length>0?t.getPreviousPageParam?.(e[0],e,a[0],a):void 0}:p)(i,e);c=await h(e,a,t)}else{let e=t??o.length;do{let t=0===l?s[0]??i.initialPageParam:p(i,c);if(l>0&&null==t)break;c=await h(c,t),l++}while(le.options.persister?.(u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},a):e.fetchFn=u}}}function p(t,{pages:e,pageParams:a}){let n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,a[n],a):void 0}var m=class{#l;#a;#u;#d;#h;#f;#p;#m;constructor(t={}){this.#l=t.queryCache||new s,this.#a=t.mutationCache||new l,this.#u=t.defaultOptions||{},this.#d=new Map,this.#h=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#p=d.j.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#l.onFocus())}),this.#m=h.N.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#l.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#p?.(),this.#p=void 0,this.#m?.(),this.#m=void 0)}isFetching(t){return this.#l.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#a.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#l.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),a=this.#l.build(this,e),i=a.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&a.isStaleByTime((0,n.KC)(e.staleTime,a))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#l.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,a){let i=this.defaultQueryOptions({queryKey:t}),r=this.#l.get(i.queryHash),o=r?.state.data,s=(0,n.SE)(e,o);if(void 0!==s)return this.#l.build(this,i).setData(s,{...a,manual:!0})}setQueriesData(t,e,a){return r.Vr.batch(()=>this.#l.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,a)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#l.get(e.queryHash)?.state}removeQueries(t){let e=this.#l;r.Vr.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let a=this.#l;return r.Vr.batch(()=>(a.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let a={revert:!0,...e};return Promise.all(r.Vr.batch(()=>this.#l.findAll(t).map(t=>t.cancel(a)))).then(n.ZT).catch(n.ZT)}invalidateQueries(t,e={}){return r.Vr.batch(()=>(this.#l.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let a={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(r.Vr.batch(()=>this.#l.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,a);return a.throwOnError||(e=e.catch(n.ZT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(n.ZT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let a=this.#l.build(this,e);return a.isStaleByTime((0,n.KC)(e.staleTime,a))?a.fetch(e):Promise.resolve(a.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(t){return t.behavior=f(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(t){return t.behavior=f(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return h.N.isOnline()?this.#a.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#l}getMutationCache(){return this.#a}getDefaultOptions(){return this.#u}setDefaultOptions(t){this.#u=t}setQueryDefaults(t,e){this.#d.set((0,n.Ym)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#d.values()],a={};return e.forEach(e=>{(0,n.to)(t,e.queryKey)&&Object.assign(a,e.defaultOptions)}),a}setMutationDefaults(t,e){this.#h.set((0,n.Ym)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#h.values()],a={};return e.forEach(e=>{(0,n.to)(t,e.mutationKey)&&Object.assign(a,e.defaultOptions)}),a}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#u.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,n.Rm)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===n.CN&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#u.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#l.clear(),this.#a.clear()}}},19616:function(t,e,a){a.d(e,{G:function(){return o}});var n=a(2265);let i={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class r{constructor(t,e){this.fn=t,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...i,...e}}setOptions(t){return this._options={...this._options,...t},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...t){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...t),this._canLeadingExecute=!1),(this._options.leading||this._options.trailing)&&(this._isPending=!0),this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=setTimeout(()=>{this._canLeadingExecute=!0,this._isPending=!1,this._options.trailing&&this.executeFunction(...t)},this._options.wait)}executeFunction(...t){this._options.enabled&&(this.fn(...t),this._executionCount++,this._options.onExecute(this))}cancel(){this._timeoutId&&(clearTimeout(this._timeoutId),this._canLeadingExecute=!0,this._isPending=!1)}getExecutionCount(){return this._executionCount}getIsPending(){return this._options.enabled&&this._isPending}}function o(t,e){let[a,i]=(0,n.useState)(t),o=function(t,e){let[a]=(0,n.useState)(()=>{var a;return Object.getOwnPropertyNames(Object.getPrototypeOf(a=new r(t,e))).filter(t=>"function"==typeof a[t]).reduce((t,e)=>{let n=a[e];return"function"==typeof n&&(t[e]=n.bind(a)),t},{})});return a.setOptions(e),a}(i,e);return[a,o.maybeExecute,o]}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5975-a2924ccaea8442a9.js b/litellm/proxy/_experimental/out/_next/static/chunks/5975-a2924ccaea8442a9.js deleted file mode 100644 index edddd843c8f..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5975-a2924ccaea8442a9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5975],{9513:function(e,t,l){l.d(t,{Ct:function(){return s.Z},JO:function(){return n.Z},RM:function(){return i.Z},SC:function(){return u.Z},iA:function(){return r.Z},pj:function(){return o.Z},ss:function(){return c.Z},xs:function(){return d.Z},xv:function(){return m.Z},zx:function(){return a.Z}});var s=l(41649),a=l(78489),n=l(47323),r=l(21626),i=l(97214),o=l(28241),c=l(58834),d=l(69552),u=l(71876),m=l(84264)},12011:function(e,t,l){l.r(t),l.d(t,{default:function(){return j}});var s=l(57437),a=l(2265),n=l(99376),r=l(78489),i=l(94789),o=l(12514),c=l(49804),d=l(67101),u=l(84264),m=l(49566),g=l(96761),h=l(84566),x=l(19250),f=l(14474),y=l(10032),p=l(5545),w=l(3914);function j(){let[e]=y.Z.useForm(),t=(0,n.useSearchParams)();(0,w.e)("token");let l=t.get("invitation_id"),j=t.get("action"),[S,v]=(0,a.useState)(null),[_,b]=(0,a.useState)(""),[k,N]=(0,a.useState)(""),[z,C]=(0,a.useState)(null),[D,I]=(0,a.useState)(""),[Z,O]=(0,a.useState)(""),[A,E]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(0,x.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),E(!1)})},[]),(0,a.useEffect)(()=>{l&&!A&&(0,x.getOnboardingCredentials)(l).then(e=>{let t=e.login_url;console.log("login_url:",t),I(t);let l=e.token,s=(0,f.o)(l);O(l),console.log("decoded:",s),v(s.key),console.log("decoded user email:",s.user_email),N(s.user_email),C(s.user_id)})},[l,A]),(0,s.jsx)("div",{className:"mx-auto w-full max-w-md mt-10",children:(0,s.jsxs)(o.Z,{children:[(0,s.jsx)(g.Z,{className:"text-sm mb-5 text-center",children:"\uD83D\uDE85 LiteLLM"}),(0,s.jsx)(g.Z,{className:"text-xl",children:"reset_password"===j?"Reset Password":"Sign up"}),(0,s.jsx)(u.Z,{children:"reset_password"===j?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==j&&(0,s.jsx)(i.Z,{className:"mt-4",title:"SSO",icon:h.GH$,color:"sky",children:(0,s.jsxs)(d.Z,{numItems:2,className:"flex justify-between items-center",children:[(0,s.jsx)(c.Z,{children:"SSO is under the Enterprise Tier."}),(0,s.jsx)(c.Z,{children:(0,s.jsx)(r.Z,{variant:"primary",className:"mb-2",children:(0,s.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"Get Free Trial"})})})]})}),(0,s.jsxs)(y.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",S,"token:",Z,"formValues:",e),S&&Z&&(e.user_email=k,z&&l&&(0,x.claimOnboardingToken)(S,l,z,e.password).then(e=>{document.cookie="token="+Z;let t=(0,x.getProxyBaseUrl)();console.log("proxyBaseUrl:",t);let l=t?"".concat(t,"/ui/?login=success"):"/ui/?login=success";console.log("redirecting to:",l),window.location.href=l}))},children:[(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.Z.Item,{label:"Email Address",name:"user_email",children:(0,s.jsx)(m.Z,{type:"email",disabled:!0,value:k,defaultValue:k,className:"max-w-md"})}),(0,s.jsx)(y.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===j?"Enter your new password":"Create a password for your account",children:(0,s.jsx)(m.Z,{placeholder:"",type:"password",className:"max-w-md"})})]}),(0,s.jsx)("div",{className:"mt-10",children:(0,s.jsx)(p.ZP,{htmlType:"submit",children:"reset_password"===j?"Reset Password":"Sign Up"})})]})]})})}},39210:function(e,t,l){l.d(t,{Z:function(){return a}});var s=l(19250);let a=async(e,t,l,a,n)=>{let r;r="Admin"!=l&&"Admin Viewer"!=l?await (0,s.teamListCall)(e,(null==a?void 0:a.organization_id)||null,t):await (0,s.teamListCall)(e,(null==a?void 0:a.organization_id)||null),console.log("givenTeams: ".concat(r)),n(r)}},85975:function(e,t,l){l.d(t,{Z:function(){return K}});var s=l(57437),a=l(3914),n=l(49804),r=l(67101),i=l(57840),o=l(14474),c=l(99376),d=l(2265),u=l(12011),m=l(39210),g=l(19250),h=l(19640),x=l(30280),f=l(59872),y=l(86462),p=l(47686),w=l(44633),j=l(49084),S=l(71594),v=l(24525),_=l(9513),b=l(99981),k=l(50337),N=l(46468),z=l(11713),C=l(30841),D=l(7310),I=l.n(D),Z=l(12363),O=l(39760),A=l(23048),E=l(50665);function U(e){let{teams:t,organizations:l,onSortChange:a,currentSort:n}=e,[r,i]=(0,d.useState)(null),[o,c]=d.useState(()=>n?[{id:n.sortBy,desc:"desc"===n.sortOrder}]:[{id:"created_at",desc:!0}]),[u,m]=d.useState({pageIndex:0,pageSize:50}),{data:h,isPending:D,isFetching:U,refetch:K}=(0,x.E)(u.pageIndex+1,u.pageSize),P=(null==h?void 0:h.total_count)||0,[R,V]=(0,d.useState)({}),{filters:L,filteredKeys:T,allKeyAliases:M,allTeams:B,allOrganizations:F,handleFilterChange:J,handleFilterReset:H}=function(e){let{keys:t,teams:l,organizations:s}=e,a={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},{accessToken:n}=(0,O.Z)(),[r,i]=(0,d.useState)(a),[o,c]=(0,d.useState)(l||[]),[u,m]=(0,d.useState)(s||[]),[h,x]=(0,d.useState)(t),f=(0,d.useRef)(0),y=(0,d.useCallback)(I()(async e=>{if(!n)return;let t=Date.now();f.current=t;try{let l=await (0,g.keyListCall)(n,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,Z.d,e["Sort By"]||null,e["Sort Order"]||null);t===f.current&&l&&(x(l.keys),console.log("called from debouncedSearch filters:",JSON.stringify(e)),console.log("called from debouncedSearch data:",JSON.stringify(l)))}catch(e){console.error("Error searching users:",e)}},300),[n]);(0,d.useEffect)(()=>{if(!t){x([]);return}let e=[...t];r["Team ID"]&&(e=e.filter(e=>e.team_id===r["Team ID"])),r["Organization ID"]&&(e=e.filter(e=>e.organization_id===r["Organization ID"])),x(e)},[t,r]),(0,d.useEffect)(()=>{let e=async()=>{let e=await (0,C.IE)(n);e.length>0&&c(e);let t=await (0,C.cT)(n);t.length>0&&m(t)};n&&e()},[n]);let p=(0,z.a)({queryKey:["allKeys"],queryFn:async()=>{if(!n)throw Error("Access token required");return await (0,C.LO)(n)},enabled:!!n}).data||[];return(0,d.useEffect)(()=>{l&&l.length>0&&c(e=>e.length{s&&s.length>0&&m(e=>e.length{i({"Team ID":e["Team ID"]||"","Organization ID":e["Organization ID"]||"","Key Alias":e["Key Alias"]||"","User ID":e["User ID"]||"","Sort By":e["Sort By"]||"created_at","Sort Order":e["Sort Order"]||"desc"}),y({...r,...e})},handleFilterReset:()=>{i(a),y(a)}}}({keys:(null==h?void 0:h.keys)||[],teams:t,organizations:l});(0,d.useEffect)(()=>{if(K){let e=()=>{K()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[K]);let W=[{id:"expander",header:()=>null,size:40,cell:e=>{let{row:t}=e;return t.getCanExpand()?(0,s.jsx)("button",{onClick:t.getToggleExpandedHandler(),style:{cursor:"pointer"},children:t.getIsExpanded()?"▼":"▶"}):null}},{id:"token",accessorKey:"token",header:"Key ID",size:150,cell:e=>(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(b.Z,{title:e.getValue(),children:(0,s.jsx)(_.zx,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate max-w-[200px]",onClick:()=>i(e.row.original),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",size:150,cell:e=>{let t=e.getValue(),l=e.cell.column.getSize();return(0,s.jsx)(b.Z,{title:t,children:(0,s.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:l,overflow:"hidden"},children:null!=t?t:"-"})})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",size:120,cell:e=>(0,s.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team Alias",size:120,cell:e=>{let{row:l,getValue:s}=e,a=s(),n=null==t?void 0:t.find(e=>e.team_id===a);return(null==n?void 0:n.team_alias)||"Unknown"}},{id:"team_id",accessorKey:"team_id",header:"Team ID",size:120,cell:e=>(0,s.jsx)(b.Z,{title:e.getValue(),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",size:140,cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user",header:"User Email",size:160,cell:e=>{let t=e.getValue(),l=null==t?void 0:t.user_email,a=e.cell.column.getSize();return(0,s.jsx)(b.Z,{title:l,children:(0,s.jsx)("span",{className:"font-mono text-xs truncate block",style:{maxWidth:a,overflow:"hidden"},children:null!=l?l:"-"})})}},{id:"user_id",accessorKey:"user_id",header:"User ID",size:120,cell:e=>{let t=e.getValue();return t&&t.length>15?(0,s.jsx)(b.Z,{title:t,children:(0,s.jsxs)("span",{children:[t.slice(0,7),"..."]})}):t||"-"}},{id:"created_at",accessorKey:"created_at",header:"Created At",size:120,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",size:120,cell:e=>{let t=e.getValue();return t&&t.length>15?(0,s.jsx)(b.Z,{title:t,children:(0,s.jsxs)("span",{children:[t.slice(0,7),"..."]})}):t}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",size:120,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"expires",accessorKey:"expires",header:"Expires",size:120,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",size:100,cell:e=>(0,f.pw)(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",size:110,cell:e=>{let t=e.getValue();return null===t?"Unlimited":"$".concat((0,f.pw)(t))}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",size:130,cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",size:200,cell:e=>{let t=e.getValue();return(0,s.jsx)("div",{className:"flex flex-col py-2",children:Array.isArray(t)?(0,s.jsx)("div",{className:"flex flex-col",children:0===t.length?(0,s.jsx)(_.Ct,{size:"xs",className:"mb-1",color:"red",children:(0,s.jsx)(_.xv,{children:"All Proxy Models"})}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"flex items-start",children:[t.length>3&&(0,s.jsx)("div",{children:(0,s.jsx)(_.JO,{icon:R[e.row.id]?y.Z:p.Z,className:"cursor-pointer",size:"xs",onClick:()=>{V(t=>({...t,[e.row.id]:!t[e.row.id]}))}})}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[t.slice(0,3).map((e,t)=>"all-proxy-models"===e?(0,s.jsx)(_.Ct,{size:"xs",color:"red",children:(0,s.jsx)(_.xv,{children:"All Proxy Models"})},t):(0,s.jsx)(_.Ct,{size:"xs",color:"blue",children:(0,s.jsx)(_.xv,{children:e.length>30?"".concat((0,N.W0)(e).slice(0,30),"..."):(0,N.W0)(e)})},t)),t.length>3&&!R[e.row.id]&&(0,s.jsx)(_.Ct,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,s.jsxs)(_.xv,{children:["+",t.length-3," ",t.length-3==1?"more model":"more models"]})}),R[e.row.id]&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:t.slice(3).map((e,t)=>"all-proxy-models"===e?(0,s.jsx)(_.Ct,{size:"xs",color:"red",children:(0,s.jsx)(_.xv,{children:"All Proxy Models"})},t+3):(0,s.jsx)(_.Ct,{size:"xs",color:"blue",children:(0,s.jsx)(_.xv,{children:e.length>30?"".concat((0,N.W0)(e).slice(0,30),"..."):(0,N.W0)(e)})},t+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",size:140,cell:e=>{let{row:t}=e,l=t.original;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{children:["TPM: ",null!==l.tpm_limit?l.tpm_limit:"Unlimited"]}),(0,s.jsxs)("div",{children:["RPM: ",null!==l.rpm_limit?l.rpm_limit:"Unlimited"]})]})}}];console.log("keys: ".concat(JSON.stringify(h)));let q=(0,S.b7)({data:T,columns:W.filter(e=>"expander"!==e.id),columnResizeMode:"onChange",columnResizeDirection:"ltr",state:{sorting:o,pagination:u},onSortingChange:e=>{let t="function"==typeof e?e(o):e;if(console.log("newSorting: ".concat(JSON.stringify(t))),c(t),t&&t.length>0){let e=t[0],l=e.id,s=e.desc?"desc":"asc";console.log("sortBy: ".concat(l,", sortOrder: ").concat(s)),J({...L,"Sort By":l,"Sort Order":s}),null==a||a(l,s)}},onPaginationChange:m,getCoreRowModel:(0,v.sC)(),getSortedRowModel:(0,v.tj)(),getPaginationRowModel:(0,v.G_)(),enableSorting:!0,manualSorting:!1,manualPagination:!0,pageCount:Math.ceil(P/u.pageSize)});d.useEffect(()=>{n&&c([{id:n.sortBy,desc:"desc"===n.sortOrder}])},[n]);let{pageIndex:G,pageSize:$}=q.getState().pagination,Q="".concat(G*$+1," - ").concat(Math.min((G+1)*$,P));return(0,s.jsx)("div",{className:"w-full h-full overflow-hidden",children:r?(0,s.jsx)(E.Z,{keyId:r.token,onClose:()=>i(null),keyData:r,teams:B}):(0,s.jsxs)("div",{className:"border-b py-4 flex-1 overflow-hidden",children:[(0,s.jsx)("div",{className:"w-full mb-6",children:(0,s.jsx)(A.Z,{options:[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>B&&0!==B.length?B.filter(t=>t.team_id.toLowerCase().includes(e.toLowerCase())||t.team_alias&&t.team_alias.toLowerCase().includes(e.toLowerCase())).map(e=>({label:"".concat(e.team_alias||e.team_id," (").concat(e.team_id,")"),value:e.team_id})):[]},{name:"Organization ID",label:"Organization ID",isSearchable:!0,searchFn:async e=>F&&0!==F.length?F.filter(t=>{var l,s;return null!==(s=null===(l=t.organization_id)||void 0===l?void 0:l.toLowerCase().includes(e.toLowerCase()))&&void 0!==s&&s}).filter(e=>null!==e.organization_id&&void 0!==e.organization_id).map(e=>({label:"".concat(e.organization_id||"Unknown"," (").concat(e.organization_id,")"),value:e.organization_id})):[]},{name:"Key Alias",label:"Key Alias",isSearchable:!0,searchFn:async e=>M.filter(t=>t.toLowerCase().includes(e.toLowerCase())).map(e=>({label:e,value:e}))},{name:"User ID",label:"User ID",isSearchable:!1},{name:"Key Hash",label:"Key Hash",isSearchable:!1}],onApplyFilters:J,initialValues:L,onResetFilters:H})}),(0,s.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[D||U?(0,s.jsx)(k.Z.Node,{active:!0,style:{width:200,height:20}}):(0,s.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing ",Q," of ",P," results"]}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-2",children:[D||U?(0,s.jsx)(k.Z.Node,{active:!0,style:{width:74,height:20}}):(0,s.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",G+1," of ",q.getPageCount()]}),D||U?(0,s.jsx)(k.Z.Button,{active:!0,size:"small",style:{width:84,height:30}}):(0,s.jsx)("button",{onClick:()=>q.previousPage(),disabled:D||U||!q.getCanPreviousPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),D||U?(0,s.jsx)(k.Z.Button,{active:!0,size:"small",style:{width:58,height:30}}):(0,s.jsx)("button",{onClick:()=>q.nextPage(),disabled:D||U||!q.getCanNextPage(),className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]}),(0,s.jsx)("div",{className:"h-[75vh] overflow-auto",children:(0,s.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(_.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",style:{width:q.getCenterTotalSize()},children:[(0,s.jsx)(_.ss,{children:q.getHeaderGroups().map(e=>(0,s.jsx)(_.SC,{children:e.headers.map(e=>(0,s.jsx)(_.xs,{"data-header-id":e.id,className:"py-1 h-8 relative hover:bg-gray-50 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),style:{width:e.getSize(),position:"relative"},onMouseEnter:()=>{let t=document.querySelector('[data-header-id="'.concat(e.id,'"] .resizer'));t&&(t.style.opacity="0.5")},onMouseLeave:()=>{let t=document.querySelector('[data-header-id="'.concat(e.id,'"] .resizer'));t&&!e.column.getIsResizing()&&(t.style.opacity="0")},onClick:e.column.getToggleSortingHandler(),children:(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,S.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,s.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,s.jsx)(w.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,s.jsx)(y.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,s.jsx)(j.Z,{className:"h-4 w-4 text-gray-400"})}),(0,s.jsx)("div",{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"resizer ".concat(q.options.columnResizeDirection," ").concat(e.column.getIsResizing()?"isResizing":""),style:{position:"absolute",right:0,top:0,height:"100%",width:"5px",background:e.column.getIsResizing()?"#3b82f6":"transparent",cursor:"col-resize",userSelect:"none",touchAction:"none",opacity:e.column.getIsResizing()?1:0}})]})},e.id))},e.id))}),(0,s.jsx)(_.RM,{children:D||U?(0,s.jsx)(_.SC,{children:(0,s.jsx)(_.pj,{colSpan:W.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"\uD83D\uDE85 Loading keys..."})})})}):T.length>0?q.getRowModel().rows.map(e=>(0,s.jsx)(_.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(_.pj,{style:{width:e.column.getSize(),maxWidth:"8-x",whiteSpace:"pre-wrap",overflow:"hidden"},className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("models"===e.column.id&&e.getValue().length>3?"px-0":""),children:(0,S.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,s.jsx)(_.SC,{children:(0,s.jsx)(_.pj,{colSpan:W.length,className:"h-8 text-center",children:(0,s.jsx)("div",{className:"text-center text-gray-500",children:(0,s.jsx)("p",{children:"No keys found"})})})})})]})})})})]})})}var K=e=>{let{userID:t,userRole:l,teams:x,keys:f,setUserRole:y,userEmail:p,setUserEmail:w,setTeams:j,setKeys:S,premiumUser:v,organizations:_,addKey:b,createClicked:k}=e,[N,z]=(0,d.useState)(null),[C,D]=(0,d.useState)(null),I=(0,c.useSearchParams)(),Z=function(e){console.log("COOKIES",document.cookie);let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}("token"),O=I.get("invitation_id"),[A,E]=(0,d.useState)(null),[K,P]=(0,d.useState)(null),[R,V]=(0,d.useState)([]),[L,T]=(0,d.useState)(null),[M,B]=(0,d.useState)(null);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,d.useEffect)(()=>{if(Z){let e=(0,o.o)(Z);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),E(e.key),e.user_role){let t=function(e){if(!e)return"Undefined Role";switch(console.log("Received user role: ".concat(e)),e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"app_user":return"App User";case"internal_user":return"Internal User";case"internal_user_viewer":return"Internal Viewer";default:return"Unknown Role"}}(e.user_role);console.log("Decoded user_role:",t),y(t)}else console.log("User role not defined");e.user_email?w(e.user_email):console.log("User Email is not set ".concat(e))}}if(t&&A&&l&&!f&&!N){let e=sessionStorage.getItem("userModels"+t);e?V(JSON.parse(e)):(console.log("currentOrg: ".concat(JSON.stringify(C))),(async()=>{try{let e=await (0,g.getProxyUISettings)(A);T(e);let s=await (0,g.userInfoCall)(A,t,l,!1,null,null);z(s.user_info),console.log("userSpendData: ".concat(JSON.stringify(N))),(null==s?void 0:s.teams[0].keys)?S(s.keys.concat(s.teams.filter(e=>"Admin"===l||e.user_id===t).flatMap(e=>e.keys))):S(s.keys),sessionStorage.setItem("userData"+t,JSON.stringify(s.keys)),sessionStorage.setItem("userSpendData"+t,JSON.stringify(s.user_info));let a=(await (0,g.modelAvailableCall)(A,t,l)).data.map(e=>e.id);console.log("available_model_names:",a),V(a),console.log("userModels:",R),sessionStorage.setItem("userModels"+t,JSON.stringify(a))}catch(e){console.error("There was an error fetching the data",e),e.message.includes("Invalid proxy server token passed")&&F()}})(),(0,m.Z)(A,t,l,C,j))}},[t,Z,A,f,l]),(0,d.useEffect)(()=>{A&&(async()=>{try{let e=await (0,g.keyInfoCall)(A,[A]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&F()}})()},[A]),(0,d.useEffect)(()=>{console.log("currentOrg: ".concat(JSON.stringify(C),", accessToken: ").concat(A,", userID: ").concat(t,", userRole: ").concat(l)),A&&(console.log("fetching teams"),(0,m.Z)(A,t,l,C,j))},[C]),(0,d.useEffect)(()=>{if(null!==f&&null!=M&&null!==M.team_id){let e=0;for(let t of(console.log("keys: ".concat(JSON.stringify(f))),f))M.hasOwnProperty("team_id")&&null!==t.team_id&&t.team_id===M.team_id&&(e+=t.spend);console.log("sum: ".concat(e)),P(e)}else if(null!==f){let e=0;for(let t of f)e+=t.spend;P(e)}},[M]),null!=O)return(0,s.jsx)(u.default,{});function F(){(0,a.b)();let e=(0,g.getProxyBaseUrl)();console.log("proxyBaseUrl:",e);let t=e?"".concat(e,"/sso/key/generate"):"/sso/key/generate";return console.log("Full URL:",t),window.location.href=t,null}if(null==Z)return console.log("All cookies before redirect:",document.cookie),F(),null;try{let e=(0,o.o)(Z);console.log("Decoded token:",e);let t=e.exp,l=Math.floor(Date.now()/1e3);if(t&&l>=t)return console.log("Token expired, redirecting to login"),F(),null}catch(e){return console.error("Error decoding token:",e),(0,a.b)(),F(),null}if(null==A)return null;if(null==t)return(0,s.jsx)("h1",{children:"User ID is not set"});if(null==l&&y("App Owner"),l&&"Admin Viewer"==l){let{Title:e,Paragraph:t}=i.default;return(0,s.jsxs)("div",{children:[(0,s.jsx)(e,{level:1,children:"Access Denied"}),(0,s.jsx)(t,{children:"Ask your proxy admin for access to create keys"})]})}return console.log("inside user dashboard, selected team",M),console.log("All cookies after redirect:",document.cookie),(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(r.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(n.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)(h.ZP,{team:M,teams:x,data:f,addKey:b},M?M.team_id:null),(0,s.jsx)(U,{teams:x,organizations:_})]})})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5992-e20acf7c5cf0486a.js b/litellm/proxy/_experimental/out/_next/static/chunks/5992-e20acf7c5cf0486a.js deleted file mode 100644 index bd6600debc1..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5992-e20acf7c5cf0486a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5992],{19046:function(e,t,s){s.d(t,{Dx:function(){return l.Z},Zb:function(){return r.Z},oi:function(){return o.Z},xv:function(){return n.Z},zx:function(){return a.Z}});var a=s(78489),r=s(12514),n=s(84264),o=s(49566),l=s(96761)},88712:function(e,t,s){var a=s(57437);s(2265);var r=s(33145),n=s(66830),o=s(50010);t.Z=e=>{let{message:t}=e;if(!(0,n.br)(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,a.jsx)("div",{className:"mb-2",children:s?(0,a.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,a.jsx)(o.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,a.jsx)(r.default,{src:t.imagePreviewUrl||"",alt:"User uploaded image",width:256,height:200,className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px",width:"auto",height:"auto"}})})}},27930:function(e,t,s){var a=s(57437);s(2265);var r=s(65319),n=s(99981),o=s(53508);let{Dragger:l}=r.default;t.Z=e=>{let{chatUploadedImage:t,chatImagePreviewUrl:s,onImageUpload:r,onRemoveImage:i}=e;return(0,a.jsx)(a.Fragment,{children:!t&&(0,a.jsx)(l,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,a.jsx)(n.Z,{title:"Attach image or PDF",children:(0,a.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,a.jsx)(o.Z,{style:{fontSize:"16px"}})})})})})}},66830:function(e,t,s){s.d(t,{Hk:function(){return n},Sn:function(){return r},br:function(){return o}});let a=e=>new Promise((t,s)=>{let a=new FileReader;a.onload=()=>{t(a.result)},a.onerror=s,a.readAsDataURL(e)}),r=async(e,t)=>({role:"user",content:[{type:"text",text:e},{type:"image_url",image_url:{url:await a(t)}}]}),n=(e,t,s,a)=>{let r="";t&&a&&(r=a.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(r):e};return t&&s&&(n.imagePreviewUrl=s),n},o=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl},25992:function(e,t,s){s.d(t,{Z:function(){return e5}});var a=s(57437),r=s(61935),n=s(92403),o=s(55322),l=s(26430),i=s(12660),c=s(25980),d=s(69993),m=s(71891),u=s(58630),x=s(15424),g=s(44625),p=s(57400),h=s(11894),f=s(15883),v=s(99890),b=s(26349),y=s(50010),j=s(79276),N=s(19046),w=s(4260),S=s(65319),k=s(57840),P=s(37592),_=s(5545),C=s(79326),A=s(99981),E=s(10353),I=s(22116),Z=s(2265),T=s(62831),R=s(17906),L=s(94263),O=s(93837),K=s(9309),U=s(67479),M=s(9114),D=s(99020),z=s(97415),B=s(92280),F=s(61994),H=s(19015),G=s(85847),W=e=>{let{temperature:t=1,maxTokens:s=2048,useAdvancedParams:r,onTemperatureChange:n,onMaxTokensChange:o,onUseAdvancedParamsChange:l}=e,[i,c]=(0,Z.useState)(!1),d=void 0!==r?r:i,[m,u]=(0,Z.useState)(t),[g,p]=(0,Z.useState)(s);(0,Z.useEffect)(()=>{u(t)},[t]),(0,Z.useEffect)(()=>{p(s)},[s]);let h=e=>{let t=null!=e?e:1;u(t),null==n||n(t)},f=e=>{let t=null!=e?e:1e3;p(t),null==o||o(t)},v=d?"text-gray-700":"text-gray-400",b=e=>{l?l(e):c(e)};return(0,a.jsxs)("div",{className:"space-y-4 p-4 w-80",children:[(0,a.jsx)(F.Z,{checked:d,onChange:e=>b(e.target.checked),children:(0,a.jsx)("span",{className:"font-medium",children:"Use Advanced Parameters"})}),(0,a.jsxs)("div",{className:"space-y-4 transition-opacity duration-200",style:{opacity:d?1:.4},children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(B.x,{className:"text-sm ".concat(v),children:"Temperature"}),(0,a.jsx)(A.Z,{title:"Controls randomness. Lower values make output more deterministic, higher values more creative.",children:(0,a.jsx)(x.Z,{className:"text-xs ".concat(v," cursor-help")})})]}),(0,a.jsx)(H.Z,{min:0,max:2,step:.1,value:m,onChange:h,disabled:!d,precision:1,className:"w-20"})]}),(0,a.jsx)(G.Z,{min:0,max:2,step:.1,value:m,onChange:h,disabled:!d,marks:{0:"0",1:"1.0",2:"2.0"}})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(B.x,{className:"text-sm ".concat(v),children:"Max Tokens"}),(0,a.jsx)(A.Z,{title:"Maximum number of tokens to generate in the response.",children:(0,a.jsx)(x.Z,{className:"text-xs ".concat(v," cursor-help")})})]}),(0,a.jsx)(H.Z,{min:1,max:32768,step:1,value:g,onChange:f,disabled:!d})]}),(0,a.jsx)(G.Z,{min:1,max:32768,step:1,value:g,onChange:f,disabled:!d,marks:{1:"1",32768:"32768"}})]})]})]})},q=e=>{let{message:t}=e;return t.isAudio&&"string"==typeof t.content?(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsx)("audio",{controls:!0,src:t.content,className:"max-w-full",style:{maxWidth:"500px"},children:"Your browser does not support the audio element."})}):null},J=s(8443);let V={ALLOY:"Alloy - Professional and confident",ASH:"Ash - Casual and relaxed",BALAD:"Ballad - Smooth and melodic",CORAL:"Coral - Warm and engaging",ECHO:"Echo - Friendly and conversational",FABLE:"Fable - Wise and measured",NOVA:"Nova - Friendly and conversational",ONYX:"Onyx - Deep and authoritative",SAGE:"Sage - Wise and measured",SHIMMER:"Shimmer - Bright and cheerful"},Y=Object.entries({ALLOY:"alloy",ASH:"ash",BALAD:"ballad",CORAL:"coral",ECHO:"echo",FABLE:"fable",NOVA:"nova",ONYX:"onyx",SAGE:"sage",SHIMMER:"shimmer"}).map(e=>{let[t,s]=e;return{value:s,label:V[t]}}),X=[{value:J.KP.CHAT,label:"/v1/chat/completions"},{value:J.KP.RESPONSES,label:"/v1/responses"},{value:J.KP.ANTHROPIC_MESSAGES,label:"/v1/messages"},{value:J.KP.IMAGE,label:"/v1/images/generations"},{value:J.KP.IMAGE_EDITS,label:"/v1/images/edits"},{value:J.KP.EMBEDDINGS,label:"/v1/embeddings"},{value:J.KP.SPEECH,label:"/v1/audio/speech"},{value:J.KP.TRANSCRIPTION,label:"/v1/audio/transcriptions"},{value:J.KP.A2A_AGENTS,label:"/v1/a2a/message/send"}];var $=s(88712),Q=s(27930),ee=s(66830),et=s(82971),es=e=>{let{endpointType:t,onEndpointChange:s,className:r}=e;return(0,a.jsx)("div",{className:r,children:(0,a.jsx)(P.default,{showSearch:!0,value:t,style:{width:"100%"},onChange:s,options:X,className:"rounded-md",filterOption:(e,t)=>{var s,a;return(null!==(s=null==t?void 0:t.label)&&void 0!==s?s:"").toLowerCase().includes(e.toLowerCase())||(null!==(a=null==t?void 0:t.value)&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())}})})},ea=s(85498),er=s(19250);async function en(e,t,s,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=(arguments.length>12&&arguments[12],arguments.length>13?arguments[13]:void 0);if(!a)throw Error("Virtual Key is required");console.log=function(){};let x=u||(0,er.getProxyBaseUrl)(),g={};r&&r.length>0&&(g["x-litellm-tags"]=r.join(","));let p=new ea.ZP({apiKey:a,baseURL:x,dangerouslyAllowBrowser:!0,defaultHeaders:g});try{let a=Date.now(),r=!1,u={model:s,messages:e.map(e=>({role:e.role,content:e.content})),stream:!0,max_tokens:1024,litellm_trace_id:c};for await(let e of(d&&(u.vector_store_ids=d),m&&(u.guardrails=m),p.messages.stream(u,{signal:n}))){if(console.log("Stream event:",e),"content_block_delta"===e.type){let n=e.delta;if(!r){r=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),l&&l(e)}"text_delta"===n.type?t("assistant",n.text,s):"reasoning_delta"===n.type&&o&&o(n.text)}if("message_delta"===e.type&&e.usage&&i){let t=e.usage;console.log("Usage data found:",t);let s={completionTokens:t.output_tokens,promptTokens:t.input_tokens,totalTokens:t.input_tokens+t.output_tokens};i(s)}}}catch(e){throw(null==n?void 0:n.aborted)?console.log("Anthropic messages request was cancelled"):M.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var eo=s(7271);async function el(e,t,s,a,r,n,o,l,i,c){console.log=function(){},console.log("isLocal:",!1);let d=c||(0,er.getProxyBaseUrl)(),m=new eo.ZP.OpenAI({apiKey:r,baseURL:d,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let r=await m.audio.speech.create({model:a,input:e,voice:t,...l?{response_format:l}:{},...i?{speed:i}:{}},{signal:o}),n=await r.blob(),c=URL.createObjectURL(n);s(c,a)}catch(e){throw(null==o?void 0:o.aborted)?console.log("Audio speech request was cancelled"):M.Z.fromBackend("Error occurred while generating speech. Please try again. Error: ".concat(e)),e}}async function ei(e,t,s,a,r,n,o,l,i,c,d){console.log=function(){},console.log("isLocal:",!1);let m=d||(0,er.getProxyBaseUrl)(),u=new eo.ZP.OpenAI({apiKey:a,baseURL:m,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{console.log("Processing audio file for transcription:",e.name);let a=await u.audio.transcriptions.create({model:s,file:e,...o?{language:o}:{},...l?{prompt:l}:{},...i?{response_format:i}:{},...void 0!==c?{temperature:c}:{}},{signal:n});if(console.log("Transcription response:",a),a&&a.text)t(a.text,s),M.Z.success("Audio transcribed successfully");else throw Error("No transcription text in response")}catch(e){if(console.error("Error making audio transcription request:",e),null==n?void 0:n.aborted)console.log("Audio transcription request was cancelled");else{var x;let t="Failed to transcribe audio";(null==e?void 0:null===(x=e.error)||void 0===x?void 0:x.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),M.Z.fromBackend("Audio transcription failed: ".concat(t))}throw e}}var ec=s(95459);async function ed(e,t,s,a,r,n){if(!a)throw Error("Virtual Key is required");console.log=function(){};let o=n||(0,er.getProxyBaseUrl)(),l={};r&&r.length>0&&(l["x-litellm-tags"]=r.join(","));try{var i,c,d;let r=o.endsWith("/")?o.slice(0,-1):o,n=await fetch("".concat(r,"/embeddings"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a),...l},body:JSON.stringify({model:s,input:e})});if(!n.ok){let e=await n.text();throw Error(e||"Request failed with status ".concat(n.status))}let m=await n.json(),u=null==m?void 0:null===(c=m.data)||void 0===c?void 0:null===(i=c[0])||void 0===i?void 0:i.embedding;if(!u)throw Error("No embedding returned from server");t(JSON.stringify(u),null!==(d=null==m?void 0:m.model)&&void 0!==d?d:s)}catch(e){throw M.Z.fromBackend("Error occurred while making embeddings request. Please try again. Error: ".concat(e)),e}}var em=s(10703);async function eu(e,t,s,a,r,n,o,l){console.log=function(){},console.log("isLocal:",!1);let i=l||(0,er.getProxyBaseUrl)(),c=new eo.ZP.OpenAI({apiKey:r,baseURL:i,dangerouslyAllowBrowser:!0,defaultHeaders:n&&n.length>0?{"x-litellm-tags":n.join(",")}:void 0});try{let r=Array.isArray(e)?e:[e],n=[];for(let e=0;e1&&M.Z.success("Successfully processed ".concat(n.length," images"))}catch(e){if(console.error("Error making image edit request:",e),null==o?void 0:o.aborted)console.log("Image edits request was cancelled");else{var d;let t="Failed to edit image(s)";(null==e?void 0:null===(d=e.error)||void 0===d?void 0:d.message)?t=e.error.message:(null==e?void 0:e.message)&&(t=e.message),M.Z.fromBackend("Image edit failed: ".concat(t))}throw e}}async function ex(e,t,s,a,r,n,o){console.log=function(){},console.log("isLocal:",!1);let l=o||(0,er.getProxyBaseUrl)(),i=new eo.ZP.OpenAI({apiKey:a,baseURL:l,dangerouslyAllowBrowser:!0,defaultHeaders:r&&r.length>0?{"x-litellm-tags":r.join(",")}:void 0});try{let a=await i.images.generate({model:s,prompt:e},{signal:n});if(console.log(a.data),a.data&&a.data[0]){if(a.data[0].url)t(a.data[0].url,s);else if(a.data[0].b64_json){let e=a.data[0].b64_json;t("data:image/png;base64,".concat(e),s)}else throw Error("No image data found in response")}else throw Error("Invalid response format")}catch(e){throw(null==n?void 0:n.aborted)?console.log("Image generation request was cancelled"):M.Z.fromBackend("Error occurred while generating image. Please try again. Error: ".concat(e)),e}}async function eg(e,t,s,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],n=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,i=arguments.length>8?arguments[8]:void 0,c=arguments.length>9?arguments[9]:void 0,d=arguments.length>10?arguments[10]:void 0,m=arguments.length>11?arguments[11]:void 0,u=arguments.length>12?arguments[12]:void 0,x=arguments.length>13?arguments[13]:void 0,g=arguments.length>14?arguments[14]:void 0,p=arguments.length>15?arguments[15]:void 0,h=arguments.length>16?arguments[16]:void 0,f=arguments.length>17?arguments[17]:void 0,v=arguments.length>18?arguments[18]:void 0,b=arguments.length>19?arguments[19]:void 0,y=arguments.length>20?arguments[20]:void 0;if(!a)throw Error("Virtual Key is required");if(!s||""===s.trim())throw Error("Model is required. Please select a model before sending a request.");console.log=function(){};let j=v||(0,er.getProxyBaseUrl)(),N={};r&&r.length>0&&(N["x-litellm-tags"]=r.join(","));let w=new eo.ZP.OpenAI({apiKey:a,baseURL:j,dangerouslyAllowBrowser:!0,defaultHeaders:N});try{let a=Date.now(),r=!1,v=e.map(e=>(Array.isArray(e.content),{role:e.role,content:e.content,type:"message"})),j=[];u&&u.length>0&&(u.includes("__all__")?j.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):u.forEach(e=>{let t=null==b?void 0:b.find(t=>t.server_id===e),s=(null==t?void 0:t.alias)||(null==t?void 0:t.server_name)||e,a=(null==y?void 0:y[e])||[];j.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp/".concat(s),require_approval:"never",...a.length>0?{allowed_tools:a}:{}})})),h&&j.push({type:"code_interpreter",container:{type:"auto"}});let N=await w.responses.create({model:s,input:v,stream:!0,litellm_trace_id:c,...x?{previous_response_id:x}:{},...d?{vector_store_ids:d}:{},...m?{guardrails:m}:{},...j.length>0?{tools:j,tool_choice:"auto"}:{}},{signal:n}),I="",Z={code:"",containerId:""};for await(let e of N)if(console.log("Response event:",e),"object"==typeof e&&null!==e){var S,k,P,_,C,A,E;if(((null===(S=e.type)||void 0===S?void 0:S.startsWith("response.mcp_"))||"response.output_item.done"===e.type&&((null===(k=e.item)||void 0===k?void 0:k.type)==="mcp_list_tools"||(null===(P=e.item)||void 0===P?void 0:P.type)==="mcp_call"))&&(console.log("MCP event received:",e),p)){let t={type:e.type,sequence_number:e.sequence_number,output_index:e.output_index,item_id:e.item_id||(null===(A=e.item)||void 0===A?void 0:A.id),item:e.item,delta:e.delta,arguments:e.arguments,timestamp:Date.now()};p(t)}if("response.output_item.done"===e.type&&(null===(_=e.item)||void 0===_?void 0:_.type)==="mcp_call"&&(null===(C=e.item)||void 0===C?void 0:C.name)&&(I=e.item.name,console.log("MCP tool used:",I)),Z=function(e,t){var s;return"response.output_item.done"===e.type&&(null===(s=e.item)||void 0===s?void 0:s.type)==="code_interpreter_call"?(console.log("Code interpreter call completed:",e.item),{code:e.item.code||"",containerId:e.item.container_id||""}):t}(e,Z),!function(e,t,s){var a,r;if("response.output_item.done"===e.type&&(null===(a=e.item)||void 0===a?void 0:a.type)==="message"&&(null===(r=e.item)||void 0===r?void 0:r.content)&&s){for(let a of e.item.content)if("output_text"===a.type&&a.annotations){let e=a.annotations.filter(e=>"container_file_citation"===e.type);(e.length>0||t.code)&&s({code:t.code,containerId:t.containerId,annotations:e})}}}(e,Z,f),"response.role.delta"===e.type)continue;if("response.output_text.delta"===e.type&&"string"==typeof e.delta){let n=e.delta;if(console.log("Text delta",n),n.trim().length>0&&(t("assistant",n,s),!r)){r=!0;let e=Date.now()-a;console.log("First token received! Time:",e,"ms"),l&&l(e)}}if("response.reasoning.delta"===e.type&&"delta"in e){let t=e.delta;"string"==typeof t&&o&&o(t)}if("response.completed"===e.type&&"response"in e){let t=e.response,s=t.usage;if(console.log("Usage data:",s),console.log("Response completed event:",t),t.id&&g&&(console.log("Response ID for session management:",t.id),g(t.id)),s&&i){console.log("Usage data:",s);let e={completionTokens:s.output_tokens,promptTokens:s.input_tokens,totalTokens:s.total_tokens};(null===(E=s.completion_tokens_details)||void 0===E?void 0:E.reasoning_tokens)&&(e.reasoningTokens=s.completion_tokens_details.reasoning_tokens),i(e,I)}}}return N}catch(e){throw(null==n?void 0:n.aborted)?console.log("Responses API request was cancelled"):M.Z.fromBackend("Error occurred while generating model response. Please try again. Error: ".concat(e)),e}}var ep=s(44851),eh=s(41589),ef=s(73879),ev=s(38434),eb=e=>{let{code:t,containerId:s,annotations:n=[],accessToken:o}=e,[l,i]=(0,Z.useState)({}),[c,d]=(0,Z.useState)({}),m=(0,er.getProxyBaseUrl)();(0,Z.useEffect)(()=>{let e=async()=>{for(let r of n){var e,t,s,a;if(((null===(e=r.filename)||void 0===e?void 0:e.toLowerCase().endsWith(".png"))||(null===(t=r.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".jpg"))||(null===(s=r.filename)||void 0===s?void 0:s.toLowerCase().endsWith(".jpeg"))||(null===(a=r.filename)||void 0===a?void 0:a.toLowerCase().endsWith(".gif")))&&r.container_id&&r.file_id){d(e=>({...e,[r.file_id]:!0}));try{let e=await fetch("".concat(m,"/v1/containers/").concat(r.container_id,"/files/").concat(r.file_id,"/content"),{headers:{Authorization:"Bearer ".concat(o)}});if(e.ok){let t=await e.blob(),s=URL.createObjectURL(t);i(e=>({...e,[r.file_id]:s}))}}catch(e){console.error("Error fetching image:",e)}finally{d(e=>({...e,[r.file_id]:!1}))}}}};return n.length>0&&o&&e(),()=>{Object.values(l).forEach(e=>URL.revokeObjectURL(e))}},[n,o,m]);let u=async e=>{try{let t=await fetch("".concat(m,"/v1/containers/").concat(e.container_id,"/files/").concat(e.file_id,"/content"),{headers:{Authorization:"Bearer ".concat(o)}});if(t.ok){let s=await t.blob(),a=URL.createObjectURL(s),r=document.createElement("a");r.href=a,r.download=e.filename||"file_".concat(e.file_id),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}}catch(e){console.error("Error downloading file:",e)}},x=n.filter(e=>{var t,s,a,r;return(null===(t=e.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".png"))||(null===(s=e.filename)||void 0===s?void 0:s.toLowerCase().endsWith(".jpg"))||(null===(a=e.filename)||void 0===a?void 0:a.toLowerCase().endsWith(".jpeg"))||(null===(r=e.filename)||void 0===r?void 0:r.toLowerCase().endsWith(".gif"))}),g=n.filter(e=>{var t,s,a,r;return!(null===(t=e.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".png"))&&!(null===(s=e.filename)||void 0===s?void 0:s.toLowerCase().endsWith(".jpg"))&&!(null===(a=e.filename)||void 0===a?void 0:a.toLowerCase().endsWith(".jpeg"))&&!(null===(r=e.filename)||void 0===r?void 0:r.toLowerCase().endsWith(".gif"))});return t||0!==n.length?(0,a.jsxs)("div",{className:"mt-3 space-y-3",children:[t&&(0,a.jsx)(ep.default,{size:"small",items:[{key:"code",label:(0,a.jsxs)("span",{className:"flex items-center gap-2 text-sm text-gray-600",children:[(0,a.jsx)(h.Z,{})," Python Code Executed"]}),children:(0,a.jsx)(R.Z,{language:"python",style:L.Z,customStyle:{margin:0,borderRadius:"6px",fontSize:"12px",maxHeight:"300px",overflow:"auto"},children:t})}]}),x.map(e=>(0,a.jsx)("div",{className:"rounded-lg border border-gray-200 overflow-hidden",children:c[e.file_id]?(0,a.jsxs)("div",{className:"flex items-center justify-center p-8 bg-gray-50",children:[(0,a.jsx)(E.Z,{indicator:(0,a.jsx)(r.Z,{spin:!0})}),(0,a.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:"Loading image..."})]}):l[e.file_id]?(0,a.jsxs)("div",{children:[(0,a.jsx)("img",{src:l[e.file_id],alt:e.filename||"Generated chart",className:"max-w-full",style:{maxHeight:"400px"}}),(0,a.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-50 border-t border-gray-200",children:[(0,a.jsxs)("span",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,a.jsx)(eh.Z,{})," ",e.filename]}),(0,a.jsxs)("button",{onClick:()=>u(e),className:"text-xs text-blue-500 hover:text-blue-700 flex items-center gap-1",children:[(0,a.jsx)(ef.Z,{})," Download"]})]})]}):(0,a.jsx)("div",{className:"flex items-center justify-center p-4 bg-gray-50",children:(0,a.jsx)("span",{className:"text-sm text-gray-400",children:"Image not available"})})},e.file_id)),g.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map(e=>(0,a.jsxs)("button",{onClick:()=>u(e),className:"flex items-center gap-2 px-3 py-2 bg-gray-50 border border-gray-200 rounded-lg hover:bg-gray-100 transition-colors",children:[(0,a.jsx)(ev.Z,{className:"text-blue-500"}),(0,a.jsx)("span",{className:"text-sm",children:e.filename}),(0,a.jsx)(ef.Z,{className:"text-gray-400"})]},e.file_id))})]}):null},ey=s(91643),ej=s(26832),eN=s(83669),ew=s(29271),eS=s(5540),ek=s(23639),eP=s(62272),e_=s(70464),eC=s(77565);let eA=e=>{switch(e){case"completed":return(0,a.jsx)(eN.Z,{className:"text-green-500"});case"working":case"submitted":return(0,a.jsx)(r.Z,{className:"text-blue-500"});case"failed":case"canceled":return(0,a.jsx)(ew.Z,{className:"text-red-500"});default:return(0,a.jsx)(eS.Z,{className:"text-gray-500"})}},eE=e=>{switch(e){case"completed":return"bg-green-100 text-green-700";case"working":case"submitted":return"bg-blue-100 text-blue-700";case"failed":case"canceled":return"bg-red-100 text-red-700";default:return"bg-gray-100 text-gray-700"}},eI=e=>{if(!e)return null;try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return e}},eZ=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return e?e.length>t?"".concat(e.substring(0,t),"…"):e:null},eT=e=>{navigator.clipboard.writeText(e)};var eR=e=>{let{a2aMetadata:t,timeToFirstToken:s,totalLatency:r}=e,[n,o]=(0,Z.useState)(!1);if(!t&&!s&&!r)return null;let{taskId:l,contextId:i,status:c,metadata:m}=t||{},u=eI(null==c?void 0:c.timestamp);return(0,a.jsxs)("div",{className:"a2a-metrics mt-3 pt-2 border-t border-gray-200 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center mb-2 text-gray-600",children:[(0,a.jsx)(d.Z,{className:"mr-1.5 text-blue-500"}),(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"A2A Metadata"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-gray-500 ml-4",children:[(null==c?void 0:c.state)&&(0,a.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium ".concat(eE(c.state)),children:[eA(c.state),(0,a.jsx)("span",{className:"ml-1 capitalize",children:c.state})]}),u&&(0,a.jsx)(A.Z,{title:null==c?void 0:c.timestamp,children:(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)(eS.Z,{className:"mr-1"}),u]})}),void 0!==r&&(0,a.jsx)(A.Z,{title:"Total latency",children:(0,a.jsxs)("span",{className:"flex items-center text-blue-600",children:[(0,a.jsx)(eS.Z,{className:"mr-1"}),(r/1e3).toFixed(2),"s"]})}),void 0!==s&&(0,a.jsx)(A.Z,{title:"Time to first token",children:(0,a.jsxs)("span",{className:"flex items-center text-green-600",children:["TTFT: ",(s/1e3).toFixed(2),"s"]})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-gray-500 ml-4 mt-1.5",children:[l&&(0,a.jsx)(A.Z,{title:"Click to copy: ".concat(l),children:(0,a.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>eT(l),children:[(0,a.jsx)(ev.Z,{className:"mr-1"}),"Task: ",eZ(l),(0,a.jsx)(ek.Z,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),i&&(0,a.jsx)(A.Z,{title:"Click to copy: ".concat(i),children:(0,a.jsxs)("span",{className:"flex items-center cursor-pointer hover:text-gray-700",onClick:()=>eT(i),children:[(0,a.jsx)(eP.Z,{className:"mr-1"}),"Session: ",eZ(i),(0,a.jsx)(ek.Z,{className:"ml-1 text-gray-400 hover:text-gray-600"})]})}),(m||(null==c?void 0:c.message))&&(0,a.jsxs)(_.ZP,{type:"text",size:"small",className:"text-xs text-blue-500 hover:text-blue-700 p-0 h-auto",onClick:()=>o(!n),children:[n?(0,a.jsx)(e_.Z,{}):(0,a.jsx)(eC.Z,{}),(0,a.jsx)("span",{className:"ml-1",children:"Details"})]})]}),n&&(0,a.jsxs)("div",{className:"mt-2 ml-4 p-3 bg-gray-50 rounded-md text-gray-600 border border-gray-200",children:[(null==c?void 0:c.message)&&(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Status Message:"}),(0,a.jsx)("span",{className:"ml-2",children:c.message})]}),l&&(0,a.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Task ID:"}),(0,a.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:l}),(0,a.jsx)(ek.Z,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>eT(l)})]}),i&&(0,a.jsxs)("div",{className:"mb-1.5 flex items-center",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700 w-24",children:"Session ID:"}),(0,a.jsx)("code",{className:"ml-2 px-2 py-1 bg-white border border-gray-200 rounded text-xs font-mono",children:i}),(0,a.jsx)(ek.Z,{className:"ml-2 cursor-pointer text-gray-400 hover:text-blue-500",onClick:()=>eT(i)})]}),m&&Object.keys(m).length>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Custom Metadata:"}),(0,a.jsx)("pre",{className:"mt-1.5 p-2 bg-white border border-gray-200 rounded text-xs font-mono overflow-x-auto whitespace-pre-wrap",children:JSON.stringify(m,null,2)})]})]})]})},eL=s(29),eO=s.n(eL);let{Text:eK}=k.default,{Panel:eU}=ep.default;var eM=e=>{var t,s;let{events:r,className:n}=e;if(console.log("MCPEventsDisplay: Received events:",r),!r||0===r.length)return console.log("MCPEventsDisplay: No events, returning null"),null;let o=r.find(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_list_tools"&&e.item.tools&&e.item.tools.length>0}),l=r.filter(e=>{var t;return"response.output_item.done"===e.type&&(null===(t=e.item)||void 0===t?void 0:t.type)==="mcp_call"});return(console.log("MCPEventsDisplay: toolsEvent:",o),console.log("MCPEventsDisplay: mcpCallEvents:",l),o||0!==l.length)?(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac "+"mcp-events-display ".concat(n||""),children:[(0,a.jsx)(eO(),{id:"32b14b04f420f3ac",children:'.openai-mcp-tools.jsx-32b14b04f420f3ac{position:relative;margin:0;padding:0}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse.jsx-32b14b04f420f3ac{background:transparent!important;border:none!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-item.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac{padding:0 0 0 20px!important;background:transparent!important;border:none!important;font-size:14px!important;color:#9ca3af!important;font-weight:400!important;line-height:20px!important;min-height:20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-header.jsx-32b14b04f420f3ac:hover{background:transparent!important;color:#6b7280!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content.jsx-32b14b04f420f3ac{border:none!important;background:transparent!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-content-box.jsx-32b14b04f420f3ac{padding:4px 0 0 20px!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac{position:absolute!important;left:2px!important;top:2px!important;color:#9ca3af!important;font-size:10px!important;width:16px!important;height:16px!important;display:-webkit-box!important;display:-webkit-flex!important;display:-moz-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-webkit-align-items:center!important;-moz-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:center!important;-webkit-justify-content:center!important;-moz-box-pack:center!important;-ms-flex-pack:center!important;justify-content:center!important}.openai-mcp-tools.jsx-32b14b04f420f3ac .ant-collapse-expand-icon.jsx-32b14b04f420f3ac:hover{color:#6b7280!important}.openai-vertical-line.jsx-32b14b04f420f3ac{position:absolute;left:9px;top:18px;bottom:0;width:.5px;background-color:#f3f4f6;opacity:.8}.tool-item.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:13px;color:#4b5563;line-height:18px;padding:0;margin:0;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac{margin-bottom:12px;background:white;position:relative;z-index:1}.mcp-section.jsx-32b14b04f420f3ac:last-child{margin-bottom:0}.mcp-section-header.jsx-32b14b04f420f3ac{font-size:13px;color:#6b7280;font-weight:500;margin-bottom:4px}.mcp-code-block.jsx-32b14b04f420f3ac{background:#f9fafb;border:1px solid#f3f4f6;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;padding:8px;font-size:12px}.mcp-json.jsx-32b14b04f420f3ac{font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace;color:#374151;margin:0;white-space:pre-wrap;word-wrap:break-word}.mcp-approved.jsx-32b14b04f420f3ac{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;color:#6b7280}.mcp-checkmark.jsx-32b14b04f420f3ac{color:#10b981;margin-right:6px;font-weight:bold}.mcp-response-content.jsx-32b14b04f420f3ac{font-size:13px;color:#374151;line-height:1.5;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,"SF Mono",Monaco,Consolas,"Liberation Mono","Courier New",monospace}'}),(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac openai-mcp-tools",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac openai-vertical-line"}),(0,a.jsxs)(ep.default,{ghost:!0,size:"small",expandIconPosition:"start",defaultActiveKey:o?["list-tools"]:l.map((e,t)=>"mcp-call-".concat(t)),children:[o&&(0,a.jsx)(eU,{header:"List tools",children:(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac",children:null===(s=o.item)||void 0===s?void 0:null===(t=s.tools)||void 0===t?void 0:t.map((e,t)=>(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac tool-item",children:e.name},t))})},"list-tools"),l.map((e,t)=>{var s,r,n;return(0,a.jsx)(eU,{header:(null===(s=e.item)||void 0===s?void 0:s.name)||"Tool call",children:(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac",children:[(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Request"}),(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-code-block",children:(null===(r=e.item)||void 0===r?void 0:r.arguments)&&(0,a.jsx)("pre",{className:"jsx-32b14b04f420f3ac mcp-json",children:(()=>{try{return JSON.stringify(JSON.parse(e.item.arguments),null,2)}catch(t){return e.item.arguments}})()})})]}),(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-approved",children:[(0,a.jsx)("span",{className:"jsx-32b14b04f420f3ac mcp-checkmark",children:"✓"})," Approved"]})}),(null===(n=e.item)||void 0===n?void 0:n.output)&&(0,a.jsxs)("div",{className:"jsx-32b14b04f420f3ac mcp-section",children:[(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-section-header",children:"Response"}),(0,a.jsx)("div",{className:"jsx-32b14b04f420f3ac mcp-response-content",children:e.item.output})]})]})},"mcp-call-".concat(t))})]})]})]}):(console.log("MCPEventsDisplay: No valid events found, returning null"),null)},eD=s(94331),ez=s(38398);let eB=e=>new Promise((t,s)=>{let a=new FileReader;a.onload=()=>{t(a.result.split(",")[1])},a.onerror=s,a.readAsDataURL(e)}),eF=async(e,t)=>{let s=await eB(t),a=t.type||(t.name.toLowerCase().endsWith(".pdf")?"application/pdf":"image/jpeg");return{role:"user",content:[{type:"input_text",text:e},{type:"input_image",image_url:"data:".concat(a,";base64,").concat(s)}]}},eH=(e,t,s,a)=>{let r="";t&&a&&(r=a.toLowerCase().endsWith(".pdf")?"[PDF attached]":"[Image attached]");let n={role:"user",content:t?"".concat(e," ").concat(r):e};return t&&s&&(n.imagePreviewUrl=s),n},eG=e=>"user"===e.role&&"string"==typeof e.content&&(e.content.includes("[Image attached]")||e.content.includes("[PDF attached]"))&&!!e.imagePreviewUrl;var eW=e=>{let{message:t}=e;if(!eG(t))return null;let s="string"==typeof t.content&&t.content.includes("[PDF attached]");return(0,a.jsx)("div",{className:"mb-2",children:s?(0,a.jsx)("div",{className:"w-64 h-32 rounded-md border border-gray-200 bg-red-50 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"48px",color:"#dc2626"}})}):(0,a.jsx)("img",{src:t.imagePreviewUrl,alt:"User uploaded image",className:"max-w-64 rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"200px"}})})},eq=s(53508);let{Dragger:eJ}=S.default;var eV=e=>{let{responsesUploadedImage:t,responsesImagePreviewUrl:s,onImageUpload:r,onRemoveImage:n}=e;return(0,a.jsx)(a.Fragment,{children:!t&&(0,a.jsx)(eJ,{beforeUpload:r,accept:"image/*,.pdf",showUploadList:!1,className:"inline-block",style:{padding:0,border:"none",background:"none"},children:(0,a.jsx)(A.Z,{title:"Attach image or PDF",children:(0,a.jsx)("button",{type:"button",className:"flex items-center justify-center w-8 h-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:(0,a.jsx)(eq.Z,{style:{fontSize:"16px"}})})})})})},eY=s(33152),eX=s(63709),e$=e=>{let{endpointType:t,responsesSessionId:s,useApiSessionManagement:r,onToggleSessionManagement:n}=e;return t!==J.KP.RESPONSES?null:(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Session Management"}),(0,a.jsx)(A.Z,{title:"Choose between LiteLLM API session management (using previous_response_id) or UI-based session management (using chat history)",children:(0,a.jsx)(x.Z,{className:"text-gray-400",style:{fontSize:"12px"}})})]}),(0,a.jsx)(eX.Z,{checked:r,onChange:n,checkedChildren:"API",unCheckedChildren:"UI",size:"small"})]}),(0,a.jsxs)("div",{className:"text-xs p-2 rounded-md ".concat(s?"bg-green-50 text-green-700 border border-green-200":"bg-blue-50 text-blue-700 border border-blue-200"),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(x.Z,{style:{fontSize:"12px"}}),(()=>{if(!s)return r?"API Session: Ready":"UI Session: Ready";let e=r?"Response ID":"UI Session",t=s.slice(0,10);return"".concat(e,": ").concat(t,"...")})()]}),s&&(0,a.jsx)(A.Z,{title:(0,a.jsxs)("div",{className:"text-xs",children:[(0,a.jsx)("div",{className:"mb-1",children:"Copy response ID to continue session:"}),(0,a.jsx)("div",{className:"bg-gray-800 text-gray-100 p-2 rounded font-mono text-xs whitespace-pre-wrap",children:'curl -X POST "your-proxy-url/v1/responses" \\\n -H "Authorization: Bearer your-api-key" \\\n -H "Content-Type: application/json" \\\n -d \'{\n "model": "your-model",\n "input": [{"role": "user", "content": "your message", "type": "message"}],\n "previous_response_id": "'.concat(s,'",\n "stream": true\n }\'')})]}),overlayStyle:{maxWidth:"500px"},children:(0,a.jsx)("button",{onClick:()=>{s&&(navigator.clipboard.writeText(s),M.Z.success("Response ID copied to clipboard!"))},className:"ml-2 p-1 hover:bg-green-100 rounded transition-colors",children:(0,a.jsx)(ek.Z,{style:{fontSize:"12px"}})})})]}),(0,a.jsx)("div",{className:"text-xs opacity-75 mt-1",children:s?r?"LiteLLM API session active - context maintained server-side":"UI session active - context maintained client-side":r?"LiteLLM will manage session using previous_response_id":"UI will manage session using chat history"})]})]})},eQ=s(42264);let e0=e=>{if(!e)return!1;let t=e.toLowerCase();return t.startsWith("openai/")||t.startsWith("gpt-")||t.startsWith("o1")||t.startsWith("o3")||t.includes("openai")};var e1=e=>{let{enabled:t,onEnabledChange:s,selectedModel:r,disabled:n=!1}=e,o=e0(r);return(0,a.jsxs)("div",{className:"border border-gray-200 rounded-lg p-3 bg-gradient-to-r from-blue-50 to-purple-50",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(h.Z,{className:"text-blue-500"}),(0,a.jsx)(B.x,{className:"font-medium text-gray-700",children:"Code Interpreter"}),(0,a.jsx)(A.Z,{title:"Run Python code to generate files, charts, and analyze data. Container is created automatically.",children:(0,a.jsx)(x.Z,{className:"text-gray-400 text-xs"})})]}),(0,a.jsx)(eX.Z,{checked:t&&o,onChange:e=>{if(e&&!o){eQ.ZP.warning("Code Interpreter is only available for OpenAI models");return}s(e)},disabled:n||!o,size:"small",className:t&&o?"bg-blue-500":""})]}),!o&&(0,a.jsx)("div",{className:"mt-2 pt-2 border-t border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(ew.Z,{className:"text-amber-500 mt-0.5"}),(0,a.jsxs)("div",{className:"text-xs text-gray-600",children:[(0,a.jsx)("span",{children:"Code Interpreter is currently only supported for OpenAI models. "}),(0,a.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new?template=feature_request.yml",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"Request support for other providers"})]})]})})]})};let{TextArea:e2}=w.default,{Dragger:e4}=S.default,e3=new Set([J.KP.CHAT,J.KP.RESPONSES]);var e5=e=>{let{accessToken:t,token:s,userRole:w,userID:S,disabledPersonalKeyCreation:B,proxySettings:F}=e,[H,G]=(0,Z.useState)([]),[V,X]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("selectedMCPServers");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedMCPServers from sessionStorage",e),[]}}),[ea,eo]=(0,Z.useState)(!1),[ep,eh]=(0,Z.useState)({}),[ef,ev]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("mcpServerToolRestrictions");try{return e?JSON.parse(e):{}}catch(e){return console.error("Error parsing mcpServerToolRestrictions from sessionStorage",e),{}}}),[eN,ew]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("apiKeySource");if(e)try{return JSON.parse(e)}catch(e){console.error("Error parsing apiKeySource from sessionStorage",e)}return B?"custom":"session"}),[eS,ek]=(0,Z.useState)(()=>sessionStorage.getItem("apiKey")||""),[eP,e_]=(0,Z.useState)(()=>sessionStorage.getItem("customProxyBaseUrl")||""),[eC,eA]=(0,Z.useState)(""),[eE,eI]=(0,Z.useState)(()=>{try{let e=sessionStorage.getItem("chatHistory");return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing chatHistory from sessionStorage",e),[]}}),[eZ,eT]=(0,Z.useState)(void 0),[eL,eO]=(0,Z.useState)(!1),[eK,eU]=(0,Z.useState)([]),[eB,eG]=(0,Z.useState)([]),[eq,eJ]=(0,Z.useState)(void 0),eX=(0,Z.useRef)(null),[eQ,e0]=(0,Z.useState)(()=>sessionStorage.getItem("endpointType")||J.KP.CHAT),[e5,e6]=(0,Z.useState)(!1),e7=(0,Z.useRef)(null),[e9,e8]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("selectedTags");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedTags from sessionStorage",e),[]}}),[te,tt]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("selectedVoice");if(!e)return"alloy";try{return JSON.parse(e)}catch(t){return e}}),[ts,ta]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("selectedVectorStores");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedVectorStores from sessionStorage",e),[]}}),[tr,tn]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("selectedGuardrails");try{return e?JSON.parse(e):[]}catch(e){return console.error("Error parsing selectedGuardrails from sessionStorage",e),[]}}),[to,tl]=(0,Z.useState)(()=>sessionStorage.getItem("messageTraceId")||null),[ti,tc]=(0,Z.useState)(()=>sessionStorage.getItem("responsesSessionId")||null),[td,tm]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("useApiSessionManagement");return!e||JSON.parse(e)}),[tu,tx]=(0,Z.useState)([]),[tg,tp]=(0,Z.useState)([]),[th,tf]=(0,Z.useState)(null),[tv,tb]=(0,Z.useState)(null),[ty,tj]=(0,Z.useState)(null),[tN,tw]=(0,Z.useState)(null),[tS,tk]=(0,Z.useState)(null),[tP,t_]=(0,Z.useState)(!1),[tC,tA]=(0,Z.useState)(""),[tE,tI]=(0,Z.useState)("openai"),[tZ,tT]=(0,Z.useState)([]),[tR,tL]=(0,Z.useState)(1),[tO,tK]=(0,Z.useState)(2048),[tU,tM]=(0,Z.useState)(!1),tD=function(){let[e,t]=(0,Z.useState)(()=>{let e=sessionStorage.getItem("codeInterpreterEnabled");return!!e&&JSON.parse(e)}),[s,a]=(0,Z.useState)(null),r=(0,Z.useCallback)(e=>{t(e),sessionStorage.setItem("codeInterpreterEnabled",JSON.stringify(e))},[]),n=(0,Z.useCallback)(()=>{a(null)},[]),o=(0,Z.useCallback)(()=>{r(!e)},[e,r]);return{enabled:e,result:s,setEnabled:r,setResult:a,clearResult:n,toggle:o}}(),tz=(0,Z.useRef)(null),tB=async()=>{let e="session"===eN?t:eS;if(e){eo(!0);try{let t=await (0,er.fetchMCPServers)(e);G(Array.isArray(t)?t:t.data||[])}catch(e){console.error("Error fetching MCP servers:",e)}finally{eo(!1)}}},tF=async e=>{let s="session"===eN?t:eS;if(s&&!ep[e])try{let t=await (0,er.listMCPTools)(s,e);eh(s=>({...s,[e]:t.tools||[]}))}catch(t){console.error("Error fetching tools for server ".concat(e,":"),t)}};(0,Z.useEffect)(()=>{tP&&tA((0,et.L)({apiKeySource:eN,accessToken:t,apiKey:eS,inputMessage:eC,chatHistory:eE,selectedTags:e9,selectedVectorStores:ts,selectedGuardrails:tr,selectedMCPServers:V,mcpServers:H,mcpServerToolRestrictions:ef,endpointType:eQ,selectedModel:eZ,selectedSdk:tE,selectedVoice:te,proxySettings:F}))},[tP,tE,eN,t,eS,eC,eE,e9,ts,tr,V,H,ef,eQ,eZ,F]),(0,Z.useEffect)(()=>{let e=setTimeout(()=>{sessionStorage.setItem("chatHistory",JSON.stringify(eE))},500);return()=>{clearTimeout(e)}},[eE]),(0,Z.useEffect)(()=>{sessionStorage.setItem("apiKeySource",JSON.stringify(eN)),sessionStorage.setItem("apiKey",eS),sessionStorage.setItem("endpointType",eQ),sessionStorage.setItem("selectedTags",JSON.stringify(e9)),sessionStorage.setItem("selectedVectorStores",JSON.stringify(ts)),sessionStorage.setItem("selectedGuardrails",JSON.stringify(tr)),sessionStorage.setItem("selectedMCPServers",JSON.stringify(V)),sessionStorage.setItem("mcpServerToolRestrictions",JSON.stringify(ef)),sessionStorage.setItem("selectedVoice",te),sessionStorage.removeItem("selectedMCPTools"),eZ?sessionStorage.setItem("selectedModel",eZ):sessionStorage.removeItem("selectedModel"),to?sessionStorage.setItem("messageTraceId",to):sessionStorage.removeItem("messageTraceId"),ti?sessionStorage.setItem("responsesSessionId",ti):sessionStorage.removeItem("responsesSessionId"),sessionStorage.setItem("useApiSessionManagement",JSON.stringify(td))},[eN,eS,eZ,eQ,e9,ts,tr,to,ti,td,V,ef,te]),(0,Z.useEffect)(()=>{let e="session"===eN?t:eS;if(!e||!s||!w||!S){console.log("userApiKey or token or userRole or userID is missing = ",e,s,w,S);return}(async()=>{try{if(!e){console.log("userApiKey is missing");return}let t=await (0,em.p)(e);console.log("Fetched models:",t),eU(t);let s=t.some(e=>e.model_group===eZ);t.length&&s||eT(void 0)}catch(e){console.error("Error fetching model info:",e)}})(),tB()},[t,S,w,eN,eS,s]),(0,Z.useEffect)(()=>{let e="session"===eN?t:eS;e&&eQ===J.KP.A2A_AGENTS&&(async()=>{try{let t=await (0,ey.o)(e,eP||void 0);eG(t),eq&&!t.some(e=>e.agent_name===eq)&&eJ(void 0)}catch(e){console.error("Error fetching agents:",e)}})()},[t,eN,eS,eQ,eP,eq]),(0,Z.useEffect)(()=>{tz.current&&setTimeout(()=>{var e;null===(e=tz.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)},[eE]);let tH=(e,t,s)=>{console.log("updateTextUI called with:",e,t,s),eI(a=>{let r=a[a.length-1];if(!r||r.role!==e||r.isImage||r.isAudio)return[...a,{role:e,content:t,model:s}];{var n;let e={...r,content:r.content+t,model:null!==(n=r.model)&&void 0!==n?n:s};return[...a.slice(0,-1),e]}})},tG=e=>{eI(t=>{let s=t[t.length-1];return!s||"assistant"!==s.role||s.isImage||s.isAudio?t.length>0&&"user"===t[t.length-1].role?[...t,{role:"assistant",content:"",reasoningContent:e}]:t:[...t.slice(0,t.length-1),{...s,reasoningContent:(s.reasoningContent||"")+e}]})},tW=e=>{console.log("updateTimingData called with:",e),eI(t=>{let s=t[t.length-1];if(console.log("Current last message:",s),s&&"assistant"===s.role){console.log("Updating assistant message with timeToFirstToken:",e);let a=[...t.slice(0,t.length-1),{...s,timeToFirstToken:e}];return console.log("Updated chat history:",a),a}return s&&"user"===s.role?(console.log("Creating new assistant message with timeToFirstToken:",e),[...t,{role:"assistant",content:"",timeToFirstToken:e}]):(console.log("No appropriate message found to update timing"),t)})},tq=(e,t)=>{console.log("Received usage data:",e),eI(s=>{let a=s[s.length-1];if(a&&"assistant"===a.role){console.log("Updating message with usage data:",e);let r={...a,usage:e,toolName:t};return console.log("Updated message:",r),[...s.slice(0,s.length-1),r]}return s})},tJ=e=>{console.log("Received A2A metadata:",e),eI(t=>{let s=t[t.length-1];if(s&&"assistant"===s.role){let a={...s,a2aMetadata:e};return[...t.slice(0,t.length-1),a]}return t})},tV=e=>{eI(t=>{let s=t[t.length-1];return s&&"assistant"===s.role?[...t.slice(0,t.length-1),{...s,totalLatency:e}]:t})},tY=e=>{console.log("Received search results:",e),eI(t=>{let s=t[t.length-1];if(s&&"assistant"===s.role){console.log("Updating message with search results");let a={...s,searchResults:e};return[...t.slice(0,t.length-1),a]}return t})},tX=e=>{console.log("Received response ID for session management:",e),td&&tc(e)},t$=e=>{console.log("ChatUI: Received MCP event:",e),tT(t=>{if(t.some(t=>t.item_id===e.item_id&&t.type===e.type&&t.sequence_number===e.sequence_number))return console.log("ChatUI: Duplicate MCP event, skipping"),t;let s=[...t,e];return console.log("ChatUI: Updated MCP events:",s),s})},tQ=(e,t)=>{eI(s=>[...s,{role:"assistant",content:e,model:t,isImage:!0}])},t0=(e,t)=>{eI(s=>[...s,{role:"assistant",content:(0,K.aS)(e,100),model:t,isEmbeddings:!0}])},t1=(e,t)=>{eI(s=>[...s,{role:"assistant",content:e,model:t,isAudio:!0}])},t2=(e,t)=>{eI(s=>{let a=s[s.length-1];if(!a||"assistant"!==a.role||a.isImage||a.isAudio)return[...s,{role:"assistant",content:"",model:t,image:{url:e,detail:"auto"}}];{var r;let n={...a,image:{url:e,detail:"auto"},model:null!==(r=a.model)&&void 0!==r?r:t};return[...s.slice(0,-1),n]}})},t4=e=>{tx(t=>[...t,e]);let t=URL.createObjectURL(e);return tp(e=>[...e,t]),!1},t3=e=>{tg[e]&&URL.revokeObjectURL(tg[e]),tx(t=>t.filter((t,s)=>s!==e)),tp(t=>t.filter((t,s)=>s!==e))},t5=()=>{tg.forEach(e=>{URL.revokeObjectURL(e)}),tx([]),tp([])},t6=()=>{tv&&URL.revokeObjectURL(tv),tf(null),tb(null)},t7=()=>{tN&&URL.revokeObjectURL(tN),tj(null),tw(null)},t9=()=>{tk(null)},t8=async()=>{let e;if(""===eC.trim()&&eQ!==J.KP.TRANSCRIPTION)return;if(eQ===J.KP.IMAGE_EDITS&&0===tu.length){M.Z.fromBackend("Please upload at least one image for editing");return}if(eQ===J.KP.TRANSCRIPTION&&!tS){M.Z.fromBackend("Please upload an audio file for transcription");return}if(eQ===J.KP.A2A_AGENTS&&!eq){M.Z.fromBackend("Please select an agent to send a message");return}if([J.KP.CHAT,J.KP.IMAGE,J.KP.SPEECH,J.KP.IMAGE_EDITS,J.KP.RESPONSES,J.KP.ANTHROPIC_MESSAGES,J.KP.EMBEDDINGS,J.KP.TRANSCRIPTION].includes(eQ)&&!eZ){M.Z.fromBackend("Please select a model before sending a request");return}if(!s||!w||!S)return;let a="session"===eN?t:eS;if(!a){M.Z.fromBackend("Please provide a Virtual Key or select Current UI Session");return}e7.current=new AbortController;let r=e7.current.signal;if(eQ===J.KP.RESPONSES&&th)try{e=await eF(eC,th)}catch(e){M.Z.fromBackend("Failed to process image. Please try again.");return}else if(eQ===J.KP.CHAT&&ty)try{e=await (0,ee.Sn)(eC,ty)}catch(e){M.Z.fromBackend("Failed to process image. Please try again.");return}else e={role:"user",content:eC};let n=to||(0,O.Z)();to||tl(n),eI([...eE,eQ===J.KP.RESPONSES&&th?eH(eC,!0,tv||void 0,th.name):eQ===J.KP.CHAT&&ty?(0,ee.Hk)(eC,!0,tN||void 0,ty.name):eQ===J.KP.TRANSCRIPTION&&tS?eH(eC?"\uD83C\uDFB5 Audio file: ".concat(tS.name,"\nPrompt: ").concat(eC):"\uD83C\uDFB5 Audio file: ".concat(tS.name),!1):eH(eC,!1)]),tT([]),tD.clearResult(),e6(!0);try{if(eZ){if(eQ===J.KP.CHAT){let t=[...eE.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:"string"==typeof s?s:""}}),e];await (0,ec.n)(t,(e,t)=>tH("assistant",e,t),eZ,a,e9,r,tG,tW,tq,n,ts.length>0?ts:void 0,tr.length>0?tr:void 0,V,t2,tY,tU?tR:void 0,tU?tO:void 0,tV,eP||void 0,H,ef)}else if(eQ===J.KP.IMAGE)await ex(eC,(e,t)=>tQ(e,t),eZ,a,e9,r,eP||void 0);else if(eQ===J.KP.SPEECH)await el(eC,te,(e,t)=>t1(e,t),eZ||"",a,e9,r,void 0,void 0,eP||void 0);else if(eQ===J.KP.IMAGE_EDITS)tu.length>0&&await eu(1===tu.length?tu[0]:tu,eC,(e,t)=>tQ(e,t),eZ,a,e9,r,eP||void 0);else if(eQ===J.KP.RESPONSES){let t;t=td&&ti?[e]:[...eE.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e],await eg(t,(e,t,s)=>tH(e,t,s),eZ,a,e9,r,tG,tW,tq,n,ts.length>0?ts:void 0,tr.length>0?tr:void 0,V,td?ti:null,tX,t$,tD.enabled,tD.setResult,eP||void 0,H,ef)}else if(eQ===J.KP.ANTHROPIC_MESSAGES){let t=[...eE.filter(e=>!e.isImage&&!e.isAudio).map(e=>{let{role:t,content:s}=e;return{role:t,content:s}}),e];await en(t,(e,t,s)=>tH(e,t,s),eZ,a,e9,r,tG,tW,tq,n,ts.length>0?ts:void 0,tr.length>0?tr:void 0,V,eP||void 0)}else eQ===J.KP.EMBEDDINGS?await ed(eC,(e,t)=>t0(e,t),eZ,a,e9,eP||void 0):eQ===J.KP.TRANSCRIPTION&&tS&&await ei(tS,(e,t)=>tH("assistant",e,t),eZ,a,e9,r,void 0,void 0,void 0,void 0,eP||void 0)}eQ===J.KP.A2A_AGENTS&&eq&&await (0,ej.m)(eq,eC,(e,t)=>tH("assistant",e,t),a,r,tW,tV,tJ,eP||void 0)}catch(e){r.aborted?console.log("Request was cancelled"):(console.error("Error fetching response",e),tH("assistant","Error fetching response:"+e))}finally{e6(!1),e7.current=null,eQ===J.KP.IMAGE_EDITS&&t5(),eQ===J.KP.RESPONSES&&th&&t6(),eQ===J.KP.CHAT&&ty&&t7(),eQ===J.KP.TRANSCRIPTION&&tS&&t9()}eA("")};if(w&&"Admin Viewer"===w){let{Title:e,Paragraph:t}=k.default;return(0,a.jsxs)("div",{children:[(0,a.jsx)(e,{level:1,children:"Access Denied"}),(0,a.jsx)(t,{children:"Ask your proxy admin for access to test models"})]})}let se=(0,a.jsx)(r.Z,{style:{fontSize:24},spin:!0});return(0,a.jsxs)("div",{className:"w-full p-4 pb-0 bg-white",children:[(0,a.jsx)(N.Zb,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,a.jsxs)("div",{className:"flex h-[80vh] w-full gap-4",children:[(0,a.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 overflow-y-auto",children:[(0,a.jsx)(N.Dx,{className:"text-xl font-semibold mb-6 mt-2",children:"Configurations"}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-2"})," Virtual Key Source"]}),(0,a.jsx)(P.default,{disabled:B,value:eN,style:{width:"100%"},onChange:e=>{ew(e)},options:[{value:"session",label:"Current UI Session"},{value:"custom",label:"Virtual Key"}],className:"rounded-md"}),"custom"===eN&&(0,a.jsx)(N.oi,{className:"mt-2",placeholder:"Enter custom Virtual Key",type:"password",onValueChange:ek,value:eS,icon:n.Z})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)(N.xv,{className:"font-medium text-gray-700 flex items-center",children:[(0,a.jsx)(o.Z,{className:"mr-2"})," Custom Proxy Base URL"]}),eP&&(0,a.jsx)(_.ZP,{type:"link",size:"small",icon:(0,a.jsx)(l.Z,{}),onClick:()=>{e_(""),sessionStorage.removeItem("customProxyBaseUrl")},className:"text-gray-500 hover:text-gray-700",children:"Clear"})]}),(0,a.jsx)(N.oi,{placeholder:"Optional: Enter custom proxy URL (e.g., http://localhost:5000)",onValueChange:e=>{e_(e),sessionStorage.setItem("customProxyBaseUrl",e)},value:eP,icon:i.Z}),eP&&(0,a.jsxs)(N.xv,{className:"text-xs text-gray-500 mt-1",children:["API calls will be sent to: ",eP]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-2"})," Endpoint Type"]}),(0,a.jsx)(es,{endpointType:eQ,onEndpointChange:e=>{e0(e),eT(void 0),eJ(void 0),eO(!1);try{sessionStorage.removeItem("selectedModel"),sessionStorage.removeItem("selectedAgent")}catch(e){}},className:"mb-4"}),eQ===J.KP.SPEECH&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(c.Z,{className:"mr-2"}),"Voice"]}),(0,a.jsx)(P.default,{value:te,onChange:e=>{tt(e),sessionStorage.setItem("selectedVoice",e)},style:{width:"100%"},className:"rounded-md",options:Y})]}),(0,a.jsx)(e$,{endpointType:eQ,responsesSessionId:ti,useApiSessionManagement:td,onToggleSessionManagement:e=>{tm(e),e||tc(null)}})]}),eQ!==J.KP.A2A_AGENTS&&(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center justify-between",children:[(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-2"})," Select Model"]}),(()=>{if(!eZ||"custom"===eZ)return!1;let e=eK.find(e=>e.model_group===eZ);return!!e&&(!e.mode||"chat"===e.mode)})()?(0,a.jsx)(C.Z,{content:(0,a.jsx)(W,{temperature:tR,maxTokens:tO,useAdvancedParams:tU,onTemperatureChange:tL,onMaxTokensChange:tK,onUseAdvancedParamsChange:tM}),title:"Model Settings",trigger:"click",placement:"right",children:(0,a.jsx)(_.ZP,{type:"text",size:"small",icon:(0,a.jsx)(o.Z,{}),className:"text-gray-500 hover:text-gray-700"})}):(0,a.jsx)(A.Z,{title:"Advanced parameters are only supported for chat models currently",children:(0,a.jsx)(_.ZP,{type:"text",size:"small",icon:(0,a.jsx)(o.Z,{}),className:"text-gray-300 cursor-not-allowed",disabled:!0})})]}),(0,a.jsx)(P.default,{value:eZ,placeholder:"Select a Model",onChange:e=>{console.log("selected ".concat(e)),eT(e),eO("custom"===e)},options:[{value:"custom",label:"Enter custom model",key:"custom"},...Array.from(new Set(eK.filter(e=>{if(!e.mode)return!0;let t=(0,J.vf)(e.mode);return eQ===J.KP.RESPONSES||eQ===J.KP.ANTHROPIC_MESSAGES?t===eQ||t===J.KP.CHAT:eQ===J.KP.IMAGE_EDITS?t===eQ||t===J.KP.IMAGE:t===eQ}).map(e=>e.model_group))).map((e,t)=>({value:e,label:e,key:t}))],style:{width:"100%"},showSearch:!0,className:"rounded-md"}),eL&&(0,a.jsx)(N.oi,{className:"mt-2",placeholder:"Enter custom model name",onValueChange:e=>{eX.current&&clearTimeout(eX.current),eX.current=setTimeout(()=>{eT(e)},500)}})]}),eQ===J.KP.A2A_AGENTS&&(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-2"})," Select Agent"]}),(0,a.jsx)(P.default,{value:eq,placeholder:"Select an Agent",onChange:e=>eJ(e),options:eB.map(e=>({value:e.agent_name,label:e.agent_name||e.agent_id,key:e.agent_id})),style:{width:"100%"},showSearch:!0,className:"rounded-md",optionLabelProp:"label",children:eB.map(e=>{var t;return(0,a.jsx)(P.default.Option,{value:e.agent_name,label:e.agent_name||e.agent_id,children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.agent_name||e.agent_id}),(null===(t=e.agent_card_params)||void 0===t?void 0:t.description)&&(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.agent_card_params.description})]})},e.agent_id)})}),0===eB.length&&(0,a.jsx)(N.xv,{className:"text-xs text-gray-500 mt-2 block",children:"No agents found. Create agents via /v1/agents endpoint."})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-2"})," Tags"]}),(0,a.jsx)(D.Z,{value:e9,onChange:e8,className:"mb-4",accessToken:t||""})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(u.Z,{className:"mr-2"})," MCP Servers",(0,a.jsx)(A.Z,{className:"ml-1",title:"Select MCP servers to use in your conversation.",children:(0,a.jsx)(x.Z,{})})]}),(0,a.jsxs)(P.default,{mode:"multiple",style:{width:"100%"},placeholder:"Select MCP servers",value:V,onChange:e=>{e.includes("__all__")?(X(["__all__"]),ev({})):(X(e),ev(t=>{let s={...t};return Object.keys(s).forEach(t=>{e.includes(t)||delete s[t]}),s}),e.forEach(e=>{ep[e]||tF(e)}))},loading:ea,className:"mb-2",allowClear:!0,optionLabelProp:"label",disabled:!e3.has(eQ),maxTagCount:"responsive",children:[(0,a.jsx)(P.default.Option,{value:"__all__",label:"All MCP Servers",children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:"All MCP Servers"}),(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:"Use all available MCP servers"})]})},"__all__"),H.map(e=>(0,a.jsx)(P.default.Option,{value:e.server_id,label:e.alias||e.server_name||e.server_id,disabled:V.includes("__all__"),children:(0,a.jsxs)("div",{className:"flex flex-col py-1",children:[(0,a.jsx)("span",{className:"font-medium",children:e.alias||e.server_name||e.server_id}),e.description&&(0,a.jsx)("span",{className:"text-xs text-gray-500 mt-1",children:e.description})]})},e.server_id))]}),V.length>0&&!V.includes("__all__")&&e3.has(eQ)&&(0,a.jsx)("div",{className:"mt-3 space-y-2",children:V.map(e=>{let t=H.find(t=>t.server_id===e),s=ep[e]||[];return 0===s.length?null:(0,a.jsxs)("div",{className:"border rounded p-2",children:[(0,a.jsxs)(N.xv,{className:"text-xs text-gray-600 mb-1",children:["Limit tools for ",(null==t?void 0:t.alias)||(null==t?void 0:t.server_name)||e,":"]}),(0,a.jsx)(P.default,{mode:"multiple",size:"small",style:{width:"100%"},placeholder:"All tools (default)",value:ef[e]||[],onChange:t=>{ev(s=>({...s,[e]:t}))},options:s.map(e=>({value:e.name,label:e.name})),maxTagCount:2})]},e)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(g.Z,{className:"mr-2"})," Vector Store",(0,a.jsx)(A.Z,{className:"ml-1",title:(0,a.jsxs)("span",{children:["Select vector store(s) to use for this LLM API call. You can set up your vector store"," ",(0,a.jsx)("a",{href:"?page=vector-stores",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,a.jsx)(x.Z,{})})]}),(0,a.jsx)(z.Z,{value:ts,onChange:ta,className:"mb-4",accessToken:t||""})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)(N.xv,{className:"font-medium block mb-2 text-gray-700 flex items-center",children:[(0,a.jsx)(p.Z,{className:"mr-2"})," Guardrails",(0,a.jsx)(A.Z,{className:"ml-1",title:(0,a.jsxs)("span",{children:["Select guardrail(s) to use for this LLM API call. You can set up your guardrails"," ",(0,a.jsx)("a",{href:"?page=guardrails",style:{color:"#1890ff"},children:"here"}),"."]}),children:(0,a.jsx)(x.Z,{})})]}),(0,a.jsx)(U.Z,{value:tr,onChange:tn,className:"mb-4",accessToken:t||""})]}),eQ===J.KP.RESPONSES&&(0,a.jsx)("div",{children:(0,a.jsx)(e1,{accessToken:"session"===eN?t||"":eS,enabled:tD.enabled,onEnabledChange:tD.setEnabled,selectedContainerId:null,onContainerChange:()=>{},selectedModel:eZ||""})})]})]}),(0,a.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,a.jsx)(N.Dx,{className:"text-xl font-semibold mb-0",children:"Test Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(N.zx,{onClick:()=>{eE.forEach(e=>{e.isAudio&&"string"==typeof e.content&&URL.revokeObjectURL(e.content)}),eI([]),tl(null),tc(null),tT([]),t5(),t6(),t7(),t9(),sessionStorage.removeItem("chatHistory"),sessionStorage.removeItem("messageTraceId"),sessionStorage.removeItem("responsesSessionId"),M.Z.success("Chat history cleared.")},className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:l.Z,children:"Clear Chat"}),(0,a.jsx)(N.zx,{onClick:()=>t_(!0),className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:h.Z,children:"Get Code"})]})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===eE.length&&(0,a.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,a.jsx)(d.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,a.jsx)(N.xv,{children:"Start a conversation, generate an image, or handle audio"})]}),eE.map((e,s)=>(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"mb-4 ".concat("user"===e.role?"text-right":"text-left"),children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===e.role?"#f0f8ff":"#ffffff",border:"user"===e.role?"1px solid #e6f0fa":"1px solid #f0f0f0",textAlign:"left"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===e.role?"#e6f0fa":"#f5f5f5"},children:"user"===e.role?(0,a.jsx)(f.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,a.jsx)(d.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,a.jsx)("strong",{className:"text-sm capitalize",children:e.role}),"assistant"===e.role&&e.model&&(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:e.model})]}),e.reasoningContent&&(0,a.jsx)(eD.Z,{reasoningContent:e.reasoningContent}),"assistant"===e.role&&s===eE.length-1&&tZ.length>0&&eQ===J.KP.RESPONSES&&(0,a.jsx)("div",{className:"mb-3",children:(0,a.jsx)(eM,{events:tZ})}),"assistant"===e.role&&e.searchResults&&(0,a.jsx)(eY.J,{searchResults:e.searchResults}),"assistant"===e.role&&s===eE.length-1&&tD.result&&eQ===J.KP.RESPONSES&&(0,a.jsx)(eb,{code:tD.result.code,containerId:tD.result.containerId,annotations:tD.result.annotations,accessToken:"session"===eN?t||"":eS}),(0,a.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[e.isImage?(0,a.jsx)("img",{src:"string"==typeof e.content?e.content:"",alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}}):e.isAudio?(0,a.jsx)(q,{message:e}):(0,a.jsxs)(a.Fragment,{children:[eQ===J.KP.RESPONSES&&(0,a.jsx)(eW,{message:e}),eQ===J.KP.CHAT&&(0,a.jsx)($.Z,{message:e}),(0,a.jsx)(T.UG,{components:{code(e){let{node:t,inline:s,className:r,children:n,...o}=e,l=/language-(\w+)/.exec(r||"");return!s&&l?(0,a.jsx)(R.Z,{style:L.Z,language:l[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...o,children:String(n).replace(/\n$/,"")}):(0,a.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...o,children:n})},pre:e=>{let{node:t,...s}=e;return(0,a.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:"string"==typeof e.content?e.content:""}),e.image&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("img",{src:e.image.url,alt:"Generated image",className:"max-w-full rounded-md border border-gray-200 shadow-sm",style:{maxHeight:"500px"}})})]}),"assistant"===e.role&&(e.timeToFirstToken||e.totalLatency||e.usage)&&!e.a2aMetadata&&(0,a.jsx)(ez.Z,{timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency,usage:e.usage,toolName:e.toolName}),"assistant"===e.role&&e.a2aMetadata&&(0,a.jsx)(eR,{a2aMetadata:e.a2aMetadata,timeToFirstToken:e.timeToFirstToken,totalLatency:e.totalLatency})]})]})})},s)),e5&&tZ.length>0&&eQ===J.KP.RESPONSES&&eE.length>0&&"user"===eE[eE.length-1].role&&(0,a.jsx)("div",{className:"text-left mb-4",children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"#ffffff",border:"1px solid #f0f0f0",textAlign:"left"},children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"#f5f5f5"},children:(0,a.jsx)(d.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,a.jsx)("strong",{className:"text-sm capitalize",children:"Assistant"})]}),(0,a.jsx)(eM,{events:tZ})]})}),e5&&(0,a.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,a.jsx)(E.Z,{indicator:se})}),(0,a.jsx)("div",{ref:tz,style:{height:"1px"}})]}),(0,a.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[eQ===J.KP.IMAGE_EDITS&&(0,a.jsx)("div",{className:"mb-4",children:0===tu.length?(0,a.jsxs)(e4,{beforeUpload:t4,accept:"image/*",showUploadList:!1,children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(v.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,a.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag images to upload"}),(0,a.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for PNG, JPG, JPEG formats. Multiple images supported."})]}):(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[tu.map((e,t)=>(0,a.jsxs)("div",{className:"relative inline-block",children:[(0,a.jsx)("img",{src:tg[t]||"",alt:"Upload preview ".concat(t+1),className:"max-w-32 max-h-32 rounded-md border border-gray-200 object-cover"}),(0,a.jsx)("button",{className:"absolute top-1 right-1 bg-white shadow-sm border border-gray-200 rounded px-1 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:()=>t3(t),children:(0,a.jsx)(b.Z,{})})]},t)),(0,a.jsxs)("div",{className:"flex items-center justify-center w-32 h-32 border-2 border-dashed border-gray-300 rounded-md hover:border-gray-400 cursor-pointer",onClick:()=>{var e;return null===(e=document.getElementById("additional-image-upload"))||void 0===e?void 0:e.click()},children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(v.Z,{style:{fontSize:"24px",color:"#666"}}),(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Add more"})]}),(0,a.jsx)("input",{id:"additional-image-upload",type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:e=>{Array.from(e.target.files||[]).forEach(e=>t4(e))}})]})]})}),eQ===J.KP.TRANSCRIPTION&&(0,a.jsx)("div",{className:"mb-4",children:tS?(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,a.jsx)(c.Z,{style:{fontSize:"20px",color:"#666"}}),(0,a.jsx)("span",{className:"text-sm font-medium",children:tS.name}),(0,a.jsxs)("span",{className:"text-xs text-gray-500",children:["(",(tS.size/1024/1024).toFixed(2)," MB)"]})]}),(0,a.jsxs)("button",{className:"bg-white shadow-sm border border-gray-200 rounded px-2 py-1 text-red-500 hover:bg-red-50 text-xs",onClick:t9,children:[(0,a.jsx)(b.Z,{})," Remove"]})]}):(0,a.jsxs)(e4,{beforeUpload:e=>(tk(e),!1),accept:"audio/*,.mp3,.mp4,.mpeg,.mpga,.m4a,.wav,.webm",showUploadList:!1,children:[(0,a.jsx)("p",{className:"ant-upload-drag-icon",children:(0,a.jsx)(c.Z,{style:{fontSize:"24px",color:"#666"}})}),(0,a.jsx)("p",{className:"ant-upload-text text-sm",children:"Click or drag audio file to upload"}),(0,a.jsx)("p",{className:"ant-upload-hint text-xs text-gray-500",children:"Support for MP3, MP4, MPEG, MPGA, M4A, WAV, WEBM formats. Max file size: 25 MB."})]})}),eQ===J.KP.RESPONSES&&th&&(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsx)("div",{className:"relative inline-block",children:th.name.toLowerCase().endsWith(".pdf")?(0,a.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"16px",color:"white"}})}):(0,a.jsx)("img",{src:tv||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:th.name}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:th.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,a.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:t6,children:(0,a.jsx)(b.Z,{style:{fontSize:"12px"}})})]})}),eQ===J.KP.CHAT&&ty&&(0,a.jsx)("div",{className:"mb-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsx)("div",{className:"relative inline-block",children:ty.name.toLowerCase().endsWith(".pdf")?(0,a.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,a.jsx)(y.Z,{style:{fontSize:"16px",color:"white"}})}):(0,a.jsx)("img",{src:tN||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:ty.name}),(0,a.jsx)("div",{className:"text-xs text-gray-500",children:ty.name.toLowerCase().endsWith(".pdf")?"PDF":"Image"})]}),(0,a.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:t7,children:(0,a.jsx)(b.Z,{style:{fontSize:"12px"}})})]})}),eQ===J.KP.RESPONSES&&tD.enabled&&(0,a.jsxs)("div",{className:"mb-2 space-y-2",children:[(0,a.jsxs)("div",{className:"px-3 py-2 bg-gradient-to-r from-blue-50 to-purple-50 rounded-lg border border-blue-200 flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:e5?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.Z,{className:"text-blue-500",spin:!0}),(0,a.jsx)("span",{className:"text-sm text-blue-700 font-medium",children:"Running Python code..."})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.Z,{className:"text-blue-500"}),(0,a.jsx)("span",{className:"text-sm text-blue-700 font-medium",children:"Code Interpreter Active"})]})}),(0,a.jsx)("button",{className:"text-xs text-blue-500 hover:text-blue-700",onClick:()=>tD.setEnabled(!1),children:"Disable"})]}),!e5&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:["Generate sample sales data CSV and create a chart","Create a PNG bar chart comparing AI gateway providers including LiteLLM","Generate a CSV of LLM pricing data and visualize it as a line chart"].map((e,t)=>(0,a.jsx)("button",{className:"text-xs px-3 py-1.5 bg-white border border-gray-200 rounded-full hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600 transition-colors",onClick:()=>eA(e),children:e},t))})]}),0===eE.length&&!e5&&(0,a.jsx)("div",{className:"flex items-center gap-2 mb-3 overflow-x-auto",children:(eQ===J.KP.A2A_AGENTS?["What can you help me with?","Tell me about yourself","What tasks can you perform?"]:["Write me a poem","Explain quantum computing","Draft a polite email requesting a meeting"]).map(e=>(0,a.jsx)("button",{type:"button",className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600 cursor-pointer",onClick:()=>eA(e),children:e},e))}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,a.jsxs)("div",{className:"flex-shrink-0 mr-2 flex items-center gap-1",children:[eQ===J.KP.RESPONSES&&!th&&(0,a.jsx)(eV,{responsesUploadedImage:th,responsesImagePreviewUrl:tv,onImageUpload:e=>(tf(e),tb(URL.createObjectURL(e)),!1),onRemoveImage:t6}),eQ===J.KP.CHAT&&!ty&&(0,a.jsx)(Q.Z,{chatUploadedImage:ty,chatImagePreviewUrl:tN,onImageUpload:e=>(tj(e),tw(URL.createObjectURL(e)),!1),onRemoveImage:t7}),eQ===J.KP.RESPONSES&&(0,a.jsx)(A.Z,{title:tD.enabled?"Code Interpreter enabled (click to disable)":"Enable Code Interpreter",children:(0,a.jsx)("button",{className:"p-1.5 rounded-md transition-colors ".concat(tD.enabled?"bg-blue-100 text-blue-600":"text-gray-400 hover:text-gray-600 hover:bg-gray-100"),onClick:()=>{tD.toggle(),tD.enabled||M.Z.success("Code Interpreter enabled!")},children:(0,a.jsx)(h.Z,{style:{fontSize:"16px"}})})})]}),(0,a.jsx)(e2,{value:eC,onChange:e=>eA(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),t8())},placeholder:eQ===J.KP.CHAT||eQ===J.KP.EMBEDDINGS||eQ===J.KP.RESPONSES||eQ===J.KP.ANTHROPIC_MESSAGES?"Type your message... (Shift+Enter for new line)":eQ===J.KP.A2A_AGENTS?"Send a message to the A2A agent...":eQ===J.KP.IMAGE_EDITS?"Describe how you want to edit the image...":eQ===J.KP.SPEECH?"Enter text to convert to speech...":eQ===J.KP.TRANSCRIPTION?"Optional: Add context or prompt for transcription...":"Describe the image you want to generate...",disabled:e5,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,a.jsx)(N.zx,{onClick:t8,disabled:e5||(eQ===J.KP.TRANSCRIPTION?!tS:!eC.trim()),className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,a.jsx)(j.Z,{style:{fontSize:"14px"}})})]}),e5&&(0,a.jsx)(N.zx,{onClick:()=>{e7.current&&(e7.current.abort(),e7.current=null,e6(!1),M.Z.info("Request cancelled"))},className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",icon:b.Z,children:"Cancel"})]})]})]})]})}),(0,a.jsxs)(I.Z,{title:"Generated Code",visible:tP,onCancel:()=>t_(!1),footer:null,width:800,children:[(0,a.jsxs)("div",{className:"flex justify-between items-end my-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(N.xv,{className:"font-medium block mb-1 text-gray-700",children:"SDK Type"}),(0,a.jsx)(P.default,{value:tE,onChange:e=>tI(e),style:{width:150},options:[{value:"openai",label:"OpenAI SDK"},{value:"azure",label:"Azure SDK"}]})]}),(0,a.jsx)(_.ZP,{onClick:()=>{navigator.clipboard.writeText(tC),M.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,a.jsx)(R.Z,{language:"python",style:L.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md",customStyle:{maxHeight:"60vh",overflowY:"auto"},children:tC})]})]})}},94331:function(e,t,s){var a=s(57437),r=s(2265),n=s(5545),o=s(62831),l=s(17906),i=s(94263),c=s(83322),d=s(70464),m=s(77565);t.Z=e=>{let{reasoningContent:t}=e,[s,u]=(0,r.useState)(!0);return t?(0,a.jsxs)("div",{className:"reasoning-content mt-1 mb-2",children:[(0,a.jsxs)(n.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>u(!s),icon:(0,a.jsx)(c.Z,{}),children:[s?"Hide reasoning":"Show reasoning",s?(0,a.jsx)(d.Z,{className:"ml-1"}):(0,a.jsx)(m.Z,{className:"ml-1"})]}),s&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm text-gray-700",children:(0,a.jsx)(o.UG,{components:{code(e){let{node:t,inline:s,className:r,children:n,...o}=e,c=/language-(\w+)/.exec(r||"");return!s&&c?(0,a.jsx)(l.Z,{style:i.Z,language:c[1],PreTag:"div",className:"rounded-md my-2",...o,children:String(n).replace(/\n$/,"")}):(0,a.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...o,children:n})}},children:t})})]}):null}},38398:function(e,t,s){var a=s(57437);s(2265);var r=s(99981),n=s(5540),o=s(71282),l=s(11741),i=s(83322),c=s(16601),d=s(62670),m=s(58630);t.Z=e=>{let{timeToFirstToken:t,totalLatency:s,usage:u,toolName:x}=e;return t||s||u?(0,a.jsxs)("div",{className:"response-metrics mt-2 pt-2 border-t border-gray-100 text-xs text-gray-500 flex flex-wrap gap-3",children:[void 0!==t&&(0,a.jsx)(r.Z,{title:"Time to first token",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["TTFT: ",(t/1e3).toFixed(2),"s"]})]})}),void 0!==s&&(0,a.jsx)(r.Z,{title:"Total latency",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(n.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Total Latency: ",(s/1e3).toFixed(2),"s"]})]})}),(null==u?void 0:u.promptTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Prompt tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(o.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["In: ",u.promptTokens]})]})}),(null==u?void 0:u.completionTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Completion tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(l.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Out: ",u.completionTokens]})]})}),(null==u?void 0:u.reasoningTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Reasoning tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(i.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Reasoning: ",u.reasoningTokens]})]})}),(null==u?void 0:u.totalTokens)!==void 0&&(0,a.jsx)(r.Z,{title:"Total tokens",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Total: ",u.totalTokens]})]})}),(null==u?void 0:u.cost)!==void 0&&(0,a.jsx)(r.Z,{title:"Cost",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(d.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["$",u.cost.toFixed(6)]})]})}),x&&(0,a.jsx)(r.Z,{title:"Tool used",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(m.Z,{className:"mr-1"}),(0,a.jsxs)("span",{children:["Tool: ",x]})]})})]}):null}},33152:function(e,t,s){s.d(t,{J:function(){return d}});var a=s(57437),r=s(2265),n=s(5545),o=s(44625),l=s(70464),i=s(77565),c=s(38434);function d(e){let{searchResults:t}=e,[s,d]=(0,r.useState)(!0),[m,u]=(0,r.useState)({});if(!t||0===t.length)return null;let x=(e,t)=>{let s="".concat(e,"-").concat(t);u(e=>({...e,[s]:!e[s]}))},g=t.reduce((e,t)=>e+t.data.length,0);return(0,a.jsxs)("div",{className:"search-results-content mt-1 mb-2",children:[(0,a.jsxs)(n.ZP,{type:"text",className:"flex items-center text-xs text-gray-500 hover:text-gray-700",onClick:()=>d(!s),icon:(0,a.jsx)(o.Z,{}),children:[s?"Hide sources":"Show sources (".concat(g,")"),s?(0,a.jsx)(l.Z,{className:"ml-1"}):(0,a.jsx)(i.Z,{className:"ml-1"})]}),s&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-gray-50 border border-gray-200 rounded-md text-sm",children:(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"text-xs text-gray-600 mb-2 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"Query:"}),(0,a.jsxs)("span",{className:"italic",children:['"',e.search_query,'"']}),(0,a.jsx)("span",{className:"text-gray-400",children:"•"}),(0,a.jsxs)("span",{className:"text-gray-500",children:[e.data.length," result",1!==e.data.length?"s":""]})]}),(0,a.jsx)("div",{className:"space-y-2",children:e.data.map((e,s)=>{let r=m["".concat(t,"-").concat(s)]||!1;return(0,a.jsxs)("div",{className:"border border-gray-200 rounded-md overflow-hidden bg-white",children:[(0,a.jsx)("div",{className:"flex items-center justify-between p-2 cursor-pointer hover:bg-gray-50 transition-colors",onClick:()=>x(t,s),children:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[(0,a.jsx)("svg",{className:"w-4 h-4 text-gray-400 transition-transform flex-shrink-0 ".concat(r?"transform rotate-90":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,a.jsx)(c.Z,{className:"text-gray-400 flex-shrink-0",style:{fontSize:"12px"}}),(0,a.jsx)("span",{className:"text-xs font-medium text-gray-700 truncate",children:e.filename||e.file_id||"Result ".concat(s+1)}),(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-blue-100 text-blue-700 font-mono flex-shrink-0",children:e.score.toFixed(3)})]})}),r&&(0,a.jsx)("div",{className:"border-t border-gray-200 bg-white",children:(0,a.jsxs)("div",{className:"p-3 space-y-2",children:[e.content.map((e,t)=>(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"text-xs font-mono bg-gray-50 p-2 rounded text-gray-800 whitespace-pre-wrap break-words",children:e.text})},t)),e.attributes&&Object.keys(e.attributes).length>0&&(0,a.jsxs)("div",{className:"mt-2 pt-2 border-t border-gray-100",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Metadata:"}),(0,a.jsx)("div",{className:"space-y-1",children:Object.entries(e.attributes).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"text-xs flex gap-2",children:[(0,a.jsxs)("span",{className:"text-gray-500 font-medium",children:[t,":"]}),(0,a.jsx)("span",{className:"text-gray-700 font-mono break-all",children:String(s)})]},t)})})]})]})})]},s)})})]},t))})})]})}},26832:function(e,t,s){s.d(t,{m:function(){return o}});var a=s(93837),r=s(19250);let n=e=>{if(!e)return;let t={};if(e.id&&(t.taskId=e.id),e.contextId&&(t.contextId=e.contextId),e.status){var s;if(t.status={state:e.status.state,timestamp:e.status.timestamp},null===(s=e.status.message)||void 0===s?void 0:s.parts){let s=e.status.message.parts.filter(e=>"text"===e.kind&&e.text).map(e=>e.text).join(" ");s&&(t.status.message=s)}}return e.metadata&&"object"==typeof e.metadata&&(t.metadata=e.metadata),Object.keys(t).length>0?t:void 0},o=async(e,t,s,o,l,i,c,d,m)=>{let u;let x=m||(0,r.getProxyBaseUrl)(),g=x?"".concat(x,"/a2a/").concat(e):"/a2a/".concat(e),p=(0,a.Z)(),h=(0,a.Z)().replace(/-/g,""),f=performance.now(),v=!1,b="";try{var y,j;let a=await fetch(g,{method:"POST",headers:{Authorization:"Bearer ".concat(o),"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:p,method:"message/stream",params:{message:{kind:"message",messageId:h,role:"user",parts:[{kind:"text",text:t}]}}}),signal:l});if(!a.ok){let e=await a.json();throw Error((null===(j=e.error)||void 0===j?void 0:j.message)||e.detail||"HTTP ".concat(a.status))}let r=null===(y=a.body)||void 0===y?void 0:y.getReader();if(!r)throw Error("No response body");let m=new TextDecoder,x="",N=!1;for(;!N;){let t=await r.read();N=t.done;let a=t.value;if(N)break;let o=(x+=m.decode(a,{stream:!0})).split("\n");for(let t of(x=o.pop()||"",o))if(t.trim())try{let a=JSON.parse(t);if(!v){v=!0;let e=performance.now()-f;i&&i(e)}let r=a.result;if(r){let t=n(r);t&&(u={...u,...t});let a=r.kind;if("artifact-update"===a&&r.artifact){let t=r.artifact;if(t.parts&&Array.isArray(t.parts))for(let a of t.parts)"text"===a.kind&&a.text&&(b+=a.text,s(b,"a2a_agent/".concat(e)))}else if(r.artifacts&&Array.isArray(r.artifacts)){for(let t of r.artifacts)if(t.parts&&Array.isArray(t.parts))for(let a of t.parts)"text"===a.kind&&a.text&&(b+=a.text,s(b,"a2a_agent/".concat(e)))}else if("status-update"===a);else if(r.parts&&Array.isArray(r.parts))for(let t of r.parts)"text"===t.kind&&t.text&&(b+=t.text,s(b,"a2a_agent/".concat(e)))}if(a.error){let e=a.error.message||"Unknown A2A error";throw Error(e)}}catch(e){if(e instanceof Error&&e.message&&!e.message.includes("JSON"))throw e;t.trim().length>0&&console.warn("Failed to parse A2A streaming chunk:",t,e)}}let w=performance.now()-f;c&&c(w),u&&d&&d(u)}catch(e){if(null==l?void 0:l.aborted){console.log("A2A streaming request was cancelled");return}throw console.error("A2A stream message error:",e),e}}},95459:function(e,t,s){s.d(t,{n:function(){return n}});var a=s(7271),r=s(19250);async function n(e,t,s,n,o,l,i,c,d,m,u,x,g,p,h,f,v,b,y,j,N){console.log=function(){},console.log("isLocal:",!1);let w=y||(0,r.getProxyBaseUrl)(),S={};o&&o.length>0&&(S["x-litellm-tags"]=o.join(","));let k=new a.ZP.OpenAI({apiKey:n,baseURL:w,dangerouslyAllowBrowser:!0,defaultHeaders:S});try{let a;let r=Date.now(),n=!1,o=[];for await(let b of(g&&g.length>0&&(g.includes("__all__")?o.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp",require_approval:"never"}):g.forEach(e=>{let t=null==j?void 0:j.find(t=>t.server_id===e),s=(null==t?void 0:t.alias)||(null==t?void 0:t.server_name)||e,a=(null==N?void 0:N[e])||[];o.push({type:"mcp",server_label:"litellm",server_url:"litellm_proxy/mcp/".concat(s),require_approval:"never",...a.length>0?{allowed_tools:a}:{}})})),await k.chat.completions.create({model:s,stream:!0,stream_options:{include_usage:!0},litellm_trace_id:m,messages:e,...u?{vector_store_ids:u}:{},...x?{guardrails:x}:{},...o.length>0?{tools:o,tool_choice:"auto"}:{},...void 0!==f?{temperature:f}:{},...void 0!==v?{max_tokens:v}:{}},{signal:l}))){var P,_,C,A,E,I,Z,T,R;console.log("Stream chunk:",b);let e=null===(P=b.choices[0])||void 0===P?void 0:P.delta;if(console.log("Delta content:",null===(C=b.choices[0])||void 0===C?void 0:null===(_=C.delta)||void 0===_?void 0:_.content),console.log("Delta reasoning content:",null==e?void 0:e.reasoning_content),!n&&((null===(E=b.choices[0])||void 0===E?void 0:null===(A=E.delta)||void 0===A?void 0:A.content)||e&&e.reasoning_content)&&(n=!0,a=Date.now()-r,console.log("First token received! Time:",a,"ms"),c?(console.log("Calling onTimingData with:",a),c(a)):console.log("onTimingData callback is not defined!")),null===(Z=b.choices[0])||void 0===Z?void 0:null===(I=Z.delta)||void 0===I?void 0:I.content){let e=b.choices[0].delta.content;t(e,b.model)}if(e&&e.image&&p&&(console.log("Image generated:",e.image),p(e.image.url,b.model)),e&&e.reasoning_content){let t=e.reasoning_content;i&&i(t)}if(e&&(null===(T=e.provider_specific_fields)||void 0===T?void 0:T.search_results)&&h&&(console.log("Search results found:",e.provider_specific_fields.search_results),h(e.provider_specific_fields.search_results)),b.usage&&d){console.log("Usage data found:",b.usage);let e={completionTokens:b.usage.completion_tokens,promptTokens:b.usage.prompt_tokens,totalTokens:b.usage.total_tokens};(null===(R=b.usage.completion_tokens_details)||void 0===R?void 0:R.reasoning_tokens)&&(e.reasoningTokens=b.usage.completion_tokens_details.reasoning_tokens),void 0!==b.usage.cost&&null!==b.usage.cost&&(e.cost=parseFloat(b.usage.cost)),d(e)}}let y=Date.now();b&&b(y-r)}catch(e){throw(null==l?void 0:l.aborted)&&console.log("Chat completion request was cancelled"),e}}},91643:function(e,t,s){s.d(t,{o:function(){return r}});var a=s(19250);let r=async(e,t)=>{try{let s=t||(0,a.getProxyBaseUrl)(),r=await fetch(s?"".concat(s,"/v1/agents"):"/v1/agents",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json();throw Error(e.detail||"Failed to fetch agents")}let n=await r.json();return console.log("Fetched agents:",n),n.sort((e,t)=>{let s=e.agent_name||e.agent_id,a=t.agent_name||t.agent_id;return s.localeCompare(a)}),n}catch(e){throw console.error("Error fetching agents:",e),e}}},99020:function(e,t,s){var a=s(57437),r=s(2265),n=s(37592),o=s(19250);t.Z=e=>{let{onChange:t,value:s,className:l,accessToken:i}=e,[c,d]=(0,r.useState)([]),[m,u]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(i)try{let e=await (0,o.tagListCall)(i);console.log("List tags response:",e),d(Object.values(e))}catch(e){console.error("Error fetching tags:",e)}finally{u(!1)}})()},[i]),(0,a.jsx)(n.default,{mode:"tags",showSearch:!0,placeholder:"Select or create tags",onChange:t,value:s,loading:m,className:l,options:c.map(e=>({label:e.name,value:e.name,title:e.description||e.name})),optionFilterProp:"label",tokenSeparators:[","],maxTagCount:"responsive",allowClear:!0,style:{width:"100%"}})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6399-759f6cf22845f708.js b/litellm/proxy/_experimental/out/_next/static/chunks/6399-759f6cf22845f708.js deleted file mode 100644 index 92874eef0da..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6399-759f6cf22845f708.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6399],{12579:function(e,t,s){s.d(t,{RM:function(){return a.Z},SC:function(){return c.Z},iA:function(){return r.Z},pj:function(){return l.Z},ss:function(){return o.Z},xs:function(){return i.Z},zx:function(){return n.Z}});var n=s(78489),r=s(21626),a=s(97214),l=s(28241),o=s(58834),i=s(69552),c=s(71876)},56399:function(e,t,s){s.d(t,{Z:function(){return eG}});var n=s(57437),r=s(2265),a=s(16312),l=s(22116),o=s(19250),i=s(12579),c=s(74998),d=s(44633),m=s(86462),p=s(49084),x=s(99981),u=s(23639),h=s(71594),g=s(24525),v=s(42673);let f=e=>{let t=new Set,s=/\{\{(\w+)\}\}/g;if(e.messages.forEach(e=>{let n;for(;null!==(n=s.exec(e.content));)t.add(n[1])}),e.developerMessage){let n;for(;null!==(n=s.exec(e.developerMessage));)t.add(n[1])}return Array.from(t)},j=e=>{let t=f(e),s="---\nmodel: ".concat(e.model,"\n");return void 0!==e.config.temperature&&(s+="temperature: ".concat(e.config.temperature,"\n")),void 0!==e.config.max_tokens&&(s+="max_tokens: ".concat(e.config.max_tokens,"\n")),void 0!==e.config.top_p&&(s+="top_p: ".concat(e.config.top_p,"\n")),s+="input:\n schema:\n",t.forEach(e=>{s+=" ".concat(e,": string\n")}),s+="output:\n format: text\n",e.tools&&e.tools.length>0&&(s+="tools:\n",e.tools.forEach(e=>{let t=JSON.parse(e.json);s+=" - ".concat(JSON.stringify(t),"\n")})),s+="---\n\n",e.developerMessage&&""!==e.developerMessage.trim()&&(s+="Developer: ".concat(e.developerMessage.trim(),"\n\n")),e.messages.forEach(e=>{let t=e.role.charAt(0).toUpperCase()+e.role.slice(1);s+="".concat(t,": ").concat(e.content,"\n\n")}),s.trim()},b=e=>{var t,s,n;let r=(null==e?void 0:null===(s=e.prompt_spec)||void 0===s?void 0:null===(t=s.litellm_params)||void 0===t?void 0:t.dotprompt_content)||"";if(!r)throw Error("No dotprompt_content found in API response");let a=r.split("---");if(a.length<3)throw Error("Invalid dotprompt format");let l=a[1],o=a.slice(2).join("---").trim(),i={};l.split("\n").forEach(e=>{let t=e.trim();if(t&&!t.startsWith("input:")&&!t.startsWith("output:")&&!t.startsWith("schema:")&&!t.startsWith("format:")){let e=t.indexOf(":");if(e>0){let s=t.substring(0,e).trim(),n=t.substring(e+1).trim();"temperature"===s||"max_tokens"===s||"top_p"===s?i[s]=parseFloat(n):"model"===s&&(i[s]=n)}}});let c="",d=[],m=o.split("\n"),p=null,x="";for(let e of m)e.startsWith("Developer:")?c=e.substring(10).trim():e.startsWith("User:")?(p&&x&&d.push({role:p,content:x.trim()}),p="user",x=e.substring(5).trim()):e.startsWith("Assistant:")?(p&&x&&d.push({role:p,content:x.trim()}),p="assistant",x=e.substring(10).trim()):e.trim()&&p&&(x+="\n"+e.trim());p&&x&&d.push({role:p,content:x.trim()});let u=(null==e?void 0:null===(n=e.prompt_spec)||void 0===n?void 0:n.prompt_id)||"Unnamed Prompt";return{name:N(u)||u,model:i.model||"gpt-4o",config:{temperature:i.temperature,max_tokens:i.max_tokens,top_p:i.top_p},tools:[],developerMessage:c,messages:d.length>0?d:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}]}},y=e=>{if(!e)return"1";let t=e.match(/[._-]v(\d+)$/);return t?t[1]:"1"},N=e=>e?e.replace(/[._-]v\d+$/,""):"",w=e=>{let t;if(!e)return{};let s={},n=/\{\{(\w+)\}\}/g;for(;null!==(t=n.exec(e));){let e=t[1];s[e]||(s[e]="example_".concat(e))}return s},_=e=>(null==e?void 0:e.prompt_id)||"",C=e=>{var t;let s=_(e);return(null==e?void 0:null===(t=e.litellm_params)||void 0===t?void 0:t.prompt_id)||s},k=e=>(null==e?void 0:e.version)?String(e.version):y(C(e)),S=e=>{try{var t;let s=e.litellm_params;if(null==s?void 0:s.dotprompt_content){let e=s.dotprompt_content.match(/model:\s*([^\n]+)/);if(e)return e[1].trim()}if(null==s?void 0:null===(t=s.prompt_data)||void 0===t?void 0:t.model)return s.prompt_data.model;if(null==s?void 0:s.model)return s.model;return null}catch(e){return console.error("Error extracting model:",e),null}},Z=(e,t)=>{if(!e)return null;let s=t.get(e);return s&&s.providers&&s.providers.length>0?s.providers[0]:null};var P=e=>{let{promptsList:t,isLoading:s,onPromptClick:a,onDeleteClick:l,accessToken:f,isAdmin:j}=e,[b,y]=(0,r.useState)([{id:"created_at",desc:!0}]),[N,w]=(0,r.useState)(new Map);(0,r.useEffect)(()=>{(async()=>{if(f)try{let e=await (0,o.modelHubCall)(f);if(null==e?void 0:e.data){let t=new Map;e.data.forEach(e=>{t.set(e.model_group,e)}),w(t)}}catch(e){console.error("Error fetching model hub data:",e)}})()},[f]);let _=e=>e?new Date(e).toLocaleString():"-",C=e=>{navigator.clipboard.writeText(e)},k=[{header:"Prompt ID",accessorKey:"prompt_id",cell:e=>{let t=String(e.getValue()||""),s=t.length>25?"".concat(t.slice(0,25),"..."):t;return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(x.Z,{title:t,children:(0,n.jsx)(i.zx,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left overflow-hidden truncate min-w-[220px] justify-start",onClick:()=>e.getValue()&&(null==a?void 0:a(e.getValue())),children:s})}),(0,n.jsx)(x.Z,{title:"Copy prompt ID",children:(0,n.jsx)(u.Z,{onClick:e=>{e.stopPropagation(),C(t)},className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]})}},{header:"Model",accessorKey:"model",cell:e=>{let{row:t}=e,s=S(t.original);if(!s)return(0,n.jsx)("span",{className:"text-xs text-gray-400",children:"-"});let r=Z(s,N),{logo:a}=(0,v.dr)(r||"");return(0,n.jsx)(x.Z,{title:s,children:(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)("div",{className:"flex-shrink-0",children:r&&a?(0,n.jsx)("img",{src:a,alt:"".concat(r," logo"),className:"w-4 h-4",onError:e=>{let t=e.currentTarget,s=t.parentElement;if(s&&s.contains(t))try{let e=document.createElement("div");e.className="w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=(null==r?void 0:r.charAt(0))||"-",s.replaceChild(e,t)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,n.jsx)("div",{className:"w-4 h-4 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:"-"})}),(0,n.jsx)("span",{className:"max-w-[15ch] truncate block",children:s})]})})}},{header:"Created At",accessorKey:"created_at",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(x.Z,{title:s.created_at,children:(0,n.jsx)("span",{className:"text-xs",children:_(s.created_at)})})}},{header:"Updated At",accessorKey:"updated_at",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(x.Z,{title:s.updated_at,children:(0,n.jsx)("span",{className:"text-xs",children:_(s.updated_at)})})}},{header:"Type",accessorKey:"prompt_info.prompt_type",cell:e=>{let{row:t}=e,s=t.original;return(0,n.jsx)(x.Z,{title:s.prompt_info.prompt_type,children:(0,n.jsx)("span",{className:"text-xs",children:s.prompt_info.prompt_type})})}},...j?[{header:"Actions",id:"actions",enableSorting:!1,cell:e=>{let{row:t}=e,s=t.original,r=s.prompt_id||"Unknown Prompt";return(0,n.jsx)("div",{className:"flex items-center gap-1",children:(0,n.jsx)(x.Z,{title:"Delete prompt",children:(0,n.jsx)(i.zx,{size:"xs",variant:"light",color:"red",onClick:e=>{e.stopPropagation(),null==l||l(s.prompt_id,r)},icon:c.Z,className:"text-red-500 hover:text-red-700 hover:bg-red-50"})})})}}]:[]],P=(0,h.b7)({data:t,columns:k,state:{sorting:b},onSortingChange:y,getCoreRowModel:(0,g.sC)(),getSortedRowModel:(0,g.tj)(),enableSorting:!0});return(0,n.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)(i.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,n.jsx)(i.ss,{children:P.getHeaderGroups().map(e=>(0,n.jsx)(i.SC,{children:e.headers.map(e=>(0,n.jsx)(i.xs,{className:"py-1 h-8",onClick:e.column.getToggleSortingHandler(),children:(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,h.ie)(e.column.columnDef.header,e.getContext())}),(0,n.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,n.jsx)(d.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,n.jsx)(m.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,n.jsx)(p.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,n.jsx)(i.RM,{children:s?(0,n.jsx)(i.SC,{children:(0,n.jsx)(i.pj,{colSpan:k.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"Loading..."})})})}):t.length>0?P.getRowModel().rows.map(e=>(0,n.jsx)(i.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,n.jsx)(i.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap",children:(0,h.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,n.jsx)(i.SC,{children:(0,n.jsx)(i.pj,{colSpan:k.length,className:"h-8 text-center",children:(0,n.jsx)("div",{className:"text-center text-gray-500",children:(0,n.jsx)("p",{children:"No prompts found"})})})})})]})})})},T=s(84717),D=s(5545),E=s(10900),z=s(93416),O=s(59872),A=s(30401),I=s(78867),L=s(9114),M=s(37592),F=s(65869),B=s(11894),R=s(19431),J=s(17906),U=s(94263),V=e=>{let{promptId:t,model:s,promptVariables:a={},accessToken:o,version:i="1",proxySettings:c}=e,[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)("curl"),[u,h]=(0,r.useState)("basic"),[g,v]=(0,r.useState)(""),f=window.location.origin,j=null==c?void 0:c.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?f=j:(null==c?void 0:c.PROXY_BASE_URL)&&(f=c.PROXY_BASE_URL);let b=o||"sk-1234",y=()=>{let e=Object.keys(a).length>0;if("curl"===p)return"basic"===u?"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,6).replace(/\n/g,"\n ")):"","\n }' | jq"):"messages"===u?"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,6).replace(/\n/g,"\n ")):"",',\n "messages": [\n {\n "role": "user",\n "content": "hi"\n }\n ]\n }\' | jq'):"curl -X POST '".concat(f,"/chat/completions' \\\n -H 'Content-Type: application/json' \\\n -H 'Authorization: Bearer ").concat(b,'\' \\\n -d \'{\n "model": "').concat(s,'",\n "prompt_id": "').concat(t,'",\n "prompt_version": ').concat(i,',\n "messages": [\n {\n "role": "user",\n "content": "Who are u"\n }\n ]\n }\' | jq');if("python"===p){let n='import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(b,'",\n base_url="').concat(f,'"\n)\n');return"basic"===u?"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n extra_body={\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):"","\n }\n)\n\nprint(response)"):"messages"===u?"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n messages=[\n {"role": "user", "content": "hi"}\n ],\n extra_body={\n "prompt_id": "').concat(t,'"').concat(e?',\n "prompt_variables": '.concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):"","\n }\n)\n\nprint(response)"):"".concat(n,'\nresponse = client.chat.completions.create(\n model="').concat(s,'",\n messages=[\n {"role": "user", "content": "Who are u"}\n ],\n extra_body={\n "prompt_id": "').concat(t,'",\n "prompt_version": ').concat(i,"\n }\n)\n\nprint(response)")}{let n="import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: \"".concat(b,'",\n baseURL: "').concat(f,'"\n});\n');return"basic"===u?"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n ').concat(e?'prompt_id: "'.concat(t,'",\n prompt_variables: ').concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):'prompt_id: "'.concat(t,'"'),"\n });\n \n console.log(response);\n}\n\nmain();"):"messages"===u?"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n messages: [\n { role: "user", content: "hi" }\n ],\n ').concat(e?'prompt_id: "'.concat(t,'",\n prompt_variables: ').concat(JSON.stringify(a,null,8).replace(/\n/g,"\n ")):'prompt_id: "'.concat(t,'"'),"\n });\n \n console.log(response);\n}\n\nmain();"):"".concat(n,'\nasync function main() {\n const response = await client.chat.completions.create({\n model: "').concat(s,'",\n messages: [\n { role: "user", content: "Who are u" }\n ],\n prompt_id: "').concat(t,'",\n prompt_version: ').concat(i,"\n });\n \n console.log(response);\n}\n\nmain();")}};return r.useEffect(()=>{d&&v(y())},[d,p,u,t,s,a]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(R.z,{variant:"secondary",icon:B.Z,onClick:()=>{m(!0)},children:"Get Code"}),(0,n.jsxs)(l.Z,{title:"Generated Code",open:d,onCancel:()=>{m(!1)},footer:null,width:800,children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(R.x,{className:"font-medium block mb-1 text-gray-700",children:"Language"}),(0,n.jsx)(M.default,{value:p,onChange:e=>x(e),style:{width:180},options:[{value:"curl",label:"cURL"},{value:"python",label:"Python (OpenAI SDK)"},{value:"javascript",label:"JavaScript (OpenAI SDK)"}]})]}),(0,n.jsx)(D.ZP,{onClick:()=>{navigator.clipboard.writeText(g),L.Z.success("Copied to clipboard!")},children:"Copy to Clipboard"})]}),(0,n.jsx)(F.default,{activeKey:u,onChange:h,items:[{label:"Basic",key:"basic"},{label:"With Messages",key:"messages"},{label:"With Version",key:"version"}]}),(0,n.jsx)(J.Z,{language:"curl"===p?"bash":"python"===p?"python":"javascript",style:U.Z,wrapLines:!0,wrapLongLines:!0,className:"rounded-md mt-0",customStyle:{maxHeight:"60vh",overflowY:"auto",marginTop:0,borderTopLeftRadius:0,borderTopRightRadius:0},children:g})]})]})},W=e=>{var t,s,a;let{promptId:i,onClose:d,accessToken:m,isAdmin:p,onDelete:x,onEdit:u}=e,[h,g]=(0,r.useState)(null),[v,f]=(0,r.useState)(null),[j,b]=(0,r.useState)(null),[y,N]=(0,r.useState)(!0),[C,Z]=(0,r.useState)({}),[P,M]=(0,r.useState)(!1),[F,B]=(0,r.useState)(!1),R=async()=>{try{if(N(!0),!m)return;let e=await (0,o.getPromptInfo)(m,i);g(e.prompt_spec),f(e.raw_prompt_template),b(e)}catch(e){L.Z.fromBackend("Failed to load prompt information"),console.error("Error fetching prompt info:",e)}finally{N(!1)}};if((0,r.useEffect)(()=>{R()},[i,m]),y)return(0,n.jsx)("div",{className:"p-4",children:"Loading..."});if(!h)return(0,n.jsx)("div",{className:"p-4",children:"Prompt not found"});let J=e=>e?new Date(e).toLocaleString():"-",U=async(e,t)=>{await (0,O.vQ)(e)&&(Z(e=>({...e,[t]:!0})),setTimeout(()=>{Z(e=>({...e,[t]:!1}))},2e3))},W=async()=>{if(m&&h){B(!0);try{await (0,o.deletePromptCall)(m,H),L.Z.success('Prompt "'.concat(H,'" deleted successfully')),null==x||x(),d()}catch(e){console.error("Error deleting prompt:",e),L.Z.fromBackend("Failed to delete prompt")}finally{B(!1),M(!1)}}},K=h&&S(h)||"gpt-4o",H=_(h),q=k(h);return(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.zx,{icon:E.Z,variant:"light",onClick:d,className:"mb-4",children:"Back to Prompts"}),(0,n.jsxs)("div",{className:"flex justify-between items-start mb-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.Dx,{children:"Prompt Details"}),(0,n.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,n.jsx)(T.xv,{className:"text-gray-500 font-mono",children:H}),(0,n.jsx)(D.ZP,{type:"text",size:"small",icon:C["prompt-id"]?(0,n.jsx)(A.Z,{size:12}):(0,n.jsx)(I.Z,{size:12}),onClick:()=>U(H,"prompt-id"),className:"left-2 z-10 transition-all duration-200 ".concat(C["prompt-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(V,{promptId:H,model:K,promptVariables:w(null==v?void 0:v.content),accessToken:m,version:q}),(0,n.jsx)(T.zx,{icon:z.Z,variant:"primary",onClick:()=>null==u?void 0:u(j),className:"flex items-center",children:"Prompt Studio"}),p&&(0,n.jsx)(T.zx,{icon:c.Z,variant:"secondary",onClick:()=>{M(!0)},className:"flex items-center",children:"Delete Prompt"})]})]})]}),(0,n.jsxs)(T.v0,{children:[(0,n.jsxs)(T.td,{className:"mb-4",children:[(0,n.jsx)(T.OK,{children:"Overview"},"overview"),v?(0,n.jsx)(T.OK,{children:"Prompt Template"},"prompt-template"):(0,n.jsx)(n.Fragment,{}),p?(0,n.jsx)(T.OK,{children:"Details"},"details"):(0,n.jsx)(n.Fragment,{}),(0,n.jsx)(T.OK,{children:"Raw JSON"},"raw-json")]}),(0,n.jsxs)(T.nP,{children:[(0,n.jsxs)(T.x4,{children:[(0,n.jsxs)(T.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Prompt ID"}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(T.Dx,{className:"font-mono text-sm",children:H})})]}),(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Version"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(T.Dx,{children:q}),(0,n.jsxs)(T.Ct,{color:"blue",className:"mt-1",children:["v",q]})]})]}),(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Prompt Type"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(T.Dx,{children:(null===(t=h.prompt_info)||void 0===t?void 0:t.prompt_type)||"-"}),(0,n.jsx)(T.Ct,{color:"blue",className:"mt-1",children:(null===(s=h.prompt_info)||void 0===s?void 0:s.prompt_type)||"Unknown"})]})]}),(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.xv,{children:"Created At"}),(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)(T.Dx,{children:J(h.created_at)}),(0,n.jsxs)(T.xv,{children:["Last Updated: ",J(h.updated_at)]})]})]})]}),h.litellm_params&&Object.keys(h.litellm_params).length>0&&(0,n.jsxs)(T.Zb,{className:"mt-6",children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"LiteLLM Parameters"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(h.litellm_params,null,2)})})]})]}),v&&(0,n.jsx)(T.x4,{children:(0,n.jsxs)(T.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(T.Dx,{children:"Prompt Template"}),(0,n.jsx)(D.ZP,{type:"text",size:"small",icon:C["prompt-content"]?(0,n.jsx)(A.Z,{size:16}):(0,n.jsx)(I.Z,{size:16}),onClick:()=>U(v.content,"prompt-content"),className:"transition-all duration-200 ".concat(C["prompt-content"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:C["prompt-content"]?"Copied!":"Copy Content"})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Template ID"}),(0,n.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:v.litellm_prompt_id})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Content"}),(0,n.jsx)("div",{className:"mt-2 p-4 bg-gray-50 rounded-md border overflow-auto max-h-96",children:(0,n.jsx)("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:v.content})})]}),v.metadata&&Object.keys(v.metadata).length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Template Metadata"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-64",children:JSON.stringify(v.metadata,null,2)})})]})]})]})}),p&&(0,n.jsx)(T.x4,{children:(0,n.jsxs)(T.Zb,{children:[(0,n.jsx)(T.Dx,{className:"mb-4",children:"Prompt Details"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Prompt ID"}),(0,n.jsx)("div",{className:"font-mono text-sm bg-gray-50 p-2 rounded",children:H})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Prompt Type"}),(0,n.jsx)("div",{children:(null===(a=h.prompt_info)||void 0===a?void 0:a.prompt_type)||"-"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Created At"}),(0,n.jsx)("div",{children:J(h.created_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Last Updated"}),(0,n.jsx)("div",{children:J(h.updated_at)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"LiteLLM Parameters"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap overflow-auto max-h-96",children:JSON.stringify(h.litellm_params,null,2)})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(T.xv,{className:"font-medium",children:"Prompt Info"}),(0,n.jsx)("div",{className:"mt-2 p-3 bg-gray-50 rounded-md border",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(h.prompt_info,null,2)})})]})]})]})}),(0,n.jsx)(T.x4,{children:(0,n.jsxs)(T.Zb,{children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)(T.Dx,{children:"Raw API Response"}),(0,n.jsx)(D.ZP,{type:"text",size:"small",icon:C["raw-json"]?(0,n.jsx)(A.Z,{size:16}):(0,n.jsx)(I.Z,{size:16}),onClick:()=>U(JSON.stringify(j,null,2),"raw-json"),className:"transition-all duration-200 ".concat(C["raw-json"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100"),children:C["raw-json"]?"Copied!":"Copy JSON"})]}),(0,n.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border overflow-auto",children:(0,n.jsx)("pre",{className:"text-xs text-gray-800 whitespace-pre-wrap",children:JSON.stringify(j,null,2)})})]})})]})]}),(0,n.jsxs)(l.Z,{title:"Delete Prompt",open:P,onOk:W,onCancel:()=>{M(!1)},confirmLoading:F,okText:"Delete",okButtonProps:{danger:!0},children:[(0,n.jsxs)("p",{children:["Are you sure you want to delete prompt: ",(0,n.jsx)("strong",{children:H}),"?"]}),(0,n.jsx)("p",{children:"This action cannot be undone."})]})]})},K=s(10032),H=s(23496),q=s(65319),G=s(31283),X=s(3632);let{Option:Y}=M.default;var $=e=>{let{visible:t,onClose:s,accessToken:a,onSuccess:i}=e,[c]=K.Z.useForm(),[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)([]),[u,h]=(0,r.useState)("dotprompt"),g=()=>{c.resetFields(),x([]),h("dotprompt"),s()},v=async()=>{try{let e=await c.validateFields();if(console.log("values: ",e),!a){L.Z.fromBackend("Access token is required");return}if("dotprompt"===u&&0===p.length){L.Z.fromBackend("Please upload a .prompt file");return}m(!0);let t={};if("dotprompt"===u&&p.length>0){let s=p[0].originFileObj;try{let n=await (0,o.convertPromptFileToJson)(a,s);console.log("Conversion result:",n),t={prompt_id:e.prompt_id,litellm_params:{prompt_integration:"dotprompt",prompt_id:n.prompt_id,prompt_data:n.json_data},prompt_info:{prompt_type:"db"}}}catch(e){console.error("Error converting prompt file:",e),L.Z.fromBackend("Failed to convert prompt file to JSON"),m(!1);return}}try{await (0,o.createPromptCall)(a,t),L.Z.success("Prompt created successfully!"),g(),i()}catch(e){console.error("Error creating prompt:",e),L.Z.fromBackend("Failed to create prompt")}}catch(e){console.error("Form validation error:",e)}finally{m(!1)}};return(0,n.jsx)(l.Z,{title:"Add New Prompt",open:t,onCancel:g,footer:[(0,n.jsx)(D.ZP,{onClick:g,children:"Cancel"},"cancel"),(0,n.jsx)(D.ZP,{loading:d,onClick:v,children:"Create Prompt"},"submit")],width:600,children:(0,n.jsxs)(K.Z,{form:c,layout:"vertical",requiredMark:!1,children:[(0,n.jsx)(K.Z.Item,{label:"Prompt ID",name:"prompt_id",rules:[{required:!0,message:"Please enter a prompt ID"},{pattern:/^[a-zA-Z0-9_-]+$/,message:"Prompt ID can only contain letters, numbers, underscores, and hyphens"}],children:(0,n.jsx)(G.o,{placeholder:"Enter unique prompt ID (e.g., my_prompt_id)"})}),(0,n.jsx)(K.Z.Item,{label:"Prompt Integration",name:"prompt_integration",initialValue:"dotprompt",children:(0,n.jsx)(M.default,{value:u,onChange:h,children:(0,n.jsx)(Y,{value:"dotprompt",children:"dotprompt"})})}),"dotprompt"===u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.Z,{}),(0,n.jsxs)(K.Z.Item,{label:"Prompt File",extra:"Upload a .prompt file that follows the Dotprompt specification",children:[(0,n.jsx)(q.default,{beforeUpload:e=>(e.name.endsWith(".prompt")||L.Z.fromBackend("Please upload a .prompt file"),!1),fileList:p,onChange:e=>{let{fileList:t}=e;x(t.slice(-1))},onRemove:()=>{x([])},children:(0,n.jsx)(D.ZP,{icon:(0,n.jsx)(X.Z,{}),children:"Select .prompt File"})}),p.length>0&&(0,n.jsxs)("div",{className:"mt-2 text-sm text-gray-600",children:["Selected: ",p[0].name]})]})]})]})})},Q=e=>{let{visible:t,initialJson:s,onSave:a,onClose:o}=e,[i,c]=(0,r.useState)(s||'{\n "type": "function",\n "function": {\n "name": "get_current_weather",\n "description": "Get the current weather in a given location",\n "parameters": {\n "type": "object",\n "properties": {\n "location": {\n "type": "string",\n "description": "The city and state, e.g. San Francisco, CA"\n },\n "unit": {\n "type": "string",\n "enum": ["celsius", "fahrenheit"]\n }\n },\n "required": ["location"]\n }\n }\n}'),[d,m]=(0,r.useState)(null),p=()=>{m(null),o()};return(0,n.jsx)(l.Z,{title:(0,n.jsx)("div",{className:"flex items-center justify-between",children:(0,n.jsx)("span",{className:"text-lg font-medium",children:"Add Tool"})}),open:t,onCancel:p,width:800,footer:[(0,n.jsx)(D.ZP,{onClick:p,children:"Cancel"},"cancel"),(0,n.jsx)(D.ZP,{type:"primary",onClick:()=>{try{JSON.parse(i),m(null),a(i)}catch(e){m("Invalid JSON format. Please check your syntax.")}},children:"Add"},"save")],children:(0,n.jsxs)("div",{className:"space-y-3",children:[d&&(0,n.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-red-600 text-sm",children:d}),(0,n.jsx)("textarea",{value:i,onChange:e=>c(e.target.value),className:"w-full min-h-[400px] px-4 py-3 border border-gray-300 rounded-lg text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Paste your tool JSON here..."})]})})},ee=s(4260),et=s(32660),es=s(91723),en=s(83229),er=e=>{let{promptName:t,onNameChange:s,onBack:r,onSave:l,isSaving:o,editMode:i=!1,onShowHistory:c,version:d,promptModel:m="gpt-4o",promptVariables:p={},accessToken:x,proxySettings:u}=e;return(0,n.jsxs)("div",{className:"bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,n.jsx)(a.z,{icon:et.Z,variant:"light",onClick:r,size:"xs",children:"Back"}),(0,n.jsx)(ee.default,{value:t,onChange:e=>s(e.target.value),className:"text-base font-medium border-none shadow-none",style:{width:"200px"}}),d&&(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium",children:d}),(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs bg-gray-100 text-gray-600 rounded",children:"Draft"}),(0,n.jsx)("span",{className:"text-xs text-gray-400",children:"Unsaved changes"})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)(V,{promptId:t,model:m,promptVariables:p,accessToken:x,version:(null==d?void 0:d.replace("v",""))||"1",proxySettings:u}),i&&c&&(0,n.jsx)(a.z,{icon:es.Z,variant:"secondary",onClick:c,children:"History"}),(0,n.jsx)(a.z,{icon:en.Z,onClick:l,loading:o,disabled:o,children:i?"Update":"Save"})]})]})},ea=s(92280),el=s(98728),eo=s(76593),ei=e=>{let{model:t,temperature:s=1,maxTokens:a=1e3,accessToken:l,onModelChange:o,onTemperatureChange:i,onMaxTokensChange:c}=e,[d,m]=(0,r.useState)(!1);return(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("div",{className:"w-[300px]",children:(0,n.jsx)(eo.Z,{accessToken:l||"",value:t,onChange:o,showLabel:!1})}),(0,n.jsxs)("button",{onClick:()=>m(!d),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[(0,n.jsx)(el.Z,{size:16}),(0,n.jsx)("span",{children:"Parameters"})]}),d&&(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-30",children:(0,n.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-96",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold",children:"Model Parameters"}),(0,n.jsx)("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(ea.x,{className:"text-sm text-gray-700",children:"Temperature"}),(0,n.jsx)(ee.default,{type:"number",size:"small",min:0,max:2,step:.1,value:s,onChange:e=>i(parseFloat(e.target.value)||0),className:"w-20"})]})}),(0,n.jsx)("div",{children:(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(ea.x,{className:"text-sm text-gray-700",children:"Max Tokens"}),(0,n.jsx)(ee.default,{type:"number",size:"small",min:1,max:32768,value:a,onChange:e=>c(parseInt(e.target.value)||1e3),className:"w-24"})]})})]})]})})]})},ec=s(78801),ed=s(99397),em=s(27413),ep=e=>{let{tools:t,onAddTool:s,onEditTool:r,onRemoveTool:a}=e;return(0,n.jsxs)(ec.Z,{className:"p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsx)(ec.x,{className:"text-sm font-medium",children:"Tools"}),(0,n.jsxs)("button",{onClick:s,className:"text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,n.jsx)(ed.Z,{size:14,className:"mr-1"}),"Add"]})]}),0===t.length?(0,n.jsx)(ec.x,{className:"text-gray-500 text-xs",children:"No tools added"}):(0,n.jsx)("div",{className:"space-y-2",children:t.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-center justify-between p-2 bg-gray-50 border border-gray-200 rounded",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"font-medium text-xs truncate",children:e.name}),(0,n.jsx)("div",{className:"text-xs text-gray-500 truncate",children:e.description})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-1 ml-2",children:[(0,n.jsx)("button",{onClick:()=>r(t),className:"text-xs text-blue-600 hover:text-blue-700",children:"Edit"}),(0,n.jsx)("button",{onClick:()=>a(t),className:"text-gray-400 hover:text-red-500",children:(0,n.jsx)(em.Z,{size:14})})]})]},t))})]})},ex=s(79326),eu=s(3810),eh=s(13377);let{TextArea:eg}=ee.default;var ev=e=>{let{value:t,onChange:s,placeholder:a,rows:l=4,className:o}=e,[i,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(""),p=()=>{d.trim()&&i&&(s(t.substring(0,i.start)+"{{".concat(d,"}}")+t.substring(i.end)),c(null),m(""))},x=(()=>{let e;let s=/\{\{(\w+)\}\}/g,n=[];for(;null!==(e=s.exec(t));)n.push({name:e[1],start:e.index,end:e.index+e[0].length});return n})();return(0,n.jsxs)("div",{className:"variable-textarea-container ".concat(o),children:[(0,n.jsx)("style",{children:"\n .variable-highlight-text {\n color: #f97316;\n background-color: #fff7ed;\n border-radius: 4px;\n padding: 0 2px;\n border: 1px solid #fed7aa;\n font-family: monospace;\n }\n "}),(0,n.jsx)(eg,{value:t,onChange:e=>s(e.target.value),placeholder:a,rows:l,className:"font-sans"}),x.length>0&&(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 items-center",children:[(0,n.jsx)("span",{className:"text-xs text-gray-500 mr-1",children:"Detected variables:"}),x.map((e,t)=>(0,n.jsx)(ex.Z,{content:(0,n.jsxs)("div",{className:"p-2",style:{minWidth:"200px"},children:[(0,n.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:"Edit variable name"}),(0,n.jsx)(ee.default,{size:"small",value:d,onChange:e=>m(e.target.value),onPressEnter:p,placeholder:"Variable name",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,n.jsx)("button",{onClick:p,className:"text-xs px-2 py-1 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Save"}),(0,n.jsx)("button",{onClick:()=>{c(null),m("")},className:"text-xs px-2 py-1 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",children:"Cancel"})]})]}),open:(null==i?void 0:i.start)===e.start,onOpenChange:e=>{e||(c(null),m(""))},trigger:"click",children:(0,n.jsx)(eu.Z,{color:"orange",className:"cursor-pointer hover:opacity-80 transition-all m-0",icon:(0,n.jsx)(eh.Z,{}),onClick:()=>{c({oldName:e.name,start:e.start,end:e.end}),m(e.name)},children:e.name})},"".concat(e.start,"-").concat(t)))]})]})},ef=e=>{let{value:t,onChange:s}=e;return(0,n.jsxs)(ec.Z,{className:"p-3",children:[(0,n.jsx)(ec.x,{className:"block mb-2 text-sm font-medium",children:"Developer message"}),(0,n.jsx)(ec.x,{className:"text-gray-500 text-xs mb-2",children:"Optional system instructions for the model"}),(0,n.jsx)(ev,{value:t,onChange:s,rows:3,placeholder:"e.g., You are a helpful assistant..."})]})},ej=s(41905);let{Option:eb}=M.default;var ey=e=>{let{messages:t,onAddMessage:s,onUpdateMessage:a,onRemoveMessage:l,onMoveMessage:o}=e,[i,c]=(0,r.useState)(null),[d,m]=(0,r.useState)(null),p=e=>{c(e)},x=(e,t)=>{e.preventDefault(),m(t)},u=(e,t)=>{e.preventDefault(),null!==i&&i!==t&&o(i,t),c(null),m(null)},h=()=>{c(null),m(null)};return(0,n.jsxs)(ec.Z,{className:"p-3",children:[(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)(ec.x,{className:"text-sm font-medium",children:"Prompt messages"}),(0,n.jsxs)(ec.x,{className:"text-gray-500 text-xs mt-1",children:["Use ",(0,n.jsx)("code",{className:"bg-gray-100 px-1 rounded text-xs",children:"{{variable}}"})," syntax for template variables"]})]}),(0,n.jsx)("div",{className:"space-y-2",children:t.map((e,s)=>(0,n.jsxs)("div",{draggable:!0,onDragStart:()=>p(s),onDragOver:e=>x(e,s),onDrop:e=>u(e,s),onDragEnd:h,className:"border border-gray-300 rounded overflow-hidden bg-white transition-all ".concat(i===s?"opacity-50":""," ").concat(d===s&&i!==s?"border-blue-500 border-2":""),children:[(0,n.jsxs)("div",{className:"bg-gray-50 px-2 py-1.5 border-b border-gray-300 flex items-center justify-between",children:[(0,n.jsxs)(M.default,{value:e.role,onChange:e=>a(s,"role",e),style:{width:100},size:"small",bordered:!1,children:[(0,n.jsx)(eb,{value:"user",children:"User"}),(0,n.jsx)(eb,{value:"assistant",children:"Assistant"}),(0,n.jsx)(eb,{value:"system",children:"System"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[t.length>1&&(0,n.jsx)("button",{onClick:()=>l(s),className:"text-gray-400 hover:text-red-500",children:(0,n.jsx)(em.Z,{size:14})}),(0,n.jsx)("div",{className:"cursor-grab active:cursor-grabbing text-gray-400 hover:text-gray-600",children:(0,n.jsx)(ej.Z,{size:16})})]})]}),(0,n.jsx)("div",{className:"p-2",children:(0,n.jsx)(ev,{value:e.content,onChange:e=>a(s,"content",e),rows:3,placeholder:"Enter prompt content..."})})]},s))}),(0,n.jsxs)("button",{onClick:s,className:"mt-2 text-xs text-blue-600 hover:text-blue-700 flex items-center",children:[(0,n.jsx)(ed.Z,{size:14,className:"mr-1"}),"Add message"]})]})},eN=s(26430);let ew=(e,t)=>{let[s,n]=(0,r.useState)(!1),[a,l]=(0,r.useState)([]),[i,c]=(0,r.useState)(""),[d,m]=(0,r.useState)({}),[p,x]=(0,r.useState)(!1),[u,h]=(0,r.useState)(null),g=(0,r.useRef)(null),v=f(e),b=v.every(e=>d[e]&&""!==d[e].trim()),y=()=>{g.current&&setTimeout(()=>{var e;null===(e=g.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end"})},100)};(0,r.useEffect)(()=>{y()},[a]);let N=async()=>{let s;if(!t){L.Z.fromBackend("Access token is required");return}if(v.length>0&&!b){L.Z.fromBackend("Please fill in all template variables");return}if(!i.trim())return;!p&&v.length>0&&x(!0);let r={role:"user",content:i};l(e=>[...e,r]),c("");let m=new AbortController;h(m),n(!0);let u=Date.now();try{let n,r;let c=j(e),p=(0,o.getProxyBaseUrl)(),x={dotprompt_content:c};0===a.length?x.prompt_variables=d:x.conversation_history=[...a.map(e=>({role:e.role,content:e.content})),{role:"user",content:i}];let h=await fetch("".concat(p,"/prompts/test"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify(x),signal:m.signal});if(!h.ok){let e=await h.text();throw Error("HTTP error! status: ".concat(h.status,", ").concat(e))}if(!h.body)throw Error("No response body");let v=h.body.getReader(),b=new TextDecoder,N="";for(l(e=>[...e,{role:"assistant",content:""}]);;){let{done:e,value:t}=await v.read();if(e)break;for(let e of b.decode(t).split("\n"))if(e.startsWith("data: ")){let t=e.slice(6);if("[DONE]"===t)continue;try{var g,f,y;let e=JSON.parse(t);!n&&e.model&&(n=e.model),e.usage&&(r=e.usage);let a=null===(y=e.choices)||void 0===y?void 0:null===(f=y[0])||void 0===f?void 0:null===(g=f.delta)||void 0===g?void 0:g.content;a&&(s||(s=Date.now()-u),N+=a,l(e=>{let t=[...e];return t[t.length-1]={role:"assistant",content:N,model:n,timeToFirstToken:s},t}))}catch(e){console.error("Error parsing chunk:",e)}}}let w=Date.now()-u;l(e=>{let t=[...e];return t[t.length-1]={...t[t.length-1],totalLatency:w,usage:r},t})}catch(e){"AbortError"===e.name?console.log("Request was cancelled"):(console.error("Error testing prompt:",e),l(t=>{let s=t[t.length-1];return s&&"assistant"===s.role&&""===s.content?[...t.slice(0,-1),{role:"assistant",content:"Error: ".concat(e.message)}]:[...t,{role:"assistant",content:"Error: ".concat(e.message)}]}))}finally{n(!1),h(null)}};return{isLoading:s,messages:a,inputMessage:i,variables:d,variablesFilled:p,extractedVariables:v,allVariablesFilled:b,messagesEndRef:g,setInputMessage:c,handleSendMessage:N,handleCancelRequest:()=>{u&&(u.abort(),h(null),n(!1),L.Z.info("Request cancelled"))},handleClearConversation:()=>{l([]),x(!1),L.Z.success("Chat history cleared.")},handleKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),N())},handleVariableChange:(e,t)=>{m({...d,[e]:t})}}};var e_=e=>{let{extractedVariables:t,variables:s,onVariableChange:r}=e;return 0===t.length?null:(0,n.jsxs)("div",{className:"p-4 border-b border-gray-200 bg-blue-50",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Fill in template variables to start testing"}),(0,n.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-xs text-gray-600 mb-1 font-medium",children:["{{",e,"}}"]}),(0,n.jsx)(ee.default,{value:s[e]||"",onChange:t=>r(e,t.target.value),placeholder:"Enter value for ".concat(e),size:"small"})]},e))})]})},eC=s(61935),ek=s(10353),eS=s(69993),eZ=e=>{let{hasVariables:t}=e;return(0,n.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,n.jsx)(eS.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,n.jsx)("span",{className:"text-base",children:t?"Fill in the variables above, then type a message to start testing":"Type a message below to start testing your prompt"})]})},eP=s(15883),eT=s(62831),eD=s(38398),eE=e=>{let{message:t}=e;return(0,n.jsx)("div",{className:"mb-4 flex ".concat("user"===t.role?"justify-end":"justify-start"),children:(0,n.jsxs)("div",{className:"max-w-[85%] rounded-lg shadow-sm p-3.5 px-4",style:{backgroundColor:"user"===t.role?"#f0f8ff":"#ffffff",border:"user"===t.role?"1px solid #e6f0fa":"1px solid #f0f0f0"},children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,n.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full mr-1",style:{backgroundColor:"user"===t.role?"#e6f0fa":"#f5f5f5"},children:"user"===t.role?(0,n.jsx)(eP.Z,{style:{fontSize:"12px",color:"#2563eb"}}):(0,n.jsx)(eS.Z,{style:{fontSize:"12px",color:"#4b5563"}})}),(0,n.jsx)("strong",{className:"text-sm capitalize",children:t.role}),"assistant"===t.role&&t.model&&(0,n.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600 font-normal",children:t.model})]}),(0,n.jsxs)("div",{className:"whitespace-pre-wrap break-words max-w-full message-content",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:["assistant"===t.role?(0,n.jsx)(eT.UG,{components:{code(e){let{node:t,inline:s,className:r,children:a,...l}=e,o=/language-(\w+)/.exec(r||"");return!s&&o?(0,n.jsx)(J.Z,{style:U.Z,language:o[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(a).replace(/\n$/,"")}):(0,n.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),style:{wordBreak:"break-word"},...l,children:a})},pre:e=>{let{node:t,...s}=e;return(0,n.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...s})}},children:t.content}):(0,n.jsx)("div",{className:"whitespace-pre-wrap",children:t.content}),"assistant"===t.role&&(t.timeToFirstToken||t.totalLatency||t.usage)&&(0,n.jsx)(eD.Z,{timeToFirstToken:t.timeToFirstToken,totalLatency:t.totalLatency,usage:t.usage})]})]})})},ez=e=>{let{messages:t,isLoading:s,hasVariables:r,messagesEndRef:a}=e,l=(0,n.jsx)(eC.Z,{style:{fontSize:24},spin:!0});return(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 pb-0",children:[0===t.length&&(0,n.jsx)(eZ,{hasVariables:r}),t.map((e,t)=>(0,n.jsx)(eE,{message:e},t)),s&&(0,n.jsx)("div",{className:"flex justify-center items-center my-4",children:(0,n.jsx)(ek.Z,{indicator:l})}),(0,n.jsx)("div",{ref:a,style:{height:"1px"}})]})},eO=e=>{let{extractedVariables:t,variables:s}=e,r=t.filter(e=>!s[e]||""===s[e].trim());return 0===r.length?null:(0,n.jsx)("div",{className:"mb-3 p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("span",{className:"text-yellow-600 text-sm",children:"⚠️"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("p",{className:"text-sm text-yellow-800 font-medium mb-1",children:"Please fill in all template variables above"}),(0,n.jsxs)("p",{className:"text-xs text-yellow-700",children:["Missing: ",r.map(e=>"{{".concat(e,"}}")).join(", ")]})]})]})})},eA=s(79276);let{TextArea:eI}=ee.default;var eL=e=>{let{inputMessage:t,isLoading:s,isDisabled:r,onInputChange:l,onSend:o,onKeyDown:i,onCancel:c}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[(0,n.jsx)(eI,{value:t,onChange:e=>l(e.target.value),onKeyDown:i,placeholder:"Type your message... (Shift+Enter for new line)",disabled:s,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,n.jsx)(a.z,{onClick:o,disabled:r,className:"flex-shrink-0 ml-2 !w-8 !h-8 !min-w-8 !p-0 !rounded-full !bg-blue-600 hover:!bg-blue-700 disabled:!bg-gray-300 !border-none !text-white disabled:!text-gray-500 !flex !items-center !justify-center",children:(0,n.jsx)(eA.Z,{style:{fontSize:"14px"}})})]}),s&&(0,n.jsx)(a.z,{onClick:c,className:"bg-red-50 hover:bg-red-100 text-red-600 border-red-200",children:"Cancel"})]})},eM=e=>{let{prompt:t,accessToken:s}=e,{isLoading:r,messages:l,inputMessage:o,variables:i,variablesFilled:c,extractedVariables:d,allVariablesFilled:m,messagesEndRef:p,setInputMessage:x,handleSendMessage:u,handleCancelRequest:h,handleClearConversation:g,handleKeyDown:v,handleVariableChange:f}=ew(t,s);return(0,n.jsxs)("div",{className:"flex flex-col h-full bg-white",children:[!c&&(0,n.jsx)(e_,{extractedVariables:d,variables:i,onVariableChange:f}),l.length>0&&(0,n.jsx)("div",{className:"p-3 border-b border-gray-200 bg-white flex justify-end",children:(0,n.jsx)(a.z,{onClick:g,className:"bg-gray-100 hover:bg-gray-200 text-gray-700 border-gray-300",icon:eN.Z,children:"Clear Chat"})}),(0,n.jsx)(ez,{messages:l,isLoading:r,hasVariables:d.length>0,messagesEndRef:p}),(0,n.jsxs)("div",{className:"p-4 border-t border-gray-200 bg-white",children:[(0,n.jsx)(eO,{extractedVariables:d,variables:i}),(0,n.jsx)(eL,{inputMessage:o,isLoading:r,isDisabled:r||!o.trim()||d.length>0&&!m,onInputChange:x,onSend:u,onKeyDown:v,onCancel:h})]})]})},eF=e=>{let{visible:t,promptName:s,isSaving:r,onNameChange:a,onPublish:o,onCancel:i}=e;return(0,n.jsx)(l.Z,{title:"Publish Prompt",open:t,onCancel:i,footer:[(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(R.z,{variant:"secondary",onClick:i,children:"Cancel"}),(0,n.jsx)(R.z,{onClick:o,loading:r,children:"Publish"})]},"footer")],children:(0,n.jsxs)("div",{className:"py-4",children:[(0,n.jsx)(R.x,{className:"mb-2",children:"Name"}),(0,n.jsx)(ee.default,{value:s,onChange:e=>a(e.target.value),placeholder:"Enter prompt name",onPressEnter:o,autoFocus:!0}),(0,n.jsx)(R.x,{className:"text-gray-500 text-xs mt-2",children:"Published prompts can be used in API calls and are versioned for easy tracking."})]})})},eB=e=>{let{prompt:t}=e,s=j(t);return(0,n.jsxs)("div",{className:"p-6",children:[(0,n.jsxs)("div",{className:"mb-4",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-gray-700 mb-2",children:"Generated .prompt file"}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:"This is the dotprompt format that will be saved to the database"})]}),(0,n.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:(0,n.jsx)("pre",{className:"text-sm text-gray-900 font-mono whitespace-pre-wrap",children:s})})]})},eR=s(57840),eJ=s(63134),eU=s(50337),eV=s(35631);let{Text:eW}=eR.default;var eK=e=>{let{isOpen:t,onClose:s,accessToken:a,promptId:l,activeVersionId:i,onSelectVersion:c}=e,[d,m]=(0,r.useState)([]),[p,x]=(0,r.useState)(!1);(0,r.useEffect)(()=>{t&&a&&l&&u()},[t,a,l]);let u=async()=>{x(!0);try{let e=l.includes(".v")?l.split(".v")[0]:l,t=await (0,o.getPromptVersions)(a,e);m(t.prompts)}catch(e){console.error("Error fetching prompt versions:",e)}finally{x(!1)}},h=e=>{var t;if(e.version)return"v".concat(e.version);let s=(null===(t=e.litellm_params)||void 0===t?void 0:t.prompt_id)||e.prompt_id;return s.includes(".v")?"v".concat(s.split(".v")[1]):s.includes("_v")?"v".concat(s.split("_v")[1]):"v1"},g=e=>e?new Date(e).toLocaleString():"-";return(0,n.jsx)(eJ.Z,{title:"Version History",placement:"right",onClose:s,open:t,width:400,mask:!1,maskClosable:!1,children:p?(0,n.jsx)(eU.Z,{active:!0,paragraph:{rows:4}}):0===d.length?(0,n.jsx)("div",{className:"text-center py-8 text-gray-500",children:"No version history available."}):(0,n.jsx)(eV.Z,{dataSource:d,renderItem:(e,t)=>{var s;let r=e.version||parseInt(h(e).replace("v","")),a=null;i&&(i.includes(".v")?a=parseInt(i.split(".v")[1]):i.includes("_v")&&(a=parseInt(i.split("_v")[1])));let l=a?r===a:0===t;return(0,n.jsxs)("div",{className:"mb-4 p-4 rounded-lg border cursor-pointer transition-all hover:shadow-md ".concat(l?"border-blue-500 bg-blue-50":"border-gray-200 bg-white hover:border-blue-300"),onClick:()=>null==c?void 0:c(e),children:[(0,n.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(eu.Z,{className:"m-0",children:h(e)}),0===t&&(0,n.jsx)(eu.Z,{color:"blue",className:"m-0",children:"Latest"})]}),l&&(0,n.jsx)(eu.Z,{color:"green",className:"m-0",children:"Active"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,n.jsx)(eW,{className:"text-sm text-gray-600 font-medium",children:g(e.created_at)}),(0,n.jsx)(eW,{type:"secondary",className:"text-xs",children:(null===(s=e.prompt_info)||void 0===s?void 0:s.prompt_type)==="db"?"Saved to Database":"Config Prompt"})]})]},"".concat(e.prompt_id,"-v").concat(e.version||r))}})})},eH=e=>{var t;let{onClose:s,onSuccess:a,accessToken:l,initialPromptData:i}=e,[c,d]=(0,r.useState)((()=>{if(i)try{return b(i)}catch(e){console.error("Error parsing existing prompt:",e),L.Z.fromBackend("Failed to parse prompt data")}return{name:"New prompt",model:"gpt-4o",config:{temperature:1,max_tokens:1e3},tools:[],developerMessage:"",messages:[{role:"user",content:"Enter task specifics. Use {{template_variables}} for dynamic inputs"}]}})()),[m,p]=(0,r.useState)(!!i),[x,u]=(0,r.useState)(!1),[h,g]=(0,r.useState)((()=>{var e;if(!(null==i?void 0:i.prompt_spec))return;let t=i.prompt_spec.prompt_id,s=i.prompt_spec.version||(null===(e=i.prompt_spec.litellm_params)||void 0===e?void 0:e.prompt_id);return"number"==typeof s?"".concat(t,".v").concat(s):"string"==typeof s&&(s.includes(".v")||s.includes("_v"))?s:t})()),[v,f]=(0,r.useState)(!1),[y,N]=(0,r.useState)(!1),[w,_]=(0,r.useState)(null),[C,k]=(0,r.useState)(!1),[S,Z]=(0,r.useState)("pretty"),P=e=>{void 0!==e?_(e):_(null),f(!0)},T=async()=>{if(!l){L.Z.fromBackend("Access token is required");return}if(!c.name||""===c.name.trim()){L.Z.fromBackend("Please enter a valid prompt name");return}k(!0);try{var e;let t=c.name.replace(/[^a-zA-Z0-9_-]/g,"_").toLowerCase(),n=j(c),r={prompt_id:t,litellm_params:{prompt_integration:"dotprompt",prompt_id:t,dotprompt_content:n},prompt_info:{prompt_type:"db"}};m&&(null==i?void 0:null===(e=i.prompt_spec)||void 0===e?void 0:e.prompt_id)?(await (0,o.updatePromptCall)(l,i.prompt_spec.prompt_id,r),L.Z.success("Prompt updated successfully!")):(await (0,o.createPromptCall)(l,r),L.Z.success("Prompt created successfully!")),a(),s()}catch(e){console.error("Error saving prompt:",e),L.Z.fromBackend(m?"Failed to update prompt":"Failed to save prompt")}finally{k(!1),N(!1)}},D=h&&h.includes(".v")?"v".concat(h.split(".v")[1]):null;return(0,n.jsxs)("div",{className:"flex h-full bg-white",children:[(0,n.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,n.jsx)(er,{promptName:c.name,onNameChange:e=>d({...c,name:e}),onBack:s,onSave:()=>{c.name&&""!==c.name.trim()&&"New prompt"!==c.name?T():N(!0)},isSaving:C,editMode:m,onShowHistory:()=>u(!0),version:D,promptModel:c.model,promptVariables:(()=>{let e;let t={},s=[c.developerMessage,...c.messages.map(e=>e.content)].join(" "),n=/\{\{(\w+)\}\}/g;for(;null!==(e=n.exec(s));){let s=e[1];t[s]||(t[s]="example_".concat(s))}return t})(),accessToken:l}),(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,n.jsxs)("div",{className:"w-1/2 overflow-y-auto bg-white border-r border-gray-200 flex-shrink-0",children:[(0,n.jsxs)("div",{className:"border-b border-gray-200 bg-white px-6 py-4 flex items-center gap-3",children:[(0,n.jsx)(ei,{model:c.model,temperature:c.config.temperature,maxTokens:c.config.max_tokens,accessToken:l,onModelChange:e=>d({...c,model:e}),onTemperatureChange:e=>d({...c,config:{...c.config,temperature:e}}),onMaxTokensChange:e=>d({...c,config:{...c.config,max_tokens:e}})}),(0,n.jsxs)("div",{className:"ml-auto inline-flex items-center bg-gray-200 rounded-full p-0.5",children:[(0,n.jsx)("button",{className:"px-3 py-1 text-xs font-medium rounded-full transition-colors ".concat("pretty"===S?"bg-white text-gray-900 shadow-sm":"text-gray-600"),onClick:()=>Z("pretty"),children:"PRETTY"}),(0,n.jsx)("button",{className:"px-3 py-1 text-xs font-medium rounded-full transition-colors ".concat("dotprompt"===S?"bg-white text-gray-900 shadow-sm":"text-gray-600"),onClick:()=>Z("dotprompt"),children:"DOTPROMPT"})]})]}),"pretty"===S?(0,n.jsxs)("div",{className:"p-6 space-y-4 pb-20",children:[(0,n.jsx)(ep,{tools:c.tools,onAddTool:()=>P(),onEditTool:P,onRemoveTool:e=>{d({...c,tools:c.tools.filter((t,s)=>s!==e)})}}),(0,n.jsx)(ef,{value:c.developerMessage,onChange:e=>d({...c,developerMessage:e})}),(0,n.jsx)(ey,{messages:c.messages,onAddMessage:()=>{d({...c,messages:[...c.messages,{role:"user",content:""}]})},onUpdateMessage:(e,t,s)=>{let n=[...c.messages];n[e][t]=s,d({...c,messages:n})},onRemoveMessage:e=>{c.messages.length>1&&d({...c,messages:c.messages.filter((t,s)=>s!==e)})},onMoveMessage:(e,t)=>{let s=[...c.messages],[n]=s.splice(e,1);s.splice(t,0,n),d({...c,messages:s})}})]}):(0,n.jsx)(eB,{prompt:c})]}),(0,n.jsx)("div",{className:"w-1/2 flex-shrink-0",children:(0,n.jsx)(eM,{prompt:c,accessToken:l})})]})]}),(0,n.jsx)(eF,{visible:y,promptName:c.name,isSaving:C,onNameChange:e=>d({...c,name:e}),onPublish:T,onCancel:()=>N(!1)}),v&&(0,n.jsx)(Q,{visible:v,initialJson:null!==w?c.tools[w].json:"",onSave:e=>{try{var t,s;let n=JSON.parse(e),r={name:(null===(t=n.function)||void 0===t?void 0:t.name)||"Unnamed Tool",description:(null===(s=n.function)||void 0===s?void 0:s.description)||"",json:e};if(null!==w){let e=[...c.tools];e[w]=r,d({...c,tools:e})}else d({...c,tools:[...c.tools,r]});f(!1),_(null)}catch(e){L.Z.fromBackend("Invalid JSON format")}},onClose:()=>{f(!1),_(null)}}),(0,n.jsx)(eK,{isOpen:x,onClose:()=>u(!1),accessToken:l,promptId:(null==i?void 0:null===(t=i.prompt_spec)||void 0===t?void 0:t.prompt_id)||c.name,activeVersionId:h,onSelectVersion:e=>{try{let t=b({prompt_spec:e});d(t);let s=e.version||1;g("".concat(e.prompt_id,".v").concat(s))}catch(e){console.error("Error loading version:",e),L.Z.fromBackend("Failed to load prompt version")}}})]})},eq=s(20347),eG=e=>{let{accessToken:t,userRole:s}=e,[i,c]=(0,r.useState)([]),[d,m]=(0,r.useState)(!1),[p,x]=(0,r.useState)(null),[u,h]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),[f,j]=(0,r.useState)(null),[b,y]=(0,r.useState)(!1),[N,w]=(0,r.useState)(null),_=!!s&&(0,eq.tY)(s),C=async()=>{if(t){m(!0);try{let e=await (0,o.getPromptsList)(t);console.log("prompts: ".concat(JSON.stringify(e))),c(e.prompts)}catch(e){console.error("Error fetching prompts:",e)}finally{m(!1)}}};(0,r.useEffect)(()=>{C()},[t]);let k=()=>{C(),v(!1),j(null),x(null)},S=async()=>{if(N&&t){y(!0);try{await (0,o.deletePromptCall)(t,N.id),L.Z.success('Prompt "'.concat(N.name,'" deleted successfully')),C()}catch(e){console.error("Error deleting prompt:",e),L.Z.fromBackend("Failed to delete prompt")}finally{y(!1),w(null)}}};return(0,n.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto m-8 p-2",children:[g?(0,n.jsx)(eH,{onClose:()=>{v(!1),j(null)},onSuccess:k,accessToken:t,initialPromptData:f}):p?(0,n.jsx)(W,{promptId:p,onClose:()=>x(null),accessToken:t,isAdmin:_,onDelete:C,onEdit:e=>{j(e),v(!0)}}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(a.z,{onClick:()=>{p&&x(null),j(null),v(!0)},disabled:!t,children:"+ Add New Prompt"}),(0,n.jsx)(a.z,{onClick:()=>{p&&x(null),h(!0)},disabled:!t,variant:"secondary",children:"Upload .prompt File"})]})}),(0,n.jsx)(P,{promptsList:i,isLoading:d,onPromptClick:e=>{x(e)},onDeleteClick:(e,t)=>{w({id:e,name:t})},accessToken:t,isAdmin:_})]}),(0,n.jsx)($,{visible:u,onClose:()=>{h(!1)},accessToken:t,onSuccess:k}),N&&(0,n.jsxs)(l.Z,{title:"Delete Prompt",open:null!==N,onOk:S,onCancel:()=>{w(null)},confirmLoading:b,okText:"Delete",okButtonProps:{danger:!0},children:[(0,n.jsxs)("p",{children:["Are you sure you want to delete prompt: ",N.name," ?"]}),(0,n.jsx)("p",{children:"This action cannot be undone."})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6537-a0859fb62e73fda7.js b/litellm/proxy/_experimental/out/_next/static/chunks/6537-a0859fb62e73fda7.js deleted file mode 100644 index 038dc937199..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6537-a0859fb62e73fda7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6537],{86537:function(e,s,r){r.d(s,{d:function(){return e4},o:function(){return ss}});var t=r(57437),l=r(20347),a=r(67187),n=r(78489),i=r(12485),o=r(18135),c=r(35242),d=r(29706),m=r(77991),u=r(84264),x=r(96761),h=r(57840),p=r(37592),g=r(99981),j=r(22116),v=r(76188),f=r(2265),y=r(68474),b=r(11713),N=r(90246),_=r(19250),w=r(39760);let Z=(0,N.n)("mcpServerHealth"),C=e=>{let{accessToken:s}=(0,w.Z)();return(0,b.a)({queryKey:[...Z.lists(),{serverIds:e}],queryFn:async()=>await (0,_.fetchMCPServerHealth)(s,e),enabled:!!s,refetchInterval:3e4})};var S=r(9114),k=r(12322),A=r(10032),P=r(4260),M=r(15424),O=r(64504);let I={NONE:"none",API_KEY:"api_key",BEARER_TOKEN:"bearer_token",BASIC:"basic",OAUTH2:"oauth2"},T={SSE:"sse"},L=e=>(console.log(e),null==e)?T.SSE:e,E=e=>null==e?I.NONE:e;var z=r(19015),q=r(44851),R=r(33866),U=r(62670),V=r(58630),F=r(12514),B=e=>{let{value:s={},onChange:r,tools:l=[],disabled:a=!1}=e,n=(e,t)=>{let l={...s,tool_name_to_cost_per_query:{...s.tool_name_to_cost_per_query,[e]:t}};null==r||r(l)};return(0,t.jsx)(F.Z,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,t.jsx)(U.Z,{className:"text-green-600"}),(0,t.jsx)(x.Z,{children:"Cost Configuration"}),(0,t.jsx)(g.Z,{title:"Configure costs for this MCP server's tool calls. Set a default rate and per-tool overrides.",children:(0,t.jsx)(M.Z,{className:"text-gray-400"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Default Cost per Query ($)",(0,t.jsx)(g.Z,{title:"Default cost charged for each tool call to this server.",children:(0,t.jsx)(M.Z,{className:"ml-1 text-gray-400"})})]}),(0,t.jsx)(z.Z,{min:0,step:1e-4,precision:4,placeholder:"0.0000",value:s.default_cost_per_query,onChange:e=>{let t={...s,default_cost_per_query:e};null==r||r(t)},disabled:a,style:{width:"200px"},addonBefore:"$"}),(0,t.jsx)(u.Z,{className:"block mt-1 text-gray-500 text-sm",children:"Set a default cost for all tool calls to this server"})]}),l.length>0&&(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("label",{className:"block text-sm font-medium text-gray-700",children:["Tool-Specific Costs ($)",(0,t.jsx)(g.Z,{title:"Override the default cost for specific tools. Leave blank to use the default rate.",children:(0,t.jsx)(M.Z,{className:"ml-1 text-gray-400"})})]}),(0,t.jsx)(q.default,{items:[{key:"1",label:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(V.Z,{className:"mr-2 text-blue-500"}),(0,t.jsx)("span",{className:"font-medium",children:"Available Tools"}),(0,t.jsx)(R.Z,{count:l.length,style:{backgroundColor:"#52c41a",marginLeft:"8px"}})]}),children:(0,t.jsx)("div",{className:"space-y-3 max-h-64 overflow-y-auto",children:l.map((e,r)=>{var l;return(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(u.Z,{className:"font-medium text-gray-900",children:e.name}),e.description&&(0,t.jsx)(u.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description})]}),(0,t.jsx)("div",{className:"ml-4",children:(0,t.jsx)(z.Z,{min:0,step:1e-4,precision:4,placeholder:"Use default",value:null===(l=s.tool_name_to_cost_per_query)||void 0===l?void 0:l[e.name],onChange:s=>n(e.name,s),disabled:a,style:{width:"120px"},addonBefore:"$"})})]},r)})})}]})]})]}),(s.default_cost_per_query||s.tool_name_to_cost_per_query&&Object.keys(s.tool_name_to_cost_per_query).length>0)&&(0,t.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,t.jsx)(u.Z,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[s.default_cost_per_query&&(0,t.jsxs)(u.Z,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),s.tool_name_to_cost_per_query&&Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,t.jsxs)(u.Z,{className:"text-blue-700",children:["• ",s,": $",r.toFixed(4)," per query"]},s)})]})]})]})})},H=r(10353),K=r(51653),D=r(5545),J=r(83669),G=r(29271),Y=r(89245);let W=e=>{var s,r;let{accessToken:t,oauthAccessToken:l,formValues:a,enabled:n=!0}=e,[i,o]=(0,f.useState)([]),[c,d]=(0,f.useState)(!1),[m,u]=(0,f.useState)(null),[x,h]=(0,f.useState)(null),[p,g]=(0,f.useState)(!1),j=a.auth_type===I.OAUTH2,v=!!(a.url&&a.transport&&a.auth_type&&t&&(!j||l)),y=JSON.stringify(null!==(s=a.static_headers)&&void 0!==s?s:{}),b=JSON.stringify(null!==(r=a.credentials)&&void 0!==r?r:{}),N=async()=>{if(t&&a.url&&(!j||l)){d(!0),u(null);try{let e=Array.isArray(a.static_headers)?a.static_headers.reduce((e,s)=>{var r;let t=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return t&&(e[t]=(null==s?void 0:s.value)!=null?String(s.value):""),e},{}):!Array.isArray(a.static_headers)&&a.static_headers&&"object"==typeof a.static_headers?Object.entries(a.static_headers).reduce((e,s)=>{let[r,t]=s;return r&&(e[r]=null!=t?String(t):""),e},{}):{},s=a.credentials&&"object"==typeof a.credentials?Object.entries(a.credentials).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,r={server_id:a.server_id||"",server_name:a.server_name||"",url:a.url,transport:a.transport,auth_type:a.auth_type,authorization_url:a.authorization_url,token_url:a.token_url,registration_url:a.registration_url,mcp_info:a.mcp_info,static_headers:e};s&&Object.keys(s).length>0&&(r.credentials=s);let n=await (0,_.testMCPToolsListRequest)(t,r,l);if(n.tools&&!n.error)o(n.tools),u(null),h(null),n.tools.length>0&&!p&&g(!0);else{let e=n.message||"Failed to retrieve tools list";u(e),h(n.stack_trace||null),o([]),g(!1)}}catch(e){console.error("Tools fetch error:",e),u(e instanceof Error?e.message:String(e)),h(null),o([]),g(!1)}finally{d(!1)}}},w=()=>{o([]),u(null),h(null),g(!1)};return(0,f.useEffect)(()=>{n&&(v?N():w())},[a.url,a.transport,a.auth_type,t,n,l,v,y,b]),{tools:i,isLoadingTools:c,toolsError:m,toolsErrorStackTrace:x,hasShownSuccessMessage:p,canFetchTools:v,fetchTools:N,clearTools:w}};var $=e=>{let{accessToken:s,oauthAccessToken:r,formValues:l,onToolsLoaded:a}=e,{tools:n,isLoadingTools:i,toolsError:o,toolsErrorStackTrace:c,canFetchTools:d,fetchTools:m}=W({accessToken:s,oauthAccessToken:r,formValues:l,enabled:!0});return((0,f.useEffect)(()=>{null==a||a(n)},[n,a]),d||l.url)?(0,t.jsx)(F.Z,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(J.Z,{className:"text-blue-600"}),(0,t.jsx)(x.Z,{children:"Connection Status"})]}),!d&&l.url&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(V.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(u.Z,{children:"Complete required fields to test connection"}),(0,t.jsx)("br",{}),(0,t.jsx)(u.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to test MCP server connection"})]}),d&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"text-gray-700 font-medium",children:i?"Testing connection to MCP server...":n.length>0?"Connection successful":o?"Connection failed":"Ready to test connection"}),(0,t.jsx)("br",{}),(0,t.jsxs)(u.Z,{className:"text-gray-500 text-sm",children:["Server: ",l.url]})]}),i&&(0,t.jsxs)("div",{className:"flex items-center text-blue-600",children:[(0,t.jsx)(H.Z,{size:"small",className:"mr-2"}),(0,t.jsx)(u.Z,{className:"text-blue-600",children:"Connecting..."})]}),!i&&!o&&n.length>0&&(0,t.jsxs)("div",{className:"flex items-center text-green-600",children:[(0,t.jsx)(J.Z,{className:"mr-1"}),(0,t.jsx)(u.Z,{className:"text-green-600 font-medium",children:"Connected"})]}),o&&(0,t.jsxs)("div",{className:"flex items-center text-red-600",children:[(0,t.jsx)(G.Z,{className:"mr-1"}),(0,t.jsx)(u.Z,{className:"text-red-600 font-medium",children:"Failed"})]})]}),i&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,t.jsx)(H.Z,{size:"large"}),(0,t.jsx)(u.Z,{className:"ml-3",children:"Testing connection and loading tools..."})]}),o&&(0,t.jsx)(K.Z,{message:"Connection Failed",description:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{children:o}),c&&(0,t.jsx)(q.default,{items:[{key:"stack-trace",label:"Stack Trace",children:(0,t.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontSize:"12px",fontFamily:"monospace",margin:0,padding:"8px",backgroundColor:"#f5f5f5",borderRadius:"4px",maxHeight:"400px",overflow:"auto"},children:c})}],style:{marginTop:"12px"}})]}),type:"error",showIcon:!0,action:(0,t.jsx)(D.ZP,{icon:(0,t.jsx)(Y.Z,{}),onClick:m,size:"small",children:"Retry"})}),!i&&0===n.length&&!o&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-500 border rounded-lg border-dashed",children:[(0,t.jsx)(J.Z,{className:"text-2xl mb-2 text-green-500"}),(0,t.jsx)(u.Z,{className:"text-green-600 font-medium",children:"Connection successful!"}),(0,t.jsx)("br",{}),(0,t.jsx)(u.Z,{className:"text-gray-500",children:"No tools found for this MCP server"})]})]})]})}):null},Q=r(61994),X=e=>{let{accessToken:s,oauthAccessToken:r,formValues:l,allowedTools:a,existingAllowedTools:n,onAllowedToolsChange:i}=e,o=(0,f.useRef)(0),{tools:c,isLoadingTools:d,toolsError:m,canFetchTools:h}=W({accessToken:s,oauthAccessToken:r,formValues:l,enabled:!0});(0,f.useEffect)(()=>{if(c.length>0&&c.length!==o.current&&0===a.length){if(n&&n.length>0){let e=c.map(e=>e.name);i(n.filter(s=>e.includes(s)))}else i(c.map(e=>e.name))}o.current=c.length},[c,a.length,n,i]);let p=e=>{a.includes(e)?i(a.filter(s=>s!==e)):i([...a,e])};return h||l.url?(0,t.jsx)(F.Z,{children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(V.Z,{className:"text-blue-600"}),(0,t.jsx)(x.Z,{children:"Tool Configuration"}),c.length>0&&(0,t.jsx)(R.Z,{count:c.length,style:{backgroundColor:"#52c41a"}})]})}),(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,t.jsxs)(u.Z,{className:"text-blue-800 text-sm",children:[(0,t.jsx)("strong",{children:"Select which tools users can call:"})," Only checked tools will be available for users to invoke. Unchecked tools will be blocked from execution."]})}),d&&(0,t.jsxs)("div",{className:"flex items-center justify-center py-6",children:[(0,t.jsx)(H.Z,{size:"large"}),(0,t.jsx)(u.Z,{className:"ml-3",children:"Loading tools..."})]}),m&&!d&&(0,t.jsxs)("div",{className:"text-center py-6 text-red-500 border rounded-lg border-dashed border-red-300 bg-red-50",children:[(0,t.jsx)(V.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(u.Z,{className:"text-red-600 font-medium",children:"Unable to load tools"}),(0,t.jsx)("br",{}),(0,t.jsx)(u.Z,{className:"text-sm text-red-500",children:m})]}),!d&&!m&&0===c.length&&h&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(V.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(u.Z,{children:"No tools available for configuration"}),(0,t.jsx)("br",{}),(0,t.jsx)(u.Z,{className:"text-sm",children:"Connect to an MCP server with tools to configure them"})]}),!h&&l.url&&(0,t.jsxs)("div",{className:"text-center py-6 text-gray-400 border rounded-lg border-dashed",children:[(0,t.jsx)(V.Z,{className:"text-2xl mb-2"}),(0,t.jsx)(u.Z,{children:"Complete required fields to configure tools"}),(0,t.jsx)("br",{}),(0,t.jsx)(u.Z,{className:"text-sm",children:"Fill in URL, Transport, and Authentication to load available tools"})]}),!d&&!m&&c.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 rounded-lg border border-green-200 flex-1",children:[(0,t.jsx)(J.Z,{className:"text-green-600"}),(0,t.jsxs)(u.Z,{className:"text-green-700 font-medium",children:[a.length," of ",c.length," ",1===c.length?"tool":"tools"," enabled for user access"]})]}),(0,t.jsxs)("div",{className:"flex gap-2 ml-3",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{i(c.map(e=>e.name))},className:"px-3 py-1.5 text-sm text-blue-600 hover:text-blue-700 hover:bg-blue-50 rounded-md transition-colors",children:"Enable All"}),(0,t.jsx)("button",{type:"button",onClick:()=>{i([])},className:"px-3 py-1.5 text-sm text-gray-600 hover:text-gray-700 hover:bg-gray-100 rounded-md transition-colors",children:"Disable All"})]})]}),(0,t.jsx)("div",{className:"space-y-2",children:c.map((e,s)=>(0,t.jsx)("div",{className:"p-4 rounded-lg border transition-colors cursor-pointer ".concat(a.includes(e.name)?"bg-blue-50 border-blue-300 hover:border-blue-400":"bg-gray-50 border-gray-200 hover:border-gray-300"),onClick:()=>p(e.name),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(Q.Z,{checked:a.includes(e.name),onChange:()=>p(e.name)}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.Z,{className:"font-medium text-gray-900",children:e.name}),(0,t.jsx)("span",{className:"px-2 py-0.5 text-xs rounded-full font-medium ".concat(a.includes(e.name)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:a.includes(e.name)?"Enabled":"Disabled"})]}),e.description&&(0,t.jsx)(u.Z,{className:"text-gray-500 text-sm block mt-1",children:e.description}),(0,t.jsx)(u.Z,{className:"text-gray-400 text-xs block mt-1",children:a.includes(e.name)?"✓ Users can call this tool":"✗ Users cannot call this tool"})]})]})},s))})]})]})}):null},ee=e=>{let{isVisible:s}=e;return s?(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Stdio Configuration (JSON)",(0,t.jsx)(g.Z,{title:"Paste your stdio MCP server configuration in JSON format. You can use the full mcpServers structure from config.yaml or just the inner server configuration.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"stdio_config",rules:[{required:!0,message:"Please enter stdio configuration"},{validator:(e,s)=>{if(!s)return Promise.resolve();try{return JSON.parse(s),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}],children:(0,t.jsx)(P.default.TextArea,{placeholder:'{\n "mcpServers": {\n "circleci-mcp-server": {\n "command": "npx",\n "args": ["-y", "@circleci/mcp-server-circleci"],\n "env": {\n "CIRCLECI_TOKEN": "your-circleci-token",\n "CIRCLECI_BASE_URL": "https://circleci.com"\n }\n }\n }\n}',rows:12,className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500 font-mono text-sm"})}):null},es=r(63709),er=r(58760),et=r(45246),el=r(96473);let{Panel:ea}=q.default;var en=e=>{var s;let{availableAccessGroups:r,mcpServer:l,searchValue:a,setSearchValue:n,getAccessGroupOptions:i}=e,o=A.Z.useFormInstance();return(0,f.useEffect)(()=>{if(l){if(l.extra_headers&&o.setFieldValue("extra_headers",l.extra_headers),l.static_headers){let e=Object.entries(l.static_headers).map(e=>{let[s,r]=e;return{header:s,value:null!=r?String(r):""}});o.setFieldValue("static_headers",e)}"boolean"==typeof l.allow_all_keys&&o.setFieldValue("allow_all_keys",l.allow_all_keys)}else o.setFieldValue("allow_all_keys",!1)},[l,o]),(0,t.jsx)(q.default,{className:"bg-gray-50 border border-gray-200 rounded-lg",expandIconPosition:"end",ghost:!1,children:(0,t.jsx)(ea,{header:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Permission Management / Access Control"})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 ml-4",children:"Configure access permissions and security settings (Optional)"})]}),className:"border-0",children:(0,t.jsxs)("div",{className:"space-y-6 pt-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Allow All LiteLLM Keys",(0,t.jsx)(g.Z,{title:"When enabled, every API key can access this MCP server.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),(0,t.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:'Enable if this server should be "public" to all keys.'})]}),(0,t.jsx)(A.Z.Item,{name:"allow_all_keys",valuePropName:"checked",initialValue:null!==(s=null==l?void 0:l.allow_all_keys)&&void 0!==s&&s,className:"mb-0",children:(0,t.jsx)(es.Z,{})})]}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Access Groups",(0,t.jsx)(g.Z,{title:"Specify access groups for this MCP server. Users must be in at least one of these groups to access the server.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"mcp_access_groups",className:"mb-4",children:(0,t.jsx)(p.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"value",filterOption:(e,s)=>{var r;return(null!==(r=null==s?void 0:s.value)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},onSearch:e=>n(e),tokenSeparators:[","],options:i(),maxTagCount:"responsive",allowClear:!0})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Extra Headers",(0,t.jsx)(g.Z,{title:"Forward custom headers from incoming requests to this MCP server (e.g., Authorization, X-Custom-Header, User-Agent)",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})}),(null==l?void 0:l.extra_headers)&&l.extra_headers.length>0&&(0,t.jsxs)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-1 rounded-full",children:[l.extra_headers.length," configured"]})]}),name:"extra_headers",children:(0,t.jsx)(p.default,{mode:"tags",placeholder:(null==l?void 0:l.extra_headers)&&l.extra_headers.length>0?"Currently: ".concat(l.extra_headers.join(", ")):"Enter header names (e.g., Authorization, X-Custom-Header)",className:"rounded-lg",size:"large",tokenSeparators:[","],allowClear:!0})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Static Headers",(0,t.jsx)(g.Z,{title:"Send these key-value headers with every request to this MCP server.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),required:!1,children:(0,t.jsx)(A.Z.List,{name:"static_headers",children:(e,s)=>{let{add:r,remove:l}=s;return(0,t.jsxs)("div",{className:"space-y-3",children:[e.map(e=>{let{key:s,name:r,...a}=e;return(0,t.jsxs)(er.Z,{className:"flex w-full",align:"baseline",size:"middle",children:[(0,t.jsx)(A.Z.Item,{...a,name:[r,"header"],className:"flex-1",rules:[{required:!0,message:"Header name is required"}],children:(0,t.jsx)(P.default,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header name (e.g., X-API-Key)"})}),(0,t.jsx)(A.Z.Item,{...a,name:[r,"value"],className:"flex-1",rules:[{required:!0,message:"Header value is required"}],children:(0,t.jsx)(P.default,{size:"large",allowClear:!0,className:"rounded-lg",placeholder:"Header value"})}),(0,t.jsx)(et.Z,{onClick:()=>l(r),className:"text-gray-500 hover:text-red-500 cursor-pointer"})]},s)}),(0,t.jsx)(D.ZP,{type:"dashed",onClick:()=>r(),icon:(0,t.jsx)(el.Z,{}),block:!0,children:"Add Static Header"})]})}})})]})},"permissions")})};let ei=e=>{try{let s=e.indexOf("/mcp/");if(-1===s)return{token:null,baseUrl:e};let r=e.split("/mcp/");if(2!==r.length)return{token:null,baseUrl:e};let t=r[0]+"/mcp/",l=r[1];if(!l)return{token:null,baseUrl:e};return{token:l,baseUrl:t}}catch(s){return console.error("Error parsing MCP URL:",s),{token:null,baseUrl:e}}},eo=e=>{let{token:s,baseUrl:r}=ei(e);return s?r+"...":e},ec=e=>{let{token:s}=ei(e);return{maskedUrl:eo(e),hasToken:!!s}},ed=e=>e?/^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(e)?Promise.resolve():Promise.reject("Please enter a valid URL (e.g., http://service-name.domain:1234/path or https://example.com)"):Promise.resolve(),em=e=>e&&e.includes("-")?Promise.reject("Server name cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve(),eu=e=>{let s=new Uint8Array(e),r="";return s.forEach(e=>r+=String.fromCharCode(e)),btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},ex=()=>{let e=new Uint8Array(32);return window.crypto.getRandomValues(e),eu(e.buffer)},eh=async e=>{let s=new TextEncoder().encode(e);return eu(await window.crypto.subtle.digest("SHA-256",s))},ep=e=>{let{accessToken:s,getCredentials:r,getTemporaryPayload:t,onTokenReceived:l,onBeforeRedirect:a}=e,[n,i]=(0,f.useState)("idle"),[o,c]=(0,f.useState)(null),[d,m]=(0,f.useState)(null),u="litellm-mcp-oauth-flow-state",x="litellm-mcp-oauth-result",h="litellm-mcp-oauth-return-url",p=()=>{try{window.sessionStorage.removeItem(u),window.sessionStorage.removeItem(x),window.sessionStorage.removeItem(h)}catch(e){console.warn("Failed to clear OAuth storage",e)}},g=()=>{{let e=window.location.pathname||"",s=e.indexOf("/ui"),r=(s>=0?e.slice(0,s+3):"").replace(/\/+$/,"");return"".concat(window.location.origin).concat(r,"/mcp/oauth/callback")}},j=()=>g(),v=(0,f.useCallback)(async()=>{let e=r()||{};if(!s){c("Missing admin token"),S.Z.error("Access token missing. Please re-authenticate and try again.");return}let l=t();if(!l||!l.url||!l.transport){let e="Please complete server URL and transport before starting OAuth.";c(e),S.Z.error(e);return}try{var n,o,d;i("authorizing"),c(null);let r=await (0,_.cacheTemporaryMcpServer)(s,l),t=null==r?void 0:null===(n=r.server_id)||void 0===n?void 0:n.trim();if(!t)throw Error("Temporary MCP server identifier missing. Please retry.");let m={};if(!((null===(o=l.credentials)||void 0===o?void 0:o.client_id)&&(null===(d=l.credentials)||void 0===d?void 0:d.client_secret))){let e=await (0,_.registerMcpOAuthClient)(s,t,{client_name:l.alias||l.server_name||t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:l.credentials&&l.credentials.client_secret?"client_secret_post":"none"});m={clientId:null==e?void 0:e.client_id,clientSecret:null==e?void 0:e.client_secret}}let x=ex(),p=await eh(x),g=crypto.randomUUID(),v=m.clientId||e.client_id,f=Array.isArray(e.scopes)?e.scopes.filter(e=>e&&e.trim().length>0).join(" "):void 0,y=(0,_.buildMcpOAuthAuthorizeUrl)({serverId:t,clientId:v,redirectUri:j(),state:g,codeChallenge:p,scope:f}),b={state:g,codeVerifier:x,clientId:v,clientSecret:m.clientSecret||e.client_secret,serverId:t,redirectUri:j()};if(a)try{a()}catch(e){console.error("Failed to prepare for OAuth redirect",e)}try{window.sessionStorage.setItem(u,JSON.stringify(b)),window.sessionStorage.setItem(h,window.location.href)}catch(e){throw console.error("Unable to persist OAuth state",e),Error("Unable to access browser storage for OAuth. Please enable storage and retry.")}window.location.href=y}catch(s){console.error("Failed to start OAuth flow",s),i("error");let e=s instanceof Error?s.message:String(s);c(e),S.Z.error(e)}},[s,r,t,a]),y=(0,f.useCallback)(async()=>{let e=null,s=null;try{let r=window.sessionStorage.getItem(x);if(!r)return;e=JSON.parse(r),s=JSON.parse(window.sessionStorage.getItem(u)||"null")}catch(e){console.error("Failed to read OAuth session state",e),p(),c("Failed to resume OAuth flow. Please retry."),i("error"),S.Z.error("Failed to resume OAuth flow. Please retry.");return}if(e){window.sessionStorage.removeItem(x);try{if(!s||!s.state||!s.codeVerifier||!s.serverId)throw Error("Missing OAuth session state. Please retry.");if(!e.state||e.state!==s.state)throw Error("OAuth state mismatch. Please retry.");if(e.error)throw Error(e.error_description||e.error);if(!e.code)throw Error("Authorization code missing in callback.");i("exchanging");let r=await (0,_.exchangeMcpOAuthToken)({serverId:s.serverId,code:e.code,clientId:s.clientId,clientSecret:s.clientSecret,codeVerifier:s.codeVerifier,redirectUri:s.redirectUri});l(r),m(r),i("success"),c(null),S.Z.success("OAuth token retrieved successfully")}catch(s){console.error("OAuth flow failed",s);let e=s instanceof Error?s.message:String(s);c(e),i("error"),S.Z.error(e)}finally{p()}}},[l]);return(0,f.useEffect)(()=>{let e=!1;return(async()=>{e||await y()})(),()=>{e=!0}},[y]),{startOAuthFlow:v,status:n,error:o,tokenResponse:d}},eg="".concat("../ui/assets/logos/","mcp_logo.png"),ej=[I.API_KEY,I.BEARER_TOKEN,I.BASIC],ev=[...ej,I.OAUTH2],ef="litellm-mcp-oauth-create-state";var ey=e=>{var s;let{userRole:r,accessToken:a,onCreateSuccess:n,isModalVisible:i,setModalVisible:o,availableAccessGroups:c}=e,[d]=A.Z.useForm(),[m,u]=(0,f.useState)(!1),[x,h]=(0,f.useState)({}),[v,y]=(0,f.useState)({}),[b,N]=(0,f.useState)(null),[w,Z]=(0,f.useState)(!1),[C,k]=(0,f.useState)([]),[T,L]=(0,f.useState)([]),[E,z]=(0,f.useState)(""),[q,R]=(0,f.useState)(""),[U,V]=(0,f.useState)(null),F=v.auth_type,H=!!F&&ej.includes(F),K=F===I.OAUTH2,{startOAuthFlow:D,status:J,error:G,tokenResponse:Y}=ep({accessToken:a,getCredentials:()=>d.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=d.getFieldsValue(!0),s=e.url,r=e.transport||E;if(!s||!r)return null;let t=Array.isArray(e.static_headers)?e.static_headers.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{};return{server_id:void 0,server_name:e.server_name,alias:e.alias,description:e.description,url:s,transport:r,auth_type:I.OAUTH2,credentials:e.credentials,authorization_url:e.authorization_url,token_url:e.token_url,registration_url:e.registration_url,mcp_access_groups:e.mcp_access_groups,static_headers:t,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{var s;V(null!==(s=null==e?void 0:e.access_token)&&void 0!==s?s:null)},onBeforeRedirect:()=>{try{let e=d.getFieldsValue(!0);window.sessionStorage.setItem(ef,JSON.stringify({modalVisible:i,formValues:e,transportType:E,costConfig:x,allowedTools:T,searchValue:q,aliasManuallyEdited:w}))}catch(e){console.warn("Failed to persist MCP create state",e)}}});f.useEffect(()=>{let e=window.sessionStorage.getItem(ef);if(e)try{var s;let r=JSON.parse(e);r.modalVisible&&o(!0);let t=(null===(s=r.formValues)||void 0===s?void 0:s.transport)||r.transportType||"";t&&z(t),r.formValues&&N({values:r.formValues,transport:t}),r.costConfig&&h(r.costConfig),r.allowedTools&&L(r.allowedTools),r.searchValue&&R(r.searchValue),"boolean"==typeof r.aliasManuallyEdited&&Z(r.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP create state",e)}finally{window.sessionStorage.removeItem(ef)}},[d,o]),f.useEffect(()=>{b&&(E||b.transport,(!b.transport||E)&&(d.setFieldsValue(b.values),y(b.values),N(null)))},[b,d,E]);let W=async e=>{u(!0);try{let{static_headers:s,stdio_config:r,credentials:t,allow_all_keys:l,...i}=e,c=i.mcp_access_groups,m=Array.isArray(s)?s.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{},u=t&&"object"==typeof t?Object.entries(t).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,p={};if(r&&"stdio"===E)try{let e=JSON.parse(r),s=e;if(e.mcpServers&&"object"==typeof e.mcpServers){let r=Object.keys(e.mcpServers);if(r.length>0){let t=r[0];s=e.mcpServers[t],i.server_name||(i.server_name=t.replace(/-/g,"_"))}}p={command:s.command,args:s.args,env:s.env},console.log("Parsed stdio config:",p)}catch(e){S.Z.fromBackend("Invalid JSON in stdio configuration");return}let g={...i,...p,stdio_config:void 0,mcp_info:{server_name:i.server_name||i.url,description:i.description,mcp_server_cost_info:Object.keys(x).length>0?x:null},mcp_access_groups:c,alias:i.alias,allowed_tools:T.length>0?T:null,allow_all_keys:!!l,static_headers:m};if(g.static_headers=m,i.auth_type&&ev.includes(i.auth_type)&&u&&Object.keys(u).length>0&&(g.credentials=u),console.log("Payload: ".concat(JSON.stringify(g))),null!=a){let e=await (0,_.createMCPServer)(a,g);S.Z.success("MCP Server created successfully"),d.resetFields(),h({}),k([]),L([]),Z(!1),o(!1),n(e)}}catch(e){S.Z.fromBackend("Error creating MCP Server: "+e)}finally{u(!1)}},Q=()=>{d.resetFields(),h({}),k([]),L([]),Z(!1),o(!1)};return(f.useEffect(()=>{if(!w&&v.server_name){let e=v.server_name.replace(/\s+/g,"_");d.setFieldsValue({alias:e}),y(s=>({...s,alias:e}))}},[v.server_name]),f.useEffect(()=>{i||y({})},[i]),(0,l.tY)(r))?(0,t.jsx)(j.Z,{title:(0,t.jsxs)("div",{className:"flex items-center space-x-3 pb-4 border-b border-gray-100",children:[(0,t.jsx)("img",{src:eg,alt:"MCP Logo",className:"w-8 h-8 object-contain",style:{height:"20px",width:"20px",marginRight:"8px",objectFit:"contain"}}),(0,t.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"Add New MCP Server"})]}),open:i,width:1e3,onCancel:Q,footer:null,className:"top-8",styles:{body:{padding:"24px"},header:{padding:"24px 24px 0 24px",border:"none"}},children:(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsxs)(A.Z,{form:d,onFinish:W,onValuesChange:(e,s)=>y(s),layout:"vertical",className:"space-y-6",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-6",children:[(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["MCP Server Name",(0,t.jsx)(g.Z,{title:"Best practice: Use a descriptive name that indicates the server's purpose (e.g., 'GitHub_MCP', 'Email_Service'). Hyphens '-' are not allowed; use underscores '_' instead.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"server_name",rules:[{required:!1,message:"Please enter a server name"},{validator:(e,s)=>em(s)}],children:(0,t.jsx)(O.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Alias",(0,t.jsx)(g.Z,{title:"A short, unique identifier for this server. Defaults to the server name with spaces replaced by underscores.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"alias",rules:[{required:!1},{validator:(e,s)=>s&&s.includes("-")?Promise.reject("Alias cannot contain '-' (hyphen). Please use '_' (underscore) instead."):Promise.resolve()}],children:(0,t.jsx)(O.o,{placeholder:"e.g., GitHub_MCP, Zapier_MCP, etc.",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500",onChange:()=>Z(!0)})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Description"}),name:"description",rules:[{required:!1,message:"Please enter a server description!!!!!!!!!"}],children:(0,t.jsx)(O.o,{placeholder:"Brief description of what this server does",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Transport Type"}),name:"transport",rules:[{required:!0,message:"Please select a transport type"}],children:(0,t.jsxs)(p.default,{placeholder:"Select transport",className:"rounded-lg",size:"large",onChange:e=>{z(e),"stdio"===e?d.setFieldsValue({url:void 0,auth_type:void 0,credentials:void 0}):d.setFieldsValue({command:void 0,args:void 0,env:void 0})},value:E,children:[(0,t.jsx)(p.default.Option,{value:"http",children:"HTTP"}),(0,t.jsx)(p.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,t.jsx)(p.default.Option,{value:"stdio",children:"Standard Input/Output (stdio)"})]})}),"stdio"!==E&&(0,t.jsx)(A.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"MCP Server URL"}),name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>ed(s)}],children:(0,t.jsx)(P.default,{placeholder:"https://your-mcp-server.com",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==E&&(0,t.jsx)(A.Z.Item,{label:(0,t.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Authentication"}),name:"auth_type",rules:[{required:!0,message:"Please select an auth type"}],children:(0,t.jsxs)(p.default,{placeholder:"Select auth type",className:"rounded-lg",size:"large",children:[(0,t.jsx)(p.default.Option,{value:"none",children:"None"}),(0,t.jsx)(p.default.Option,{value:"api_key",children:"API Key"}),(0,t.jsx)(p.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,t.jsx)(p.default.Option,{value:"basic",children:"Basic Auth"}),(0,t.jsx)(p.default.Option,{value:"oauth2",children:"OAuth"})]})}),"stdio"!==E&&H&&(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,t.jsx)(g.Z,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{required:!0,message:"Please enter the authentication value"}],children:(0,t.jsx)(O.o,{type:"password",placeholder:"Enter token or secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),"stdio"!==E&&K&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,t.jsx)(g.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,t.jsx)(O.o,{type:"password",placeholder:"Enter OAuth client ID",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,t.jsx)(g.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,t.jsx)(O.o,{type:"password",placeholder:"Enter OAuth client secret",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,t.jsx)(g.Z,{title:"Optional scopes requested during token exchange. Separate multiple scopes with enter or commas.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,t.jsx)(p.default,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authorization URL Override (optional)",(0,t.jsx)(g.Z,{title:"Optional override for the authorization endpoint.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"authorization_url",children:(0,t.jsx)(O.o,{placeholder:"https://example.com/oauth/authorize",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token URL Override (optional)",(0,t.jsx)(g.Z,{title:"Optional override for the token endpoint.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_url",children:(0,t.jsx)(O.o,{placeholder:"https://example.com/oauth/token",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Registration URL Override (optional)",(0,t.jsx)(g.Z,{title:"Optional orverride for the dynamic client registration endpoint.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"registration_url",children:(0,t.jsx)(O.o,{placeholder:"https://example.com/oauth/register",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Complete the OAuth authorization flow to fetch an access token and store it as the authentication value."}),(0,t.jsx)(O.z,{variant:"secondary",onClick:D,disabled:"authorizing"===J||"exchanging"===J,children:"authorizing"===J?"Waiting for authorization...":"exchanging"===J?"Exchanging authorization code...":"Authorize & Fetch Token"}),G&&(0,t.jsx)("p",{className:"text-sm text-red-500",children:G}),"success"===J&&(null==Y?void 0:Y.access_token)&&(0,t.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",null!==(s=Y.expires_in)&&void 0!==s?s:"?"," seconds."]})]})]}),(0,t.jsx)(ee,{isVisible:"stdio"===E})]}),(0,t.jsx)("div",{className:"mt-8",children:(0,t.jsx)(en,{availableAccessGroups:c,mcpServer:null,searchValue:q,setSearchValue:R,getAccessGroupOptions:()=>{let e=c.map(e=>({value:e,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})}));return q&&!c.some(e=>e.toLowerCase().includes(q.toLowerCase()))&&e.push({value:q,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:q}),(0,t.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,t.jsx)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:(0,t.jsx)($,{accessToken:a,oauthAccessToken:U,formValues:v,onToolsLoaded:k})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(X,{accessToken:a,oauthAccessToken:U,formValues:v,allowedTools:T,existingAllowedTools:null,onAllowedToolsChange:L})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(B,{value:x,onChange:h,tools:C.filter(e=>T.includes(e.name)),disabled:!1})}),(0,t.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6 border-t border-gray-100",children:[(0,t.jsx)(O.z,{variant:"secondary",onClick:Q,children:"Cancel"}),(0,t.jsx)(O.z,{variant:"primary",loading:m,children:m?"Creating...":"Add MCP Server"})]})]})})}):null},eb=r(5945),eN=r(64935),e_=r(30401),ew=r(78867),eZ=r(11239),eC=r(54001),eS=r(96137),ek=r(96362),eA=r(80221),eP=r(29202),eM=r(59872);let{Title:eO,Text:eI}=h.default,{Panel:eT}=q.default,eL=e=>{let{icon:s,title:r,description:l,children:a,serverName:n,accessGroups:i=["dev"]}=e,[o,c]=(0,f.useState)(!1),d=()=>{let e={"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"};if(o&&n){let s=[n.replace(/\s+/g,"_"),...i].join(",");e["x-mcp-servers"]=[s]}return e};return(0,t.jsxs)(eb.Z,{className:"border border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)("span",{className:"p-2 rounded-lg bg-gray-50",children:s}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eO,{level:5,className:"mb-0",children:r}),(0,t.jsx)(eI,{className:"text-gray-600",children:l})]})]}),n&&("Implementation Example"===r||"Configuration"===r)&&(0,t.jsxs)(A.Z.Item,{className:"mb-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(es.Z,{size:"small",checked:o,onChange:c}),(0,t.jsxs)(eI,{className:"text-sm",children:["Limit tools to specific MCP servers or MCP groups by passing the ",(0,t.jsx)("code",{children:"x-mcp-servers"})," header"]})]}),o&&(0,t.jsx)(K.Z,{className:"mt-2",type:"info",showIcon:!0,message:"Two Options",description:(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Option 1:"})," Get a specific server: ",(0,t.jsxs)("code",{children:['["',n.replace(/\s+/g,"_"),'"]']})]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Option 2:"})," Get a group of MCPs: ",(0,t.jsx)("code",{children:'["dev-group"]'})]}),(0,t.jsxs)("p",{className:"mt-2 text-sm text-gray-600",children:["You can also mix both: ",(0,t.jsx)("code",{children:'["Server1,dev-group"]'})]})]})})]}),f.Children.map(a,e=>{if(f.isValidElement(e)&&e.props.hasOwnProperty("code")&&e.props.hasOwnProperty("copyKey")){let s=e.props.code;if(s&&s.includes('"headers":'))return f.cloneElement(e,{code:s.replace(/"headers":\s*{[^}]*}/,'"headers": '.concat(JSON.stringify(d(),null,8)))})}return e})]})};var eE=e=>{let{currentServerAccessGroups:s=[]}=e,r=(0,_.getProxyBaseUrl)(),[l,a]=(0,f.useState)({}),[n,h]=(0,f.useState)({openai:[],litellm:[],cursor:[],http:[]}),[p]=(0,f.useState)("Zapier_MCP"),g=async(e,s)=>{await (0,eM.vQ)(e)&&(a(e=>({...e,[s]:!0})),setTimeout(()=>{a(e=>({...e,[s]:!1}))},2e3))},j=e=>{let{code:s,copyKey:r,title:a,className:n=""}=e;return(0,t.jsxs)("div",{className:"relative group",children:[a&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(eN.Z,{size:16,className:"text-blue-600"}),(0,t.jsx)(eI,{strong:!0,className:"text-gray-700",children:a})]}),(0,t.jsxs)(eb.Z,{className:"bg-gray-50 border border-gray-200 relative ".concat(n),children:[(0,t.jsx)(D.ZP,{type:"text",size:"small",icon:l[r]?(0,t.jsx)(e_.Z,{size:12}):(0,t.jsx)(ew.Z,{size:12}),onClick:()=>g(s,r),className:"absolute top-2 right-2 z-10 transition-all duration-200 ".concat(l[r]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),(0,t.jsx)("pre",{className:"text-sm overflow-x-auto pr-10 text-gray-800 font-mono leading-relaxed",children:s})]})]})},v=e=>{let{step:s,title:r,children:l}=e;return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("div",{className:"w-8 h-8 bg-blue-600 text-white rounded-full flex items-center justify-center text-sm font-semibold",children:s})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(eI,{strong:!0,className:"text-gray-800 block mb-2",children:r}),l]})]})};return(0,t.jsx)("div",{children:(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(x.Z,{className:"text-3xl font-bold text-gray-900 mb-3",children:"Connect to your MCP client"}),(0,t.jsx)(u.Z,{className:"text-lg text-gray-600",children:"Use tools directly from any MCP client with LiteLLM MCP. Enable your AI assistant to perform real-world tasks through a simple, secure connection."})]}),(0,t.jsxs)(o.Z,{className:"w-full",children:[(0,t.jsx)(c.Z,{className:"flex justify-start mt-8 mb-6",children:(0,t.jsxs)("div",{className:"flex bg-gray-100 p-1 rounded-lg",children:[(0,t.jsx)(i.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eN.Z,{size:18}),"OpenAI API"]})}),(0,t.jsx)(i.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eZ.Z,{size:18}),"LiteLLM Proxy"]})}),(0,t.jsx)(i.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eA.Z,{size:18}),"Cursor"]})}),(0,t.jsx)(i.Z,{className:"px-6 py-3 rounded-md transition-all duration-200",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(eP.Z,{size:18}),"Streamable HTTP"]})})]})}),(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(d.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-6 rounded-lg border border-blue-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eN.Z,{className:"text-blue-600",size:24}),(0,t.jsx)(eO,{level:4,className:"mb-0 text-blue-900",children:"OpenAI Responses API Integration"})]}),(0,t.jsx)(eI,{className:"text-blue-700",children:"Connect OpenAI Responses API to your LiteLLM MCP server for seamless tool integration"})]}),(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(eL,{icon:(0,t.jsx)(eC.Z,{className:"text-blue-600",size:16}),title:"API Key Setup",description:"Configure your OpenAI API key for authentication",children:(0,t.jsxs)(er.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsxs)(eI,{children:["Get your API key from the"," ",(0,t.jsxs)("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700 inline-flex items-center gap-1",children:["OpenAI platform ",(0,t.jsx)(ek.Z,{size:12})]})]})}),(0,t.jsx)(j,{title:"Environment Variable",code:'export OPENAI_API_KEY="sk-..."',copyKey:"openai-env"})]})}),(0,t.jsx)(eL,{icon:(0,t.jsx)(eS.Z,{className:"text-blue-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,t.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"openai-server-url"})}),(0,t.jsx)(eL,{icon:(0,t.jsx)(eN.Z,{className:"text-blue-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the Responses API",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,t.jsx)(j,{code:'curl --location \'https://api.openai.com/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $OPENAI_API_KEY" \\\n--data \'{\n "model": "gpt-4.1",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "'.concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"openai-curl",className:"text-xs"})})]})]}),{})}),(0,t.jsx)(d.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-green-50 p-6 rounded-lg border border-emerald-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eZ.Z,{className:"text-emerald-600",size:24}),(0,t.jsx)(eO,{level:4,className:"mb-0 text-emerald-900",children:"LiteLLM Proxy API Integration"})]}),(0,t.jsx)(eI,{className:"text-emerald-700",children:"Connect to LiteLLM Proxy Responses API for seamless tool integration with multiple model providers"})]}),(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(eL,{icon:(0,t.jsx)(eC.Z,{className:"text-emerald-600",size:16}),title:"Virtual Key Setup",description:"Configure your LiteLLM Proxy Virtual Key for authentication",children:(0,t.jsxs)(er.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsx)(eI,{children:"Get your Virtual Key from your LiteLLM Proxy dashboard or contact your administrator"})}),(0,t.jsx)(j,{title:"Environment Variable",code:'export LITELLM_API_KEY="sk-..."',copyKey:"litellm-env"})]})}),(0,t.jsx)(eL,{icon:(0,t.jsx)(eS.Z,{className:"text-emerald-600",size:16}),title:"MCP Server Information",description:"Connection details for your LiteLLM MCP server",children:(0,t.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"litellm-server-url"})}),(0,t.jsx)(eL,{icon:(0,t.jsx)(eN.Z,{className:"text-emerald-600",size:16}),title:"Implementation Example",description:"Complete cURL example for using the LiteLLM Proxy Responses API",serverName:p,accessGroups:["dev"],children:(0,t.jsx)(j,{code:"curl --location '".concat(r,'/v1/responses\' \\\n--header \'Content-Type: application/json\' \\\n--header "Authorization: Bearer $LITELLM_VIRTUAL_KEY" \\\n--data \'{\n "model": "gpt-4",\n "tools": [\n {\n "type": "mcp",\n "server_label": "litellm",\n "server_url": "').concat(r,'/mcp",\n "require_approval": "never",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_VIRTUAL_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n ],\n "input": "Run available tools",\n "tool_choice": "required"\n}\''),copyKey:"litellm-curl",className:"text-xs"})})]})]}),{})}),(0,t.jsx)(d.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-purple-50 to-blue-50 p-6 rounded-lg border border-purple-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eA.Z,{className:"text-purple-600",size:24}),(0,t.jsx)(eO,{level:4,className:"mb-0 text-purple-900",children:"Cursor IDE Integration"})]}),(0,t.jsx)(eI,{className:"text-purple-700",children:"Use tools directly from Cursor IDE with LiteLLM MCP. Enable your AI assistant to perform real-world tasks without leaving your coding environment."})]}),(0,t.jsxs)(eb.Z,{className:"border border-gray-200",children:[(0,t.jsx)(eO,{level:5,className:"mb-4 text-gray-800",children:"Setup Instructions"}),(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsx)(v,{step:1,title:"Open Cursor Settings",children:(0,t.jsxs)(eI,{className:"text-gray-600",children:["Use the keyboard shortcut ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"⇧+⌘+J"})," (Mac) or"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+Shift+J"})," (Windows/Linux)"]})}),(0,t.jsx)(v,{step:2,title:"Navigate to MCP Tools",children:(0,t.jsx)(eI,{className:"text-gray-600",children:'Go to the "MCP Tools" tab and click "New MCP Server"'})}),(0,t.jsxs)(v,{step:3,title:"Add Configuration",children:[(0,t.jsxs)(eI,{className:"text-gray-600 mb-3",children:["Copy the JSON configuration below and paste it into Cursor, then save with"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Cmd+S"})," or"," ",(0,t.jsx)("code",{className:"bg-gray-100 px-2 py-1 rounded",children:"Ctrl+S"})]}),(0,t.jsx)(eL,{icon:(0,t.jsx)(eN.Z,{className:"text-purple-600",size:16}),title:"Configuration",description:"Cursor MCP configuration",serverName:"Zapier Gmail",accessGroups:["dev"],children:(0,t.jsx)(j,{code:'{\n "mcpServers": {\n "Zapier_MCP": {\n "url": "'.concat(r,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer YOUR_LITELLM_API_KEY",\n "x-mcp-servers": ["Zapier_MCP,dev"]\n }\n }\n }\n}'),copyKey:"cursor-config",className:"text-xs"})})]})]})]})]}),{})}),(0,t.jsx)(d.Z,{className:"mt-6",children:(0,t.jsx)(()=>(0,t.jsxs)(er.Z,{direction:"vertical",size:"large",className:"w-full",children:[(0,t.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-teal-50 p-6 rounded-lg border border-green-100",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(eP.Z,{className:"text-green-600",size:24}),(0,t.jsx)(eO,{level:4,className:"mb-0 text-green-900",children:"Streamable HTTP Transport"})]}),(0,t.jsx)(eI,{className:"text-green-700",children:"Connect to LiteLLM MCP using HTTP transport. Compatible with any MCP client that supports HTTP streaming."})]}),(0,t.jsx)(eL,{icon:(0,t.jsx)(eP.Z,{className:"text-green-600",size:16}),title:"Universal MCP Connection",description:"Use this URL with any MCP client that supports HTTP transport",children:(0,t.jsxs)(er.Z,{direction:"vertical",size:"middle",className:"w-full",children:[(0,t.jsx)("div",{children:(0,t.jsx)(eI,{children:"Each MCP client supports different transports. Refer to your client documentation to determine the appropriate transport method."})}),(0,t.jsx)(j,{title:"Server URL",code:"".concat(r,"/mcp"),copyKey:"http-server-url"}),(0,t.jsx)(j,{title:"Headers Configuration",code:JSON.stringify({"x-litellm-api-key":"Bearer YOUR_LITELLM_API_KEY"},null,2),copyKey:"http-headers"}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(D.ZP,{type:"link",className:"p-0 h-auto text-blue-600 hover:text-blue-700",href:"https://modelcontextprotocol.io/docs/concepts/transports",icon:(0,t.jsx)(ek.Z,{size:14}),children:"Learn more about MCP transports"})})]})})]}),{})})]})]})]})})},ez=r(58927),eq=r(53410),eR=r(74998);let eU=(e,s,r,l,a)=>[{accessorKey:"server_id",header:"Server ID",cell:e=>{let{row:r}=e;return(0,t.jsxs)("button",{onClick:()=>s(r.original.server_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:[r.original.server_id.slice(0,7),"..."]})}},{accessorKey:"server_name",header:"Name"},{accessorKey:"alias",header:"Alias"},{id:"url",header:"URL",cell:e=>{let{row:s}=e,{maskedUrl:r}=ec(s.original.url);return(0,t.jsx)("span",{className:"font-mono text-sm",children:r})}},{accessorKey:"transport",header:"Transport",cell:e=>{let{getValue:s}=e;return(0,t.jsx)("span",{children:(s()||"http").toUpperCase()})}},{accessorKey:"auth_type",header:"Auth Type",cell:e=>{let{getValue:s}=e;return(0,t.jsx)("span",{children:s()||"none"})}},{id:"health_status",header:"Health Status",cell:e=>{let{row:s}=e,r=s.original,l=r.status||"unknown",n=r.last_health_check,i=r.health_check_error;if(a)return(0,t.jsxs)("div",{className:"flex items-center text-gray-500",children:[(0,t.jsxs)("svg",{className:"animate-spin h-4 w-4 mr-1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,t.jsx)("span",{className:"text-xs",children:"Loading..."})]});let o=(0,t.jsxs)("div",{className:"max-w-xs",children:[(0,t.jsxs)("div",{className:"font-semibold mb-1",children:["Health Status: ",l]}),n&&(0,t.jsxs)("div",{className:"text-xs mb-1",children:["Last Check: ",new Date(n).toLocaleString()]}),i&&(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("div",{className:"font-medium text-red-400 mb-1",children:"Error:"}),(0,t.jsx)("div",{className:"break-words",children:i})]}),!n&&!i&&(0,t.jsx)("div",{className:"text-xs text-gray-400",children:"No health check data available"})]});return(0,t.jsx)(g.Z,{title:o,placement:"top",children:(0,t.jsxs)("button",{className:"font-mono text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[10ch] ".concat((e=>{switch(e){case"healthy":return"text-green-500 bg-green-50 hover:bg-green-100";case"unhealthy":return"text-red-500 bg-red-50 hover:bg-red-100";default:return"text-gray-500 bg-gray-50 hover:bg-gray-100"}})(l)),children:[(0,t.jsx)("span",{className:"mr-1",children:"●"}),l.charAt(0).toUpperCase()+l.slice(1)]})})}},{id:"mcp_access_groups",header:"Access Groups",cell:e=>{let{row:s}=e,r=s.original.mcp_access_groups;if(Array.isArray(r)&&r.length>0&&"string"==typeof r[0]){let e=r.join(", ");return(0,t.jsx)(g.Z,{title:e,children:(0,t.jsx)("span",{className:"max-w-[200px] truncate block",children:e.length>30?"".concat(e.slice(0,30),"..."):e})})}return(0,t.jsx)("span",{className:"text-gray-400 italic",children:"None"})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,t.jsx)("span",{className:"text-xs",children:r.created_at?new Date(r.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,r=s.original;return(0,t.jsx)("span",{className:"text-xs",children:r.updated_at?new Date(r.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Z,{title:"Edit MCP Server",children:(0,t.jsx)(ez.J,{icon:eq.Z,size:"sm",onClick:()=>r(s.original.server_id),className:"cursor-pointer hover:text-blue-600"})}),(0,t.jsx)(g.Z,{title:"Delete MCP Server",children:(0,t.jsx)(ez.J,{icon:eR.Z,size:"sm",onClick:()=>l(s.original.server_id),className:"cursor-pointer hover:text-red-600"})})]})}}];var eV=r(10900),eF=r(82376),eB=r(71437),eH=r(67101),eK=r(47323),eD=r(49566);let eJ=[I.API_KEY,I.BEARER_TOKEN,I.BASIC],eG=[...eJ,I.OAUTH2],eY="litellm-mcp-oauth-edit-state";var eW=e=>{var s;let{mcpServer:r,accessToken:l,onCancel:a,onSuccess:u,availableAccessGroups:x}=e,[h]=A.Z.useForm(),[j,v]=(0,f.useState)({}),[y,b]=(0,f.useState)([]),[N,w]=(0,f.useState)(!1),[Z,C]=(0,f.useState)(""),[k,P]=(0,f.useState)(!1),[O,T]=(0,f.useState)([]),[L,E]=(0,f.useState)(null),z=A.Z.useWatch("auth_type",h),q=!!z&&eJ.includes(z),R=z===I.OAUTH2,[U,V]=(0,f.useState)(null),{startOAuthFlow:F,status:H,error:K,tokenResponse:J}=ep({accessToken:l,getCredentials:()=>h.getFieldValue("credentials"),getTemporaryPayload:()=>{let e=h.getFieldsValue(!0),s=e.url||r.url,t=e.transport||r.transport;if(!s||!t)return null;let l=Array.isArray(e.static_headers)?e.static_headers.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{};return{server_id:r.server_id,server_name:e.server_name||r.server_name||r.alias,alias:e.alias||r.alias,description:e.description||r.description,url:s,transport:t,auth_type:I.OAUTH2,credentials:e.credentials,mcp_access_groups:e.mcp_access_groups||r.mcp_access_groups,static_headers:l,command:e.command,args:e.args,env:e.env}},onTokenReceived:e=>{var s;V(null!==(s=null==e?void 0:e.access_token)&&void 0!==s?s:null)},onBeforeRedirect:()=>{try{let e=h.getFieldsValue(!0);window.sessionStorage.setItem(eY,JSON.stringify({serverId:r.server_id,formValues:e,costConfig:j,allowedTools:O,searchValue:Z,aliasManuallyEdited:k}))}catch(e){console.warn("Failed to persist MCP edit state",e)}}}),G=f.useMemo(()=>r.static_headers?Object.entries(r.static_headers).map(e=>{let[s,r]=e;return{header:s,value:null!=r?String(r):""}}):[],[r.static_headers]),Y=f.useMemo(()=>({...r,static_headers:G}),[r,G]);(0,f.useEffect)(()=>{var e;(null===(e=r.mcp_info)||void 0===e?void 0:e.mcp_server_cost_info)&&v(r.mcp_info.mcp_server_cost_info)},[r]),(0,f.useEffect)(()=>{r.allowed_tools&&T(r.allowed_tools)},[r]),(0,f.useEffect)(()=>{let e=window.sessionStorage.getItem(eY);if(e)try{let s=JSON.parse(e);if(!s||s.serverId!==r.server_id)return;s.formValues&&E({...r,...s.formValues}),s.costConfig&&v(s.costConfig),s.allowedTools&&T(s.allowedTools),s.searchValue&&C(s.searchValue),"boolean"==typeof s.aliasManuallyEdited&&P(s.aliasManuallyEdited)}catch(e){console.error("Failed to restore MCP edit state",e)}finally{window.sessionStorage.removeItem(eY)}},[h,r]),(0,f.useEffect)(()=>{if(!L)return;let e=L.transport||r.transport;if(e&&e!==h.getFieldValue("transport")){h.setFieldsValue({transport:e});return}h.setFieldsValue(L),E(null)},[L,h,r.transport]),(0,f.useEffect)(()=>{if(r.mcp_access_groups){let e=r.mcp_access_groups.map(e=>"string"==typeof e?e:e.name||String(e));h.setFieldValue("mcp_access_groups",e)}},[r]),(0,f.useEffect)(()=>{W()},[r,l,U]);let W=async()=>{if(l&&r.url&&(r.auth_type!==I.OAUTH2||U)){w(!0);try{let e={server_id:r.server_id,server_name:r.server_name,url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info,authorization_url:r.authorization_url,token_url:r.token_url,registration_url:r.registration_url},s=await (0,_.testMCPToolsListRequest)(l,e,U);s.tools&&!s.error?b(s.tools):(console.error("Failed to fetch tools:",s.message),b([]))}catch(e){console.error("Tools fetch error:",e),b([])}finally{w(!1)}}},$=async e=>{if(l)try{let{static_headers:s,credentials:t,allow_all_keys:a,...n}=e,i=(n.mcp_access_groups||[]).map(e=>"string"==typeof e?e:e.name||String(e)),o=Array.isArray(s)?s.reduce((e,s)=>{var r,t;let l=null==s?void 0:null===(r=s.header)||void 0===r?void 0:r.trim();return l&&(e[l]=null!==(t=null==s?void 0:s.value)&&void 0!==t?t:""),e},{}):{},c=t&&"object"==typeof t?Object.entries(t).reduce((e,s)=>{let[r,t]=s;if(null==t||""===t)return e;if("scopes"===r){if(Array.isArray(t)){let s=t.filter(e=>null!=e&&""!==e);s.length>0&&(e[r]=s)}}else e[r]=t;return e},{}):void 0,d={...n,server_id:r.server_id,mcp_info:{server_name:n.server_name||n.url,description:n.description,mcp_server_cost_info:Object.keys(j).length>0?j:null},mcp_access_groups:i,alias:n.alias,extra_headers:n.extra_headers||[],allowed_tools:O.length>0?O:null,disallowed_tools:n.disallowed_tools||[],static_headers:o,allow_all_keys:!!(null!=a?a:r.allow_all_keys)};n.auth_type&&eG.includes(n.auth_type)&&c&&Object.keys(c).length>0&&(d.credentials=c);let m=await (0,_.updateMCPServer)(l,d);S.Z.success("MCP Server updated successfully"),u(m)}catch(e){S.Z.fromBackend("Failed to update MCP Server"+((null==e?void 0:e.message)?": ".concat(e.message):""))}};return(0,t.jsxs)(o.Z,{children:[(0,t.jsxs)(c.Z,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(i.Z,{children:"Server Configuration"}),(0,t.jsx)(i.Z,{children:"Cost Configuration"})]}),(0,t.jsxs)(m.Z,{className:"mt-6",children:[(0,t.jsx)(d.Z,{children:(0,t.jsxs)(A.Z,{form:h,onFinish:$,initialValues:Y,layout:"vertical",children:[(0,t.jsx)(A.Z.Item,{label:"MCP Server Name",name:"server_name",rules:[{validator:(e,s)=>em(s)}],children:(0,t.jsx)(eD.Z,{})}),(0,t.jsx)(A.Z.Item,{label:"Alias",name:"alias",rules:[{validator:(e,s)=>em(s)}],children:(0,t.jsx)(eD.Z,{onChange:()=>P(!0)})}),(0,t.jsx)(A.Z.Item,{label:"Description",name:"description",children:(0,t.jsx)(eD.Z,{})}),(0,t.jsx)(A.Z.Item,{label:"MCP Server URL",name:"url",rules:[{required:!0,message:"Please enter a server URL"},{validator:(e,s)=>ed(s)}],children:(0,t.jsx)(eD.Z,{})}),(0,t.jsx)(A.Z.Item,{label:"Transport Type",name:"transport",rules:[{required:!0}],children:(0,t.jsxs)(p.default,{children:[(0,t.jsx)(p.default.Option,{value:"sse",children:"Server-Sent Events (SSE)"}),(0,t.jsx)(p.default.Option,{value:"http",children:"HTTP"})]})}),(0,t.jsx)(A.Z.Item,{label:"Authentication",name:"auth_type",rules:[{required:!0}],children:(0,t.jsxs)(p.default,{children:[(0,t.jsx)(p.default.Option,{value:"none",children:"None"}),(0,t.jsx)(p.default.Option,{value:"api_key",children:"API Key"}),(0,t.jsx)(p.default.Option,{value:"bearer_token",children:"Bearer Token"}),(0,t.jsx)(p.default.Option,{value:"basic",children:"Basic Auth"}),(0,t.jsx)(p.default.Option,{value:"oauth2",children:"OAuth"})]})}),q&&(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authentication Value",(0,t.jsx)(g.Z,{title:"Token, password, or header value to send with each request for the selected auth type.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","auth_value"],rules:[{validator:(e,s)=>s&&"string"==typeof s&&""===s.trim()?Promise.reject(Error("Authentication value cannot be empty")):Promise.resolve()}],children:(0,t.jsx)(eD.Z,{type:"password",placeholder:"Enter token or secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),R&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client ID (optional)",(0,t.jsx)(g.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_id"],children:(0,t.jsx)(eD.Z,{type:"password",placeholder:"Enter OAuth client ID (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Client Secret (optional)",(0,t.jsx)(g.Z,{title:"Provide only if your MCP server cannot handle dynamic client registration.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","client_secret"],children:(0,t.jsx)(eD.Z,{type:"password",placeholder:"Enter OAuth client secret (leave blank to keep existing)",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["OAuth Scopes (optional)",(0,t.jsx)(g.Z,{title:"Add scopes to override the default scope list used for this MCP server.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:["credentials","scopes"],children:(0,t.jsx)(p.default,{mode:"tags",tokenSeparators:[","],placeholder:"Add scopes",className:"rounded-lg",size:"large"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Authorization URL Override (optional)",(0,t.jsx)(g.Z,{title:"Optional override for the authorization endpoint.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"authorization_url",children:(0,t.jsx)(eD.Z,{placeholder:"https://example.com/oauth/authorize",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Token URL Override (optional)",(0,t.jsx)(g.Z,{title:"Optional override for the token endpoint.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"token_url",children:(0,t.jsx)(eD.Z,{placeholder:"https://example.com/oauth/token",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:["Registration URL Override (optional)",(0,t.jsx)(g.Z,{title:"Optional override for the dynamic client registration endpoint.",children:(0,t.jsx)(M.Z,{className:"ml-2 text-blue-400 hover:text-blue-600 cursor-help"})})]}),name:"registration_url",children:(0,t.jsx)(eD.Z,{placeholder:"https://example.com/oauth/register",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})}),(0,t.jsxs)("div",{className:"rounded-lg border border-dashed border-gray-300 p-4 space-y-2",children:[(0,t.jsx)("p",{className:"text-sm text-gray-600",children:"Use OAuth to fetch a fresh access token and save it as the authentication value."}),(0,t.jsx)(n.Z,{variant:"secondary",onClick:F,disabled:"authorizing"===H||"exchanging"===H,children:"authorizing"===H?"Waiting for authorization...":"exchanging"===H?"Exchanging authorization code...":"Authorize & Fetch Token"}),K&&(0,t.jsx)("p",{className:"text-sm text-red-500",children:K}),"success"===H&&(null==J?void 0:J.access_token)&&(0,t.jsxs)("p",{className:"text-sm text-green-600",children:["Token fetched. Expires in ",null!==(s=J.expires_in)&&void 0!==s?s:"?"," seconds."]})]})]}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(en,{availableAccessGroups:x,mcpServer:r,searchValue:Z,setSearchValue:C,getAccessGroupOptions:()=>{let e=x.map(e=>({value:e,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})}));return Z&&!x.some(e=>e.toLowerCase().includes(Z.toLowerCase()))&&e.push({value:Z,label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:Z}),(0,t.jsx)("span",{className:"text-gray-400 text-xs ml-1",children:"create new group"})]})}),e}})}),(0,t.jsx)("div",{className:"mt-6",children:(0,t.jsx)(X,{accessToken:l,oauthAccessToken:U,formValues:{server_id:r.server_id,server_name:r.server_name,url:r.url,transport:r.transport,auth_type:r.auth_type,mcp_info:r.mcp_info},allowedTools:O,existingAllowedTools:r.allowed_tools||null,onAllowedToolsChange:T})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(D.ZP,{onClick:a,children:"Cancel"}),(0,t.jsx)(n.Z,{type:"submit",children:"Save Changes"})]})]})}),(0,t.jsx)(d.Z,{children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)(B,{value:j,onChange:v,tools:y,disabled:N}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(D.ZP,{onClick:a,children:"Cancel"}),(0,t.jsx)(n.Z,{onClick:()=>h.submit(),children:"Save Changes"})]})]})})]})]})},e$=r(92280),eQ=e=>{let{costConfig:s}=e,r=(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null,l=(null==s?void 0:s.tool_name_to_cost_per_query)&&Object.keys(s.tool_name_to_cost_per_query).length>0;return r||l?(0,t.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,t.jsxs)("div",{className:"space-y-4",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,t.jsxs)("div",{children:[(0,t.jsx)(e$.x,{className:"font-medium",children:"Default Cost per Query"}),(0,t.jsxs)("div",{className:"text-green-600 font-mono",children:["$",s.default_cost_per_query.toFixed(4)]})]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,t.jsxs)("div",{children:[(0,t.jsx)(e$.x,{className:"font-medium",children:"Tool-Specific Costs"}),(0,t.jsx)("div",{className:"mt-2 space-y-2",children:Object.entries(s.tool_name_to_cost_per_query).map(e=>{let[s,r]=e;return null!=r&&(0,t.jsxs)("div",{className:"flex justify-between items-center p-3 bg-gray-50 rounded-lg",children:[(0,t.jsx)(e$.x,{className:"font-medium",children:s}),(0,t.jsxs)(e$.x,{className:"text-green-600 font-mono",children:["$",r.toFixed(4)," per query"]})]},s)})})]}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:[(0,t.jsx)(e$.x,{className:"text-blue-800 font-medium",children:"Cost Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[r&&(null==s?void 0:s.default_cost_per_query)!==void 0&&(null==s?void 0:s.default_cost_per_query)!==null&&(0,t.jsxs)(e$.x,{className:"text-blue-700",children:["• Default cost: $",s.default_cost_per_query.toFixed(4)," per query"]}),l&&(null==s?void 0:s.tool_name_to_cost_per_query)&&(0,t.jsxs)(e$.x,{className:"text-blue-700",children:["• ",Object.keys(s.tool_name_to_cost_per_query).length," tool(s) with custom pricing"]})]})]})]})}):(0,t.jsx)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsx)("div",{className:"p-4 bg-gray-50 border border-gray-200 rounded-lg",children:(0,t.jsx)(e$.x,{className:"text-gray-600",children:"No cost configuration set for this server. Tool calls will be charged at $0.00 per tool call."})})})})};let eX=e=>{var s,r,l,a,h;let{mcpServer:p,onBack:g,isEditing:j,isProxyAdmin:v,accessToken:y,userRole:b,userID:N,availableAccessGroups:_}=e,[w,Z]=(0,f.useState)(j),[C,S]=(0,f.useState)(!1),[k,A]=(0,f.useState)({}),{maskedUrl:P,hasToken:M}=ec(p.url),O=(e,s)=>M?s?e:P:e,I=async(e,s)=>{await (0,eM.vQ)(e)&&(A(e=>({...e,[s]:!0})),setTimeout(()=>{A(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4 max-w-full",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(n.Z,{icon:eV.Z,variant:"light",className:"mb-4",onClick:g,children:"Back to All Servers"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(x.Z,{children:p.server_name}),(0,t.jsx)(D.ZP,{type:"text",size:"small",icon:k["mcp-server_name"]?(0,t.jsx)(e_.Z,{size:12}):(0,t.jsx)(ew.Z,{size:12}),onClick:()=>I(p.server_name,"mcp-server_name"),className:"left-2 z-10 transition-all duration-200 ".concat(k["mcp-server_name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")}),p.alias&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"ml-4 text-gray-500",children:"Alias:"}),(0,t.jsx)("span",{className:"ml-1 font-mono text-blue-600",children:p.alias}),(0,t.jsx)(D.ZP,{type:"text",size:"small",icon:k["mcp-alias"]?(0,t.jsx)(e_.Z,{size:12}):(0,t.jsx)(ew.Z,{size:12}),onClick:()=>I(p.alias,"mcp-alias"),className:"left-2 z-10 transition-all duration-200 ".concat(k["mcp-alias"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(u.Z,{className:"text-gray-500 font-mono",children:p.server_id}),(0,t.jsx)(D.ZP,{type:"text",size:"small",icon:k["mcp-server-id"]?(0,t.jsx)(e_.Z,{size:12}):(0,t.jsx)(ew.Z,{size:12}),onClick:()=>I(p.server_id,"mcp-server-id"),className:"left-2 z-10 transition-all duration-200 ".concat(k["mcp-server-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,t.jsxs)(o.Z,{defaultIndex:w?2:0,children:[(0,t.jsx)(c.Z,{className:"mb-4",children:[(0,t.jsx)(i.Z,{children:"Overview"},"overview"),(0,t.jsx)(i.Z,{children:"MCP Tools"},"tools"),...v?[(0,t.jsx)(i.Z,{children:"Settings"},"settings")]:[]]}),(0,t.jsxs)(m.Z,{children:[(0,t.jsxs)(d.Z,{children:[(0,t.jsxs)(eH.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(u.Z,{children:"Transport"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(x.Z,{children:L(null!==(a=p.transport)&&void 0!==a?a:void 0)})})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(u.Z,{children:"Auth Type"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(u.Z,{children:E(null!==(h=p.auth_type)&&void 0!==h?h:void 0)})})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(u.Z,{children:"Host Url"}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(u.Z,{className:"break-all overflow-wrap-anywhere",children:O(p.url,C)}),M&&(0,t.jsx)("button",{onClick:()=>S(!C),className:"p-1 hover:bg-gray-100 rounded",children:(0,t.jsx)(eK.Z,{icon:C?eF.Z:eB.Z,size:"sm",className:"text-gray-500"})})]})]})]}),(0,t.jsxs)(F.Z,{className:"mt-2",children:[(0,t.jsx)(x.Z,{children:"Cost Configuration"}),(0,t.jsx)(eQ,{costConfig:null===(s=p.mcp_info)||void 0===s?void 0:s.mcp_server_cost_info})]})]}),(0,t.jsx)(d.Z,{children:(0,t.jsx)(ss,{serverId:p.server_id,accessToken:y,auth_type:p.auth_type,userRole:b,userID:N,serverAlias:p.alias})}),(0,t.jsx)(d.Z,{children:(0,t.jsxs)(F.Z,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(x.Z,{children:"MCP Server Settings"}),w?null:(0,t.jsx)(n.Z,{variant:"light",onClick:()=>Z(!0),children:"Edit Settings"})]}),w?(0,t.jsx)(eW,{mcpServer:p,accessToken:y,onCancel:()=>Z(!1),onSuccess:e=>{Z(!1),g()},availableAccessGroups:_}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Server Name"}),(0,t.jsx)("div",{children:p.server_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Alias"}),(0,t.jsx)("div",{children:p.alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Description"}),(0,t.jsx)("div",{children:p.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"URL"}),(0,t.jsxs)("div",{className:"font-mono break-all overflow-wrap-anywhere max-w-full flex items-center gap-2",children:[O(p.url,C),M&&(0,t.jsx)("button",{onClick:()=>S(!C),className:"p-1 hover:bg-gray-100 rounded",children:(0,t.jsx)(eK.Z,{icon:C?eF.Z:eB.Z,size:"sm",className:"text-gray-500"})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Transport"}),(0,t.jsx)("div",{children:L(p.transport)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Extra Headers"}),(0,t.jsx)("div",{children:null===(r=p.extra_headers)||void 0===r?void 0:r.join(", ")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Auth Type"}),(0,t.jsx)("div",{children:E(p.auth_type)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Allow All LiteLLM Keys"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[p.allow_all_keys?(0,t.jsx)("span",{className:"px-2 py-1 bg-green-50 text-green-700 rounded-md text-sm",children:"Enabled"}):(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 text-gray-600 rounded-md text-sm",children:"Disabled"}),p.allow_all_keys&&(0,t.jsx)(u.Z,{className:"text-xs text-gray-500",children:"All keys can access this MCP server"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Access Groups"}),(0,t.jsx)("div",{children:p.mcp_access_groups&&p.mcp_access_groups.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:p.mcp_access_groups.map((e,s)=>{var r;return(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded-md text-sm",children:"string"==typeof e?e:null!==(r=null==e?void 0:e.name)&&void 0!==r?r:""},s)})}):(0,t.jsx)(u.Z,{className:"text-gray-500",children:"No access groups defined"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Allowed Tools"}),(0,t.jsx)("div",{children:p.allowed_tools&&p.allowed_tools.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:p.allowed_tools.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-50 border border-blue-200 rounded-md text-sm",children:e},s))}):(0,t.jsx)(u.Z,{className:"text-gray-500",children:"All tools enabled"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{className:"font-medium",children:"Cost Configuration"}),(0,t.jsx)(eQ,{costConfig:null===(l=p.mcp_info)||void 0===l?void 0:l.mcp_server_cost_info})]})]})]})})]})]})]})},{Text:e0,Title:e2}=h.default,{Option:e1}=p.default;var e4=e=>{let{accessToken:s,userRole:r,userID:h}=e,{data:b,isLoading:N,refetch:w}=(0,y.F)(),{data:Z,isLoading:A}=C((0,f.useMemo)(()=>null==b?void 0:b.map(e=>e.server_id),[b])),P=(0,f.useMemo)(()=>{if(!b)return[];if(!Z)return b;let e=new Map(Z.map(e=>[e.server_id,e.status]));return b.map(s=>{let r=e.get(s.server_id);return{...s,status:r||s.status}})},[b,Z]);f.useEffect(()=>{b&&(console.log("MCP Servers fetched:",b),b.forEach(e=>{console.log("Server: ".concat(e.server_name||e.server_id)),console.log(" allowed_tools:",e.allowed_tools)}))},[b]);let[M,O]=(0,f.useState)(null),[I,T]=(0,f.useState)(!1),[L,E]=(0,f.useState)(null),[z,q]=(0,f.useState)(!1),[R,U]=(0,f.useState)("all"),[V,F]=(0,f.useState)("all"),[B,H]=(0,f.useState)([]),[K,D]=(0,f.useState)(!1),[J,G]=(0,f.useState)(!1),Y="Internal User"===r;(0,f.useEffect)(()=>{try{let e=window.sessionStorage.getItem("litellm-mcp-oauth-edit-state");if(!e)return;let s=JSON.parse(e);(null==s?void 0:s.serverId)&&(E(s.serverId),q(!0))}catch(e){console.error("Failed to restore MCP edit view state",e)}},[]);let W=f.useMemo(()=>{if(!P)return[];let e=new Set,s=[];return P.forEach(r=>{r.teams&&r.teams.forEach(r=>{let t=r.team_id;e.has(t)||(e.add(t),s.push(r))})}),s},[P]),$=f.useMemo(()=>P?Array.from(new Set(P.flatMap(e=>e.mcp_access_groups).filter(e=>null!=e))):[],[P]),Q=e=>{U(e),ee(e,V)},X=e=>{F(e),ee(R,e)},ee=(e,s)=>{if(!P)return H([]);let r=P;if("personal"===e){H([]);return}"all"!==e&&(r=r.filter(s=>{var r;return null===(r=s.teams)||void 0===r?void 0:r.some(s=>s.team_id===e)})),"all"!==s&&(r=r.filter(e=>{var r;return null===(r=e.mcp_access_groups)||void 0===r?void 0:r.some(e=>"string"==typeof e?e===s:e&&e.name===s)})),H(r)};(0,f.useEffect)(()=>{ee(R,V)},[P,R,V]);let es=f.useMemo(()=>eU(null!=r?r:"",e=>{E(e),q(!1)},e=>{E(e),q(!0)},er,A),[r,A]);function er(e){O(e),T(!0)}let et=async()=>{if(null!=M&&null!=s)try{G(!0),await (0,_.deleteMCPServer)(s,M),S.Z.success("Deleted MCP Server successfully"),w()}catch(e){console.error("Error deleting the mcp server:",e)}finally{G(!1),T(!1),O(null)}},el=M?(b||[]).find(e=>e.server_id===M):null;return s&&r&&h?(0,t.jsxs)("div",{className:"w-full h-full p-6",children:[(0,t.jsx)(j.Z,{open:I,title:"Delete MCP Server?",onOk:et,okText:J?"Deleting...":"Delete",onCancel:()=>{T(!1),O(null)},cancelText:"Cancel",cancelButtonProps:{disabled:J},okButtonProps:{danger:!0},confirmLoading:J,children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(e0,{children:"Are you sure you want to delete this MCP Server? This action cannot be undone."}),el&&(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(e2,{level:5,className:"mb-3 text-gray-900",children:"Server Information"}),(0,t.jsxs)(v.Z,{column:1,size:"small",children:[el.server_name&&(0,t.jsx)(v.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Server Name"}),children:(0,t.jsx)(e0,{className:"text-sm",children:el.server_name})}),el.alias&&(0,t.jsx)(v.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Alias"}),children:(0,t.jsx)(e0,{className:"text-sm",children:el.alias})}),(0,t.jsx)(v.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"Server ID"}),children:(0,t.jsx)(e0,{code:!0,className:"text-sm",children:el.server_id})}),(0,t.jsx)(v.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:"URL"}),children:(0,t.jsx)(e0,{code:!0,className:"text-sm",children:el.url})})]})]})]})}),(0,t.jsx)(ey,{userRole:r,accessToken:s,onCreateSuccess:e=>{H(s=>[...s,e]),D(!1)},isModalVisible:K,setModalVisible:D,availableAccessGroups:$}),(0,t.jsx)(x.Z,{children:"MCP Servers"}),(0,t.jsx)(u.Z,{className:"text-tremor-content mt-2",children:"Configure and manage your MCP servers"}),(0,l.tY)(r)&&(0,t.jsx)(n.Z,{className:"mt-4 mb-4",onClick:()=>D(!0),children:"+ Add New MCP Server"}),(0,t.jsxs)(o.Z,{className:"w-full h-full",children:[(0,t.jsx)(c.Z,{className:"flex justify-between mt-2 w-full items-center",children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(i.Z,{children:"All Servers"}),(0,t.jsx)(i.Z,{children:"Connect"})]})}),(0,t.jsxs)(m.Z,{children:[(0,t.jsx)(d.Z,{children:(0,t.jsx)(()=>L?(0,t.jsx)(eX,{mcpServer:B.find(e=>e.server_id===L)||{server_id:"",server_name:"",alias:"",url:"",transport:"",auth_type:"",created_at:"",created_by:"",updated_at:"",updated_by:""},onBack:()=>{q(!1),E(null),w()},isProxyAdmin:(0,l.tY)(r),isEditing:z,accessToken:s,userID:h,userRole:r,availableAccessGroups:$}):(0,t.jsxs)("div",{className:"w-full h-full",children:[(0,t.jsx)("div",{className:"w-full px-6",children:(0,t.jsx)("div",{className:"flex flex-col space-y-4",children:(0,t.jsx)("div",{className:"flex items-center justify-between bg-gray-50 rounded-lg p-4 border-2 border-gray-200",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(u.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,t.jsxs)(p.default,{value:R,onChange:Q,style:{width:300},children:[(0,t.jsx)(e1,{value:"all",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:Y?"All Available Servers":"All Servers"})]})}),(0,t.jsx)(e1,{value:"personal",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:"Personal"})]})}),W.map(e=>(0,t.jsx)(e1,{value:e.team_id,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e.team_alias||e.team_id})]})},e.team_id))]}),(0,t.jsxs)(u.Z,{className:"text-lg font-semibold text-gray-900 ml-6",children:["Access Group:",(0,t.jsx)(g.Z,{title:"An MCP Access Group is a set of users or teams that have permission to access specific MCP servers. Use access groups to control and organize who can connect to which servers.",children:(0,t.jsx)(a.Z,{style:{marginLeft:4,color:"#888"}})})]}),(0,t.jsxs)(p.default,{value:V,onChange:X,style:{width:300},children:[(0,t.jsx)(e1,{value:"all",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-blue-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:"All Access Groups"})]})}),$.map(e=>(0,t.jsx)(e1,{value:e,children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),(0,t.jsx)("span",{className:"font-medium",children:e})]})},e))]})]})})})}),(0,t.jsx)("div",{className:"w-full px-6 mt-6",children:(0,t.jsx)(k.w,{data:B,columns:es,renderSubComponent:()=>(0,t.jsx)("div",{}),getRowCanExpand:()=>!1,isLoading:N,noDataMessage:"No MCP servers configured",loadingMessage:"\uD83D\uDE85 Loading MCP servers..."})})]}),{})}),(0,t.jsx)(d.Z,{children:(0,t.jsx)(eE,{})})]})]})]}):(console.log("Missing required authentication parameters",{accessToken:s,userRole:r,userID:h}),(0,t.jsx)("div",{className:"p-6 text-center text-gray-500",children:"Missing required authentication parameters."}))},e5=r(21770);let e6=e=>"object"==typeof e&&null!==e&&!Array.isArray(e);function e3(e){if(!e)return[];if(Array.isArray(e))return e.map(e=>e7(e)).filter(e=>void 0!==e);let s=e7(e);return void 0===s?[]:[s]}function e7(e,s){if(!e)return;let r=void 0!==s?s:e.default;if("object"===e.type){let s=e6(r)?{...r}:{};return e.properties&&Object.entries(e.properties).forEach(e=>{let[r,t]=e;s[r]=e7(t,s[r])}),s}if("array"===e.type){if(Array.isArray(r)){let s=e.items;if(!s)return r;if(0===r.length){let e=e3(s);return e.length?e:r}return Array.isArray(s)?r.map((e,r)=>{var t;return e7(null!==(t=s[r])&&void 0!==t?t:s[s.length-1],e)}):r.map(e=>e7(s,e))}return void 0!==r?r:e3(e.items)}if(void 0!==r)return r;switch(e.type){case"integer":case"number":return 0;case"boolean":return!1;default:return""}}let e8=e=>{let s=e7(e);if("object"===e.type||"array"===e.type){let r="array"===e.type?[]:{};return JSON.stringify(null!=s?s:r,null,2)}return s};function e9(e){let{tool:s,onSubmit:r,isLoading:l,result:a,error:n,onClose:i}=e,[o]=A.Z.useForm(),[c,d]=f.useState("formatted"),[m,u]=f.useState(null),[x,h]=f.useState(null),p=f.useMemo(()=>"string"==typeof s.inputSchema?{type:"object",properties:{input:{type:"string",description:"Input for this tool"}},required:["input"]}:s.inputSchema,[s.inputSchema]),j=f.useMemo(()=>p.properties&&p.properties.params&&"object"===p.properties.params.type&&p.properties.params.properties?{type:"object",properties:p.properties.params.properties,required:p.properties.params.required||[]}:p,[p]);f.useEffect(()=>{if(o.resetFields(),!j.properties)return;let e={};Object.entries(j.properties).forEach(s=>{let[r,t]=s;e[r]=e8(t)}),o.setFieldsValue(e)},[o,j,s]),f.useEffect(()=>{m&&(a||n)&&h(Date.now()-m)},[a,n,m]);let v=async e=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0;{let s=document.createElement("textarea");s.value=e,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();let r=document.execCommand("copy");if(document.body.removeChild(s),!r)throw Error("execCommand failed");return!0}}catch(e){return console.error("Copy failed:",e),!1}},y=async()=>{await v(JSON.stringify(a,null,2))?S.Z.success("Result copied to clipboard"):S.Z.fromBackend("Failed to copy result")},b=async()=>{await v(s.name)?S.Z.success("Tool name copied to clipboard"):S.Z.fromBackend("Failed to copy tool name")};return(0,t.jsxs)("div",{className:"space-y-4 h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 border-b border-gray-200",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[s.mcp_info.logo_url&&(0,t.jsx)("img",{src:s.mcp_info.logo_url,alt:"".concat(s.mcp_info.server_name," logo"),className:"w-6 h-6 object-contain"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:"Test Tool:"}),(0,t.jsxs)("div",{className:"group inline-flex items-center space-x-1 bg-slate-50 hover:bg-slate-100 px-3 py-1 rounded-md cursor-pointer transition-colors border border-slate-200",onClick:b,title:"Click to copy tool name",children:[(0,t.jsx)("span",{className:"font-mono text-slate-700 font-medium text-sm",children:s.name}),(0,t.jsx)("svg",{className:"w-3 h-3 text-slate-400 group-hover:text-slate-600 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})]})]}),(0,t.jsx)("p",{className:"text-xs text-gray-600",children:s.description}),(0,t.jsxs)("p",{className:"text-xs text-gray-500",children:["Provider: ",s.mcp_info.server_name]})]})]}),(0,t.jsx)(O.z,{onClick:i,variant:"light",size:"sm",className:"text-gray-500 hover:text-gray-700",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 h-full",children:[(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Input Parameters"}),(0,t.jsx)(g.Z,{title:"Configure the input parameters for this tool call",children:(0,t.jsx)(M.Z,{className:"text-gray-400 hover:text-gray-600"})})]})}),(0,t.jsx)("div",{className:"p-4",children:(0,t.jsxs)(A.Z,{form:o,onFinish:e=>{u(Date.now()),h(null);let s={};Object.entries(e).forEach(e=>{var r;let[t,l]=e,a=null===(r=j.properties)||void 0===r?void 0:r[t];if(a&&null!=l&&""!==l)switch(a.type){case"boolean":s[t]="true"===l||!0===l;break;case"number":case"integer":{let e=Number(l);s[t]=Number.isNaN(e)?l:"integer"===a.type?Math.trunc(e):e;break}case"object":case"array":try{let e="string"==typeof l?JSON.parse(l):l,r="object"===a.type&&null!==e&&"object"==typeof e&&!Array.isArray(e),n="array"===a.type&&Array.isArray(e);"object"===a.type&&r||"array"===a.type&&n?s[t]=e:s[t]=l}catch(e){s[t]=l}break;case"string":s[t]=String(l);break;default:s[t]=l}else null!=l&&""!==l&&(s[t]=l)}),r(p.properties&&p.properties.params&&"object"===p.properties.params.type&&p.properties.params.properties?{params:s}:s)},layout:"vertical",className:"space-y-3",children:["string"==typeof s.inputSchema?(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsx)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Input ",(0,t.jsx)("span",{className:"text-red-500",children:"*"})]}),name:"input",rules:[{required:!0,message:"Please enter input for this tool"}],className:"mb-3",children:(0,t.jsx)(O.o,{placeholder:"Enter input for this tool",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"})})}):void 0===j.properties?(0,t.jsx)("div",{className:"text-center py-6 bg-gray-50 rounded-lg border border-gray-200",children:(0,t.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"No Parameters Required"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"This tool can be called without any input parameters."})]})}):(0,t.jsx)("div",{className:"space-y-3",children:Object.entries(j.properties).map(e=>{var r,l,a,n;let[i,o]=e,c=e8(o),d="".concat(s.name,"-").concat(i);return(0,t.jsxs)(A.Z.Item,{label:(0,t.jsxs)("span",{className:"text-sm font-medium text-gray-700 flex items-center",children:[i," ",(null===(r=j.required)||void 0===r?void 0:r.includes(i))&&(0,t.jsx)("span",{className:"text-red-500",children:"*"}),o.description&&(0,t.jsx)(g.Z,{title:o.description,children:(0,t.jsx)(M.Z,{className:"ml-2 text-gray-400 hover:text-gray-600"})})]}),name:i,initialValue:c,rules:[{required:null===(l=j.required)||void 0===l?void 0:l.includes(i),message:"Please enter ".concat(i)},..."object"===o.type||"array"===o.type?[{validator:(e,s)=>{var r;if((null==s||""===s)&&!(null===(r=j.required)||void 0===r?void 0:r.includes(i)))return Promise.resolve();try{let e="string"==typeof s?JSON.parse(s):s,r="object"===o.type&&null!==e&&"object"==typeof e&&!Array.isArray(e),t="array"===o.type&&Array.isArray(e);if("object"===o.type&&r||"array"===o.type&&t)return Promise.resolve();return Promise.reject(Error("object"===o.type?"Please enter a JSON object":"Please enter a JSON array"))}catch(e){return Promise.reject(Error("Invalid JSON"))}}}]:[]],className:"mb-3",children:["string"===o.type&&o.enum&&(0,t.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:null!=c?c:"",children:[!(null===(a=j.required)||void 0===a?void 0:a.includes(i))&&(0,t.jsxs)("option",{value:"",children:["Select ",i]}),o.enum.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),"string"===o.type&&!o.enum&&(0,t.jsx)(O.o,{placeholder:o.description||"Enter ".concat(i),defaultValue:null!=c?c:"",className:"rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-500"}),("number"===o.type||"integer"===o.type)&&(0,t.jsx)("input",{type:"number",step:"integer"===o.type?1:"any",placeholder:o.description||"Enter ".concat(i),defaultValue:null!=c?c:0,className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors"}),"boolean"===o.type&&(0,t.jsxs)("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm transition-colors",defaultValue:(null!=c&&c).toString(),children:[!(null===(n=j.required)||void 0===n?void 0:n.includes(i))&&(0,t.jsxs)("option",{value:"",children:["Select ",i]}),(0,t.jsx)("option",{value:"true",children:"True"}),(0,t.jsx)("option",{value:"false",children:"False"})]}),("object"===o.type||"array"===o.type)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("textarea",{rows:"object"===o.type?6:4,placeholder:o.description||("object"===o.type?"Enter JSON object for ".concat(i):"Enter JSON array for ".concat(i)),defaultValue:null!=c?c:"object"===o.type?"{}":"[]",spellCheck:!1,"data-testid":"textarea-".concat(i),className:"w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-sm font-mono"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"object"===o.type?"Provide a valid JSON object.":"Provide a valid JSON array."})]})]},d)})}),(0,t.jsx)("div",{className:"pt-3 border-t border-gray-100",children:(0,t.jsx)(O.z,{onClick:()=>o.submit(),disabled:l,variant:"primary",className:"w-full",loading:l,children:l?"Calling Tool...":a||n?"Call Again":"Call Tool"})})]})})]}),(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"border-b border-gray-100 px-4 py-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"Tool Result"})}),(0,t.jsx)("div",{className:"p-4",children:a||n||l?(0,t.jsxs)("div",{className:"space-y-3",children:[a&&!l&&!n&&(0,t.jsx)("div",{className:"p-2 bg-green-50 border border-green-200 rounded-lg",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)("svg",{className:"h-4 w-4 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,t.jsx)("h4",{className:"text-xs font-medium text-green-900",children:"Tool executed successfully"}),null!==x&&(0,t.jsxs)("span",{className:"text-xs text-green-600 ml-1",children:["• ",(x/1e3).toFixed(2),"s"]})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,t.jsxs)("div",{className:"flex bg-white rounded border border-green-300 p-0.5",children:[(0,t.jsx)("button",{onClick:()=>d("formatted"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("formatted"===c?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"Formatted"}),(0,t.jsx)("button",{onClick:()=>d("json"),className:"px-2 py-1 text-xs font-medium rounded transition-colors ".concat("json"===c?"bg-green-100 text-green-800":"text-green-600 hover:text-green-800"),children:"JSON"})]}),(0,t.jsx)("button",{onClick:y,className:"p-1 hover:bg-green-100 rounded text-green-700",title:"Copy response",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})]})]})}),(0,t.jsxs)("div",{className:"max-h-96 overflow-y-auto",children:[l&&(0,t.jsxs)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-gray-200"}),(0,t.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,t.jsx)("p",{className:"text-sm font-medium mt-3",children:"Calling tool..."}),(0,t.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Please wait while we process your request"})]}),n&&(0,t.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-4 w-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-red-900",children:"Tool Call Failed"}),null!==x&&(0,t.jsxs)("span",{className:"text-xs text-red-600",children:["• ",(x/1e3).toFixed(2),"s"]})]}),(0,t.jsx)("div",{className:"bg-white border border-red-200 rounded p-2 max-h-48 overflow-y-auto",children:(0,t.jsx)("pre",{className:"text-xs whitespace-pre-wrap text-red-700 font-mono",children:n.message})})]})]})}),a&&!l&&!n&&(0,t.jsx)("div",{className:"space-y-3",children:"formatted"===c?a.map((e,s)=>(0,t.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:["text"===e.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Text Response"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsx)("div",{className:"bg-white rounded border border-gray-200 max-h-64 overflow-y-auto",children:(0,t.jsx)("div",{className:"p-3 space-y-2",children:e.text.split("\n\n").map((e,s)=>{if(""===e.trim())return null;if(e.startsWith("##")){let r=e.replace(/^#+\s/,"");return(0,t.jsx)("div",{className:"border-b border-gray-200 pb-1 mb-2",children:(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:r})},s)}let r=/(https?:\/\/[^\s\)]+)/g;if(r.test(e)){let l=e.split(r);return(0,t.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded p-2",children:(0,t.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap",children:l.map((e,s)=>r.test(e)?(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline break-all",children:e},s):e)})},s)}return e.includes("Score:")?(0,t.jsx)("div",{className:"bg-green-50 border-l-4 border-green-400 p-2 rounded-r",children:(0,t.jsx)("p",{className:"text-xs text-green-800 font-medium whitespace-pre-wrap",children:e})},s):(0,t.jsx)("div",{className:"bg-gray-50 rounded p-2 border border-gray-200",children:(0,t.jsx)("div",{className:"text-xs text-gray-700 leading-relaxed whitespace-pre-wrap font-mono",children:e})},s)}).filter(Boolean)})})})]}),"image"===e.type&&e.url&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Image Response"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsx)("div",{className:"bg-gray-50 rounded p-3 border border-gray-200",children:(0,t.jsx)("img",{src:e.url,alt:"Tool result",className:"max-w-full h-auto rounded shadow-sm"})})})]}),"embedded_resource"===e.type&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"bg-gray-50 px-3 py-1 border-b border-gray-200",children:(0,t.jsx)("span",{className:"text-xs font-medium text-gray-700 uppercase tracking-wide",children:"Embedded Resource"})}),(0,t.jsx)("div",{className:"p-3",children:(0,t.jsxs)("div",{className:"flex items-center space-x-2 p-3 bg-blue-50 border border-blue-200 rounded",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("p",{className:"text-xs font-medium text-blue-900",children:["Resource Type: ",e.resource_type]}),e.url&&(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-xs text-blue-600 hover:text-blue-800 hover:underline mt-1 transition-colors",children:["View Resource",(0,t.jsxs)("svg",{className:"ml-1 h-3 w-3",fill:"currentColor",viewBox:"0 0 20 20",children:[(0,t.jsx)("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),(0,t.jsx)("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"})]})]})]})]})})]})]},s)):(0,t.jsx)("div",{className:"bg-white rounded border border-gray-200",children:(0,t.jsx)("div",{className:"p-3 overflow-auto max-h-80 bg-gray-50",children:(0,t.jsx)("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all text-gray-800",children:JSON.stringify(a,null,2)})})})})]})]}):(0,t.jsx)("div",{className:"flex flex-col justify-center items-center h-48 text-gray-500",children:(0,t.jsxs)("div",{className:"text-center max-w-sm",children:[(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),(0,t.jsx)("h4",{className:"text-sm font-medium text-gray-900 mb-1",children:"Ready to Call Tool"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 leading-relaxed",children:'Configure the input parameters and click "Call Tool" to see the results here.'})]})})})]})]})]})}var se=r(69993),ss=e=>{let{serverId:s,accessToken:r,auth_type:l,userRole:a,userID:n,serverAlias:i}=e,[o,c]=(0,f.useState)(null),[d,m]=(0,f.useState)(null),[h,p]=(0,f.useState)(null),{data:g,isLoading:j,error:v}=(0,b.a)({queryKey:["mcpTools",s],queryFn:()=>{if(!r)throw Error("Access Token required");return(0,_.listMCPTools)(r,s)},enabled:!!r,staleTime:3e4}),{mutate:y,isPending:N}=(0,e5.D)({mutationFn:async e=>{if(!r)throw Error("Access Token required");try{return await (0,_.callMCPTool)(r,e.tool.name,e.arguments)}catch(e){throw e}},onSuccess:e=>{m(e.content),p(null)},onError:e=>{p(e),m(null)}}),w=(null==g?void 0:g.tools)||[];return(0,t.jsx)("div",{className:"w-full h-screen p-4 bg-white",children:(0,t.jsx)(F.Z,{className:"w-full rounded-xl shadow-md overflow-hidden",children:(0,t.jsxs)("div",{className:"flex h-auto w-full gap-4",children:[(0,t.jsxs)("div",{className:"w-1/4 p-4 bg-gray-50 flex flex-col",children:[(0,t.jsx)(x.Z,{className:"text-xl font-semibold mb-6 mt-2",children:"MCP Tools"}),(0,t.jsx)("div",{className:"flex flex-col flex-1",children:(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,t.jsxs)(u.Z,{className:"font-medium block mb-3 text-gray-700 flex items-center",children:[(0,t.jsx)(V.Z,{className:"mr-2"})," Available Tools",w.length>0&&(0,t.jsx)("span",{className:"ml-2 bg-blue-100 text-blue-800 text-xs font-medium px-2 py-0.5 rounded-full",children:w.length})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 bg-white border border-gray-200 rounded-lg",children:[(0,t.jsxs)("div",{className:"relative mb-3",children:[(0,t.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-gray-200"}),(0,t.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-2 border-blue-600 border-t-transparent absolute top-0"})]}),(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700",children:"Loading tools..."})]}),(null==g?void 0:g.error)&&!j&&!w.length&&(0,t.jsx)("div",{className:"p-3 text-xs text-red-800 rounded-lg bg-red-50 border border-red-200",children:(0,t.jsxs)("p",{className:"font-medium",children:["Error: ",g.message]})}),!j&&!(null==g?void 0:g.error)&&(!w||0===w.length)&&(0,t.jsxs)("div",{className:"p-4 text-center bg-white border border-gray-200 rounded-lg",children:[(0,t.jsx)("div",{className:"mx-auto w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center mb-2",children:(0,t.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 8.172V5L8 4z"})})}),(0,t.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:"No tools available"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"No tools found for this server"})]}),!j&&!(null==g?void 0:g.error)&&w.length>0&&(0,t.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto min-h-0 mcp-tools-scrollable",style:{maxHeight:"400px",scrollbarWidth:"auto",scrollbarColor:"#cbd5e0 #f7fafc"},children:w.map(e=>(0,t.jsxs)("div",{className:"border rounded-lg p-3 cursor-pointer transition-all hover:shadow-sm ".concat((null==o?void 0:o.name)===e.name?"border-blue-500 bg-blue-50 ring-1 ring-blue-200":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>{c(e),m(null),p(null)},children:[(0,t.jsxs)("div",{className:"flex items-start space-x-2",children:[e.mcp_info.logo_url&&(0,t.jsx)("img",{src:e.mcp_info.logo_url,alt:"".concat(e.mcp_info.server_name," logo"),className:"w-4 h-4 object-contain flex-shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h4",{className:"font-mono text-xs font-medium text-gray-900 truncate",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.mcp_info.server_name}),(0,t.jsx)("p",{className:"text-xs text-gray-600 mt-1 line-clamp-2 leading-relaxed",children:e.description})]})]}),(null==o?void 0:o.name)===e.name&&(0,t.jsx)("div",{className:"mt-2 pt-2 border-t border-blue-200",children:(0,t.jsxs)("div",{className:"flex items-center text-xs font-medium text-blue-700",children:[(0,t.jsx)("svg",{className:"w-3 h-3 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Selected"]})})]},e.name))})]})})]}),(0,t.jsxs)("div",{className:"w-3/4 flex flex-col bg-white",children:[(0,t.jsx)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:(0,t.jsx)(x.Z,{className:"text-xl font-semibold mb-0",children:"Tool Testing Playground"})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto p-4",children:o?(0,t.jsx)("div",{className:"h-full",children:(0,t.jsx)(e9,{tool:o,onSubmit:e=>{y({tool:o,arguments:e})},result:d,error:h,isLoading:N,onClose:()=>c(null)})}):(0,t.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,t.jsx)(se.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,t.jsx)(u.Z,{className:"text-lg font-medium text-gray-600 mb-2",children:"Select a Tool to Test"}),(0,t.jsx)(u.Z,{className:"text-center text-gray-500 max-w-md",children:"Choose a tool from the left sidebar to start testing its functionality with custom inputs."})]})})]})]})})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6600-43a47ceabf838b3d.js b/litellm/proxy/_experimental/out/_next/static/chunks/6600-43a47ceabf838b3d.js deleted file mode 100644 index d3032abe15a..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6600-43a47ceabf838b3d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6600],{66600:function(e,t,s){s.d(t,{Z:function(){return Y}});var l=s(57437),a=s(40278),r=s(12514),n=s(49804),i=s(67101),c=s(47323),o=s(92414),d=s(46030),m=s(97765),u=s(12485),h=s(18135),x=s(35242),p=s(29706),f=s(77991),g=s(84264),v=s(2265),_=s(9114),y=s(39789),j=s(23628),N=s(19250),b=s(78489),S=s(51853),w=s(44643),k=s(71157);let C=e=>{let{responseTimeMs:t}=e;return null==t?null:(0,l.jsxs)("div",{className:"flex items-center space-x-1 text-xs text-gray-500 font-mono",children:[(0,l.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 6V12L16 14M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,l.jsxs)("span",{children:[t.toFixed(0),"ms"]})]})},Z=e=>{let t=e;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){}return t},A=e=>{let{label:t,value:s}=e,[a,r]=v.useState(!1),[n,i]=v.useState(!1),c=(null==s?void 0:s.toString())||"N/A",o=c.length>50?c.substring(0,50)+"...":c;return(0,l.jsx)("tr",{className:"hover:bg-gray-50",children:(0,l.jsx)("td",{className:"px-4 py-2 align-top",colSpan:2,children:(0,l.jsxs)("div",{className:"flex items-center justify-between group",children:[(0,l.jsxs)("div",{className:"flex items-center flex-1",children:[(0,l.jsx)("button",{onClick:()=>r(!a),className:"text-gray-400 hover:text-gray-600 mr-2",children:a?"▼":"▶"}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-sm text-gray-600",children:t}),(0,l.jsx)("pre",{className:"mt-1 text-sm font-mono text-gray-800 whitespace-pre-wrap",children:a?c:o})]})]}),(0,l.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(c),i(!0),setTimeout(()=>i(!1),2e3)},className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-gray-600",children:(0,l.jsx)(S.Z,{className:"h-4 w-4"})})]})})})},T=e=>{var t,s,a,r,n,i,c,o,d,m,v,_,y,j;let{response:N}=e,b=null,S={},C={};try{if(null==N?void 0:N.error)try{let e="string"==typeof N.error.message?JSON.parse(N.error.message):N.error.message;b={message:(null==e?void 0:e.message)||"Unknown error",traceback:(null==e?void 0:e.traceback)||"No traceback available",litellm_params:(null==e?void 0:e.litellm_cache_params)||{},health_check_cache_params:(null==e?void 0:e.health_check_cache_params)||{}},S=Z(b.litellm_params)||{},C=Z(b.health_check_cache_params)||{}}catch(e){console.warn("Error parsing error details:",e),b={message:String(N.error.message||"Unknown error"),traceback:"Error parsing details",litellm_params:{},health_check_cache_params:{}}}else S=Z(null==N?void 0:N.litellm_cache_params)||{},C=Z(null==N?void 0:N.health_check_cache_params)||{}}catch(e){console.warn("Error in response parsing:",e),S={},C={}}let T={redis_host:(null==C?void 0:null===(a=C.redis_client)||void 0===a?void 0:null===(s=a.connection_pool)||void 0===s?void 0:null===(t=s.connection_kwargs)||void 0===t?void 0:t.host)||(null==C?void 0:null===(i=C.redis_async_client)||void 0===i?void 0:null===(n=i.connection_pool)||void 0===n?void 0:null===(r=n.connection_kwargs)||void 0===r?void 0:r.host)||(null==C?void 0:null===(c=C.connection_kwargs)||void 0===c?void 0:c.host)||(null==C?void 0:C.host)||"N/A",redis_port:(null==C?void 0:null===(m=C.redis_client)||void 0===m?void 0:null===(d=m.connection_pool)||void 0===d?void 0:null===(o=d.connection_kwargs)||void 0===o?void 0:o.port)||(null==C?void 0:null===(y=C.redis_async_client)||void 0===y?void 0:null===(_=y.connection_pool)||void 0===_?void 0:null===(v=_.connection_kwargs)||void 0===v?void 0:v.port)||(null==C?void 0:null===(j=C.connection_kwargs)||void 0===j?void 0:j.port)||(null==C?void 0:C.port)||"N/A",redis_version:(null==C?void 0:C.redis_version)||"N/A",startup_nodes:(()=>{try{var e,t,s,l,a,r,n,i,c,o,d,m,u;if(null==C?void 0:null===(e=C.redis_kwargs)||void 0===e?void 0:e.startup_nodes)return JSON.stringify(C.redis_kwargs.startup_nodes);let h=(null==C?void 0:null===(l=C.redis_client)||void 0===l?void 0:null===(s=l.connection_pool)||void 0===s?void 0:null===(t=s.connection_kwargs)||void 0===t?void 0:t.host)||(null==C?void 0:null===(n=C.redis_async_client)||void 0===n?void 0:null===(r=n.connection_pool)||void 0===r?void 0:null===(a=r.connection_kwargs)||void 0===a?void 0:a.host),x=(null==C?void 0:null===(o=C.redis_client)||void 0===o?void 0:null===(c=o.connection_pool)||void 0===c?void 0:null===(i=c.connection_kwargs)||void 0===i?void 0:i.port)||(null==C?void 0:null===(u=C.redis_async_client)||void 0===u?void 0:null===(m=u.connection_pool)||void 0===m?void 0:null===(d=m.connection_kwargs)||void 0===d?void 0:d.port);return h&&x?JSON.stringify([{host:h,port:x}]):"N/A"}catch(e){return"N/A"}})(),namespace:(null==C?void 0:C.namespace)||"N/A"};return(0,l.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,l.jsxs)(h.Z,{children:[(0,l.jsxs)(x.Z,{className:"border-b border-gray-200 px-4",children:[(0,l.jsx)(u.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Summary"}),(0,l.jsx)(u.Z,{className:"px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-800",children:"Raw Response"})]}),(0,l.jsxs)(f.Z,{children:[(0,l.jsx)(p.Z,{className:"p-4",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"flex items-center mb-6",children:[(null==N?void 0:N.status)==="healthy"?(0,l.jsx)(w.Z,{className:"h-5 w-5 text-green-500 mr-2"}):(0,l.jsx)(k.Z,{className:"h-5 w-5 text-red-500 mr-2"}),(0,l.jsxs)(g.Z,{className:"text-sm font-medium ".concat((null==N?void 0:N.status)==="healthy"?"text-green-500":"text-red-500"),children:["Cache Status: ",(null==N?void 0:N.status)||"unhealthy"]})]}),(0,l.jsx)("table",{className:"w-full border-collapse",children:(0,l.jsxs)("tbody",{children:[b&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold text-red-600",children:"Error Details"})}),(0,l.jsx)(A,{label:"Error Message",value:b.message}),(0,l.jsx)(A,{label:"Traceback",value:b.traceback})]}),(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Cache Details"})}),(0,l.jsx)(A,{label:"Cache Configuration",value:String(null==S?void 0:S.type)}),(0,l.jsx)(A,{label:"Ping Response",value:String(N.ping_response)}),(0,l.jsx)(A,{label:"Set Cache Response",value:N.set_cache_response||"N/A"}),(0,l.jsx)(A,{label:"litellm_settings.cache_params",value:JSON.stringify(S,null,2)}),(null==S?void 0:S.type)==="redis"&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("tr",{children:(0,l.jsx)("td",{colSpan:2,className:"pt-4 pb-2 font-semibold",children:"Redis Details"})}),(0,l.jsx)(A,{label:"Redis Host",value:T.redis_host||"N/A"}),(0,l.jsx)(A,{label:"Redis Port",value:T.redis_port||"N/A"}),(0,l.jsx)(A,{label:"Redis Version",value:T.redis_version||"N/A"}),(0,l.jsx)(A,{label:"Startup Nodes",value:T.startup_nodes||"N/A"}),(0,l.jsx)(A,{label:"Namespace",value:T.namespace||"N/A"})]})]})})]})}),(0,l.jsx)(p.Z,{className:"p-4",children:(0,l.jsx)("div",{className:"bg-gray-50 rounded-md p-4 font-mono text-sm",children:(0,l.jsx)("pre",{className:"whitespace-pre-wrap break-words overflow-auto max-h-[500px]",children:(()=>{try{let e={...N,litellm_cache_params:S,health_check_cache_params:C},t=JSON.parse(JSON.stringify(e,(e,t)=>{if("string"==typeof t)try{return JSON.parse(t)}catch(e){}return t}));return JSON.stringify(t,null,2)}catch(e){return"Error formatting JSON: "+e.message}})()})})})]})]})})},D=e=>{let{accessToken:t,healthCheckResponse:s,runCachingHealthCheck:a,responseTimeMs:r}=e,[n,i]=v.useState(null),[c,o]=v.useState(!1),d=async()=>{o(!0);let e=performance.now();await a(),i(performance.now()-e),o(!1)};return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(b.Z,{onClick:d,disabled:c,className:"bg-indigo-600 hover:bg-indigo-700 disabled:bg-indigo-400 text-white text-sm px-4 py-2 rounded-md",children:c?"Running Health Check...":"Run Health Check"}),(0,l.jsx)(C,{responseTimeMs:n})]}),s&&(0,l.jsx)(T,{response:s})]})};var R=s(87452),L=s(88829),E=s(72208),I=s(25512),F=e=>{let{redisType:t,redisTypeDescriptions:s,onTypeChange:a}=e;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Redis Type"}),(0,l.jsxs)(I.P,{value:t,onValueChange:a,children:[(0,l.jsx)(I.Q,{value:"node",children:"Node (Single Instance)"}),(0,l.jsx)(I.Q,{value:"cluster",children:"Cluster"}),(0,l.jsx)(I.Q,{value:"sentinel",children:"Sentinel"}),(0,l.jsx)(I.Q,{value:"semantic",children:"Semantic"})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:s[t]||"Select the type of Redis deployment you're using"})]})},H=s(39760),O=s(30150),V=s(49566),J=s(37592),B=s(10703),P=s(24199),M=e=>{let{field:t,currentValue:s}=e,[a,r]=(0,v.useState)([]),[n,i]=(0,v.useState)(s||""),{accessToken:c}=(0,H.Z)();if((0,v.useEffect)(()=>{c&&(async()=>{try{let e=await (0,B.p)(c);console.log("Fetched models for selector:",e),e.length>0&&r(e)}catch(e){console.error("Error fetching model info:",e)}})()},[c]),"Boolean"===t.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:t.ui_field_name}),(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("input",{type:"checkbox",name:t.field_name,defaultChecked:!0===s||"true"===s,className:"h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded"}),(0,l.jsx)("span",{className:"ml-2 text-sm text-gray-500",children:t.field_description})]})]});if("Integer"===t.field_type||"Float"===t.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:t.ui_field_name}),(0,l.jsx)(P.Z,{name:t.field_name,type:"number",defaultValue:s,placeholder:t.field_description}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:t.field_description})]});if("List"===t.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:t.ui_field_name}),(0,l.jsx)("textarea",{name:t.field_name,defaultValue:"object"==typeof s?JSON.stringify(s,null,2):s,placeholder:t.field_description,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500",rows:4}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:t.field_description})]});if("Models_Select"===t.field_type){let e=a.filter(e=>"embedding"===e.mode).map(e=>({value:e.model_group,label:e.model_group}));return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:t.ui_field_name}),(0,l.jsx)(J.default,{value:n,onChange:i,showSearch:!0,placeholder:"Search and select a model...",options:e,style:{width:"100%"},className:"rounded-md",filterOption:(e,t)=>{var s;return(null!==(s=null==t?void 0:t.label)&&void 0!==s?s:"").toLowerCase().includes(e.toLowerCase())}}),(0,l.jsx)("input",{type:"hidden",name:t.field_name,value:n}),t.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:t.field_description})]})}if("Integer"===t.field_type||"Float"===t.field_type)return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:t.ui_field_name}),(0,l.jsx)(O.Z,{name:t.field_name,defaultValue:s,placeholder:t.field_description,step:"Float"===t.field_type?.01:1}),t.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:t.field_description})]});let o="password"===t.field_name||t.field_name.includes("password")?"password":"text";return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-medium text-gray-700",children:t.ui_field_name}),(0,l.jsx)(V.Z,{name:t.field_name,type:o,defaultValue:s,placeholder:t.field_description}),t.field_description&&(0,l.jsx)("p",{className:"text-xs text-gray-500",children:t.field_description})]})};let q=(e,t)=>null===e.redis_type||void 0===e.redis_type||e.redis_type===t,U=(e,t)=>e.find(e=>e.field_name===t),G=(e,t)=>{let s=["host","port","password","username"].map(t=>U(e,t)).filter(Boolean),l=["ssl","ssl_cert_reqs","ssl_check_hostname"].map(t=>U(e,t)).filter(Boolean),a=["namespace","ttl","max_connections"].map(t=>U(e,t)).filter(Boolean),r=["gcp_service_account","gcp_ssl_ca_certs"].map(t=>U(e,t)).filter(Boolean);return{basicFields:s,sslFields:l,cacheManagementFields:a,gcpFields:r,clusterFields:e.filter(e=>"cluster"===e.redis_type),sentinelFields:e.filter(e=>"sentinel"===e.redis_type),semanticFields:e.filter(e=>"semantic"===e.redis_type)}},z=(e,t)=>{let s={type:"redis"};return e.forEach(e=>{if("redis_type"===e.field_name||!q(e,t))return;let l=e.field_name,a=null;if("Boolean"===e.field_type){let e=document.querySelector('input[name="'.concat(l,'"]'));(null==e?void 0:e.checked)!==void 0&&(a=e.checked)}else if("List"===e.field_type){let e=document.querySelector('textarea[name="'.concat(l,'"]'));if(null==e?void 0:e.value)try{a=JSON.parse(e.value)}catch(e){console.error("Invalid JSON for ".concat(l,":"),e)}}else{let t=document.querySelector('input[name="'.concat(l,'"]'));if(null==t?void 0:t.value){let s=t.value.trim();if(""!==s){if("Integer"===e.field_type){let e=Number(s);isNaN(e)||(a=e)}else if("Float"===e.field_type){let e=Number(s);isNaN(e)||(a=e)}else a=s}}}null!=a&&(s[l]=a)}),s};var Q=e=>{let{accessToken:t,userRole:s,userID:a}=e,[r,n]=(0,v.useState)({}),[i,c]=(0,v.useState)([]),[o,d]=(0,v.useState)({}),[m,u]=(0,v.useState)("node"),[h,x]=(0,v.useState)(!1),[p,f]=(0,v.useState)(!1),g=(0,v.useCallback)(async()=>{try{let e=await (0,N.getCacheSettingsCall)(t);console.log("cache settings from API",e),e.fields&&c(e.fields),e.current_values&&(n(e.current_values),e.current_values.redis_type&&u(e.current_values.redis_type)),e.redis_type_descriptions&&d(e.redis_type_descriptions)}catch(e){console.error("Failed to load cache settings:",e),_.Z.fromBackend("Failed to load cache settings")}},[t]);(0,v.useEffect)(()=>{t&&g()},[t,g]);let y=async()=>{if(t){x(!0);try{let e=z(i,m),s=await (0,N.testCacheConnectionCall)(t,e);"success"===s.status?_.Z.success("Cache connection test successful!"):_.Z.fromBackend("Connection test failed: ".concat(s.message||s.error))}catch(e){console.error("Test connection error:",e),_.Z.fromBackend("Connection test failed: ".concat(e.message||"Unknown error"))}finally{x(!1)}}},j=async()=>{if(t){f(!0);try{let e=z(i,m);"semantic"===m&&(e.type="redis-semantic"),await (0,N.updateCacheSettingsCall)(t,e),_.Z.success("Cache settings updated successfully"),await g()}catch(e){console.error("Failed to save cache settings:",e),_.Z.fromBackend("Failed to update cache settings")}finally{f(!1)}}};if(!t)return null;let{basicFields:S,sslFields:w,cacheManagementFields:k,gcpFields:C,clusterFields:Z,sentinelFields:A,semanticFields:T}=G(i,m);return(0,l.jsxs)("div",{className:"w-full space-y-8 py-2",children:[(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"max-w-3xl",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Cache Settings"}),(0,l.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Configure Redis cache for LiteLLM"})]}),(0,l.jsx)(F,{redisType:m,redisTypeDescriptions:o,onTypeChange:u}),(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Connection Settings"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:S.map(e=>{var t,s;if(!e)return null;let a=null!==(s=null!==(t=r[e.field_name])&&void 0!==t?t:e.field_default)&&void 0!==s?s:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"cluster"===m&&Z.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Cluster Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6",children:Z.map(e=>{var t,s;let a=null!==(s=null!==(t=r[e.field_name])&&void 0!==t?t:e.field_default)&&void 0!==s?s:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"sentinel"===m&&A.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Sentinel Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:A.map(e=>{var t,s;let a=null!==(s=null!==(t=r[e.field_name])&&void 0!==t?t:e.field_default)&&void 0!==s?s:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),"semantic"===m&&T.length>0&&(0,l.jsxs)("div",{className:"space-y-6 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h4",{className:"text-sm font-medium text-gray-900",children:"Semantic Configuration"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:T.map(e=>{var t,s;let a=null!==(s=null!==(t=r[e.field_name])&&void 0!==t?t:e.field_default)&&void 0!==s?s:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),(0,l.jsxs)(R.Z,{className:"mt-4",children:[(0,l.jsx)(E.Z,{children:(0,l.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Advanced Settings"})}),(0,l.jsx)(L.Z,{children:(0,l.jsxs)("div",{className:"space-y-6",children:[w.length>0&&(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"SSL Settings"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:w.map(e=>{var t,s;if(!e)return null;let a=null!==(s=null!==(t=r[e.field_name])&&void 0!==t?t:e.field_default)&&void 0!==s?s:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),k.length>0&&(0,l.jsxs)("div",{className:"space-y-4 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"Cache Management"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:k.map(e=>{var t,s;if(!e)return null;let a=null!==(s=null!==(t=r[e.field_name])&&void 0!==t?t:e.field_default)&&void 0!==s?s:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]}),C.length>0&&(0,l.jsxs)("div",{className:"space-y-4 pt-4 border-t border-gray-200",children:[(0,l.jsx)("h5",{className:"text-sm font-medium text-gray-700",children:"GCP Authentication"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:C.map(e=>{var t,s;if(!e)return null;let a=null!==(s=null!==(t=r[e.field_name])&&void 0!==t?t:e.field_default)&&void 0!==s?s:"";return(0,l.jsx)(M,{field:e,currentValue:a},e.field_name)})})]})]})})]})]}),(0,l.jsxs)("div",{className:"border-t border-gray-200 pt-6 flex justify-end gap-3",children:[(0,l.jsx)(b.Z,{variant:"secondary",size:"sm",onClick:y,disabled:h,className:"text-sm",children:h?"Testing...":"Test Connection"}),(0,l.jsx)(b.Z,{size:"sm",onClick:j,disabled:p,className:"text-sm font-medium",children:p?"Saving...":"Save Changes"})]})]})};let W=e=>{if(e)return e.toISOString().split("T")[0]};function K(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}var Y=e=>{let{accessToken:t,token:s,userRole:b,userID:S,premiumUser:w}=e,[k,C]=(0,v.useState)([]),[Z,A]=(0,v.useState)([]),[T,R]=(0,v.useState)([]),[L,E]=(0,v.useState)([]),[I,F]=(0,v.useState)("0"),[H,O]=(0,v.useState)("0"),[V,J]=(0,v.useState)("0"),[B,P]=(0,v.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[M,q]=(0,v.useState)(""),[U,G]=(0,v.useState)("");(0,v.useEffect)(()=>{t&&B&&((async()=>{E(await (0,N.adminGlobalCacheActivity)(t,W(B.from),W(B.to)))})(),q(new Date().toLocaleString()))},[t]);let z=Array.from(new Set(L.map(e=>{var t;return null!==(t=null==e?void 0:e.api_key)&&void 0!==t?t:""}))),Y=Array.from(new Set(L.map(e=>{var t;return null!==(t=null==e?void 0:e.model)&&void 0!==t?t:""})));Array.from(new Set(L.map(e=>{var t;return null!==(t=null==e?void 0:e.call_type)&&void 0!==t?t:""})));let X=async(e,s)=>{e&&s&&t&&E(await (0,N.adminGlobalCacheActivity)(t,W(e),W(s)))};(0,v.useEffect)(()=>{console.log("DATA IN CACHE DASHBOARD",L);let e=L;Z.length>0&&(e=e.filter(e=>Z.includes(e.api_key))),T.length>0&&(e=e.filter(e=>T.includes(e.model))),console.log("before processed data in cache dashboard",e);let t=0,s=0,l=0,a=e.reduce((e,a)=>{console.log("Processing item:",a),a.call_type||(console.log("Item has no call_type:",a),a.call_type="Unknown"),t+=(a.total_rows||0)-(a.cache_hit_true_rows||0),s+=a.cache_hit_true_rows||0,l+=a.cached_completion_tokens||0;let r=e.find(e=>e.name===a.call_type);return r?(r["LLM API requests"]+=(a.total_rows||0)-(a.cache_hit_true_rows||0),r["Cache hit"]+=a.cache_hit_true_rows||0,r["Cached Completion Tokens"]+=a.cached_completion_tokens||0,r["Generated Completion Tokens"]+=a.generated_completion_tokens||0):e.push({name:a.call_type,"LLM API requests":(a.total_rows||0)-(a.cache_hit_true_rows||0),"Cache hit":a.cache_hit_true_rows||0,"Cached Completion Tokens":a.cached_completion_tokens||0,"Generated Completion Tokens":a.generated_completion_tokens||0}),e},[]);F(K(s)),O(K(l));let r=s+t;r>0?J((s/r*100).toFixed(2)):J("0"),C(a),console.log("PROCESSED DATA IN CACHE DASHBOARD",a)},[Z,T,B,L]);let $=async()=>{try{_.Z.info("Running cache health check..."),G("");let e=await (0,N.cachingHealthCheckCall)(null!==t?t:"");console.log("CACHING HEALTH CHECK RESPONSE",e),G(e)}catch(t){let e;if(console.error("Error running health check:",t),t&&t.message)try{let s=JSON.parse(t.message);s.error&&(s=s.error),e=s}catch(s){e={message:t.message}}else e={message:"Unknown error occurred"};G({error:e})}};return(0,l.jsxs)(h.Z,{className:"gap-2 p-8 h-full w-full mt-2 mb-8",children:[(0,l.jsxs)(x.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,l.jsxs)("div",{className:"flex",children:[(0,l.jsx)(u.Z,{children:"Cache Analytics"}),(0,l.jsx)(u.Z,{children:"Cache Health"}),(0,l.jsx)(u.Z,{children:"Cache Settings"})]}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[M&&(0,l.jsxs)(g.Z,{children:["Last Refreshed: ",M]}),(0,l.jsx)(c.Z,{icon:j.Z,variant:"shadow",size:"xs",className:"self-center",onClick:()=>{q(new Date().toLocaleString())}})]})]}),(0,l.jsxs)(f.Z,{children:[(0,l.jsx)(p.Z,{children:(0,l.jsxs)(r.Z,{children:[(0,l.jsxs)(i.Z,{numItems:3,className:"gap-4 mt-4",children:[(0,l.jsx)(n.Z,{children:(0,l.jsx)(o.Z,{placeholder:"Select Virtual Keys",value:Z,onValueChange:A,children:z.map(e=>(0,l.jsx)(d.Z,{value:e,children:e},e))})}),(0,l.jsx)(n.Z,{children:(0,l.jsx)(o.Z,{placeholder:"Select Models",value:T,onValueChange:R,children:Y.map(e=>(0,l.jsx)(d.Z,{value:e,children:e},e))})}),(0,l.jsx)(n.Z,{children:(0,l.jsx)(y.Z,{value:B,onValueChange:e=>{P(e),X(e.from,e.to)}})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 mt-4",children:[(0,l.jsxs)(r.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hit Ratio"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsxs)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:[V,"%"]})})]}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cache Hits"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:I})})]}),(0,l.jsxs)(r.Z,{children:[(0,l.jsx)("p",{className:"text-tremor-default font-medium text-tremor-content dark:text-dark-tremor-content",children:"Cached Tokens"}),(0,l.jsx)("div",{className:"mt-2 flex items-baseline space-x-2.5",children:(0,l.jsx)("p",{className:"text-tremor-metric font-semibold text-tremor-content-strong dark:text-dark-tremor-content-strong",children:H})})]})]}),(0,l.jsx)(m.Z,{className:"mt-4",children:"Cache Hits vs API Requests"}),(0,l.jsx)(a.Z,{title:"Cache Hits vs API Requests",data:k,stack:!0,index:"name",valueFormatter:K,categories:["LLM API requests","Cache hit"],colors:["sky","teal"],yAxisWidth:48}),(0,l.jsx)(m.Z,{className:"mt-4",children:"Cached Completion Tokens vs Generated Completion Tokens"}),(0,l.jsx)(a.Z,{className:"mt-6",data:k,stack:!0,index:"name",valueFormatter:K,categories:["Generated Completion Tokens","Cached Completion Tokens"],colors:["sky","teal"],yAxisWidth:48})]})}),(0,l.jsx)(p.Z,{children:(0,l.jsx)(D,{accessToken:t,healthCheckResponse:U,runCachingHealthCheck:$})}),(0,l.jsx)(p.Z,{children:(0,l.jsx)(Q,{accessToken:t,userRole:b,userID:S})})]})]})}},39789:function(e,t,s){s.d(t,{Z:function(){return i}});var l=s(57437),a=s(2265),r=s(88237),n=s(84264),i=e=>{let{value:t,onValueChange:s,label:i="Select Time Range",className:c="",showTimeRange:o=!0}=e,[d,m]=(0,a.useState)(!1),u=(0,a.useRef)(null),h=(0,a.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),s(e),requestIdleCallback(()=>{if(e.from){let t;let l={...e},a=new Date(e.from);t=new Date(e.to?e.to:e.from),a.toDateString(),t.toDateString(),a.setHours(0,0,0,0),t.setHours(23,59,59,999),l.from=a,l.to=t,s(l)}},{timeout:100})},[s]),x=(0,a.useCallback)((e,t)=>{if(!e||!t)return"";let s=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==t.toDateString())return"".concat(s(e)," - ").concat(s(t));{let s=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),l=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(s,": ").concat(l," - ").concat(a)}},[]);return(0,l.jsxs)("div",{className:c,children:[i&&(0,l.jsx)(n.Z,{className:"mb-2",children:i}),(0,l.jsxs)("div",{className:"relative w-fit",children:[(0,l.jsx)("div",{ref:u,children:(0,l.jsx)(r.Z,{enableSelect:!0,value:t,onValueChange:h,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),d&&(0,l.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,l.jsxs)("div",{className:"flex items-center gap-1 text-green-600 text-sm font-medium bg-white px-2 py-1 rounded-full border border-green-200 shadow-sm whitespace-nowrap",children:[(0,l.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,l.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),o&&t.from&&t.to&&(0,l.jsx)(n.Z,{className:"mt-2 text-xs text-gray-500",children:x(t.from,t.to)})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6609-d93906f43161f066.js b/litellm/proxy/_experimental/out/_next/static/chunks/6609-d93906f43161f066.js deleted file mode 100644 index 8e0a0e5f3b6..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6609-d93906f43161f066.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6609],{29967:function(e,t,n){n.d(t,{ZP:function(){return B}});var o=n(2265),r=n(36760),a=n.n(r),l=n(92491),c=n(50506),i=n(18242),d=n(71744),s=n(64024),u=n(33759);let f=o.createContext(null),p=f.Provider,m=o.createContext(null),h=m.Provider;var v=n(20873),g=n(28791),b=n(6694),y=n(34709),x=n(66531),w=n(86586),k=n(39109),C=n(93463),E=n(12918),S=n(99320),Z=n(71140);let N=e=>{let{componentCls:t,antCls:n}=e,o="".concat(t,"-group");return{[o]:Object.assign(Object.assign({},(0,E.Wf)(e)),{display:"inline-block",fontSize:0,["&".concat(o,"-rtl")]:{direction:"rtl"},["&".concat(o,"-block")]:{display:"flex"},["".concat(n,"-badge ").concat(n,"-badge-count")]:{zIndex:1},["> ".concat(n,"-badge:not(:first-child) > ").concat(n,"-button-wrapper")]:{borderInlineStart:"none"}})}},K=e=>{let{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:o,radioSize:r,motionDurationSlow:a,motionDurationMid:l,motionEaseInOutCirc:c,colorBgContainer:i,colorBorder:d,lineWidth:s,colorBgContainerDisabled:u,colorTextDisabled:f,paddingXS:p,dotColorDisabled:m,lineType:h,radioColor:v,radioBgColor:g,calc:b}=e,y="".concat(t,"-inner"),x=b(r).sub(b(4).mul(2)),w=b(1).mul(r).equal({unit:!0});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},(0,E.Wf)(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer","&:last-child":{marginInlineEnd:0},["&".concat(t,"-wrapper-rtl")]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},["".concat(t,"-checked::after")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:"".concat((0,C.bf)(s)," ").concat(h," ").concat(o),borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[t]:Object.assign(Object.assign({},(0,E.Wf)(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),["".concat(t,"-wrapper:hover &,\n &:hover ").concat(y)]:{borderColor:o},["".concat(t,"-input:focus-visible + ").concat(y)]:(0,E.oN)(e),["".concat(t,":hover::after, ").concat(t,"-wrapper:hover &::after")]:{visibility:"visible"},["".concat(t,"-inner")]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:w,height:w,marginBlockStart:b(1).mul(r).div(-2).equal({unit:!0}),marginInlineStart:b(1).mul(r).div(-2).equal({unit:!0}),backgroundColor:v,borderBlockStart:0,borderInlineStart:0,borderRadius:w,transform:"scale(0)",opacity:0,transition:"all ".concat(a," ").concat(c),content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:w,height:w,backgroundColor:i,borderColor:d,borderStyle:"solid",borderWidth:s,borderRadius:"50%",transition:"all ".concat(l)},["".concat(t,"-input")]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},["".concat(t,"-checked")]:{[y]:{borderColor:o,backgroundColor:g,"&::after":{transform:"scale(".concat(e.calc(e.dotSize).div(r).equal(),")"),opacity:1,transition:"all ".concat(a," ").concat(c)}}},["".concat(t,"-disabled")]:{cursor:"not-allowed",[y]:{backgroundColor:u,borderColor:d,cursor:"not-allowed","&::after":{backgroundColor:m}},["".concat(t,"-input")]:{cursor:"not-allowed"},["".concat(t,"-disabled + span")]:{color:f,cursor:"not-allowed"},["&".concat(t,"-checked")]:{[y]:{"&::after":{transform:"scale(".concat(b(x).div(r).equal(),")")}}}},["span".concat(t," + *")]:{paddingInlineStart:p,paddingInlineEnd:p}})}},O=e=>{let{buttonColor:t,controlHeight:n,componentCls:o,lineWidth:r,lineType:a,colorBorder:l,motionDurationMid:c,buttonPaddingInline:i,fontSize:d,buttonBg:s,fontSizeLG:u,controlHeightLG:f,controlHeightSM:p,paddingXS:m,borderRadius:h,borderRadiusSM:v,borderRadiusLG:g,buttonCheckedBg:b,buttonSolidCheckedColor:y,colorTextDisabled:x,colorBgContainerDisabled:w,buttonCheckedBgDisabled:k,buttonCheckedColorDisabled:S,colorPrimary:Z,colorPrimaryHover:N,colorPrimaryActive:K,buttonSolidCheckedBg:O,buttonSolidCheckedHoverBg:I,buttonSolidCheckedActiveBg:R,calc:P}=e;return{["".concat(o,"-button-wrapper")]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:i,paddingBlock:0,color:t,fontSize:d,lineHeight:(0,C.bf)(P(n).sub(P(r).mul(2)).equal()),background:s,border:"".concat((0,C.bf)(r)," ").concat(a," ").concat(l),borderBlockStartWidth:P(r).add(.02).equal(),borderInlineEndWidth:r,cursor:"pointer",transition:["color ".concat(c),"background ".concat(c),"box-shadow ".concat(c)].join(","),a:{color:t},["> ".concat(o,"-button")]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:last-child)":{marginInlineEnd:P(r).mul(-1).equal()},"&:first-child":{borderInlineStart:"".concat((0,C.bf)(r)," ").concat(a," ").concat(l),borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h},"&:first-child:last-child":{borderRadius:h},["".concat(o,"-group-large &")]:{height:f,fontSize:u,lineHeight:(0,C.bf)(P(f).sub(P(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g}},["".concat(o,"-group-small &")]:{height:p,paddingInline:P(m).sub(r).equal(),paddingBlock:0,lineHeight:(0,C.bf)(P(p).sub(P(r).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},"&:hover":{position:"relative",color:Z},"&:has(:focus-visible)":(0,E.oN)(e),["".concat(o,"-inner, input[type='checkbox'], input[type='radio']")]:{width:0,height:0,opacity:0,pointerEvents:"none"},["&-checked:not(".concat(o,"-button-wrapper-disabled)")]:{zIndex:1,color:Z,background:b,borderColor:Z,"&::before":{backgroundColor:Z},"&:first-child":{borderColor:Z},"&:hover":{color:N,borderColor:N,"&::before":{backgroundColor:N}},"&:active":{color:K,borderColor:K,"&::before":{backgroundColor:K}}},["".concat(o,"-group-solid &-checked:not(").concat(o,"-button-wrapper-disabled)")]:{color:y,background:O,borderColor:O,"&:hover":{color:y,background:I,borderColor:I},"&:active":{color:y,background:R,borderColor:R}},"&-disabled":{color:x,backgroundColor:w,borderColor:l,cursor:"not-allowed","&:first-child, &:hover":{color:x,backgroundColor:w,borderColor:l}},["&-disabled".concat(o,"-button-wrapper-checked")]:{color:S,backgroundColor:k,borderColor:l,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}};var I=(0,S.I$)("Radio",e=>{let{controlOutline:t,controlOutlineWidth:n}=e,o="0 0 0 ".concat((0,C.bf)(n)," ").concat(t),r=(0,Z.IX)(e,{radioFocusShadow:o,radioButtonFocusShadow:o});return[N(r),K(r),O(r)]},e=>{let{wireframe:t,padding:n,marginXS:o,lineWidth:r,fontSizeLG:a,colorText:l,colorBgContainer:c,colorTextDisabled:i,controlItemBgActiveDisabled:d,colorTextLightSolid:s,colorPrimary:u,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e;return{radioSize:a,dotSize:t?a-8:a-(4+r)*2,dotColorDisabled:i,buttonSolidCheckedColor:s,buttonSolidCheckedBg:u,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:c,buttonCheckedBg:c,buttonColor:l,buttonCheckedBgDisabled:d,buttonCheckedColorDisabled:i,buttonPaddingInline:n-r,wrapperMarginInlineEnd:o,radioColor:t?u:m,radioBgColor:t?c:u}},{unitless:{radioSize:!0,dotSize:!0}}),R=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};let P=o.forwardRef((e,t)=>{var n,r;let l=o.useContext(f),c=o.useContext(m),{getPrefixCls:i,direction:u,radio:p}=o.useContext(d.E_),h=o.useRef(null),C=(0,g.sQ)(t,h),{isFormItemInput:E}=o.useContext(k.aM),{prefixCls:S,className:Z,rootClassName:N,children:K,style:O,title:P}=e,M=R(e,["prefixCls","className","rootClassName","children","style","title"]),T=i("radio",S),D="button"===((null==l?void 0:l.optionType)||c),L=D?"".concat(T,"-button"):T,j=(0,s.Z)(T),[B,H,z]=I(T,j),A=Object.assign({},M),W=o.useContext(w.Z);l&&(A.name=l.name,A.onChange=t=>{var n,o;null===(n=e.onChange)||void 0===n||n.call(e,t),null===(o=null==l?void 0:l.onChange)||void 0===o||o.call(l,t)},A.checked=e.value===l.value,A.disabled=null!==(n=A.disabled)&&void 0!==n?n:l.disabled),A.disabled=null!==(r=A.disabled)&&void 0!==r?r:W;let _=a()("".concat(L,"-wrapper"),{["".concat(L,"-wrapper-checked")]:A.checked,["".concat(L,"-wrapper-disabled")]:A.disabled,["".concat(L,"-wrapper-rtl")]:"rtl"===u,["".concat(L,"-wrapper-in-form-item")]:E,["".concat(L,"-wrapper-block")]:!!(null==l?void 0:l.block)},null==p?void 0:p.className,Z,N,H,z,j),[F,q]=(0,x.Z)(A.onClick);return B(o.createElement(b.Z,{component:"Radio",disabled:A.disabled},o.createElement("label",{className:_,style:Object.assign(Object.assign({},null==p?void 0:p.style),O),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:P,onClick:F},o.createElement(v.Z,Object.assign({},A,{className:a()(A.className,{[y.A]:!D}),type:"radio",prefixCls:L,ref:C,onClick:q})),void 0!==K?o.createElement("span",{className:"".concat(L,"-label")},K):null)))});var M=n(29487);let T=o.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r}=o.useContext(d.E_),{name:f}=o.useContext(k.aM),m=(0,l.Z)((0,M.S)(f)),{prefixCls:h,className:v,rootClassName:g,options:b,buttonStyle:y="outline",disabled:x,children:w,size:C,style:E,id:S,optionType:Z,name:N=m,defaultValue:K,value:O,block:R=!1,onChange:T,onMouseEnter:D,onMouseLeave:L,onFocus:j,onBlur:B}=e,[H,z]=(0,c.Z)(K,{value:O}),A=o.useCallback(t=>{let n=t.target.value;"value"in e||z(n),n!==H&&(null==T||T(t))},[H,z,T]),W=n("radio",h),_="".concat(W,"-group"),F=(0,s.Z)(W),[q,V,X]=I(W,F),U=w;b&&b.length>0&&(U=b.map(e=>"string"==typeof e||"number"==typeof e?o.createElement(P,{key:e.toString(),prefixCls:W,disabled:x,value:e,checked:H===e},e):o.createElement(P,{key:"radio-group-value-options-".concat(e.value),prefixCls:W,disabled:e.disabled||x,value:e.value,checked:H===e.value,title:e.title,style:e.style,className:e.className,id:e.id,required:e.required},e.label)));let G=(0,u.Z)(C),Y=a()(_,"".concat(_,"-").concat(y),{["".concat(_,"-").concat(G)]:G,["".concat(_,"-rtl")]:"rtl"===r,["".concat(_,"-block")]:R},v,g,V,X,F),$=o.useMemo(()=>({onChange:A,value:H,disabled:x,name:N,optionType:Z,block:R}),[A,H,x,N,Z,R]);return q(o.createElement("div",Object.assign({},(0,i.Z)(e,{aria:!0,data:!0}),{className:Y,style:E,onMouseEnter:D,onMouseLeave:L,onFocus:j,onBlur:B,id:S,ref:t}),o.createElement(p,{value:$},U)))});var D=o.memo(T),L=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},j=o.forwardRef((e,t)=>{let{getPrefixCls:n}=o.useContext(d.E_),{prefixCls:r}=e,a=L(e,["prefixCls"]),l=n("radio",r);return o.createElement(h,{value:"button"},o.createElement(P,Object.assign({prefixCls:l},a,{type:"radio",ref:t})))});P.Button=j,P.Group=D,P.__ANT_RADIO=!0;var B=P},56609:function(e,t,n){n.d(t,{Z:function(){return oj}});var o=n(2265),r={},a="rc-table-internal-hook",l=n(26365),c=n(58525),i=n(27380),d=n(16671),s=n(54887);function u(e){var t=o.createContext(void 0);return{Context:t,Provider:function(e){var n=e.value,r=e.children,a=o.useRef(n);a.current=n;var c=o.useState(function(){return{getValue:function(){return a.current},listeners:new Set}}),d=(0,l.Z)(c,1)[0];return(0,i.Z)(function(){(0,s.unstable_batchedUpdates)(function(){d.listeners.forEach(function(e){e(n)})})},[n]),o.createElement(t.Provider,{value:d},r)},defaultValue:e}}function f(e,t){var n=(0,c.Z)("function"==typeof t?t:function(e){if(void 0===t)return e;if(!Array.isArray(t))return e[t];var n={};return t.forEach(function(t){n[t]=e[t]}),n}),r=o.useContext(null==e?void 0:e.Context),a=r||{},s=a.listeners,u=a.getValue,f=o.useRef();f.current=n(r?u():null==e?void 0:e.defaultValue);var p=o.useState({}),m=(0,l.Z)(p,2)[1];return(0,i.Z)(function(){if(r)return s.add(e),function(){s.delete(e)};function e(e){var t=n(e);(0,d.Z)(f.current,t,!0)||m({})}},[r]),f.current}var p=n(1119),m=n(28791);function h(){var e=o.createContext(null);function t(){return o.useContext(e)}return{makeImmutable:function(n,r){var a=(0,m.Yr)(n),l=function(l,c){var i=a?{ref:c}:{},d=o.useRef(0),s=o.useRef(l);return null!==t()?o.createElement(n,(0,p.Z)({},l,i)):((!r||r(s.current,l))&&(d.current+=1),s.current=l,o.createElement(e.Provider,{value:d.current},o.createElement(n,(0,p.Z)({},l,i))))};return a?o.forwardRef(l):l},responseImmutable:function(e,n){var r=(0,m.Yr)(e),a=function(n,a){return t(),o.createElement(e,(0,p.Z)({},n,r?{ref:a}:{}))};return r?o.memo(o.forwardRef(a),n):o.memo(a,n)},useImmutableMark:t}}var v=h();v.makeImmutable,v.responseImmutable,v.useImmutableMark;var g=h(),b=g.makeImmutable,y=g.responseImmutable,x=g.useImmutableMark,w=u(),k=n(41154),C=n(31686),E=n(11993),S=n(36760),Z=n.n(S),N=n(6397),K=n(16847),O=n(32559),I=o.createContext({renderWithProps:!1});function R(e){var t=[],n={};return e.forEach(function(e){for(var o=e||{},r=o.key,a=o.dataIndex,l=r||(null==a?[]:Array.isArray(a)?a:[a]).join("-")||"RC_TABLE_KEY";n[l];)l="".concat(l,"_next");n[l]=!0,t.push(l)}),t}var P=n(74126),M=function(e){var t,n=e.ellipsis,r=e.rowType,a=e.children,l=!0===n?{showTitle:!0}:n;return l&&(l.showTitle||"header"===r)&&("string"==typeof a||"number"==typeof a?t=a.toString():o.isValidElement(a)&&"string"==typeof a.props.children&&(t=a.props.children)),t},T=o.memo(function(e){var t,n,r,a,c,i,s,u,m,h,v=e.component,g=e.children,b=e.ellipsis,y=e.scope,S=e.prefixCls,O=e.className,R=e.align,T=e.record,D=e.render,L=e.dataIndex,j=e.renderIndex,B=e.shouldCellUpdate,H=e.index,z=e.rowType,A=e.colSpan,W=e.rowSpan,_=e.fixLeft,F=e.fixRight,q=e.firstFixLeft,V=e.lastFixLeft,X=e.firstFixRight,U=e.lastFixRight,G=e.appendNode,Y=e.additionalProps,$=void 0===Y?{}:Y,J=e.isSticky,Q="".concat(S,"-cell"),ee=f(w,["supportSticky","allColumnsFixedLeft","rowHoverable"]),et=ee.supportSticky,en=ee.allColumnsFixedLeft,eo=ee.rowHoverable,er=(t=o.useContext(I),n=x(),(0,N.Z)(function(){if(null!=g)return[g];var e=null==L||""===L?[]:Array.isArray(L)?L:[L],n=(0,K.Z)(T,e),r=n,a=void 0;if(D){var l=D(n,T,j);!l||"object"!==(0,k.Z)(l)||Array.isArray(l)||o.isValidElement(l)?r=l:(r=l.children,a=l.props,t.renderWithProps=!0)}return[r,a]},[n,T,g,L,D,j],function(e,n){if(B){var o=(0,l.Z)(e,2)[1];return B((0,l.Z)(n,2)[1],o)}return!!t.renderWithProps||!(0,d.Z)(e,n,!0)})),ea=(0,l.Z)(er,2),el=ea[0],ec=ea[1],ei={},ed="number"==typeof _&&et,es="number"==typeof F&&et;ed&&(ei.position="sticky",ei.left=_),es&&(ei.position="sticky",ei.right=F);var eu=null!==(r=null!==(a=null!==(c=null==ec?void 0:ec.colSpan)&&void 0!==c?c:$.colSpan)&&void 0!==a?a:A)&&void 0!==r?r:1,ef=null!==(i=null!==(s=null!==(u=null==ec?void 0:ec.rowSpan)&&void 0!==u?u:$.rowSpan)&&void 0!==s?s:W)&&void 0!==i?i:1,ep=f(w,function(e){var t,n;return[(t=ef||1,n=e.hoverStartRow,H<=e.hoverEndRow&&H+t-1>=n),e.onHover]}),em=(0,l.Z)(ep,2),eh=em[0],ev=em[1],eg=(0,P.zX)(function(e){var t;T&&ev(H,H+ef-1),null==$||null===(t=$.onMouseEnter)||void 0===t||t.call($,e)}),eb=(0,P.zX)(function(e){var t;T&&ev(-1,-1),null==$||null===(t=$.onMouseLeave)||void 0===t||t.call($,e)});if(0===eu||0===ef)return null;var ey=null!==(m=$.title)&&void 0!==m?m:M({rowType:z,ellipsis:b,children:el}),ex=Z()(Q,O,(h={},(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(h,"".concat(Q,"-fix-left"),ed&&et),"".concat(Q,"-fix-left-first"),q&&et),"".concat(Q,"-fix-left-last"),V&&et),"".concat(Q,"-fix-left-all"),V&&en&&et),"".concat(Q,"-fix-right"),es&&et),"".concat(Q,"-fix-right-first"),X&&et),"".concat(Q,"-fix-right-last"),U&&et),"".concat(Q,"-ellipsis"),b),"".concat(Q,"-with-append"),G),"".concat(Q,"-fix-sticky"),(ed||es)&&J&&et),(0,E.Z)(h,"".concat(Q,"-row-hover"),!ec&&eh)),$.className,null==ec?void 0:ec.className),ew={};R&&(ew.textAlign=R);var ek=(0,C.Z)((0,C.Z)((0,C.Z)((0,C.Z)({},null==ec?void 0:ec.style),ei),ew),$.style),eC=el;return"object"!==(0,k.Z)(eC)||Array.isArray(eC)||o.isValidElement(eC)||(eC=null),b&&(V||X)&&(eC=o.createElement("span",{className:"".concat(Q,"-content")},eC)),o.createElement(v,(0,p.Z)({},ec,$,{className:ex,style:ek,title:ey,scope:y,onMouseEnter:eo?eg:void 0,onMouseLeave:eo?eb:void 0,colSpan:1!==eu?eu:null,rowSpan:1!==ef?ef:null}),G,eC)});function D(e,t,n,o,r){var a,l,c=n[e]||{},i=n[t]||{};"left"===c.fixed?a=o.left["rtl"===r?t:e]:"right"===i.fixed&&(l=o.right["rtl"===r?e:t]);var d=!1,s=!1,u=!1,f=!1,p=n[t+1],m=n[e-1],h=p&&!p.fixed||m&&!m.fixed||n.every(function(e){return"left"===e.fixed});return"rtl"===r?void 0!==a?f=!(m&&"left"===m.fixed)&&h:void 0!==l&&(u=!(p&&"right"===p.fixed)&&h):void 0!==a?d=!(p&&"left"===p.fixed)&&h:void 0!==l&&(s=!(m&&"right"===m.fixed)&&h),{fixLeft:a,fixRight:l,lastFixLeft:d,firstFixRight:s,lastFixRight:u,firstFixLeft:f,isSticky:o.isSticky}}var L=o.createContext({}),j=n(6989),B=["children"];function H(e){return e.children}H.Row=function(e){var t=e.children,n=(0,j.Z)(e,B);return o.createElement("tr",n,t)},H.Cell=function(e){var t=e.className,n=e.index,r=e.children,a=e.colSpan,l=void 0===a?1:a,c=e.rowSpan,i=e.align,d=f(w,["prefixCls","direction"]),s=d.prefixCls,u=d.direction,m=o.useContext(L),h=m.scrollColumnIndex,v=m.stickyOffsets,g=m.flattenColumns,b=n+l-1+1===h?l+1:l,y=D(n,n+b-1,g,v,u);return o.createElement(T,(0,p.Z)({className:t,index:n,component:"td",prefixCls:s,record:null,dataIndex:null,align:i,colSpan:b,rowSpan:c,render:function(){return r}},y))};var z=y(function(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,a=f(w,"prefixCls"),l=r.length-1,c=r[l],i=o.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:null!=c&&c.scrollbar?l:null}},[c,r,l,n]);return o.createElement(L.Provider,{value:i},o.createElement("tfoot",{className:"".concat(a,"-summary")},t))}),A=n(31474),W=n(10281),_=n(3208),F=n(18242);function q(e,t,n,r){return o.useMemo(function(){if(null!=n&&n.size){for(var o=[],a=0;a<(null==e?void 0:e.length);a+=1)!function e(t,n,o,r,a,l,c){var i=l(n,c);t.push({record:n,indent:o,index:c,rowKey:i});var d=null==a?void 0:a.has(i);if(n&&Array.isArray(n[r])&&d)for(var s=0;s1?n-1:0),r=1;r5&&void 0!==arguments[5]?arguments[5]:[],d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=e.record,u=e.prefixCls,f=e.columnsKey,p=e.fixedInfoList,m=e.expandIconColumnIndex,h=e.nestExpandable,v=e.indentSize,g=e.expandIcon,b=e.expanded,y=e.hasNestChildren,x=e.onTriggerExpand,w=e.expandable,k=e.expandedKeys,C=f[n],E=p[n];n===(m||0)&&h&&(c=o.createElement(o.Fragment,null,o.createElement("span",{style:{paddingLeft:"".concat(v*r,"px")},className:"".concat(u,"-row-indent indent-level-").concat(r)}),g({prefixCls:u,expanded:b,expandable:y,record:s,onExpand:x})));var S=(null===(l=t.onCell)||void 0===l?void 0:l.call(t,s,a))||{};if(d){var Z=S.rowSpan,N=void 0===Z?1:Z;if(w&&N&&n=1)),style:(0,C.Z)((0,C.Z)({},r),null==k?void 0:k.style)}),y.map(function(e,t){var n=e.render,r=e.dataIndex,i=e.className,s=Y(g,e,t,u,l,d,null==v?void 0:v.offset),f=s.key,y=s.fixedInfo,x=s.appendCellNode,w=s.additionalCellProps;return o.createElement(T,(0,p.Z)({className:i,ellipsis:e.ellipsis,align:e.align,scope:e.rowScope,component:e.rowScope?h:m,prefixCls:b,key:f,record:a,index:l,renderIndex:c,dataIndex:r,render:n,shouldCellUpdate:e.shouldCellUpdate},y,{appendNode:x,additionalProps:w}))}));if(N&&(K.current||S)){var R=w(a,l,u+1,S);t=o.createElement(X,{expanded:S,className:Z()("".concat(b,"-expanded-row"),"".concat(b,"-expanded-row-level-").concat(u+1),O),prefixCls:b,component:f,cellComponent:m,colSpan:v?v.colSpan:y.length,stickyOffset:null==v?void 0:v.sticky,isEmpty:!1},R)}return o.createElement(o.Fragment,null,I,t)});function J(e){var t=e.columnKey,n=e.onColumnResize,r=e.prefixCls,a=e.title,l=o.useRef();return(0,i.Z)(function(){l.current&&n(t,l.current.offsetWidth)},[]),o.createElement(A.Z,{data:t},o.createElement("th",{ref:l,className:"".concat(r,"-measure-cell")},o.createElement("div",{className:"".concat(r,"-measure-cell-content")},a||"\xa0")))}var Q=n(2857);function ee(e){var t=e.prefixCls,n=e.columnsKey,r=e.onColumnResize,a=e.columns,l=o.useRef(null),c=f(w,["measureRowRender"]).measureRowRender,i=o.createElement("tr",{"aria-hidden":"true",className:"".concat(t,"-measure-row"),ref:l,tabIndex:-1},o.createElement(A.Z.Collection,{onBatchResize:function(e){(0,Q.Z)(l.current)&&e.forEach(function(e){r(e.data,e.size.offsetWidth)})}},n.map(function(e){var n=a.find(function(t){return t.key===e}),l=null==n?void 0:n.title,c=o.isValidElement(l)?o.cloneElement(l,{ref:null}):l;return o.createElement(J,{prefixCls:t,key:e,columnKey:e,onColumnResize:r,title:c})})));return c?c(i):i}var et=y(function(e){var t,n=e.data,r=e.measureColumnWidth,a=f(w,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode","expandedRowOffset","fixedInfoList","colWidths"]),l=a.prefixCls,c=a.getComponent,i=a.onColumnResize,d=a.flattenColumns,s=a.getRowKey,u=a.expandedKeys,p=a.childrenColumnName,m=a.emptyNode,h=a.expandedRowOffset,v=void 0===h?0:h,g=a.colWidths,b=q(n,p,u,s),y=o.useMemo(function(){return b.map(function(e){return e.rowKey})},[b]),x=o.useRef({renderWithProps:!1}),k=o.useMemo(function(){for(var e=d.length-v,t=0,n=0;n=0;d-=1){var s=t[d],u=n&&n[d],m=void 0,h=void 0;if(u&&(m=u[eo],"auto"===a&&(h=u.minWidth)),s||h||m||i){var v=m||{},g=(v.columnType,(0,j.Z)(v,er));l.unshift(o.createElement("col",(0,p.Z)({key:d,style:{width:s,minWidth:h}},g))),i=!0}}return l.length>0?o.createElement("colgroup",null,l):null},el=n(83145),ec=["className","noData","columns","flattenColumns","colWidths","colGroup","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","scrollX","tableLayout","onScroll","children"],ei=o.forwardRef(function(e,t){var n=e.className,r=e.noData,a=e.columns,l=e.flattenColumns,c=e.colWidths,i=e.colGroup,d=e.columCount,s=e.stickyOffsets,u=e.direction,p=e.fixHeader,h=e.stickyTopOffset,v=e.stickyBottomOffset,g=e.stickyClassName,b=e.scrollX,y=e.tableLayout,x=e.onScroll,k=e.children,S=(0,j.Z)(e,ec),N=f(w,["prefixCls","scrollbarSize","isSticky","getComponent"]),K=N.prefixCls,O=N.scrollbarSize,I=N.isSticky,R=(0,N.getComponent)(["header","table"],"table"),P=I&&!p?0:O,M=o.useRef(null),T=o.useCallback(function(e){(0,m.mH)(t,e),(0,m.mH)(M,e)},[]);o.useEffect(function(){function e(e){var t=e.currentTarget,n=e.deltaX;n&&(x({currentTarget:t,scrollLeft:t.scrollLeft+n}),e.preventDefault())}var t=M.current;return null==t||t.addEventListener("wheel",e,{passive:!1}),function(){null==t||t.removeEventListener("wheel",e)}},[]);var D=l[l.length-1],L={fixed:D?D.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(K,"-cell-scrollbar")}}},B=(0,o.useMemo)(function(){return P?[].concat((0,el.Z)(a),[L]):a},[P,a]),H=(0,o.useMemo)(function(){return P?[].concat((0,el.Z)(l),[L]):l},[P,l]),z=(0,o.useMemo)(function(){var e=s.right,t=s.left;return(0,C.Z)((0,C.Z)({},s),{},{left:"rtl"===u?[].concat((0,el.Z)(t.map(function(e){return e+P})),[0]):t,right:"rtl"===u?e:[].concat((0,el.Z)(e.map(function(e){return e+P})),[0]),isSticky:I})},[P,s,I]),A=(0,o.useMemo)(function(){for(var e=[],t=0;t1?"colgroup":"col":null,ellipsis:l.ellipsis,align:l.align,component:c,prefixCls:u,key:h[t]},i,{additionalProps:n,rowType:"header"}))}))},eu=y(function(e){var t=e.stickyOffsets,n=e.columns,r=e.flattenColumns,a=e.onHeaderRow,l=f(w,["prefixCls","getComponent"]),c=l.prefixCls,i=l.getComponent,d=o.useMemo(function(){return function(e){var t=[];!function e(n,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t[r]=t[r]||[];var a=o;return n.filter(Boolean).map(function(n){var o={key:n.key,className:n.className||"",children:n.title,column:n,colStart:a},l=1,c=n.children;return c&&c.length>0&&(l=e(c,a,r+1).reduce(function(e,t){return e+t},0),o.hasSubColumns=!0),"colSpan"in n&&(l=n.colSpan),"rowSpan"in n&&(o.rowSpan=n.rowSpan),o.colSpan=l,o.colEnd=o.colStart+l-1,t[r].push(o),a+=l,l})}(e,0);for(var n=t.length,o=function(e){t[e].forEach(function(t){("rowSpan"in t)||t.hasSubColumns||(t.rowSpan=n-e)})},r=0;r1&&void 0!==arguments[1]?arguments[1]:"";return"number"==typeof t?t:t.endsWith("%")?e*parseFloat(t)/100:null}var em=["children"],eh=["fixed"];function ev(e){return(0,ef.Z)(e).filter(function(e){return o.isValidElement(e)}).map(function(e){var t=e.key,n=e.props,o=n.children,r=(0,j.Z)(n,em),a=(0,C.Z)({key:t},r);return o&&(a.children=ev(o)),a})}function eg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key";return e.filter(function(e){return e&&"object"===(0,k.Z)(e)}).reduce(function(e,n,o){var r=n.fixed,a=!0===r?"left":r,l="".concat(t,"-").concat(o),c=n.children;return c&&c.length>0?[].concat((0,el.Z)(e),(0,el.Z)(eg(c,l).map(function(e){var t;return(0,C.Z)((0,C.Z)({},e),{},{fixed:null!==(t=e.fixed)&&void 0!==t?t:a})}))):[].concat((0,el.Z)(e),[(0,C.Z)((0,C.Z)({key:l},n),{},{fixed:a})])},[])}var eb=function(e,t){var n=e.prefixCls,a=e.columns,c=e.children,i=e.expandable,d=e.expandedKeys,s=e.columnTitle,u=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,m=e.rowExpandable,h=e.expandIconColumnIndex,v=e.expandedRowOffset,g=void 0===v?0:v,b=e.direction,y=e.expandRowByClick,x=e.columnWidth,w=e.fixed,S=e.scrollWidth,Z=e.clientWidth,N=o.useMemo(function(){return function e(t){return t.filter(function(e){return e&&"object"===(0,k.Z)(e)&&!e.hidden}).map(function(t){var n=t.children;return n&&n.length>0?(0,C.Z)((0,C.Z)({},t),{},{children:e(n)}):t})}((a||ev(c)||[]).slice())},[a,c]),K=o.useMemo(function(){if(i){var e,t=N.slice();if(!t.includes(r)){var a=h||0,l=0===a&&"right"===w?N.length:a;l>=0&&t.splice(l,0,r)}var c=t.indexOf(r);t=t.filter(function(e,t){return e!==r||t===c});var v=N[c];e=w||(v?v.fixed:null);var b=(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)({},eo,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",s),"fixed",e),"className","".concat(n,"-row-expand-icon-cell")),"width",x),"render",function(e,t,r){var a=u(t,r),l=p({prefixCls:n,expanded:d.has(a),expandable:!m||m(t),record:t,onExpand:f});return y?o.createElement("span",{onClick:function(e){return e.stopPropagation()}},l):l});return t.map(function(e,t){var n=e===r?b:e;return t=0;t-=1){var n=I[t].fixed;if("left"===n||!0===n){e=t;break}}if(e>=0)for(var o=0;o<=e;o+=1){var r=I[o].fixed;if("left"!==r&&!0!==r)return!0}var a=I.findIndex(function(e){return"right"===e.fixed});if(a>=0){for(var l=a;l0){var e=0,t=0;I.forEach(function(n){var o=ep(S,n.width);o?e+=o:t+=1});var n=Math.max(S,Z),o=Math.max(n-e,t),r=t,a=o/t,l=0,c=I.map(function(e){var t=(0,C.Z)({},e),n=ep(S,t.width);if(n)t.width=n;else{var c=Math.floor(a);t.width=1===r?o:c,o-=c,r-=1}return l+=t.width,t});if(l=n-h})})}})},z=function(e){I(function(t){return(0,C.Z)((0,C.Z)({},t),{},{scrollLeft:y?e/y*x:0})})};return(o.useImperativeHandle(t,function(){return{setScrollLeft:z,checkScrollBarVisible:H}}),o.useEffect(function(){var e=ew(document.body,"mouseup",j,!1),t=ew(document.body,"mousemove",B,!1);return H(),function(){e.remove(),t.remove()}},[k,T]),o.useEffect(function(){if(p.current){for(var e=[],t=(0,eC.bn)(p.current);t;)e.push(t),t=t.parentElement;return e.forEach(function(e){return e.addEventListener("scroll",H,!1)}),window.addEventListener("resize",H,!1),window.addEventListener("scroll",H,!1),v.addEventListener("scroll",H,!1),function(){e.forEach(function(e){return e.removeEventListener("scroll",H)}),window.removeEventListener("resize",H),window.removeEventListener("scroll",H),v.removeEventListener("scroll",H)}}},[v]),o.useEffect(function(){O.isHiddenScrollBar||I(function(e){var t=p.current;return t?(0,C.Z)((0,C.Z)({},e),{},{scrollLeft:t.scrollLeft/t.scrollWidth*t.clientWidth}):e})},[O.isHiddenScrollBar]),y<=x||!k||O.isHiddenScrollBar)?null:o.createElement("div",{style:{height:(0,_.Z)(),width:x,bottom:h},className:"".concat(b,"-sticky-scroll")},o.createElement("div",{onMouseDown:function(e){e.persist(),R.current.delta=e.pageX-O.scrollLeft,R.current.x=0,D(!0),e.preventDefault()},ref:S,className:Z()("".concat(b,"-sticky-scroll-bar"),(0,E.Z)({},"".concat(b,"-sticky-scroll-bar-active"),T)),style:{width:"".concat(k,"px"),transform:"translate3d(".concat(O.scrollLeft,"px, 0, 0)")}}))}),eZ="rc-table",eN=[],eK={};function eO(){return"No Data"}var eI=o.forwardRef(function(e,t){var n,r=(0,C.Z)({rowKey:"key",prefixCls:eZ,emptyText:eO},e),s=r.prefixCls,u=r.className,f=r.rowClassName,m=r.style,h=r.data,v=r.rowKey,g=r.scroll,b=r.tableLayout,y=r.direction,x=r.title,S=r.footer,O=r.summary,I=r.caption,P=r.id,M=r.showHeader,T=r.components,L=r.emptyText,B=r.onRow,q=r.onHeaderRow,V=r.measureRowRender,X=r.onScroll,G=r.internalHooks,Y=r.transformColumns,$=r.internalRefs,J=r.tailor,Q=r.getContainerWidth,ee=r.sticky,eo=r.rowHoverable,er=void 0===eo||eo,ec=h||eN,ei=!!ec.length,es=G===a,ef=o.useCallback(function(e,t){return(0,K.Z)(T,e)||t},[T]),ep=o.useMemo(function(){return"function"==typeof v?v:function(e){return e&&e[v]}},[v]),em=ef(["body"]),eh=(tU=o.useState(-1),tY=(tG=(0,l.Z)(tU,2))[0],t$=tG[1],tJ=o.useState(-1),t0=(tQ=(0,l.Z)(tJ,2))[0],t1=tQ[1],[tY,t0,o.useCallback(function(e,t){t$(e),t1(t)},[])]),ev=(0,l.Z)(eh,3),eg=ev[0],ew=ev[1],ek=ev[2],eE=(t8=(t3=r.expandable,t4=(0,j.Z)(r,en),!1===(t2="expandable"in r?(0,C.Z)((0,C.Z)({},t4),t3):t4).showExpandColumn&&(t2.expandIconColumnIndex=-1),t2).expandIcon,t6=t2.expandedRowKeys,t5=t2.defaultExpandedRowKeys,t7=t2.defaultExpandAllRows,t9=t2.expandedRowRender,ne=t2.onExpand,nt=t2.onExpandedRowsChange,nn=t2.childrenColumnName||"children",no=o.useMemo(function(){return t9?"row":!!(r.expandable&&r.internalHooks===a&&r.expandable.__PARENT_RENDER_ICON__||ec.some(function(e){return e&&"object"===(0,k.Z)(e)&&e[nn]}))&&"nest"},[!!t9,ec]),nr=o.useState(function(){if(t5)return t5;if(t7){var e;return e=[],function t(n){(n||[]).forEach(function(n,o){e.push(ep(n,o)),t(n[nn])})}(ec),e}return[]}),nl=(na=(0,l.Z)(nr,2))[0],nc=na[1],ni=o.useMemo(function(){return new Set(t6||nl||[])},[t6,nl]),nd=o.useCallback(function(e){var t,n=ep(e,ec.indexOf(e)),o=ni.has(n);o?(ni.delete(n),t=(0,el.Z)(ni)):t=[].concat((0,el.Z)(ni),[n]),nc(t),ne&&ne(!o,e),nt&&nt(t)},[ep,ni,ec,ne,nt]),[t2,no,ni,t8||U,nn,nd]),eI=(0,l.Z)(eE,6),eR=eI[0],eP=eI[1],eM=eI[2],eT=eI[3],eD=eI[4],eL=eI[5],ej=null==g?void 0:g.x,eB=o.useState(0),eH=(0,l.Z)(eB,2),ez=eH[0],eA=eH[1],eW=eb((0,C.Z)((0,C.Z)((0,C.Z)({},r),eR),{},{expandable:!!eR.expandedRowRender,columnTitle:eR.columnTitle,expandedKeys:eM,getRowKey:ep,onTriggerExpand:eL,expandIcon:eT,expandIconColumnIndex:eR.expandIconColumnIndex,direction:y,scrollWidth:es&&J&&"number"==typeof ej?ej:null,clientWidth:ez}),es?Y:null),e_=(0,l.Z)(eW,4),eF=e_[0],eq=e_[1],eV=e_[2],eX=e_[3],eU=null!=eV?eV:ej,eG=o.useMemo(function(){return{columns:eF,flattenColumns:eq}},[eF,eq]),eY=o.useRef(),e$=o.useRef(),eJ=o.useRef(),eQ=o.useRef();o.useImperativeHandle(t,function(){return{nativeElement:eY.current,scrollTo:function(e){var t;if(eJ.current instanceof HTMLElement){var n=e.index,o=e.top,r=e.key;if("number"!=typeof o||Number.isNaN(o)){var a,l,c=null!=r?r:ep(ec[n]);null===(l=eJ.current.querySelector('[data-row-key="'.concat(c,'"]')))||void 0===l||l.scrollIntoView()}else null===(a=eJ.current)||void 0===a||a.scrollTo({top:o})}else null!==(t=eJ.current)&&void 0!==t&&t.scrollTo&&eJ.current.scrollTo(e)}}});var e0=o.useRef(),e1=o.useState(!1),e2=(0,l.Z)(e1,2),e3=e2[0],e4=e2[1],e8=o.useState(!1),e6=(0,l.Z)(e8,2),e5=e6[0],e7=e6[1],e9=o.useState(new Map),te=(0,l.Z)(e9,2),tt=te[0],tn=te[1],to=R(eq).map(function(e){return tt.get(e)}),tr=o.useMemo(function(){return to},[to.join("_")]),ta=(0,o.useMemo)(function(){var e=eq.length,t=function(e,t,n){for(var o=[],r=0,a=e;a!==t;a+=n)o.push(r),eq[a].fixed&&(r+=tr[a]||0);return o},n=t(0,e,1),o=t(e-1,-1,-1).reverse();return"rtl"===y?{left:o,right:n}:{left:n,right:o}},[tr,eq,y]),tl=g&&null!=g.y,tc=g&&null!=eU||!!eR.fixed,ti=tc&&eq.some(function(e){return e.fixed}),td=o.useRef(),ts=(nf=void 0===(nu=(ns="object"===(0,k.Z)(ee)?ee:{}).offsetHeader)?0:nu,nm=void 0===(np=ns.offsetSummary)?0:np,nv=void 0===(nh=ns.offsetScroll)?0:nh,nb=(void 0===(ng=ns.getContainer)?function(){return ey}:ng)()||ey,ny=!!ee,o.useMemo(function(){return{isSticky:ny,stickyClassName:ny?"".concat(s,"-sticky-holder"):"",offsetHeader:nf,offsetSummary:nm,offsetScroll:nv,container:nb}},[ny,nv,nf,nm,s,nb])),tu=ts.isSticky,tf=ts.offsetHeader,tp=ts.offsetSummary,tm=ts.offsetScroll,th=ts.stickyClassName,tv=ts.container,tg=o.useMemo(function(){return null==O?void 0:O(ec)},[O,ec]),tb=(tl||tu)&&o.isValidElement(tg)&&tg.type===H&&tg.props.fixed;tl&&(nw={overflowY:ei?"scroll":"auto",maxHeight:g.y}),tc&&(nx={overflowX:"auto"},tl||(nw={overflowY:"hidden"}),nk={width:!0===eU?"auto":eU,minWidth:"100%"});var ty=o.useCallback(function(e,t){tn(function(n){if(n.get(e)!==t){var o=new Map(n);return o.set(e,t),o}return n})},[]),tx=function(e){var t=(0,o.useRef)(null),n=(0,o.useRef)();function r(){window.clearTimeout(n.current)}return(0,o.useEffect)(function(){return r},[]),[function(e){t.current=e,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)},function(){return t.current}]}(0),tw=(0,l.Z)(tx,2),tk=tw[0],tC=tw[1];function tE(e,t){t&&("function"==typeof t?t(e):t.scrollLeft!==e&&(t.scrollLeft=e,t.scrollLeft!==e&&setTimeout(function(){t.scrollLeft=e},0)))}var tS=(0,c.Z)(function(e){var t,n=e.currentTarget,o=e.scrollLeft,r="rtl"===y,a="number"==typeof o?o:n.scrollLeft,l=n||eK;tC()&&tC()!==l||(tk(l),tE(a,e$.current),tE(a,eJ.current),tE(a,e0.current),tE(a,null===(t=td.current)||void 0===t?void 0:t.setScrollLeft));var c=n||e$.current;if(c){var i=es&&J&&"number"==typeof eU?eU:c.scrollWidth,d=c.clientWidth;if(i===d){e4(!1),e7(!1);return}r?(e4(-a0)):(e4(a>0),e7(a1?x-D:0,pointerEvents:"auto"}),j=o.useMemo(function(){return h?M<=1:0===R||0===M||M>1},[M,R,h]);j?L.visibility="hidden":h&&(L.height=null==v?void 0:v(M));var B={};return(0===M||0===R)&&(B.rowSpan=1,B.colSpan=1),o.createElement(T,(0,p.Z)({className:Z()(y,m),ellipsis:r.ellipsis,align:r.align,scope:r.rowScope,component:i,prefixCls:n.prefixCls,key:E,record:s,index:c,renderIndex:d,dataIndex:b,render:j?function(){return null}:g,shouldCellUpdate:r.shouldCellUpdate},S,{appendNode:N,additionalProps:(0,C.Z)((0,C.Z)({},K),{},{style:L},B)}))},eL=["data","index","className","rowKey","style","extra","getHeight"],ej=y(o.forwardRef(function(e,t){var n,r=e.data,a=e.index,l=e.className,c=e.rowKey,i=e.style,d=e.extra,s=e.getHeight,u=(0,j.Z)(e,eL),m=r.record,h=r.indent,v=r.index,g=f(w,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),b=g.scrollX,y=g.flattenColumns,x=g.prefixCls,k=g.fixColumn,S=g.componentWidth,N=f(eM,["getComponent"]).getComponent,K=V(m,c,a,h),O=N(["body","row"],"div"),I=N(["body","cell"],"div"),R=K.rowSupportExpand,P=K.expanded,M=K.rowProps,D=K.expandedRowRender,L=K.expandedRowClassName;if(R&&P){var B=D(m,a,h+1,P),H=G(L,m,a,h),z={};k&&(z={style:(0,E.Z)({},"--virtual-width","".concat(S,"px"))});var A="".concat(x,"-expanded-row-cell");n=o.createElement(O,{className:Z()("".concat(x,"-expanded-row"),"".concat(x,"-expanded-row-level-").concat(h+1),H)},o.createElement(T,{component:I,prefixCls:x,className:Z()(A,(0,E.Z)({},"".concat(A,"-fixed"),k)),additionalProps:z},B))}var W=(0,C.Z)((0,C.Z)({},i),{},{width:b});d&&(W.position="absolute",W.pointerEvents="none");var _=o.createElement(O,(0,p.Z)({},M,u,{"data-row-key":c,ref:R?null:t,className:Z()(l,"".concat(x,"-row"),null==M?void 0:M.className,(0,E.Z)({},"".concat(x,"-row-extra"),d)),style:(0,C.Z)((0,C.Z)({},W),null==M?void 0:M.style)}),y.map(function(e,t){return o.createElement(eD,{key:t,component:I,rowInfo:K,column:e,colIndex:t,indent:h,index:a,renderIndex:v,record:m,inverse:d,getHeight:s})}));return R?o.createElement("div",{ref:t},_,n):_})),eB=y(o.forwardRef(function(e,t){var n=e.data,r=e.onScroll,a=f(w,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),c=a.flattenColumns,i=a.onColumnResize,d=a.getRowKey,s=a.expandedKeys,u=a.prefixCls,p=a.childrenColumnName,m=a.scrollX,h=a.direction,v=f(eM),g=v.sticky,b=v.scrollY,y=v.listItemHeight,x=v.getComponent,C=v.onScroll,E=o.useRef(),S=q(n,p,s,d),Z=o.useMemo(function(){var e=0;return c.map(function(t){var n=t.width,o=t.minWidth,r=t.key,a=Math.max(n||0,o||0);return e+=a,[r,a,e]})},[c]),N=o.useMemo(function(){return Z.map(function(e){return e[2]})},[Z]);o.useEffect(function(){Z.forEach(function(e){var t=(0,l.Z)(e,2);i(t[0],t[1])})},[Z]),o.useImperativeHandle(t,function(){var e,t={scrollTo:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo(e)},nativeElement:null===(e=E.current)||void 0===e?void 0:e.nativeElement};return Object.defineProperty(t,"scrollLeft",{get:function(){var e;return(null===(e=E.current)||void 0===e?void 0:e.getScrollInfo().x)||0},set:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo({left:e})}}),Object.defineProperty(t,"scrollTop",{get:function(){var e;return(null===(e=E.current)||void 0===e?void 0:e.getScrollInfo().y)||0},set:function(e){var t;null===(t=E.current)||void 0===t||t.scrollTo({top:e})}}),t});var K=function(e,t){var n=null===(r=S[t])||void 0===r?void 0:r.record,o=e.onCell;if(o){var r,a,l=o(n,t);return null!==(a=null==l?void 0:l.rowSpan)&&void 0!==a?a:1}return 1},O=o.useMemo(function(){return{columnsOffset:N}},[N]),I="".concat(u,"-tbody"),R=x(["body","wrapper"]),P={};return g&&(P.position="sticky",P.bottom=0,"object"===(0,k.Z)(g)&&g.offsetScroll&&(P.bottom=g.offsetScroll)),o.createElement(eT.Provider,{value:O},o.createElement(eP.Z,{fullHeight:!1,ref:E,prefixCls:"".concat(I,"-virtual"),styles:{horizontalScrollBar:P},className:I,height:b,itemHeight:y||24,data:S,itemKey:function(e){return d(e.record)},component:R,scrollWidth:m,direction:h,onVirtualScroll:function(e){var t,n=e.x;r({currentTarget:null===(t=E.current)||void 0===t?void 0:t.nativeElement,scrollLeft:n})},onScroll:C,extraRender:function(e){var t=e.start,n=e.end,r=e.getSize,a=e.offsetY;if(n<0)return null;for(var l=c.filter(function(e){return 0===K(e,t)}),i=t,s=function(e){if(!(l=l.filter(function(t){return 0===K(t,e)})).length)return i=e,1},u=t;u>=0&&!s(u);u-=1);for(var f=c.filter(function(e){return 1!==K(e,n)}),p=n,m=function(e){if(!(f=f.filter(function(t){return 1!==K(t,e)})).length)return p=Math.max(e-1,n),1},h=n;h1})&&v.push(e)},b=i;b<=p;b+=1)if(g(b))continue;return v.map(function(e){var t=S[e],n=d(t.record,e),l=r(n);return o.createElement(ej,{key:e,data:t,rowKey:n,index:e,style:{top:-a+l.top},extra:!0,getHeight:function(t){var o=e+t-1,a=r(n,d(S[o].record,o));return a.bottom-a.top}})})}},function(e,t,n){var r=d(e.record,t);return o.createElement(ej,{data:e,rowKey:r,index:t,style:n.style})}))})),eH=function(e,t){var n=t.ref,r=t.onScroll;return o.createElement(eB,{ref:n,data:e,onScroll:r})},ez=o.forwardRef(function(e,t){var n=e.data,r=e.columns,l=e.scroll,c=e.sticky,i=e.prefixCls,d=void 0===i?eZ:i,s=e.className,u=e.listItemHeight,f=e.components,m=e.onScroll,h=l||{},v=h.x,g=h.y;"number"!=typeof v&&(v=1),"number"!=typeof g&&(g=500);var b=(0,P.zX)(function(e,t){return(0,K.Z)(f,e)||t}),y=(0,P.zX)(m),x=o.useMemo(function(){return{sticky:c,scrollY:g,listItemHeight:u,getComponent:b,onScroll:y}},[c,g,u,b,y]);return o.createElement(eM.Provider,{value:x},o.createElement(eR,(0,p.Z)({},e,{className:Z()(s,"".concat(d,"-virtual")),scroll:(0,C.Z)((0,C.Z)({},l),{},{x:v}),components:(0,C.Z)((0,C.Z)({},f),{},{body:null!=n&&n.length?eH:void 0}),columns:r,internalHooks:a,tailor:!0,ref:t})))});b(ez,void 0);var eA=n(70464),eW=o.createContext(null),e_=o.createContext({}),eF=o.memo(function(e){for(var t=e.prefixCls,n=e.level,r=e.isStart,a=e.isEnd,l="".concat(t,"-indent-unit"),c=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:null;return n.map(function(d,s){for(var u,f=eX(o?o.pos:"0",s),p=eU(d[a],f),m=0;m1&&void 0!==arguments[1]?arguments[1]:{},f=u.initWrapper,p=u.processEntity,m=u.onProcessFinished,h=u.externalGetKey,v=u.childrenPropName,g=u.fieldNames,b=arguments.length>2?arguments[2]:void 0,y={},x={},w={posEntities:y,keyEntities:x};return f&&(w=f(w)||w),t=function(e){var t=e.node,n=e.index,o=e.pos,r=e.key,a=e.parentPos,l=e.level,c={node:t,nodes:e.nodes,index:n,key:r,pos:o,level:l},i=eU(r,o);y[o]=c,x[i]=c,c.parent=y[a],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),p&&p(c,w)},n={externalGetKey:h||b,childrenPropName:v,fieldNames:g},a=(r=("object"===(0,k.Z)(n)?n:{externalGetKey:n})||{}).childrenPropName,l=r.externalGetKey,i=(c=eG(r.fieldNames)).key,d=c.children,s=a||d,l?"string"==typeof l?o=function(e){return e[l]}:"function"==typeof l&&(o=function(e){return l(e)}):o=function(e,t){return eU(e[i],t)},function n(r,a,l,c){var i=r?r[s]:e,d=r?eX(l.pos,a):"0",u=r?[].concat((0,el.Z)(c),[r]):[];if(r){var f=o(r,d);t({node:r,index:a,pos:d,key:f,parentPos:l.node?l.pos:null,level:l.level+1,nodes:u})}i&&i.forEach(function(e,t){n(e,t,{node:r,pos:d,level:l?l.level+1:-1},u)})}(null),m&&m(w),w}function eQ(e,t){var n=t.expandedKeys,o=t.selectedKeys,r=t.loadedKeys,a=t.loadingKeys,l=t.checkedKeys,c=t.halfCheckedKeys,i=t.dragOverNodeKey,d=t.dropPosition,s=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==o.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==l.indexOf(e),halfChecked:-1!==c.indexOf(e),pos:String(s?s.pos:""),dragOver:i===e&&0===d,dragOverGapTop:i===e&&-1===d,dragOverGapBottom:i===e&&1===d}}function e0(e){var t=e.data,n=e.expanded,o=e.selected,r=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,i=e.dragOver,d=e.dragOverGapTop,s=e.dragOverGapBottom,u=e.pos,f=e.active,p=e.eventKey,m=(0,C.Z)((0,C.Z)({},t),{},{expanded:n,selected:o,checked:r,loaded:a,loading:l,halfChecked:c,dragOver:i,dragOverGapTop:d,dragOverGapBottom:s,pos:u,active:f,key:p});return"props"in m||Object.defineProperty(m,"props",{get:function(){return(0,O.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}var e1=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],e2="open",e3="close",e4=function(e){var t,n,r,a=e.eventKey,c=e.className,i=e.style,d=e.dragOver,s=e.dragOverGapTop,u=e.dragOverGapBottom,f=e.isLeaf,m=e.isStart,h=e.isEnd,v=e.expanded,g=e.selected,b=e.checked,y=e.halfChecked,x=e.loading,w=e.domRef,k=e.active,S=e.data,N=e.onMouseMove,K=e.selectable,O=(0,j.Z)(e,e1),I=o.useContext(eW),R=o.useContext(e_),P=o.useRef(null),M=o.useState(!1),T=(0,l.Z)(M,2),D=T[0],L=T[1],B=!!(I.disabled||e.disabled||null!==(t=R.nodeDisabled)&&void 0!==t&&t.call(R,S)),H=o.useMemo(function(){return!!I.checkable&&!1!==e.checkable&&I.checkable},[I.checkable,e.checkable]),z=function(t){B||I.onNodeSelect(t,e0(e))},A=function(t){B||!H||e.disableCheckbox||I.onNodeCheck(t,e0(e),!b)},W=o.useMemo(function(){return"boolean"==typeof K?K:I.selectable},[K,I.selectable]),_=function(t){I.onNodeClick(t,e0(e)),W?z(t):A(t)},q=function(t){I.onNodeDoubleClick(t,e0(e))},V=function(t){I.onNodeMouseEnter(t,e0(e))},X=function(t){I.onNodeMouseLeave(t,e0(e))},U=function(t){I.onNodeContextMenu(t,e0(e))},G=o.useMemo(function(){return!!(I.draggable&&(!I.draggable.nodeDraggable||I.draggable.nodeDraggable(S)))},[I.draggable,S]),Y=function(t){x||I.onNodeExpand(t,e0(e))},$=o.useMemo(function(){return!!((I.keyEntities[a]||{}).children||[]).length},[I.keyEntities,a]),J=o.useMemo(function(){return!1!==f&&(f||!I.loadData&&!$||I.loadData&&e.loaded&&!$)},[f,I.loadData,$,e.loaded]);o.useEffect(function(){!x&&("function"!=typeof I.loadData||!v||J||e.loaded||I.onNodeLoad(e0(e)))},[x,I.loadData,I.onNodeLoad,v,J,e]);var Q=o.useMemo(function(){var e;return null!==(e=I.draggable)&&void 0!==e&&e.icon?o.createElement("span",{className:"".concat(I.prefixCls,"-draggable-icon")},I.draggable.icon):null},[I.draggable]),ee=function(t){var n=e.switcherIcon||I.switcherIcon;return"function"==typeof n?n((0,C.Z)((0,C.Z)({},e),{},{isLeaf:t})):n},et=o.useMemo(function(){if(!H)return null;var t="boolean"!=typeof H?H:null;return o.createElement("span",{className:Z()("".concat(I.prefixCls,"-checkbox"),(0,E.Z)((0,E.Z)((0,E.Z)({},"".concat(I.prefixCls,"-checkbox-checked"),b),"".concat(I.prefixCls,"-checkbox-indeterminate"),!b&&y),"".concat(I.prefixCls,"-checkbox-disabled"),B||e.disableCheckbox)),onClick:A,role:"checkbox","aria-checked":y?"mixed":b,"aria-disabled":B||e.disableCheckbox,"aria-label":"Select ".concat("string"==typeof e.title?e.title:"tree node")},t)},[H,b,y,B,e.disableCheckbox,e.title]),en=o.useMemo(function(){return J?null:v?e2:e3},[J,v]),eo=o.useMemo(function(){return o.createElement("span",{className:Z()("".concat(I.prefixCls,"-iconEle"),"".concat(I.prefixCls,"-icon__").concat(en||"docu"),(0,E.Z)({},"".concat(I.prefixCls,"-icon_loading"),x))})},[I.prefixCls,en,x]),er=o.useMemo(function(){var t=!!I.draggable;return!e.disabled&&t&&I.dragOverNodeKey===a?I.dropIndicatorRender({dropPosition:I.dropPosition,dropLevelOffset:I.dropLevelOffset,indent:I.indent,prefixCls:I.prefixCls,direction:I.direction}):null},[I.dropPosition,I.dropLevelOffset,I.indent,I.prefixCls,I.direction,I.draggable,I.dragOverNodeKey,I.dropIndicatorRender]),ea=o.useMemo(function(){var t,n,r=e.title,a=void 0===r?"---":r,l="".concat(I.prefixCls,"-node-content-wrapper");if(I.showIcon){var c=e.icon||I.icon;t=c?o.createElement("span",{className:Z()("".concat(I.prefixCls,"-iconEle"),"".concat(I.prefixCls,"-icon__customize"))},"function"==typeof c?c(e):c):eo}else I.loadData&&x&&(t=eo);return n="function"==typeof a?a(S):I.titleRender?I.titleRender(S):a,o.createElement("span",{ref:P,title:"string"==typeof a?a:"",className:Z()(l,"".concat(l,"-").concat(en||"normal"),(0,E.Z)({},"".concat(I.prefixCls,"-node-selected"),!B&&(g||D))),onMouseEnter:V,onMouseLeave:X,onContextMenu:U,onClick:_,onDoubleClick:q},t,o.createElement("span",{className:"".concat(I.prefixCls,"-title")},n),er)},[I.prefixCls,I.showIcon,e,I.icon,eo,I.titleRender,S,en,V,X,U,_,q]),el=(0,F.Z)(O,{aria:!0,data:!0}),ec=(I.keyEntities[a]||{}).level,ei=h[h.length-1],ed=!B&&G,es=I.draggingNodeKey===a;return o.createElement("div",(0,p.Z)({ref:w,role:"treeitem","aria-expanded":f?void 0:v,className:Z()(c,"".concat(I.prefixCls,"-treenode"),(r={},(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(r,"".concat(I.prefixCls,"-treenode-disabled"),B),"".concat(I.prefixCls,"-treenode-switcher-").concat(v?"open":"close"),!f),"".concat(I.prefixCls,"-treenode-checkbox-checked"),b),"".concat(I.prefixCls,"-treenode-checkbox-indeterminate"),y),"".concat(I.prefixCls,"-treenode-selected"),g),"".concat(I.prefixCls,"-treenode-loading"),x),"".concat(I.prefixCls,"-treenode-active"),k),"".concat(I.prefixCls,"-treenode-leaf-last"),ei),"".concat(I.prefixCls,"-treenode-draggable"),G),"dragging",es),(0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)((0,E.Z)(r,"drop-target",I.dropTargetKey===a),"drop-container",I.dropContainerKey===a),"drag-over",!B&&d),"drag-over-gap-top",!B&&s),"drag-over-gap-bottom",!B&&u),"filter-node",null===(n=I.filterTreeNode)||void 0===n?void 0:n.call(I,e0(e))),"".concat(I.prefixCls,"-treenode-leaf"),J))),style:i,draggable:ed,onDragStart:ed?function(t){t.stopPropagation(),L(!0),I.onNodeDragStart(t,e);try{t.dataTransfer.setData("text/plain","")}catch(e){}}:void 0,onDragEnter:G?function(t){t.preventDefault(),t.stopPropagation(),I.onNodeDragEnter(t,e)}:void 0,onDragOver:G?function(t){t.preventDefault(),t.stopPropagation(),I.onNodeDragOver(t,e)}:void 0,onDragLeave:G?function(t){t.stopPropagation(),I.onNodeDragLeave(t,e)}:void 0,onDrop:G?function(t){t.preventDefault(),t.stopPropagation(),L(!1),I.onNodeDrop(t,e)}:void 0,onDragEnd:G?function(t){t.stopPropagation(),L(!1),I.onNodeDragEnd(t,e)}:void 0,onMouseMove:N},void 0!==K?{"aria-selected":!!K}:void 0,el),o.createElement(eF,{prefixCls:I.prefixCls,level:ec,isStart:m,isEnd:h}),Q,function(){if(J){var e=ee(!0);return!1!==e?o.createElement("span",{className:Z()("".concat(I.prefixCls,"-switcher"),"".concat(I.prefixCls,"-switcher-noop"))},e):null}var t=ee(!1);return!1!==t?o.createElement("span",{onClick:Y,className:Z()("".concat(I.prefixCls,"-switcher"),"".concat(I.prefixCls,"-switcher_").concat(v?e2:e3))},t):null}(),et,ea)};function e8(e,t){if(!e)return[];var n=e.slice(),o=n.indexOf(t);return o>=0&&n.splice(o,1),n}function e6(e,t){var n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function e5(e){return e.split("-")}function e7(e,t,n,o,r,a,l,c,i,d){var s,u,f=e.clientX,p=e.clientY,m=e.target.getBoundingClientRect(),h=m.top,v=m.height,g=(("rtl"===d?-1:1)*(((null==r?void 0:r.x)||0)-f)-12)/o,b=i.filter(function(e){var t;return null===(t=c[e])||void 0===t||null===(t=t.children)||void 0===t?void 0:t.length}),y=c[n.eventKey];if(p-1.5?a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1:a({dragNode:N,dropNode:K,dropPosition:0})?E=0:a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1:a({dragNode:N,dropNode:K,dropPosition:1})?E=1:O=!1,{dropPosition:E,dropLevelOffset:S,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:C,dropContainerKey:0===E?null:(null===(u=y.parent)||void 0===u?void 0:u.key)||null,dropAllowed:O}}function e9(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function te(e){var t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,k.Z)(e))return(0,O.ZP)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function tt(e,t){var n=new Set;return(e||[]).forEach(function(e){!function e(o){if(!n.has(o)){var r=t[o];if(r){n.add(o);var a=r.parent;!r.node.disabled&&a&&e(a.key)}}}(e)}),(0,el.Z)(n)}function tn(e,t){var n=new Set;return e.forEach(function(e){t.has(e)||n.add(e)}),n}function to(e){var t=e||{},n=t.disabled,o=t.disableCheckbox,r=t.checkable;return!!(n||o)||!1===r}function tr(e,t,n,o){var r,a=[];r=o||to;var l=new Set(e.filter(function(e){var t=!!n[e];return t||a.push(e),t})),c=new Map,i=0;return Object.keys(n).forEach(function(e){var t=n[e],o=t.level,r=c.get(o);r||(r=new Set,c.set(o,r)),r.add(t),i=Math.max(i,o)}),(0,O.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map(function(e){return"'".concat(e,"'")}).join(", "))),!0===t?function(e,t,n,o){for(var r=new Set(e),a=new Set,l=0;l<=n;l+=1)(t.get(l)||new Set).forEach(function(e){var t=e.key,n=e.node,a=e.children,l=void 0===a?[]:a;r.has(t)&&!o(n)&&l.filter(function(e){return!o(e.node)}).forEach(function(e){r.add(e.key)})});for(var c=new Set,i=n;i>=0;i-=1)(t.get(i)||new Set).forEach(function(e){var t=e.parent;if(!(o(e.node)||!e.parent||c.has(e.parent.key))){if(o(e.parent.node)){c.add(t.key);return}var n=!0,l=!1;(t.children||[]).filter(function(e){return!o(e.node)}).forEach(function(e){var t=e.key,o=r.has(t);n&&!o&&(n=!1),!l&&(o||a.has(t))&&(l=!0)}),n&&r.add(t.key),l&&a.add(t.key),c.add(t.key)}});return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(tn(a,r))}}(l,c,i,r):function(e,t,n,o,r){for(var a=new Set(e),l=new Set(t),c=0;c<=o;c+=1)(n.get(c)||new Set).forEach(function(e){var t=e.key,n=e.node,o=e.children,c=void 0===o?[]:o;a.has(t)||l.has(t)||r(n)||c.filter(function(e){return!r(e.node)}).forEach(function(e){a.delete(e.key)})});l=new Set;for(var i=new Set,d=o;d>=0;d-=1)(n.get(d)||new Set).forEach(function(e){var t=e.parent;if(!(r(e.node)||!e.parent||i.has(e.parent.key))){if(r(e.parent.node)){i.add(t.key);return}var n=!0,o=!1;(t.children||[]).filter(function(e){return!r(e.node)}).forEach(function(e){var t=e.key,r=a.has(t);n&&!r&&(n=!1),!o&&(r||l.has(t))&&(o=!0)}),n||a.delete(t.key),o&&l.add(t.key),i.add(t.key)}});return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(tn(l,a))}}(l,t.halfCheckedKeys,c,i,r)}e4.isTreeNode=1;var ta=n(50506);let tl=e=>{let[t,n]=(0,o.useState)(null);return[(0,o.useCallback)((o,r,a)=>{let l=null!=t?t:o,c=Math.max(l||0,o),i=r.slice(Math.min(l||0,o),c+1).map(e),d=i.some(e=>!a.has(e)),s=[];return i.forEach(e=>{d?(a.has(e)||s.push(e),a.add(e)):(a.delete(e),s.push(e))}),n(d?c:null),s},[t]),n]};var tc=n(13613),ti=n(61994),td=n(73705),ts=n(29967);let tu={},tf="SELECT_ALL",tp="SELECT_INVERT",tm="SELECT_NONE",th=[],tv=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return(t||[]).forEach(t=>{n.push(t),t&&"object"==typeof t&&e in t&&tv(e,t[e],n)}),n};var tg=(e,t)=>{let{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:a,getCheckboxProps:l,getTitleCheckboxProps:c,onChange:i,onSelect:d,onSelectAll:s,onSelectInvert:u,onSelectNone:f,onSelectMultiple:p,columnWidth:m,type:h,selections:v,fixed:g,renderCell:b,hideSelectAll:y,checkStrictly:x=!0}=t||{},{prefixCls:w,data:k,pageData:C,getRecordByKey:E,getRowKey:S,expandType:N,childrenColumnName:K,locale:O,getPopupContainer:I}=e,R=(0,tc.ln)("Table"),[P,M]=tl(e=>e),[T,D]=(0,ta.Z)(r||a||th,{value:r}),L=o.useRef(new Map),j=(0,o.useCallback)(e=>{if(n){let t=new Map;e.forEach(e=>{let n=E(e);!n&&L.current.has(e)&&(n=L.current.get(e)),t.set(e,n)}),L.current=t}},[E,n]);o.useEffect(()=>{j(T)},[T]);let B=(0,o.useMemo)(()=>tv(K,C),[K,C]),{keyEntities:H}=(0,o.useMemo)(()=>{if(x)return{keyEntities:null};let e=k;if(n){let t=new Set(B.map((e,t)=>S(e,t))),n=Array.from(L.current).reduce((e,n)=>{let[o,r]=n;return t.has(o)?e:e.concat(r)},[]);e=[].concat((0,el.Z)(e),(0,el.Z)(n))}return eJ(e,{externalGetKey:S,childrenPropName:K})},[k,S,x,K,n,B]),z=(0,o.useMemo)(()=>{let e=new Map;return B.forEach((t,n)=>{let o=S(t,n),r=(l?l(t):null)||{};e.set(o,r)}),e},[B,S,l]),A=(0,o.useCallback)(e=>{let t;let n=S(e);return!!(null==(t=z.has(n)?z.get(S(e)):l?l(e):void 0)?void 0:t.disabled)},[z,S]),[W,_]=(0,o.useMemo)(()=>{if(x)return[T||[],[]];let{checkedKeys:e,halfCheckedKeys:t}=tr(T,!0,H,A);return[e||[],t]},[T,x,H,A]),F=(0,o.useMemo)(()=>new Set("radio"===h?W.slice(0,1):W),[W,h]),q=(0,o.useMemo)(()=>"radio"===h?new Set:new Set(_),[_,h]);o.useEffect(()=>{t||D(th)},[!!t]);let V=(0,o.useCallback)((e,t)=>{let o,r;j(e),n?(o=e,r=e.map(e=>L.current.get(e))):(o=[],r=[],e.forEach(e=>{let t=E(e);void 0!==t&&(o.push(e),r.push(t))})),D(o),null==i||i(o,r,{type:t})},[D,E,i,n]),X=(0,o.useCallback)((e,t,n,o)=>{if(d){let r=n.map(e=>E(e));d(E(e),t,r,o)}V(n,"single")},[d,E,V]),U=(0,o.useMemo)(()=>!v||y?null:(!0===v?[tf,tp,tm]:v).map(e=>e===tf?{key:"all",text:O.selectionAll,onSelect(){V(k.map((e,t)=>S(e,t)).filter(e=>{let t=z.get(e);return!(null==t?void 0:t.disabled)||F.has(e)}),"all")}}:e===tp?{key:"invert",text:O.selectInvert,onSelect(){let e=new Set(F);C.forEach((t,n)=>{let o=S(t,n),r=z.get(o);(null==r?void 0:r.disabled)||(e.has(o)?e.delete(o):e.add(o))});let t=Array.from(e);u&&(R.deprecated(!1,"onSelectInvert","onChange"),u(t)),V(t,"invert")}}:e===tm?{key:"none",text:O.selectNone,onSelect(){null==f||f(),V(Array.from(F).filter(e=>{let t=z.get(e);return null==t?void 0:t.disabled}),"none")}}:e).map(e=>Object.assign(Object.assign({},e),{onSelect:function(){for(var t,n=arguments.length,o=Array(n),r=0;r{var n;let r,a,l;if(!t)return e.filter(e=>e!==tu);let i=(0,el.Z)(e),d=new Set(F),u=B.map(S).filter(e=>!z.get(e).disabled),f=u.every(e=>d.has(e)),k=u.some(e=>d.has(e)),C=()=>{let e=[];f?u.forEach(t=>{d.delete(t),e.push(t)}):u.forEach(t=>{d.has(t)||(d.add(t),e.push(t))});let t=Array.from(d);null==s||s(!f,t.map(e=>E(e)),e.map(e=>E(e))),V(t,"all"),M(null)};if("radio"!==h){let e;if(U){let t={getPopupContainer:I,items:U.map((e,t)=>{let{key:n,text:o,onSelect:r}=e;return{key:null!=n?n:t,onClick:()=>{null==r||r(u)},label:o}})};e=o.createElement("div",{className:"".concat(w,"-selection-extra")},o.createElement(td.Z,{menu:t,getPopupContainer:I},o.createElement("span",null,o.createElement(eA.Z,null))))}let t=B.map((e,t)=>{let n=S(e,t),o=z.get(n)||{};return Object.assign({checked:d.has(n)},o)}).filter(e=>{let{disabled:t}=e;return t}),n=!!t.length&&t.length===B.length,l=n&&t.every(e=>{let{checked:t}=e;return t}),i=n&&t.some(e=>{let{checked:t}=e;return t}),s=(null==c?void 0:c())||{},{onChange:p,disabled:m}=s;a=o.createElement(ti.Z,Object.assign({"aria-label":e?"Custom selection":"Select all"},s,{checked:n?l:!!B.length&&f,indeterminate:n?!l&&i:!f&&k,onChange:e=>{C(),null==p||p(e)},disabled:null!=m?m:0===B.length||n,skipGroup:!0})),r=!y&&o.createElement("div",{className:"".concat(w,"-selection")},a,e)}if(l="radio"===h?(e,t,n)=>{let r=S(t,n),a=d.has(r),l=z.get(r);return{node:o.createElement(ts.ZP,Object.assign({},l,{checked:a,onClick:e=>{var t;e.stopPropagation(),null===(t=null==l?void 0:l.onClick)||void 0===t||t.call(l,e)},onChange:e=>{var t;d.has(r)||X(r,!0,[r],e.nativeEvent),null===(t=null==l?void 0:l.onChange)||void 0===t||t.call(l,e)}})),checked:a}}:(e,t,n)=>{var r;let a;let l=S(t,n),c=d.has(l),i=q.has(l),s=z.get(l);return a="nest"===N?i:null!==(r=null==s?void 0:s.indeterminate)&&void 0!==r?r:i,{node:o.createElement(ti.Z,Object.assign({},s,{indeterminate:a,checked:c,skipGroup:!0,onClick:e=>{var t;e.stopPropagation(),null===(t=null==s?void 0:s.onClick)||void 0===t||t.call(s,e)},onChange:e=>{var t;let{nativeEvent:n}=e,{shiftKey:o}=n,r=u.indexOf(l),a=W.some(e=>u.includes(e));if(o&&x&&a){let e=P(r,u,d),t=Array.from(d);null==p||p(!c,t.map(e=>E(e)),e.map(e=>E(e))),V(t,"multiple")}else if(x){let e=c?e8(W,l):e6(W,l);X(l,!c,e,n)}else{let{checkedKeys:e,halfCheckedKeys:t}=tr([].concat((0,el.Z)(W),[l]),!0,H,A),o=e;if(c){let n=new Set(e);n.delete(l),o=tr(Array.from(n),{checked:!1,halfCheckedKeys:t},H,A).checkedKeys}X(l,!c,o,n)}c?M(null):M(r),null===(t=null==s?void 0:s.onChange)||void 0===t||t.call(s,e)}})),checked:c}},!i.includes(tu)){if(0===i.findIndex(e=>{var t;return(null===(t=e[eo])||void 0===t?void 0:t.columnType)==="EXPAND_COLUMN"})){let[e,...t]=i;i=[e,tu].concat((0,el.Z)(t))}else i=[tu].concat((0,el.Z)(i))}let K=i.indexOf(tu),O=(i=i.filter((e,t)=>e!==tu||t===K))[K-1],R=i[K+1],T=g;void 0===T&&((null==R?void 0:R.fixed)!==void 0?T=R.fixed:(null==O?void 0:O.fixed)!==void 0&&(T=O.fixed)),T&&O&&(null===(n=O[eo])||void 0===n?void 0:n.columnType)==="EXPAND_COLUMN"&&void 0===O.fixed&&(O.fixed=T);let D=Z()("".concat(w,"-selection-col"),{["".concat(w,"-selection-col-with-dropdown")]:v&&"checkbox"===h}),L={fixed:T,width:m,className:"".concat(w,"-selection-column"),title:(null==t?void 0:t.columnTitle)?"function"==typeof t.columnTitle?t.columnTitle(a):t.columnTitle:r,render:(e,t,n)=>{let{node:o,checked:r}=l(e,t,n);return b?b(r,t,n,o):o},onCell:t.onCell,align:t.align,[eo]:{className:D}};return i.map(e=>e===tu?L:e)},[S,B,t,W,F,q,m,U,N,z,p,X,A]),F]};let tb=(e,t)=>(0,o.useImperativeHandle)(e,()=>{let e=t(),{nativeElement:n}=e;return"undefined"!=typeof Proxy?new Proxy(n,{get:(t,n)=>e[n]?e[n]:Reflect.get(t,n)}):(n._antProxy=n._antProxy||{},Object.keys(e).forEach(t=>{if(!(t in n._antProxy)){let o=n[t];n._antProxy[t]=o,n[t]=e[t]}}),n)});function ty(e){return null!=e&&e===e.window}var tx=e=>{var t,n;if("undefined"==typeof window)return 0;let o=0;return ty(e)?o=e.pageYOffset:e instanceof Document?o=e.documentElement.scrollTop:e instanceof HTMLElement?o=e.scrollTop:e&&(o=e.scrollTop),e&&!ty(e)&&"number"!=typeof o&&(o=null===(n=(null!==(t=e.ownerDocument)&&void 0!==t?t:e).documentElement)||void 0===n?void 0:n.scrollTop),o},tw=n(18310),tk=n(71744),tC=n(91086),tE=n(64024),tS=n(33759),tZ=n(28617),tN=n(37381),tK=n(40049),tO=n(10353),tI=n(84951);let tR=(e,t)=>"key"in e&&void 0!==e.key&&null!==e.key?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t;function tP(e,t){return t?"".concat(t,"-").concat(e):"".concat(e)}let tM=(e,t)=>"function"==typeof e?e(t):e,tT=(e,t)=>{let n=tM(e,t);return"[object Object]"===Object.prototype.toString.call(n)?"":n};var tD={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"},tL=n(55015),tj=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:tD}))}),tB=n(53253),tH=n(51646);let tz=e=>{let t=o.useRef(e),[,n]=(0,tH.N)();return[()=>t.current,e=>{t.current=e,n()}]};var tA=n(5545),tW=n(85180),t_=n(60985),tF=n(88208),tq=n(76405),tV=n(25049),tX=n(63496),tU=n(41690),tG=n(15900),tY=n(95814);function t$(e){if(null==e)throw TypeError("Cannot destructure "+e)}var tJ=n(66632),tQ=function(e,t){var n=o.useState(!1),r=(0,l.Z)(n,2),a=r[0],c=r[1];(0,i.Z)(function(){if(a)return e(),function(){t()}},[a]),(0,i.Z)(function(){return c(!0),function(){c(!1)}},[])},t0=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],t1=o.forwardRef(function(e,t){var n=e.className,r=e.style,a=e.motion,c=e.motionNodes,d=e.motionType,s=e.onMotionStart,u=e.onMotionEnd,f=e.active,m=e.treeNodeRequiredProps,h=(0,j.Z)(e,t0),v=o.useState(!0),g=(0,l.Z)(v,2),b=g[0],y=g[1],x=o.useContext(eW).prefixCls,w=c&&"hide"!==d;(0,i.Z)(function(){c&&w!==b&&y(w)},[c]);var k=o.useRef(!1),C=function(){c&&!k.current&&(k.current=!0,u())};return(tQ(function(){c&&s()},C),c)?o.createElement(tJ.ZP,(0,p.Z)({ref:t,visible:b},a,{motionAppear:"show"===d,onVisibleChanged:function(e){w===e&&C()}}),function(e,t){var n=e.className,r=e.style;return o.createElement("div",{ref:t,className:Z()("".concat(x,"-treenode-motion"),n),style:r},c.map(function(e){var t=Object.assign({},(t$(e.data),e.data)),n=e.title,r=e.key,a=e.isStart,l=e.isEnd;delete t.children;var c=eQ(r,m);return o.createElement(e4,(0,p.Z)({},t,c,{title:n,active:f,data:e.data,key:r,isStart:a,isEnd:l}))}))}):o.createElement(e4,(0,p.Z)({domRef:t,className:n,style:r},h,{active:f}))});function t2(e,t,n){var o=e.findIndex(function(e){return e.key===n}),r=e[o+1],a=t.findIndex(function(e){return e.key===n});if(r){var l=t.findIndex(function(e){return e.key===r.key});return t.slice(a+1,l)}return t.slice(a+1)}var t3=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],t4={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},t8=function(){},t6="RC_TREE_MOTION_".concat(Math.random()),t5={key:t6},t7={key:t6,level:0,index:0,pos:"0",node:t5,nodes:[t5]},t9={parent:null,children:[],pos:t7.pos,data:t5,title:null,key:t6,isStart:[],isEnd:[]};function ne(e,t,n,o){return!1!==t&&n?e.slice(0,Math.ceil(n/o)+1):e}function nt(e){return eU(e.key,e.pos)}var nn=o.forwardRef(function(e,t){var n=e.prefixCls,r=e.data,a=(e.selectable,e.checkable,e.expandedKeys),c=e.selectedKeys,d=e.checkedKeys,s=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,m=e.keyEntities,h=e.disabled,v=e.dragging,g=e.dragOverNodeKey,b=e.dropPosition,y=e.motion,x=e.height,w=e.itemHeight,k=e.virtual,C=e.scrollWidth,E=e.focusable,S=e.activeItem,Z=e.focused,N=e.tabIndex,K=e.onKeyDown,O=e.onFocus,I=e.onBlur,R=e.onActiveChange,P=e.onListChangeStart,M=e.onListChangeEnd,T=(0,j.Z)(e,t3),D=o.useRef(null),L=o.useRef(null);o.useImperativeHandle(t,function(){return{scrollTo:function(e){D.current.scrollTo(e)},getIndentWidth:function(){return L.current.offsetWidth}}});var B=o.useState(a),H=(0,l.Z)(B,2),z=H[0],A=H[1],W=o.useState(r),_=(0,l.Z)(W,2),F=_[0],q=_[1],V=o.useState(r),X=(0,l.Z)(V,2),U=X[0],G=X[1],Y=o.useState([]),$=(0,l.Z)(Y,2),J=$[0],Q=$[1],ee=o.useState(null),et=(0,l.Z)(ee,2),en=et[0],eo=et[1],er=o.useRef(r);function ea(){var e=er.current;q(e),G(e),Q([]),eo(null),M()}er.current=r,(0,i.Z)(function(){A(a);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,o=t.length;if(1!==Math.abs(n-o))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach(function(e){n.set(e,!0)});var o=t.filter(function(e){return!n.has(e)});return 1===o.length?o[0]:null}return n ").concat(t);return t}(S)),o.createElement("div",null,o.createElement("input",{style:t4,disabled:!1===E||h,tabIndex:!1!==E?N:null,onKeyDown:K,onFocus:O,onBlur:I,value:"",onChange:t8,"aria-label":"for screen reader"})),o.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},o.createElement("div",{className:"".concat(n,"-indent")},o.createElement("div",{ref:L,className:"".concat(n,"-indent-unit")}))),o.createElement(eP.Z,(0,p.Z)({},T,{data:el,itemKey:nt,height:x,fullHeight:!1,virtual:k,itemHeight:w,scrollWidth:C,prefixCls:"".concat(n,"-list"),ref:D,role:"tree",onVisibleChange:function(e){e.every(function(e){return nt(e)!==t6})&&ea()}}),function(e){var t=e.pos,n=Object.assign({},(t$(e.data),e.data)),r=e.title,a=e.key,l=e.isStart,c=e.isEnd,i=eU(a,t);delete n.key,delete n.children;var d=eQ(i,ec);return o.createElement(t1,(0,p.Z)({},n,d,{title:r,active:!!S&&a===S.key,pos:t,data:e.data,isStart:l,isEnd:c,motion:y,motionNodes:a===t6?J:null,motionType:en,onMotionStart:P,onMotionEnd:ea,treeNodeRequiredProps:ec,onMouseMove:function(){R(null)}}))}))}),no=function(e){(0,tU.Z)(n,e);var t=(0,tG.Z)(n);function n(){var e;(0,tq.Z)(this,n);for(var r=arguments.length,a=Array(r),l=0;l0&&void 0!==arguments[0]?arguments[0]:[];t.forEach(function(t){var n=t.key,r=t.children;o.push(n),e(r)})}(l[i].children),o),indent:e.listRef.current.getIndentWidth()}),e.setExpandedKeys(d),window.addEventListener("dragend",e.onWindowDragEnd),null==c||c({event:t,node:e0(n)})}),(0,E.Z)((0,tX.Z)(e),"onNodeDragEnter",function(t,n){var o=e.state,r=o.expandedKeys,a=o.keyEntities,l=o.dragChildrenKeys,c=o.flattenNodes,i=o.indent,d=e.props,s=d.onDragEnter,u=d.onExpand,f=d.allowDrop,p=d.direction,m=n.pos,h=n.eventKey;if(e.currentMouseOverDroppableNodeKey!==h&&(e.currentMouseOverDroppableNodeKey=h),!e.dragNodeProps){e.resetDragState();return}var v=e7(t,e.dragNodeProps,n,i,e.dragStartMousePosition,f,c,a,r,p),g=v.dropPosition,b=v.dropLevelOffset,y=v.dropTargetKey,x=v.dropContainerKey,w=v.dropTargetPos,k=v.dropAllowed,C=v.dragOverNodeKey;if(l.includes(y)||!k||(e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach(function(t){clearTimeout(e.delayedDragEnterLogic[t])}),e.dragNodeProps.eventKey!==n.eventKey&&(t.persist(),e.delayedDragEnterLogic[m]=window.setTimeout(function(){if(null!==e.state.draggingNodeKey){var o=(0,el.Z)(r),l=a[n.eventKey];l&&(l.children||[]).length&&(o=e6(r,n.eventKey)),e.props.hasOwnProperty("expandedKeys")||e.setExpandedKeys(o),null==u||u(o,{node:e0(n),expanded:!0,nativeEvent:t.nativeEvent})}},800)),e.dragNodeProps.eventKey===y&&0===b)){e.resetDragState();return}e.setState({dragOverNodeKey:C,dropPosition:g,dropLevelOffset:b,dropTargetKey:y,dropContainerKey:x,dropTargetPos:w,dropAllowed:k}),null==s||s({event:t,node:e0(n),expandedKeys:r})}),(0,E.Z)((0,tX.Z)(e),"onNodeDragOver",function(t,n){var o=e.state,r=o.dragChildrenKeys,a=o.flattenNodes,l=o.keyEntities,c=o.expandedKeys,i=o.indent,d=e.props,s=d.onDragOver,u=d.allowDrop,f=d.direction;if(e.dragNodeProps){var p=e7(t,e.dragNodeProps,n,i,e.dragStartMousePosition,u,a,l,c,f),m=p.dropPosition,h=p.dropLevelOffset,v=p.dropTargetKey,g=p.dropContainerKey,b=p.dropTargetPos,y=p.dropAllowed,x=p.dragOverNodeKey;!r.includes(v)&&y&&(e.dragNodeProps.eventKey===v&&0===h?null===e.state.dropPosition&&null===e.state.dropLevelOffset&&null===e.state.dropTargetKey&&null===e.state.dropContainerKey&&null===e.state.dropTargetPos&&!1===e.state.dropAllowed&&null===e.state.dragOverNodeKey||e.resetDragState():m===e.state.dropPosition&&h===e.state.dropLevelOffset&&v===e.state.dropTargetKey&&g===e.state.dropContainerKey&&b===e.state.dropTargetPos&&y===e.state.dropAllowed&&x===e.state.dragOverNodeKey||e.setState({dropPosition:m,dropLevelOffset:h,dropTargetKey:v,dropContainerKey:g,dropTargetPos:b,dropAllowed:y,dragOverNodeKey:x}),null==s||s({event:t,node:e0(n)}))}}),(0,E.Z)((0,tX.Z)(e),"onNodeDragLeave",function(t,n){e.currentMouseOverDroppableNodeKey!==n.eventKey||t.currentTarget.contains(t.relatedTarget)||(e.resetDragState(),e.currentMouseOverDroppableNodeKey=null);var o=e.props.onDragLeave;null==o||o({event:t,node:e0(n)})}),(0,E.Z)((0,tX.Z)(e),"onWindowDragEnd",function(t){e.onNodeDragEnd(t,null,!0),window.removeEventListener("dragend",e.onWindowDragEnd)}),(0,E.Z)((0,tX.Z)(e),"onNodeDragEnd",function(t,n){var o=e.props.onDragEnd;e.setState({dragOverNodeKey:null}),e.cleanDragState(),null==o||o({event:t,node:e0(n)}),e.dragNodeProps=null,window.removeEventListener("dragend",e.onWindowDragEnd)}),(0,E.Z)((0,tX.Z)(e),"onNodeDrop",function(t,n){var o,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.state,l=a.dragChildrenKeys,c=a.dropPosition,i=a.dropTargetKey,d=a.dropTargetPos;if(a.dropAllowed){var s=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==i){var u=(0,C.Z)((0,C.Z)({},eQ(i,e.getTreeNodeRequiredProps())),{},{active:(null===(o=e.getActiveItem())||void 0===o?void 0:o.key)===i,data:e.state.keyEntities[i].node}),f=l.includes(i);(0,O.ZP)(!f,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var p=e5(d),m={event:t,node:e0(u),dragNode:e.dragNodeProps?e0(e.dragNodeProps):null,dragNodesKeys:[e.dragNodeProps.eventKey].concat(l),dropToGap:0!==c,dropPosition:c+Number(p[p.length-1])};r||null==s||s(m),e.dragNodeProps=null}}}),(0,E.Z)((0,tX.Z)(e),"cleanDragState",function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null}),(0,E.Z)((0,tX.Z)(e),"triggerExpandActionExpand",function(t,n){var o=e.state,r=o.expandedKeys,a=o.flattenNodes,l=n.expanded,c=n.key;if(!n.isLeaf&&!t.shiftKey&&!t.metaKey&&!t.ctrlKey){var i=a.filter(function(e){return e.key===c})[0],d=e0((0,C.Z)((0,C.Z)({},eQ(c,e.getTreeNodeRequiredProps())),{},{data:i.data}));e.setExpandedKeys(l?e8(r,c):e6(r,c)),e.onNodeExpand(t,d)}}),(0,E.Z)((0,tX.Z)(e),"onNodeClick",function(t,n){var o=e.props,r=o.onClick;"click"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)}),(0,E.Z)((0,tX.Z)(e),"onNodeDoubleClick",function(t,n){var o=e.props,r=o.onDoubleClick;"doubleClick"===o.expandAction&&e.triggerExpandActionExpand(t,n),null==r||r(t,n)}),(0,E.Z)((0,tX.Z)(e),"onNodeSelect",function(t,n){var o=e.state.selectedKeys,r=e.state,a=r.keyEntities,l=r.fieldNames,c=e.props,i=c.onSelect,d=c.multiple,s=n.selected,u=n[l.key],f=!s,p=(o=f?d?e6(o,u):[u]:e8(o,u)).map(function(e){var t=a[e];return t?t.node:null}).filter(Boolean);e.setUncontrolledState({selectedKeys:o}),null==i||i(o,{event:"select",selected:f,node:n,selectedNodes:p,nativeEvent:t.nativeEvent})}),(0,E.Z)((0,tX.Z)(e),"onNodeCheck",function(t,n,o){var r,a=e.state,l=a.keyEntities,c=a.checkedKeys,i=a.halfCheckedKeys,d=e.props,s=d.checkStrictly,u=d.onCheck,f=n.key,p={event:"check",node:n,checked:o,nativeEvent:t.nativeEvent};if(s){var m=o?e6(c,f):e8(c,f);r={checked:m,halfChecked:e8(i,f)},p.checkedNodes=m.map(function(e){return l[e]}).filter(Boolean).map(function(e){return e.node}),e.setUncontrolledState({checkedKeys:m})}else{var h=tr([].concat((0,el.Z)(c),[f]),!0,l),v=h.checkedKeys,g=h.halfCheckedKeys;if(!o){var b=new Set(v);b.delete(f);var y=tr(Array.from(b),{checked:!1,halfCheckedKeys:g},l);v=y.checkedKeys,g=y.halfCheckedKeys}r=v,p.checkedNodes=[],p.checkedNodesPositions=[],p.halfCheckedKeys=g,v.forEach(function(e){var t=l[e];if(t){var n=t.node,o=t.pos;p.checkedNodes.push(n),p.checkedNodesPositions.push({node:n,pos:o})}}),e.setUncontrolledState({checkedKeys:v},!1,{halfCheckedKeys:g})}null==u||u(r,p)}),(0,E.Z)((0,tX.Z)(e),"onNodeLoad",function(t){var n,o=t.key,r=e.state.keyEntities[o];if(null==r||null===(n=r.children)||void 0===n||!n.length){var a=new Promise(function(n,r){e.setState(function(a){var l=a.loadedKeys,c=a.loadingKeys,i=void 0===c?[]:c,d=e.props,s=d.loadData,u=d.onLoad;return!s||(void 0===l?[]:l).includes(o)||i.includes(o)?null:(s(t).then(function(){var r=e6(e.state.loadedKeys,o);null==u||u(r,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:r}),e.setState(function(e){return{loadingKeys:e8(e.loadingKeys,o)}}),n()}).catch(function(t){if(e.setState(function(e){return{loadingKeys:e8(e.loadingKeys,o)}}),e.loadingRetryTimes[o]=(e.loadingRetryTimes[o]||0)+1,e.loadingRetryTimes[o]>=10){var a=e.state.loadedKeys;(0,O.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:e6(a,o)}),n()}r(t)}),{loadingKeys:e6(i,o)})})});return a.catch(function(){}),a}}),(0,E.Z)((0,tX.Z)(e),"onNodeMouseEnter",function(t,n){var o=e.props.onMouseEnter;null==o||o({event:t,node:n})}),(0,E.Z)((0,tX.Z)(e),"onNodeMouseLeave",function(t,n){var o=e.props.onMouseLeave;null==o||o({event:t,node:n})}),(0,E.Z)((0,tX.Z)(e),"onNodeContextMenu",function(t,n){var o=e.props.onRightClick;o&&(t.preventDefault(),o({event:t,node:n}))}),(0,E.Z)((0,tX.Z)(e),"onFocus",function(){var t=e.props.onFocus;e.setState({focused:!0});for(var n=arguments.length,o=Array(n),r=0;r1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var r=!1,a=!0,l={};Object.keys(t).forEach(function(n){if(e.props.hasOwnProperty(n)){a=!1;return}r=!0,l[n]=t[n]}),r&&(!n||a)&&e.setState((0,C.Z)((0,C.Z)({},l),o))}}),(0,E.Z)((0,tX.Z)(e),"scrollTo",function(t){e.listRef.current.scrollTo(t)}),e}return(0,tV.Z)(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props,t=e.activeKey,n=e.itemScrollOffset;void 0!==t&&t!==this.state.activeKey&&(this.setState({activeKey:t}),null!==t&&this.scrollTo({key:t,offset:void 0===n?0:n}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,t=this.state,n=t.focused,r=t.flattenNodes,a=t.keyEntities,l=t.draggingNodeKey,c=t.activeKey,i=t.dropLevelOffset,d=t.dropContainerKey,s=t.dropTargetKey,u=t.dropPosition,f=t.dragOverNodeKey,m=t.indent,h=this.props,v=h.prefixCls,g=h.className,b=h.style,y=h.showLine,x=h.focusable,w=h.tabIndex,C=h.selectable,S=h.showIcon,N=h.icon,K=h.switcherIcon,O=h.draggable,I=h.checkable,R=h.checkStrictly,P=h.disabled,M=h.motion,T=h.loadData,D=h.filterTreeNode,L=h.height,j=h.itemHeight,B=h.scrollWidth,H=h.virtual,z=h.titleRender,A=h.dropIndicatorRender,W=h.onContextMenu,_=h.onScroll,q=h.direction,V=h.rootClassName,X=h.rootStyle,U=(0,F.Z)(this.props,{aria:!0,data:!0});O&&(e="object"===(0,k.Z)(O)?O:"function"==typeof O?{nodeDraggable:O}:{});var G={prefixCls:v,selectable:C,showIcon:S,icon:N,switcherIcon:K,draggable:e,draggingNodeKey:l,checkable:I,checkStrictly:R,disabled:P,keyEntities:a,dropLevelOffset:i,dropContainerKey:d,dropTargetKey:s,dropPosition:u,dragOverNodeKey:f,indent:m,direction:q,dropIndicatorRender:A,loadData:T,filterTreeNode:D,titleRender:z,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return o.createElement(eW.Provider,{value:G},o.createElement("div",{className:Z()(v,g,V,(0,E.Z)((0,E.Z)((0,E.Z)({},"".concat(v,"-show-line"),y),"".concat(v,"-focused"),n),"".concat(v,"-active-focused"),null!==c)),style:X},o.createElement(nn,(0,p.Z)({ref:this.listRef,prefixCls:v,style:b,data:r,disabled:P,selectable:C,checkable:!!I,motion:M,dragging:null!==l,height:L,itemHeight:j,virtual:H,focusable:x,focused:n,tabIndex:void 0===w?0:w,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:W,onScroll:_,scrollWidth:B},this.getTreeNodeRequiredProps(),U))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o,r=t.prevProps,a={prevProps:e};function l(t){return!r&&e.hasOwnProperty(t)||r&&r[t]!==e[t]}var c=t.fieldNames;if(l("fieldNames")&&(c=eG(e.fieldNames),a.fieldNames=c),l("treeData")?n=e.treeData:l("children")&&((0,O.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=eY(e.children)),n){a.treeData=n;var i=eJ(n,{fieldNames:c});a.keyEntities=(0,C.Z)((0,E.Z)({},t6,t7),i.keyEntities)}var d=a.keyEntities||t.keyEntities;if(l("expandedKeys")||r&&l("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?tt(e.expandedKeys,d):e.expandedKeys;else if(!r&&e.defaultExpandAll){var s=(0,C.Z)({},d);delete s[t6];var u=[];Object.keys(s).forEach(function(e){var t=s[e];t.children&&t.children.length&&u.push(t.key)}),a.expandedKeys=u}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?tt(e.defaultExpandedKeys,d):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var f=e$(n||t.treeData,a.expandedKeys||t.expandedKeys,c);a.flattenNodes=f}if(e.selectable&&(l("selectedKeys")?a.selectedKeys=e9(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=e9(e.defaultSelectedKeys,e))),e.checkable&&(l("checkedKeys")?o=te(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?o=te(e.defaultCheckedKeys)||{}:n&&(o=te(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),o)){var p=o,m=p.checkedKeys,h=void 0===m?[]:m,v=p.halfCheckedKeys,g=void 0===v?[]:v;if(!e.checkStrictly){var b=tr(h,!0,d);h=b.checkedKeys,g=b.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=g}return l("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(o.Component);(0,E.Z)(no,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,a={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:a.top=0,a.left=-n*r;break;case 1:a.bottom=0,a.left=-n*r;break;case 0:a.bottom=0,a.left=r}return o.createElement("div",{style:a})},allowDrop:function(){return!0},expandAction:!1}),(0,E.Z)(no,"TreeNode",e4);var nr={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},na=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nr}))}),nl={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},nc=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nl}))}),ni={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},nd=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:ni}))}),ns={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},nu=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:ns}))}),nf=n(68710),np=n(86586),nm=n(93463),nh=n(23159),nv=n(12918),ng=n(63074),nb=n(71140),ny=n(99320);let nx=e=>{let{treeCls:t,treeNodeCls:n,directoryNodeSelectedBg:o,directoryNodeSelectedColor:r,motionDurationMid:a,borderRadius:l,controlItemBgHover:c}=e;return{["".concat(t).concat(t,"-directory ").concat(n)]:{["".concat(t,"-node-content-wrapper")]:{position:"static",["&:has(".concat(t,"-drop-indicator)")]:{position:"relative"},["> *:not(".concat(t,"-drop-indicator)")]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:"background-color ".concat(a),content:'""',borderRadius:l},"&:hover:before":{background:c}},["".concat(t,"-switcher, ").concat(t,"-checkbox, ").concat(t,"-draggable-icon")]:{zIndex:1},"&-selected":{background:o,borderRadius:l,["".concat(t,"-switcher, ").concat(t,"-draggable-icon")]:{color:r},["".concat(t,"-node-content-wrapper")]:{color:r,background:"transparent","&, &:hover":{color:r},"&:before, &:hover:before":{background:o}}}}}},nw=new nm.E4("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),nk=(e,t)=>({[".".concat(e,"-switcher-icon")]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:"transform ".concat(t.motionDurationSlow)}}}),nC=(e,t)=>({[".".concat(e,"-drop-indicator")]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:"".concat((0,nm.bf)(t.lineWidthBold)," solid ").concat(t.colorPrimary),borderRadius:"50%",content:'""'}}}),nE=(e,t)=>{let{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:a,indentSize:l,nodeSelectedBg:c,nodeHoverBg:i,colorTextQuaternary:d,controlItemBgActiveDisabled:s}=t;return{[n]:Object.assign(Object.assign({},(0,nv.Wf)(t)),{"--rc-virtual-list-scrollbar-bg":t.colorSplit,background:t.colorBgContainer,borderRadius:t.borderRadius,transition:"background-color ".concat(t.motionDurationSlow),"&-rtl":{direction:"rtl"},["&".concat(n,"-rtl ").concat(n,"-switcher_close ").concat(n,"-switcher-icon svg")]:{transform:"rotate(90deg)"},["&-focused:not(:hover):not(".concat(n,"-active-focused)")]:(0,nv.oN)(t),["".concat(n,"-list-holder-inner")]:{alignItems:"flex-start"},["&".concat(n,"-block-node")]:{["".concat(n,"-list-holder-inner")]:{alignItems:"stretch",["".concat(n,"-node-content-wrapper")]:{flex:"auto"},["".concat(o,".dragging:after")]:{position:"absolute",inset:0,border:"1px solid ".concat(t.colorPrimary),opacity:0,animationName:nw,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:t.borderRadius}}},[o]:{display:"flex",alignItems:"flex-start",marginBottom:r,lineHeight:(0,nm.bf)(a),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:r},["&-disabled ".concat(n,"-node-content-wrapper")]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},["".concat(n,"-checkbox-disabled + ").concat(n,"-node-selected,&").concat(o,"-disabled").concat(o,"-selected ").concat(n,"-node-content-wrapper")]:{backgroundColor:s},["".concat(n,"-checkbox-disabled")]:{pointerEvents:"unset"},["&:not(".concat(o,"-disabled)")]:{["".concat(n,"-node-content-wrapper")]:{"&:hover":{color:t.nodeHoverColor}}},["&-active ".concat(n,"-node-content-wrapper")]:{background:t.controlItemBgHover},["&:not(".concat(o,"-disabled).filter-node ").concat(n,"-title")]:{color:t.colorPrimary,fontWeight:t.fontWeightStrong},"&-draggable":{cursor:"grab",["".concat(n,"-draggable-icon")]:{flexShrink:0,width:a,textAlign:"center",visibility:"visible",color:d},["&".concat(o,"-disabled ").concat(n,"-draggable-icon")]:{visibility:"hidden"}}},["".concat(n,"-indent")]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:l}},["".concat(n,"-draggable-icon")]:{visibility:"hidden"},["".concat(n,"-switcher, ").concat(n,"-checkbox")]:{marginInlineEnd:t.calc(t.calc(a).sub(t.controlInteractiveSize)).div(2).equal()},["".concat(n,"-switcher")]:Object.assign(Object.assign({},nk(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:a,textAlign:"center",cursor:"pointer",userSelect:"none",transition:"all ".concat(t.motionDurationSlow),"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:a,height:a,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:t.borderRadius,transition:"all ".concat(t.motionDurationSlow)},["&:not(".concat(n,"-switcher-noop):hover:before")]:{backgroundColor:t.colorBgTextHover},["&_close ".concat(n,"-switcher-icon svg")]:{transform:"rotate(-90deg)"},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(a).div(2).equal(),borderBottom:"1px solid ".concat(t.colorBorder),content:'""'}}}),["".concat(n,"-node-content-wrapper")]:Object.assign(Object.assign({position:"relative",minHeight:a,paddingBlock:0,paddingInline:t.paddingXS,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:"all ".concat(t.motionDurationMid,", border 0s, line-height 0s, box-shadow 0s")},nC(e,t)),{"&:hover":{backgroundColor:i},["&".concat(n,"-node-selected")]:{color:t.nodeSelectedColor,backgroundColor:c},["".concat(n,"-iconEle")]:{display:"inline-block",width:a,height:a,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}}),["".concat(n,"-unselectable ").concat(n,"-node-content-wrapper:hover")]:{backgroundColor:"transparent"},["".concat(o,".drop-container > [draggable]")]:{boxShadow:"0 0 0 2px ".concat(t.colorPrimary)},"&-show-line":{["".concat(n,"-indent-unit")]:{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),borderInlineEnd:"1px solid ".concat(t.colorBorder),content:'""'},"&-end:before":{display:"none"}},["".concat(n,"-switcher")]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},["".concat(o,"-leaf-last ").concat(n,"-switcher-leaf-line:before")]:{top:"auto !important",bottom:"auto !important",height:"".concat((0,nm.bf)(t.calc(a).div(2).equal())," !important")}})}},nS=function(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=".".concat(e),r=t.calc(t.paddingXS).div(2).equal(),a=(0,nb.IX)(t,{treeCls:o,treeNodeCls:"".concat(o,"-treenode"),treeNodePadding:r});return[nE(e,a),n&&nx(a)].filter(Boolean)},nZ=e=>{let{controlHeightSM:t,controlItemBgHover:n,controlItemBgActive:o}=e;return{titleHeight:t,indentSize:t,nodeHoverBg:n,nodeHoverColor:e.colorText,nodeSelectedBg:o,nodeSelectedColor:e.colorText}};var nN=(0,ny.I$)("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:(0,nh.C2)("".concat(n,"-checkbox"),e)},nS(n,e),(0,ng.Z)(e)]},e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},nZ(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})}),nK=function(e){let{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:a,direction:l="ltr"}=e,c="ltr"===l?"left":"right",i={[c]:-n*a+4,["ltr"===l?"right":"left"]:0};switch(t){case -1:i.top=-3;break;case 1:i.bottom=-3;break;default:i.bottom=-3,i[c]=a+4}return o.createElement("div",{style:i,className:"".concat(r,"-drop-indicator")})},nO={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"},nI=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nO}))}),nR=n(61935),nP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"},nM=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nP}))}),nT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},nD=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:nT}))}),nL=n(19722),nj=e=>{var t,n;let r;let{prefixCls:a,switcherIcon:l,treeNodeProps:c,showLine:i,switcherLoadingIcon:d}=e,{isLeaf:s,expanded:u,loading:f}=c;if(f)return o.isValidElement(d)?d:o.createElement(nR.Z,{className:"".concat(a,"-switcher-loading-icon")});if(i&&"object"==typeof i&&(r=i.showLeafIcon),s){if(!i)return null;if("boolean"!=typeof r&&r){let e="function"==typeof r?r(c):r;return o.isValidElement(e)?(0,nL.Tm)(e,{className:Z()(null===(t=e.props)||void 0===t?void 0:t.className,"".concat(a,"-switcher-line-custom-icon"))}):e}return r?o.createElement(na,{className:"".concat(a,"-switcher-line-icon")}):o.createElement("span",{className:"".concat(a,"-switcher-leaf-line")})}let p="".concat(a,"-switcher-icon"),m="function"==typeof l?l(c):l;return o.isValidElement(m)?(0,nL.Tm)(m,{className:Z()(null===(n=m.props)||void 0===n?void 0:n.className,p)}):void 0!==m?m:i?u?o.createElement(nM,{className:"".concat(a,"-switcher-line-icon")}):o.createElement(nD,{className:"".concat(a,"-switcher-line-icon")}):o.createElement(nI,{className:p})};let nB=o.forwardRef((e,t)=>{var n;let{getPrefixCls:r,direction:a,virtual:l,tree:c}=o.useContext(tk.E_),{prefixCls:i,className:d,showIcon:s=!1,showLine:u,switcherIcon:f,switcherLoadingIcon:p,blockNode:m=!1,children:h,checkable:v=!1,selectable:g=!0,draggable:b,disabled:y,motion:x,style:w}=e,k=r("tree",i),C=r(),E=o.useContext(np.Z),S=null!=y?y:E,N=null!=x?x:Object.assign(Object.assign({},(0,nf.Z)(C)),{motionAppear:!1}),K=Object.assign(Object.assign({},e),{checkable:v,selectable:g,showIcon:s,motion:N,blockNode:m,disabled:S,showLine:!!u,dropIndicatorRender:nK}),[O,I,R]=nN(k),[,P]=(0,tI.ZP)(),M=P.paddingXS/2+((null===(n=P.Tree)||void 0===n?void 0:n.titleHeight)||P.controlHeightSM),T=o.useMemo(()=>{if(!b)return!1;let e={};switch(typeof b){case"function":e.nodeDraggable=b;break;case"object":e=Object.assign({},b)}return!1!==e.icon&&(e.icon=e.icon||o.createElement(nu,null)),e},[b]);return O(o.createElement(no,Object.assign({itemHeight:M,ref:t,virtual:l},K,{style:Object.assign(Object.assign({},null==c?void 0:c.style),w),prefixCls:k,className:Z()({["".concat(k,"-icon-hide")]:!s,["".concat(k,"-block-node")]:m,["".concat(k,"-unselectable")]:!g,["".concat(k,"-rtl")]:"rtl"===a,["".concat(k,"-disabled")]:S},null==c?void 0:c.className,d,I,R),direction:a,checkable:v?o.createElement("span",{className:"".concat(k,"-checkbox-inner")}):v,selectable:g,switcherIcon:e=>o.createElement(nj,{prefixCls:k,switcherIcon:f,switcherLoadingIcon:p,treeNodeProps:e,showLine:u}),draggable:T}),h))});function nH(e,t,n){let{key:o,children:r}=n;e.forEach(function(e){let a=e[o],l=e[r];!1!==t(a,e)&&nH(l||[],t,n)})}var nz=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n};function nA(e){let{isLeaf:t,expanded:n}=e;return t?o.createElement(na,null):n?o.createElement(nc,null):o.createElement(nd,null)}function nW(e){let{treeData:t,children:n}=e;return t||eY(n)}let n_=o.forwardRef((e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:a}=e,l=nz(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);let c=o.useRef(null),i=o.useRef(null),d=()=>{let{keyEntities:e}=eJ(nW(l),{fieldNames:l.fieldNames});return n?Object.keys(e):r?tt(l.expandedKeys||a||[],e):l.expandedKeys||a||[]},[s,u]=o.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[f,p]=o.useState(()=>d());o.useEffect(()=>{"selectedKeys"in l&&u(l.selectedKeys)},[l.selectedKeys]),o.useEffect(()=>{"expandedKeys"in l&&p(l.expandedKeys)},[l.expandedKeys]);let{getPrefixCls:m,direction:h}=o.useContext(tk.E_),{prefixCls:v,className:g,showIcon:b=!0,expandAction:y="click"}=l,x=nz(l,["prefixCls","className","showIcon","expandAction"]),w=m("tree",v),k=Z()("".concat(w,"-directory"),{["".concat(w,"-directory-rtl")]:"rtl"===h},g);return o.createElement(nB,Object.assign({icon:nA,ref:t,blockNode:!0},x,{showIcon:b,expandAction:y,prefixCls:w,className:k,expandedKeys:f,selectedKeys:s,onSelect:(e,t)=>{var n;let o;let{multiple:r,fieldNames:a}=l,{node:d,nativeEvent:s}=t,{key:p=""}=d,m=nW(l),h=Object.assign(Object.assign({},t),{selected:!0}),v=(null==s?void 0:s.ctrlKey)||(null==s?void 0:s.metaKey),g=null==s?void 0:s.shiftKey;r&&v?(o=e,c.current=p,i.current=o):r&&g?o=Array.from(new Set([].concat((0,el.Z)(i.current||[]),(0,el.Z)(function(e){let{treeData:t,expandedKeys:n,startKey:o,endKey:r,fieldNames:a}=e,l=[],c=0;return o&&o===r?[o]:o&&r?(nH(t,e=>{if(2===c)return!1;if(e===o||e===r){if(l.push(e),0===c)c=1;else if(1===c)return c=2,!1}else 1===c&&l.push(e);return n.includes(e)},eG(a)),l):[]}({treeData:m,expandedKeys:f,startKey:p,endKey:c.current,fieldNames:a}))))):(o=[p],c.current=p,i.current=o),h.selectedNodes=function(e,t,n){let o=(0,el.Z)(t),r=[];return nH(e,(e,t)=>{let n=o.indexOf(e);return -1!==n&&(r.push(t),o.splice(n,1)),!!o.length},eG(n)),r}(m,o,a),null===(n=l.onSelect)||void 0===n||n.call(l,o,h),"selectedKeys"in l||u(o)},onExpand:(e,t)=>{var n;return"expandedKeys"in l||p(e),null===(n=l.onExpand)||void 0===n?void 0:n.call(l,e,t)}}))});nB.DirectoryTree=n_,nB.TreeNode=e4;var nF=n(29436),nq=n(39454),nV=e=>{let{value:t,filterSearch:n,tablePrefixCls:r,locale:a,onChange:l}=e;return n?o.createElement("div",{className:"".concat(r,"-filter-dropdown-search")},o.createElement(nq.Z,{prefix:o.createElement(nF.Z,null),placeholder:a.filterSearchPlaceholder,onChange:l,value:t,htmlSize:1,className:"".concat(r,"-filter-dropdown-search-input")})):null};let nX=e=>{let{keyCode:t}=e;t===tY.Z.ENTER&&e.stopPropagation()},nU=o.forwardRef((e,t)=>o.createElement("div",{className:e.className,onClick:e=>e.stopPropagation(),onKeyDown:nX,ref:t},e.children));function nG(e){let t=[];return(e||[]).forEach(e=>{let{value:n,children:o}=e;t.push(n),o&&(t=[].concat((0,el.Z)(t),(0,el.Z)(nG(o))))}),t}function nY(e,t){return("string"==typeof t||"number"==typeof t)&&(null==t?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()))}var n$=e=>{var t,n,r,a;let l,c;let{tablePrefixCls:i,prefixCls:s,column:u,dropdownPrefixCls:f,columnKey:p,filterOnClose:m,filterMultiple:h,filterMode:v="menu",filterSearch:g=!1,filterState:b,triggerFilter:y,locale:x,children:w,getPopupContainer:k,rootClassName:C}=e,{filterResetToDefaultFilteredValue:E,defaultFilteredValue:S,filterDropdownProps:N={},filterDropdownOpen:K,filterDropdownVisible:O,onFilterDropdownVisibleChange:I,onFilterDropdownOpenChange:R}=u,[P,M]=o.useState(!1),T=!!(b&&((null===(t=b.filteredKeys)||void 0===t?void 0:t.length)||b.forceFiltered)),D=e=>{var t;M(e),null===(t=N.onOpenChange)||void 0===t||t.call(N,e),null==R||R(e),null==I||I(e)},L=null!==(a=null!==(r=null!==(n=N.open)&&void 0!==n?n:K)&&void 0!==r?r:O)&&void 0!==a?a:P,j=null==b?void 0:b.filteredKeys,[B,H]=tz(j||[]),z=e=>{let{selectedKeys:t}=e;H(t)},A=(e,t)=>{let{node:n,checked:o}=t;h?z({selectedKeys:e}):z({selectedKeys:o&&n.key?[n.key]:[]})};o.useEffect(()=>{P&&z({selectedKeys:j||[]})},[j]);let[W,_]=o.useState([]),F=e=>{_(e)},[q,V]=o.useState(""),X=e=>{let{value:t}=e.target;V(t)};o.useEffect(()=>{P||V("")},[P]);let U=e=>{let t=(null==e?void 0:e.length)?e:null;if(null===t&&(!b||!b.filteredKeys)||(0,d.Z)(t,null==b?void 0:b.filteredKeys,!0))return null;y({column:u,key:p,filteredKeys:t})},G=()=>{D(!1),U(B())},Y=function(){let{confirm:e,closeDropdown:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1};e&&U([]),t&&D(!1),V(""),E?H((S||[]).map(e=>String(e))):H([])},$=Z()({["".concat(f,"-menu-without-submenu")]:!(u.filters||[]).some(e=>{let{children:t}=e;return t})}),J=e=>{e.target.checked?H(nG(null==u?void 0:u.filters).map(e=>String(e))):H([])},Q=e=>{let{filters:t}=e;return(t||[]).map((e,t)=>{let n=String(e.value),o={title:e.text,key:void 0!==e.value?n:String(t)};return e.children&&(o.children=Q({filters:e.children})),o})},ee=e=>{var t;return Object.assign(Object.assign({},e),{text:e.title,value:e.key,children:(null===(t=e.children)||void 0===t?void 0:t.map(e=>ee(e)))||[]})},{direction:et,renderEmpty:en}=o.useContext(tk.E_);if("function"==typeof u.filterDropdown)l=u.filterDropdown({prefixCls:"".concat(f,"-custom"),setSelectedKeys:e=>z({selectedKeys:e}),selectedKeys:B(),confirm:function(){let{closeDropdown:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0};e&&D(!1),U(B())},clearFilters:Y,filters:u.filters,visible:L,close:()=>{D(!1)}});else if(u.filterDropdown)l=u.filterDropdown;else{let e=B()||[];l=o.createElement(o.Fragment,null,(()=>{var t,n;let r=null!==(t=null==en?void 0:en("Table.filter"))&&void 0!==t?t:o.createElement(tW.Z,{image:tW.Z.PRESENTED_IMAGE_SIMPLE,description:x.filterEmptyText,styles:{image:{height:24}},style:{margin:0,padding:"16px 0"}});if(0===(u.filters||[]).length)return r;if("tree"===v)return o.createElement(o.Fragment,null,o.createElement(nV,{filterSearch:g,value:q,onChange:X,tablePrefixCls:i,locale:x}),o.createElement("div",{className:"".concat(i,"-filter-dropdown-tree")},h?o.createElement(ti.Z,{checked:e.length===nG(u.filters).length,indeterminate:e.length>0&&e.length"function"==typeof g?g(q,ee(e)):nY(q,e.title):void 0})));let a=function e(t){let{filters:n,prefixCls:r,filteredKeys:a,filterMultiple:l,searchValue:c,filterSearch:i}=t;return n.map((t,n)=>{let d=String(t.value);if(t.children)return{key:d||n,label:t.text,popupClassName:"".concat(r,"-dropdown-submenu"),children:e({filters:t.children,prefixCls:r,filteredKeys:a,filterMultiple:l,searchValue:c,filterSearch:i})};let s=l?ti.Z:ts.ZP,u={key:void 0!==t.value?d:n,label:o.createElement(o.Fragment,null,o.createElement(s,{checked:a.includes(d)}),o.createElement("span",null,t.text))};return c.trim()?"function"==typeof i?i(c,t)?u:null:nY(c,t.text)?u:null:u})}({filters:u.filters||[],filterSearch:g,prefixCls:s,filteredKeys:B(),filterMultiple:h,searchValue:q}),l=a.every(e=>null===e);return o.createElement(o.Fragment,null,o.createElement(nV,{filterSearch:g,value:q,onChange:X,tablePrefixCls:i,locale:x}),l?r:o.createElement(t_.Z,{selectable:!0,multiple:h,prefixCls:"".concat(f,"-menu"),className:$,onSelect:z,onDeselect:z,selectedKeys:e,getPopupContainer:k,openKeys:W,onOpenChange:F,items:a}))})(),o.createElement("div",{className:"".concat(s,"-dropdown-btns")},o.createElement(tA.ZP,{type:"link",size:"small",disabled:E?(0,d.Z)((S||[]).map(e=>String(e)),e,!0):0===e.length,onClick:()=>Y()},x.filterReset),o.createElement(tA.ZP,{type:"primary",size:"small",onClick:G},x.filterConfirm)))}u.filterDropdown&&(l=o.createElement(tF.J,{selectable:void 0},l)),l=o.createElement(nU,{className:"".concat(s,"-dropdown")},l);let eo=(0,tB.Z)({trigger:["click"],placement:"rtl"===et?"bottomLeft":"bottomRight",children:(c="function"==typeof u.filterIcon?u.filterIcon(T):u.filterIcon?u.filterIcon:o.createElement(tj,null),o.createElement("span",{role:"button",tabIndex:-1,className:Z()("".concat(s,"-trigger"),{active:T}),onClick:e=>{e.stopPropagation()}},c)),getPopupContainer:k},Object.assign(Object.assign({},N),{rootClassName:Z()(C,N.rootClassName),open:L,onOpenChange:(e,t)=>{"trigger"===t.source&&(e&&void 0!==j&&H(j||[]),D(e),e||u.filterDropdown||!m||G())},popupRender:()=>"function"==typeof(null==N?void 0:N.dropdownRender)?N.dropdownRender(l):l}));return o.createElement("div",{className:"".concat(s,"-column")},o.createElement("span",{className:"".concat(i,"-column-title")},w),o.createElement(td.Z,Object.assign({},eo)))};let nJ=(e,t,n)=>{let o=[];return(e||[]).forEach((e,r)=>{var a;let l=tP(r,n),c=void 0!==e.filterDropdown;if(e.filters||c||"onFilter"in e){if("filteredValue"in e){let t=e.filteredValue;c||(t=null!==(a=null==t?void 0:t.map(String))&&void 0!==a?a:t),o.push({column:e,key:tR(e,l),filteredKeys:t,forceFiltered:e.filtered})}else o.push({column:e,key:tR(e,l),filteredKeys:t&&e.defaultFilteredValue?e.defaultFilteredValue:void 0,forceFiltered:e.filtered})}"children"in e&&(o=[].concat((0,el.Z)(o),(0,el.Z)(nJ(e.children,t,l))))}),o},nQ=e=>{let t={};return e.forEach(e=>{let{key:n,filteredKeys:o,column:r}=e,{filters:a,filterDropdown:l}=r;if(l)t[n]=o||null;else if(Array.isArray(o)){let e=nG(a);t[n]=e.filter(e=>o.includes(String(e)))}else t[n]=null}),t},n0=(e,t,n)=>t.reduce((e,o)=>{let{column:{onFilter:r,filters:a},filteredKeys:l}=o;return r&&l&&l.length?e.map(e=>Object.assign({},e)).filter(e=>l.some(o=>{let l=nG(a),c=l.findIndex(e=>String(e)===String(o)),i=-1!==c?l[c]:o;return e[n]&&(e[n]=n0(e[n],t,n)),r(i,e)})):e},e),n1=e=>e.flatMap(e=>"children"in e?[e].concat((0,el.Z)(n1(e.children||[]))):[e]);var n2=e=>{let{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:a,getPopupContainer:l,locale:c,rootClassName:i}=e;(0,tc.ln)("Table");let d=o.useMemo(()=>n1(r||[]),[r]),[s,u]=o.useState(()=>nJ(d,!0)),f=o.useMemo(()=>{let e=nJ(d,!1);if(0===e.length)return e;let t=!0;if(e.forEach(e=>{let{filteredKeys:n}=e;void 0!==n&&(t=!1)}),t){let e=(d||[]).map((e,t)=>tR(e,tP(t)));return s.filter(t=>{let{key:n}=t;return e.includes(n)}).map(t=>{let n=d[e.indexOf(t.key)];return Object.assign(Object.assign({},t),{column:Object.assign(Object.assign({},t.column),n),forceFiltered:n.filtered})})}return e},[d,s]),p=o.useMemo(()=>nQ(f),[f]),m=e=>{let t=f.filter(t=>{let{key:n}=t;return n!==e.key});t.push(e),u(t),a(nQ(t),t)};return[e=>(function e(t,n,r,a,l,c,i,d,s){return r.map((r,u)=>{let f=tP(u,d),{filterOnClose:p=!0,filterMultiple:m=!0,filterMode:h,filterSearch:v}=r,g=r;if(g.filters||g.filterDropdown){let e=tR(g,f),d=a.find(t=>{let{key:n}=t;return e===n});g=Object.assign(Object.assign({},g),{title:a=>o.createElement(n$,{tablePrefixCls:t,prefixCls:"".concat(t,"-filter"),dropdownPrefixCls:n,column:g,columnKey:e,filterState:d,filterOnClose:p,filterMultiple:m,filterMode:h,filterSearch:v,triggerFilter:c,locale:l,getPopupContainer:i,rootClassName:s},tM(r.title,a))})}return"children"in g&&(g=Object.assign(Object.assign({},g),{children:e(t,n,g.children,a,l,c,i,f,s)})),g})})(t,n,e,f,c,m,l,void 0,i),f,p]},n3=(e,t,n)=>{let r=o.useRef({});return[function(o){var a;if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let o=new Map;!function e(r){r.forEach((r,a)=>{let l=n(r,a);o.set(l,r),r&&"object"==typeof r&&t in r&&e(r[t]||[])})}(e),r.current={data:e,childrenColumnName:t,kvMap:o,getRowKey:n}}return null===(a=r.current.kvMap)||void 0===a?void 0:a.get(o)}]},n4=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);rt.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},n8=function(e,t,n){let r=n&&"object"==typeof n?n:{},{total:a=0}=r,l=n4(r,["total"]),[c,i]=(0,o.useState)(()=>({current:"defaultCurrent"in l?l.defaultCurrent:1,pageSize:"defaultPageSize"in l?l.defaultPageSize:10})),d=(0,tB.Z)(c,l,{total:a>0?a:e}),s=Math.ceil((a||e)/d.pageSize);d.current>s&&(d.current=s||1);let u=(e,t)=>{i({current:null!=e?e:1,pageSize:t||d.pageSize})};return!1===n?[{},()=>{}]:[Object.assign(Object.assign({},d),{onChange:(e,o)=>{var r;n&&(null===(r=n.onChange)||void 0===r||r.call(n,e,o)),u(e,o),t(e,o||(null==d?void 0:d.pageSize))}}),u]},n6={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"},n5=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:n6}))}),n7={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},n9=o.forwardRef(function(e,t){return o.createElement(tL.Z,(0,p.Z)({},e,{ref:t,icon:n7}))}),oe=n(99981);let ot="ascend",on="descend",oo=e=>"object"==typeof e.sorter&&"number"==typeof e.sorter.multiple&&e.sorter.multiple,or=e=>"function"==typeof e?e:!!e&&"object"==typeof e&&!!e.compare&&e.compare,oa=(e,t)=>t?e[e.indexOf(t)+1]:e[0],ol=(e,t,n)=>{let o=[],r=(e,t)=>{o.push({column:e,key:tR(e,t),multiplePriority:oo(e),sortOrder:e.sortOrder})};return(e||[]).forEach((e,a)=>{let l=tP(a,n);e.children?("sortOrder"in e&&r(e,l),o=[].concat((0,el.Z)(o),(0,el.Z)(ol(e.children,t,l)))):e.sorter&&("sortOrder"in e?r(e,l):t&&e.defaultSortOrder&&o.push({column:e,key:tR(e,l),multiplePriority:oo(e),sortOrder:e.defaultSortOrder}))}),o},oc=(e,t,n,r,a,l,c,i)=>(t||[]).map((t,d)=>{let s=tP(d,i),u=t;if(u.sorter){let i;let d=u.sortDirections||a,f=void 0===u.showSorterTooltip?c:u.showSorterTooltip,p=tR(u,s),m=n.find(e=>{let{key:t}=e;return t===p}),h=m?m.sortOrder:null,v=oa(d,h);if(t.sortIcon)i=t.sortIcon({sortOrder:h});else{let t=d.includes(ot)&&o.createElement(n9,{className:Z()("".concat(e,"-column-sorter-up"),{active:h===ot})}),n=d.includes(on)&&o.createElement(n5,{className:Z()("".concat(e,"-column-sorter-down"),{active:h===on})});i=o.createElement("span",{className:Z()("".concat(e,"-column-sorter"),{["".concat(e,"-column-sorter-full")]:!!(t&&n)})},o.createElement("span",{className:"".concat(e,"-column-sorter-inner"),"aria-hidden":"true"},t,n))}let{cancelSort:g,triggerAsc:b,triggerDesc:y}=l||{},x=g;v===on?x=y:v===ot&&(x=b);let w="object"==typeof f?Object.assign({title:x},f):{title:x};u=Object.assign(Object.assign({},u),{className:Z()(u.className,{["".concat(e,"-column-sort")]:h}),title:n=>{let r="".concat(e,"-column-sorters"),a=o.createElement("span",{className:"".concat(e,"-column-title")},tM(t.title,n)),l=o.createElement("div",{className:r},a,i);return f?"boolean"!=typeof f&&(null==f?void 0:f.target)==="sorter-icon"?o.createElement("div",{className:Z()(r,"".concat(r,"-tooltip-target-sorter"))},a,o.createElement(oe.Z,Object.assign({},w),i)):o.createElement(oe.Z,Object.assign({},w),l):l},onHeaderCell:n=>{var o;let a=(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,n))||{},l=a.onClick,c=a.onKeyDown;a.onClick=e=>{r({column:t,key:p,sortOrder:v,multiplePriority:oo(t)}),null==l||l(e)},a.onKeyDown=e=>{e.keyCode===tY.Z.ENTER&&(r({column:t,key:p,sortOrder:v,multiplePriority:oo(t)}),null==c||c(e))};let i=tT(t.title,{}),d=null==i?void 0:i.toString();return h&&(a["aria-sort"]="ascend"===h?"ascending":"descending"),a["aria-label"]=d||"",a.className=Z()(a.className,"".concat(e,"-column-has-sorters")),a.tabIndex=0,t.ellipsis&&(a.title=(null!=i?i:"").toString()),a}})}return"children"in u&&(u=Object.assign(Object.assign({},u),{children:oc(e,u.children,n,r,a,l,c,s)})),u}),oi=e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}},od=e=>{let t=e.filter(e=>{let{sortOrder:t}=e;return t}).map(oi);if(0===t.length&&e.length){let t=e.length-1;return Object.assign(Object.assign({},oi(e[t])),{column:void 0,order:void 0,field:void 0,columnKey:void 0})}return t.length<=1?t[0]||{}:t},os=(e,t,n)=>{let o=t.slice().sort((e,t)=>t.multiplePriority-e.multiplePriority),r=e.slice(),a=o.filter(e=>{let{column:{sorter:t},sortOrder:n}=e;return or(t)&&n});return a.length?r.sort((e,t)=>{for(let n=0;n{let o=e[n];return o?Object.assign(Object.assign({},e),{[n]:os(o,t,n)}):e}):r};var ou=e=>{let{prefixCls:t,mergedColumns:n,sortDirections:r,tableLocale:a,showSorterTooltip:l,onSorterChange:c}=e,[i,d]=o.useState(()=>ol(n,!0)),s=(e,t)=>{let n=[];return e.forEach((e,o)=>{let r=tP(o,t);if(n.push(tR(e,r)),Array.isArray(e.children)){let t=s(e.children,r);n.push.apply(n,(0,el.Z)(t))}}),n},u=o.useMemo(()=>{let e=!0,t=ol(n,!1);if(!t.length){let e=s(n);return i.filter(t=>{let{key:n}=t;return e.includes(n)})}let o=[];function r(t){e?o.push(t):o.push(Object.assign(Object.assign({},t),{sortOrder:null}))}let a=null;return t.forEach(t=>{null===a?(r(t),t.sortOrder&&(!1===t.multiplePriority?e=!1:a=!0)):(a&&!1!==t.multiplePriority||(e=!1),r(t))}),o},[n,i]),f=o.useMemo(()=>{var e,t;let n=u.map(e=>{let{column:t,sortOrder:n}=e;return{column:t,order:n}});return{sortColumns:n,sortColumn:null===(e=n[0])||void 0===e?void 0:e.column,sortOrder:null===(t=n[0])||void 0===t?void 0:t.order}},[u]),p=e=>{let t;d(t=!1!==e.multiplePriority&&u.length&&!1!==u[0].multiplePriority?[].concat((0,el.Z)(u.filter(t=>{let{key:n}=t;return n!==e.key})),[e]):[e]),c(od(t),t)};return[e=>oc(t,e,u,p,r,a,l),u,f,()=>od(u)]};let of=(e,t)=>e.map(e=>{let n=Object.assign({},e);return n.title=tM(e.title,t),"children"in n&&(n.children=of(n.children,t)),n});var op=e=>[o.useCallback(t=>of(t,e),[e])];let om=b(eI,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o}),oh=b(ez,(e,t)=>{let{_renderTimes:n}=e,{_renderTimes:o}=t;return n!==o});var ov=n(54558),og=e=>{let{componentCls:t,lineWidth:n,lineType:o,tableBorderColor:r,tableHeaderBg:a,tablePaddingVertical:l,tablePaddingHorizontal:c,calc:i}=e,d="".concat((0,nm.bf)(n)," ").concat(o," ").concat(r),s=(e,o,r)=>({["&".concat(t,"-").concat(e)]:{["> ".concat(t,"-container")]:{["> ".concat(t,"-content, > ").concat(t,"-body")]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(i(o).mul(-1).equal()),"\n ").concat((0,nm.bf)(i(i(r).add(n)).mul(-1).equal()))}}}}}});return{["".concat(t,"-wrapper")]:{["".concat(t).concat(t,"-bordered")]:Object.assign(Object.assign(Object.assign({["> ".concat(t,"-title")]:{border:d,borderBottom:0},["> ".concat(t,"-container")]:{borderInlineStart:d,borderTop:d,["\n > ".concat(t,"-content,\n > ").concat(t,"-header,\n > ").concat(t,"-body,\n > ").concat(t,"-summary\n ")]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:d},"> thead":{"> tr:not(:last-child) > th":{borderBottom:d},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{["> ".concat(t,"-cell-fix-right-first::after")]:{borderInlineEnd:d}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{["> ".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(i(l).mul(-1).equal())," ").concat((0,nm.bf)(i(i(c).add(n)).mul(-1).equal())),"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:d,content:'""'}}}}}},["&".concat(t,"-scroll-horizontal")]:{["> ".concat(t,"-container > ").concat(t,"-body")]:{"> table > tbody":{["\n > tr".concat(t,"-expanded-row,\n > tr").concat(t,"-placeholder\n ")]:{"> th, > td":{borderInlineEnd:0}}}}}},s("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),s("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{["> ".concat(t,"-footer")]:{border:d,borderTop:0}}),["".concat(t,"-cell")]:{["".concat(t,"-container:first-child")]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:"0 ".concat((0,nm.bf)(n)," 0 ").concat((0,nm.bf)(n)," ").concat(a)}},["".concat(t,"-bordered ").concat(t,"-cell-scrollbar")]:{borderInlineEnd:d}}}},ob=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-cell-ellipsis")]:Object.assign(Object.assign({},nv.vS),{wordBreak:"keep-all",["\n &".concat(t,"-cell-fix-left-last,\n &").concat(t,"-cell-fix-right-first\n ")]:{overflow:"visible",["".concat(t,"-cell-content")]:{display:"block",overflow:"hidden",textOverflow:"ellipsis"}},["".concat(t,"-column-title")]:{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"keep-all"}})}}},oy=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody > tr").concat(t,"-placeholder")]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},ox=e=>{let{componentCls:t,antCls:n,motionDurationSlow:o,lineWidth:r,paddingXS:a,lineType:l,tableBorderColor:c,tableExpandIconBg:i,tableExpandColumnWidth:d,borderRadius:s,tablePaddingVertical:u,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:m,expandIconMarginTop:h,expandIconSize:v,expandIconHalfInner:g,expandIconScale:b,calc:y}=e,x="".concat((0,nm.bf)(r)," ").concat(l," ").concat(c),w=y(m).sub(r).equal();return{["".concat(t,"-wrapper")]:{["".concat(t,"-expand-icon-col")]:{width:d},["".concat(t,"-row-expand-icon-cell")]:{textAlign:"center",["".concat(t,"-row-expand-icon")]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},["".concat(t,"-row-indent")]:{height:1,float:"left"},["".concat(t,"-row-expand-icon")]:Object.assign(Object.assign({},(0,nv.Nd)(e)),{position:"relative",float:"left",width:v,height:v,color:"inherit",lineHeight:(0,nm.bf)(v),background:i,border:x,borderRadius:s,transform:"scale(".concat(b,")"),"&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:"transform ".concat(o," ease-out"),content:'""'},"&::before":{top:g,insetInlineEnd:w,insetInlineStart:w,height:r},"&::after":{top:w,bottom:w,insetInlineStart:g,width:r,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}}),["".concat(t,"-row-indent + ").concat(t,"-row-expand-icon")]:{marginTop:h,marginInlineEnd:a},["tr".concat(t,"-expanded-row")]:{"&, &:hover":{"> th, > td":{background:p}},["".concat(n,"-descriptions-view")]:{display:"flex",table:{flex:"auto",width:"100%"}}},["".concat(t,"-expanded-row-fixed")]:{position:"relative",margin:"".concat((0,nm.bf)(y(u).mul(-1).equal())," ").concat((0,nm.bf)(y(f).mul(-1).equal())),padding:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(f))}}}},ow=e=>{let{componentCls:t,antCls:n,iconCls:o,tableFilterDropdownWidth:r,tableFilterDropdownSearchWidth:a,paddingXXS:l,paddingXS:c,colorText:i,lineWidth:d,lineType:s,tableBorderColor:u,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:h,motionDurationSlow:v,colorIcon:g,colorPrimary:b,tableHeaderFilterActiveBg:y,colorTextDisabled:x,tableFilterDropdownBg:w,tableFilterDropdownHeight:k,controlItemBgHover:C,controlItemBgActive:E,boxShadowSecondary:S,filterDropdownMenuBg:Z,calc:N}=e,K="".concat(n,"-dropdown"),O="".concat(t,"-filter-dropdown"),I="".concat(n,"-tree"),R="".concat((0,nm.bf)(d)," ").concat(s," ").concat(u);return[{["".concat(t,"-wrapper")]:{["".concat(t,"-filter-column")]:{display:"flex",justifyContent:"space-between"},["".concat(t,"-filter-trigger")]:{position:"relative",display:"flex",alignItems:"center",marginBlock:N(l).mul(-1).equal(),marginInline:"".concat((0,nm.bf)(l)," ").concat((0,nm.bf)(N(m).div(2).mul(-1).equal())),padding:"0 ".concat((0,nm.bf)(l)),color:f,fontSize:p,borderRadius:h,cursor:"pointer",transition:"all ".concat(v),"&:hover":{color:g,background:y},"&.active":{color:b}}}},{["".concat(n,"-dropdown")]:{[O]:Object.assign(Object.assign({},(0,nv.Wf)(e)),{minWidth:r,backgroundColor:w,borderRadius:h,boxShadow:S,overflow:"hidden",["".concat(K,"-menu")]:{maxHeight:k,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:Z,"&:empty::after":{display:"block",padding:"".concat((0,nm.bf)(c)," 0"),color:x,fontSize:p,textAlign:"center",content:'"Not Found"'}},["".concat(O,"-tree")]:{paddingBlock:"".concat((0,nm.bf)(c)," 0"),paddingInline:c,[I]:{padding:0},["".concat(I,"-treenode ").concat(I,"-node-content-wrapper:hover")]:{backgroundColor:C},["".concat(I,"-treenode-checkbox-checked ").concat(I,"-node-content-wrapper")]:{"&, &:hover":{backgroundColor:E}}},["".concat(O,"-search")]:{padding:c,borderBottom:R,"&-input":{input:{minWidth:a},[o]:{color:x}}},["".concat(O,"-checkall")]:{width:"100%",marginBottom:l,marginInlineStart:l},["".concat(O,"-btns")]:{display:"flex",justifyContent:"space-between",padding:"".concat((0,nm.bf)(N(c).sub(d).equal())," ").concat((0,nm.bf)(c)),overflow:"hidden",borderTop:R}})}},{["".concat(n,"-dropdown ").concat(O,", ").concat(O,"-submenu")]:{["".concat(n,"-checkbox-wrapper + span")]:{paddingInlineStart:c,color:i},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]},ok=e=>{let{componentCls:t,lineWidth:n,colorSplit:o,motionDurationSlow:r,zIndexTableFixed:a,tableBg:l,zIndexTableSticky:c,calc:i}=e;return{["".concat(t,"-wrapper")]:{["\n ".concat(t,"-cell-fix-left,\n ").concat(t,"-cell-fix-right\n ")]:{position:"sticky !important",zIndex:a,background:l},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{position:"absolute",top:0,right:{_skip_check_:!0,value:0},bottom:i(n).mul(-1).equal(),width:30,transform:"translateX(100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none",willChange:"transform"},["".concat(t,"-cell-fix-left-all::after")]:{display:"none"},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{position:"absolute",top:0,bottom:i(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:"translateX(-100%)",transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},["".concat(t,"-container")]:{position:"relative","&::before, &::after":{position:"absolute",top:0,bottom:0,zIndex:i(c).add(1).equal({unit:!1}),width:30,transition:"box-shadow ".concat(r),content:'""',pointerEvents:"none"},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},["".concat(t,"-ping-left")]:{["&:not(".concat(t,"-has-fix-left) ").concat(t,"-container::before")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after\n ")]:{boxShadow:"inset 10px 0 8px -8px ".concat(o)},["".concat(t,"-cell-fix-left-last::before")]:{backgroundColor:"transparent !important"}},["".concat(t,"-ping-right")]:{["&:not(".concat(t,"-has-fix-right) ").concat(t,"-container::after")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)},["\n ".concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"inset -10px 0 8px -8px ".concat(o)}},["".concat(t,"-fixed-column-gapped")]:{["\n ".concat(t,"-cell-fix-left-first::after,\n ").concat(t,"-cell-fix-left-last::after,\n ").concat(t,"-cell-fix-right-first::after,\n ").concat(t,"-cell-fix-right-last::after\n ")]:{boxShadow:"none"}}}}},oC=e=>{let{componentCls:t,antCls:n,margin:o}=e;return{["".concat(t,"-wrapper ").concat(t,"-pagination").concat(n,"-pagination")]:{margin:"".concat((0,nm.bf)(o)," 0")}}},oE=e=>{let{componentCls:t,tableRadius:n}=e;return{["".concat(t,"-wrapper")]:{[t]:{["".concat(t,"-title, ").concat(t,"-header")]:{borderRadius:"".concat((0,nm.bf)(n)," ").concat((0,nm.bf)(n)," 0 0")},["".concat(t,"-title + ").concat(t,"-container")]:{borderStartStartRadius:0,borderStartEndRadius:0,["".concat(t,"-header, table")]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:"0 0 ".concat((0,nm.bf)(n)," ").concat((0,nm.bf)(n))}}}}},oS=e=>{let{componentCls:t}=e;return{["".concat(t,"-wrapper-rtl")]:{direction:"rtl",table:{direction:"rtl"},["".concat(t,"-pagination-left")]:{justifyContent:"flex-end"},["".concat(t,"-pagination-right")]:{justifyContent:"flex-start"},["".concat(t,"-row-expand-icon")]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},["".concat(t,"-container")]:{"&::before":{insetInlineStart:"unset",insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:"unset"},["".concat(t,"-row-indent")]:{float:"right"}}}}},oZ=e=>{let{componentCls:t,antCls:n,iconCls:o,fontSizeIcon:r,padding:a,paddingXS:l,headerIconColor:c,headerIconHoverColor:i,tableSelectionColumnWidth:d,tableSelectedRowBg:s,tableSelectedRowHoverBg:u,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:m}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-selection-col")]:{width:d,["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).equal()}},["".concat(t,"-bordered ").concat(t,"-selection-col")]:{width:m(d).add(m(l).mul(2)).equal(),["&".concat(t,"-selection-col-with-dropdown")]:{width:m(d).add(r).add(m(a).div(4)).add(m(l).mul(2)).equal()}},["\n table tr th".concat(t,"-selection-column,\n table tr td").concat(t,"-selection-column,\n ").concat(t,"-selection-column\n ")]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",["".concat(n,"-radio-wrapper")]:{marginInlineEnd:0}},["table tr th".concat(t,"-selection-column").concat(t,"-cell-fix-left")]:{zIndex:m(e.zIndexTableFixed).add(1).equal({unit:!1})},["table tr th".concat(t,"-selection-column::after")]:{backgroundColor:"transparent !important"},["".concat(t,"-selection")]:{position:"relative",display:"inline-flex",flexDirection:"column"},["".concat(t,"-selection-extra")]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),marginInlineStart:"100%",paddingInlineStart:(0,nm.bf)(m(p).div(4).equal()),[o]:{color:c,fontSize:r,verticalAlign:"baseline","&:hover":{color:i}}},["".concat(t,"-tbody")]:{["".concat(t,"-row")]:{["&".concat(t,"-row-selected")]:{["> ".concat(t,"-cell")]:{background:s,"&-row-hover":{background:u}}},["> ".concat(t,"-cell-row-hover")]:{background:f}}}}}},oN=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:o}=e,r=(e,r,a,l)=>({["".concat(t).concat(t,"-").concat(e)]:{fontSize:l,["\n ".concat(t,"-title,\n ").concat(t,"-footer,\n ").concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{padding:"".concat((0,nm.bf)(r)," ").concat((0,nm.bf)(a))},["".concat(t,"-filter-trigger")]:{marginInlineEnd:(0,nm.bf)(o(a).div(2).mul(-1).equal())},["".concat(t,"-expanded-row-fixed")]:{margin:"".concat((0,nm.bf)(o(r).mul(-1).equal())," ").concat((0,nm.bf)(o(a).mul(-1).equal()))},["".concat(t,"-tbody")]:{["".concat(t,"-wrapper:only-child ").concat(t)]:{marginBlock:(0,nm.bf)(o(r).mul(-1).equal()),marginInline:"".concat((0,nm.bf)(o(n).sub(a).equal())," ").concat((0,nm.bf)(o(a).mul(-1).equal()))}},["".concat(t,"-selection-extra")]:{paddingInlineStart:(0,nm.bf)(o(a).div(4).equal())}}});return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({},r("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),r("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},oK=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:o,headerIconColor:r,headerIconHoverColor:a}=e;return{["".concat(t,"-wrapper")]:{["".concat(t,"-thead th").concat(t,"-column-has-sorters")]:{outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow,", left 0s"),"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},["\n &".concat(t,"-cell-fix-left:hover,\n &").concat(t,"-cell-fix-right:hover\n ")]:{background:e.tableFixedHeaderSortActiveBg}},["".concat(t,"-thead th").concat(t,"-column-sort")]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},["td".concat(t,"-column-sort")]:{background:e.tableBodySortBg},["".concat(t,"-column-title")]:{position:"relative",zIndex:1,flex:1,minWidth:0},["".concat(t,"-column-sorters")]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},["".concat(t,"-column-sorters-tooltip-target-sorter")]:{"&::after":{content:"none"}},["".concat(t,"-column-sorter")]:{marginInlineStart:n,color:r,fontSize:0,transition:"color ".concat(e.motionDurationSlow),"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:o,"&.active":{color:e.colorPrimary}},["".concat(t,"-column-sorter-up + ").concat(t,"-column-sorter-down")]:{marginTop:"-0.3em"}},["".concat(t,"-column-sorters:hover ").concat(t,"-column-sorter")]:{color:a}}}},oO=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:o,tableScrollThumbBgHover:r,tableScrollThumbSize:a,tableScrollBg:l,zIndexTableSticky:c,stickyScrollBarBorderRadius:i,lineWidth:d,lineType:s,tableBorderColor:u}=e,f="".concat((0,nm.bf)(d)," ").concat(s," ").concat(u);return{["".concat(t,"-wrapper")]:{["".concat(t,"-sticky")]:{"&-holder":{position:"sticky",zIndex:c,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:"".concat((0,nm.bf)(a)," !important"),zIndex:c,display:"flex",alignItems:"center",background:l,borderTop:f,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:a,backgroundColor:o,borderRadius:i,transition:"all ".concat(e.motionDurationSlow,", transform 0s"),position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:r}}}}}}},oI=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:o,calc:r}=e,a="".concat((0,nm.bf)(n)," ").concat(e.lineType," ").concat(o);return{["".concat(t,"-wrapper")]:{["".concat(t,"-summary")]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},["div".concat(t,"-summary")]:{boxShadow:"0 ".concat((0,nm.bf)(r(n).mul(-1).equal())," 0 ").concat(o)}}}},oR=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:o,lineType:r,tableBorderColor:a,calc:l}=e,c="".concat((0,nm.bf)(o)," ").concat(r," ").concat(a),i="".concat(t,"-expanded-row-cell");return{["".concat(t,"-wrapper")]:{["".concat(t,"-tbody-virtual")]:{["".concat(t,"-tbody-virtual-holder-inner")]:{["\n & > ".concat(t,"-row, \n & > div:not(").concat(t,"-row) > ").concat(t,"-row\n ")]:{display:"flex",boxSizing:"border-box",width:"100%"}},["".concat(t,"-cell")]:{borderBottom:c,transition:"background ".concat(n)},["".concat(t,"-expanded-row")]:{["".concat(i).concat(i,"-fixed")]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:"calc(var(--virtual-width) - ".concat((0,nm.bf)(o),")"),borderInlineEnd:"none"}}},["".concat(t,"-bordered")]:{["".concat(t,"-tbody-virtual")]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:c,position:"absolute"},["".concat(t,"-cell")]:{borderInlineEnd:c,["&".concat(t,"-cell-fix-right-first:before")]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:l(o).mul(-1).equal(),borderInlineStart:c}}},["&".concat(t,"-virtual")]:{["".concat(t,"-placeholder ").concat(t,"-cell")]:{borderInlineEnd:c,borderBottom:c}}}}}};let oP=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:o,tablePaddingHorizontal:r,tableExpandColumnWidth:a,lineWidth:l,lineType:c,tableBorderColor:i,tableFontSize:d,tableBg:s,tableRadius:u,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:m,tableHeaderCellSplitColor:h,tableFooterTextColor:v,tableFooterBg:g,calc:b}=e,y="".concat((0,nm.bf)(l)," ").concat(c," ").concat(i);return{["".concat(t,"-wrapper")]:Object.assign(Object.assign({clear:"both",maxWidth:"100%","--rc-virtual-list-scrollbar-bg":e.tableScrollBg},(0,nv.dF)()),{[t]:Object.assign(Object.assign({},(0,nv.Wf)(e)),{fontSize:d,background:s,borderRadius:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(u)," 0 0"),scrollbarColor:"".concat(e.tableScrollThumbBg," ").concat(e.tableScrollBg)}),table:{width:"100%",textAlign:"start",borderRadius:"".concat((0,nm.bf)(u)," ").concat((0,nm.bf)(u)," 0 0"),borderCollapse:"separate",borderSpacing:0},["\n ".concat(t,"-cell,\n ").concat(t,"-thead > tr > th,\n ").concat(t,"-tbody > tr > th,\n ").concat(t,"-tbody > tr > td,\n tfoot > tr > th,\n tfoot > tr > td\n ")]:{position:"relative",padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r)),overflowWrap:"break-word"},["".concat(t,"-title")]:{padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r))},["".concat(t,"-thead")]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease"),"&[colspan]:not([colspan='1'])":{textAlign:"center"},["&:not(:last-child):not(".concat(t,"-selection-column):not(").concat(t,"-row-expand-icon-cell):not([colspan])::before")]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:h,transform:"translateY(-50%)",transition:"background-color ".concat(p),content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},["".concat(t,"-tbody")]:{"> tr":{"> th, > td":{transition:"background ".concat(p,", border-color ").concat(p),borderBottom:y,["\n > ".concat(t,"-wrapper:only-child,\n > ").concat(t,"-expanded-row-fixed > ").concat(t,"-wrapper:only-child\n ")]:{[t]:{marginBlock:(0,nm.bf)(b(o).mul(-1).equal()),marginInline:"".concat((0,nm.bf)(b(a).sub(r).equal()),"\n ").concat((0,nm.bf)(b(r).mul(-1).equal())),["".concat(t,"-tbody > tr:last-child > td")]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:f,fontWeight:n,textAlign:"start",background:m,borderBottom:y,transition:"background ".concat(p," ease")},["& > ".concat(t,"-measure-cell")]:{paddingBlock:"0 !important",borderBlock:"0 !important",["".concat(t,"-measure-cell-content")]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},["".concat(t,"-footer")]:{padding:"".concat((0,nm.bf)(o)," ").concat((0,nm.bf)(r)),color:v,background:g}})}};var oM=(0,ny.I$)("Table",e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:o,controlInteractiveSize:r,headerBg:a,headerColor:l,headerSortActiveBg:c,headerSortHoverBg:i,bodySortBg:d,rowHoverBg:s,rowSelectedBg:u,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:m,cellPaddingInline:h,cellPaddingBlockMD:v,cellPaddingInlineMD:g,cellPaddingBlockSM:b,cellPaddingInlineSM:y,borderColor:x,footerBg:w,footerColor:k,headerBorderRadius:C,cellFontSize:E,cellFontSizeMD:S,cellFontSizeSM:Z,headerSplitColor:N,fixedHeaderSortActiveBg:K,headerFilterHoverBg:O,filterDropdownBg:I,expandIconBg:R,selectionColumnWidth:P,stickyScrollBarBg:M,calc:T}=e,D=(0,nb.IX)(e,{tableFontSize:E,tableBg:o,tableRadius:C,tablePaddingVertical:m,tablePaddingHorizontal:h,tablePaddingVerticalMiddle:v,tablePaddingHorizontalMiddle:g,tablePaddingVerticalSmall:b,tablePaddingHorizontalSmall:y,tableBorderColor:x,tableHeaderTextColor:l,tableHeaderBg:a,tableFooterTextColor:k,tableFooterBg:w,tableHeaderCellSplitColor:N,tableHeaderSortBg:c,tableHeaderSortHoverBg:i,tableBodySortBg:d,tableFixedHeaderSortActiveBg:K,tableHeaderFilterActiveBg:O,tableFilterDropdownBg:I,tableRowHoverBg:s,tableSelectedRowBg:u,tableSelectedRowHoverBg:f,zIndexTableFixed:2,zIndexTableSticky:T(2).add(1).equal({unit:!1}),tableFontSizeMiddle:S,tableFontSizeSmall:Z,tableSelectionColumnWidth:P,tableExpandIconBg:R,tableExpandColumnWidth:T(r).add(T(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:M,tableScrollThumbBgHover:t,tableScrollBg:n});return[oP(D),oC(D),oI(D),oK(D),ow(D),og(D),oE(D),ox(D),oI(D),oy(D),oZ(D),ok(D),oO(D),ob(D),oN(D),oS(D),oR(D)]},e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:o,colorFillSecondary:r,colorFillContent:a,controlItemBgActive:l,controlItemBgActiveHover:c,padding:i,paddingSM:d,paddingXS:s,colorBorderSecondary:u,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:m,fontSize:h,fontSizeSM:v,lineHeight:g,lineWidth:b,colorIcon:y,colorIconHover:x,opacityLoading:w,controlInteractiveSize:k}=e,C=new ov.t(r).onBackground(n).toHexString(),E=new ov.t(a).onBackground(n).toHexString(),S=new ov.t(t).onBackground(n).toHexString(),Z=new ov.t(y),N=new ov.t(x),K=k/2-b,O=2*K+3*b;return{headerBg:S,headerColor:o,headerSortActiveBg:C,headerSortHoverBg:E,bodySortBg:S,rowHoverBg:S,rowSelectedBg:l,rowSelectedHoverBg:c,rowExpandedBg:t,cellPaddingBlock:i,cellPaddingInline:i,cellPaddingBlockMD:d,cellPaddingInlineMD:s,cellPaddingBlockSM:s,cellPaddingInlineSM:s,borderColor:u,headerBorderRadius:f,footerBg:S,footerColor:o,cellFontSize:h,cellFontSizeMD:h,cellFontSizeSM:h,headerSplitColor:u,fixedHeaderSortActiveBg:C,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:m,stickyScrollBarBorderRadius:100,expandIconMarginTop:(h*g-3*b)/2-Math.ceil((1.4*v-3*b)/2),headerIconColor:Z.clone().setA(Z.a*w).toRgbString(),headerIconHoverColor:N.clone().setA(N.a*w).toRgbString(),expandIconHalfInner:K,expandIconSize:O,expandIconScale:k/O}},{unitless:{expandIconScale:!0}});let oT=[];var oD=o.forwardRef((e,t)=>{var n,r;let{prefixCls:l,className:c,rootClassName:i,style:d,size:s,bordered:u,dropdownPrefixCls:f,dataSource:p,pagination:m,rowSelection:h,rowKey:v="key",rowClassName:g,columns:b,children:y,childrenColumnName:x,onChange:w,getPopupContainer:k,loading:C,expandIcon:E,expandable:S,expandedRowRender:N,expandIconColumnIndex:K,indentSize:O,scroll:I,sortDirections:R,locale:P,showSorterTooltip:M={target:"full-header"},virtual:T}=e;(0,tc.ln)("Table");let D=o.useMemo(()=>b||ev(y),[b,y]),L=o.useMemo(()=>D.some(e=>e.responsive),[D]),j=(0,tZ.Z)(L),B=o.useMemo(()=>{let e=new Set(Object.keys(j).filter(e=>j[e]));return D.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[D,j]),H=(0,eq.Z)(e,["className","style","columns"]),{locale:z=tN.Z,direction:A,table:W,renderEmpty:_,getPrefixCls:F,getPopupContainer:q}=o.useContext(tk.E_),V=(0,tS.Z)(s),X=Object.assign(Object.assign({},z.Table),P),U=p||oT,G=F("table",l),Y=F("dropdown",f),[,$]=(0,tI.ZP)(),J=(0,tE.Z)(G),[Q,ee,et]=oM(G,J),en=Object.assign(Object.assign({childrenColumnName:x,expandIconColumnIndex:K},S),{expandIcon:null!==(n=null==S?void 0:S.expandIcon)&&void 0!==n?n:null===(r=null==W?void 0:W.expandable)||void 0===r?void 0:r.expandIcon}),{childrenColumnName:eo="children"}=en,er=o.useMemo(()=>U.some(e=>null==e?void 0:e[eo])?"nest":N||(null==S?void 0:S.expandedRowRender)?"row":null,[U]),ea={body:o.useRef(null)},el=o.useRef(null),ec=o.useRef(null);tb(t,()=>Object.assign(Object.assign({},ec.current),{nativeElement:el.current}));let ei=o.useMemo(()=>"function"==typeof v?v:e=>null==e?void 0:e[v],[v]),[ed]=n3(U,eo,ei),es={},eu=function(e,t){var n,o,r,a;let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=Object.assign(Object.assign({},es),e);l&&(null===(n=es.resetPagination)||void 0===n||n.call(es),(null===(o=c.pagination)||void 0===o?void 0:o.current)&&(c.pagination.current=1),m&&(null===(r=m.onChange)||void 0===r||r.call(m,1,null===(a=c.pagination)||void 0===a?void 0:a.pageSize))),I&&!1!==I.scrollToFirstRowOnChange&&ea.body.current&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{getContainer:n=()=>window,callback:o,duration:r=450}=t,a=n(),l=tx(a),c=Date.now(),i=()=>{let t=Date.now()-c,n=function(e,t,n,o){let r=n-t;return(e/=o/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}(t>r?r:t,l,e,r);ty(a)?a.scrollTo(window.pageXOffset,n):a instanceof Document||"HTMLDocument"===a.constructor.name?a.documentElement.scrollTop=n:a.scrollTop=n,tea.body.current}),null==w||w(c.pagination,c.filters,c.sorter,{currentDataSource:n0(os(U,c.sorterStates,eo),c.filterStates,eo),action:t})},[ef,ep,em,eh]=ou({prefixCls:G,mergedColumns:B,onSorterChange:(e,t)=>{eu({sorter:e,sorterStates:t},"sort",!1)},sortDirections:R||["ascend","descend"],tableLocale:X,showSorterTooltip:M}),eg=o.useMemo(()=>os(U,ep,eo),[U,ep]);es.sorter=eh(),es.sorterStates=ep;let[eb,ey,ex]=n2({prefixCls:G,locale:X,dropdownPrefixCls:Y,mergedColumns:B,onFilterChange:(e,t)=>{eu({filters:e,filterStates:t},"filter",!0)},getPopupContainer:k||q,rootClassName:Z()(i,J)}),ew=n0(eg,ey,eo);es.filters=ex,es.filterStates=ey;let[eC]=op(o.useMemo(()=>{let e={};return Object.keys(ex).forEach(t=>{null!==ex[t]&&(e[t]=ex[t])}),Object.assign(Object.assign({},em),{filters:e})},[em,ex])),[eE,eS]=n8(ew.length,(e,t)=>{eu({pagination:Object.assign(Object.assign({},es.pagination),{current:e,pageSize:t})},"paginate")},m);es.pagination=!1===m?{}:function(e,t){let n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&"object"==typeof t?t:{}).forEach(t=>{let o=e[t];"function"!=typeof o&&(n[t]=o)}),n}(eE,m),es.resetPagination=eS;let eZ=o.useMemo(()=>{if(!1===m||!eE.pageSize)return ew;let{current:e=1,total:t,pageSize:n=10}=eE;return ew.lengthn?ew.slice((e-1)*n,e*n):ew:ew.slice((e-1)*n,e*n)},[!!m,ew,null==eE?void 0:eE.current,null==eE?void 0:eE.pageSize,null==eE?void 0:eE.total]),[eN,eK]=tg({prefixCls:G,data:ew,pageData:eZ,getRowKey:ei,getRecordByKey:ed,expandType:er,childrenColumnName:eo,locale:X,getPopupContainer:k||q},h);en.__PARENT_RENDER_ICON__=en.expandIcon,en.expandIcon=en.expandIcon||E||(e=>{let{prefixCls:t,onExpand:n,record:r,expanded:a,expandable:l}=e,c="".concat(t,"-row-expand-icon");return o.createElement("button",{type:"button",onClick:e=>{n(r,e),e.stopPropagation()},className:Z()(c,{["".concat(c,"-spaced")]:!l,["".concat(c,"-expanded")]:l&&a,["".concat(c,"-collapsed")]:l&&!a}),"aria-label":a?X.collapse:X.expand,"aria-expanded":a})}),"nest"===er&&void 0===en.expandIconColumnIndex?en.expandIconColumnIndex=h?1:0:en.expandIconColumnIndex>0&&h&&(en.expandIconColumnIndex-=1),"number"!=typeof en.indentSize&&(en.indentSize="number"==typeof O?O:15);let eO=o.useCallback(e=>eC(eN(eb(ef(e)))),[ef,eb,eN]),eI=o.useMemo(()=>"boolean"==typeof C?{spinning:C}:"object"==typeof C&&null!==C?Object.assign({spinning:!0},C):void 0,[C]),eR=Z()(et,J,"".concat(G,"-wrapper"),null==W?void 0:W.className,{["".concat(G,"-wrapper-rtl")]:"rtl"===A},c,i,ee),eP=Object.assign(Object.assign({},null==W?void 0:W.style),d),eM=o.useMemo(()=>(null==eI?void 0:eI.spinning)&&U===oT?null:void 0!==(null==P?void 0:P.emptyText)?P.emptyText:(null==_?void 0:_("Table"))||o.createElement(tC.Z,{componentName:"Table"}),[null==eI?void 0:eI.spinning,U,null==P?void 0:P.emptyText,_]),eT={},eD=o.useMemo(()=>{let{fontSize:e,lineHeight:t,lineWidth:n,padding:o,paddingXS:r,paddingSM:a}=$,l=Math.floor(e*t);switch(V){case"middle":return 2*a+l+n;case"small":return 2*r+l+n;default:return 2*o+l+n}},[$,V]);T&&(eT.listItemHeight=eD);let{top:eL,bottom:ej}=(()=>{if(!1===m||!(null==eE?void 0:eE.total))return{};let e=()=>eE.size||("small"===V||"middle"===V?"small":void 0),t=t=>o.createElement(tK.Z,Object.assign({},eE,{align:eE.align||("left"===t?"start":"right"===t?"end":t),className:Z()("".concat(G,"-pagination"),eE.className),size:e()})),n="rtl"===A?"left":"right",r=eE.position;if(null===r||!Array.isArray(r))return{bottom:t(n)};let a=r.find(e=>"string"==typeof e&&e.toLowerCase().includes("top")),l=r.find(e=>"string"==typeof e&&e.toLowerCase().includes("bottom")),c=r.every(e=>"none"==="".concat(e)),i=a?a.toLowerCase().replace("top",""):"",d=l?l.toLowerCase().replace("bottom",""):"";return{top:i?t(i):void 0,bottom:d?t(d):a||l||c?void 0:t(n)}})();return Q(o.createElement("div",{ref:el,className:eR,style:eP},o.createElement(tO.Z,Object.assign({spinning:!1},eI),eL,o.createElement(T?oh:om,Object.assign({},eT,H,{ref:ec,columns:B,direction:A,expandable:en,prefixCls:G,className:Z()({["".concat(G,"-middle")]:"middle"===V,["".concat(G,"-small")]:"small"===V,["".concat(G,"-bordered")]:u,["".concat(G,"-empty")]:0===U.length},et,J,ee),data:eZ,rowKey:ei,rowClassName:(e,t,n)=>{let o;return o="function"==typeof g?Z()(g(e,t,n)):Z()(g),Z()({["".concat(G,"-row-selected")]:eK.has(ei(e,t))},o)},emptyText:eM,internalHooks:a,internalRefs:ea,transformColumns:eO,getContainerWidth:(e,t)=>{let n=e.querySelector(".".concat(G,"-container")),o=t;if(n){let e=getComputedStyle(n);o=t-Number.parseInt(e.borderLeftWidth,10)-Number.parseInt(e.borderRightWidth,10)}return o},measureRowRender:e=>o.createElement(tw.ZP,{getPopupContainer:e=>e},e)})),ej)))});let oL=o.forwardRef((e,t)=>{let n=o.useRef(0);return n.current+=1,o.createElement(oD,Object.assign({},e,{ref:t,_renderTimes:n.current}))});oL.SELECTION_COLUMN=tu,oL.EXPAND_COLUMN=r,oL.SELECTION_ALL=tf,oL.SELECTION_INVERT=tp,oL.SELECTION_NONE=tm,oL.Column=e=>null,oL.ColumnGroup=e=>null,oL.Summary=H;var oj=oL}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/665-61c75c183699f983.js b/litellm/proxy/_experimental/out/_next/static/chunks/665-61c75c183699f983.js deleted file mode 100644 index 7a9fc4952ad..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/665-61c75c183699f983.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[665],{84717:function(e,s,a){a.d(s,{Ct:function(){return t.Z},Dx:function(){return x.Z},OK:function(){return n.Z},Zb:function(){return r.Z},nP:function(){return m.Z},rj:function(){return i.Z},td:function(){return o.Z},v0:function(){return d.Z},x4:function(){return c.Z},xv:function(){return u.Z},zx:function(){return l.Z}});var t=a(41649),l=a(78489),r=a(12514),i=a(67101),n=a(12485),d=a(18135),o=a(35242),c=a(29706),m=a(77991),u=a(84264),x=a(96761)},40728:function(e,s,a){a.d(s,{C:function(){return t.Z},x:function(){return l.Z}});var t=a(41649),l=a(84264)},64504:function(e,s,a){a.d(s,{o:function(){return l.Z},z:function(){return t.Z}});var t=a(78489),l=a(49566)},49282:function(e,s,a){var t=a(2265),l=a(39760),r=a(39623);s.Z=()=>{let[e,s]=(0,t.useState)([]),{accessToken:a,userId:i,userRole:n}=(0,l.Z)();return(0,t.useEffect)(()=>{(async()=>{s(await (0,r.Z)(a,i,n,null))})()},[a,i,n]),{teams:e,setTeams:s}}},39623:function(e,s,a){a.d(s,{Z:function(){return l}});var t=a(19250);let l=async(e,s,a,l)=>"Admin"!=a&&"Admin Viewer"!=a?await (0,t.teamListCall)(e,(null==l?void 0:l.organization_id)||null,s):await (0,t.teamListCall)(e,(null==l?void 0:l.organization_id)||null)},21609:function(e,s,a){a.d(s,{Z:function(){return c}});var t=a(57437),l=a(57840),r=a(22116),i=a(51653),n=a(76188),d=a(4260),o=a(2265);function c(e){let{isOpen:s,title:a,alertMessage:c,message:m,resourceInformationTitle:u,resourceInformation:x,onCancel:g,onOk:h,confirmLoading:p,requiredConfirmation:v}=e,{Title:j,Text:_}=l.default,[b,y]=(0,o.useState)("");return(0,o.useEffect)(()=>{s&&y("")},[s]),(0,t.jsx)(r.Z,{title:a,open:s,onOk:h,onCancel:g,confirmLoading:p,okText:p?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!v&&b!==v||p},cancelButtonProps:{disabled:p},children:(0,t.jsxs)("div",{className:"space-y-4",children:[c&&(0,t.jsx)(i.Z,{message:c,type:"warning"}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(j,{level:5,className:"mb-3 text-gray-900",children:u}),(0,t.jsx)(n.Z,{column:1,size:"small",children:x&&x.map(e=>{let{label:s,value:a,...l}=e;return(0,t.jsx)(n.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:s}),children:(0,t.jsx)(_,{...l,children:null!=a?a:"-"})},s)})})]}),(0,t.jsx)("div",{children:(0,t.jsx)(_,{children:m})}),v&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200",children:[(0,t.jsxs)(_,{className:"block text-base font-medium text-gray-700 mb-2",children:[(0,t.jsx)(_,{children:"Type "}),(0,t.jsx)(_,{strong:!0,type:"danger",children:v}),(0,t.jsx)(_,{children:" to confirm deletion:"})]}),(0,t.jsx)(d.default,{value:b,onChange:e=>y(e.target.value),placeholder:v,className:"rounded-md text-base border-gray-200",autoFocus:!0})]})]})})}},67479:function(e,s,a){var t=a(57437),l=a(2265),r=a(37592),i=a(19250);s.Z=e=>{let{onChange:s,value:a,className:n,accessToken:d,disabled:o}=e,[c,m]=(0,l.useState)([]),[u,x]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{(async()=>{if(d){x(!0);try{let e=await (0,i.getGuardrailsList)(d);console.log("Guardrails response:",e),e.guardrails&&(console.log("Guardrails data:",e.guardrails),m(e.guardrails))}catch(e){console.error("Error fetching guardrails:",e)}finally{x(!1)}}})()},[d]),(0,t.jsx)("div",{children:(0,t.jsx)(r.default,{mode:"multiple",disabled:o,placeholder:o?"Setting guardrails is a premium feature.":"Select guardrails",onChange:e=>{console.log("Selected guardrails:",e),s(e)},value:a,loading:u,className:n,allowClear:!0,options:c.map(e=>(console.log("Mapping guardrail:",e),{label:"".concat(e.guardrail_name),value:e.guardrail_name})),optionFilterProp:"label",showSearch:!0,style:{width:"100%"}})})}},27799:function(e,s,a){var t=a(57437);a(2265);var l=a(40728),r=a(82182),i=a(91777),n=a(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:a=[],variant:d="card",className:o=""}=e,c=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[a,t]=s;return t===e}))||void 0===s?void 0:s[0])||e},m=e=>{switch(e){case"success":return"green";case"failure":return"red";case"success_and_failure":return"blue";default:return"gray"}},u=e=>{switch(e){case"success":return"Success Only";case"failure":return"Failure Only";case"success_and_failure":return"Success & Failure";default:return e}},x=(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,t.jsx)(l.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,t.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var a;let i=c(e.callback_name),d=null===(a=n.Dg[i])||void 0===a?void 0:a.logo;return(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,t.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}):(0,t.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(l.x,{className:"font-medium text-blue-800",children:i}),(0,t.jsxs)(l.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,t.jsx)(l.C,{color:m(e.callback_type),size:"sm",children:u(e.callback_type)})]},s)})}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,t.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,t.jsx)(l.C,{color:"red",size:"xs",children:a.length})]}),a.length>0?(0,t.jsx)("div",{className:"space-y-3",children:a.map((e,s)=>{var a;let r=n.RD[e]||e,d=null===(a=n.Dg[r])||void 0===a?void 0:a.logo;return(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,t.jsx)("img",{src:d,alt:r,className:"w-5 h-5 object-contain"}):(0,t.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(l.x,{className:"font-medium text-red-800",children:r}),(0,t.jsx)(l.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,t.jsx)(l.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===d?(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,t.jsx)(l.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),x]}):(0,t.jsxs)("div",{className:"".concat(o),children:[(0,t.jsx)(l.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),x]})}},60131:function(e,s,a){a.d(s,{Z:function(){return v}});var t=a(57437),l=a(2265),r=a(92280),i=a(40728),n=a(79814),d=a(19250),o=function(e){let{vectorStores:s,accessToken:a}=e,[r,o]=(0,l.useState)([]);(0,l.useEffect)(()=>{(async()=>{if(a&&0!==s.length)try{let e=await (0,d.vectorStoreListCall)(a);e.data&&o(e.data.map(e=>({vector_store_id:e.vector_store_id,vector_store_name:e.vector_store_name})))}catch(e){console.error("Error fetching vector stores:",e)}})()},[a,s.length]);let c=e=>{let s=r.find(s=>s.vector_store_id===e);return s?"".concat(s.vector_store_name||s.vector_store_id," (").concat(s.vector_store_id,")"):e};return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,t.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,t.jsx)("div",{className:"inline-flex items-center px-3 py-1.5 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-sm font-medium",children:c(e)},s))}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},c=a(25327),m=a(86462),u=a(47686),x=a(99981),g=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[g,h]=(0,l.useState)([]),[p,v]=(0,l.useState)([]),[j,_]=(0,l.useState)(new Set),b=e=>{_(s=>{let a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a})};(0,l.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,d.fetchMCPServers)(o);e&&Array.isArray(e)?h(e):e.data&&Array.isArray(e.data)&&h(e.data)}catch(e){console.error("Error fetching MCP servers:",e)}})()},[o,s.length]),(0,l.useEffect)(()=>{(async()=>{if(o&&r.length>0)try{let e=await Promise.resolve().then(a.bind(a,19250)).then(e=>e.fetchMCPAccessGroups(o));v(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let y=e=>{let s=g.find(s=>s.server_id===e);if(s){let a=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(a,")")}return e},f=e=>e,N=[...s.map(e=>({type:"server",value:e})),...r.map(e=>({type:"accessGroup",value:e}))],k=N.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Z,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,t.jsx)(i.C,{color:"blue",size:"xs",children:k})]}),k>0?(0,t.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let a="server"===e.type?n[e.value]:void 0,l=a&&a.length>0,r=j.has(e.value);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>l&&b(e.value),className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 transition-all ".concat(l?"cursor-pointer hover:bg-gray-50 hover:border-gray-300":"bg-white"),children:[(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,t.jsx)(x.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:y(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:f(e.value)}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})}),l&&(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-gray-600",children:a.length}),(0,t.jsx)("span",{className:"text-xs text-gray-500",children:1===a.length?"tool":"tools"}),r?(0,t.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,t.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l&&r&&(0,t.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map((e,s)=>(0,t.jsx)("span",{className:"inline-flex items-center px-2.5 py-1 rounded-lg bg-blue-50 border border-blue-200 text-blue-800 text-xs font-medium",children:e},s))})})]},s)})}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(c.Z,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},h=a(3497),p=function(e){let{agents:s,agentAccessGroups:a=[],accessToken:r}=e,[n,o]=(0,l.useState)([]);(0,l.useEffect)(()=>{(async()=>{if(r&&s.length>0)try{let e=await (0,d.getAgentsList)(r);e&&e.agents&&Array.isArray(e.agents)&&o(e.agents)}catch(e){console.error("Error fetching agents:",e)}})()},[r,s.length]);let c=e=>{let s=n.find(s=>s.agent_id===e);if(s){let a=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.agent_name," (").concat(a,")")}return e},m=[...s.map(e=>({type:"agent",value:e})),...a.map(e=>({type:"accessGroup",value:e}))],u=m.length;return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(h.Z,{className:"h-4 w-4 text-purple-600"}),(0,t.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Agents"}),(0,t.jsx)(i.C,{color:"purple",size:"xs",children:u})]}),u>0?(0,t.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:m.map((e,s)=>(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsx)("div",{className:"flex items-center gap-3 py-2 px-3 rounded-lg border border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"agent"===e.type?(0,t.jsx)(x.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-purple-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:c(e.value)})]})}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,t.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:e.value}),(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-[9px] font-semibold text-green-600 bg-green-50 border border-green-200 rounded uppercase tracking-wide flex-shrink-0",children:"Group"})]})})})},s))}):(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,t.jsx)(h.Z,{className:"h-4 w-4 text-gray-400"}),(0,t.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No agents or access groups configured"})]})]})},v=function(e){let{objectPermission:s,variant:a="card",className:l="",accessToken:i}=e,n=(null==s?void 0:s.vector_stores)||[],d=(null==s?void 0:s.mcp_servers)||[],c=(null==s?void 0:s.mcp_access_groups)||[],m=(null==s?void 0:s.mcp_tool_permissions)||{},u=(null==s?void 0:s.agents)||[],x=(null==s?void 0:s.agent_access_groups)||[],h=(0,t.jsxs)("div",{className:"card"===a?"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6":"space-y-4",children:[(0,t.jsx)(o,{vectorStores:n,accessToken:i}),(0,t.jsx)(g,{mcpServers:d,mcpAccessGroups:c,mcpToolPermissions:m,accessToken:i}),(0,t.jsx)(p,{agents:u,agentAccessGroups:x,accessToken:i})]});return"card"===a?(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,t.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),h]}):(0,t.jsxs)("div",{className:"".concat(l),children:[(0,t.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),h]})}},21425:function(e,s,a){var t=a(57437);a(2265);var l=a(54507);s.Z=e=>{let{value:s,onChange:a,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,t.jsx)(l.Z,{value:s,onChange:a,disabledCallbacks:r,onDisabledCallbacksChange:i})}},50665:function(e,s,a){a.d(s,{Z:function(){return eo}});var t=a(57437),l=a(49282),r=a(59872),i=a(33304),n=a(10900),d=a(23628),o=a(74998),c=a(84717),m=a(10032),u=a(5545),x=a(99981),g=a(30401),h=a(78867),p=a(2265),v=a(20347),j=a(97434),_=a(40728),b=a(58710),y=e=>{let{autoRotate:s=!1,rotationInterval:a,lastRotationAt:l,keyRotationAt:r,nextRotationAt:i,variant:n="card",className:o=""}=e,c=e=>{let s=new Date(e),a=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),t=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(a," at ").concat(t)},m=(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Z,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(_.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,t.jsx)(_.C,{color:s?"green":"gray",size:"xs",children:s?"Enabled":"Disabled"}),s&&a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.x,{className:"text-gray-400",children:"•"}),(0,t.jsxs)(_.x,{className:"text-sm text-gray-600",children:["Every ",a]})]})]})}),(s||l||r||i)&&(0,t.jsxs)("div",{className:"space-y-3",children:[l&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,t.jsx)(b.Z,{className:"w-4 h-4 text-gray-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(_.x,{className:"font-medium text-gray-700",children:"Last Rotation"}),(0,t.jsx)(_.x,{className:"text-sm text-gray-600",children:c(l)})]})]}),(r||i)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,t.jsx)(b.Z,{className:"w-4 h-4 text-gray-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(_.x,{className:"font-medium text-gray-700",children:"Next Scheduled Rotation"}),(0,t.jsx)(_.x,{className:"text-sm text-gray-600",children:c(i||r||"")})]})]}),s&&!l&&!r&&!i&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,t.jsx)(b.Z,{className:"w-4 h-4 text-gray-500"}),(0,t.jsx)(_.x,{className:"text-gray-600",children:"No rotation history available"})]})]}),!s&&!l&&!r&&!i&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,t.jsx)(d.Z,{className:"w-4 h-4 text-gray-400"}),(0,t.jsx)(_.x,{className:"text-gray-600",children:"Auto-rotation is not enabled for this key"})]})]});return"card"===n?(0,t.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,t.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(_.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,t.jsx)(_.x,{className:"text-xs text-gray-500",children:"Automatic key rotation settings and status for this key"})]})}),m]}):(0,t.jsxs)("div",{className:"".concat(o),children:[(0,t.jsx)(_.x,{className:"font-medium text-gray-900 mb-3",children:"Auto-Rotation"}),m]})},f=a(21609);let N=["logging"],k=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!N.includes(s)})):{},w=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],Z=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(k(e),null,s)},S=e=>{if(!e||"object"!=typeof e)return e;let{tags:s,...a}=e;return a};var C=a(27799),A=a(9114),I=a(19250),P=a(60131),L=a(39760),D=a(78489),M=a(49804),T=a(67101),E=a(84264),R=a(49566),F=a(96761),V=a(22116),O=a(19015),z=a(92668),K=a(29233);function U(e){let{selectedToken:s,visible:a,onClose:l,onKeyUpdate:r}=e,{accessToken:i}=(0,L.Z)(),[n]=m.Z.useForm(),[d,o]=(0,p.useState)(null),[c,u]=(0,p.useState)(null),[x,g]=(0,p.useState)(null),[h,v]=(0,p.useState)(!1),[j,_]=(0,p.useState)(!1),[b,y]=(0,p.useState)(null);(0,p.useEffect)(()=>{a&&s&&i&&(n.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),y(i),_(s.key_name===i))},[a,s,n,i]),(0,p.useEffect)(()=>{a||(o(null),v(!1),_(!1),y(null),n.resetFields())},[a,n]);let f=e=>{if(!e)return null;try{let s;let a=new Date;if(e.endsWith("s"))s=(0,z.I)(a,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,z.I)(a,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,z.I)(a,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,p.useEffect)(()=>{(null==c?void 0:c.duration)?g(f(c.duration)):g(null)},[null==c?void 0:c.duration]);let N=async()=>{if(s&&b){v(!0);try{let e=await n.validateFields(),a=await (0,I.regenerateKeyCall)(b,s.token||s.token_id,e);o(a.key),A.Z.success("Virtual Key regenerated successfully"),console.log("Full regenerate response:",a);let t={token:a.token||a.key_id||s.token,key_name:a.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?f(e.duration):s.expires,...a};console.log("Updated key data with new token:",t),r&&r(t),v(!1)}catch(e){console.error("Error regenerating key:",e),A.Z.fromBackend(e),v(!1)}}},k=()=>{o(null),v(!1),_(!1),y(null),n.resetFields(),l()};return(0,t.jsx)(V.Z,{title:"Regenerate Virtual Key",open:a,onCancel:k,footer:d?[(0,t.jsx)(D.Z,{onClick:k,children:"Close"},"close")]:[(0,t.jsx)(D.Z,{onClick:k,className:"mr-2",children:"Cancel"},"cancel"),(0,t.jsx)(D.Z,{onClick:N,disabled:h,children:h?"Regenerating...":"Regenerate"},"regenerate")],children:d?(0,t.jsxs)(T.Z,{numItems:1,className:"gap-2 w-full",children:[(0,t.jsx)(F.Z,{children:"Regenerated Key"}),(0,t.jsx)(M.Z,{numColSpan:1,children:(0,t.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,t.jsx)("b",{children:"you will not be able to view it again"})," through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,t.jsxs)(M.Z,{numColSpan:1,children:[(0,t.jsx)(E.Z,{className:"mt-3",children:"Key Alias:"}),(0,t.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,t.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,t.jsx)(E.Z,{className:"mt-3",children:"New Virtual Key:"}),(0,t.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,t.jsx)("pre",{className:"break-words whitespace-normal",children:d})}),(0,t.jsx)(K.CopyToClipboard,{text:d,onCopy:()=>A.Z.success("Virtual Key copied to clipboard"),children:(0,t.jsx)(D.Z,{className:"mt-3",children:"Copy Virtual Key"})})]})]}):(0,t.jsxs)(m.Z,{form:n,layout:"vertical",onValuesChange:e=>{"duration"in e&&u(s=>({...s,duration:e.duration}))},children:[(0,t.jsx)(m.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,t.jsx)(R.Z,{disabled:!0})}),(0,t.jsx)(m.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,t.jsx)(O.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(m.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,t.jsx)(O.Z,{style:{width:"100%"}})}),(0,t.jsx)(m.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,t.jsx)(O.Z,{style:{width:"100%"}})}),(0,t.jsx)(m.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,t.jsx)(R.Z,{placeholder:""})}),(0,t.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry: ",(null==s?void 0:s.expires)?new Date(s.expires).toLocaleString():"Never"]}),x&&(0,t.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",x]})]})})}var G=a(85968),B=a(67479),q=a(64504),W=a(37592),J=a(4260),$=a(63709),Q=a(62099),Y=a(95096),H=a(65895),X=a(97492),ee=a(68473),es=a(82586),ea=a(19640),et=a(24199),el=a(21425),er=a(97415),ei=a(15424);let en=e=>e&&0!==e.length?e.includes("llm_api_routes")?"llm_api":e.includes("management_routes")?"management":e.includes("info_routes")?"read_only":"default":"default";function ed(e){var s,a,l,r,i,n,d,o,c,u,g,h,v,_;let{keyData:b,onCancel:y,onSubmit:f,teams:N,accessToken:k,userID:C,userRole:P,premiumUser:L=!1}=e,[D]=m.Z.useForm(),[M,T]=(0,p.useState)([]),[E,R]=(0,p.useState)([]),[F,V]=(0,p.useState)({}),O=null==N?void 0:N.find(e=>e.team_id===b.team_id),[z,K]=(0,p.useState)([]),[U,G]=(0,p.useState)([]),[ed,eo]=(0,p.useState)(!1),[ec,em]=(0,p.useState)(Array.isArray(null===(s=b.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,j.PA)(b.metadata.litellm_disabled_callbacks):[]),[eu,ex]=(0,p.useState)(b.auto_rotate||!1),[eg,eh]=(0,p.useState)(b.rotation_interval||""),[ep,ev]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=async()=>{if(C&&P&&k)try{if(null===b.team_id){let e=(await (0,I.modelAvailableCall)(k,C,P)).data.map(e=>e.id);K(e)}else if(null==O?void 0:O.team_id){let e=await (0,ea.wk)(C,P,k,O.team_id);K(Array.from(new Set([...O.models,...e])))}}catch(e){console.error("Error fetching models:",e)}};(async()=>{if(k)try{let e=await (0,I.getPromptsList)(k);R(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}})(),e()},[C,P,k,O,b.team_id]),(0,p.useEffect)(()=>{D.setFieldValue("disabled_callbacks",ec)},[D,ec]);let ej=e=>e&&({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||null,e_={...b,token:b.token||b.token_id,budget_duration:ej(b.budget_duration),metadata:Z(S(b.metadata)),guardrails:null===(a=b.metadata)||void 0===a?void 0:a.guardrails,disable_global_guardrails:(null===(l=b.metadata)||void 0===l?void 0:l.disable_global_guardrails)||!1,prompts:null===(r=b.metadata)||void 0===r?void 0:r.prompts,tags:null===(i=b.metadata)||void 0===i?void 0:i.tags,vector_stores:(null===(n=b.object_permission)||void 0===n?void 0:n.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(d=b.object_permission)||void 0===d?void 0:d.mcp_servers)||[],accessGroups:(null===(o=b.object_permission)||void 0===o?void 0:o.mcp_access_groups)||[]},mcp_tool_permissions:(null===(c=b.object_permission)||void 0===c?void 0:c.mcp_tool_permissions)||{},agents_and_groups:{agents:(null===(u=b.object_permission)||void 0===u?void 0:u.agents)||[],accessGroups:(null===(g=b.object_permission)||void 0===g?void 0:g.agent_access_groups)||[]},logging_settings:w(b.metadata),disabled_callbacks:Array.isArray(null===(h=b.metadata)||void 0===h?void 0:h.litellm_disabled_callbacks)?(0,j.PA)(b.metadata.litellm_disabled_callbacks):[],auto_rotate:b.auto_rotate||!1,...b.rotation_interval&&{rotation_interval:b.rotation_interval},allowed_routes:b.allowed_routes};(0,p.useEffect)(()=>{var e,s,a,t,l,r,i,n,d;D.setFieldsValue({...b,token:b.token||b.token_id,budget_duration:ej(b.budget_duration),metadata:Z(S(b.metadata)),guardrails:null===(e=b.metadata)||void 0===e?void 0:e.guardrails,disable_global_guardrails:(null===(s=b.metadata)||void 0===s?void 0:s.disable_global_guardrails)||!1,prompts:null===(a=b.metadata)||void 0===a?void 0:a.prompts,tags:null===(t=b.metadata)||void 0===t?void 0:t.tags,vector_stores:(null===(l=b.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(r=b.object_permission)||void 0===r?void 0:r.mcp_servers)||[],accessGroups:(null===(i=b.object_permission)||void 0===i?void 0:i.mcp_access_groups)||[]},mcp_tool_permissions:(null===(n=b.object_permission)||void 0===n?void 0:n.mcp_tool_permissions)||{},logging_settings:w(b.metadata),disabled_callbacks:Array.isArray(null===(d=b.metadata)||void 0===d?void 0:d.litellm_disabled_callbacks)?(0,j.PA)(b.metadata.litellm_disabled_callbacks):[],auto_rotate:b.auto_rotate||!1,...b.rotation_interval&&{rotation_interval:b.rotation_interval},allowed_routes:b.allowed_routes})},[b,D]),(0,p.useEffect)(()=>{D.setFieldValue("auto_rotate",eu)},[eu,D]),(0,p.useEffect)(()=>{eg&&D.setFieldValue("rotation_interval",eg)},[eg,D]),(0,p.useEffect)(()=>{(async()=>{if(k)try{let e=await (0,I.tagListCall)(k);V(e)}catch(e){A.Z.fromBackend("Error fetching tags: "+e)}})()},[k]),console.log("premiumUser:",L);let eb=async e=>{try{ev(!0),await f(e)}finally{ev(!1)}};return(0,t.jsxs)(m.Z,{form:D,onFinish:eb,initialValues:e_,layout:"vertical",children:[(0,t.jsx)(m.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,t.jsx)(q.o,{})}),(0,t.jsx)(m.Z.Item,{label:"Models",name:"models",children:(0,t.jsx)(m.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_routes!==s.allowed_routes||e.models!==s.models,children:e=>{let{getFieldValue:s,setFieldValue:a}=e,l=s("allowed_routes")||[],r=l.includes("management_routes")||l.includes("info_routes"),i=s("models")||[];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(W.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:r,value:r?[]:i,onChange:e=>a("models",e),children:[z.length>0&&(0,t.jsx)(W.default.Option,{value:"all-team-models",children:"All Team Models"}),z.map(e=>(0,t.jsx)(W.default.Option,{value:e,children:e},e))]}),r&&(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Models field is disabled for this key type"})]})}})}),(0,t.jsx)(m.Z.Item,{label:"Key Type",children:(0,t.jsx)(m.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_routes!==s.allowed_routes,children:e=>{let{getFieldValue:s,setFieldValue:a}=e,l=en(s("allowed_routes"));return(0,t.jsxs)(W.default,{placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",value:l,onChange:e=>{switch(e){case"default":a("allowed_routes",[]);break;case"llm_api":a("allowed_routes",["llm_api_routes"]);break;case"management":a("allowed_routes",["management_routes"]),a("models",[])}},children:[(0,t.jsx)(W.default.Option,{value:"default",label:"Default",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,t.jsx)(W.default.Option,{value:"llm_api",label:"LLM API",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,t.jsx)(W.default.Option,{value:"management",label:"Management",children:(0,t.jsxs)("div",{style:{padding:"4px 0"},children:[(0,t.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,t.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})})]})}})}),(0,t.jsx)(m.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(et.Z,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,t.jsx)(m.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(W.default,{placeholder:"n/a",children:[(0,t.jsx)(W.default.Option,{value:"daily",children:"Daily"}),(0,t.jsx)(W.default.Option,{value:"weekly",children:"Weekly"}),(0,t.jsx)(W.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,t.jsx)(m.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,t.jsx)(et.Z,{min:0})}),(0,t.jsx)(H.Z,{type:"tpm",name:"tpm_limit_type",showDetailedDescriptions:!1}),(0,t.jsx)(m.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,t.jsx)(et.Z,{min:0})}),(0,t.jsx)(H.Z,{type:"rpm",name:"rpm_limit_type",showDetailedDescriptions:!1}),(0,t.jsx)(m.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,t.jsx)(et.Z,{min:0})}),(0,t.jsx)(m.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,t.jsx)(J.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,t.jsx)(m.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,t.jsx)(J.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,t.jsx)(m.Z.Item,{label:"Guardrails",name:"guardrails",children:k&&(0,t.jsx)(B.Z,{onChange:e=>{D.setFieldValue("guardrails",e)},accessToken:k,disabled:!L})}),(0,t.jsx)(m.Z.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(x.Z,{title:"When enabled, this key will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)(ei.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",children:(0,t.jsx)($.Z,{disabled:!L,checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(m.Z.Item,{label:"Tags",name:"tags",children:(0,t.jsx)(W.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",options:Object.values(F).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}),(0,t.jsx)(m.Z.Item,{label:"Prompts",name:"prompts",children:(0,t.jsx)(x.Z,{title:L?"":"Setting prompts by key is a premium feature",placement:"top",children:(0,t.jsx)(W.default,{mode:"tags",style:{width:"100%"},disabled:!L,placeholder:L?Array.isArray(null===(v=b.metadata)||void 0===v?void 0:v.prompts)&&b.metadata.prompts.length>0?"Current: ".concat(b.metadata.prompts.join(", ")):"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:E.map(e=>({value:e,label:e}))})})}),(0,t.jsx)(m.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(x.Z,{title:L?"":"Setting allowed pass through routes by key is a premium feature",placement:"top",children:(0,t.jsx)(Y.Z,{onChange:e=>D.setFieldValue("allowed_passthrough_routes",e),value:D.getFieldValue("allowed_passthrough_routes"),accessToken:k||"",placeholder:L?Array.isArray(null===(_=b.metadata)||void 0===_?void 0:_.allowed_passthrough_routes)&&b.metadata.allowed_passthrough_routes.length>0?"Current: ".concat(b.metadata.allowed_passthrough_routes.join(", ")):"Select or enter allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes by key",disabled:!L})})}),(0,t.jsx)(m.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,t.jsx)(er.Z,{onChange:e=>D.setFieldValue("vector_stores",e),value:D.getFieldValue("vector_stores"),accessToken:k||"",placeholder:"Select vector stores"})}),(0,t.jsx)(m.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(X.Z,{onChange:e=>D.setFieldValue("mcp_servers_and_groups",e),value:D.getFieldValue("mcp_servers_and_groups"),accessToken:k||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(m.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(J.default,{type:"hidden"})}),(0,t.jsx)(m.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.mcp_servers_and_groups!==s.mcp_servers_and_groups||e.mcp_tool_permissions!==s.mcp_tool_permissions,children:()=>{var e;return(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(ee.Z,{accessToken:k||"",selectedServers:(null===(e=D.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:D.getFieldValue("mcp_tool_permissions")||{},onChange:e=>D.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,t.jsx)(m.Z.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,t.jsx)(es.Z,{onChange:e=>D.setFieldValue("agents_and_groups",e),value:D.getFieldValue("agents_and_groups"),accessToken:k||"",placeholder:"Select agents or access groups (optional)"})}),(0,t.jsx)(m.Z.Item,{label:"Team ID",name:"team_id",children:(0,t.jsx)(W.default,{placeholder:"Select team",style:{width:"100%"},children:null==N?void 0:N.map(e=>(0,t.jsx)(W.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,t.jsx)(m.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(el.Z,{value:D.getFieldValue("logging_settings"),onChange:e=>D.setFieldValue("logging_settings",e),disabledCallbacks:ec,onDisabledCallbacksChange:e=>{em((0,j.PA)(e)),D.setFieldValue("disabled_callbacks",e)}})}),(0,t.jsx)(m.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(J.default.TextArea,{rows:10})}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(Q.Z,{form:D,autoRotationEnabled:eu,onAutoRotationChange:ex,rotationInterval:eg,onRotationIntervalChange:eh}),(0,t.jsx)(m.Z.Item,{name:"duration",hidden:!0,initialValue:"",children:(0,t.jsx)(J.default,{})})]}),(0,t.jsx)(m.Z.Item,{name:"token",hidden:!0,children:(0,t.jsx)(J.default,{})}),(0,t.jsx)(m.Z.Item,{name:"allowed_routes",hidden:!0,children:(0,t.jsx)(J.default,{})}),(0,t.jsx)(m.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,t.jsx)(J.default,{})}),(0,t.jsx)(m.Z.Item,{name:"auto_rotate",hidden:!0,children:(0,t.jsx)(J.default,{})}),(0,t.jsx)(m.Z.Item,{name:"rotation_interval",hidden:!0,children:(0,t.jsx)(J.default,{})}),(0,t.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,t.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,t.jsx)(q.z,{variant:"secondary",onClick:y,disabled:ep,children:"Cancel"}),(0,t.jsx)(q.z,{type:"submit",loading:ep,children:"Save Changes"})]})})]})}function eo(e){var s,a,_,b,N,k,D,M;let{onClose:T,keyData:E,teams:R,onKeyDataUpdate:F,onDelete:V,backButtonText:O="Back to Keys"}=e,{accessToken:z,userId:K,userRole:B,premiumUser:q}=(0,L.Z)(),{teams:W}=(0,l.Z)(),[J,$]=(0,p.useState)(!1),[Q]=m.Z.useForm(),[Y,H]=(0,p.useState)(!1),[X,ee]=(0,p.useState)(!1),[es,ea]=(0,p.useState)(""),[et,el]=(0,p.useState)(!1),[er,ei]=(0,p.useState)({}),[en,eo]=(0,p.useState)(E),[ec,em]=(0,p.useState)(null),[eu,ex]=(0,p.useState)(!1);if((0,p.useEffect)(()=>{E&&eo(E)},[E]),(0,p.useEffect)(()=>{if(eu){let e=setTimeout(()=>{ex(!1)},5e3);return()=>clearTimeout(e)}},[eu]),!en)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(c.zx,{icon:n.Z,variant:"light",onClick:T,className:"mb-4",children:O}),(0,t.jsx)(c.xv,{children:"Key not found"})]});let eg=async e=>{try{var s,a,t,l;if(!z)return;let r=e.token;if(e.key=r,q||(delete e.guardrails,delete e.prompts),e.max_budget=(0,i.C)(e.max_budget),void 0!==e.vector_stores&&(e.object_permission={...en.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:a}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...en.object_permission,mcp_servers:s||[],mcp_access_groups:a||[]},delete e.mcp_servers_and_groups}if(void 0!==e.mcp_tool_permissions){let s=e.mcp_tool_permissions||{};Object.keys(s).length>0&&(e.object_permission={...e.object_permission,mcp_tool_permissions:s}),delete e.mcp_tool_permissions}if(void 0!==e.agents_and_groups){let{agents:s,accessGroups:a}=e.agents_and_groups||{agents:[],accessGroups:[]};e.object_permission={...e.object_permission,agents:s||[],agent_access_groups:a||[]},delete e.agents_and_groups}if(e.max_budget=(0,i.C)(e.max_budget),e.tpm_limit=(0,i.C)(e.tpm_limit),e.rpm_limit=(0,i.C)(e.rpm_limit),e.max_parallel_requests=(0,i.C)(e.max_parallel_requests),e.metadata&&"string"==typeof e.metadata)try{let t=JSON.parse(e.metadata);"tags"in t&&delete t.tags,e.metadata={...t,...Array.isArray(e.tags)&&e.tags.length>0?{tags:e.tags}:{},...(null===(s=e.guardrails)||void 0===s?void 0:s.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(a=e.disabled_callbacks)||void 0===a?void 0:a.length)>0?{litellm_disabled_callbacks:(0,j.Z3)(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),A.Z.error("Invalid metadata JSON");return}else{let{tags:s,...a}=e.metadata||{};e.metadata={...a,...Array.isArray(e.tags)&&e.tags.length>0?{tags:e.tags}:{},...(null===(t=e.guardrails)||void 0===t?void 0:t.length)>0?{guardrails:e.guardrails}:{},...e.logging_settings?{logging:e.logging_settings}:{},...(null===(l=e.disabled_callbacks)||void 0===l?void 0:l.length)>0?{litellm_disabled_callbacks:(0,j.Z3)(e.disabled_callbacks)}:{}}}"tags"in e&&delete e.tags,delete e.logging_settings,e.budget_duration&&(e.budget_duration=({daily:"24h",weekly:"7d",monthly:"30d"})[e.budget_duration]);let n=await (0,I.keyUpdateCall)(z,e);eo(e=>e?{...e,...n}:void 0),F&&F(n),A.Z.success("Key updated successfully"),$(!1)}catch(e){A.Z.fromBackend((0,G.O)(e)),console.error("Error updating key:",e)}},eh=async()=>{try{if(ee(!0),!z)return;await (0,I.keyDeleteCall)(z,en.token||en.token_id),A.Z.success("Key deleted successfully"),V&&V(),T()}catch(e){console.error("Error deleting the key:",e),A.Z.fromBackend(e)}finally{ee(!1),H(!1),ea("")}},ep=async(e,s)=>{await (0,r.vQ)(e)&&(ei(e=>({...e,[s]:!0})),setTimeout(()=>{ei(e=>({...e,[s]:!1}))},2e3))},ev=e=>{let s=new Date(e),a=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),t=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(a," at ").concat(t)};console.log("userRole",B);let ej=(0,v.P4)(B||"")||W&&(0,v._p)(null==W?void 0:W.filter(e=>e.team_id===en.team_id)[0],K||"")||K===en.user_id&&"Internal Viewer"!==B;return(0,t.jsxs)("div",{className:"w-full h-screen p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.zx,{icon:n.Z,variant:"light",onClick:T,className:"mb-4",children:O}),(0,t.jsx)(c.Dx,{children:en.key_alias||"Virtual Key"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,t.jsx)(c.xv,{className:"text-gray-500 font-mono text-sm",children:en.token_id||en.token})]}),(0,t.jsx)(u.ZP,{type:"text",size:"small",icon:er["key-id"]?(0,t.jsx)(g.Z,{size:12}):(0,t.jsx)(h.Z,{size:12}),onClick:()=>ep(en.token_id||en.token,"key-id"),className:"ml-2 transition-all duration-200".concat(er["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsx)(c.xv,{className:"text-sm text-gray-500",children:en.updated_at&&en.updated_at!==en.created_at?"Updated: ".concat(ev(en.updated_at)):"Created: ".concat(ev(en.created_at))}),eu&&(0,t.jsx)(c.Ct,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),ec&&(0,t.jsx)(c.Ct,{color:"blue",size:"xs",children:"Regenerated"})]})]}),ej&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(x.Z,{title:q?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,t.jsx)("span",{className:"inline-block",children:(0,t.jsx)(c.zx,{icon:d.Z,variant:"secondary",onClick:()=>el(!0),className:"flex items-center",disabled:!q,children:"Regenerate Key"})})}),(0,t.jsx)(c.zx,{icon:o.Z,variant:"secondary",onClick:()=>H(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-700",children:"Delete Key"})]})]}),(0,t.jsx)(U,{selectedToken:en,visible:et,onClose:()=>el(!1),onKeyUpdate:e=>{eo(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),em(new Date),ex(!0),F&&F({...e,created_at:new Date().toLocaleString()})}}),(0,t.jsx)(f.Z,{isOpen:Y,title:"Delete Key",alertMessage:"This action is irreversible and will immediately revoke access for any applications using this key.",message:"Are you sure you want to delete this Virtual Key?",resourceInformationTitle:"Key Information",resourceInformation:[{label:"Key Alias",value:(null==en?void 0:en.key_alias)||"-"},{label:"Key ID",value:(null==en?void 0:en.token_id)||(null==en?void 0:en.token)||"-",code:!0},{label:"Team ID",value:(null==en?void 0:en.team_id)||"-",code:!0},{label:"Spend",value:(null==en?void 0:en.spend)?"$".concat((0,r.pw)(en.spend,4)):"$0.0000"}],onCancel:()=>{H(!1),ea("")},onOk:eh,confirmLoading:X,requiredConfirmation:null==en?void 0:en.key_alias}),(0,t.jsxs)(c.v0,{children:[(0,t.jsxs)(c.td,{className:"mb-4",children:[(0,t.jsx)(c.OK,{children:"Overview"}),(0,t.jsx)(c.OK,{children:"Settings"})]}),(0,t.jsxs)(c.nP,{children:[(0,t.jsx)(c.x4,{children:(0,t.jsxs)(c.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(c.Zb,{children:[(0,t.jsx)(c.xv,{children:"Spend"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(c.Dx,{children:["$",(0,r.pw)(en.spend,4)]}),(0,t.jsxs)(c.xv,{children:["of"," ",null!==en.max_budget?"$".concat((0,r.pw)(en.max_budget)):"Unlimited"]})]})]}),(0,t.jsxs)(c.Zb,{children:[(0,t.jsx)(c.xv,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(c.xv,{children:["TPM: ",null!==en.tpm_limit?en.tpm_limit:"Unlimited"]}),(0,t.jsxs)(c.xv,{children:["RPM: ",null!==en.rpm_limit?en.rpm_limit:"Unlimited"]})]})]}),(0,t.jsxs)(c.Zb,{children:[(0,t.jsx)(c.xv,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:en.models&&en.models.length>0?en.models.map((e,s)=>(0,t.jsx)(c.Ct,{color:"red",children:e},s)):(0,t.jsx)(c.xv,{children:"No models specified"})})]}),(0,t.jsx)(c.Zb,{children:(0,t.jsx)(P.Z,{objectPermission:en.object_permission,variant:"inline",accessToken:z})}),(0,t.jsx)(C.Z,{loggingConfigs:w(en.metadata),disabledCallbacks:Array.isArray(null===(s=en.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,j.PA)(en.metadata.litellm_disabled_callbacks):[],variant:"card"}),(0,t.jsx)(y,{autoRotate:en.auto_rotate,rotationInterval:en.rotation_interval,lastRotationAt:en.last_rotation_at,keyRotationAt:en.key_rotation_at,nextRotationAt:en.next_rotation_at,variant:"card"})]})}),(0,t.jsx)(c.x4,{children:(0,t.jsxs)(c.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(c.Dx,{children:"Key Settings"}),!J&&B&&v.LQ.includes(B)&&(0,t.jsx)(c.zx,{onClick:()=>$(!0),children:"Edit Settings"})]}),J?(0,t.jsx)(ed,{keyData:en,onCancel:()=>$(!1),onSubmit:eg,teams:R,accessToken:z,userID:K,userRole:B,premiumUser:q}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Key ID"}),(0,t.jsx)(c.xv,{className:"font-mono",children:en.token_id||en.token})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Key Alias"}),(0,t.jsx)(c.xv,{children:en.key_alias||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Secret Key"}),(0,t.jsx)(c.xv,{className:"font-mono",children:en.key_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Team ID"}),(0,t.jsx)(c.xv,{children:en.team_id||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Organization"}),(0,t.jsx)(c.xv,{children:en.organization_id||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Created"}),(0,t.jsx)(c.xv,{children:ev(en.created_at)})]}),ec&&(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Last Regenerated"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.xv,{children:ev(ec)}),(0,t.jsx)(c.Ct,{color:"green",size:"xs",children:"Recent"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Expires"}),(0,t.jsx)(c.xv,{children:en.expires?ev(en.expires):"Never"})]}),(0,t.jsx)(y,{autoRotate:en.auto_rotate,rotationInterval:en.rotation_interval,lastRotationAt:en.last_rotation_at,keyRotationAt:en.key_rotation_at,nextRotationAt:en.next_rotation_at,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Spend"}),(0,t.jsxs)(c.xv,{children:["$",(0,r.pw)(en.spend,4)," USD"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Budget"}),(0,t.jsx)(c.xv,{children:null!==en.max_budget?"$".concat((0,r.pw)(en.max_budget,2)):"Unlimited"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Tags"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:Array.isArray(null===(a=en.metadata)||void 0===a?void 0:a.tags)&&en.metadata.tags.length>0?en.metadata.tags.map((e,s)=>(0,t.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No tags specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Prompts"}),(0,t.jsx)(c.xv,{children:Array.isArray(null===(_=en.metadata)||void 0===_?void 0:_.prompts)&&en.metadata.prompts.length>0?en.metadata.prompts.map((e,s)=>(0,t.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No prompts specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Allowed Pass Through Routes"}),(0,t.jsx)(c.xv,{children:Array.isArray(null===(b=en.metadata)||void 0===b?void 0:b.allowed_passthrough_routes)&&en.metadata.allowed_passthrough_routes.length>0?en.metadata.allowed_passthrough_routes.map((e,s)=>(0,t.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No pass through routes specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,t.jsx)(c.xv,{children:(null===(N=en.metadata)||void 0===N?void 0:N.disable_global_guardrails)===!0?(0,t.jsx)(c.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,t.jsx)(c.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:en.models&&en.models.length>0?en.models.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,t.jsx)(c.xv,{children:"No models specified"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)(c.xv,{children:["TPM: ",null!==en.tpm_limit?en.tpm_limit:"Unlimited"]}),(0,t.jsxs)(c.xv,{children:["RPM: ",null!==en.rpm_limit?en.rpm_limit:"Unlimited"]}),(0,t.jsxs)(c.xv,{children:["Max Parallel Requests:"," ",null!==en.max_parallel_requests?en.max_parallel_requests:"Unlimited"]}),(0,t.jsxs)(c.xv,{children:["Model TPM Limits:"," ",(null===(k=en.metadata)||void 0===k?void 0:k.model_tpm_limit)?JSON.stringify(en.metadata.model_tpm_limit):"Unlimited"]}),(0,t.jsxs)(c.xv,{children:["Model RPM Limits:"," ",(null===(D=en.metadata)||void 0===D?void 0:D.model_rpm_limit)?JSON.stringify(en.metadata.model_rpm_limit):"Unlimited"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.xv,{className:"font-medium",children:"Metadata"}),(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:Z(S(en.metadata))})]}),(0,t.jsx)(P.Z,{objectPermission:en.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:z}),(0,t.jsx)(C.Z,{loggingConfigs:w(en.metadata),disabledCallbacks:Array.isArray(null===(M=en.metadata)||void 0===M?void 0:M.litellm_disabled_callbacks)?(0,j.PA)(en.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}},33304:function(e,s,a){a.d(s,{C:function(){return t}});function t(e){return""===e?null:e}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6653-f5732600f703fa47.js b/litellm/proxy/_experimental/out/_next/static/chunks/6653-f5732600f703fa47.js deleted file mode 100644 index 315758eedf8..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6653-f5732600f703fa47.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6653],{88913:function(e,s,l){l.d(s,{Dx:function(){return d.Z},Zb:function(){return a.Z},iz:function(){return r.Z},oi:function(){return n.Z},xv:function(){return i.Z},zx:function(){return t.Z}});var t=l(78489),a=l(12514),r=l(67982),i=l(84264),n=l(49566),d=l(96761)},86653:function(e,s,l){l.d(s,{Z:function(){return eS}});var t=l(57437),a=l(58643),r=l(2265),i=l(16312),n=l(57840),d=l(42264),o=l(22116),c=l(61994),u=l(56609),m=l(23496),x=l(5945),h=l(58760),g=l(37592),v=l(19015),j=l(19250),p=l(10032),f=l(99981),y=l(24199),b=l(57365),_=l(49566),N=l(16853),S=l(46468),w=l(20347),Z=l(15424),k=l(65925);function C(e){let{userData:s,onCancel:l,onSubmit:a,teams:n,accessToken:d,userID:o,userRole:c,userModels:u,possibleUIRoles:m,isBulkEdit:x=!1}=e,[h]=p.Z.useForm();return r.useEffect(()=>{var e,l,t,a,r,i,n;h.setFieldsValue({user_id:s.user_id,user_email:null===(e=s.user_info)||void 0===e?void 0:e.user_email,user_alias:null===(l=s.user_info)||void 0===l?void 0:l.user_alias,user_role:null===(t=s.user_info)||void 0===t?void 0:t.user_role,models:(null===(a=s.user_info)||void 0===a?void 0:a.models)||[],max_budget:null===(r=s.user_info)||void 0===r?void 0:r.max_budget,budget_duration:null===(i=s.user_info)||void 0===i?void 0:i.budget_duration,metadata:(null===(n=s.user_info)||void 0===n?void 0:n.metadata)?JSON.stringify(s.user_info.metadata,null,2):void 0})},[s,h]),(0,t.jsxs)(p.Z,{form:h,onFinish:e=>{if(e.metadata&&"string"==typeof e.metadata)try{e.metadata=JSON.parse(e.metadata)}catch(e){console.error("Error parsing metadata JSON:",e);return}a(e)},layout:"vertical",children:[!x&&(0,t.jsx)(p.Z.Item,{label:"User ID",name:"user_id",children:(0,t.jsx)(_.Z,{disabled:!0})}),!x&&(0,t.jsx)(p.Z.Item,{label:"Email",name:"user_email",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"User Alias",name:"user_alias",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:(0,t.jsxs)("span",{children:["Global Proxy Role"," ",(0,t.jsx)(f.Z,{title:"This is the role that the user will globally on the proxy. This role is independent of any team/org specific roles.",children:(0,t.jsx)(Z.Z,{})})]}),name:"user_role",children:(0,t.jsx)(g.default,{children:m&&Object.entries(m).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(b.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(p.Z.Item,{label:(0,t.jsxs)("span",{children:["Personal Models"," ",(0,t.jsx)(f.Z,{title:"Select which models this user can access outside of team-scope. Choose 'All Proxy Models' to grant access to all models available on the proxy.",children:(0,t.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,t.jsxs)(g.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:!w.ZL.includes(c||""),children:[(0,t.jsx)(g.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(g.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),u.map(e=>(0,t.jsx)(g.default.Option,{value:e,children:(0,S.W0)(e)},e))]})}),(0,t.jsx)(p.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(y.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(p.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(k.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(N.Z,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,t.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,t.jsx)(i.z,{variant:"secondary",type:"button",onClick:l,children:"Cancel"}),(0,t.jsx)(i.z,{type:"submit",children:"Save Changes"})]})]})}var U=l(9114);let{Text:I,Title:D}=n.default;var z=e=>{let{visible:s,onCancel:l,selectedUsers:a,possibleUIRoles:i,accessToken:n,onSuccess:p,teams:f,userRole:y,userModels:b,allowAllUsers:_=!1}=e,[N,S]=(0,r.useState)(!1),[w,Z]=(0,r.useState)([]),[k,z]=(0,r.useState)(null),[A,B]=(0,r.useState)(!1),[L,E]=(0,r.useState)(!1),T=()=>{Z([]),z(null),B(!1),E(!1),l()},O=r.useMemo(()=>({user_id:"bulk_edit",user_info:{user_email:"",user_role:"",teams:[],models:[],max_budget:null,spend:0,metadata:{},created_at:null,updated_at:null},keys:[],teams:f||[]}),[f,s]),F=async e=>{if(console.log("formValues",e),!n){U.Z.fromBackend("Access token not found");return}S(!0);try{let s=a.map(e=>e.user_id),t={};e.user_role&&""!==e.user_role&&(t.user_role=e.user_role),null!==e.max_budget&&void 0!==e.max_budget&&(t.max_budget=e.max_budget),e.models&&e.models.length>0&&(t.models=e.models),e.budget_duration&&""!==e.budget_duration&&(t.budget_duration=e.budget_duration),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata=e.metadata);let r=Object.keys(t).length>0,i=A&&w.length>0;if(!r&&!i){U.Z.fromBackend("Please modify at least one field or select teams to add users to");return}let o=[];if(r){if(L){let e=await (0,j.userBulkUpdateUserCall)(n,t,void 0,!0);o.push("Updated all users (".concat(e.total_requested," total)"))}else await (0,j.userBulkUpdateUserCall)(n,t,s),o.push("Updated ".concat(s.length," user(s)"))}if(i){let e=[];for(let s of w)try{let l=null;L?l=null:a.map(e=>({user_id:e.user_id,role:"user",user_email:e.user_email||null}));let t=await (0,j.teamBulkMemberAddCall)(n,s,l||null,k||void 0,L);console.log("result",t),e.push({teamId:s,success:!0,successfulAdditions:t.successful_additions,failedAdditions:t.failed_additions})}catch(l){console.error("Failed to add users to team ".concat(s,":"),l),e.push({teamId:s,success:!1,error:l})}let s=e.filter(e=>e.success),l=e.filter(e=>!e.success);if(s.length>0){let e=s.reduce((e,s)=>e+s.successfulAdditions,0);o.push("Added users to ".concat(s.length," team(s) (").concat(e," total additions)"))}l.length>0&&d.ZP.warning("Failed to add users to ".concat(l.length," team(s)"))}o.length>0&&U.Z.success(o.join(". ")),Z([]),z(null),B(!1),E(!1),p(),l()}catch(e){console.error("Bulk operation failed:",e),U.Z.fromBackend("Failed to perform bulk operations")}finally{S(!1)}};return(0,t.jsxs)(o.Z,{visible:s,onCancel:T,footer:null,title:L?"Bulk Edit All Users":"Bulk Edit ".concat(a.length," User(s)"),width:800,children:[_&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(c.Z,{checked:L,onChange:e=>E(e.target.checked),children:(0,t.jsx)(I,{strong:!0,children:"Update ALL users in the system"})}),L&&(0,t.jsx)("div",{style:{marginTop:8},children:(0,t.jsx)(I,{type:"warning",style:{fontSize:"12px"},children:"⚠️ This will apply changes to ALL users in the system, not just the selected ones."})})]}),!L&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsxs)(D,{level:5,children:["Selected Users (",a.length,"):"]}),(0,t.jsx)(u.Z,{size:"small",bordered:!0,dataSource:a,pagination:!1,scroll:{y:200},rowKey:"user_id",columns:[{title:"User ID",dataIndex:"user_id",key:"user_id",width:"30%",render:e=>(0,t.jsx)(I,{strong:!0,style:{fontSize:"12px"},children:e.length>20?"".concat(e.slice(0,20),"..."):e})},{title:"Email",dataIndex:"user_email",key:"user_email",width:"25%",render:e=>(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:e||"No email"})},{title:"Current Role",dataIndex:"user_role",key:"user_role",width:"25%",render:e=>{var s;return(0,t.jsx)(I,{style:{fontSize:"12px"},children:(null==i?void 0:null===(s=i[e])||void 0===s?void 0:s.ui_label)||e})}},{title:"Budget",dataIndex:"max_budget",key:"max_budget",width:"20%",render:e=>(0,t.jsx)(I,{style:{fontSize:"12px"},children:null!==e?"$".concat(e):"Unlimited"})}]})]}),(0,t.jsx)(m.Z,{}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsxs)(I,{children:[(0,t.jsx)("strong",{children:"Instructions:"})," Fill in the fields below with the values you want to apply to all selected users. You can bulk edit: role, budget, models, and metadata. You can also add users to teams."]})}),(0,t.jsx)(x.Z,{title:"Team Management",size:"small",className:"mb-4",style:{backgroundColor:"#fafafa"},children:(0,t.jsxs)(h.Z,{direction:"vertical",style:{width:"100%"},children:[(0,t.jsx)(c.Z,{checked:A,onChange:e=>B(e.target.checked),children:"Add selected users to teams"}),A&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(I,{strong:!0,children:"Select Teams:"}),(0,t.jsx)(g.default,{mode:"multiple",placeholder:"Select teams to add users to",value:w,onChange:Z,style:{width:"100%",marginTop:8},options:(null==f?void 0:f.map(e=>({label:e.team_alias||e.team_id,value:e.team_id})))||[]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(I,{strong:!0,children:"Team Budget (Optional):"}),(0,t.jsx)(v.Z,{placeholder:"Max budget per user in team",value:k,onChange:e=>z(e),style:{width:"100%",marginTop:8},min:0,step:.01,precision:2}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:"Leave empty for unlimited budget within team limits"})]}),(0,t.jsx)(I,{type:"secondary",style:{fontSize:"12px"},children:'Users will be added with "user" role by default. All users will be added to each selected team.'})]})]})}),(0,t.jsx)(C,{userData:O,onCancel:T,onSubmit:F,teams:f,accessToken:n,userID:"bulk_edit",userRole:y,userModels:b,possibleUIRoles:i,isBulkEdit:!0}),N&&(0,t.jsx)("div",{style:{textAlign:"center",marginTop:"10px"},children:(0,t.jsxs)(I,{children:["Updating ",L?"all users":a.length," user(s)..."]})})]})},A=l(7765),B=l(5545),L=e=>{let{visible:s,possibleUIRoles:l,onCancel:a,user:i,onSubmit:n}=e,[d,c]=(0,r.useState)(i),[u]=p.Z.useForm();(0,r.useEffect)(()=>{u.resetFields()},[i]);let m=async()=>{u.resetFields(),a()},x=async e=>{n(e),u.resetFields(),a()};return i?(0,t.jsx)(o.Z,{visible:s,onCancel:m,footer:null,title:"Edit User "+i.user_id,width:1e3,children:(0,t.jsx)(p.Z,{form:u,onFinish:x,initialValues:i,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p.Z.Item,{className:"mt-8",label:"User Email",tooltip:"Email of the User",name:"user_email",children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"user_id",name:"user_id",hidden:!0,children:(0,t.jsx)(_.Z,{})}),(0,t.jsx)(p.Z.Item,{label:"User Role",name:"user_role",children:(0,t.jsx)(g.default,{children:l&&Object.entries(l).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(b.Z,{value:s,title:l,children:(0,t.jsxs)("div",{className:"flex",children:[l," ",(0,t.jsx)("p",{className:"ml-2",style:{color:"gray",fontSize:"12px"},children:a})]})},s)})})}),(0,t.jsx)(p.Z.Item,{label:"Spend (USD)",name:"spend",tooltip:"(float) - Spend of all LLM calls completed by this user",help:"Across all keys (including keys with team_id).",children:(0,t.jsx)(v.Z,{min:0,step:.01})}),(0,t.jsx)(p.Z.Item,{label:"User Budget (USD)",name:"max_budget",tooltip:"(float) - Maximum budget of this user",help:"Maximum budget of this user.",children:(0,t.jsx)(y.Z,{min:0,step:.01})}),(0,t.jsx)(p.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsx)(k.Z,{})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(B.ZP,{htmlType:"submit",children:"Save"})}),(0,t.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,t.jsx)(B.ZP,{htmlType:"submit",children:"Save"})})]})})}):null},E=l(98187),T=l(59872),O=l(19616),F=l(29827),M=l(11713),R=l(21609),P=l(88913),K=l(63709),V=l(10353),q=l(26349),G=l(96473),J=e=>{var s;let{accessToken:l,possibleUIRoles:a,userID:i,userRole:d}=e,[o,c]=(0,r.useState)(!0),[u,m]=(0,r.useState)(null),[x,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)({}),[y,b]=(0,r.useState)(!1),[_,N]=(0,r.useState)([]),{Paragraph:w}=n.default,{Option:Z}=g.default;(0,r.useEffect)(()=>{(async()=>{if(!l){c(!1);return}try{let e=await (0,j.getInternalUserSettings)(l);if(m(e),f(e.values||{}),l)try{let e=await (0,j.modelAvailableCall)(l,i,d);if(e&&e.data){let s=e.data.map(e=>e.id);N(s)}}catch(e){console.error("Error fetching available models:",e)}}catch(e){console.error("Error fetching SSO settings:",e),U.Z.fromBackend("Failed to fetch SSO settings")}finally{c(!1)}})()},[l]);let C=async()=>{if(l){b(!0);try{let e=Object.entries(p).reduce((e,s)=>{let[l,t]=s;return e[l]=""===t?null:t,e},{}),s=await (0,j.updateInternalUserSettings)(l,e);m({...u,values:s.settings}),h(!1)}catch(e){console.error("Error updating SSO settings:",e),U.Z.fromBackend("Failed to update settings: "+e)}finally{b(!1)}}},I=(e,s)=>{f(l=>({...l,[e]:s}))},D=e=>e&&Array.isArray(e)?e.map(e=>"string"==typeof e?{team_id:e,user_role:"user"}:"object"==typeof e&&e.team_id?{team_id:e.team_id,max_budget_in_team:e.max_budget_in_team,user_role:e.user_role||"user"}:{team_id:"",user_role:"user"}):[],z=e=>{let s=D(e),l=(e,l,t)=>{let a=[...s];a[e]={...a[e],[l]:t},I("teams",a)},a=e=>{I("teams",s.filter((s,l)=>l!==e))};return(0,t.jsxs)("div",{className:"space-y-3",children:[s.map((e,s)=>(0,t.jsxs)("div",{className:"border rounded-lg p-4 bg-gray-50",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)(P.xv,{className:"font-medium",children:["Team ",s+1]}),(0,t.jsx)(P.zx,{size:"sm",variant:"secondary",icon:q.Z,onClick:()=>a(s),className:"text-red-500 hover:text-red-700",children:"Remove"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"Team ID"}),(0,t.jsx)(P.oi,{value:e.team_id,onChange:e=>l(s,"team_id",e.target.value),placeholder:"Enter team ID"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"Max Budget in Team"}),(0,t.jsx)(v.Z,{style:{width:"100%"},value:e.max_budget_in_team,onChange:e=>l(s,"max_budget_in_team",e),placeholder:"Optional",min:0,step:.01,precision:2})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(P.xv,{className:"text-sm font-medium mb-1",children:"User Role"}),(0,t.jsxs)(g.default,{style:{width:"100%"},value:e.user_role,onChange:e=>l(s,"user_role",e),children:[(0,t.jsx)(Z,{value:"user",children:"User"}),(0,t.jsx)(Z,{value:"admin",children:"Admin"})]})]})]})]},s)),(0,t.jsx)(P.zx,{variant:"secondary",icon:G.Z,onClick:()=>{I("teams",[...s,{team_id:"",user_role:"user"}])},className:"w-full",children:"Add Team"})]})},A=(e,s,l)=>{var r;let i=s.type;if("teams"===e)return(0,t.jsx)("div",{className:"mt-2",children:z(p[e]||[])});if("user_role"===e&&a)return(0,t.jsx)(g.default,{style:{width:"100%"},value:p[e]||"",onChange:s=>I(e,s),className:"mt-2",children:Object.entries(a).filter(e=>{let[s]=e;return s.includes("internal_user")}).map(e=>{let[s,{ui_label:l,description:a}]=e;return(0,t.jsx)(Z,{value:s,children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("span",{children:l}),(0,t.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:a})]})},s)})});if("budget_duration"===e)return(0,t.jsx)(k.Z,{value:p[e]||null,onChange:s=>I(e,s),className:"mt-2"});if("boolean"===i)return(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(K.Z,{checked:!!p[e],onChange:s=>I(e,s)})});if("array"===i&&(null===(r=s.items)||void 0===r?void 0:r.enum))return(0,t.jsx)(g.default,{mode:"multiple",style:{width:"100%"},value:p[e]||[],onChange:s=>I(e,s),className:"mt-2",children:s.items.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});if("models"===e)return(0,t.jsxs)(g.default,{mode:"multiple",style:{width:"100%"},value:p[e]||[],onChange:s=>I(e,s),className:"mt-2",children:[(0,t.jsx)(Z,{value:"no-default-models",children:"No Default Models"},"no-default-models"),(0,t.jsx)(Z,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),_.map(e=>(0,t.jsx)(Z,{value:e,children:(0,S.W0)(e)},e))]});if("string"===i&&s.enum)return(0,t.jsx)(g.default,{style:{width:"100%"},value:p[e]||"",onChange:s=>I(e,s),className:"mt-2",children:s.enum.map(e=>(0,t.jsx)(Z,{value:e,children:e},e))});else return(0,t.jsx)(P.oi,{value:void 0!==p[e]?String(p[e]):"",onChange:s=>I(e,s.target.value),placeholder:s.description||"",className:"mt-2"})},B=(e,s)=>{if(null==s)return(0,t.jsx)("span",{className:"text-gray-400",children:"Not set"});if("teams"===e&&Array.isArray(s)){if(0===s.length)return(0,t.jsx)("span",{className:"text-gray-400",children:"No teams assigned"});let e=D(s);return(0,t.jsx)("div",{className:"space-y-2 mt-1",children:e.map((e,s)=>(0,t.jsx)("div",{className:"border rounded-lg p-3 bg-white",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Team ID:"}),(0,t.jsx)("p",{className:"text-gray-900",children:e.team_id||"Not specified"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Max Budget:"}),(0,t.jsx)("p",{className:"text-gray-900",children:void 0!==e.max_budget_in_team?"$".concat((0,T.pw)(e.max_budget_in_team,4)):"No limit"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium text-gray-600",children:"Role:"}),(0,t.jsx)("p",{className:"text-gray-900 capitalize",children:e.user_role})]})]})},s))})}if("user_role"===e&&a&&a[s]){let{ui_label:e,description:l}=a[s];return(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"font-medium",children:e}),l&&(0,t.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:l})]})}return"budget_duration"===e?(0,t.jsx)("span",{children:(0,k.m)(s)}):"boolean"==typeof s?(0,t.jsx)("span",{children:s?"Enabled":"Disabled"}):"models"===e&&Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:(0,S.W0)(e)},s))}):"object"==typeof s?Array.isArray(s)?0===s.length?(0,t.jsx)("span",{className:"text-gray-400",children:"None"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:s.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:"object"==typeof e?JSON.stringify(e):String(e)},s))}):(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify(s,null,2)}):(0,t.jsx)("span",{children:String(s)})};return o?(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(V.Z,{size:"large"})}):u?(0,t.jsxs)(P.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(P.Dx,{children:"Default User Settings"}),!o&&u&&(x?(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(P.zx,{variant:"secondary",onClick:()=>{h(!1),f(u.values||{})},disabled:y,children:"Cancel"}),(0,t.jsx)(P.zx,{onClick:C,loading:y,children:"Save Changes"})]}):(0,t.jsx)(P.zx,{onClick:()=>h(!0),children:"Edit Settings"}))]}),(null==u?void 0:null===(s=u.field_schema)||void 0===s?void 0:s.description)&&(0,t.jsx)(w,{className:"mb-4",children:u.field_schema.description}),(0,t.jsx)(P.iz,{}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:(()=>{let{values:e,field_schema:s}=u;return s&&s.properties?Object.entries(s.properties).map(s=>{let[l,a]=s,r=e[l],i=l.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return(0,t.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200 last:border-0",children:[(0,t.jsx)(P.xv,{className:"font-medium text-lg",children:i}),(0,t.jsx)(w,{className:"text-sm text-gray-500 mt-1",children:a.description||"No description available"}),x?(0,t.jsx)("div",{className:"mt-2",children:A(l,a,r)}):(0,t.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:B(l,r)})]},l)}):(0,t.jsx)(P.xv,{children:"No schema information available"})})()})]}):(0,t.jsx)(P.Zb,{children:(0,t.jsx)(P.xv,{children:"No settings available or you do not have permission to view them."})})},W=l(41649),Q=l(67101),$=l(47323),H=l(15731),Y=l(53410),X=l(74998),ee=l(23628);let es=(e,s,l,a,r,i)=>{let n=[{header:"User ID",accessorKey:"user_id",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)(f.Z,{title:s.original.user_id,children:(0,t.jsx)("span",{className:"text-xs",children:s.original.user_id?"".concat(s.original.user_id.slice(0,7),"..."):"-"})})}},{header:"Email",accessorKey:"user_email",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_email||"-"})}},{header:"Global Proxy Role",accessorKey:"user_role",enableSorting:!0,cell:s=>{var l;let{row:a}=s;return(0,t.jsx)("span",{className:"text-xs",children:(null==e?void 0:null===(l=e[a.original.user_role])||void 0===l?void 0:l.ui_label)||"-"})}},{header:"User Alias",accessorKey:"user_alias",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.user_alias||"-"})}},{header:"Spend (USD)",accessorKey:"spend",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.spend?(0,T.pw)(s.original.spend,4):"-"})}},{header:"Budget (USD)",accessorKey:"max_budget",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.max_budget?s.original.max_budget:"Unlimited"})}},{header:()=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"SSO ID"}),(0,t.jsx)(f.Z,{title:"SSO ID is the ID of the user in the SSO provider. If the user is not using SSO, this will be null.",children:(0,t.jsx)(H.Z,{className:"w-4 h-4"})})]}),accessorKey:"sso_user_id",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:null!==s.original.sso_user_id?s.original.sso_user_id:"-"})}},{header:"Virtual Keys",accessorKey:"key_count",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)(Q.Z,{numItems:2,children:s.original.key_count>0?(0,t.jsxs)(W.Z,{size:"xs",color:"indigo",children:[s.original.key_count," ",1===s.original.key_count?"Key":"Keys"]}):(0,t.jsx)(W.Z,{size:"xs",color:"gray",children:"No Keys"})})}},{header:"Created At",accessorKey:"created_at",enableSorting:!0,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.created_at?new Date(s.original.created_at).toLocaleDateString():"-"})}},{header:"Updated At",accessorKey:"updated_at",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsx)("span",{className:"text-xs",children:s.original.updated_at?new Date(s.original.updated_at).toLocaleDateString():"-"})}},{id:"actions",header:"Actions",enableSorting:!1,cell:e=>{let{row:s}=e;return(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(f.Z,{title:"Edit user details",children:(0,t.jsx)($.Z,{icon:Y.Z,size:"sm",onClick:()=>r(s.original.user_id,!0),className:"cursor-pointer hover:text-blue-600"})}),(0,t.jsx)(f.Z,{title:"Delete user",children:(0,t.jsx)($.Z,{icon:X.Z,size:"sm",onClick:()=>l(s.original),className:"cursor-pointer hover:text-red-600"})}),(0,t.jsx)(f.Z,{title:"Reset Password",children:(0,t.jsx)($.Z,{icon:ee.Z,size:"sm",onClick:()=>a(s.original.user_id),className:"cursor-pointer hover:text-green-600"})})]})}}];if(i){let{onSelectUser:e,onSelectAll:s,isUserSelected:l,isAllSelected:a,isIndeterminate:r}=i;return[{id:"select",enableSorting:!1,header:()=>(0,t.jsx)(c.Z,{indeterminate:r,checked:a,onChange:e=>s(e.target.checked),onClick:e=>e.stopPropagation()}),cell:s=>{let{row:a}=s;return(0,t.jsx)(c.Z,{checked:l(a.original),onChange:s=>e(a.original,s.target.checked),onClick:e=>e.stopPropagation()})}},...n]}return n};var el=l(71594),et=l(24525),ea=l(27281),er=l(21626),ei=l(97214),en=l(28241),ed=l(58834),eo=l(69552),ec=l(71876),eu=l(44633),em=l(86462),ex=l(49084),eh=l(50337),eg=l(84717),ev=l(10900),ej=l(30401),ep=l(78867);function ef(e){var s,l,a,i,n,d,o,c,u,m,x,h,g,v,p,f,y,b,_,N,S,Z,I,D,z,A,L,O,F,M,P,K,V,q,G,J,W,Q,$,H,Y,es,el,et,ea;let{userId:er,onClose:ei,accessToken:en,userRole:ed,onDelete:eo,possibleUIRoles:ec,initialTab:eu=0,startInEditMode:em=!1}=e,[ex,eh]=(0,r.useState)(null),[ef,ey]=(0,r.useState)(!1),[eb,e_]=(0,r.useState)(!1),[eN,eS]=(0,r.useState)(!0),[ew,eZ]=(0,r.useState)(em),[ek,eC]=(0,r.useState)([]),[eU,eI]=(0,r.useState)(!1),[eD,ez]=(0,r.useState)(null),[eA,eB]=(0,r.useState)(null),[eL,eE]=(0,r.useState)(eu),[eT,eO]=(0,r.useState)({}),[eF,eM]=(0,r.useState)(!1);r.useEffect(()=>{eB((0,j.getProxyBaseUrl)())},[]),r.useEffect(()=>{console.log("userId: ".concat(er,", userRole: ").concat(ed,", accessToken: ").concat(en)),(async()=>{try{if(!en)return;let e=await (0,j.userInfoCall)(en,er,ed||"",!1,null,null,!0);eh(e);let s=(await (0,j.modelAvailableCall)(en,er,ed||"")).data.map(e=>e.id);eC(s)}catch(e){console.error("Error fetching user data:",e),U.Z.fromBackend("Failed to fetch user data")}finally{eS(!1)}})()},[en,er,ed]);let eR=async()=>{if(!en){U.Z.fromBackend("Access token not found");return}try{U.Z.success("Generating password reset link...");let e=await (0,j.invitationCreateCall)(en,er);ez(e),eI(!0)}catch(e){U.Z.fromBackend("Failed to generate password reset link")}},eP=async()=>{try{if(!en)return;e_(!0),await (0,j.userDeleteCall)(en,[er]),U.Z.success("User deleted successfully"),eo&&eo(),ei()}catch(e){console.error("Error deleting user:",e),U.Z.fromBackend("Failed to delete user")}finally{ey(!1),e_(!1)}},eK=async e=>{try{if(!en||!ex)return;await (0,j.userUpdateUserCall)(en,e,null),eh({...ex,user_info:{...ex.user_info,user_email:e.user_email,user_alias:e.user_alias,models:e.models,max_budget:e.max_budget,budget_duration:e.budget_duration,metadata:e.metadata}}),U.Z.success("User updated successfully"),eZ(!1)}catch(e){console.error("Error updating user:",e),U.Z.fromBackend("Failed to update user")}};if(eN)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.xv,{children:"Loading user data..."})]});if(!ex)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.xv,{children:"User not found"})]});let eV=async(e,s)=>{await (0,T.vQ)(e)&&(eO(e=>({...e,[s]:!0})),setTimeout(()=>{eO(e=>({...e,[s]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.zx,{icon:ev.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Users"}),(0,t.jsx)(eg.Dx,{children:(null===(s=ex.user_info)||void 0===s?void 0:s.user_email)||"User"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eg.xv,{className:"text-gray-500 font-mono",children:ex.user_id}),(0,t.jsx)(B.ZP,{type:"text",size:"small",icon:eT["user-id"]?(0,t.jsx)(ej.Z,{size:12}):(0,t.jsx)(ep.Z,{size:12}),onClick:()=>eV(ex.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eT["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),ed&&w.LQ.includes(ed)&&(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(eg.zx,{icon:ee.Z,variant:"secondary",onClick:eR,className:"flex items-center",children:"Reset Password"}),(0,t.jsx)(eg.zx,{icon:X.Z,variant:"secondary",onClick:()=>ey(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-600 hover:border-red-600",children:"Delete User"})]})]}),(0,t.jsx)(R.Z,{isOpen:ef,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:null===(l=ex.user_info)||void 0===l?void 0:l.user_email},{label:"User ID",value:ex.user_id,code:!0},{label:"Global Proxy Role",value:(null===(a=ex.user_info)||void 0===a?void 0:a.user_role)&&(null==ec?void 0:null===(i=ec[ex.user_info.user_role])||void 0===i?void 0:i.ui_label)||(null===(n=ex.user_info)||void 0===n?void 0:n.user_role)||"-"},{label:"Total Spend (USD)",value:(null===(d=ex.user_info)||void 0===d?void 0:d.spend)!==null&&(null===(o=ex.user_info)||void 0===o?void 0:o.spend)!==void 0?ex.user_info.spend.toFixed(2):void 0}],onCancel:()=>{ey(!1)},onOk:eP,confirmLoading:eb}),(0,t.jsxs)(eg.v0,{defaultIndex:eL,onIndexChange:eE,children:[(0,t.jsxs)(eg.td,{className:"mb-4",children:[(0,t.jsx)(eg.OK,{children:"Overview"}),(0,t.jsx)(eg.OK,{children:"Details"})]}),(0,t.jsxs)(eg.nP,{children:[(0,t.jsx)(eg.x4,{children:(0,t.jsxs)(eg.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Spend"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(eg.Dx,{children:["$",(0,T.pw)((null===(c=ex.user_info)||void 0===c?void 0:c.spend)||0,4)]}),(0,t.jsxs)(eg.xv,{children:["of"," ",(null===(u=ex.user_info)||void 0===u?void 0:u.max_budget)!==null?"$".concat((0,T.pw)(ex.user_info.max_budget,4)):"Unlimited"]})]})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Teams"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(m=ex.teams)||void 0===m?void 0:m.length)&&(null===(x=ex.teams)||void 0===x?void 0:x.length)>0?(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[null===(h=ex.teams)||void 0===h?void 0:h.slice(0,eF?ex.teams.length:20).map((e,s)=>(0,t.jsx)(eg.Ct,{color:"blue",title:e.team_alias,children:e.team_alias},s)),!eF&&(null===(g=ex.teams)||void 0===g?void 0:g.length)>20&&(0,t.jsxs)(eg.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!0),children:["+",ex.teams.length-20," more"]}),eF&&(null===(v=ex.teams)||void 0===v?void 0:v.length)>20&&(0,t.jsx)(eg.Ct,{color:"gray",className:"cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!1),children:"Show Less"})]}):(0,t.jsx)(eg.xv,{children:"No teams"})})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Virtual Keys"}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsxs)(eg.xv,{children:[(null===(p=ex.keys)||void 0===p?void 0:p.length)||0," ",(null===(f=ex.keys)||void 0===f?void 0:f.length)===1?"Key":"Keys"]})})]}),(0,t.jsxs)(eg.Zb,{children:[(0,t.jsx)(eg.xv,{children:"Personal Models"}),(0,t.jsx)("div",{className:"mt-2",children:(null===(b=ex.user_info)||void 0===b?void 0:null===(y=b.models)||void 0===y?void 0:y.length)&&(null===(N=ex.user_info)||void 0===N?void 0:null===(_=N.models)||void 0===_?void 0:_.length)>0?null===(Z=ex.user_info)||void 0===Z?void 0:null===(S=Z.models)||void 0===S?void 0:S.map((e,s)=>(0,t.jsx)(eg.xv,{children:e},s)):(0,t.jsx)(eg.xv,{children:"All proxy models"})})]})]})}),(0,t.jsx)(eg.x4,{children:(0,t.jsxs)(eg.Zb,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,t.jsx)(eg.Dx,{children:"User Settings"}),!ew&&ed&&w.LQ.includes(ed)&&(0,t.jsx)(eg.zx,{onClick:()=>eZ(!0),children:"Edit Settings"})]}),ew&&ex?(0,t.jsx)(C,{userData:ex,onCancel:()=>eZ(!1),onSubmit:eK,teams:ex.teams,accessToken:en,userID:er,userRole:ed,userModels:ek,possibleUIRoles:ec}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"User ID"}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(eg.xv,{className:"font-mono",children:ex.user_id}),(0,t.jsx)(B.ZP,{type:"text",size:"small",icon:eT["user-id"]?(0,t.jsx)(ej.Z,{size:12}):(0,t.jsx)(ep.Z,{size:12}),onClick:()=>eV(ex.user_id,"user-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eT["user-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Email"}),(0,t.jsx)(eg.xv,{children:(null===(I=ex.user_info)||void 0===I?void 0:I.user_email)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"User Alias"}),(0,t.jsx)(eg.xv,{children:(null===(D=ex.user_info)||void 0===D?void 0:D.user_alias)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Global Proxy Role"}),(0,t.jsx)(eg.xv,{children:(null===(z=ex.user_info)||void 0===z?void 0:z.user_role)||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Created"}),(0,t.jsx)(eg.xv,{children:(null===(A=ex.user_info)||void 0===A?void 0:A.created_at)?new Date(ex.user_info.created_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Last Updated"}),(0,t.jsx)(eg.xv,{children:(null===(L=ex.user_info)||void 0===L?void 0:L.updated_at)?new Date(ex.user_info.updated_at).toLocaleString():"Unknown"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Teams"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(O=ex.teams)||void 0===O?void 0:O.length)&&(null===(F=ex.teams)||void 0===F?void 0:F.length)>0?(0,t.jsxs)(t.Fragment,{children:[null===(M=ex.teams)||void 0===M?void 0:M.slice(0,eF?ex.teams.length:20).map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",title:e.team_alias||e.team_id,children:e.team_alias||e.team_id},s)),!eF&&(null===(P=ex.teams)||void 0===P?void 0:P.length)>20&&(0,t.jsxs)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!0),children:["+",ex.teams.length-20," more"]}),eF&&(null===(K=ex.teams)||void 0===K?void 0:K.length)>20&&(0,t.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded text-xs cursor-pointer hover:bg-gray-200 transition-colors",onClick:()=>eM(!1),children:"Show Less"})]}):(0,t.jsx)(eg.xv,{children:"No teams"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Personal Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===(q=ex.user_info)||void 0===q?void 0:null===(V=q.models)||void 0===V?void 0:V.length)&&(null===(J=ex.user_info)||void 0===J?void 0:null===(G=J.models)||void 0===G?void 0:G.length)>0?null===(Q=ex.user_info)||void 0===Q?void 0:null===(W=Q.models)||void 0===W?void 0:W.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,t.jsx)(eg.xv,{children:"All proxy models"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Virtual Keys"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:(null===($=ex.keys)||void 0===$?void 0:$.length)&&(null===(H=ex.keys)||void 0===H?void 0:H.length)>0?ex.keys.map((e,s)=>(0,t.jsx)("span",{className:"px-2 py-1 bg-green-100 rounded text-xs",children:e.key_alias||e.token},s)):(0,t.jsx)(eg.xv,{children:"No Virtual Keys"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Max Budget"}),(0,t.jsx)(eg.xv,{children:(null===(Y=ex.user_info)||void 0===Y?void 0:Y.max_budget)!==null&&(null===(es=ex.user_info)||void 0===es?void 0:es.max_budget)!==void 0?"$".concat((0,T.pw)(ex.user_info.max_budget,4)):"Unlimited"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Budget Reset"}),(0,t.jsx)(eg.xv,{children:(0,k.m)(null!==(ea=null===(el=ex.user_info)||void 0===el?void 0:el.budget_duration)&&void 0!==ea?ea:null)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(eg.xv,{className:"font-medium",children:"Metadata"}),(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:JSON.stringify((null===(et=ex.user_info)||void 0===et?void 0:et.metadata)||{},null,2)})]})]})]})})]})]}),(0,t.jsx)(E.Z,{isInvitationLinkModalVisible:eU,setIsInvitationLinkModalVisible:eI,baseUrl:eA||"",invitationLinkData:eD,modalType:"resetPassword"})]})}function ey(e){let{data:s=[],columns:l,isLoading:a=!1,onSortChange:i,currentSort:n,accessToken:d,userRole:o,possibleUIRoles:c,handleEdit:u,handleDelete:m,handleResetPassword:x,selectedUsers:h=[],onSelectionChange:g,enableSelection:v=!1,filters:j,updateFilters:p,initialFilters:f,teams:y,userListResponse:_,currentPage:N,handlePageChange:S}=e,[w,Z]=r.useState([{id:(null==n?void 0:n.sortBy)||"created_at",desc:(null==n?void 0:n.sortOrder)==="desc"}]),[k,C]=r.useState(null),[U,I]=r.useState(!1),[D,z]=r.useState(!1),A=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];C(e),I(s)},B=(e,s)=>{g&&(s?g([...h,e]):g(h.filter(s=>s.user_id!==e.user_id)))},L=e=>{g&&(e?g(s):g([]))},E=e=>h.some(s=>s.user_id===e.user_id),T=s.length>0&&h.length===s.length,O=h.length>0&&h.lengthc?es(c,u,m,x,A,v?{selectedUsers:h,onSelectUser:B,onSelectAll:L,isUserSelected:E,isAllSelected:T,isIndeterminate:O}:void 0):l,[c,u,m,x,A,l,v,h,T,O]),M=(0,el.b7)({data:s,columns:F,state:{sorting:w},onSortingChange:e=>{let s="function"==typeof e?e(w):e;if(Z(s),s&&Array.isArray(s)&&s.length>0&&s[0]){let e=s[0];if(e.id){let s=e.id,l=e.desc?"desc":"asc";null==i||i(s,l)}}else null==i||i("created_at","desc")},getCoreRowModel:(0,et.sC)(),manualSorting:!0,enableSorting:!0});return(r.useEffect(()=>{n&&Z([{id:n.sortBy,desc:"desc"===n.sortOrder}])},[n]),k)?(0,t.jsx)(ef,{userId:k,onClose:()=>{C(null),I(!1)},accessToken:d,userRole:o,possibleUIRoles:c,initialTab:U?1:0,startInEditMode:U}):(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow",children:[(0,t.jsx)("div",{className:"border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Search by email...",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:j.email,onChange:e=>p({email:e.target.value})}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2 ".concat(D?"bg-gray-100":""),onClick:()=>z(!D),children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),"Filters",(j.user_id||j.user_role||j.team)&&(0,t.jsx)("span",{className:"w-2 h-2 rounded-full bg-blue-500"})]}),(0,t.jsxs)("button",{className:"px-3 py-2 text-sm border rounded-md hover:bg-gray-50 flex items-center gap-2",onClick:()=>{p(f)},children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Reset Filters"]})]}),D&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mt-3",children:[(0,t.jsxs)("div",{className:"relative w-64",children:[(0,t.jsx)("input",{type:"text",placeholder:"Filter by User ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:j.user_id,onChange:e=>p({user_id:e.target.value})}),(0,t.jsx)("svg",{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(ea.Z,{value:j.user_role,onValueChange:e=>p({user_role:e}),placeholder:"Select Role",children:c&&Object.entries(c).map(e=>{let[s,l]=e;return(0,t.jsx)(b.Z,{value:s,children:l.ui_label},s)})})}),(0,t.jsx)("div",{className:"w-64",children:(0,t.jsx)(ea.Z,{value:j.team,onValueChange:e=>p({team:e}),placeholder:"Select Team",children:null==y?void 0:y.map(e=>(0,t.jsx)(b.Z,{value:e.team_id,children:e.team_alias||e.team_id},e.team_id))})}),(0,t.jsx)("div",{className:"relative w-64",children:(0,t.jsx)("input",{type:"text",placeholder:"Filter by SSO ID",className:"w-full px-3 py-2 pl-8 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",value:j.sso_user_id,onChange:e=>p({sso_user_id:e.target.value})})})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[a?(0,t.jsx)(eh.Z.Input,{active:!0,style:{width:192,height:20}}):(0,t.jsxs)("span",{className:"text-sm text-gray-700",children:["Showing"," ",_&&_.users&&_.users.length>0?(_.page-1)*_.page_size+1:0," ","-"," ",_&&_.users?Math.min(_.page*_.page_size,_.total):0," ","of ",_?_.total:0," results"]}),(0,t.jsx)("div",{className:"flex space-x-2",children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eh.Z.Button,{active:!0,size:"small",style:{width:80,height:30}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"small",style:{width:60,height:30}})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{onClick:()=>S(N-1),disabled:1===N,className:"px-3 py-1 text-sm border rounded-md ".concat(1===N?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,t.jsx)("button",{onClick:()=>S(N+1),disabled:!_||N>=_.total_pages,className:"px-3 py-1 text-sm border rounded-md ".concat(!_||N>=_.total_pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})})]})]})}),(0,t.jsx)("div",{className:"overflow-auto",children:(0,t.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(er.Z,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,t.jsx)(ed.Z,{children:M.getHeaderGroups().map(e=>(0,t.jsx)(ec.Z,{children:e.headers.map(e=>(0,t.jsx)(eo.Z,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""," ").concat(e.column.getCanSort()?"cursor-pointer hover:bg-gray-50":""),onClick:e.column.getToggleSortingHandler(),children:(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,el.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,t.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,t.jsx)(eu.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,t.jsx)(em.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,t.jsx)(ex.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,t.jsx)(ei.Z,{children:a?(0,t.jsx)(ec.Z,{children:(0,t.jsx)(en.Z,{colSpan:F.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"\uD83D\uDE85 Loading users..."})})})}):s.length>0?M.getRowModel().rows.map(e=>(0,t.jsx)(ec.Z,{className:"h-8",children:e.getVisibleCells().map(e=>(0,t.jsx)(en.Z,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:()=>{"user_id"===e.column.id&&A(e.getValue(),!1)},style:{cursor:"user_id"===e.column.id?"pointer":"default",color:"user_id"===e.column.id?"#3b82f6":"inherit"},children:(0,el.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,t.jsx)(ec.Z,{children:(0,t.jsx)(en.Z,{colSpan:F.length,className:"h-8 text-center",children:(0,t.jsx)("div",{className:"text-center text-gray-500",children:(0,t.jsx)("p",{children:"No users found"})})})})})]})})})})]})}let{Text:eb,Title:e_}=n.default,eN={email:"",user_id:"",user_role:"",sso_user_id:"",team:"",model:"",min_spend:null,max_spend:null,sort_by:"created_at",sort_order:"desc"};var eS=e=>{var s,l,n;let{accessToken:d,token:o,userRole:c,userID:u,teams:m}=e,x=(0,F.NL)(),[h,g]=(0,r.useState)(1),[v,p]=(0,r.useState)(!1),[f,y]=(0,r.useState)(null),[b,_]=(0,r.useState)(!1),[N,S]=(0,r.useState)(!1),[Z,k]=(0,r.useState)(null),[C,I]=(0,r.useState)("users"),[D,B]=(0,r.useState)(eN),[P,K,V]=(0,O.G)(D,{wait:300}),[q,G]=(0,r.useState)(!1),[W,Q]=(0,r.useState)(null),[$,H]=(0,r.useState)(null),[Y,X]=(0,r.useState)([]),[ee,el]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),[er,ei]=(0,r.useState)([]),en=e=>{k(e),_(!0)};(0,r.useEffect)(()=>()=>{V.cancel()},[V]),(0,r.useEffect)(()=>{H((0,j.getProxyBaseUrl)())},[]),(0,r.useEffect)(()=>{(async()=>{try{if(!u||!c||!d)return;let e=(await (0,j.modelAvailableCall)(d,u,c)).data.map(e=>e.id);console.log("available_model_names:",e),ei(e)}catch(e){console.error("Error fetching user models:",e)}})()},[d,u,c]);let ed=e=>{B(s=>{let l={...s,...e};return K(l),l})},eo=async e=>{if(!d){U.Z.fromBackend("Access token not found");return}try{U.Z.success("Generating password reset link...");let s=await (0,j.invitationCreateCall)(d,e);Q(s),G(!0)}catch(e){U.Z.fromBackend("Failed to generate password reset link")}},ec=async()=>{if(Z&&d)try{S(!0),await (0,j.userDeleteCall)(d,[Z.user_id]),x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let s=e.users.filter(e=>e.user_id!==Z.user_id);return{...e,users:s}}),U.Z.success("User deleted successfully")}catch(e){console.error("Error deleting user:",e),U.Z.fromBackend("Failed to delete user")}finally{_(!1),k(null),S(!1)}},eu=async()=>{y(null),p(!1)},em=async e=>{if(console.log("inside handleEditSubmit:",e),d&&o&&c&&u){try{let s=await (0,j.userUpdateUserCall)(d,e,null);x.setQueriesData({queryKey:["userList"]},e=>{if(void 0===e)return e;let l=e.users.map(e=>e.user_id===s.data.user_id?(0,T.nl)(e,s.data):e);return{...e,users:l}}),U.Z.success("User ".concat(e.user_id," updated successfully"))}catch(e){console.error("There was an error updating the user",e)}y(null),p(!1)}},ex=async e=>{g(e)},eg=(0,M.a)({queryKey:["userList",{debouncedFilter:P,currentPage:h}],queryFn:async()=>{if(!d)throw Error("Access token required");return await (0,j.userListCall)(d,P.user_id?[P.user_id]:null,h,25,P.email||null,P.user_role||null,P.team||null,P.sso_user_id||null,P.sort_by,P.sort_order)},enabled:!!(d&&o&&c&&u),placeholderData:e=>e}),ev=eg.data,ej=(0,M.a)({queryKey:["userRoles"],initialData:()=>({}),queryFn:async()=>{if(!d)throw Error("Access token required");return await (0,j.getPossibleUserRoles)(d)},enabled:!!(d&&o&&c&&u)}).data,ep=es(ej,e=>{y(e),p(!0)},en,eo,()=>{});return(0,t.jsxs)("div",{className:"w-full p-8 overflow-hidden",children:[(0,t.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,t.jsx)("div",{className:"flex space-x-3",children:eg.isLoading?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:145,height:36}}),(0,t.jsx)(eh.Z.Button,{active:!0,size:"default",shape:"default",style:{width:110,height:36}})]}):u&&d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.Z,{userID:u,accessToken:d,teams:m,possibleUIRoles:ej}),(0,t.jsx)(i.z,{onClick:()=>{ea(!et),X([])},variant:et?"primary":"secondary",className:"flex items-center",children:et?"Cancel Selection":"Select Users"}),et&&(0,t.jsxs)(i.z,{onClick:()=>{if(0===Y.length){U.Z.fromBackend("Please select users to edit");return}el(!0)},disabled:0===Y.length,className:"flex items-center",children:["Bulk Edit (",Y.length," selected)"]})]}):null})}),(0,t.jsxs)(a.v0,{defaultIndex:0,onIndexChange:e=>I(0===e?"users":"settings"),children:[(0,t.jsxs)(a.td,{className:"mb-4",children:[(0,t.jsx)(a.OK,{children:"Users"}),(0,t.jsx)(a.OK,{children:"Default User Settings"})]}),(0,t.jsxs)(a.nP,{children:[(0,t.jsx)(a.x4,{children:(0,t.jsx)(ey,{data:(null===(s=eg.data)||void 0===s?void 0:s.users)||[],columns:ep,isLoading:eg.isLoading,accessToken:d,userRole:c,onSortChange:(e,s)=>{ed({sort_by:e,sort_order:s})},currentSort:{sortBy:D.sort_by,sortOrder:D.sort_order},possibleUIRoles:ej,handleEdit:e=>{y(e),p(!0)},handleDelete:en,handleResetPassword:eo,enableSelection:et,selectedUsers:Y,onSelectionChange:e=>{X(e)},filters:D,updateFilters:ed,initialFilters:eN,teams:m,userListResponse:ev,currentPage:h,handlePageChange:ex})}),(0,t.jsx)(a.x4,{children:u&&c&&d?(0,t.jsx)(J,{accessToken:d,possibleUIRoles:ej,userID:u,userRole:c}):(0,t.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,t.jsx)(eh.Z,{active:!0,paragraph:{rows:4}})})})]})]}),(0,t.jsx)(L,{visible:v,possibleUIRoles:ej,onCancel:eu,user:f,onSubmit:em}),(0,t.jsx)(R.Z,{isOpen:b,title:"Delete User?",message:"Are you sure you want to delete this user? This action cannot be undone.",resourceInformationTitle:"User Information",resourceInformation:[{label:"Email",value:null==Z?void 0:Z.user_email},{label:"User ID",value:null==Z?void 0:Z.user_id,code:!0},{label:"Global Proxy Role",value:Z&&(null==ej?void 0:null===(l=ej[Z.user_role])||void 0===l?void 0:l.ui_label)||(null==Z?void 0:Z.user_role)||"-"},{label:"Total Spend (USD)",value:null==Z?void 0:null===(n=Z.spend)||void 0===n?void 0:n.toFixed(2)}],onCancel:()=>{_(!1),k(null)},onOk:ec,confirmLoading:N}),(0,t.jsx)(E.Z,{isInvitationLinkModalVisible:q,setIsInvitationLinkModalVisible:G,baseUrl:$||"",invitationLinkData:W,modalType:"resetPassword"}),(0,t.jsx)(z,{visible:ee,onCancel:()=>el(!1),selectedUsers:Y,possibleUIRoles:ej,accessToken:d,onSuccess:()=>{x.invalidateQueries({queryKey:["userList"]}),X([]),ea(!1)},teams:m,userRole:c,userModels:er,allowAllUsers:!!c&&(0,w.tY)(c)})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/6685-13e80be9679226cf.js b/litellm/proxy/_experimental/out/_next/static/chunks/6685-13e80be9679226cf.js deleted file mode 100644 index cba09ef5f31..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/6685-13e80be9679226cf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6685],{37527:function(t,e,o){o.d(e,{Z:function(){return i}});var n=o(1119),a=o(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 00-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]},name:"bank",theme:"outlined"},c=o(55015),i=a.forwardRef(function(t,e){return a.createElement(c.Z,(0,n.Z)({},t,{ref:e,icon:r}))})},9775:function(t,e,o){o.d(e,{Z:function(){return i}});var n=o(1119),a=o(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"},c=o(55015),i=a.forwardRef(function(t,e){return a.createElement(c.Z,(0,n.Z)({},t,{ref:e,icon:r}))})},49634:function(t,e,o){o.d(e,{Z:function(){return i}});var n=o(1119),a=o(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},c=o(55015),i=a.forwardRef(function(t,e){return a.createElement(c.Z,(0,n.Z)({},t,{ref:e,icon:r}))})},64739:function(t,e,o){o.d(e,{Z:function(){return i}});var n=o(1119),a=o(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"},c=o(55015),i=a.forwardRef(function(t,e){return a.createElement(c.Z,(0,n.Z)({},t,{ref:e,icon:r}))})},48231:function(t,e,o){o.d(e,{Z:function(){return i}});var n=o(1119),a=o(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"},c=o(55015),i=a.forwardRef(function(t,e){return a.createElement(c.Z,(0,n.Z)({},t,{ref:e,icon:r}))})},40312:function(t,e,o){o.d(e,{Z:function(){return i}});var n=o(1119),a=o(2265),r={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M922.9 701.9H327.4l29.9-60.9 496.8-.9c16.8 0 31.2-12 34.2-28.6l68.8-385.1c1.8-10.1-.9-20.5-7.5-28.4a34.99 34.99 0 00-26.6-12.5l-632-2.1-5.4-25.4c-3.4-16.2-18-28-34.6-28H96.5a35.3 35.3 0 100 70.6h125.9L246 312.8l58.1 281.3-74.8 122.1a34.96 34.96 0 00-3 36.8c6 11.9 18.1 19.4 31.5 19.4h62.8a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7h161.1a102.43 102.43 0 00-20.6 61.7c0 56.6 46 102.6 102.6 102.6s102.6-46 102.6-102.6c0-22.3-7.4-44-20.6-61.7H923c19.4 0 35.3-15.8 35.3-35.3a35.42 35.42 0 00-35.4-35.2zM305.7 253l575.8 1.9-56.4 315.8-452.3.8L305.7 253zm96.9 612.7c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6zm325.1 0c-17.4 0-31.6-14.2-31.6-31.6 0-17.4 14.2-31.6 31.6-31.6s31.6 14.2 31.6 31.6a31.6 31.6 0 01-31.6 31.6z"}}]},name:"shopping-cart",theme:"outlined"},c=o(55015),i=a.forwardRef(function(t,e){return a.createElement(c.Z,(0,n.Z)({},t,{ref:e,icon:r}))})},41361:function(t,e,o){o.d(e,{Z:function(){return i}});var n=o(1119),a=o(2265),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M824.2 699.9a301.55 301.55 0 00-86.4-60.4C783.1 602.8 812 546.8 812 484c0-110.8-92.4-201.7-203.2-200-109.1 1.7-197 90.6-197 200 0 62.8 29 118.8 74.2 155.5a300.95 300.95 0 00-86.4 60.4C345 754.6 314 826.8 312 903.8a8 8 0 008 8.2h56c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5A226.62 226.62 0 01612 684c60.9 0 118.2 23.7 161.3 66.8C814.5 792 838 846.3 840 904.3c.1 4.3 3.7 7.7 8 7.7h56a8 8 0 008-8.2c-2-77-33-149.2-87.8-203.9zM612 612c-34.2 0-66.4-13.3-90.5-37.5a126.86 126.86 0 01-37.5-91.8c.3-32.8 13.4-64.5 36.3-88 24-24.6 56.1-38.3 90.4-38.7 33.9-.3 66.8 12.9 91 36.6 24.8 24.3 38.4 56.8 38.4 91.4 0 34.2-13.3 66.3-37.5 90.5A127.3 127.3 0 01612 612zM361.5 510.4c-.9-8.7-1.4-17.5-1.4-26.4 0-15.9 1.5-31.4 4.3-46.5.7-3.6-1.2-7.3-4.5-8.8-13.6-6.1-26.1-14.5-36.9-25.1a127.54 127.54 0 01-38.7-95.4c.9-32.1 13.8-62.6 36.3-85.6 24.7-25.3 57.9-39.1 93.2-38.7 31.9.3 62.7 12.6 86 34.4 7.9 7.4 14.7 15.6 20.4 24.4 2 3.1 5.9 4.4 9.3 3.2 17.6-6.1 36.2-10.4 55.3-12.4 5.6-.6 8.8-6.6 6.3-11.6-32.5-64.3-98.9-108.7-175.7-109.9-110.9-1.7-203.3 89.2-203.3 199.9 0 62.8 28.9 118.8 74.2 155.5-31.8 14.7-61.1 35-86.5 60.4-54.8 54.7-85.8 126.9-87.8 204a8 8 0 008 8.2h56.1c4.3 0 7.9-3.4 8-7.7 1.9-58 25.4-112.3 66.7-153.5 29.4-29.4 65.4-49.8 104.7-59.7 3.9-1 6.5-4.7 6-8.7z"}}]},name:"team",theme:"outlined"},c=o(55015),i=a.forwardRef(function(t,e){return a.createElement(c.Z,(0,n.Z)({},t,{ref:e,icon:r}))})},59664:function(t,e,o){o.d(e,{Z:function(){return C}});var n=o(5853),a=o(2265),r=o(47625),c=o(93765),i=o(54061),l=o(97059),s=o(62994),d=o(25311),u=(0,c.z)({chartName:"LineChart",GraphicalChild:i.x,axisComponents:[{axisType:"xAxis",AxisComp:l.K},{axisType:"yAxis",AxisComp:s.B}],formatAxisMap:d.t9}),m=o(56940),b=o(26680),f=o(8147),g=o(22190),p=o(81889),h=o(65278),v=o(98593),y=o(92666),k=o(32644),x=o(7084),w=o(26898),E=o(13241),N=o(1153);let C=a.forwardRef((t,e)=>{let{data:o=[],categories:c=[],index:d,colors:C=w.s,valueFormatter:O=N.Cj,startEndOnly:z=!1,showXAxis:j=!0,showYAxis:S=!0,yAxisWidth:T=56,intervalType:M="equidistantPreserveStart",animationDuration:L=900,showAnimation:Z=!1,showTooltip:A=!0,showLegend:B=!0,showGridLines:H=!0,autoMinValue:R=!1,curveType:V="linear",minValue:I,maxValue:D,connectNulls:K=!1,allowDecimals:W=!0,noDataText:q,className:F,onValueChange:P,enableLegendSlider:_=!1,customTooltip:G,rotateLabelX:X,padding:Y=j||S?{left:20,right:20}:{left:0,right:0},tickGap:$=5,xAxisLabel:J,yAxisLabel:Q}=t,U=(0,n._T)(t,["data","categories","index","colors","valueFormatter","startEndOnly","showXAxis","showYAxis","yAxisWidth","intervalType","animationDuration","showAnimation","showTooltip","showLegend","showGridLines","autoMinValue","curveType","minValue","maxValue","connectNulls","allowDecimals","noDataText","className","onValueChange","enableLegendSlider","customTooltip","rotateLabelX","padding","tickGap","xAxisLabel","yAxisLabel"]),[tt,te]=(0,a.useState)(60),[to,tn]=(0,a.useState)(void 0),[ta,tr]=(0,a.useState)(void 0),tc=(0,k.me)(c,C),ti=(0,k.i4)(R,I,D),tl=!!P;function ts(t){tl&&(t===ta&&!to||(0,k.FB)(o,t)&&to&&to.dataKey===t?(tr(void 0),null==P||P(null)):(tr(t),null==P||P({eventType:"category",categoryClicked:t})),tn(void 0))}return a.createElement("div",Object.assign({ref:e,className:(0,E.q)("w-full h-80",F)},U),a.createElement(r.h,{className:"h-full w-full"},(null==o?void 0:o.length)?a.createElement(u,{data:o,onClick:tl&&(ta||to)?()=>{tn(void 0),tr(void 0),null==P||P(null)}:void 0,margin:{bottom:J?30:void 0,left:Q?20:void 0,right:Q?5:void 0,top:5}},H?a.createElement(m.q,{className:(0,E.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(l.K,{padding:Y,hide:!j,dataKey:d,interval:z?"preserveStartEnd":M,tick:{transform:"translate(0, 6)"},ticks:z?[o[0][d],o[o.length-1][d]]:void 0,fill:"",stroke:"",className:(0,E.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickLine:!1,axisLine:!1,minTickGap:$,angle:null==X?void 0:X.angle,dy:null==X?void 0:X.verticalShift,height:null==X?void 0:X.xAxisHeight},J&&a.createElement(b._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},J)),a.createElement(s.B,{width:T,hide:!S,axisLine:!1,tickLine:!1,type:"number",domain:ti,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,E.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:O,allowDecimals:W},Q&&a.createElement(b._,{position:"insideLeft",style:{textAnchor:"middle"},angle:-90,offset:-15,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},Q)),a.createElement(f.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:A?t=>{let{active:e,payload:o,label:n}=t;return G?a.createElement(G,{payload:null==o?void 0:o.map(t=>{var e;return Object.assign(Object.assign({},t),{color:null!==(e=tc.get(t.dataKey))&&void 0!==e?e:x.fr.Gray})}),active:e,label:n}):a.createElement(v.ZP,{active:e,payload:o,label:n,valueFormatter:O,categoryColors:tc})}:a.createElement(a.Fragment,null),position:{y:0}}),B?a.createElement(g.D,{verticalAlign:"top",height:tt,content:t=>{let{payload:e}=t;return(0,h.Z)({payload:e},tc,te,ta,tl?t=>ts(t):void 0,_)}}):null,c.map(t=>{var e;return a.createElement(i.x,{className:(0,E.q)((0,N.bM)(null!==(e=tc.get(t))&&void 0!==e?e:x.fr.Gray,w.K.text).strokeColor),strokeOpacity:to||ta&&ta!==t?.3:1,activeDot:t=>{var e;let{cx:n,cy:r,stroke:c,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,dataKey:d}=t;return a.createElement(p.o,{className:(0,E.q)("stroke-tremor-background dark:stroke-dark-tremor-background",P?"cursor-pointer":"",(0,N.bM)(null!==(e=tc.get(d))&&void 0!==e?e:x.fr.Gray,w.K.text).fillColor),cx:n,cy:r,r:5,fill:"",stroke:c,strokeLinecap:i,strokeLinejoin:l,strokeWidth:s,onClick:(e,n)=>{n.stopPropagation(),tl&&(t.index===(null==to?void 0:to.index)&&t.dataKey===(null==to?void 0:to.dataKey)||(0,k.FB)(o,t.dataKey)&&ta&&ta===t.dataKey?(tr(void 0),tn(void 0),null==P||P(null)):(tr(t.dataKey),tn({index:t.index,dataKey:t.dataKey}),null==P||P(Object.assign({eventType:"dot",categoryClicked:t.dataKey},t.payload))))}})},dot:e=>{var n;let{stroke:r,strokeLinecap:c,strokeLinejoin:i,strokeWidth:l,cx:s,cy:d,dataKey:u,index:m}=e;return(0,k.FB)(o,t)&&!(to||ta&&ta!==t)||(null==to?void 0:to.index)===m&&(null==to?void 0:to.dataKey)===t?a.createElement(p.o,{key:m,cx:s,cy:d,r:5,stroke:r,fill:"",strokeLinecap:c,strokeLinejoin:i,strokeWidth:l,className:(0,E.q)("stroke-tremor-background dark:stroke-dark-tremor-background",P?"cursor-pointer":"",(0,N.bM)(null!==(n=tc.get(u))&&void 0!==n?n:x.fr.Gray,w.K.text).fillColor)}):a.createElement(a.Fragment,{key:m})},key:t,name:t,type:V,dataKey:t,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:Z,animationDuration:L,connectNulls:K})}),P?c.map(t=>a.createElement(i.x,{className:(0,E.q)("cursor-pointer"),strokeOpacity:0,key:t,name:t,type:V,dataKey:t,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:K,onClick:(t,e)=>{e.stopPropagation();let{name:o}=t;ts(o)}})):null):a.createElement(y.Z,{noDataText:q})))});C.displayName="LineChart"},94789:function(t,e,o){o.d(e,{Z:function(){return s}});var n=o(5853),a=o(2265),r=o(26898),c=o(13241),i=o(1153);let l=(0,i.fn)("Callout"),s=a.forwardRef((t,e)=>{let{title:o,icon:s,color:d,className:u,children:m}=t,b=(0,n._T)(t,["title","icon","color","className","children"]);return a.createElement("div",Object.assign({ref:e,className:(0,c.q)(l("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",d?(0,c.q)((0,i.bM)(d,r.K.background).bgColor,(0,i.bM)(d,r.K.darkBorder).borderColor,(0,i.bM)(d,r.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,c.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),u)},b),a.createElement("div",{className:(0,c.q)(l("header"),"flex items-start")},s?a.createElement(s,{className:(0,c.q)(l("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.createElement("h4",{className:(0,c.q)(l("title"),"font-semibold")},o)),a.createElement("p",{className:(0,c.q)(l("body"),"overflow-y-auto",m?"mt-2":"")},m))});s.displayName="Callout"},35829:function(t,e,o){o.d(e,{Z:function(){return l}});var n=o(5853),a=o(26898),r=o(13241),c=o(1153),i=o(2265);let l=i.forwardRef((t,e)=>{let{color:o,children:l,className:s}=t,d=(0,n._T)(t,["color","children","className"]);return i.createElement("p",Object.assign({ref:e,className:(0,r.q)("font-semibold text-tremor-metric",o?(0,c.bM)(o,a.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",s)},d),l)});l.displayName="Metric"},33866:function(t,e,o){o.d(e,{Z:function(){return Z}});var n=o(2265),a=o(36760),r=o.n(a),c=o(66632),i=o(93350),l=o(19722),s=o(71744),d=o(93463),u=o(12918),m=o(18536),b=o(71140),f=o(99320);let g=new d.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),p=new d.E4("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),h=new d.E4("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),v=new d.E4("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),y=new d.E4("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),k=new d.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),x=t=>{let{componentCls:e,iconCls:o,antCls:n,badgeShadowSize:a,textFontSize:r,textFontSizeSM:c,statusSize:i,dotSize:l,textFontWeight:s,indicatorHeight:b,indicatorHeightSM:f,marginXS:x,calc:w}=t,E="".concat(n,"-scroll-number"),N=(0,m.Z)(t,(t,o)=>{let{darkColor:n}=o;return{["&".concat(e," ").concat(e,"-color-").concat(t)]:{background:n,["&:not(".concat(e,"-count)")]:{color:n},"a:hover &":{background:n}}}});return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(t)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(e,"-count")]:{display:"inline-flex",justifyContent:"center",zIndex:t.indicatorZIndex,minWidth:b,height:b,color:t.badgeTextColor,fontWeight:s,fontSize:r,lineHeight:(0,d.bf)(b),whiteSpace:"nowrap",textAlign:"center",background:t.badgeColor,borderRadius:w(b).div(2).equal(),boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(t.badgeShadowColor),transition:"background ".concat(t.motionDurationMid),a:{color:t.badgeTextColor},"a:hover":{color:t.badgeTextColor},"a:hover &":{background:t.badgeColorHover}},["".concat(e,"-count-sm")]:{minWidth:f,height:f,fontSize:c,lineHeight:(0,d.bf)(f),borderRadius:w(f).div(2).equal()},["".concat(e,"-multiple-words")]:{padding:"0 ".concat((0,d.bf)(t.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(e,"-dot")]:{zIndex:t.indicatorZIndex,width:l,minWidth:l,height:l,background:t.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(t.badgeShadowColor)},["".concat(e,"-count, ").concat(e,"-dot, ").concat(E,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(o,"-spin")]:{animationName:k,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},["&".concat(e,"-status")]:{lineHeight:"inherit",verticalAlign:"baseline",["".concat(e,"-status-dot")]:{position:"relative",top:-1,display:"inline-block",width:i,height:i,verticalAlign:"middle",borderRadius:"50%"},["".concat(e,"-status-success")]:{backgroundColor:t.colorSuccess},["".concat(e,"-status-processing")]:{overflow:"visible",color:t.colorInfo,backgroundColor:t.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:a,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:g,animationDuration:t.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},["".concat(e,"-status-default")]:{backgroundColor:t.colorTextPlaceholder},["".concat(e,"-status-error")]:{backgroundColor:t.colorError},["".concat(e,"-status-warning")]:{backgroundColor:t.colorWarning},["".concat(e,"-status-text")]:{marginInlineStart:x,color:t.colorText,fontSize:t.fontSize}}}),N),{["".concat(e,"-zoom-appear, ").concat(e,"-zoom-enter")]:{animationName:p,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},["".concat(e,"-zoom-leave")]:{animationName:h,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack,animationFillMode:"both"},["&".concat(e,"-not-a-wrapper")]:{["".concat(e,"-zoom-appear, ").concat(e,"-zoom-enter")]:{animationName:v,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},["".concat(e,"-zoom-leave")]:{animationName:y,animationDuration:t.motionDurationSlow,animationTimingFunction:t.motionEaseOutBack},["&:not(".concat(e,"-status)")]:{verticalAlign:"middle"},["".concat(E,"-custom-component, ").concat(e,"-count")]:{transform:"none"},["".concat(E,"-custom-component, ").concat(E)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[E]:{overflow:"hidden",transition:"all ".concat(t.motionDurationMid," ").concat(t.motionEaseOutBack),["".concat(E,"-only")]:{position:"relative",display:"inline-block",height:b,transition:"all ".concat(t.motionDurationSlow," ").concat(t.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(E,"-only-unit")]:{height:b,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(E,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(e,"-count, ").concat(e,"-dot, ").concat(E,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},w=t=>{let{fontHeight:e,lineWidth:o,marginXS:n,colorBorderBg:a}=t,r=t.colorTextLightSolid,c=t.colorError,i=t.colorErrorHover;return(0,b.IX)(t,{badgeFontHeight:e,badgeShadowSize:o,badgeTextColor:r,badgeColor:c,badgeColorHover:i,badgeShadowColor:a,badgeProcessingDuration:"1.2s",badgeRibbonOffset:n,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},E=t=>{let{fontSize:e,lineHeight:o,fontSizeSM:n,lineWidth:a}=t;return{indicatorZIndex:"auto",indicatorHeight:Math.round(e*o)-2*a,indicatorHeightSM:e,dotSize:n/2,textFontSize:n,textFontSizeSM:n,textFontWeight:"normal",statusSize:n/2}};var N=(0,f.I$)("Badge",t=>x(w(t)),E);let C=t=>{let{antCls:e,badgeFontHeight:o,marginXS:n,badgeRibbonOffset:a,calc:r}=t,c="".concat(e,"-ribbon"),i=(0,m.Z)(t,(t,e)=>{let{darkColor:o}=e;return{["&".concat(c,"-color-").concat(t)]:{background:o,color:o}}});return{["".concat(e,"-ribbon-wrapper")]:{position:"relative"},[c]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(t)),{position:"absolute",top:n,padding:"0 ".concat((0,d.bf)(t.paddingXS)),color:t.colorPrimary,lineHeight:(0,d.bf)(o),whiteSpace:"nowrap",backgroundColor:t.colorPrimary,borderRadius:t.borderRadiusSM,["".concat(c,"-text")]:{color:t.badgeTextColor},["".concat(c,"-corner")]:{position:"absolute",top:"100%",width:a,height:a,color:"currentcolor",border:"".concat((0,d.bf)(r(a).div(2).equal())," solid"),transform:t.badgeRibbonCornerTransform,transformOrigin:"top",filter:t.badgeRibbonCornerFilter}}),i),{["&".concat(c,"-placement-end")]:{insetInlineEnd:r(a).mul(-1).equal(),borderEndEndRadius:0,["".concat(c,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(c,"-placement-start")]:{insetInlineStart:r(a).mul(-1).equal(),borderEndStartRadius:0,["".concat(c,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var O=(0,f.I$)(["Badge","Ribbon"],t=>C(w(t)),E);let z=t=>{let e;let{prefixCls:o,value:a,current:c,offset:i=0}=t;return i&&(e={position:"absolute",top:"".concat(i,"00%"),left:0}),n.createElement("span",{style:e,className:r()("".concat(o,"-only-unit"),{current:c})},a)};var j=t=>{let e,o;let{prefixCls:a,count:r,value:c}=t,i=Number(c),l=Math.abs(r),[s,d]=n.useState(i),[u,m]=n.useState(l),b=()=>{d(i),m(l)};if(n.useEffect(()=>{let t=setTimeout(b,1e3);return()=>clearTimeout(t)},[i]),s===i||Number.isNaN(i)||Number.isNaN(s))e=[n.createElement(z,Object.assign({},t,{key:i,current:!0}))],o={transition:"none"};else{e=[];let a=i+10,r=[];for(let t=i;t<=a;t+=1)r.push(t);let c=ut%10===s);e=(c<0?r.slice(0,d+1):r.slice(d)).map((e,o)=>n.createElement(z,Object.assign({},t,{key:e,value:e%10,offset:c<0?o-d:o,current:o===d}))),o={transform:"translateY(".concat(-function(t,e,o){let n=t,a=0;for(;(n+10)%10!==e;)n+=o,a+=o;return a}(s,i,c),"00%)")}}return n.createElement("span",{className:"".concat(a,"-only"),style:o,onTransitionEnd:b},e)},S=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(t);ae.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(o[n[a]]=t[n[a]]);return o};let T=n.forwardRef((t,e)=>{let{prefixCls:o,count:a,className:c,motionClassName:i,style:d,title:u,show:m,component:b="sup",children:f}=t,g=S(t,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:p}=n.useContext(s.E_),h=p("scroll-number",o),v=Object.assign(Object.assign({},g),{"data-show":m,style:d,className:r()(h,c,i),title:u}),y=a;if(a&&Number(a)%1==0){let t=String(a).split("");y=n.createElement("bdi",null,t.map((e,o)=>n.createElement(j,{prefixCls:h,count:Number(a),value:e,key:t.length-o})))}return((null==d?void 0:d.borderColor)&&(v.style=Object.assign(Object.assign({},d),{boxShadow:"0 0 0 1px ".concat(d.borderColor," inset")})),f)?(0,l.Tm)(f,t=>({className:r()("".concat(h,"-custom-component"),null==t?void 0:t.className,i)})):n.createElement(b,Object.assign({},v,{ref:e}),y)});var M=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&0>e.indexOf(n)&&(o[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(t);ae.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(o[n[a]]=t[n[a]]);return o};let L=n.forwardRef((t,e)=>{var o,a,d,u,m;let{prefixCls:b,scrollNumberPrefixCls:f,children:g,status:p,text:h,color:v,count:y=null,overflowCount:k=99,dot:x=!1,size:w="default",title:E,offset:C,style:O,className:z,rootClassName:j,classNames:S,styles:L,showZero:Z=!1}=t,A=M(t,["prefixCls","scrollNumberPrefixCls","children","status","text","color","count","overflowCount","dot","size","title","offset","style","className","rootClassName","classNames","styles","showZero"]),{getPrefixCls:B,direction:H,badge:R}=n.useContext(s.E_),V=B("badge",b),[I,D,K]=N(V),W=y>k?"".concat(k,"+"):y,q="0"===W||0===W||"0"===h||0===h,F=null===y||q&&!Z,P=(null!=p||null!=v)&&F,_=null!=p||!q,G=x&&!q,X=G?"":W,Y=(0,n.useMemo)(()=>((null==X||""===X)&&(null==h||""===h)||q&&!Z)&&!G,[X,q,Z,G,h]),$=(0,n.useRef)(y);Y||($.current=y);let J=$.current,Q=(0,n.useRef)(X);Y||(Q.current=X);let U=Q.current,tt=(0,n.useRef)(G);Y||(tt.current=G);let te=(0,n.useMemo)(()=>{if(!C)return Object.assign(Object.assign({},null==R?void 0:R.style),O);let t={marginTop:C[1]};return"rtl"===H?t.left=Number.parseInt(C[0],10):t.right=-Number.parseInt(C[0],10),Object.assign(Object.assign(Object.assign({},t),null==R?void 0:R.style),O)},[H,C,O,null==R?void 0:R.style]),to=null!=E?E:"string"==typeof J||"number"==typeof J?J:void 0,tn=!Y&&(0===h?Z:!!h&&!0!==h),ta=tn?n.createElement("span",{className:"".concat(V,"-status-text")},h):null,tr=J&&"object"==typeof J?(0,l.Tm)(J,t=>({style:Object.assign(Object.assign({},te),t.style)})):void 0,tc=(0,i.o2)(v,!1),ti=r()(null==S?void 0:S.indicator,null===(o=null==R?void 0:R.classNames)||void 0===o?void 0:o.indicator,{["".concat(V,"-status-dot")]:P,["".concat(V,"-status-").concat(p)]:!!p,["".concat(V,"-color-").concat(v)]:tc}),tl={};v&&!tc&&(tl.color=v,tl.background=v);let ts=r()(V,{["".concat(V,"-status")]:P,["".concat(V,"-not-a-wrapper")]:!g,["".concat(V,"-rtl")]:"rtl"===H},z,j,null==R?void 0:R.className,null===(a=null==R?void 0:R.classNames)||void 0===a?void 0:a.root,null==S?void 0:S.root,D,K);if(!g&&P&&(h||_||!F)){let t=te.color;return I(n.createElement("span",Object.assign({},A,{className:ts,style:Object.assign(Object.assign(Object.assign({},null==L?void 0:L.root),null===(d=null==R?void 0:R.styles)||void 0===d?void 0:d.root),te)}),n.createElement("span",{className:ti,style:Object.assign(Object.assign(Object.assign({},null==L?void 0:L.indicator),null===(u=null==R?void 0:R.styles)||void 0===u?void 0:u.indicator),tl)}),tn&&n.createElement("span",{style:{color:t},className:"".concat(V,"-status-text")},h)))}return I(n.createElement("span",Object.assign({ref:e},A,{className:ts,style:Object.assign(Object.assign({},null===(m=null==R?void 0:R.styles)||void 0===m?void 0:m.root),null==L?void 0:L.root)}),g,n.createElement(c.ZP,{visible:!Y,motionName:"".concat(V,"-zoom"),motionAppear:!1,motionDeadline:1e3},t=>{var e,o;let{className:a}=t,c=B("scroll-number",f),i=tt.current,l=r()(null==S?void 0:S.indicator,null===(e=null==R?void 0:R.classNames)||void 0===e?void 0:e.indicator,{["".concat(V,"-dot")]:i,["".concat(V,"-count")]:!i,["".concat(V,"-count-sm")]:"small"===w,["".concat(V,"-multiple-words")]:!i&&U&&U.toString().length>1,["".concat(V,"-status-").concat(p)]:!!p,["".concat(V,"-color-").concat(v)]:tc}),s=Object.assign(Object.assign(Object.assign({},null==L?void 0:L.indicator),null===(o=null==R?void 0:R.styles)||void 0===o?void 0:o.indicator),te);return v&&!tc&&((s=s||{}).background=v),n.createElement(T,{prefixCls:c,show:!Y,motionClassName:a,className:l,count:U,title:to,style:s,key:"scrollNumber"},tr)}),ta))});L.Ribbon=t=>{let{className:e,prefixCls:o,style:a,color:c,children:l,text:d,placement:u="end",rootClassName:m}=t,{getPrefixCls:b,direction:f}=n.useContext(s.E_),g=b("ribbon",o),p="".concat(g,"-wrapper"),[h,v,y]=O(g,p),k=(0,i.o2)(c,!1),x=r()(g,"".concat(g,"-placement-").concat(u),{["".concat(g,"-rtl")]:"rtl"===f,["".concat(g,"-color-").concat(c)]:k},e),w={},E={};return c&&!k&&(w.background=c,E.color=c),h(n.createElement("div",{className:r()(p,m,v,y)},l,n.createElement("div",{className:r()(x,v),style:Object.assign(Object.assign({},w),a)},n.createElement("span",{className:"".concat(g,"-text")},d),n.createElement("div",{className:"".concat(g,"-corner"),style:E}))))};var Z=L}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7038-d0da4f296b52ff2c.js b/litellm/proxy/_experimental/out/_next/static/chunks/7038-d0da4f296b52ff2c.js deleted file mode 100644 index a7b068b1e78..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7038-d0da4f296b52ff2c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7038],{83669:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1119),c=n(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:o}))})},5540:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1119),c=n(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:o}))})},41169:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1119),c=n(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 472a40 40 0 1080 0 40 40 0 10-80 0zm367 352.9L696.3 352V178H768v-68H256v68h71.7v174L145 824.9c-2.8 7.4-4.3 15.2-4.3 23.1 0 35.3 28.7 64 64 64h614.6c7.9 0 15.7-1.5 23.1-4.3 33-12.7 49.4-49.8 36.6-82.8zM395.7 364.7V180h232.6v184.7L719.2 600c-20.7-5.3-42.1-8-63.9-8-61.2 0-119.2 21.5-165.3 60a188.78 188.78 0 01-121.3 43.9c-32.7 0-64.1-8.3-91.8-23.7l118.8-307.5zM210.5 844l41.7-107.8c35.7 18.1 75.4 27.8 116.6 27.8 61.2 0 119.2-21.5 165.3-60 33.9-28.2 76.3-43.9 121.3-43.9 35 0 68.4 9.5 97.6 27.1L813.5 844h-603z"}}]},name:"experiment",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:o}))})},38434:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1119),c=n(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:o}))})},10798:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1119),c=n(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:o}))})},8881:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1119),c=n(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372 0-89 31.3-170.8 83.5-234.8l523.3 523.3C682.8 852.7 601 884 512 884zm288.5-137.2L277.2 223.5C341.2 171.3 423 140 512 140c205.4 0 372 166.6 372 372 0 89-31.3 170.8-83.5 234.8z"}}]},name:"stop",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:o}))})},3632:function(e,t,n){n.d(t,{Z:function(){return l}});var a=n(1119),c=n(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},r=n(55015),l=c.forwardRef(function(e,t){return c.createElement(r.Z,(0,a.Z)({},e,{ref:t,icon:o}))})},41649:function(e,t,n){n.d(t,{Z:function(){return p}});var a=n(5853),c=n(2265),o=n(47187),r=n(7084),l=n(26898),i=n(13241),s=n(1153);let d={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},m={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},u=(0,s.fn)("Badge"),p=c.forwardRef((e,t)=>{let{color:n,icon:p,size:g=r.u8.SM,tooltip:f,className:h,children:b}=e,v=(0,a._T)(e,["color","icon","size","tooltip","className","children"]),x=p||null,{tooltipProps:y,getReferenceProps:k}=(0,o.l)();return c.createElement("span",Object.assign({ref:(0,s.lq)([t,y.refs.setReference]),className:(0,i.q)(u("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",n?(0,i.q)((0,s.bM)(n,l.K.background).bgColor,(0,s.bM)(n,l.K.iconText).textColor,(0,s.bM)(n,l.K.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):(0,i.q)("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),d[g].paddingX,d[g].paddingY,d[g].fontSize,h)},k,v),c.createElement(o.Z,Object.assign({text:f},y)),x?c.createElement(x,{className:(0,i.q)(u("icon"),"shrink-0 -ml-1 mr-1.5",m[g].height,m[g].width)}):null,c.createElement("span",{className:(0,i.q)(u("text"),"whitespace-nowrap")},b))});p.displayName="Badge"},30150:function(e,t,n){n.d(t,{Z:function(){return u}});var a=n(5853),c=n(2265);let o=e=>{var t=(0,a._T)(e,[]);return c.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),c.createElement("path",{d:"M12 4v16m8-8H4"}))},r=e=>{var t=(0,a._T)(e,[]);return c.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),c.createElement("path",{d:"M20 12H4"}))};var l=n(13241),i=n(1153),s=n(69262);let d="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",m="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",u=c.forwardRef((e,t)=>{let{onSubmit:n,enableStepper:u=!0,disabled:p,onValueChange:g,onChange:f}=e,h=(0,a._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),b=(0,c.useRef)(null),[v,x]=c.useState(!1),y=c.useCallback(()=>{x(!0)},[]),k=c.useCallback(()=>{x(!1)},[]),[w,C]=c.useState(!1),E=c.useCallback(()=>{C(!0)},[]),S=c.useCallback(()=>{C(!1)},[]);return c.createElement(s.Z,Object.assign({type:"number",ref:(0,i.lq)([b,t]),disabled:p,makeInputClassName:(0,i.fn)("NumberInput"),onKeyDown:e=>{var t;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(t=b.current)||void 0===t?void 0:t.value;null==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&y(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&k(),"ArrowUp"===e.key&&S()},onChange:e=>{p||(null==g||g(parseFloat(e.target.value)),null==f||f(e))},stepper:u?c.createElement("div",{className:(0,l.q)("flex justify-center align-middle")},c.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=b.current)||void 0===e||e.stepDown(),null===(t=b.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&m,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},c.createElement(r,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),c.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;p||(null===(e=b.current)||void 0===e||e.stepUp(),null===(t=b.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&m,d,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},c.createElement(o,{"data-testid":"step-up",className:(w?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},h))});u.displayName="NumberInput"},16853:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(5853),c=n(96398),o=n(44140),r=n(2265),l=n(13241),i=n(1153);let s=(0,i.fn)("Textarea"),d=r.forwardRef((e,t)=>{let{value:n,defaultValue:d="",placeholder:m="Type...",error:u=!1,errorMessage:p,disabled:g=!1,className:f,onChange:h,onValueChange:b,autoHeight:v=!1}=e,x=(0,a._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[y,k]=(0,o.Z)(d,n),w=(0,r.useRef)(null),C=(0,c.Uh)(y);return(0,r.useEffect)(()=>{let e=w.current;if(v&&e){e.style.height="60px";let t=e.scrollHeight;e.style.height=t+"px"}},[v,w,y]),r.createElement(r.Fragment,null,r.createElement("textarea",Object.assign({ref:(0,i.lq)([w,t]),value:y,placeholder:m,disabled:g,className:(0,l.q)(s("Textarea"),"w-full flex items-center outline-none rounded-tremor-default px-3 py-2 text-tremor-default focus:ring-2 transition duration-100 border","shadow-tremor-input focus:border-tremor-brand-subtle focus:ring-tremor-brand-muted","dark:shadow-dark-tremor-input focus:dark:border-dark-tremor-brand-subtle focus:dark:ring-dark-tremor-brand-muted",(0,c.um)(C,g,u),g?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",f),"data-testid":"text-area",onChange:e=>{null==h||h(e),k(e.target.value),null==b||b(e.target.value)}},x)),u&&p?r.createElement("p",{className:(0,l.q)(s("errorMessage"),"text-sm text-red-500 mt-1")},p):null)});d.displayName="Textarea"},67101:function(e,t,n){n.d(t,{Z:function(){return d}});var a=n(5853),c=n(13241),o=n(1153),r=n(2265),l=n(9496);let i=(0,o.fn)("Grid"),s=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",d=r.forwardRef((e,t)=>{let{numItems:n=1,numItemsSm:o,numItemsMd:d,numItemsLg:m,children:u,className:p}=e,g=(0,a._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=s(n,l._m),h=s(o,l.LH),b=s(d,l.l5),v=s(m,l.N4),x=(0,c.q)(f,h,b,v);return r.createElement("div",Object.assign({ref:t,className:(0,c.q)(i("root"),"grid",x,p)},g),u)});d.displayName="Grid"},9496:function(e,t,n){n.d(t,{LH:function(){return c},N4:function(){return r},PT:function(){return l},SP:function(){return i},VS:function(){return s},_m:function(){return a},_w:function(){return d},l5:function(){return o}});let a={0:"grid-cols-none",1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},c={0:"sm:grid-cols-none",1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6",7:"sm:grid-cols-7",8:"sm:grid-cols-8",9:"sm:grid-cols-9",10:"sm:grid-cols-10",11:"sm:grid-cols-11",12:"sm:grid-cols-12"},o={0:"md:grid-cols-none",1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},r={0:"lg:grid-cols-none",1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"},l={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12",13:"col-span-13"},i={1:"sm:col-span-1",2:"sm:col-span-2",3:"sm:col-span-3",4:"sm:col-span-4",5:"sm:col-span-5",6:"sm:col-span-6",7:"sm:col-span-7",8:"sm:col-span-8",9:"sm:col-span-9",10:"sm:col-span-10",11:"sm:col-span-11",12:"sm:col-span-12",13:"sm:col-span-13"},s={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12",13:"md:col-span-13"},d={1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12",13:"lg:col-span-13"}},44140:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(2265);let c=(e,t)=>{let n=void 0!==t,[c,o]=(0,a.useState)(e);return[n?t:c,e=>{n||o(e)}]}},44851:function(e,t,n){n.d(t,{default:function(){return X}});var a=n(2265),c=n(77565),o=n(36760),r=n.n(o),l=n(1119),i=n(83145),s=n(26365),d=n(41154),m=n(50506),u=n(32559),p=n(6989),g=n(45287),f=n(31686),h=n(11993),b=n(66632),v=n(95814),x=a.forwardRef(function(e,t){var n=e.prefixCls,c=e.forceRender,o=e.className,l=e.style,i=e.children,d=e.isActive,m=e.role,u=e.classNames,p=e.styles,g=a.useState(d||c),f=(0,s.Z)(g,2),b=f[0],v=f[1];return(a.useEffect(function(){(c||d)&&v(!0)},[c,d]),b)?a.createElement("div",{ref:t,className:r()("".concat(n,"-content"),(0,h.Z)((0,h.Z)({},"".concat(n,"-content-active"),d),"".concat(n,"-content-inactive"),!d),o),style:l,role:m},a.createElement("div",{className:r()("".concat(n,"-content-box"),null==u?void 0:u.body),style:null==p?void 0:p.body},i)):null});x.displayName="PanelContent";var y=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],k=a.forwardRef(function(e,t){var n=e.showArrow,c=e.headerClass,o=e.isActive,i=e.onItemClick,s=e.forceRender,d=e.className,m=e.classNames,u=void 0===m?{}:m,g=e.styles,k=void 0===g?{}:g,w=e.prefixCls,C=e.collapsible,E=e.accordion,S=e.panelKey,N=e.extra,Z=e.header,I=e.expandIcon,M=e.openMotion,O=e.destroyInactivePanel,z=e.children,j=(0,p.Z)(e,y),B="disabled"===C,R=(0,h.Z)((0,h.Z)((0,h.Z)({onClick:function(){null==i||i(S)},onKeyDown:function(e){("Enter"===e.key||e.keyCode===v.Z.ENTER||e.which===v.Z.ENTER)&&(null==i||i(S))},role:E?"tab":"button"},"aria-expanded",o),"aria-disabled",B),"tabIndex",B?-1:0),P="function"==typeof I?I(e):a.createElement("i",{className:"arrow"}),L=P&&a.createElement("div",(0,l.Z)({className:"".concat(w,"-expand-icon")},["header","icon"].includes(C)?R:{}),P),H=r()("".concat(w,"-item"),(0,h.Z)((0,h.Z)({},"".concat(w,"-item-active"),o),"".concat(w,"-item-disabled"),B),d),T=r()(c,"".concat(w,"-header"),(0,h.Z)({},"".concat(w,"-collapsible-").concat(C),!!C),u.header),A=(0,f.Z)({className:T,style:k.header},["header","icon"].includes(C)?{}:R);return a.createElement("div",(0,l.Z)({},j,{ref:t,className:H}),a.createElement("div",A,(void 0===n||n)&&L,a.createElement("span",(0,l.Z)({className:"".concat(w,"-header-text")},"header"===C?R:{}),Z),null!=N&&"boolean"!=typeof N&&a.createElement("div",{className:"".concat(w,"-extra")},N)),a.createElement(b.ZP,(0,l.Z)({visible:o,leavedClassName:"".concat(w,"-content-hidden")},M,{forceRender:s,removeOnLeave:O}),function(e,t){var n=e.className,c=e.style;return a.createElement(x,{ref:t,prefixCls:w,className:n,classNames:u,style:c,styles:k,isActive:o,forceRender:s,role:E?"tabpanel":void 0},z)}))}),w=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],C=function(e,t){var n=t.prefixCls,c=t.accordion,o=t.collapsible,r=t.destroyInactivePanel,i=t.onItemClick,s=t.activeKey,d=t.openMotion,m=t.expandIcon;return e.map(function(e,t){var u=e.children,g=e.label,f=e.key,h=e.collapsible,b=e.onItemClick,v=e.destroyInactivePanel,x=(0,p.Z)(e,w),y=String(null!=f?f:t),C=null!=h?h:o,E=!1;return E=c?s[0]===y:s.indexOf(y)>-1,a.createElement(k,(0,l.Z)({},x,{prefixCls:n,key:y,panelKey:y,isActive:E,accordion:c,openMotion:d,expandIcon:m,header:g,collapsible:C,onItemClick:function(e){"disabled"!==C&&(i(e),null==b||b(e))},destroyInactivePanel:null!=v?v:r}),u)})},E=function(e,t,n){if(!e)return null;var c=n.prefixCls,o=n.accordion,r=n.collapsible,l=n.destroyInactivePanel,i=n.onItemClick,s=n.activeKey,d=n.openMotion,m=n.expandIcon,u=e.key||String(t),p=e.props,g=p.header,f=p.headerClass,h=p.destroyInactivePanel,b=p.collapsible,v=p.onItemClick,x=!1;x=o?s[0]===u:s.indexOf(u)>-1;var y=null!=b?b:r,k={key:u,panelKey:u,header:g,headerClass:f,isActive:x,prefixCls:c,destroyInactivePanel:null!=h?h:l,openMotion:d,accordion:o,children:e.props.children,onItemClick:function(e){"disabled"!==y&&(i(e),null==v||v(e))},expandIcon:m,collapsible:y};return"string"==typeof e.type?e:(Object.keys(k).forEach(function(e){void 0===k[e]&&delete k[e]}),a.cloneElement(e,k))},S=n(18242);function N(e){var t=e;if(!Array.isArray(t)){var n=(0,d.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}var Z=Object.assign(a.forwardRef(function(e,t){var n,c=e.prefixCls,o=void 0===c?"rc-collapse":c,d=e.destroyInactivePanel,p=e.style,f=e.accordion,h=e.className,b=e.children,v=e.collapsible,x=e.openMotion,y=e.expandIcon,k=e.activeKey,w=e.defaultActiveKey,Z=e.onChange,I=e.items,M=r()(o,h),O=(0,m.Z)([],{value:k,onChange:function(e){return null==Z?void 0:Z(e)},defaultValue:w,postState:N}),z=(0,s.Z)(O,2),j=z[0],B=z[1];(0,u.ZP)(!b,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var R=(n={prefixCls:o,accordion:f,openMotion:x,expandIcon:y,collapsible:v,destroyInactivePanel:void 0!==d&&d,onItemClick:function(e){return B(function(){return f?j[0]===e?[]:[e]:j.indexOf(e)>-1?j.filter(function(t){return t!==e}):[].concat((0,i.Z)(j),[e])})},activeKey:j},Array.isArray(I)?C(I,n):(0,g.Z)(b).map(function(e,t){return E(e,t,n)}));return a.createElement("div",(0,l.Z)({ref:t,className:M,style:p,role:f?"tablist":void 0},(0,S.Z)(e,{aria:!0,data:!0})),R)}),{Panel:k});Z.Panel;var I=n(18694),M=n(68710),O=n(19722),z=n(71744),j=n(33759);let B=a.forwardRef((e,t)=>{let{getPrefixCls:n}=a.useContext(z.E_),{prefixCls:c,className:o,showArrow:l=!0}=e,i=n("collapse",c),s=r()({["".concat(i,"-no-arrow")]:!l},o);return a.createElement(Z.Panel,Object.assign({ref:t},e,{prefixCls:i,className:s}))});var R=n(93463),P=n(12918),L=n(63074),H=n(99320),T=n(71140);let A=e=>{let{componentCls:t,contentBg:n,padding:a,headerBg:c,headerPadding:o,collapseHeaderPaddingSM:r,collapseHeaderPaddingLG:l,collapsePanelBorderRadius:i,lineWidth:s,lineType:d,colorBorder:m,colorText:u,colorTextHeading:p,colorTextDisabled:g,fontSizeLG:f,lineHeight:h,lineHeightLG:b,marginSM:v,paddingSM:x,paddingLG:y,paddingXS:k,motionDurationSlow:w,fontSizeIcon:C,contentPadding:E,fontHeight:S,fontHeightLG:N}=e,Z="".concat((0,R.bf)(s)," ").concat(d," ").concat(m);return{[t]:Object.assign(Object.assign({},(0,P.Wf)(e)),{backgroundColor:c,border:Z,borderRadius:i,"&-rtl":{direction:"rtl"},["& > ".concat(t,"-item")]:{borderBottom:Z,"&:first-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"".concat((0,R.bf)(i)," ").concat((0,R.bf)(i)," 0 0")}},"&:last-child":{["\n &,\n & > ".concat(t,"-header")]:{borderRadius:"0 0 ".concat((0,R.bf)(i)," ").concat((0,R.bf)(i))}},["> ".concat(t,"-header")]:Object.assign(Object.assign({position:"relative",display:"flex",flexWrap:"nowrap",alignItems:"flex-start",padding:o,color:p,lineHeight:h,cursor:"pointer",transition:"all ".concat(w,", visibility 0s")},(0,P.Qy)(e)),{["> ".concat(t,"-header-text")]:{flex:"auto"},["".concat(t,"-expand-icon")]:{height:S,display:"flex",alignItems:"center",paddingInlineEnd:v},["".concat(t,"-arrow")]:Object.assign(Object.assign({},(0,P.Ro)()),{fontSize:C,transition:"transform ".concat(w),svg:{transition:"transform ".concat(w)}}),["".concat(t,"-header-text")]:{marginInlineEnd:"auto"}}),["".concat(t,"-collapsible-header")]:{cursor:"default",["".concat(t,"-header-text")]:{flex:"none",cursor:"pointer"},["".concat(t,"-expand-icon")]:{cursor:"pointer"}},["".concat(t,"-collapsible-icon")]:{cursor:"unset",["".concat(t,"-expand-icon")]:{cursor:"pointer"}}},["".concat(t,"-content")]:{color:u,backgroundColor:n,borderTop:Z,["& > ".concat(t,"-content-box")]:{padding:E},"&-hidden":{display:"none"}},"&-small":{["> ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{padding:r,paddingInlineStart:k,["> ".concat(t,"-expand-icon")]:{marginInlineStart:e.calc(x).sub(k).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:x}}},"&-large":{["> ".concat(t,"-item")]:{fontSize:f,lineHeight:b,["> ".concat(t,"-header")]:{padding:l,paddingInlineStart:a,["> ".concat(t,"-expand-icon")]:{height:N,marginInlineStart:e.calc(y).sub(a).equal()}},["> ".concat(t,"-content > ").concat(t,"-content-box")]:{padding:y}}},["".concat(t,"-item:last-child")]:{borderBottom:0,["> ".concat(t,"-content")]:{borderRadius:"0 0 ".concat((0,R.bf)(i)," ").concat((0,R.bf)(i))}},["& ".concat(t,"-item-disabled > ").concat(t,"-header")]:{"\n &,\n & > .arrow\n ":{color:g,cursor:"not-allowed"}},["&".concat(t,"-icon-position-end")]:{["& > ".concat(t,"-item")]:{["> ".concat(t,"-header")]:{["".concat(t,"-expand-icon")]:{order:1,paddingInlineEnd:0,paddingInlineStart:v}}}}})}},V=e=>{let{componentCls:t}=e,n="> ".concat(t,"-item > ").concat(t,"-header ").concat(t,"-arrow");return{["".concat(t,"-rtl")]:{[n]:{transform:"rotate(180deg)"}}}},W=e=>{let{componentCls:t,headerBg:n,borderlessContentPadding:a,borderlessContentBg:c,colorBorder:o}=e;return{["".concat(t,"-borderless")]:{backgroundColor:n,border:0,["> ".concat(t,"-item")]:{borderBottom:"1px solid ".concat(o)},["\n > ".concat(t,"-item:last-child,\n > ").concat(t,"-item:last-child ").concat(t,"-header\n ")]:{borderRadius:0},["> ".concat(t,"-item:last-child")]:{borderBottom:0},["> ".concat(t,"-item > ").concat(t,"-content")]:{backgroundColor:c,borderTop:0},["> ".concat(t,"-item > ").concat(t,"-content > ").concat(t,"-content-box")]:{padding:a}}}},q=e=>{let{componentCls:t,paddingSM:n}=e;return{["".concat(t,"-ghost")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-item")]:{borderBottom:0,["> ".concat(t,"-content")]:{backgroundColor:"transparent",border:0,["> ".concat(t,"-content-box")]:{paddingBlock:n}}}}}};var K=(0,H.I$)("Collapse",e=>{let t=(0,T.IX)(e,{collapseHeaderPaddingSM:"".concat((0,R.bf)(e.paddingXS)," ").concat((0,R.bf)(e.paddingSM)),collapseHeaderPaddingLG:"".concat((0,R.bf)(e.padding)," ").concat((0,R.bf)(e.paddingLG)),collapsePanelBorderRadius:e.borderRadiusLG});return[A(t),W(t),q(t),V(t),(0,L.Z)(t)]},e=>({headerPadding:"".concat(e.paddingSM,"px ").concat(e.padding,"px"),headerBg:e.colorFillAlter,contentPadding:"".concat(e.padding,"px 16px"),contentBg:e.colorBgContainer,borderlessContentPadding:"".concat(e.paddingXXS,"px 16px ").concat(e.padding,"px"),borderlessContentBg:"transparent"})),X=Object.assign(a.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o,expandIcon:l,className:i,style:s}=(0,z.dj)("collapse"),{prefixCls:d,className:m,rootClassName:u,style:p,bordered:f=!0,ghost:h,size:b,expandIconPosition:v="start",children:x,destroyInactivePanel:y,destroyOnHidden:k,expandIcon:w}=e,C=(0,j.Z)(e=>{var t;return null!==(t=null!=b?b:e)&&void 0!==t?t:"middle"}),E=n("collapse",d),S=n(),[N,B,R]=K(E),P=a.useMemo(()=>"left"===v?"start":"right"===v?"end":v,[v]),L=null!=w?w:l,H=a.useCallback(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="function"==typeof L?L(e):a.createElement(c.Z,{rotate:e.isActive?"rtl"===o?-90:90:void 0,"aria-label":e.isActive?"expanded":"collapsed"});return(0,O.Tm)(t,()=>{var e;return{className:r()(null===(e=t.props)||void 0===e?void 0:e.className,"".concat(E,"-arrow"))}})},[L,E,o]),T=r()("".concat(E,"-icon-position-").concat(P),{["".concat(E,"-borderless")]:!f,["".concat(E,"-rtl")]:"rtl"===o,["".concat(E,"-ghost")]:!!h,["".concat(E,"-").concat(C)]:"middle"!==C},i,m,u,B,R),A=a.useMemo(()=>Object.assign(Object.assign({},(0,M.Z)(S)),{motionAppear:!1,leavedClassName:"".concat(E,"-content-hidden")}),[S,E]),V=a.useMemo(()=>x?(0,g.Z)(x).map((e,t)=>{var n,a;let c=e.props;if(null==c?void 0:c.disabled){let o=null!==(n=e.key)&&void 0!==n?n:String(t),r=Object.assign(Object.assign({},(0,I.Z)(e.props,["disabled"])),{key:o,collapsible:null!==(a=c.collapsible)&&void 0!==a?a:"disabled"});return(0,O.Tm)(e,r)}return e}):null,[x]);return N(a.createElement(Z,Object.assign({ref:t,openMotion:A},(0,I.Z)(e,["rootClassName"]),{expandIcon:H,prefixCls:E,className:T,style:Object.assign(Object.assign({},s),p),destroyInactivePanel:null!=k?k:y}),V))}),{Panel:B})},35631:function(e,t,n){n.d(t,{Z:function(){return z}});var a=n(83145),c=n(2265),o=n(36760),r=n.n(o),l=n(53253),i=n(6543),s=n(71744),d=n(91086),m=n(33759),u=n(77774),p=n(28617),g=n(40049),f=n(10353);let h=c.createContext({});h.Consumer;var b=n(19722),v=n(54998),x=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,a=Object.getOwnPropertySymbols(e);ct.indexOf(a[c])&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(n[a[c]]=e[a[c]]);return n};let y=c.forwardRef((e,t)=>{let n;let{prefixCls:a,children:o,actions:l,extra:i,styles:d,className:m,classNames:u,colStyle:p}=e,g=x(e,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:f,itemLayout:y}=(0,c.useContext)(h),{getPrefixCls:k,list:w}=(0,c.useContext)(s.E_),C=e=>{var t,n;return r()(null===(n=null===(t=null==w?void 0:w.item)||void 0===t?void 0:t.classNames)||void 0===n?void 0:n[e],null==u?void 0:u[e])},E=e=>{var t,n;return Object.assign(Object.assign({},null===(n=null===(t=null==w?void 0:w.item)||void 0===t?void 0:t.styles)||void 0===n?void 0:n[e]),null==d?void 0:d[e])},S=k("list",a),N=l&&l.length>0&&c.createElement("ul",{className:r()("".concat(S,"-item-action"),C("actions")),key:"actions",style:E("actions")},l.map((e,t)=>c.createElement("li",{key:"".concat(S,"-item-action-").concat(t)},e,t!==l.length-1&&c.createElement("em",{className:"".concat(S,"-item-action-split")})))),Z=c.createElement(f?"div":"li",Object.assign({},g,f?{}:{ref:t},{className:r()("".concat(S,"-item"),{["".concat(S,"-item-no-flex")]:!("vertical"===y?!!i:(n=!1,c.Children.forEach(o,e=>{"string"==typeof e&&(n=!0)}),!(n&&c.Children.count(o)>1)))},m)}),"vertical"===y&&i?[c.createElement("div",{className:"".concat(S,"-item-main"),key:"content"},o,N),c.createElement("div",{className:r()("".concat(S,"-item-extra"),C("extra")),key:"extra",style:E("extra")},i)]:[o,N,(0,b.Tm)(i,{key:"extra"})]);return f?c.createElement(v.Z,{ref:t,flex:1,style:p},Z):Z});y.Meta=e=>{var{prefixCls:t,className:n,avatar:a,title:o,description:l}=e,i=x(e,["prefixCls","className","avatar","title","description"]);let{getPrefixCls:d}=(0,c.useContext)(s.E_),m=d("list",t),u=r()("".concat(m,"-item-meta"),n),p=c.createElement("div",{className:"".concat(m,"-item-meta-content")},o&&c.createElement("h4",{className:"".concat(m,"-item-meta-title")},o),l&&c.createElement("div",{className:"".concat(m,"-item-meta-description")},l));return c.createElement("div",Object.assign({},i,{className:u}),a&&c.createElement("div",{className:"".concat(m,"-item-meta-avatar")},a),(o||l)&&p)};var k=n(93463),w=n(12918),C=n(99320),E=n(71140);let S=e=>{let{listBorderedCls:t,componentCls:n,paddingLG:a,margin:c,itemPaddingSM:o,itemPaddingLG:r,marginLG:l,borderRadiusLG:i}=e,s=(0,k.bf)(e.calc(i).sub(e.lineWidth).equal());return{[t]:{border:"".concat((0,k.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:i,["".concat(n,"-header")]:{borderRadius:"".concat(s," ").concat(s," 0 0")},["".concat(n,"-footer")]:{borderRadius:"0 0 ".concat(s," ").concat(s)},["".concat(n,"-header,").concat(n,"-footer,").concat(n,"-item")]:{paddingInline:a},["".concat(n,"-pagination")]:{margin:"".concat((0,k.bf)(c)," ").concat((0,k.bf)(l))}},["".concat(t).concat(n,"-sm")]:{["".concat(n,"-item,").concat(n,"-header,").concat(n,"-footer")]:{padding:o}},["".concat(t).concat(n,"-lg")]:{["".concat(n,"-item,").concat(n,"-header,").concat(n,"-footer")]:{padding:r}}}},N=e=>{let{componentCls:t,screenSM:n,screenMD:a,marginLG:c,marginSM:o,margin:r}=e;return{["@media screen and (max-width:".concat(a,"px)")]:{[t]:{["".concat(t,"-item")]:{["".concat(t,"-item-action")]:{marginInlineStart:c}}},["".concat(t,"-vertical")]:{["".concat(t,"-item")]:{["".concat(t,"-item-extra")]:{marginInlineStart:c}}}},["@media screen and (max-width: ".concat(n,"px)")]:{[t]:{["".concat(t,"-item")]:{flexWrap:"wrap",["".concat(t,"-action")]:{marginInlineStart:o}}},["".concat(t,"-vertical")]:{["".concat(t,"-item")]:{flexWrap:"wrap-reverse",["".concat(t,"-item-main")]:{minWidth:e.contentWidth},["".concat(t,"-item-extra")]:{margin:"auto auto ".concat((0,k.bf)(r))}}}}}},Z=e=>{let{componentCls:t,antCls:n,controlHeight:a,minHeight:c,paddingSM:o,marginLG:r,padding:l,itemPadding:i,colorPrimary:s,itemPaddingSM:d,itemPaddingLG:m,paddingXS:u,margin:p,colorText:g,colorTextDescription:f,motionDurationSlow:h,lineWidth:b,headerBg:v,footerBg:x,emptyTextPadding:y,metaMarginBottom:C,avatarMarginRight:E,titleMarginBottom:S,descriptionFontSize:N}=e;return{[t]:Object.assign(Object.assign({},(0,w.Wf)(e)),{position:"relative","--rc-virtual-list-scrollbar-bg":e.colorSplit,"*":{outline:"none"},["".concat(t,"-header")]:{background:v},["".concat(t,"-footer")]:{background:x},["".concat(t,"-header, ").concat(t,"-footer")]:{paddingBlock:o},["".concat(t,"-pagination")]:{marginBlockStart:r,["".concat(n,"-pagination-options")]:{textAlign:"start"}},["".concat(t,"-spin")]:{minHeight:c,textAlign:"center"},["".concat(t,"-items")]:{margin:0,padding:0,listStyle:"none"},["".concat(t,"-item")]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:i,color:g,["".concat(t,"-item-meta")]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",["".concat(t,"-item-meta-avatar")]:{marginInlineEnd:E},["".concat(t,"-item-meta-content")]:{flex:"1 0",width:0,color:g},["".concat(t,"-item-meta-title")]:{margin:"0 0 ".concat((0,k.bf)(e.marginXXS)," 0"),color:g,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:g,transition:"all ".concat(h),"&:hover":{color:s}}},["".concat(t,"-item-meta-description")]:{color:f,fontSize:N,lineHeight:e.lineHeight}},["".concat(t,"-item-action")]:{flex:"0 0 auto",marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:"0 ".concat((0,k.bf)(u)),color:f,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},["".concat(t,"-item-action-split")]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:b,height:e.calc(e.fontHeight).sub(e.calc(e.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:e.colorSplit}}},["".concat(t,"-empty")]:{padding:"".concat((0,k.bf)(l)," 0"),color:f,fontSize:e.fontSizeSM,textAlign:"center"},["".concat(t,"-empty-text")]:{padding:y,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:"center"},["".concat(t,"-item-no-flex")]:{display:"block"}}),["".concat(t,"-grid ").concat(n,"-col > ").concat(t,"-item")]:{display:"block",maxWidth:"100%",marginBlockEnd:p,paddingBlock:0,borderBlockEnd:"none"},["".concat(t,"-vertical ").concat(t,"-item")]:{alignItems:"initial",["".concat(t,"-item-main")]:{display:"block",flex:1},["".concat(t,"-item-extra")]:{marginInlineStart:r},["".concat(t,"-item-meta")]:{marginBlockEnd:C,["".concat(t,"-item-meta-title")]:{marginBlockStart:0,marginBlockEnd:S,color:g,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},["".concat(t,"-item-action")]:{marginBlockStart:l,marginInlineStart:"auto","> li":{padding:"0 ".concat((0,k.bf)(l)),"&:first-child":{paddingInlineStart:0}}}},["".concat(t,"-split ").concat(t,"-item")]:{borderBlockEnd:"".concat((0,k.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit),"&:last-child":{borderBlockEnd:"none"}},["".concat(t,"-split ").concat(t,"-header")]:{borderBlockEnd:"".concat((0,k.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},["".concat(t,"-split").concat(t,"-empty ").concat(t,"-footer")]:{borderTop:"".concat((0,k.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},["".concat(t,"-loading ").concat(t,"-spin-nested-loading")]:{minHeight:a},["".concat(t,"-split").concat(t,"-something-after-last-item ").concat(n,"-spin-container > ").concat(t,"-items > ").concat(t,"-item:last-child")]:{borderBlockEnd:"".concat((0,k.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)},["".concat(t,"-lg ").concat(t,"-item")]:{padding:m},["".concat(t,"-sm ").concat(t,"-item")]:{padding:d},["".concat(t,":not(").concat(t,"-vertical)")]:{["".concat(t,"-item-no-flex")]:{["".concat(t,"-item-action")]:{float:"right"}}}}};var I=(0,C.I$)("List",e=>{let t=(0,E.IX)(e,{listBorderedCls:"".concat(e.componentCls,"-bordered"),minHeight:e.controlHeightLG});return[Z(t),S(t),N(t)]},e=>({contentWidth:220,itemPadding:"".concat((0,k.bf)(e.paddingContentVertical)," 0"),itemPaddingSM:"".concat((0,k.bf)(e.paddingContentVerticalSM)," ").concat((0,k.bf)(e.paddingContentHorizontal)),itemPaddingLG:"".concat((0,k.bf)(e.paddingContentVerticalLG)," ").concat((0,k.bf)(e.paddingContentHorizontalLG)),headerBg:"transparent",footerBg:"transparent",emptyTextPadding:e.padding,metaMarginBottom:e.padding,avatarMarginRight:e.padding,titleMarginBottom:e.paddingSM,descriptionFontSize:e.fontSize})),M=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var c=0,a=Object.getOwnPropertySymbols(e);ct.indexOf(a[c])&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(n[a[c]]=e[a[c]]);return n};let O=c.forwardRef(function(e,t){let{pagination:n=!1,prefixCls:o,bordered:b=!1,split:v=!0,className:x,rootClassName:y,style:k,children:w,itemLayout:C,loadMore:E,grid:S,dataSource:N=[],size:Z,header:O,footer:z,loading:j=!1,rowKey:B,renderItem:R,locale:P}=e,L=M(e,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]),H=n&&"object"==typeof n?n:{},[T,A]=c.useState(H.defaultCurrent||1),[V,W]=c.useState(H.defaultPageSize||10),{getPrefixCls:q,direction:K,className:X,style:_}=(0,s.dj)("list"),{renderEmpty:D}=c.useContext(s.E_),G=e=>(t,a)=>{var c;A(t),W(a),n&&(null===(c=null==n?void 0:n[e])||void 0===c||c.call(n,t,a))},U=G("onChange"),Y=G("onShowSizeChange"),F=!!(E||n||z),J=q("list",o),[$,Q,ee]=I(J),et=j;"boolean"==typeof et&&(et={spinning:et});let en=!!(null==et?void 0:et.spinning),ea=(0,m.Z)(Z),ec="";switch(ea){case"large":ec="lg";break;case"small":ec="sm"}let eo=r()(J,{["".concat(J,"-vertical")]:"vertical"===C,["".concat(J,"-").concat(ec)]:ec,["".concat(J,"-split")]:v,["".concat(J,"-bordered")]:b,["".concat(J,"-loading")]:en,["".concat(J,"-grid")]:!!S,["".concat(J,"-something-after-last-item")]:F,["".concat(J,"-rtl")]:"rtl"===K},X,x,y,Q,ee),er=(0,l.Z)({current:1,total:0,position:"bottom"},{total:N.length,current:T,pageSize:V},n||{}),el=Math.ceil(er.total/er.pageSize);er.current=Math.min(er.current,el);let ei=n&&c.createElement("div",{className:r()("".concat(J,"-pagination"))},c.createElement(g.Z,Object.assign({align:"end"},er,{onChange:U,onShowSizeChange:Y}))),es=(0,a.Z)(N);n&&N.length>(er.current-1)*er.pageSize&&(es=(0,a.Z)(N).splice((er.current-1)*er.pageSize,er.pageSize));let ed=Object.keys(S||{}).some(e=>["xs","sm","md","lg","xl","xxl"].includes(e)),em=(0,p.Z)(ed),eu=c.useMemo(()=>{for(let e=0;e{if(!S)return;let e=eu&&S[eu]?S[eu]:S.column;if(e)return{width:"".concat(100/e,"%"),maxWidth:"".concat(100/e,"%")}},[JSON.stringify(S),eu]),eg=en&&c.createElement("div",{style:{minHeight:53}});if(es.length>0){let e=es.map((e,t)=>{let n;return R?((n="function"==typeof B?B(e):B?e[B]:e.key)||(n="list-item-".concat(t)),c.createElement(c.Fragment,{key:n},R(e,t))):null});eg=S?c.createElement(u.Z,{gutter:S.gutter},c.Children.map(e,e=>c.createElement("div",{key:null==e?void 0:e.key,style:ep},e))):c.createElement("ul",{className:"".concat(J,"-items")},e)}else w||en||(eg=c.createElement("div",{className:"".concat(J,"-empty-text")},(null==P?void 0:P.emptyText)||(null==D?void 0:D("List"))||c.createElement(d.Z,{componentName:"List"})));let ef=er.position,eh=c.useMemo(()=>({grid:S,itemLayout:C}),[JSON.stringify(S),C]);return $(c.createElement(h.Provider,{value:eh},c.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},_),k),className:eo},L),("top"===ef||"both"===ef)&&ei,O&&c.createElement("div",{className:"".concat(J,"-header")},O),c.createElement(f.Z,Object.assign({},et),eg,w),z&&c.createElement("div",{className:"".concat(J,"-footer")},z),E||("bottom"===ef||"both"===ef)&&ei)))});O.Item=y;var z=O},30401:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},78867:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("copy",[["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"}]])},10900:function(e,t,n){var a=n(2265);let c=a.forwardRef(function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});t.Z=c},86462:function(e,t,n){var a=n(2265);let c=a.forwardRef(function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});t.Z=c},74998:function(e,t,n){var a=n(2265);let c=a.forwardRef(function(e,t){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),a.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))});t.Z=c}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/7526-5af38ec64144fa99.js b/litellm/proxy/_experimental/out/_next/static/chunks/7526-5af38ec64144fa99.js deleted file mode 100644 index 6fe4e3114af..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/7526-5af38ec64144fa99.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7526],{19130:function(e,t,n){n.d(t,{RM:function(){return s.Z},SC:function(){return o.Z},iA:function(){return a.Z},pj:function(){return r.Z},ss:function(){return i.Z},xs:function(){return l.Z}});var a=n(21626),s=n(97214),r=n(28241),i=n(58834),l=n(69552),o=n(71876)},8048:function(e,t,n){n.d(t,{C:function(){return m}});var a=n(57437),s=n(71594),r=n(24525),i=n(2265),l=n(19130),o=n(44633),c=n(86462),d=n(49084);function m(e){let{data:t=[],columns:n,isLoading:m=!1,defaultSorting:p=[],pagination:u,onPaginationChange:g,enablePagination:x=!1}=e,[h,f]=i.useState(p),[_]=i.useState("onChange"),[b,v]=i.useState({}),[j,y]=i.useState({}),N=(0,s.b7)({data:t,columns:n,state:{sorting:h,columnSizing:b,columnVisibility:j,...x&&u?{pagination:u}:{}},columnResizeMode:_,onSortingChange:f,onColumnSizingChange:v,onColumnVisibilityChange:y,...x&&g?{onPaginationChange:g}:{},getCoreRowModel:(0,r.sC)(),getSortedRowModel:(0,r.tj)(),...x?{getPaginationRowModel:(0,r.G_)()}:{},enableSorting:!0,enableColumnResizing:!0,defaultColumn:{minSize:40,maxSize:500}});return(0,a.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("div",{className:"relative min-w-full",children:(0,a.jsxs)(l.iA,{className:"[&_td]:py-2 [&_th]:py-2 w-full",children:[(0,a.jsx)(l.ss,{children:N.getHeaderGroups().map(e=>(0,a.jsx)(l.SC,{children:e.headers.map(e=>{var t;return(0,a.jsxs)(l.xs,{className:"py-1 h-8 relative ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.id?120:e.getSize(),position:"actions"===e.id?"sticky":"relative",right:"actions"===e.id?0:"auto"},onClick:e.column.getCanSort()?e.column.getToggleSortingHandler():void 0,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,s.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&e.column.getCanSort()&&(0,a.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,a.jsx)(o.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,a.jsx)(c.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,a.jsx)(d.Z,{className:"h-4 w-4 text-gray-400"})})]}),e.column.getCanResize()&&(0,a.jsx)("div",{onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler(),className:"absolute right-0 top-0 h-full w-2 cursor-col-resize select-none touch-none ".concat(e.column.getIsResizing()?"bg-blue-500":"hover:bg-blue-200")})]},e.id)})},e.id))}),(0,a.jsx)(l.RM,{children:m?(0,a.jsx)(l.SC,{children:(0,a.jsx)(l.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:"\uD83D\uDE85 Loading models..."})})})}):N.getRowModel().rows.length>0?N.getRowModel().rows.map(e=>(0,a.jsx)(l.SC,{children:e.getVisibleCells().map(e=>{var t;return(0,a.jsx)(l.pj,{className:"py-0.5 ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)] w-[120px] ml-8":""," ").concat((null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.className)||""),style:{width:"actions"===e.column.id?120:e.column.getSize(),position:"actions"===e.column.id?"sticky":"relative",right:"actions"===e.column.id?0:"auto"},children:(0,s.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)):(0,a.jsx)(l.SC,{children:(0,a.jsx)(l.pj,{colSpan:n.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:"No models found"})})})})})]})})})})}},92004:function(e,t,n){n.d(t,{Z:function(){return A}});var a=n(57437),s=n(19250),r=n(11713);let i=(0,n(90246).n)("healthReadiness"),l=async()=>{let e=(0,s.getProxyBaseUrl)(),t=await fetch("".concat(e,"/health/readiness"));if(!t.ok)throw Error("Failed to fetch health readiness: ".concat(t.statusText));return t.json()},o=()=>(0,r.a)({queryKey:i.detail("readiness"),queryFn:l,staleTime:3e5});var c=n(69734),d=n(3914),m=n(9245),p=n(91624),u=n(15883),g=n(46346),x=n(57400),h=n(91870),f=n(40428),_=n(83884),b=n(45524),v=n(99981),j=n(63709),y=n(73705),N=n(27648),w=n(2265),A=e=>{let{userID:t,userEmail:n,userRole:r,premiumUser:i,proxySettings:l,setProxySettings:A,accessToken:S,isPublicPage:C=!1,sidebarCollapsed:I=!1,onToggleSidebar:k}=e,Z=(0,s.getProxyBaseUrl)();console.log("baseUrl",Z);let[E,M]=(0,w.useState)(""),[P,O]=(0,w.useState)(!1),{logoUrl:T}=(0,c.F)(),{data:D}=o(),L=null==D?void 0:D.litellm_version,z=T||"".concat(Z,"/get_image");(0,w.useEffect)(()=>{(async()=>{if(S){let e=await (0,p.C)(S);console.log("response from fetchProxySettings",e),e&&A(e)}})()},[S]),(0,w.useEffect)(()=>{O("true"===(0,m.le)("disableShowNewBadge"))},[]),(0,w.useEffect)(()=>{M((null==l?void 0:l.PROXY_LOGOUT_URL)||"")},[l]);let R=[{key:"user-info",onClick:e=>{var t;return null===(t=e.domEvent)||void 0===t?void 0:t.stopPropagation()},label:(0,a.jsxs)("div",{className:"px-3 py-3 border-b border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(u.Z,{className:"mr-2 text-gray-700"}),(0,a.jsx)("span",{className:"text-sm font-semibold text-gray-900",children:t})]}),i?(0,a.jsx)(v.Z,{title:"Premium User",placement:"left",children:(0,a.jsxs)("div",{className:"flex items-center bg-gradient-to-r from-amber-500 to-yellow-500 text-white px-2 py-0.5 rounded-full cursor-help",children:[(0,a.jsx)(g.Z,{className:"mr-1 text-xs"}),(0,a.jsx)("span",{className:"text-xs font-medium",children:"Premium"})]})}):(0,a.jsx)(v.Z,{title:"Upgrade to Premium for advanced features",placement:"left",children:(0,a.jsxs)("div",{className:"flex items-center bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full cursor-help",children:[(0,a.jsx)(g.Z,{className:"mr-1 text-xs"}),(0,a.jsx)("span",{className:"text-xs font-medium",children:"Standard"})]})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center text-sm",children:[(0,a.jsx)(x.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,a.jsx)("span",{className:"text-gray-500 text-xs",children:"Role"}),(0,a.jsx)("span",{className:"ml-auto text-gray-700 font-medium",children:r})]}),(0,a.jsxs)("div",{className:"flex items-center text-sm",children:[(0,a.jsx)(h.Z,{className:"mr-2 text-gray-400 text-xs"}),(0,a.jsx)("span",{className:"text-gray-500 text-xs",children:"Email"}),(0,a.jsx)("span",{className:"ml-auto text-gray-700 font-medium truncate max-w-[150px]",title:n||"Unknown",children:n||"Unknown"})]}),(0,a.jsxs)("div",{className:"flex items-center text-sm pt-2 mt-2 border-t border-gray-100",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("span",{className:"text-gray-500 text-xs",children:"Hide New Feature Indicators"}),(0,a.jsx)(j.Z,{className:"ml-auto",size:"small",checked:P,onChange:e=>{O(e),e?(0,m.D$)("disableShowNewBadge","true"):(0,m.e8)("disableShowNewBadge"),(0,m.nO)("disableShowNewBadge")},"aria-label":"Toggle hide new feature indicators"})]})]})]})},{key:"logout",label:(0,a.jsxs)("div",{className:"flex items-center py-2 px-3 hover:bg-gray-50 rounded-md mx-1 my-1",onClick:()=>{(0,d.b)(),window.location.href=E},children:[(0,a.jsx)(f.Z,{className:"mr-3 text-gray-600"}),(0,a.jsx)("span",{className:"text-gray-800",children:"Logout"})]})}];return(0,a.jsx)("nav",{className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:(0,a.jsx)("div",{className:"w-full",children:(0,a.jsxs)("div",{className:"flex items-center h-14 px-4",children:[(0,a.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[k&&(0,a.jsx)("button",{onClick:k,className:"flex items-center justify-center w-10 h-10 mr-2 text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded transition-colors",title:I?"Expand sidebar":"Collapse sidebar",children:(0,a.jsx)("span",{className:"text-lg",children:I?(0,a.jsx)(_.Z,{}):(0,a.jsx)(b.Z,{})})}),(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(N.default,{href:Z||"/",className:"flex items-center",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("img",{src:z,alt:"LiteLLM Brand",className:"h-10 w-auto"}),(0,a.jsx)("span",{className:"absolute -top-1 -right-2 text-lg animate-bounce",style:{animationDuration:"2s"},title:"Happy Holidays!",children:"\uD83C\uDF84"})]})}),L&&(0,a.jsxs)("a",{href:"https://docs.litellm.ai/release_notes",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-gray-500 border border-gray-200 rounded-lg px-2 py-0.5 bg-gray-50 font-medium -ml-2 hover:bg-gray-100 transition-colors cursor-pointer z-10",children:["v",L]})]})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-5 ml-auto",children:[(0,a.jsx)("a",{href:"https://docs.litellm.ai/docs/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-gray-600 hover:text-gray-900 transition-colors",children:"Docs"}),!C&&(0,a.jsx)(y.Z,{menu:{items:R,className:"min-w-[200px]",style:{padding:"8px",marginTop:"8px",borderRadius:"12px",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.08)"}},overlayStyle:{minWidth:"200px"},children:(0,a.jsxs)("button",{className:"inline-flex items-center text-sm text-gray-600 hover:text-gray-900 transition-colors",children:["User",(0,a.jsx)("svg",{className:"ml-1 w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M19 9l-7 7-7-7"})})]})})]})]})})})}},82971:function(e,t,n){n.d(t,{L:function(){return s}});var a=n(8443);let s=e=>{let t;let{apiKeySource:n,accessToken:s,apiKey:r,inputMessage:i,chatHistory:l,selectedTags:o,selectedVectorStores:c,selectedGuardrails:d,selectedMCPServers:m,mcpServers:p,mcpServerToolRestrictions:u,selectedVoice:g,endpointType:x,selectedModel:h,selectedSdk:f,proxySettings:_}=e,b="session"===n?s:r,v=window.location.origin,j=null==_?void 0:_.LITELLM_UI_API_DOC_BASE_URL;j&&j.trim()?v=j:(null==_?void 0:_.PROXY_BASE_URL)&&(v=_.PROXY_BASE_URL);let y=i||"Your prompt here",N=y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n"),w=l.filter(e=>!e.isImage).map(e=>{let{role:t,content:n}=e;return{role:t,content:n}}),A={};o.length>0&&(A.tags=o),c.length>0&&(A.vector_stores=c),d.length>0&&(A.guardrails=d);let S=h||"your-model-name",C="azure"===f?'import openai\n\nclient = openai.AzureOpenAI(\n api_key="'.concat(b||"YOUR_LITELLM_API_KEY",'",\n azure_endpoint="').concat(v,'",\n api_version="2024-02-01"\n)'):'import openai\n\nclient = openai.OpenAI(\n api_key="'.concat(b||"YOUR_LITELLM_API_KEY",'",\n base_url="').concat(v,'"\n)');switch(x){case a.KP.CHAT:{let e=Object.keys(A).length>0,n="";if(e){let e=JSON.stringify({metadata:A},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}let a=w.length>0?w:[{role:"user",content:y}];t='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.chat.completions.create(\n model="'.concat(S,'",\n messages=').concat(JSON.stringify(a,null,4)).concat(n,'\n)\n\nprint(response)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.chat.completions.create(\n# model="').concat(S,'",\n# messages=[\n# {\n# "role": "user",\n# "content": [\n# {\n# "type": "text",\n# "text": "').concat(N,'"\n# },\n# {\n# "type": "image_url",\n# "image_url": {\n# "url": f"data:image/jpeg;base64,{base64_file}" # or data:application/pdf;base64,{base64_file}\n# }\n# }\n# ]\n# }\n# ]').concat(n,"\n# )\n# print(response_with_file)\n");break}case a.KP.RESPONSES:{let e=Object.keys(A).length>0,n="";if(e){let e=JSON.stringify({metadata:A},null,2).split("\n").map(e=>" ".repeat(4)+e).join("\n").trim();n=",\n extra_body=".concat(e)}let a=w.length>0?w:[{role:"user",content:y}];t='\nimport base64\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# Example with text only\nresponse = client.responses.create(\n model="'.concat(S,'",\n input=').concat(JSON.stringify(a,null,4)).concat(n,'\n)\n\nprint(response.output_text)\n\n# Example with image or PDF (uncomment and provide file path to use)\n# base64_file = encode_image("path/to/your/file.jpg") # or .pdf\n# response_with_file = client.responses.create(\n# model="').concat(S,'",\n# input=[\n# {\n# "role": "user",\n# "content": [\n# {"type": "input_text", "text": "').concat(N,'"},\n# {\n# "type": "input_image",\n# "image_url": f"data:image/jpeg;base64,{base64_file}", # or data:application/pdf;base64,{base64_file}\n# },\n# ],\n# }\n# ]').concat(n,"\n# )\n# print(response_with_file.output_text)\n");break}case a.KP.IMAGE:t="azure"===f?"\n# NOTE: The Azure SDK does not have a direct equivalent to the multi-modal 'responses.create' method shown for OpenAI.\n# This snippet uses 'client.images.generate' and will create a new image based on your prompt.\n# It does not use the uploaded image, as 'client.images.generate' does not support image inputs in this context.\nimport os\nimport requests\nimport json\nimport time\nfrom PIL import Image\n\nresult = client.images.generate(\n model=\"".concat(S,'",\n prompt="').concat(i,'",\n n=1\n)\n\njson_response = json.loads(result.model_dump_json())\n\n# Set the directory for the stored image\nimage_dir = os.path.join(os.curdir, \'images\')\n\n# If the directory doesn\'t exist, create it\nif not os.path.isdir(image_dir):\n os.mkdir(image_dir)\n\n# Initialize the image path\nimage_filename = f"generated_image_{int(time.time())}.png"\nimage_path = os.path.join(image_dir, image_filename)\n\ntry:\n # Retrieve the generated image\n if json_response.get("data") && len(json_response["data"]) > 0 && json_response["data"][0].get("url"):\n image_url = json_response["data"][0]["url"]\n generated_image = requests.get(image_url).content\n with open(image_path, "wb") as image_file:\n image_file.write(generated_image)\n\n print(f"Image saved to {image_path}")\n # Display the image\n image = Image.open(image_path)\n image.show()\n else:\n print("Could not find image URL in response.")\n print("Full response:", json_response)\nexcept Exception as e:\n print(f"An error occurred: {e}")\n print("Full response:", json_response)\n'):"\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(N,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(S,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case a.KP.IMAGE_EDITS:t="azure"===f?'\nimport base64\nimport os\nimport time\nimport json\nfrom PIL import Image\nimport requests\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, "rb") as image_file:\n return base64.b64encode(image_file.read()).decode(\'utf-8\')\n\n# The prompt entered by the user\nprompt = "'.concat(N,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(S,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n'):"\nimport base64\nimport os\nimport time\n\n# Helper function to encode images to base64\ndef encode_image(image_path):\n with open(image_path, \"rb\") as image_file:\n return base64.b64encode(image_file.read()).decode('utf-8')\n\n# Helper function to create a file (simplified for this example)\ndef create_file(image_path):\n # In a real implementation, this would upload the file to OpenAI\n # For this example, we'll just return a placeholder ID\n return f\"file_{os.path.basename(image_path).replace('.', '_')}\"\n\n# The prompt entered by the user\nprompt = \"".concat(N,'"\n\n# Encode images to base64\nbase64_image1 = encode_image("body-lotion.png")\nbase64_image2 = encode_image("soap.png")\n\n# Create file IDs\nfile_id1 = create_file("body-lotion.png")\nfile_id2 = create_file("incense-kit.png")\n\nresponse = client.responses.create(\n model="').concat(S,'",\n input=[\n {\n "role": "user",\n "content": [\n {"type": "input_text", "text": prompt},\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image1}",\n },\n {\n "type": "input_image",\n "image_url": f"data:image/jpeg;base64,{base64_image2}",\n },\n {\n "type": "input_image",\n "file_id": file_id1,\n },\n {\n "type": "input_image",\n "file_id": file_id2,\n }\n ],\n }\n ],\n tools=[{"type": "image_generation"}],\n)\n\n# Process the response\nimage_generation_calls = [\n output\n for output in response.output\n if output.type == "image_generation_call"\n]\n\nimage_data = [output.result for output in image_generation_calls]\n\nif image_data:\n image_base64 = image_data[0]\n image_filename = f"edited_image_{int(time.time())}.png"\n with open(image_filename, "wb") as f:\n f.write(base64.b64decode(image_base64))\n print(f"Image saved to {image_filename}")\nelse:\n # If no image is generated, there might be a text response with an explanation\n text_response = [output.text for output in response.output if hasattr(output, \'text\')]\n if text_response:\n print("No image generated. Model response:")\n print("\\n".join(text_response))\n else:\n print("No image data found in response.")\n print("Full response for debugging:")\n print(response)\n');break;case a.KP.EMBEDDINGS:t='\nresponse = client.embeddings.create(\n input="'.concat(i||"Your string here",'",\n model="').concat(S,'",\n encoding_format="base64" # or "float"\n)\n\nprint(response.data[0].embedding)\n');break;case a.KP.TRANSCRIPTION:t='\n# Open the audio file\naudio_file = open("path/to/your/audio/file.mp3", "rb")\n\n# Make the transcription request\nresponse = client.audio.transcriptions.create(\n model="'.concat(S,'",\n file=audio_file').concat(i?',\n prompt="'.concat(i.replace(/"/g,'\\"'),'"'):"","\n)\n\nprint(response.text)\n");break;case a.KP.SPEECH:t='\n# Make the text-to-speech request\nresponse = client.audio.speech.create(\n model="'.concat(S,'",\n input="').concat(i||"Your text to convert to speech here",'",\n voice="').concat(g,'" # Options: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer\n)\n\n# Save the audio to a file\noutput_filename = "output_speech.mp3"\nresponse.stream_to_file(output_filename)\nprint(f"Audio saved to {output_filename}")\n\n# Optional: Customize response format and speed\n# response = client.audio.speech.create(\n# model="').concat(S,'",\n# input="').concat(i||"Your text to convert to speech here",'",\n# voice="alloy",\n# response_format="mp3", # Options: mp3, opus, aac, flac, wav, pcm\n# speed=1.0 # Range: 0.25 to 4.0\n# )\n# response.stream_to_file("output_speech.mp3")\n');break;default:t="\n# Code generation for this endpoint is not implemented yet."}return"".concat(C,"\n").concat(t)}},8443:function(e,t,n){var a,s,r,i;n.d(t,{KP:function(){return s},vf:function(){return o}}),(r=a||(a={})).AUDIO_SPEECH="audio_speech",r.AUDIO_TRANSCRIPTION="audio_transcription",r.IMAGE_GENERATION="image_generation",r.VIDEO_GENERATION="video_generation",r.CHAT="chat",r.RESPONSES="responses",r.IMAGE_EDITS="image_edits",r.ANTHROPIC_MESSAGES="anthropic_messages",r.EMBEDDING="embedding",(i=s||(s={})).IMAGE="image",i.VIDEO="video",i.CHAT="chat",i.RESPONSES="responses",i.IMAGE_EDITS="image_edits",i.ANTHROPIC_MESSAGES="anthropic_messages",i.EMBEDDINGS="embeddings",i.SPEECH="speech",i.TRANSCRIPTION="transcription",i.A2A_AGENTS="a2a_agents";let l={image_generation:"image",video_generation:"video",chat:"chat",responses:"responses",image_edits:"image_edits",anthropic_messages:"anthropic_messages",audio_speech:"speech",audio_transcription:"transcription",embedding:"embeddings"},o=e=>{if(console.log("getEndpointType:",e),Object.values(a).includes(e)){let t=l[e];return console.log("endpointType:",t),t}return"chat"}},42673:function(e,t,n){var a,s;n.d(t,{Cl:function(){return a},bK:function(){return d},cd:function(){return l},dr:function(){return o},fK:function(){return r},ph:function(){return c}}),(s=a||(a={})).A2A_Agent="A2A Agent",s.AIML="AI/ML API",s.Bedrock="Amazon Bedrock",s.Anthropic="Anthropic",s.AssemblyAI="AssemblyAI",s.SageMaker="AWS SageMaker",s.Azure="Azure",s.Azure_AI_Studio="Azure AI Foundry (Studio)",s.Cerebras="Cerebras",s.Cohere="Cohere",s.Dashscope="Dashscope",s.Databricks="Databricks (Qwen API)",s.DeepInfra="DeepInfra",s.Deepgram="Deepgram",s.Deepseek="Deepseek",s.ElevenLabs="ElevenLabs",s.FalAI="Fal AI",s.FireworksAI="Fireworks AI",s.Google_AI_Studio="Google AI Studio",s.GradientAI="GradientAI",s.Groq="Groq",s.Hosted_Vllm="vllm",s.Infinity="Infinity",s.JinaAI="Jina AI",s.MiniMax="MiniMax",s.MistralAI="Mistral AI",s.Ollama="Ollama",s.OpenAI="OpenAI",s.OpenAI_Compatible="OpenAI-Compatible Endpoints (Together AI, etc.)",s.OpenAI_Text="OpenAI Text Completion",s.OpenAI_Text_Compatible="OpenAI-Compatible Text Completion Models (Together AI, etc.)",s.Openrouter="Openrouter",s.Oracle="Oracle Cloud Infrastructure (OCI)",s.Perplexity="Perplexity",s.RunwayML="RunwayML",s.Sambanova="Sambanova",s.Snowflake="Snowflake",s.TogetherAI="TogetherAI",s.Triton="Triton",s.Vertex_AI="Vertex AI (Anthropic, Gemini, etc.)",s.VolcEngine="VolcEngine",s.Voyage="Voyage AI",s.xAI="xAI",s.SAP="SAP Generative AI Hub",s.Watsonx="Watsonx";let r={A2A_Agent:"a2a_agent",AIML:"aiml",OpenAI:"openai",OpenAI_Text:"text-completion-openai",Azure:"azure",Azure_AI_Studio:"azure_ai",Anthropic:"anthropic",Google_AI_Studio:"gemini",Bedrock:"bedrock",Groq:"groq",MiniMax:"minimax",MistralAI:"mistral",Cohere:"cohere",OpenAI_Compatible:"openai",OpenAI_Text_Compatible:"text-completion-openai",Vertex_AI:"vertex_ai",Databricks:"databricks",Dashscope:"dashscope",xAI:"xai",Deepseek:"deepseek",Ollama:"ollama",AssemblyAI:"assemblyai",Cerebras:"cerebras",Sambanova:"sambanova",Perplexity:"perplexity",RunwayML:"runwayml",TogetherAI:"together_ai",Openrouter:"openrouter",Oracle:"oci",Snowflake:"snowflake",FireworksAI:"fireworks_ai",GradientAI:"gradient_ai",Triton:"triton",Deepgram:"deepgram",ElevenLabs:"elevenlabs",FalAI:"fal_ai",SageMaker:"sagemaker_chat",Voyage:"voyage",JinaAI:"jina_ai",VolcEngine:"volcengine",DeepInfra:"deepinfra",Hosted_Vllm:"hosted_vllm",Infinity:"infinity",SAP:"sap",Watsonx:"watsonx"},i="../ui/assets/logos/",l={"A2A Agent":"".concat(i,"a2a_agent.png"),"AI/ML API":"".concat(i,"aiml_api.svg"),Anthropic:"".concat(i,"anthropic.svg"),AssemblyAI:"".concat(i,"assemblyai_small.png"),Azure:"".concat(i,"microsoft_azure.svg"),"Azure AI Foundry (Studio)":"".concat(i,"microsoft_azure.svg"),"Amazon Bedrock":"".concat(i,"bedrock.svg"),"AWS SageMaker":"".concat(i,"bedrock.svg"),Cerebras:"".concat(i,"cerebras.svg"),Cohere:"".concat(i,"cohere.svg"),"Databricks (Qwen API)":"".concat(i,"databricks.svg"),Dashscope:"".concat(i,"dashscope.svg"),Deepseek:"".concat(i,"deepseek.svg"),"Fireworks AI":"".concat(i,"fireworks.svg"),Groq:"".concat(i,"groq.svg"),"Google AI Studio":"".concat(i,"google.svg"),vllm:"".concat(i,"vllm.png"),Infinity:"".concat(i,"infinity.png"),MiniMax:"".concat(i,"minimax.svg"),"Mistral AI":"".concat(i,"mistral.svg"),Ollama:"".concat(i,"ollama.svg"),OpenAI:"".concat(i,"openai_small.svg"),"OpenAI Text Completion":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Text Completion Models (Together AI, etc.)":"".concat(i,"openai_small.svg"),"OpenAI-Compatible Endpoints (Together AI, etc.)":"".concat(i,"openai_small.svg"),Openrouter:"".concat(i,"openrouter.svg"),"Oracle Cloud Infrastructure (OCI)":"".concat(i,"oracle.svg"),Perplexity:"".concat(i,"perplexity-ai.svg"),RunwayML:"".concat(i,"runwayml.png"),Sambanova:"".concat(i,"sambanova.svg"),Snowflake:"".concat(i,"snowflake.svg"),TogetherAI:"".concat(i,"togetherai.svg"),"Vertex AI (Anthropic, Gemini, etc.)":"".concat(i,"google.svg"),xAI:"".concat(i,"xai.svg"),GradientAI:"".concat(i,"gradientai.svg"),Triton:"".concat(i,"nvidia_triton.png"),Deepgram:"".concat(i,"deepgram.png"),ElevenLabs:"".concat(i,"elevenlabs.png"),"Fal AI":"".concat(i,"fal_ai.jpg"),"Voyage AI":"".concat(i,"voyage.webp"),"Jina AI":"".concat(i,"jina.png"),VolcEngine:"".concat(i,"volcengine.png"),DeepInfra:"".concat(i,"deepinfra.png"),"SAP Generative AI Hub":"".concat(i,"sap.png")},o=e=>{if(!e)return{logo:"",displayName:"-"};if("gemini"===e.toLowerCase()){let e="Google AI Studio";return{logo:l[e],displayName:e}}let t=Object.keys(r).find(t=>r[t].toLowerCase()===e.toLowerCase());if(!t)return{logo:"",displayName:e};let n=a[t];return{logo:l[n],displayName:n}},c=e=>{if("AI/ML API"===e)return"aiml/flux-pro/v1.1";if("Vertex AI (Anthropic, Gemini, etc.)"===e)return"gemini-pro";if("Anthropic"==e||"Amazon Bedrock"==e)return"claude-3-opus";if("AWS SageMaker"==e)return"sagemaker/jumpstart-dft-meta-textgeneration-llama-2-7b";if("Google AI Studio"==e)return"gemini-pro";if("Azure AI Foundry (Studio)"==e)return"azure_ai/command-r-plus";else if("Azure"==e)return"my-deployment";else if("Oracle Cloud Infrastructure (OCI)"==e)return"oci/xai.grok-4";else if("Snowflake"==e)return"snowflake/mistral-7b";else if("Voyage AI"==e)return"voyage/";else if("Jina AI"==e)return"jina_ai/";else if("VolcEngine"==e)return"volcengine/";else if("DeepInfra"==e)return"deepinfra/";else if("Fal AI"==e)return"fal_ai/fal-ai/flux-pro/v1.1-ultra";else if("RunwayML"==e)return"runwayml/gen4_turbo";else if("Watsonx"===e)return"watsonx/ibm/granite-3-3-8b-instruct";else return"gpt-3.5-turbo"},d=(e,t)=>{console.log("Provider key: ".concat(e));let n=r[e];console.log("Provider mapped to: ".concat(n));let a=[];return e&&"object"==typeof t&&(Object.entries(t).forEach(e=>{let[t,s]=e;null!==s&&"object"==typeof s&&"litellm_provider"in s&&(s.litellm_provider===n||s.litellm_provider.includes(n))&&a.push(t)}),"Cohere"==e&&(console.log("Adding cohere chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"cohere_chat"===n.litellm_provider&&a.push(t)})),"AWS SageMaker"==e&&(console.log("Adding sagemaker chat models"),Object.entries(t).forEach(e=>{let[t,n]=e;null!==n&&"object"==typeof n&&"litellm_provider"in n&&"sagemaker_chat"===n.litellm_provider&&a.push(t)}))),a}},87526:function(e,t,n){n.d(t,{Z:function(){return C}});var a=n(57437),s=n(69734),r=n(3477),i=n(17732),l=n(78489),o=n(12514),c=n(84264),d=n(96761),m=n(65869),p=n(99981),u=n(3810),g=n(37592),x=n(22116),h=n(78867),f=n(33245),_=n(2265),b=n(8048),v=n(9114),j=n(92004),y=n(19250),N=n(82971),w=n(8443),A=n(42673);let{TabPane:S}=m.default;var C=e=>{var t,n,C,I,k;let{accessToken:Z,isEmbedded:E=!1}=e,[M,P]=(0,_.useState)(null),[O,T]=(0,_.useState)(null),[D,L]=(0,_.useState)(null),[z,R]=(0,_.useState)("LiteLLM Gateway"),[H,F]=(0,_.useState)(null),[G,U]=(0,_.useState)(""),[K,V]=(0,_.useState)({}),[B,W]=(0,_.useState)(!0),[q,Y]=(0,_.useState)(!0),[J,X]=(0,_.useState)(!0),[$,Q]=(0,_.useState)(""),[ee,et]=(0,_.useState)(""),[en,ea]=(0,_.useState)(""),[es,er]=(0,_.useState)([]),[ei,el]=(0,_.useState)([]),[eo,ec]=(0,_.useState)([]),[ed,em]=(0,_.useState)([]),[ep,eu]=(0,_.useState)([]),[eg,ex]=(0,_.useState)("I'm alive! ✓"),[eh,ef]=(0,_.useState)(!1),[e_,eb]=(0,_.useState)(!1),[ev,ej]=(0,_.useState)(!1),[ey,eN]=(0,_.useState)(null),[ew,eA]=(0,_.useState)(null),[eS,eC]=(0,_.useState)(null),[eI,ek]=(0,_.useState)({}),[eZ,eE]=(0,_.useState)("models");(0,_.useEffect)(()=>{(async()=>{try{await (0,y.getUiConfig)()}catch(e){console.error("Failed to get UI config:",e)}let e=async()=>{try{W(!0);let e=await (0,y.modelHubPublicModelsCall)();console.log("ModelHubData:",e),P(e)}catch(e){console.error("There was an error fetching the public model data",e),ex("Service unavailable")}finally{W(!1)}},t=async()=>{try{Y(!0);let e=await (0,y.agentHubPublicModelsCall)();console.log("AgentHubData:",e),T(e)}catch(e){console.error("There was an error fetching the public agent data",e)}finally{Y(!1)}},n=async()=>{try{X(!0);let e=await (0,y.mcpHubPublicServersCall)();console.log("MCPHubData:",e),L(e)}catch(e){console.error("There was an error fetching the public MCP server data",e)}finally{X(!1)}};(async()=>{let e=await (0,y.getPublicModelHubInfo)();console.log("Public Model Hub Info:",e),R(e.docs_title),F(e.custom_docs_description),U(e.litellm_version),V(e.useful_links||{})})(),e(),t(),n()})()},[]),(0,_.useEffect)(()=>{},[$,es,ei,eo]);let eM=(0,_.useMemo)(()=>{if(!M)return[];let e=M;if($.trim()){let t=$.toLowerCase(),n=t.split(/\s+/),a=M.filter(e=>{let a=e.model_group.toLowerCase();return!!a.includes(t)||n.every(e=>a.includes(e))});a.length>0&&(e=a.sort((e,n)=>{let a=e.model_group.toLowerCase(),s=n.model_group.toLowerCase(),r=a===t?1e3:0,i=s===t?1e3:0,l=a.startsWith(t)?100:0,o=s.startsWith(t)?100:0,c=t.split(/\s+/).every(e=>a.includes(e))?50:0,d=t.split(/\s+/).every(e=>s.includes(e))?50:0,m=a.length;return i+o+d+(1e3-s.length)-(r+l+c+(1e3-m))}))}return e.filter(e=>{let t=0===es.length||es.some(t=>e.providers.includes(t)),n=0===ei.length||ei.includes(e.mode||""),a=0===eo.length||Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).some(e=>{let[t]=e,n=t.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");return eo.includes(n)});return t&&n&&a})},[M,$,es,ei,eo]),eP=(0,_.useMemo)(()=>{if(!O)return[];let e=O;if(ee.trim()){let t=ee.toLowerCase(),n=t.split(/\s+/);e=(e=O.filter(e=>{let a=e.name.toLowerCase(),s=e.description.toLowerCase();return!!(a.includes(t)||s.includes(t))||n.every(e=>a.includes(e)||s.includes(e))})).sort((e,n)=>{let a=e.name.toLowerCase(),s=n.name.toLowerCase(),r=a===t?1e3:0,i=s===t?1e3:0,l=a.startsWith(t)?100:0,o=s.startsWith(t)?100:0,c=r+l+(1e3-a.length);return i+o+(1e3-s.length)-c})}return e.filter(e=>{var t;return 0===ed.length||(null===(t=e.skills)||void 0===t?void 0:t.some(e=>{var t;return null===(t=e.tags)||void 0===t?void 0:t.some(e=>ed.includes(e))}))})},[O,ee,ed]),eO=(0,_.useMemo)(()=>{if(!D)return[];let e=D;if(en.trim()){let t=en.toLowerCase(),n=t.split(/\s+/);e=(e=D.filter(e=>{var a;let s=e.server_name.toLowerCase(),r=((null===(a=e.mcp_info)||void 0===a?void 0:a.description)||"").toLowerCase();return!!(s.includes(t)||r.includes(t))||n.every(e=>s.includes(e)||r.includes(e))})).sort((e,n)=>{let a=e.server_name.toLowerCase(),s=n.server_name.toLowerCase(),r=a===t?1e3:0,i=s===t?1e3:0,l=a.startsWith(t)?100:0,o=s.startsWith(t)?100:0,c=r+l+(1e3-a.length);return i+o+(1e3-s.length)-c})}return e.filter(e=>0===ep.length||ep.includes(e.transport))},[D,en,ep]),eT=e=>{eN(e),ef(!0)},eD=e=>{eA(e),eb(!0)},eL=e=>{eC(e),ej(!0)},ez=e=>{navigator.clipboard.writeText(e),v.Z.success("Copied to clipboard!")},eR=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eH=e=>Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return t}),eF=e=>"$".concat((1e6*e).toFixed(4)),eG=e=>e?e>=1e3?"".concat((e/1e3).toFixed(0),"K"):e.toString():"N/A",eU=(e,t)=>{let n=[];return e&&n.push("RPM: ".concat(e.toLocaleString())),t&&n.push("TPM: ".concat(t.toLocaleString())),n.length>0?n.join(", "):"N/A"};return(0,a.jsx)(s.f,{accessToken:Z,children:(0,a.jsxs)("div",{className:E?"w-full":"min-h-screen bg-white",children:[!E&&(0,a.jsx)(j.Z,{userID:null,userEmail:null,userRole:null,premiumUser:!1,setProxySettings:ek,proxySettings:eI,accessToken:Z||null,isPublicPage:!0}),(0,a.jsxs)("div",{className:E?"w-full p-6":"w-full px-8 py-12",children:[E&&(0,a.jsx)("div",{className:"mb-6 p-4 bg-blue-50 border border-blue-200 rounded-lg",children:(0,a.jsx)("p",{className:"text-sm text-gray-700",children:"These are models, agents, and MCP servers your proxy admin has indicated are available in your company."})}),!E&&(0,a.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,a.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"About"}),(0,a.jsx)("p",{className:"text-gray-700 mb-6 text-base leading-relaxed",children:H||"Proxy Server to call 100+ LLMs in the OpenAI format."}),(0,a.jsx)("div",{className:"flex items-center space-x-3 text-sm text-gray-600",children:(0,a.jsxs)("span",{className:"flex items-center",children:[(0,a.jsx)("span",{className:"w-4 h-4 mr-2",children:"\uD83D\uDD27"}),"Built with litellm: v",G]})})]}),K&&Object.keys(K).length>0&&(0,a.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,a.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Useful Links"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Object.entries(K||{}).map(e=>{var t;let[n,a]=e;return{title:n,url:"string"==typeof a?a:a.url,index:"string"==typeof a?0:null!==(t=a.index)&&void 0!==t?t:0}}).sort((e,t)=>e.index-t.index).map(e=>{let{title:t,url:n}=e;return(0,a.jsxs)("button",{onClick:()=>window.open(n,"_blank"),className:"flex items-center space-x-3 text-blue-600 hover:text-blue-800 transition-colors p-3 rounded-lg hover:bg-blue-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"w-4 h-4"}),(0,a.jsx)(c.Z,{className:"text-sm font-medium",children:t})]},t)})})]}),!E&&(0,a.jsxs)(o.Z,{className:"mb-10 p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:[(0,a.jsx)(d.Z,{className:"text-2xl font-semibold mb-6 text-gray-900",children:"Health and Endpoint Status"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:(0,a.jsxs)(c.Z,{className:"text-green-600 font-medium text-sm",children:["Service status: ",eg]})})]}),(0,a.jsx)(o.Z,{className:"p-8 bg-white border border-gray-200 rounded-lg shadow-sm",children:(0,a.jsxs)(m.default,{activeKey:eZ,onChange:eE,size:"large",className:"public-hub-tabs",children:[(0,a.jsxs)(S,{tab:"Model Hub",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,a.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available Models"})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search Models:"}),(0,a.jsx)(p.Z,{title:"Smart search with relevance ranking - finds models containing your search terms, ranked by relevance. Try searching 'xai grok-4', 'claude-4', 'gpt-4', or 'sonnet'",placement:"top",children:(0,a.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(i.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,a.jsx)("input",{type:"text",placeholder:"Search model names... (smart search enabled)",value:$,onChange:e=>Q(e.target.value),className:"border border-gray-300 rounded-lg pl-10 pr-4 py-2 w-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Provider:"}),(0,a.jsx)(g.default,{mode:"multiple",value:es,onChange:e=>er(e),placeholder:"Select providers",className:"w-full",size:"large",allowClear:!0,optionRender:e=>{let{logo:t}=(0,A.dr)(e.value);return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,a.jsx)("img",{src:t,alt:e.label,className:"w-5 h-5 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{className:"capitalize",children:e.label})]})},children:M&&(e=>{let t=new Set;return e.forEach(e=>{e.providers.forEach(e=>t.add(e))}),Array.from(t)})(M).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Mode:"}),(0,a.jsx)(g.default,{mode:"multiple",value:ei,onChange:e=>el(e),placeholder:"Select modes",className:"w-full",size:"large",allowClear:!0,children:M&&(e=>{let t=new Set;return e.forEach(e=>{e.mode&&t.add(e.mode)}),Array.from(t)})(M).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Features:"}),(0,a.jsx)(g.default,{mode:"multiple",value:eo,onChange:e=>ec(e),placeholder:"Select features",className:"w-full",size:"large",allowClear:!0,children:M&&(e=>{let t=new Set;return e.forEach(e=>{Object.entries(e).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).forEach(e=>{let[n]=e,a=n.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");t.add(a)})}),Array.from(t).sort()})(M).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,a.jsx)(b.C,{columns:[{header:"Model Name",accessorKey:"model_group",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(p.Z,{title:t.original.model_group,children:(0,a.jsx)(l.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left",onClick:()=>eT(t.original),children:t.original.model_group})})})},size:150},{header:"Providers",accessorKey:"providers",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.providers;return(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>{let{logo:t}=(0,A.dr)(e);return(0,a.jsxs)("div",{className:"flex items-center space-x-1 px-2 py-1 bg-gray-100 rounded text-xs",children:[t&&(0,a.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{className:"capitalize",children:e})]},e)})})},size:120},{header:"Mode",accessorKey:"mode",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.mode;return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(e=>{switch(null==e?void 0:e.toLowerCase()){case"chat":return"\uD83D\uDCAC";case"rerank":return"\uD83D\uDD04";case"embedding":return"\uD83D\uDCC4";default:return"\uD83E\uDD16"}})(n||"")}),(0,a.jsx)(c.Z,{children:n||"Chat"})]})},size:100},{header:"Max Input",accessorKey:"max_input_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)(c.Z,{className:"text-center",children:eG(t.original.max_input_tokens)})},size:100,meta:{className:"text-center"}},{header:"Max Output",accessorKey:"max_output_tokens",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)(c.Z,{className:"text-center",children:eG(t.original.max_output_tokens)})},size:100,meta:{className:"text-center"}},{header:"Input $/1M",accessorKey:"input_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.input_cost_per_token;return(0,a.jsx)(c.Z,{className:"text-center",children:n?eF(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Output $/1M",accessorKey:"output_cost_per_token",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.output_cost_per_token;return(0,a.jsx)(c.Z,{className:"text-center",children:n?eF(n):"Free"})},size:100,meta:{className:"text-center"}},{header:"Features",accessorKey:"supports_vision",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original).filter(e=>{let[t,n]=e;return t.startsWith("supports_")&&!0===n}).map(e=>{let[t]=e;return eR(t)});return 0===n.length?(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"}):1===n.length?(0,a.jsx)("div",{className:"h-6 flex items-center",children:(0,a.jsx)(u.Z,{color:"blue",className:"text-xs",children:n[0]})}):(0,a.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,a.jsx)(u.Z,{color:"blue",className:"text-xs",children:n[0]}),(0,a.jsx)(p.Z,{title:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"font-medium",children:"All Features:"}),n.map((e,t)=>(0,a.jsxs)("div",{className:"text-xs",children:["• ",e]},t))]}),trigger:"click",placement:"topLeft",children:(0,a.jsxs)("span",{className:"text-xs text-blue-600 cursor-pointer hover:text-blue-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:120},{header:"Limits",accessorKey:"rpm",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original;return(0,a.jsx)(c.Z,{className:"text-xs text-gray-600",children:eU(n.rpm,n.tpm)})},size:150}],data:eM,isLoading:B,defaultSorting:[{id:"model_group",desc:!1}]}),(0,a.jsx)("div",{className:"mt-8 text-center",children:(0,a.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eM.length," of ",(null==M?void 0:M.length)||0," models"]})})]},"models"),O&&O.length>0&&(0,a.jsxs)(S,{tab:"Agent Hub",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,a.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available Agents"})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search Agents:"}),(0,a.jsx)(p.Z,{title:"Search agents by name or description",placement:"top",children:(0,a.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(i.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,a.jsx)("input",{type:"text",placeholder:"Search agent names or descriptions...",value:ee,onChange:e=>et(e.target.value),className:"border border-gray-300 rounded-lg pl-10 pr-4 py-2 w-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Skills:"}),(0,a.jsx)(g.default,{mode:"multiple",value:ed,onChange:e=>em(e),placeholder:"Select skills",className:"w-full",size:"large",allowClear:!0,children:O&&(e=>{let t=new Set;return e.forEach(e=>{var n;null===(n=e.skills)||void 0===n||n.forEach(e=>{var n;null===(n=e.tags)||void 0===n||n.forEach(e=>t.add(e))})}),Array.from(t).sort()})(O).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,a.jsx)(b.C,{columns:[{header:"Agent Name",accessorKey:"name",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(p.Z,{title:t.original.name,children:(0,a.jsx)(l.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left",onClick:()=>eD(t.original),children:t.original.name})})})},size:150},{header:"Description",accessorKey:"description",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.description,s=n.length>80?n.substring(0,80)+"...":n;return(0,a.jsx)(p.Z,{title:n,children:(0,a.jsx)(c.Z,{className:"text-sm text-gray-700",children:s})})},size:250},{header:"Version",accessorKey:"version",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)(c.Z,{className:"text-sm",children:t.original.version})},size:80},{header:"Provider",accessorKey:"provider",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.provider;return n?(0,a.jsx)("div",{className:"text-sm",children:(0,a.jsx)(c.Z,{className:"font-medium",children:n.organization})}):(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"})},size:120},{header:"Skills",accessorKey:"skills",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.skills||[];return 0===n.length?(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"}):1===n.length?(0,a.jsx)("div",{className:"h-6 flex items-center",children:(0,a.jsx)(u.Z,{color:"purple",className:"text-xs",children:n[0].name})}):(0,a.jsxs)("div",{className:"h-6 flex items-center space-x-1",children:[(0,a.jsx)(u.Z,{color:"purple",className:"text-xs",children:n[0].name}),(0,a.jsx)(p.Z,{title:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"font-medium",children:"All Skills:"}),n.map((e,t)=>(0,a.jsxs)("div",{className:"text-xs",children:["• ",e.name]},t))]}),trigger:"click",placement:"topLeft",children:(0,a.jsxs)("span",{className:"text-xs text-purple-600 cursor-pointer hover:text-purple-800 hover:underline",onClick:e=>e.stopPropagation(),children:["+",n.length-1]})})]})},size:150},{header:"Capabilities",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:t}=e,n=Object.entries(t.original.capabilities||{}).filter(e=>{let[t,n]=e;return!0===n}).map(e=>{let[t]=e;return t});return 0===n.length?(0,a.jsx)(c.Z,{className:"text-gray-400",children:"-"}):(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:n.map(e=>(0,a.jsx)(u.Z,{color:"green",className:"text-xs capitalize",children:e},e))})},size:150}],data:eP,isLoading:q,defaultSorting:[{id:"name",desc:!1}]}),(0,a.jsx)("div",{className:"mt-8 text-center",children:(0,a.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eP.length," of ",(null==O?void 0:O.length)||0," agents"]})})]},"agents"),D&&D.length>0&&(0,a.jsxs)(S,{tab:"MCP Hub",children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-8",children:(0,a.jsx)(d.Z,{className:"text-2xl font-semibold text-gray-900",children:"Available MCP Servers"})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium text-gray-700",children:"Search MCP Servers:"}),(0,a.jsx)(p.Z,{title:"Search MCP servers by name or description",placement:"top",children:(0,a.jsx)(f.Z,{className:"w-4 h-4 text-gray-400 cursor-help"})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(i.Z,{className:"w-4 h-4 text-gray-400 absolute left-3 top-1/2 transform -translate-y-1/2"}),(0,a.jsx)("input",{type:"text",placeholder:"Search MCP server names or descriptions...",value:en,onChange:e=>ea(e.target.value),className:"border border-gray-300 rounded-lg pl-10 pr-4 py-2 w-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-3 text-gray-700",children:"Transport:"}),(0,a.jsx)(g.default,{mode:"multiple",value:ep,onChange:e=>eu(e),placeholder:"Select transport types",className:"w-full",size:"large",allowClear:!0,children:D&&(e=>{let t=new Set;return e.forEach(e=>{e.transport&&t.add(e.transport)}),Array.from(t).sort()})(D).map(e=>(0,a.jsx)(g.default.Option,{value:e,children:e},e))})]})]}),(0,a.jsx)(b.C,{columns:[{header:"Server Name",accessorKey:"server_name",enableSorting:!0,cell:e=>{let{row:t}=e;return(0,a.jsx)("div",{className:"overflow-hidden",children:(0,a.jsx)(p.Z,{title:t.original.server_name,children:(0,a.jsx)(l.Z,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left",onClick:()=>eL(t.original),children:t.original.server_name})})})},size:150},{header:"Description",accessorKey:"mcp_info.description",enableSorting:!1,cell:e=>{var t;let{row:n}=e,s=(null===(t=n.original.mcp_info)||void 0===t?void 0:t.description)||"-",r=s.length>80?s.substring(0,80)+"...":s;return(0,a.jsx)(p.Z,{title:s,children:(0,a.jsx)(c.Z,{className:"text-sm text-gray-700",children:r})})},size:250},{header:"URL",accessorKey:"url",enableSorting:!1,cell:e=>{let{row:t}=e,n=t.original.url,s=n.length>40?n.substring(0,40)+"...":n;return(0,a.jsx)(p.Z,{title:n,children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(c.Z,{className:"text-xs font-mono",children:s}),(0,a.jsx)(h.Z,{onClick:()=>ez(n),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-3 h-3"})]})})},size:200},{header:"Transport",accessorKey:"transport",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.transport;return(0,a.jsx)(u.Z,{color:"blue",className:"text-xs uppercase",children:n})},size:100},{header:"Auth Type",accessorKey:"auth_type",enableSorting:!0,cell:e=>{let{row:t}=e,n=t.original.auth_type;return(0,a.jsx)(u.Z,{color:"none"===n?"gray":"green",className:"text-xs capitalize",children:n})},size:100}],data:eO,isLoading:J,defaultSorting:[{id:"server_name",desc:!1}]}),(0,a.jsx)("div",{className:"mt-8 text-center",children:(0,a.jsxs)(c.Z,{className:"text-sm text-gray-600",children:["Showing ",eO.length," of ",(null==D?void 0:D.length)||0," MCP servers"]})})]},"mcp")]})})]}),(0,a.jsx)(x.Z,{title:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(null==ey?void 0:ey.model_group)||"Model Details"}),ey&&(0,a.jsx)(p.Z,{title:"Copy model name",children:(0,a.jsx)(h.Z,{onClick:()=>ez(ey.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:eh,footer:null,onOk:()=>{ef(!1),eN(null)},onCancel:()=>{ef(!1),eN(null)},children:ey&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Model Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Model Name:"}),(0,a.jsx)(c.Z,{children:ey.model_group})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Mode:"}),(0,a.jsx)(c.Z,{children:ey.mode||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Providers:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:ey.providers.map(e=>{let{logo:t}=(0,A.dr)(e);return(0,a.jsx)(u.Z,{color:"blue",children:(0,a.jsxs)("div",{className:"flex items-center space-x-1",children:[t&&(0,a.jsx)("img",{src:t,alt:e,className:"w-3 h-3 flex-shrink-0 object-contain",onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("span",{className:"capitalize",children:e})]})},e)})})]})]}),ey.model_group.includes("*")&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-4",children:(0,a.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,a.jsx)(f.Z,{className:"w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium text-blue-900 mb-2",children:"Wildcard Routing"}),(0,a.jsxs)(c.Z,{className:"text-sm text-blue-800 mb-2",children:["This model uses wildcard routing. You can pass any value where you see the"," ",(0,a.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:"*"})," symbol."]}),(0,a.jsxs)(c.Z,{className:"text-sm text-blue-800",children:["For example, with"," ",(0,a.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:ey.model_group}),", you can use any string (",(0,a.jsx)("code",{className:"bg-blue-100 px-1 py-0.5 rounded text-xs",children:ey.model_group.replace("*","my-custom-value")}),") that matches this pattern."]})]})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Token & Cost Information"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Max Input Tokens:"}),(0,a.jsx)(c.Z,{children:(null===(t=ey.max_input_tokens)||void 0===t?void 0:t.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Max Output Tokens:"}),(0,a.jsx)(c.Z,{children:(null===(n=ey.max_output_tokens)||void 0===n?void 0:n.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,a.jsx)(c.Z,{children:ey.input_cost_per_token?eF(ey.input_cost_per_token):"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,a.jsx)(c.Z,{children:ey.output_cost_per_token?eF(ey.output_cost_per_token):"Not specified"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=eH(ey),t=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,a.jsx)(c.Z,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,n)=>(0,a.jsx)(u.Z,{color:t[n%t.length],children:eR(e)},e))})()})]}),(ey.tpm||ey.rpm)&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[ey.tpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Tokens per Minute:"}),(0,a.jsx)(c.Z,{children:ey.tpm.toLocaleString()})]}),ey.rpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Requests per Minute:"}),(0,a.jsx)(c.Z,{children:ey.rpm.toLocaleString()})]})]})]}),ey.supported_openai_params&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:ey.supported_openai_params.map(e=>(0,a.jsx)(u.Z,{color:"green",children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-sm",children:(0,N.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],selectedMCPServers:[],endpointType:(0,w.vf)(ey.mode||"chat"),selectedModel:ey.model_group,selectedSdk:"openai"})})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{ez((0,N.L)({apiKeySource:"custom",accessToken:null,apiKey:"your_api_key",inputMessage:"Hello, how are you?",chatHistory:[{role:"user",content:"Hello, how are you?",isImage:!1}],selectedTags:[],selectedVectorStores:[],selectedGuardrails:[],selectedMCPServers:[],endpointType:(0,w.vf)(ey.mode||"chat"),selectedModel:ey.model_group,selectedSdk:"openai"}))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})}),(0,a.jsx)(x.Z,{title:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(null==ew?void 0:ew.name)||"Agent Details"}),ew&&(0,a.jsx)(p.Z,{title:"Copy agent name",children:(0,a.jsx)(h.Z,{onClick:()=>ez(ew.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:e_,footer:null,onOk:()=>{eb(!1),eA(null)},onCancel:()=>{eb(!1),eA(null)},children:ew&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Agent Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Name:"}),(0,a.jsx)(c.Z,{children:ew.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Version:"}),(0,a.jsx)(c.Z,{children:ew.version})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Description:"}),(0,a.jsx)(c.Z,{children:ew.description})]}),ew.url&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"URL:"}),(0,a.jsx)("a",{href:ew.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all",children:ew.url})]})]})]}),ew.capabilities&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(ew.capabilities).filter(e=>{let[t,n]=e;return!0===n}).map(e=>{let[t]=e;return(0,a.jsx)(u.Z,{color:"green",className:"capitalize",children:t},t)})})]}),ew.skills&&ew.skills.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,a.jsx)("div",{className:"space-y-4",children:ew.skills.map((e,t)=>(0,a.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,a.jsx)("div",{className:"flex items-start justify-between mb-2",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium text-base",children:e.name}),(0,a.jsx)(c.Z,{className:"text-sm text-gray-600",children:e.description})]})}),e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:e.tags.map(e=>(0,a.jsx)(u.Z,{color:"purple",className:"text-xs",children:e},e))})]},t))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Input/Output Modes"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Input Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:null===(C=ew.defaultInputModes)||void 0===C?void 0:C.map(e=>(0,a.jsx)(u.Z,{color:"blue",children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Output Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:null===(I=ew.defaultOutputModes)||void 0===I?void 0:I.map(e=>(0,a.jsx)(u.Z,{color:"blue",children:e},e))})]})]})]}),ew.documentationUrl&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Documentation"}),(0,a.jsxs)("a",{href:ew.documentationUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 flex items-center space-x-2",children:[(0,a.jsx)(r.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"View Documentation"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example (A2A Protocol)"}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 1: Retrieve Agent Card"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-xs",children:"base_url = '".concat(ew.url,"'\n\nresolver = A2ACardResolver(\n httpx_client=httpx_client,\n base_url=base_url,\n # agent_card_path uses default, extended_agent_card_path also uses default\n)\n\n# Fetch Public Agent Card and Initialize Client\nfinal_agent_card_to_use: AgentCard | None = None\n_public_card = (\n await resolver.get_agent_card()\n) # Fetches from default public path - `/agents/{agent_id}/`\nfinal_agent_card_to_use = _public_card\n\nif _public_card.supports_authenticated_extended_card:\n try:\n auth_headers_dict = {\n 'Authorization': 'Bearer dummy-token-for-extended-card'\n }\n _extended_card = await resolver.get_agent_card(\n relative_card_path=EXTENDED_AGENT_CARD_PATH,\n http_kwargs={'headers': auth_headers_dict},\n )\n final_agent_card_to_use = (\n _extended_card # Update to use the extended card\n )\n except Exception as e_extended:\n logger.warning(\n f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',\n exc_info=True,\n )")})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{ez("from a2a.client import A2ACardResolver, A2AClient\nfrom a2a.types import (\n AgentCard,\n MessageSendParams,\n SendMessageRequest,\n SendStreamingMessageRequest,\n)\nfrom a2a.utils.constants import (\n AGENT_CARD_WELL_KNOWN_PATH,\n EXTENDED_AGENT_CARD_PATH,\n)\n\nbase_url = '".concat(ew.url,"'\n\nresolver = A2ACardResolver(\n httpx_client=httpx_client,\n base_url=base_url,\n # agent_card_path uses default, extended_agent_card_path also uses default\n)\n\n# Fetch Public Agent Card and Initialize Client\nfinal_agent_card_to_use: AgentCard | None = None\n_public_card = (\n await resolver.get_agent_card()\n) # Fetches from default public path - `/agents/{agent_id}/`\nfinal_agent_card_to_use = _public_card\n\nif _public_card.supports_authenticated_extended_card:\n try:\n auth_headers_dict = {\n 'Authorization': 'Bearer dummy-token-for-extended-card'\n }\n _extended_card = await resolver.get_agent_card(\n relative_card_path=EXTENDED_AGENT_CARD_PATH,\n http_kwargs={'headers': auth_headers_dict},\n )\n final_agent_card_to_use = (\n _extended_card # Update to use the extended card\n )\n except Exception as e_extended:\n logger.warning(\n f'Failed to fetch extended agent card: {e_extended}. Will proceed with public card.',\n exc_info=True,\n )"))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-sm font-medium mb-2 text-gray-700",children:"Step 2: Call the Agent"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-xs",children:"client = A2AClient(\n httpx_client=httpx_client, agent_card=final_agent_card_to_use\n)\n\nsend_message_payload: dict[str, Any] = {\n 'message': {\n 'role': 'user',\n 'parts': [\n {'kind': 'text', 'text': 'how much is 10 USD in INR?'}\n ],\n 'messageId': uuid4().hex,\n },\n}\nrequest = SendMessageRequest(\n id=str(uuid4()), params=MessageSendParams(**send_message_payload)\n)\n\nresponse = await client.send_message(request)\nprint(response.model_dump(mode='json', exclude_none=True))"})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{ez("client = A2AClient(\n httpx_client=httpx_client, agent_card=final_agent_card_to_use\n)\n\nsend_message_payload: dict[str, Any] = {\n 'message': {\n 'role': 'user',\n 'parts': [\n {'kind': 'text', 'text': 'how much is 10 USD in INR?'}\n ],\n 'messageId': uuid4().hex,\n },\n}\nrequest = SendMessageRequest(\n id=str(uuid4()), params=MessageSendParams(**send_message_payload)\n)\n\nresponse = await client.send_message(request)\nprint(response.model_dump(mode='json', exclude_none=True))")},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})]})}),(0,a.jsx)(x.Z,{title:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{children:(null==eS?void 0:eS.server_name)||"MCP Server Details"}),eS&&(0,a.jsx)(p.Z,{title:"Copy server name",children:(0,a.jsx)(h.Z,{onClick:()=>ez(eS.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 w-4 h-4"})})]}),width:1e3,open:ev,footer:null,onOk:()=>{ej(!1),eC(null)},onCancel:()=>{ej(!1),eC(null)},children:eS&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Server Overview"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Server Name:"}),(0,a.jsx)(c.Z,{children:eS.server_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Transport:"}),(0,a.jsx)(u.Z,{color:"blue",children:eS.transport})]}),eS.alias&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Alias:"}),(0,a.jsx)(c.Z,{children:eS.alias})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Auth Type:"}),(0,a.jsx)(u.Z,{color:"none"===eS.auth_type?"gray":"green",children:eS.auth_type})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"Description:"}),(0,a.jsx)(c.Z,{children:(null===(k=eS.mcp_info)||void 0===k?void 0:k.description)||"-"})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(c.Z,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("a",{href:eS.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-sm break-all flex items-center space-x-2",children:[(0,a.jsx)("span",{children:eS.url}),(0,a.jsx)(r.Z,{className:"w-4 h-4"})]})]})]})]}),eS.mcp_info&&Object.keys(eS.mcp_info).length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Additional Information"}),(0,a.jsx)("div",{className:"bg-gray-50 p-4 rounded-lg",children:(0,a.jsx)("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(eS.mcp_info,null,2)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(c.Z,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)("div",{className:"bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto",children:(0,a.jsx)("pre",{className:"text-sm",children:'# Using MCP Server with Python FastMCP\n\nfrom fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eS.server_name,'": {\n "url": "http://localhost:4000/').concat(eS.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())')})}),(0,a.jsx)("div",{className:"mt-2 text-right",children:(0,a.jsx)("button",{onClick:()=>{ez('# Using MCP Server with Python FastMCP\n\nfrom fastmcp import Client\nimport asyncio\n\n# Standard MCP configuration\nconfig = {\n "mcpServers": {\n "'.concat(eS.server_name,'": {\n "url": "http://localhost:4000/').concat(eS.server_name,'/mcp",\n "headers": {\n "x-litellm-api-key": "Bearer sk-1234"\n }\n }\n }\n}\n\n# Create a client that connects to the server\nclient = Client(config)\n\nasync def main():\n async with client:\n # List available tools\n tools = await client.list_tools()\n print(f"Available tools: {[tool.name for tool in tools]}")\n\n # Call a tool\n response = await client.call_tool(\n name="tool_name", \n arguments={"arg": "value"}\n )\n print(f"Response: {response}")\n\nif __name__ == "__main__":\n asyncio.run(main())'))},className:"text-sm text-blue-600 hover:text-blue-800 cursor-pointer",children:"Copy to clipboard"})})]})]})})]})})}},69734:function(e,t,n){n.d(t,{F:function(){return l},f:function(){return o}});var a=n(57437),s=n(2265),r=n(19250);let i=(0,s.createContext)(void 0),l=()=>{let e=(0,s.useContext)(i);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},o=e=>{let{children:t,accessToken:n}=e,[l,o]=(0,s.useState)(null);return(0,s.useEffect)(()=>{(async()=>{try{let t=(0,r.getProxyBaseUrl)(),n=await fetch(t?"".concat(t,"/get/ui_theme_settings"):"/get/ui_theme_settings",{method:"GET",headers:{"Content-Type":"application/json"}});if(n.ok){var e;let t=await n.json();(null===(e=t.values)||void 0===e?void 0:e.logo_url)&&o(t.values.logo_url)}}catch(e){console.warn("Failed to load logo settings from backend:",e)}})()},[]),(0,a.jsx)(i.Provider,{value:{logoUrl:l,setLogoUrl:o},children:t})}},9245:function(e,t,n){n.d(t,{D$:function(){return i},Qg:function(){return a},e8:function(){return l},le:function(){return r},nO:function(){return s}});let a="local-storage-change";function s(e){window.dispatchEvent(new CustomEvent(a,{detail:{key:e}}))}function r(e){try{return window.localStorage.getItem(e)}catch(t){return console.warn('Error reading localStorage key "'.concat(e,'":'),t),null}}function i(e,t){try{window.localStorage.setItem(e,t)}catch(t){console.warn('Error setting localStorage key "'.concat(e,'":'),t)}}function l(e){try{window.localStorage.removeItem(e)}catch(t){console.warn('Error removing localStorage key "'.concat(e,'":'),t)}}},91624:function(e,t,n){n.d(t,{C:function(){return s}});var a=n(19250);let s=async e=>{if(!e)return null;try{return await (0,a.getProxyUISettings)(e)}catch(e){return console.error("Error fetching proxy settings:",e),null}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/789-d313fdf35e0f5eb6.js b/litellm/proxy/_experimental/out/_next/static/chunks/789-d313fdf35e0f5eb6.js deleted file mode 100644 index 88cc022382d..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/789-d313fdf35e0f5eb6.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[789],{69993:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(1119),o=t(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},i=t(55015),d=o.forwardRef(function(e,r){return o.createElement(i.Z,(0,n.Z)({},e,{ref:r,icon:a}))})},47323:function(e,r,t){"use strict";t.d(r,{Z:function(){return g}});var n=t(5853),o=t(2265),a=t(47187),i=t(7084),d=t(13241),l=t(1153),c=t(26898);let s={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},u={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},f={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},m=(e,r)=>{switch(e){case"simple":return{textColor:r?(0,l.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:r?(0,l.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,d.q)((0,l.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:r?(0,l.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,d.q)((0,l.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:r?(0,l.bM)(r,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:r?(0,d.q)((0,l.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:r?(0,l.bM)(r,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,d.q)((0,l.bM)(r,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:r?(0,l.bM)(r,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:r?(0,d.q)((0,l.bM)(r,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},b=(0,l.fn)("Icon"),g=o.forwardRef((e,r)=>{let{icon:t,variant:c="simple",tooltip:g,size:p=i.u8.SM,color:h,className:v}=e,w=(0,n._T)(e,["icon","variant","tooltip","size","color","className"]),k=m(c,h),{tooltipProps:x,getReferenceProps:C}=(0,a.l)();return o.createElement("span",Object.assign({ref:(0,l.lq)([r,x.refs.setReference]),className:(0,d.q)(b("root"),"inline-flex shrink-0 items-center justify-center",k.bgColor,k.textColor,k.borderColor,k.ringColor,f[c].rounded,f[c].border,f[c].shadow,f[c].ring,s[p].paddingX,s[p].paddingY,v)},C,w),o.createElement(a.Z,Object.assign({text:g},x)),o.createElement(t,{className:(0,d.q)(b("icon"),"shrink-0",u[p].height,u[p].width)}))});g.displayName="Icon"},49804:function(e,r,t){"use strict";t.d(r,{Z:function(){return c}});var n=t(5853),o=t(13241),a=t(1153),i=t(2265),d=t(9496);let l=(0,a.fn)("Col"),c=i.forwardRef((e,r)=>{let{numColSpan:t=1,numColSpanSm:a,numColSpanMd:c,numColSpanLg:s,children:u,className:f}=e,m=(0,n._T)(e,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),b=(e,r)=>e&&Object.keys(r).includes(String(e))?r[e]:"";return i.createElement("div",Object.assign({ref:r,className:(0,o.q)(l("root"),(()=>{let e=b(t,d.PT),r=b(a,d.SP),n=b(c,d.VS),i=b(s,d._w);return(0,o.q)(e,r,n,i)})(),f)},m),u)});c.displayName="Col"},21626:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),a=t(13241);let i=(0,t(1153).fn)("Table"),d=o.forwardRef((e,r)=>{let{children:t,className:d}=e,l=(0,n._T)(e,["children","className"]);return o.createElement("div",{className:(0,a.q)(i("root"),"overflow-auto",d)},o.createElement("table",Object.assign({ref:r,className:(0,a.q)(i("table"),"w-full text-tremor-default","text-tremor-content","dark:text-dark-tremor-content")},l),t))});d.displayName="Table"},97214:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),a=t(13241);let i=(0,t(1153).fn)("TableBody"),d=o.forwardRef((e,r)=>{let{children:t,className:d}=e,l=(0,n._T)(e,["children","className"]);return o.createElement(o.Fragment,null,o.createElement("tbody",Object.assign({ref:r,className:(0,a.q)(i("root"),"align-top divide-y","divide-tremor-border","dark:divide-dark-tremor-border",d)},l),t))});d.displayName="TableBody"},28241:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),a=t(13241);let i=(0,t(1153).fn)("TableCell"),d=o.forwardRef((e,r)=>{let{children:t,className:d}=e,l=(0,n._T)(e,["children","className"]);return o.createElement(o.Fragment,null,o.createElement("td",Object.assign({ref:r,className:(0,a.q)(i("root"),"align-middle whitespace-nowrap text-left p-4",d)},l),t))});d.displayName="TableCell"},58834:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),a=t(13241);let i=(0,t(1153).fn)("TableHead"),d=o.forwardRef((e,r)=>{let{children:t,className:d}=e,l=(0,n._T)(e,["children","className"]);return o.createElement(o.Fragment,null,o.createElement("thead",Object.assign({ref:r,className:(0,a.q)(i("root"),"text-left","text-tremor-content","dark:text-dark-tremor-content",d)},l),t))});d.displayName="TableHead"},69552:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),a=t(13241);let i=(0,t(1153).fn)("TableHeaderCell"),d=o.forwardRef((e,r)=>{let{children:t,className:d}=e,l=(0,n._T)(e,["children","className"]);return o.createElement(o.Fragment,null,o.createElement("th",Object.assign({ref:r,className:(0,a.q)(i("root"),"whitespace-nowrap text-left font-semibold top-0 px-4 py-3.5","text-tremor-content-strong","dark:text-dark-tremor-content-strong",d)},l),t))});d.displayName="TableHeaderCell"},71876:function(e,r,t){"use strict";t.d(r,{Z:function(){return d}});var n=t(5853),o=t(2265),a=t(13241);let i=(0,t(1153).fn)("TableRow"),d=o.forwardRef((e,r)=>{let{children:t,className:d}=e,l=(0,n._T)(e,["children","className"]);return o.createElement(o.Fragment,null,o.createElement("tr",Object.assign({ref:r,className:(0,a.q)(i("row"),d)},l),t))});d.displayName="TableRow"},23910:function(e,r,t){var n=t(74288).Symbol;e.exports=n},54506:function(e,r,t){var n=t(23910),o=t(4479),a=t(80910),i=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},41087:function(e,r,t){var n=t(5035),o=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(o,""):e}},17071:function(e,r,t){var n="object"==typeof t.g&&t.g&&t.g.Object===Object&&t.g;e.exports=n},4479:function(e,r,t){var n=t(23910),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,d=n?n.toStringTag:void 0;e.exports=function(e){var r=a.call(e,d),t=e[d];try{e[d]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(r?e[d]=t:delete e[d]),o}},80910:function(e){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},74288:function(e,r,t){var n=t(17071),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},5035:function(e){var r=/\s/;e.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}},7310:function(e,r,t){var n=t(28302),o=t(11121),a=t(6660),i=Math.max,d=Math.min;e.exports=function(e,r,t){var l,c,s,u,f,m,b=0,g=!1,p=!1,h=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(r){var t=l,n=c;return l=c=void 0,b=r,u=e.apply(n,t)}function w(e){var t=e-m,n=e-b;return void 0===m||t>=r||t<0||p&&n>=s}function k(){var e,t,n,a=o();if(w(a))return x(a);f=setTimeout(k,(e=a-m,t=a-b,n=r-e,p?d(n,s-t):n))}function x(e){return(f=void 0,h&&l)?v(e):(l=c=void 0,u)}function C(){var e,t=o(),n=w(t);if(l=arguments,c=this,m=t,n){if(void 0===f)return b=e=m,f=setTimeout(k,r),g?v(e):u;if(p)return clearTimeout(f),f=setTimeout(k,r),v(m)}return void 0===f&&(f=setTimeout(k,r)),u}return r=a(r)||0,n(t)&&(g=!!t.leading,s=(p="maxWait"in t)?i(a(t.maxWait)||0,r):s,h="trailing"in t?!!t.trailing:h),C.cancel=function(){void 0!==f&&clearTimeout(f),b=0,l=m=c=f=void 0},C.flush=function(){return void 0===f?u:x(o())},C}},28302:function(e){e.exports=function(e){var r=typeof e;return null!=e&&("object"==r||"function"==r)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,r,t){var n=t(54506),o=t(10303);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},11121:function(e,r,t){var n=t(74288);e.exports=function(){return n.Date.now()}},6660:function(e,r,t){var n=t(41087),o=t(28302),a=t(78371),i=0/0,d=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return i;if(o(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=o(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var t=l.test(e);return t||c.test(e)?s(e.slice(2),t?2:8):d.test(e)?i:+e}},32489:function(e,r,t){"use strict";t.d(r,{Z:function(){return n}});let n=(0,t(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},91777:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});r.Z=o},44633:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});r.Z=o},82182:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});r.Z=o},53410:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"}))});r.Z=o},93416:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});r.Z=o},77355:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});r.Z=o},22452:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});r.Z=o},49084:function(e,r,t){"use strict";var n=t(2265);let o=n.forwardRef(function(e,r){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});r.Z=o}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8049-4d78caf73638c2f1.js b/litellm/proxy/_experimental/out/_next/static/chunks/8049-4d78caf73638c2f1.js deleted file mode 100644 index f72c3faba1f..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8049-4d78caf73638c2f1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8049],{31283:function(e,t,o){o.d(t,{o:function(){return a.Z}});var a=o(49566)},63610:function(e,t,o){o.d(t,{d:function(){return g}});var a=o(57437),r=o(2265),n=o(4260),c=o(37592),l=o(19015),i=o(10032),s=o(31283),d=o(15424),u=o(99981),h=o(19250),p=o(9309);let g=["metadata","config","enforced_params","aliases"],f=(e,t)=>g.includes(e)||"json"===t.format,m=e=>{if(!e)return!0;try{return JSON.parse(e),!0}catch(e){return!1}},w=(e,t,o)=>{let a={max_budget:"Enter maximum budget in USD (e.g., 100.50)",budget_duration:"Select a time period for budget reset",tpm_limit:"Enter maximum tokens per minute (whole number)",rpm_limit:"Enter maximum requests per minute (whole number)",duration:"Enter duration (e.g., 30s, 24h, 7d)",metadata:'Enter JSON object with key-value pairs\nExample: {"team": "research", "project": "nlp"}',config:'Enter configuration as JSON object\nExample: {"setting": "value"}',permissions:"Enter comma-separated permission strings",enforced_params:'Enter parameters as JSON object\nExample: {"param": "value"}',blocked:"Enter true/false or specific block conditions",aliases:'Enter aliases as JSON object\nExample: {"alias1": "value1", "alias2": "value2"}',models:"Select one or more model names",key_alias:"Enter a unique identifier for this key",tags:"Enter comma-separated tag strings"}[e]||({string:"Text input",number:"Numeric input",integer:"Whole number input",boolean:"True/False value"})[o]||"Text input";return f(e,t)?"".concat(a,"\nMust be valid JSON format"):t.enum?"Select from available options\nAllowed values: ".concat(t.enum.join(", ")):a};t.Z=e=>{let{schemaComponent:t,excludedFields:o=[],form:g,overrideLabels:y={},overrideTooltips:j={},customValidation:_={},defaultValues:v={}}=e,[C,T]=(0,r.useState)(null),[k,E]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{try{let e=(await (0,h.getOpenAPISchema)()).components.schemas[t];if(!e)throw Error('Schema component "'.concat(t,'" not found'));T(e);let a={};Object.keys(e.properties).filter(e=>!o.includes(e)&&void 0!==v[e]).forEach(e=>{a[e]=v[e]}),g.setFieldsValue(a)}catch(e){console.error("Schema fetch error:",e),E(e instanceof Error?e.message:"Failed to fetch schema")}})()},[t,g,o]);let S=e=>{if(e.type)return e.type;if(e.anyOf){let t=e.anyOf.map(e=>e.type);if(t.includes("number")||t.includes("integer"))return"number";t.includes("string")}return"string"},b=(e,t)=>{var o;let r;let h=S(t),g=null==C?void 0:null===(o=C.required)||void 0===o?void 0:o.includes(e),T=y[e]||t.title||(0,p.N4)(e),k=j[e]||t.description,E=[];g&&E.push({required:!0,message:"".concat(T," is required")}),_[e]&&E.push({validator:_[e]}),f(e,t)&&E.push({validator:async(e,t)=>{if(t&&!m(t))throw Error("Please enter valid JSON")}});let b=k?(0,a.jsxs)("span",{children:[T," ",(0,a.jsx)(u.Z,{title:k,children:(0,a.jsx)(d.Z,{style:{marginLeft:"4px"}})})]}):T;return r=f(e,t)?(0,a.jsx)(n.default.TextArea,{rows:4,placeholder:"Enter as JSON",className:"font-mono"}):t.enum?(0,a.jsx)(c.default,{children:t.enum.map(e=>(0,a.jsx)(c.default.Option,{value:e,children:e},e))}):"number"===h||"integer"===h?(0,a.jsx)(l.Z,{style:{width:"100%"},precision:"integer"===h?0:void 0}):"duration"===e?(0,a.jsx)(s.o,{placeholder:"eg: 30s, 30h, 30d"}):(0,a.jsx)(s.o,{placeholder:k||""}),(0,a.jsx)(i.Z.Item,{label:b,name:e,className:"mt-8",rules:E,initialValue:v[e],help:(0,a.jsx)("div",{className:"text-xs text-gray-500",children:w(e,t,h)}),children:r},e)};return k?(0,a.jsxs)("div",{className:"text-red-500",children:["Error: ",k]}):(null==C?void 0:C.properties)?(0,a.jsx)("div",{children:Object.entries(C.properties).filter(e=>{let[t]=e;return!o.includes(t)}).map(e=>{let[t,o]=e;return b(t,o)})}):null}},9114:function(e,t,o){var a=o(2265),r=o(57271),n=o(85968);function c(){return"topRight"}function l(e,t){var o;return"string"==typeof e?{message:t,description:e}:{message:null!==(o=e.message)&&void 0!==o?o:t,...e}}function i(e){return"number"==typeof e?e:"string"==typeof e&&/^\d+$/.test(e)?parseInt(e,10):void 0}let s=["invalid api key","invalid authorization header format","authentication error","invalid proxy server token","invalid jwt token","invalid jwt submitted","unauthorized access to metrics endpoint"],d=["admin-only endpoint","not allowed to access model","user does not have permission","access forbidden","invalid credentials used to access ui","user not allowed to access proxy"],u=["db not connected","database not initialized","no db connected","prisma client not initialized","service unhealthy"],h=["no models configured on proxy","llm router not initialized","no deployments available","no healthy deployment available","not allowed to access model due to tags configuration","invalid model name passed in"],p=["deployment over user-defined ratelimit","crossed tpm / rpm / max parallel request limit","max parallel request limit"],g=["budget exceeded","crossed budget","provider budget"],f=["must be a litellm enterprise user","only be available for liteLLM enterprise users","missing litellm-enterprise package","only available on the docker image","enterprise feature","premium user"],m=["invalid json payload","invalid request type","invalid key format","invalid hash key","invalid sort column","invalid sort order","invalid limit","invalid file type","invalid field","invalid date format"],w=["model not found","model with id","credential not found","user not found","team not found","organization not found","mcp server with id","tool '"],y=["already exists","team member is already in team","user already exists"],j=["violated openai moderation policy","violated jailbreak threshold","violated prompt_injection threshold","violated content safety policy","violated lasso guardrail policy","blocked by pillar security guardrail","violated azure prompt shield guardrail policy","content blocked by model armor","response blocked by model armor","streaming response blocked by model armor","guardrail","moderation"],_=["invalid purpose","service must be specified","invalid response - response.response is none"],v=["cloudzero settings not configured","failed to decrypt cloudzero api key","cloudzero settings not found"],C=["created successfully","updated successfully","deleted successfully","credential created successfully","model added successfully","team created successfully","user created successfully","organization created successfully","cloudzero settings initialized successfully","cloudzero settings updated successfully","cloudzero export completed successfully","mock llm request made","mock slack alert sent","mock email alert sent","spend for all api keys and teams reset successfully","monthlyglobalspend view refreshed","cache cleared successfully","cache set successfully","ip ","deleted successfully"],T=["rate limit reached for deployment","deployment cooldown period active"],k=["this feature is only available for litellm enterprise users","enterprise features are not available","regenerating virtual keys is an enterprise feature","trying to set allowed_routes. this is an enterprise feature"],E=["invalid maximum_spend_logs_retention_interval value","error has invalid or non-convertible code","failed to save health check to database"],S={showProgress:!0,pauseOnHover:!0};t.Z={error(e){var t,o;let a=l(e,"Error");r.ZP.error({...S,...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:6})},warning(e){var t,o;let a=l(e,"Warning");r.ZP.warning({...S,...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:5})},info(e){var t,o;let a=l(e,"Info");r.ZP.info({...S,...a,placement:null!==(t=a.placement)&&void 0!==t?t:c(),duration:null!==(o=a.duration)&&void 0!==o?o:4})},success(e){var t,o;if(a.isValidElement(e)){r.ZP.success({...S,message:"Success",description:e,placement:c(),duration:3.5});return}let n=l(e,"Success");r.ZP.success({...S,...n,placement:null!==(t=n.placement)&&void 0!==t?t:c(),duration:null!==(o=n.duration)&&void 0!==o?o:3.5})},fromBackend(e,t){var o,a,l,b,F,P,O,B,N,x,A,J;let G=null!==(J=null!==(A=i(null==e?void 0:null===(x=e.response)||void 0===x?void 0:x.status))&&void 0!==A?A:i(null==e?void 0:e.status_code))&&void 0!==J?J:i(null==e?void 0:e.code),U=function(e){var t,o,a,r,c,l,i,s,d,u,h,p;if("string"==typeof e)return e;let g=null!==(p=null!==(h=null!==(u=null!==(d=null!==(s=null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(o=a.data)||void 0===o?void 0:null===(t=o.error)||void 0===t?void 0:t.message)&&void 0!==s?s:null==e?void 0:null===(c=e.response)||void 0===c?void 0:null===(r=c.data)||void 0===r?void 0:r.message)&&void 0!==d?d:null==e?void 0:null===(i=e.response)||void 0===i?void 0:null===(l=i.data)||void 0===l?void 0:l.error)&&void 0!==u?u:null==e?void 0:e.detail)&&void 0!==h?h:null==e?void 0:e.message)&&void 0!==p?p:e;return(0,n.O)(g)}(e),R={...null!=t?t:{},description:U,placement:null!==(o=null==t?void 0:t.placement)&&void 0!==o?o:c()};if(void 0!==G||e instanceof Error||"string"==typeof e||e&&"object"==typeof e&&("error"in e||"detail"in e)){let e=function(e,t){var o,a,r,n,c;let l=(t||"").toLowerCase();return s.some(e=>l.includes(e))?"Authentication Error":d.some(e=>l.includes(e))?"Access Denied":(null==u?void 0:null===(o=u.some)||void 0===o?void 0:o.call(u,e=>l.includes(e)))||503===e?"Service Unavailable":(null==g?void 0:null===(a=g.some)||void 0===a?void 0:a.call(g,e=>l.includes(e)))?"Budget Exceeded":(null==f?void 0:null===(r=f.some)||void 0===r?void 0:r.call(f,e=>l.includes(e)))?"Feature Unavailable":(null==h?void 0:null===(n=h.some)||void 0===n?void 0:n.call(h,e=>l.includes(e)))?"Routing Error":y.some(e=>l.includes(e))?"Already Exists":j.some(e=>l.includes(e))?"Content Blocked":_.some(e=>l.includes(e))?"Validation Error":v.some(e=>l.includes(e))?"Integration Error":m.some(e=>l.includes(e))?"Validation Error":404===e||l.includes("not found")||w.some(e=>l.includes(e))?"Not Found":429===e||l.includes("rate limit")||l.includes("tpm")||l.includes("rpm")||(null==p?void 0:null===(c=p.some)||void 0===c?void 0:c.call(p,e=>l.includes(e)))?"Rate Limit Exceeded":e&&e>=500?"Server Error":401===e?"Authentication Error":403===e?"Access Denied":l.includes("enterprise")||l.includes("premium")?"Info":e&&e>=400?"Request Error":"Error"}(G,U),o={...R,message:e};if("Rate Limit Exceeded"===e||"Info"===e||"Budget Exceeded"===e||"Feature Unavailable"===e||"Content Blocked"===e||"Integration Error"===e){r.ZP.warning({...S,...o,duration:null!==(a=null==t?void 0:t.duration)&&void 0!==a?a:7});return}if("Server Error"===e){r.ZP.error({...S,...o,duration:null!==(l=null==t?void 0:t.duration)&&void 0!==l?l:8});return}if("Request Error"===e||"Authentication Error"===e||"Access Denied"===e||"Not Found"===e||"Error"===e||"Already Exists"===e){r.ZP.error({...S,...o,duration:null!==(b=null==t?void 0:t.duration)&&void 0!==b?b:6});return}r.ZP.info({...S,...o,duration:null!==(F=null==t?void 0:t.duration)&&void 0!==F?F:4});return}let I=function(e){let t=(e||"").toLowerCase();return C.some(e=>t.includes(e))?{kind:"success",title:"Success"}:k.some(e=>t.includes(e))?{kind:"warning",title:"Feature Notice"}:E.some(e=>t.includes(e))?{kind:"warning",title:"Configuration Warning"}:T.some(e=>t.includes(e))?{kind:"warning",title:"Rate Limit"}:null}(U),M={...R,message:null!==(P=null==I?void 0:I.title)&&void 0!==P?P:"Info"};if((null==I?void 0:I.kind)==="success"){r.ZP.success({...S,...M,duration:null!==(O=null==t?void 0:t.duration)&&void 0!==O?O:3.5});return}if((null==I?void 0:I.kind)==="warning"){r.ZP.warning({...S,...M,duration:null!==(B=null==t?void 0:t.duration)&&void 0!==B?B:6});return}r.ZP.info({...S,...M,duration:null!==(N=null==t?void 0:t.duration)&&void 0!==N?N:4})},clear(){r.ZP.destroy()}}},19250:function(e,t,o){o.r(t),o.d(t,{DEFAULT_ORGANIZATION:function(){return m},PredictedSpendLogsCall:function(){return tj},addAllowedIP:function(){return eb},adminGlobalActivity:function(){return eH},adminGlobalActivityExceptions:function(){return eQ},adminGlobalActivityExceptionsPerDeployment:function(){return eK},adminGlobalActivityPerModel:function(){return eW},adminGlobalCacheActivity:function(){return eY},adminSpendLogsCall:function(){return eD},adminTopEndUsersCall:function(){return eq},adminTopKeysCall:function(){return eV},adminTopModelsCall:function(){return e$},adminspendByProvider:function(){return eZ},agentDailyActivityCall:function(){return ep},agentHubPublicModelsCall:function(){return eT},alertingSettingsCall:function(){return M},allEndUsersCall:function(){return eI},allTagNamesCall:function(){return eR},applyGuardrail:function(){return oM},availableTeamListCall:function(){return $},budgetCreateCall:function(){return G},budgetDeleteCall:function(){return J},budgetUpdateCall:function(){return U},buildMcpOAuthAuthorizeUrl:function(){return o0},cacheTemporaryMcpServer:function(){return o$},cachingHealthCheckCall:function(){return tM},callMCPTool:function(){return oi},cancelModelCostMapReload:function(){return O},claimOnboardingToken:function(){return em},convertPromptFileToJson:function(){return tK},createAgentCall:function(){return tX},createGuardrailCall:function(){return t0},createMCPServer:function(){return t6},createPassThroughEndpoint:function(){return tx},createPromptCall:function(){return tY},createSearchTool:function(){return oo},credentialCreateCall:function(){return tt},credentialDeleteCall:function(){return tr},credentialGetCall:function(){return ta},credentialListCall:function(){return to},credentialUpdateCall:function(){return tn},customerDailyActivityCall:function(){return eh},defaultProxyBaseUrl:function(){return s},deleteAgentCall:function(){return ob},deleteAllowedIP:function(){return eF},deleteCallback:function(){return oY},deleteConfigFieldSetting:function(){return tJ},deleteGuardrailCall:function(){return oB},deleteMCPServer:function(){return t7},deletePassThroughEndpointsCall:function(){return tG},deletePromptCall:function(){return tQ},deleteSearchTool:function(){return or},exchangeMcpOAuthToken:function(){return o1},fetchAvailableSearchProviders:function(){return on},fetchMCPAccessGroups:function(){return t9},fetchMCPServerHealth:function(){return t5},fetchMCPServers:function(){return t2},fetchSearchToolById:function(){return ot},fetchSearchTools:function(){return oe},formatDate:function(){return l},getAgentCreateMetadata:function(){return _},getAgentInfo:function(){return oG},getAgentsList:function(){return oJ},getAllowedIPs:function(){return eS},getBudgetList:function(){return tC},getBudgetSettings:function(){return tT},getCacheSettingsCall:function(){return tb},getCallbackConfigsCall:function(){return i},getCallbacksCall:function(){return tk},getCategoryYaml:function(){return oA},getConfigFieldSetting:function(){return tB},getDefaultTeamSettings:function(){return og},getEmailEventSettings:function(){return ok},getGeneralSettingsCall:function(){return tE},getGuardrailInfo:function(){return oU},getGuardrailProviderSpecificParams:function(){return ox},getGuardrailUISettings:function(){return oN},getGuardrailsList:function(){return tV},getInternalUserSettings:function(){return t4},getModelCostMapReloadStatus:function(){return B},getOnboardingCredentials:function(){return ef},getOpenAPISchema:function(){return S},getPassThroughEndpointInfo:function(){return oH},getPassThroughEndpointsCall:function(){return tO},getPossibleUserRoles:function(){return e7},getPromptInfo:function(){return tZ},getPromptVersions:function(){return tH},getPromptsList:function(){return tq},getProviderCreateMetadata:function(){return j},getProxyBaseUrl:function(){return g},getProxyUISettings:function(){return tD},getPublicModelHubInfo:function(){return E},getRemainingUsers:function(){return oq},getRouterSettingsCall:function(){return tS},getSSOSettings:function(){return oL},getTeamPermissionsCall:function(){return om},getTotalSpendCall:function(){return eg},getUiConfig:function(){return k},getUiSettings:function(){return aa},healthCheckCall:function(){return tR},healthCheckHistoryCall:function(){return tz},individualModelHealthCheckCall:function(){return tI},invitationClaimCall:function(){return I},invitationCreateCall:function(){return R},keyAliasesCall:function(){return e3},keyCreateCall:function(){return L},keyCreateServiceAccountCall:function(){return z},keyDeleteCall:function(){return V},keyInfoCall:function(){return eX},keyInfoV1Call:function(){return e1},keyListCall:function(){return e4},keySpendLogsCall:function(){return eJ},keyUpdateCall:function(){return tc},latestHealthChecksCall:function(){return tL},listMCPTools:function(){return ol},loginCall:function(){return ao},makeAgentPublicCall:function(){return oF},makeAgentsPublicCall:function(){return oP},makeMCPPublicCall:function(){return oO},makeModelGroupPublic:function(){return T},mcpHubPublicServersCall:function(){return ek},mcpToolsCall:function(){return oW},modelAvailableCall:function(){return eA},modelCostMap:function(){return b},modelCreateCall:function(){return N},modelDeleteCall:function(){return A},modelExceptionsCall:function(){return eN},modelHubCall:function(){return eE},modelHubPublicModelsCall:function(){return eC},modelInfoCall:function(){return e_},modelInfoV1Call:function(){return ev},modelMetricsCall:function(){return eP},modelMetricsSlowResponsesCall:function(){return eB},modelPatchUpdateCall:function(){return ti},modelSettingsCall:function(){return x},modelUpdateCall:function(){return ts},organizationCreateCall:function(){return et},organizationDailyActivityCall:function(){return eu},organizationDeleteCall:function(){return ea},organizationInfoCall:function(){return ee},organizationListCall:function(){return X},organizationMemberAddCall:function(){return tg},organizationMemberDeleteCall:function(){return tf},organizationMemberUpdateCall:function(){return tm},organizationUpdateCall:function(){return eo},patchAgentCall:function(){return oR},patchPromptCall:function(){return t$},perUserAnalyticsCall:function(){return ae},proxyBaseUrl:function(){return u},regenerateKeyCall:function(){return ew},registerMcpOAuthClient:function(){return oX},reloadModelCostMap:function(){return F},resetEmailEventSettings:function(){return oS},scheduleModelCostMapReload:function(){return P},searchToolQueryCall:function(){return o3},serverRootPath:function(){return d},serviceHealthCheck:function(){return tv},sessionSpendLogsCall:function(){return oy},setCallbacksCall:function(){return tU},setGlobalLitellmHeaderName:function(){return C},slackBudgetAlertsHealthCheck:function(){return t_},spendUsersCall:function(){return e2},streamingModelMetricsCall:function(){return eO},tagCreateCall:function(){return os},tagDailyActivityCall:function(){return es},tagDauCall:function(){return o5},tagDeleteCall:function(){return op},tagDistinctCall:function(){return o8},tagInfoCall:function(){return ou},tagListCall:function(){return oh},tagMauCall:function(){return o6},tagUpdateCall:function(){return od},tagWauCall:function(){return o9},tagsSpendLogsCall:function(){return eU},teamBulkMemberAddCall:function(){return tu},teamCreateCall:function(){return te},teamDailyActivityCall:function(){return ed},teamDeleteCall:function(){return Z},teamInfoCall:function(){return W},teamListCall:function(){return K},teamMemberAddCall:function(){return td},teamMemberDeleteCall:function(){return tp},teamMemberUpdateCall:function(){return th},teamPermissionsUpdateCall:function(){return ow},teamSpendLogsCall:function(){return eG},teamUpdateCall:function(){return tl},testCacheConnectionCall:function(){return tF},testConnectionRequest:function(){return e0},testMCPConnectionRequest:function(){return oQ},testMCPToolsListRequest:function(){return oK},testSearchToolConnection:function(){return oc},transformRequestCall:function(){return er},uiAuditLogsCall:function(){return oV},uiSpendLogDetailsCall:function(){return t1},uiSpendLogsCall:function(){return eL},updateCacheSettingsCall:function(){return tP},updateConfigFieldSetting:function(){return tA},updateDefaultTeamSettings:function(){return of},updateEmailEventSettings:function(){return oE},updateGuardrailCall:function(){return oI},updateInternalUserSettings:function(){return t3},updateMCPServer:function(){return t8},updatePassThroughEndpoint:function(){return oZ},updatePassThroughFieldSetting:function(){return tN},updatePromptCall:function(){return tW},updateSSOSettings:function(){return oD},updateSearchTool:function(){return oa},updateUiSettings:function(){return ar},updateUsefulLinksCall:function(){return ex},userAgentAnalyticsCall:function(){return o2},userAgentSummaryCall:function(){return o7},userBulkUpdateUserCall:function(){return ty},userCreateCall:function(){return D},userDailyActivityAggregatedCall:function(){return e6},userDailyActivityCall:function(){return ei},userDeleteCall:function(){return q},userFilterUICall:function(){return eM},userGetAllUsersCall:function(){return e8},userGetRequesedtModelsCall:function(){return e9},userInfoCall:function(){return Y},userListCall:function(){return H},userRequestModelCall:function(){return e5},userSpendLogsCall:function(){return ez},userUpdateUserCall:function(){return tw},v2TeamListCall:function(){return Q},validateBlockedWordsFile:function(){return oz},vectorStoreCreateCall:function(){return oj},vectorStoreDeleteCall:function(){return ov},vectorStoreInfoCall:function(){return oC},vectorStoreListCall:function(){return o_},vectorStoreSearchCall:function(){return o4},vectorStoreUpdateCall:function(){return oT}});var a=o(42264),r=o(3914),n=o(63610),c=o(9114);let l=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)},i=async e=>{try{let t=u?"".concat(u,"/callbacks/configs"):"/callbacks/configs",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},s=null,d="/",u=null;console.log=function(){};let h=()=>window.location,p=function(e){var t;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=h(),r=null!==(t=null==a?void 0:a.origin)&&void 0!==t?t:null,n=o||r;if(console.log("proxyBaseUrl:",u),console.log("serverRootPath:",e),!n){console.log("Updated proxyBaseUrl:",u=null!=u?u:null);return}e.length>0&&!n.endsWith(e)&&"/"!=e&&(n+=e),console.log("Updated proxyBaseUrl:",u=n)},g=()=>{var e;if(u)return u;let t=h();return null!==(e=null==t?void 0:t.origin)&&void 0!==e?e:""},f={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE"},m="default_organization",w=0,y=async e=>{let t=Date.now();if(t-w>6e4){if(("string"==typeof e?e:JSON.stringify(e)).includes("Authentication Error - Expired Key")){c.Z.info("UI Session Expired. Logging out."),w=t,(0,r.b)();let e=h();e&&(window.location.href=e.pathname)}w=t}else console.log("Error suppressed to prevent spam:",e)},j=async()=>{let e=u?"".concat(u,"/public/providers/fields"):"/public/providers/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch provider create metadata:",t.status,e),Error("Failed to load provider configuration")}return await t.json()},_=async()=>{let e=u?"".concat(u,"/public/agents/fields"):"/public/agents/fields",t=await fetch(e,{method:"GET"});if(!t.ok){let e=await t.text();throw console.error("Failed to fetch agent create metadata:",t.status,e),Error("Failed to load agent configuration")}return await t.json()},v="Authorization";function C(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authorization";console.log("setGlobalLitellmHeaderName: ".concat(e)),v=e}let T=async(e,t)=>{let o=u?"".concat(u,"/model_group/make_public"):"/model_group/make_public";return(await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({model_groups:t})})).json()},k=async()=>{console.log("Getting UI config");let e=await fetch(s?"".concat(s,"/litellm/.well-known/litellm-ui-config"):"/litellm/.well-known/litellm-ui-config"),t=await e.json();return console.log("jsonData in getUiConfig:",t),p(t.server_root_path,t.proxy_base_url),t},E=async()=>{let e=u?"".concat(u,"/public/model_hub/info"):"/public/model_hub/info",t=await fetch(e);return await t.json()},S=async()=>{let e=u?"".concat(u,"/openapi.json"):"/openapi.json",t=await fetch(e);return await t.json()},b=async()=>{try{let e=u?"".concat(u,"/public/litellm_model_cost_map"):"/public/litellm_model_cost_map",t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}}),o=await t.json();return console.log("received litellm model cost data: ".concat(o)),o}catch(e){throw console.error("Failed to get model cost map:",e),e}},F=async e=>{try{let t=u?"".concat(u,"/reload/model_cost_map"):"/reload/model_cost_map",o=await fetch(t,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("Model cost map reload response: ".concat(a)),a}catch(e){throw console.error("Failed to reload model cost map:",e),e}},P=async(e,t)=>{try{let o=u?"".concat(u,"/schedule/model_cost_map_reload?hours=").concat(t):"/schedule/model_cost_map_reload?hours=".concat(t),a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}}),r=await a.json();return console.log("Schedule model cost map reload response: ".concat(r)),r}catch(e){throw console.error("Failed to schedule model cost map reload:",e),e}},O=async e=>{try{let t=u?"".concat(u,"/schedule/model_cost_map_reload"):"/schedule/model_cost_map_reload",o=await fetch(t,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}}),a=await o.json();return console.log("Cancel model cost map reload response: ".concat(a)),a}catch(e){throw console.error("Failed to cancel model cost map reload:",e),e}},B=async e=>{try{let t=u?"".concat(u,"/schedule/model_cost_map_reload/status"):"/schedule/model_cost_map_reload/status";console.log("Fetching status from URL:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){console.error("Status request failed with status: ".concat(o.status));let e=await o.text();throw console.error("Error response:",e),Error("HTTP ".concat(o.status,": ").concat(e))}let a=await o.json();return console.log("Model cost map reload status:",a),a}catch(e){throw console.error("Failed to get model cost map reload status:",e),e}},N=async(e,t)=>{try{let o=u?"".concat(u,"/model/new"):"/model/new",r=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),a.ZP.destroy(),c.Z.success("Model ".concat(t.model_name," created successfully")),n}catch(e){throw console.error("Failed to create key:",e),e}},x=async e=>{try{let t=u?"".concat(u,"/model/settings"):"/model/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){console.error("Failed to get model settings:",e)}},A=async(e,t)=>{console.log("model_id in model delete call: ".concat(t));try{let o=u?"".concat(u,"/model/delete"):"/model/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},J=async(e,t)=>{if(console.log("budget_id in budget delete call: ".concat(t)),null!=e)try{let o=u?"".concat(u,"/budget/delete"):"/budget/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({id:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},G=async(e,t)=>{try{console.log("Form Values in budgetCreateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/budget/new"):"/budget/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},U=async(e,t)=>{try{console.log("Form Values in budgetUpdateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/budget/update"):"/budget/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},R=async(e,t)=>{try{let o=u?"".concat(u,"/invitation/new"):"/invitation/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},I=async(e,t)=>{try{console.log("Form Values in invitationCreateCall:",t),console.log("Form Values after check:",t);let o=u?"".concat(u,"/invitation/claim"):"/invitation/claim",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},M=async e=>{try{let t=u?"".concat(u,"/alerting/settings"):"/alerting/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},z=async(e,t)=>{try{for(let e of(console.log("Form Values in keyCreateServiceAccountCall:",t),t.description&&(t.metadata||(t.metadata={}),t.metadata.description=t.description,delete t.description,t.metadata=JSON.stringify(t.metadata)),n.d))if(t[e]){console.log("formValues.".concat(e,":"),t[e]);try{t[e]=JSON.parse(t[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",t);let o=u?"".concat(u,"/key/service-account/generate"):"/key/service-account/generate",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},L=async(e,t,o)=>{try{for(let e of(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),n.d))if(o[e]){console.log("formValues.".concat(e,":"),o[e]);try{o[e]=JSON.parse(o[e])}catch(t){throw Error("Failed to parse ".concat(e,": ")+t)}}console.log("Form Values after check:",o);let a=u?"".concat(u,"/key/generate"):"/key/generate",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let c=await r.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},D=async(e,t,o)=>{try{if(console.log("Form Values in keyCreateCall:",o),o.description&&(o.metadata||(o.metadata={}),o.metadata.description=o.description,delete o.description,o.metadata=JSON.stringify(o.metadata)),o.auto_create_key=!1,o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}console.log("Form Values after check:",o);let a=u?"".concat(u,"/user/new"):"/user/new",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},V=async(e,t)=>{try{let o=u?"".concat(u,"/key/delete"):"/key/delete";console.log("in keyDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},q=async(e,t)=>{try{let o=u?"".concat(u,"/user/delete"):"/user/delete";console.log("in userDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_ids:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete user(s):",e),e}},Z=async(e,t)=>{try{let o=u?"".concat(u,"/team/delete"):"/team/delete";console.log("in teamDeleteCall:",t);let a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_ids:[t]})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},H=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,c=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,s=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;try{let d=u?"".concat(u,"/user/list"):"/user/list";console.log("in userListCall");let h=new URLSearchParams;if(t&&t.length>0){let e=t.join(",");h.append("user_ids",e)}o&&h.append("page",o.toString()),a&&h.append("page_size",a.toString()),r&&h.append("user_email",r),n&&h.append("role",n),c&&h.append("team",c),l&&h.append("sso_user_ids",l),i&&h.append("sort_by",i),s&&h.append("sort_order",s);let p=h.toString();p&&(d+="?".concat(p));let g=await fetch(d,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!g.ok){let e=await g.json(),t=at(e);throw y(t),Error(t)}let f=await g.json();return console.log("/user/list API Response:",f),f}catch(e){throw console.error("Failed to create key:",e),e}},Y=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,n=arguments.length>5?arguments[5]:void 0,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];console.log("userInfoCall: ".concat(t,", ").concat(o,", ").concat(a,", ").concat(r,", ").concat(n,", ").concat(c));try{let l;if(a){l=u?"".concat(u,"/user/list"):"/user/list";let e=new URLSearchParams;null!=r&&e.append("page",r.toString()),null!=n&&e.append("page_size",n.toString()),l+="?".concat(e.toString())}else l=u?"".concat(u,"/user/info"):"/user/info",("Admin"!==o&&"Admin Viewer"!==o||c)&&t&&(l+="?user_id=".concat(t));console.log("Requesting user data from:",l);let i=await fetch(l,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=at(e);throw y(t),Error(t)}let s=await i.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to fetch user data:",e),e}},W=async(e,t)=>{try{let o=u?"".concat(u,"/team/info"):"/team/info";t&&(o="".concat(o,"?team_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},Q=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6],arguments.length>7&&void 0!==arguments[7]&&arguments[7],arguments.length>8&&void 0!==arguments[8]&&arguments[8];try{let n=u?"".concat(u,"/v2/team/list"):"/v2/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=at(e);throw y(t),Error(t)}let s=await i.json();return console.log("/v2/team/list API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},K=async function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;try{let n=u?"".concat(u,"/team/list"):"/team/list";console.log("in teamInfoCall");let c=new URLSearchParams;o&&c.append("user_id",o.toString()),t&&c.append("organization_id",t.toString()),a&&c.append("team_id",a.toString()),r&&c.append("team_alias",r.toString());let l=c.toString();l&&(n+="?".concat(l));let i=await fetch(n,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=at(e);throw y(t),Error(t)}let s=await i.json();return console.log("/team/list API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},$=async e=>{try{let t=u?"".concat(u,"/team/available"):"/team/available";console.log("in availableTeamListCall");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("/team/available_teams API Response:",a),a}catch(e){throw e}},X=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{let a=u?"".concat(u,"/organization/list"):"/organization/list",r=new URLSearchParams;t&&r.append("org_id",t.toString()),o&&r.append("org_alias",o.toString());let n=r.toString();n&&(a+="?".concat(n));let c=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}return await c.json()}catch(e){throw console.error("Failed to create key:",e),e}},ee=async(e,t)=>{try{let o=u?"".concat(u,"/organization/info"):"/organization/info";t&&(o="".concat(o,"?organization_id=").concat(t)),console.log("in teamInfoCall");let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},et=async(e,t)=>{try{if(console.log("Form Values in organizationCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw console.error("Failed to parse metadata:",e),Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/organization/new"):"/organization/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eo=async(e,t)=>{try{console.log("Form Values in organizationUpdateCall:",t);let o=u?"".concat(u,"/organization/update"):"/organization/update",a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},ea=async(e,t)=>{try{let o=u?"".concat(u,"/organization/delete"):"/organization/delete",a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_ids:[t]})});if(!a.ok){let e=await a.text();throw y(e),Error("Error deleting organization: ".concat(e))}return await a.json()}catch(e){throw console.error("Failed to delete organization:",e),e}},er=async(e,t)=>{try{let o=u?"".concat(u,"/utils/transform_request"):"/utils/transform_request",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},en=(e,t,o)=>{if(null!=o){if(Array.isArray(o)){o.length>0&&e.append(t,o.join(","));return}e.append(t,"".concat(o))}},ec=(e,t,o,a,r)=>{let n=e.startsWith("/")?e:"/".concat(e),c=u?"".concat(u).concat(n):n,i=new URLSearchParams;i.append("start_date",l(t)),i.append("end_date",l(o)),i.append("page_size","1000"),i.append("page",a.toString()),r&&Object.entries(r).forEach(e=>{let[t,o]=e;en(i,t,o)});let s=i.toString();return s?"".concat(c,"?").concat(s):c},el=async e=>{let{accessToken:t,endpoint:o,startTime:a,endTime:r,page:n=1,extraQueryParams:c}=e;try{let e=ec(o,a,r,n,c),l=await fetch(e,{method:"GET",headers:{[v]:"Bearer ".concat(t),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=at(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch daily activity (".concat(o,"):"),e),e}},ei=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return el({accessToken:e,endpoint:"/user/daily/activity",startTime:t,endTime:o,page:a})},es=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/tag/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{tags:r}})},ed=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/team/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{team_ids:r,exclude_team_ids:"litellm-dashboard"}})},eu=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/organization/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{organization_ids:r}})},eh=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/customer/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{end_user_ids:r}})},ep=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;return el({accessToken:e,endpoint:"/agent/daily/activity",startTime:t,endTime:o,page:a,extraQueryParams:{agent_ids:r}})},eg=async e=>{try{let t=u?"".concat(u,"/global/spend"):"/global/spend",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ef=async e=>{try{let t=u?"".concat(u,"/onboarding/get_token"):"/onboarding/get_token";t+="?invite_link=".concat(e);let o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},em=async(e,t,o,a)=>{let r=u?"".concat(u,"/onboarding/claim_token"):"/onboarding/claim_token";try{let n=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({invitation_link:t,user_id:o,password:a})});if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to delete key:",e),e}},ew=async(e,t,o)=>{try{let a=u?"".concat(u,"/key/").concat(t,"/regenerate"):"/key/".concat(t,"/regenerate"),r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("Regenerate key Response:",n),n}catch(e){throw console.error("Failed to regenerate key:",e),e}},ey=!1,ej=null,e_=async(e,t,o)=>{try{console.log("modelInfoCall:",e,t,o);let a=u?"".concat(u,"/v2/model/info"):"/v2/model/info",r=new URLSearchParams;r.append("include_team_models","true"),r.toString()&&(a+="?".concat(r.toString()));let n=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.text();throw e+="error shown=".concat(ey),ey||(e.includes("No model list passed")&&(e="No Models Exist. Click Add Model to get started."),c.Z.info(e),ey=!0,ej&&clearTimeout(ej),ej=setTimeout(()=>{ey=!1},1e4)),Error("Network response was not ok")}let l=await n.json();return console.log("modelInfoCall:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},ev=async(e,t)=>{try{let o=u?"".concat(u,"/v1/model/info"):"/v1/model/info";o+="?litellm_model_id=".concat(t);let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("modelInfoV1Call:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},eC=async()=>{let e=u?"".concat(u,"/public/model_hub"):"/public/model_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},eT=async()=>{let e=u?"".concat(u,"/public/agent_hub"):"/public/agent_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},ek=async()=>{let e=u?"".concat(u,"/public/mcp_hub"):"/public/mcp_hub";return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"}})).json()},eE=async e=>{try{let t=u?"".concat(u,"/model_group/info"):"/model_group/info",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("modelHubCall:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},eS=async e=>{try{let t=u?"".concat(u,"/get/allowed_ips"):"/get/allowed_ips",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("getAllowedIPs:",a),a.data}catch(e){throw console.error("Failed to get allowed IPs:",e),e}},eb=async(e,t)=>{try{let o=u?"".concat(u,"/add/allowed_ip"):"/add/allowed_ip",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("addAllowedIP:",r),r}catch(e){throw console.error("Failed to add allowed IP:",e),e}},eF=async(e,t)=>{try{let o=u?"".concat(u,"/delete/allowed_ip"):"/delete/allowed_ip",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({ip:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("deleteAllowedIP:",r),r}catch(e){throw console.error("Failed to delete allowed IP:",e),e}},eP=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics"):"/model/metrics";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eO=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/model/streaming_metrics"):"/model/streaming_metrics";t&&(r="".concat(r,"?_selected_model_group=").concat(t,"&startTime=").concat(o,"&endTime=").concat(a));let n=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}return await n.json()}catch(e){throw console.error("Failed to create key:",e),e}},eB=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics/slow_responses"):"/model/metrics/slow_responses";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},eN=async(e,t,o,a,r,n,c,l)=>{try{let t=u?"".concat(u,"/model/metrics/exceptions"):"/model/metrics/exceptions";a&&(t="".concat(t,"?_selected_model_group=").concat(a,"&startTime=").concat(r,"&endTime=").concat(n,"&api_key=").concat(c,"&customer=").concat(l));let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to create key:",e),e}},ex=async(e,t)=>{try{let o=u?"".concat(u,"/model_hub/update_useful_links"):"/model_hub/update_useful_links",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({useful_links:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},eA=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=(arguments.length>5&&void 0!==arguments[5]&&arguments[5],arguments.length>6&&void 0!==arguments[6]&&arguments[6]);console.log("in /models calls, globalLitellmHeaderName",v);try{let t=u?"".concat(u,"/models"):"/models",o=new URLSearchParams;o.append("include_model_access_groups","True"),!0===a&&o.append("return_wildcard_routes","True"),!0===n&&o.append("only_model_access_groups","True"),r&&o.append("team_id",r.toString()),o.toString()&&(t+="?".concat(o.toString()));let c=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}return await c.json()}catch(e){throw console.error("Failed to create key:",e),e}},eJ=async(e,t)=>{try{let o=u?"".concat(u,"/global/spend/logs"):"/global/spend/logs";console.log("in keySpendLogsCall:",o);let a=await fetch("".concat(o,"?api_key=").concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},eG=async e=>{try{let t=u?"".concat(u,"/global/spend/teams"):"/global/spend/teams";console.log("in teamSpendLogsCall:",t);let o=await fetch("".concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eU=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/tags"):"/global/spend/tags";t&&o&&(r="".concat(r,"?start_date=").concat(t,"&end_date=").concat(o)),a&&(r+="".concat(r,"&tags=").concat(a.join(","))),console.log("in tagsSpendLogsCall:",r);let n=await fetch("".concat(r),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},eR=async e=>{try{let t=u?"".concat(u,"/global/spend/all_tag_names"):"/global/spend/all_tag_names";console.log("in global/spend/all_tag_names call",t);let o=await fetch("".concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eI=async e=>{try{let t=u?"".concat(u,"/customer/list"):"/customer/list";console.log("in customer/list",t);let o=await fetch("".concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to fetch end users:",e),e}},eM=async(e,t)=>{try{let o=u?"".concat(u,"/user/filter/ui"):"/user/filter/ui";t.get("user_email")&&(o+="?user_email=".concat(t.get("user_email"))),t.get("user_id")&&(o+="?user_id=".concat(t.get("user_id")));let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create key:",e),e}},ez=async(e,t,o,a,r,n)=>{try{console.log("user role in spend logs call: ".concat(o));let t=u?"".concat(u,"/spend/logs"):"/spend/logs";t="App Owner"==o?"".concat(t,"?user_id=").concat(a,"&start_date=").concat(r,"&end_date=").concat(n):"".concat(t,"?start_date=").concat(r,"&end_date=").concat(n);let c=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},eL=async(e,t,o,a,r,n,c,l,i,s,d,h,p,g)=>{try{let f=u?"".concat(u,"/spend/logs/ui"):"/spend/logs/ui",m=new URLSearchParams;t&&m.append("api_key",t),o&&m.append("team_id",o),a&&m.append("request_id",a),r&&m.append("start_date",r),n&&m.append("end_date",n),c&&m.append("page",c.toString()),l&&m.append("page_size",l.toString()),i&&m.append("user_id",i),s&&m.append("end_user",s),d&&m.append("status_filter",d),h&&m.append("model",h),p&&m.append("key_alias",p),g&&m.append("error_code",g);let w=m.toString();w&&(f+="?".concat(w));let j=await fetch(f,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!j.ok){let e=await j.json(),t=at(e);throw y(t),Error(t)}let _=await j.json();return console.log("Spend Logs Response:",_),_}catch(e){throw console.error("Failed to fetch spend logs:",e),e}},eD=async e=>{try{let t=u?"".concat(u,"/global/spend/logs"):"/global/spend/logs",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eV=async e=>{try{let t=u?"".concat(u,"/global/spend/keys?limit=5"):"/global/spend/keys?limit=5",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eq=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/end_users"):"/global/spend/end_users",n="";n=t?JSON.stringify({api_key:t,startTime:o,endTime:a}):JSON.stringify({startTime:o,endTime:a});let c={method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:n},l=await fetch(r,c);if(!l.ok){let e=await l.json(),t=at(e);throw y(t),Error(t)}let i=await l.json();return console.log(i),i}catch(e){throw console.error("Failed to create key:",e),e}},eZ=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/spend/provider"):"/global/spend/provider";o&&a&&(r+="?start_date=".concat(o,"&end_date=").concat(a)),t&&(r+="&api_key=".concat(t));let n={method:"GET",headers:{[v]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eH=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity"):"/global/activity";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[v]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eY=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity/cache_hits"):"/global/activity/cache_hits";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[v]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eW=async(e,t,o)=>{try{let a=u?"".concat(u,"/global/activity/model"):"/global/activity/model";t&&o&&(a+="?start_date=".concat(t,"&end_date=").concat(o));let r={method:"GET",headers:{[v]:"Bearer ".concat(e)}},n=await fetch(a,r);if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eQ=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/activity/exceptions"):"/global/activity/exceptions";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[v]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},eK=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/global/activity/exceptions/deployment"):"/global/activity/exceptions/deployment";t&&o&&(r+="?start_date=".concat(t,"&end_date=").concat(o)),a&&(r+="&model_group=".concat(a));let n={method:"GET",headers:{[v]:"Bearer ".concat(e)}},c=await fetch(r,n);if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}let l=await c.json();return console.log(l),l}catch(e){throw console.error("Failed to fetch spend data:",e),e}},e$=async e=>{try{let t=u?"".concat(u,"/global/spend/models?limit=5"):"/global/spend/models?limit=5",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to create key:",e),e}},eX=async(e,t)=>{try{let o=u?"".concat(u,"/v2/key/info"):"/v2/key/info",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({keys:t})});if(!a.ok){let e=await a.text();if(e.includes("Invalid proxy server token passed"))throw Error("Invalid proxy server token passed");throw y(e),Error("Network response was not ok")}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},e0=async(e,t,o,a)=>{try{console.log("Sending model connection test request:",JSON.stringify(t));let n=u?"".concat(u,"/health/test_connection"):"/health/test_connection",c=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json",[v]:"Bearer ".concat(e)},body:JSON.stringify({litellm_params:t,model_info:o,mode:a})}),l=c.headers.get("content-type");if(!l||!l.includes("application/json")){let e=await c.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(c.status,": ").concat(c.statusText,"). Check network tab for details."))}let i=await c.json();if(!c.ok||"error"===i.status){if("error"===i.status);else{var r;return{status:"error",message:(null===(r=i.error)||void 0===r?void 0:r.message)||"Connection test failed: ".concat(c.status," ").concat(c.statusText)}}}return i}catch(e){throw console.error("Model connection test error:",e),e}},e1=async(e,t)=>{try{console.log("entering keyInfoV1Call");let o=u?"".concat(u,"/key/info"):"/key/info";o="".concat(o,"?key=").concat(t);let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(console.log("response",a),!a.ok){let e=await a.text();y(e),c.Z.fromBackend("Failed to fetch key info - "+e)}let r=await a.json();return console.log("data",r),r}catch(e){throw console.error("Failed to fetch key info:",e),e}},e4=async function(e,t,o,a,r,n,c,l){let i=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null,s=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:null;try{let h=u?"".concat(u,"/key/list"):"/key/list";console.log("in keyListCall");let p=new URLSearchParams;o&&p.append("team_id",o.toString()),t&&p.append("organization_id",t.toString()),a&&p.append("key_alias",a),n&&p.append("key_hash",n),r&&p.append("user_id",r.toString()),c&&p.append("page",c.toString()),l&&p.append("size",l.toString()),i&&p.append("sort_by",i),s&&p.append("sort_order",s),d&&p.append("expand",d),p.append("return_full_object","true"),p.append("include_team_keys","true"),p.append("include_created_by_keys","true");let g=p.toString();g&&(h+="?".concat(g));let f=await fetch(h,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!f.ok){let e=await f.json(),t=at(e);throw y(t),Error(t)}let m=await f.json();return console.log("/team/list API Response:",m),m}catch(e){throw console.error("Failed to create key:",e),e}},e3=async e=>{try{let t=u?"".concat(u,"/key/aliases"):"/key/aliases";console.log("in keyAliasesCall");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("/key/aliases API Response:",a),a}catch(e){throw console.error("Failed to fetch key aliases:",e),e}},e2=async(e,t)=>{try{let o=u?"".concat(u,"/spend/users"):"/spend/users";console.log("in spendUsersCall:",o);let a=await fetch("".concat(o,"?user_id=").concat(t),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get spend for user",e),e}},e5=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/user/request_model"):"/user/request_model",n=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({models:[t],user_id:o,justification:a})});if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}let c=await n.json();return console.log(c),c}catch(e){throw console.error("Failed to create key:",e),e}},e9=async e=>{try{let t=u?"".concat(u,"/user/get_requests"):"/user/get_requests";console.log("in userGetRequesedtModelsCall:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log(a),a}catch(e){throw console.error("Failed to get requested models:",e),e}},e6=async(e,t,o)=>{try{let a=u?"".concat(u,"/user/daily/activity/aggregated"):"/user/daily/activity/aggregated",r=new URLSearchParams,n=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};r.append("start_date",n(t)),r.append("end_date",n(o));let c=r.toString();c&&(a+="?".concat(c));let l=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=at(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch aggregated user daily activity:",e),e}},e8=async(e,t)=>{try{let o=u?"".concat(u,"/user/get_users?role=").concat(t):"/user/get_users?role=".concat(t);console.log("in userGetAllUsersCall:",o);let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to get requested models:",e),e}},e7=async e=>{try{let t=u?"".concat(u,"/user/available_roles"):"/user/available_roles",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("response from user/available_role",a),a}catch(e){throw e}},te=async(e,t)=>{try{if(console.log("Form Values in teamCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/team/new"):"/team/new",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tt=async(e,t)=>{try{if(console.log("Form Values in credentialCreateCall:",t),t.metadata){console.log("formValues.metadata:",t.metadata);try{t.metadata=JSON.parse(t.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let o=u?"".concat(u,"/credentials"):"/credentials",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},to=async e=>{try{let t=u?"".concat(u,"/credentials"):"/credentials";console.log("in credentialListCall");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("/credentials API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},ta=async(e,t,o)=>{try{let a=u?"".concat(u,"/credentials"):"/credentials";t?a+="/by_name/".concat(t):o&&(a+="/by_model/".concat(o)),console.log("in credentialListCall");let r=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("/credentials API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tr=async(e,t)=>{try{let o=u?"".concat(u,"/credentials/").concat(t):"/credentials/".concat(t);console.log("in credentialDeleteCall:",t);let a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to delete key:",e),e}},tn=async(e,t,o)=>{try{if(console.log("Form Values in credentialUpdateCall:",o),o.metadata){console.log("formValues.metadata:",o.metadata);try{o.metadata=JSON.parse(o.metadata)}catch(e){throw Error("Failed to parse metadata: "+e)}}let a=u?"".concat(u,"/credentials/").concat(t):"/credentials/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...o})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tc=async(e,t)=>{try{if(console.log("Form Values in keyUpdateCall:",t),t.model_tpm_limit){console.log("formValues.model_tpm_limit:",t.model_tpm_limit);try{t.model_tpm_limit=JSON.parse(t.model_tpm_limit)}catch(e){throw Error("Failed to parse model_tpm_limit: "+e)}}if(t.model_rpm_limit){console.log("formValues.model_rpm_limit:",t.model_rpm_limit);try{t.model_rpm_limit=JSON.parse(t.model_rpm_limit)}catch(e){throw Error("Failed to parse model_rpm_limit: "+e)}}let o=u?"".concat(u,"/key/update"):"/key/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let r=await a.json();return console.log("Update key Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},tl=async(e,t)=>{try{console.log("Form Values in teamUpateCall:",t);let o=u?"".concat(u,"/team/update"):"/team/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error response from the server:",e),c.Z.fromBackend("Failed to update team settings: "+e),Error(e)}let r=await a.json();return console.log("Update Team Response:",r),r}catch(e){throw console.error("Failed to update team:",e),e}},ti=async(e,t,o)=>{try{console.log("Form Values in modelUpateCall:",t);let a=u?"".concat(u,"/model/").concat(o,"/update"):"/model/".concat(o,"/update"),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let n=await r.json();return console.log("Update model Response:",n),n}catch(e){throw console.error("Failed to update model:",e),e}},ts=async(e,t)=>{try{console.log("Form Values in modelUpateCall:",t);let o=u?"".concat(u,"/model/update"):"/model/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),console.error("Error update from the server:",e),Error("Network response was not ok")}let r=await a.json();return console.log("Update model Response:",r),r}catch(e){throw console.error("Failed to update model:",e),e}},td=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let r=u?"".concat(u,"/team/member_add"):"/team/member_add",n=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,member:o})});if(!n.ok){var a;let e=await n.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},tu=async(e,t,o,a,r)=>{try{console.log("Bulk add team members:",{teamId:t,members:o,maxBudgetInTeam:a});let c=u?"".concat(u,"/team/bulk_member_add"):"/team/bulk_member_add",l={team_id:t};r?l.all_users=!0:l.members=o,null!=a&&(l.max_budget_in_team=a);let i=await fetch(c,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){var n;let e=await i.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(n=t.detail)||void 0===n?void 0:n.error)||"Failed to bulk add team members",a=Error(o);throw a.raw=t,a}let s=await i.json();return console.log("Bulk team member add API Response:",s),s}catch(e){throw console.error("Failed to bulk add team members:",e),e}},th=async(e,t,o)=>{try{console.log("Form Values in teamMemberUpdateCall:",o),console.log("Budget value:",o.max_budget_in_team),console.log("TPM limit:",o.tpm_limit),console.log("RPM limit:",o.rpm_limit);let r=u?"".concat(u,"/team/member_update"):"/team/member_update",n={team_id:t,role:o.role,user_id:o.user_id};void 0!==o.user_email&&(n.user_email=o.user_email),void 0!==o.max_budget_in_team&&null!==o.max_budget_in_team&&(n.max_budget_in_team=o.max_budget_in_team),void 0!==o.tpm_limit&&null!==o.tpm_limit&&(n.tpm_limit=o.tpm_limit),void 0!==o.rpm_limit&&null!==o.rpm_limit&&(n.rpm_limit=o.rpm_limit),console.log("Final request body:",n);let c=await fetch(r,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(n)});if(!c.ok){var a;let e=await c.text(),t={};try{t=JSON.parse(e)}catch(t){console.warn("Failed to parse error body as JSON:",e)}let o=(null==t?void 0:null===(a=t.detail)||void 0===a?void 0:a.error)||"Failed to add team member",r=Error(o);throw r.raw=t,r}let l=await c.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to update team member:",e),e}},tp=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=u?"".concat(u,"/team/member_delete"):"/team/member_delete",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({team_id:t,...void 0!==o.user_email&&{user_email:o.user_email},...void 0!==o.user_id&&{user_id:o.user_id}})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create key:",e),e}},tg=async(e,t,o)=>{try{console.log("Form Values in teamMemberAddCall:",o);let a=u?"".concat(u,"/organization/member_add"):"/organization/member_add",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,member:o})});if(!r.ok){let e=await r.text();throw y(e),console.error("Error response from the server:",e),Error(e)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to create organization member:",e),e}},tf=async(e,t,o)=>{try{console.log("Form Values in organizationMemberDeleteCall:",o);let a=u?"".concat(u,"/organization/member_delete"):"/organization/member_delete",r=await fetch(a,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,user_id:o})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to delete organization member:",e),e}},tm=async(e,t,o)=>{try{console.log("Form Values in organizationMemberUpdateCall:",o);let a=u?"".concat(u,"/organization/member_update"):"/organization/member_update",r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({organization_id:t,...o})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("API Response:",n),n}catch(e){throw console.error("Failed to update organization member:",e),e}},tw=async(e,t,o)=>{try{console.log("Form Values in userUpdateUserCall:",t);let a=u?"".concat(u,"/user/update"):"/user/update",r={...t};null!==o&&(r.user_role=o),r=JSON.stringify(r);let n=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!n.ok){let e=await n.json(),t=at(e);throw y(t),Error(t)}let c=await n.json();return console.log("API Response:",c),c}catch(e){throw console.error("Failed to create key:",e),e}},ty=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let r;console.log("Form Values in userUpdateUserCall:",t);let n=u?"".concat(u,"/user/bulk_update"):"/user/bulk_update";if(a)r=JSON.stringify({all_users:!0,user_updates:t});else if(o&&o.length>0){let e=[];for(let a of o)e.push({user_id:a,...t});r=JSON.stringify({users:e})}else throw Error("Must provide either userIds or set allUsers=true");let c=await fetch(n,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:r});if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}let l=await c.json();return console.log("API Response:",l),l}catch(e){throw console.error("Failed to create key:",e),e}},tj=async(e,t)=>{try{let o=u?"".concat(u,"/global/predict/spend/logs"):"/global/predict/spend/logs",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({data:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log(r),r}catch(e){throw console.error("Failed to create key:",e),e}},t_=async e=>{try{let t=u?"".concat(u,"/health/services?service=slack_budget_alerts"):"/health/services?service=slack_budget_alerts";console.log("Checking Slack Budget Alerts service health");let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}let a=await o.json();return c.Z.success("Test Slack Alert worked - check your Slack!"),console.log("Service Health Response:",a),a}catch(e){throw console.error("Failed to perform health check:",e),e}},tv=async(e,t)=>{try{let o=u?"".concat(u,"/health/services?service=").concat(t):"/health/services?service=".concat(t);console.log("Checking Slack Budget Alerts service health");let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}return await a.json()}catch(e){throw console.error("Failed to perform health check:",e),e}},tC=async e=>{try{let t=u?"".concat(u,"/budget/list"):"/budget/list",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tT=async e=>{try{let t=u?"".concat(u,"/budget/settings"):"/budget/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tk=async(e,t,o)=>{try{let t=u?"".concat(u,"/get/config/callbacks"):"/get/config/callbacks",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tE=async e=>{try{let t=u?"".concat(u,"/config/list?config_type=general_settings"):"/config/list?config_type=general_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tS=async e=>{try{let t=u?"".concat(u,"/router/settings"):"/router/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get router settings:",e),e}},tb=async e=>{try{let t=u?"".concat(u,"/cache/settings"):"/cache/settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get cache settings:",e),e}},tF=async(e,t)=>{try{let o=u?"".concat(u,"/cache/settings/test"):"/cache/settings/test",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({cache_settings:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to test cache connection:",e),e}},tP=async(e,t)=>{try{let o=u?"".concat(u,"/cache/settings"):"/cache/settings",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({cache_settings:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to update cache settings:",e),e}},tO=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint";t&&(o+="/team/".concat(t));let a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tB=async(e,t)=>{try{let o=u?"".concat(u,"/config/field/info?field_name=").concat(t):"/config/field/info?field_name=".concat(t),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tN=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tx=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint"):"/config/pass_through_endpoint",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tA=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/field/update"):"/config/field/update",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,field_value:o,config_type:"general_settings"})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Successfully updated value!"),n}catch(e){throw console.error("Failed to set callbacks:",e),e}},tJ=async(e,t)=>{try{let o=u?"".concat(u,"/config/field/delete"):"/config/field/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({field_name:t,config_type:"general_settings"})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return c.Z.success("Field reset on proxy"),r}catch(e){throw console.error("Failed to get callbacks:",e),e}},tG=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint?endpoint_id=").concat(t):"/config/pass_through_endpoint?endpoint_id=".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tU=async(e,t)=>{try{let o=u?"".concat(u,"/config/update"):"/config/update",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to set callbacks:",e),e}},tR=async e=>{try{let t=u?"".concat(u,"/health"):"/health",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to call /health:",e),e}},tI=async(e,t)=>{try{let o=u?"".concat(u,"/health?model=").concat(encodeURIComponent(t)):"/health?model=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to call /health for model ".concat(t,":"),e),e}},tM=async e=>{try{let t=u?"".concat(u,"/cache/ping"):"/cache/ping",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /cache/ping:",e),e}},tz=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;try{let n=u?"".concat(u,"/health/history"):"/health/history",c=new URLSearchParams;t&&c.append("model",t),o&&c.append("status_filter",o),c.append("limit",a.toString()),c.append("offset",r.toString()),c.toString()&&(n+="?".concat(c.toString()));let l=await fetch(n,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.text();throw y(e),Error(e)}return await l.json()}catch(e){throw console.error("Failed to call /health/history:",e),e}},tL=async e=>{try{let t=u?"".concat(u,"/health/latest"):"/health/latest",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error(e)}return await o.json()}catch(e){throw console.error("Failed to call /health/latest:",e),e}},tD=async e=>{try{console.log("Getting proxy UI settings"),console.log("proxyBaseUrl in getProxyUISettings:",u);let t=u?"".concat(u,"/sso/get/ui_settings"):"/sso/get/ui_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get callbacks:",e),e}},tV=async e=>{try{let t=u?"".concat(u,"/v2/guardrails/list"):"/v2/guardrails/list",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get guardrails list:",e),e}},tq=async e=>{try{let t=u?"".concat(u,"/prompts/list"):"/prompts/list",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to get prompts list:",e),e}},tZ=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t,"/info"):"/prompts/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get prompt info:",e),e}},tH=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t,"/versions"):"/prompts/".concat(t,"/versions"),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw 404!==a.status&&y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to get prompt versions:",e),e}},tY=async(e,t)=>{try{let o=u?"".concat(u,"/prompts"):"/prompts",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to create prompt:",e),e}},tW=async(e,t,o)=>{try{let a=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),r=await fetch(a,{method:"PUT",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to update prompt:",e),e}},tQ=async(e,t)=>{try{let o=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to delete prompt:",e),e}},tK=async(e,t)=>{try{let o=new FormData;o.append("file",t);let a=u?"".concat(u,"/utils/dotprompt_json_converter"):"/utils/dotprompt_json_converter",r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e)},body:o});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to convert prompt file:",e),e}},t$=async(e,t,o)=>{try{let a=u?"".concat(u,"/prompts/").concat(t):"/prompts/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}return await r.json()}catch(e){throw console.error("Failed to patch prompt:",e),e}},tX=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents"):"/v1/agents",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Create agent response:",r),r}catch(e){throw console.error("Failed to create agent:",e),e}},t0=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails"):"/guardrails",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({guardrail:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Create guardrail response:",r),r}catch(e){throw console.error("Failed to create guardrail:",e),e}},t1=async(e,t,o)=>{try{let a=u?"".concat(u,"/spend/logs/ui/").concat(t,"?start_date=").concat(encodeURIComponent(o)):"/spend/logs/ui/".concat(t,"?start_date=").concat(encodeURIComponent(o));console.log("Fetching log details from:",a);let r=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("Fetched log details:",n),n}catch(e){throw console.error("Failed to fetch log details:",e),e}},t4=async e=>{try{let t=u?"".concat(u,"/get/internal_user_settings"):"/get/internal_user_settings";console.log("Fetching SSO settings from:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched SSO settings:",a),a}catch(e){throw console.error("Failed to fetch SSO settings:",e),e}},t3=async(e,t)=>{try{let o=u?"".concat(u,"/update/internal_user_settings"):"/update/internal_user_settings";console.log("Updating internal user settings:",t);let a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Updated internal user settings:",r),c.Z.success("Internal user settings updated successfully"),r}catch(e){throw console.error("Failed to update internal user settings:",e),e}},t2=async e=>{try{let t=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server";console.log("Fetching MCP servers from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched MCP servers:",a),a}catch(e){throw console.error("Failed to fetch MCP servers:",e),e}},t5=async(e,t)=>{try{let o=u?"".concat(u,"/v1/mcp/server/health"):"/v1/mcp/server/health";if(t&&t.length>0){let e=new URLSearchParams;t.forEach(t=>e.append("server_ids",t)),o="".concat(o,"?").concat(e.toString())}console.log("Fetching MCP server health from:",o);let a=await fetch(o,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Fetched MCP server health:",r),r}catch(e){throw console.error("Failed to fetch MCP server health:",e),e}},t9=async e=>{try{let t=u?"".concat(u,"/v1/mcp/access_groups"):"/v1/mcp/access_groups";console.log("Fetching MCP access groups from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched MCP access groups:",a),a.access_groups||[]}catch(e){throw console.error("Failed to fetch MCP access groups:",e),e}},t6=async(e,t)=>{try{console.log("Form Values in createMCPServer:",t);let o=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("API Response:",r),r}catch(e){throw console.error("Failed to create key:",e),e}},t8=async(e,t)=>{try{let o=u?"".concat(u,"/v1/mcp/server"):"/v1/mcp/server",a=await fetch(o,{method:"PUT",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to update MCP server:",e),e}},t7=async(e,t)=>{try{let o=(u?"".concat(u):"")+"/v1/mcp/server/".concat(t);console.log("in deleteMCPServer:",t);let a=await fetch(o,{method:f.DELETE,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}}catch(e){throw console.error("Failed to delete key:",e),e}},oe=async e=>{try{let t=u?"".concat(u,"/search_tools/list"):"/search_tools/list";console.log("Fetching search tools from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched search tools:",a),a}catch(e){throw console.error("Failed to fetch search tools:",e),e}},ot=async(e,t)=>{try{let o=u?"".concat(u,"/search_tools/").concat(t):"/search_tools/".concat(t);console.log("Fetching search tool by ID from:",o);let a=await fetch(o,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Fetched search tool:",r),r}catch(e){throw console.error("Failed to fetch search tool:",e),e}},oo=async(e,t)=>{try{console.log("Creating search tool with values:",t);let o=u?"".concat(u,"/search_tools"):"/search_tools",a=await fetch(o,{method:f.POST,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({search_tool:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Created search tool:",r),r}catch(e){throw console.error("Failed to create search tool:",e),e}},oa=async(e,t,o)=>{try{console.log("Updating search tool with ID:",t,"values:",o);let a=u?"".concat(u,"/search_tools/").concat(t):"/search_tools/".concat(t),r=await fetch(a,{method:f.PUT,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({search_tool:o})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("Updated search tool:",n),n}catch(e){throw console.error("Failed to update search tool:",e),e}},or=async(e,t)=>{try{let o=(u?"".concat(u):"")+"/search_tools/".concat(t);console.log("Deleting search tool:",t);let a=await fetch(o,{method:f.DELETE,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Deleted search tool:",r),r}catch(e){throw console.error("Failed to delete search tool:",e),e}},on=async e=>{try{let t=u?"".concat(u,"/search_tools/ui/available_providers"):"/search_tools/ui/available_providers";console.log("Fetching available search providers from:",t);let o=await fetch(t,{method:f.GET,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched available search providers:",a),a}catch(e){throw console.error("Failed to fetch available search providers:",e),e}},oc=async(e,t)=>{try{let o=u?"".concat(u,"/search_tools/test_connection"):"/search_tools/test_connection";console.log("Testing search tool connection:",o);let a=await fetch(o,{method:f.POST,headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({litellm_params:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Test connection response:",r),r}catch(e){throw console.error("Failed to test search tool connection:",e),e}},ol=async(e,t)=>{try{let o=u?"".concat(u,"/mcp-rest/tools/list?server_id=").concat(t):"/mcp-rest/tools/list?server_id=".concat(t);console.log("Fetching MCP tools from:",o);let a={[v]:"Bearer ".concat(e),"Content-Type":"application/json"},r=await fetch(o,{method:"GET",headers:a}),n=await r.json();if(console.log("Fetched MCP tools response:",n),!r.ok){if(n.error&&n.message)throw Error(n.message);throw Error("Failed to fetch MCP tools")}return n}catch(e){return console.error("Failed to fetch MCP tools:",e),{tools:[],error:"network_error",message:e instanceof Error?e.message:"Failed to fetch MCP tools",stack_trace:null}}},oi=async(e,t,o)=>{try{let a=u?"".concat(u,"/mcp-rest/tools/call"):"/mcp-rest/tools/call";console.log("Calling MCP tool:",t,"with arguments:",o);let r={[v]:"Bearer ".concat(e),"Content-Type":"application/json"},n=await fetch(a,{method:"POST",headers:r,body:JSON.stringify({name:t,arguments:o})});if(!n.ok){let e="Network response was not ok",t=null,o=await n.text();try{let a=JSON.parse(o);a.detail?"string"==typeof a.detail?e=a.detail:"object"==typeof a.detail&&(e=a.detail.message||a.detail.error||"An error occurred",t=a.detail):e=a.message||a.error||e}catch(t){console.error("Failed to parse JSON error response:",t),o&&(e=o)}let a=Error(e);throw a.status=n.status,a.statusText=n.statusText,a.details=t,y(e),a}let c=await n.json();return console.log("MCP tool call response:",c),c}catch(e){throw console.error("Failed to call MCP tool:",e),console.error("Error type:",typeof e),e instanceof Error&&(console.error("Error message:",e.message),console.error("Error stack:",e.stack)),e}},os=async(e,t)=>{try{let o=u?"".concat(u,"/tag/new"):"/tag/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error creating tag:",e),e}},od=async(e,t)=>{try{let o=u?"".concat(u,"/tag/update"):"/tag/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error updating tag:",e),e}},ou=async(e,t)=>{try{let o=u?"".concat(u,"/tag/info"):"/tag/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({names:t})});if(!a.ok){let e=await a.text();return await y(e),{}}return await a.json()}catch(e){throw console.error("Error getting tag info:",e),e}},oh=async e=>{try{let t=u?"".concat(u,"/tag/list"):"/tag/list",o=await fetch(t,{method:"GET",headers:{Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.text();return await y(e),{}}return await o.json()}catch(e){throw console.error("Error listing tags:",e),e}},op=async(e,t)=>{try{let o=u?"".concat(u,"/tag/delete"):"/tag/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({name:t})});if(!a.ok){let e=await a.text();await y(e);return}return await a.json()}catch(e){throw console.error("Error deleting tag:",e),e}},og=async e=>{try{let t=u?"".concat(u,"/get/default_team_settings"):"/get/default_team_settings";console.log("Fetching default team settings from:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched default team settings:",a),a}catch(e){throw console.error("Failed to fetch default team settings:",e),e}},of=async(e,t)=>{try{let o=u?"".concat(u,"/update/default_team_settings"):"/update/default_team_settings";console.log("Updating default team settings:",t);let a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Updated default team settings:",r),c.Z.success("Default team settings updated successfully"),r}catch(e){throw console.error("Failed to update default team settings:",e),e}},om=async(e,t)=>{try{let o=u?"".concat(u,"/team/permissions_list?team_id=").concat(t):"/team/permissions_list?team_id=".concat(t),a=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=await a.json();return console.log("Team permissions response:",r),r}catch(e){throw console.error("Failed to get team permissions:",e),e}},ow=async(e,t,o)=>{try{let a=u?"".concat(u,"/team/permissions_update"):"/team/permissions_update",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({team_id:t,team_member_permissions:o})});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return console.log("Team permissions response:",n),n}catch(e){throw console.error("Failed to update team permissions:",e),e}},oy=async(e,t)=>{try{let o=u?"".concat(u,"/spend/logs/session/ui?session_id=").concat(encodeURIComponent(t)):"/spend/logs/session/ui?session_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to fetch session logs:",e),e}},oj=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/new"):"/vector_store/new",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create vector store")}return await a.json()}catch(e){throw console.error("Error creating vector store:",e),e}},o_=async function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let t=u?"".concat(u,"/vector_store/list"):"/vector_store/list",o=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}});if(!o.ok){let e=await o.json();throw Error(e.detail||"Failed to list vector stores")}return await o.json()}catch(e){throw console.error("Error listing vector stores:",e),e}},ov=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/delete"):"/vector_store/delete",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to delete vector store")}return await a.json()}catch(e){throw console.error("Error deleting vector store:",e),e}},oC=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/info"):"/vector_store/info",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({vector_store_id:t})});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to get vector store info")}return await a.json()}catch(e){throw console.error("Error getting vector store info:",e),e}},oT=async(e,t)=>{try{let o=u?"".concat(u,"/vector_store/update"):"/vector_store/update",a=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update vector store")}return await a.json()}catch(e){throw console.error("Error updating vector store:",e),e}},ok=async e=>{try{let t=u?"".concat(u,"/email/event_settings"):"/email/event_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get email event settings")}let a=await o.json();return console.log("Email event settings response:",a),a}catch(e){throw console.error("Failed to get email event settings:",e),e}},oE=async(e,t)=>{try{let o=u?"".concat(u,"/email/event_settings"):"/email/event_settings",a=await fetch(o,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to update email event settings")}let r=await a.json();return console.log("Update email event settings response:",r),r}catch(e){throw console.error("Failed to update email event settings:",e),e}},oS=async e=>{try{let t=u?"".concat(u,"/email/event_settings/reset"):"/email/event_settings/reset",o=await fetch(t,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to reset email event settings")}let a=await o.json();return console.log("Reset email event settings response:",a),a}catch(e){throw console.error("Failed to reset email event settings:",e),e}},ob=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Delete agent response:",r),r}catch(e){throw console.error("Failed to delete agent:",e),e}},oF=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t,"/make_public"):"/v1/agents/".concat(t,"/make_public"),a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agent public response:",r),r}catch(e){throw console.error("Failed to make agent public:",e),e}},oP=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/make_public"):"/v1/agents/make_public",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({agent_ids:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agents public response:",r),r}catch(e){throw console.error("Failed to make agents public:",e),e}},oO=async(e,t)=>{try{let o=u?"".concat(u,"/v1/mcp/make_public"):"/v1/mcp/make_public",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({mcp_server_ids:t})});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Make agents public response:",r),r}catch(e){throw console.error("Failed to make agents public:",e),e}},oB=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/").concat(t):"/guardrails/".concat(t),a=await fetch(o,{method:"DELETE",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error(e)}let r=await a.json();return console.log("Delete guardrail response:",r),r}catch(e){throw console.error("Failed to delete guardrail:",e),e}},oN=async e=>{try{let t=u?"".concat(u,"/guardrails/ui/add_guardrail_settings"):"/guardrails/ui/add_guardrail_settings",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get guardrail UI settings")}let a=await o.json();return console.log("Guardrail UI settings response:",a),a}catch(e){throw console.error("Failed to get guardrail UI settings:",e),e}},ox=async e=>{try{let t=u?"".concat(u,"/guardrails/ui/provider_specific_params"):"/guardrails/ui/provider_specific_params",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get guardrail provider specific parameters")}let a=await o.json();return console.log("Guardrail provider specific params response:",a),a}catch(e){throw console.error("Failed to get guardrail provider specific parameters:",e),e}},oA=async(e,t)=>{try{let o=encodeURIComponent(t),a=u?"".concat(u,"/guardrails/ui/category_yaml/").concat(o):"/guardrails/ui/category_yaml/".concat(o);console.log("Fetching category YAML from: ".concat(a));let r=await fetch(a,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!r.ok){let e=await r.text();throw console.error("Failed to get category YAML. Status: ".concat(r.status,", Error:"),e),y(e),Error("Failed to get category YAML: ".concat(r.status," ").concat(e))}let n=await r.json();return console.log("Category YAML response:",n),n}catch(e){throw console.error("Failed to get category YAML:",e),e}},oJ=async e=>{try{let t=u?"".concat(u,"/v1/agents"):"/v1/agents",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.text();throw y(e),Error("Failed to get agents list")}let a=await o.json();return console.log("Agents list response:",a),{agents:a}}catch(e){throw console.error("Failed to get agents list:",e),e}},oG=async(e,t)=>{try{let o=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to get agent info")}let r=await a.json();return console.log("Agent info response:",r),r}catch(e){throw console.error("Failed to get agent info:",e),e}},oU=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/").concat(t,"/info"):"/guardrails/".concat(t,"/info"),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to get guardrail info")}let r=await a.json();return console.log("Guardrail info response:",r),r}catch(e){throw console.error("Failed to get guardrail info:",e),e}},oR=async(e,t,o)=>{try{let a=u?"".concat(u,"/v1/agents/").concat(t):"/v1/agents/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw y(e),Error("Failed to patch agent")}let n=await r.json();return console.log("Patch agent response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},oI=async(e,t,o)=>{try{let a=u?"".concat(u,"/guardrails/").concat(t):"/guardrails/".concat(t),r=await fetch(a,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.text();throw y(e),Error("Failed to update guardrail")}let n=await r.json();return console.log("Update guardrail response:",n),n}catch(e){throw console.error("Failed to update guardrail:",e),e}},oM=async(e,t,o,a,r)=>{try{let c=u?"".concat(u,"/guardrails/apply_guardrail"):"/guardrails/apply_guardrail",l={guardrail_name:t,text:o};a&&(l.language=a),r&&r.length>0&&(l.entities=r);let i=await fetch(c,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(l)});if(!i.ok){let e=await i.text(),t="Failed to apply guardrail";try{var n;let o=JSON.parse(e);(null===(n=o.error)||void 0===n?void 0:n.message)?t=o.error.message:o.detail?t=o.detail:o.message&&(t=o.message)}catch(o){t=e||t}throw y(e),Error(t)}let s=await i.json();return console.log("Apply guardrail response:",s),s}catch(e){throw console.error("Failed to apply guardrail:",e),e}},oz=async(e,t)=>{try{let o=u?"".concat(u,"/guardrails/validate_blocked_words_file"):"/guardrails/validate_blocked_words_file",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({file_content:t})});if(!a.ok){let e=await a.text();throw y(e),Error("Failed to validate blocked words file")}let r=await a.json();return console.log("Validate blocked words file response:",r),r}catch(e){throw console.error("Failed to validate blocked words file:",e),e}},oL=async e=>{try{let t=u?"".concat(u,"/get/sso_settings"):"/get/sso_settings";console.log("Fetching SSO configuration from:",t);let o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}let a=await o.json();return console.log("Fetched SSO configuration:",a),a}catch(e){throw console.error("Failed to fetch SSO configuration:",e),e}},oD=async(e,t)=>{try{let r=u?"".concat(u,"/update/sso_settings"):"/update/sso_settings";console.log("Updating SSO configuration:",t);let n=await fetch(r,{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){var o,a;let e=await n.json(),t="object"==typeof(null==e?void 0:e.detail)?(null===(o=e.detail)||void 0===o?void 0:o.error)||(null===(a=e.detail)||void 0===a?void 0:a.message):null==e?void 0:e.detail,r="string"==typeof t&&t.length>0?t:at(e);y(r);let c=Error(r);throw(null==e?void 0:e.detail)!==void 0&&(c.detail=e.detail),c.rawError=e,c}let c=await n.json();return console.log("Updated SSO configuration:",c),c}catch(e){throw console.error("Failed to update SSO configuration:",e),e}},oV=async(e,t,o,a,r)=>{try{let t=u?"".concat(u,"/audit"):"/audit",o=new URLSearchParams;a&&o.append("page",a.toString()),r&&o.append("page_size",r.toString());let n=o.toString();n&&(t+="?".concat(n));let c=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!c.ok){let e=await c.json(),t=at(e);throw y(t),Error(t)}return await c.json()}catch(e){throw console.error("Failed to fetch audit logs:",e),e}},oq=async e=>{try{let t=u?"".concat(u,"/user/available_users"):"/user/available_users",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e)}});if(!o.ok){if(404===o.status)return null;let e=await o.text();throw y(e),Error("Network response was not ok")}return await o.json()}catch(e){throw console.error("Failed to fetch remaining users:",e),e}},oZ=async(e,t,o)=>{try{let a=u?"".concat(u,"/config/pass_through_endpoint/").concat(encodeURIComponent(t)):"/config/pass_through_endpoint/".concat(encodeURIComponent(t)),r=await fetch(a,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(o)});if(!r.ok){let e=await r.json(),t=at(e);throw y(t),Error(t)}let n=await r.json();return c.Z.success("Pass through endpoint updated successfully"),n}catch(e){throw console.error("Failed to update pass through endpoint:",e),e}},oH=async(e,t)=>{try{let o=u?"".concat(u,"/config/pass_through_endpoint?endpoint_id=").concat(encodeURIComponent(t)):"/config/pass_through_endpoint?endpoint_id=".concat(encodeURIComponent(t)),a=await fetch(o,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}let r=(await a.json()).endpoints;if(!r||0===r.length)throw Error("Pass through endpoint not found");return r[0]}catch(e){throw console.error("Failed to get pass through endpoint info:",e),e}},oY=async(e,t)=>{try{let o=u?"".concat(u,"/config/callback/delete"):"/config/callback/delete",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({callback_name:t})});if(!a.ok){let e=await a.json(),t=at(e);throw y(t),Error(t)}return await a.json()}catch(e){throw console.error("Failed to delete specific callback:",e),e}},oW=async e=>{let t=g(),o=await fetch("".concat(t,"/v1/mcp/tools"),{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok)throw Error("HTTP error! status: ".concat(o.status));return await o.json()},oQ=async(e,t)=>{try{console.log("Testing MCP connection with config:",JSON.stringify(t));let a=u?"".concat(u,"/mcp-rest/test/connection"):"/mcp-rest/test/connection",r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",[v]:"Bearer ".concat(e)},body:JSON.stringify(t)}),n=r.headers.get("content-type");if(!n||!n.includes("application/json")){let e=await r.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(r.status,": ").concat(r.statusText,"). Check network tab for details."))}let c=await r.json();if(!r.ok||"error"===c.status){if("error"===c.status);else{var o;return{status:"error",message:(null===(o=c.error)||void 0===o?void 0:o.message)||"MCP connection test failed: ".concat(r.status," ").concat(r.statusText)}}}return c}catch(e){throw console.error("MCP connection test error:",e),e}},oK=async(e,t,o)=>{try{console.log("Testing MCP tools list with config:",JSON.stringify(t));let a=u?"".concat(u,"/mcp-rest/test/tools/list"):"/mcp-rest/test/tools/list",r={"Content-Type":"application/json"};e&&(r["x-litellm-api-key"]=e),o?r.Authorization="Bearer ".concat(o):e&&(r[v]="Bearer ".concat(e));let n=await fetch(a,{method:"POST",headers:r,body:JSON.stringify(t)}),c=n.headers.get("content-type");if(!c||!c.includes("application/json")){let e=await n.text();throw console.error("Received non-JSON response:",e),Error("Received non-JSON response (".concat(n.status,": ").concat(n.statusText,"). Check network tab for details."))}let l=await n.json();if((!n.ok||l.error)&&!l.error)return{tools:[],error:"request_failed",message:l.message||"MCP tools list failed: ".concat(n.status," ").concat(n.statusText)};return l}catch(e){throw console.error("MCP tools list test error:",e),e}},o$=async(e,t)=>{let o=u?"".concat(u,"/v1/mcp/server/oauth/session"):"/v1/mcp/server/oauth/session",a=await fetch(o,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await a.json();if(!a.ok)throw Error(at(r)||(null==r?void 0:r.error)||"Failed to cache MCP server");return r},oX=async(e,t,o)=>{let a=g(),r=encodeURIComponent(t.trim()),n="".concat(a,"/v1/mcp/server/oauth/").concat(r,"/register"),c=await fetch(n,{method:"POST",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify(o)}),l=await c.json();if(!c.ok)throw Error(at(l)||(null==l?void 0:l.detail)||"Failed to register OAuth client");return l},o0=e=>{let{serverId:t,clientId:o,redirectUri:a,state:r,codeChallenge:n,scope:c}=e,l=g(),i=encodeURIComponent(t.trim()),s="".concat(l,"/v1/mcp/server/oauth/").concat(i,"/authorize"),d=new URLSearchParams({redirect_uri:a,state:r,response_type:"code",code_challenge:n,code_challenge_method:"S256"});return o&&o.trim().length>0&&d.set("client_id",o),c&&c.trim().length>0&&d.set("scope",c),"".concat(s,"?").concat(d.toString())},o1=async e=>{let{serverId:t,code:o,clientId:a,clientSecret:r,codeVerifier:n,redirectUri:c}=e,l=g(),i=encodeURIComponent(t.trim()),s="".concat(l,"/v1/mcp/server/oauth/").concat(i,"/token"),d=new URLSearchParams;d.set("grant_type","authorization_code"),d.set("code",o),a&&a.trim().length>0&&d.set("client_id",a),r&&r.trim().length>0&&d.set("client_secret",r),d.set("code_verifier",n),d.set("redirect_uri",c);let u=await fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d.toString()}),h=await u.json();if(!u.ok)throw Error(at(h)||(null==h?void 0:h.detail)||"OAuth token exchange failed");return h},o4=async(e,t,o)=>{try{let a="".concat(g(),"/v1/vector_stores/").concat(t,"/search"),r=await fetch(a,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o})});if(!r.ok){let e=await r.text();return await y(e),null}return await r.json()}catch(e){throw console.error("Error testing vector store search:",e),e}},o3=async(e,t,o,a)=>{try{let r="".concat(g(),"/v1/search/").concat(t),n=await fetch(r,{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({query:o,max_results:a||5})});if(!n.ok){let e=await n.text();return await y(e),null}return await n.json()}catch(e){throw console.error("Error querying search tool:",e),e}},o2=async function(e,t,o){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:50,n=arguments.length>5?arguments[5]:void 0;try{let c=u?"".concat(u,"/tag/user-agent/analytics"):"/tag/user-agent/analytics",l=new URLSearchParams,i=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};l.append("start_date",i(t)),l.append("end_date",i(o)),l.append("page",a.toString()),l.append("page_size",r.toString()),n&&l.append("user_agent_filter",n);let s=l.toString();s&&(c+="?".concat(s));let d=await fetch(c,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!d.ok){let e=await d.json(),t=at(e);throw y(t),Error(t)}return await d.json()}catch(e){throw console.error("Failed to fetch user agent analytics:",e),e}},o5=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/dau"):"/tag/dau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=at(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch DAU:",e),e}},o9=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/wau"):"/tag/wau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=at(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch WAU:",e),e}},o6=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/mau"):"/tag/mau",n=new URLSearchParams;n.append("end_date",(e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)})(t)),a&&a.length>0?a.forEach(e=>{n.append("tag_filters",e)}):o&&n.append("tag_filter",o);let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=at(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch MAU:",e),e}},o8=async e=>{try{let t=u?"".concat(u,"/tag/distinct"):"/tag/distinct",o=await fetch(t,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!o.ok){let e=await o.json(),t=at(e);throw y(t),Error(t)}return await o.json()}catch(e){throw console.error("Failed to fetch distinct tags:",e),e}},o7=async(e,t,o,a)=>{try{let r=u?"".concat(u,"/tag/summary"):"/tag/summary",n=new URLSearchParams,c=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(o,"-").concat(a)};n.append("start_date",c(t)),n.append("end_date",c(o)),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let l=n.toString();l&&(r+="?".concat(l));let i=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!i.ok){let e=await i.json(),t=at(e);throw y(t),Error(t)}return await i.json()}catch(e){throw console.error("Failed to fetch user agent summary:",e),e}},ae=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,a=arguments.length>3?arguments[3]:void 0;try{let r=u?"".concat(u,"/tag/user-agent/per-user-analytics"):"/tag/user-agent/per-user-analytics",n=new URLSearchParams;n.append("page",t.toString()),n.append("page_size",o.toString()),a&&a.length>0&&a.forEach(e=>{n.append("tag_filters",e)});let c=n.toString();c&&(r+="?".concat(c));let l=await fetch(r,{method:"GET",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!l.ok){let e=await l.json(),t=at(e);throw y(t),Error(t)}return await l.json()}catch(e){throw console.error("Failed to fetch per-user analytics:",e),e}},at=e=>(null==e?void 0:e.error)&&(e.error.message||e.error)||(null==e?void 0:e.message)||(null==e?void 0:e.detail)||(null==e?void 0:e.error)||JSON.stringify(e),ao=async(e,t)=>{let o=g(),a=JSON.stringify({username:e,password:t}),r=await fetch(o?"".concat(o,"/v2/login"):"/v2/login",{method:"POST",body:a,credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok)throw Error(at(await r.json()));return await r.json()},aa=async e=>{let t=g(),o=await fetch(t?"".concat(t,"/get/ui_settings"):"/get/ui_settings",{method:"GET",headers:{[v]:"Bearer ".concat(e)}});if(!o.ok)throw Error(at(await o.json()));return await o.json()},ar=async(e,t)=>{let o=g(),a=await fetch(o?"".concat(o,"/update/ui_settings"):"/update/ui_settings",{method:"PATCH",headers:{[v]:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw Error(at(await a.json()));return await a.json()}},85968:function(e,t,o){o.d(t,{O:function(){return a}});let a=e=>{if(!e)return"An unknown error occurred";if("string"==typeof e)return e;if(e.message)try{let t=JSON.parse(e.message);if(t.error&&t.error.message)return t.error.message;return"string"==typeof t?t:JSON.stringify(t,null,2)}catch(t){return e.message}if(e.response&&e.response.data){if("string"==typeof e.response.data)return e.response.data;if(e.response.data.message)return e.response.data.message;if(e.response.data.error)return"string"==typeof e.response.data.error?e.response.data.error:e.response.data.error.message||JSON.stringify(e.response.data.error)}return String(e)}},3914:function(e,t,o){function a(){if("undefined"==typeof document)return;let e=window.location.hostname,t=window.location.pathname,o=["/","/ui"];if(t&&"/"!==t&&!t.startsWith("/ui")){let e=t.substring(0,t.lastIndexOf("/")+1);e&&!o.includes(e)&&o.push(e)}let a=["Lax","Strict","None"];o.forEach(t=>{document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,";"),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; domain=").concat(e,";"),a.forEach(o=>{let a="None"===o?" Secure;":"";document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; SameSite=").concat(o,";").concat(a),document.cookie="token=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=".concat(t,"; domain=").concat(e,"; SameSite=").concat(o,";").concat(a)})}),console.log("After clearing cookies:",document.cookie)}function r(e){if("undefined"==typeof document)return null;let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}o.d(t,{b:function(){return a},e:function(){return r}})},9309:function(e,t,o){o.d(t,{Ac:function(){return n},N4:function(){return a},aS:function(){return r}});let a=e=>e?e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):e;function r(e,t){return e.length>t?e.substring(0,t)+"...":e}let n=(e,t)=>{if(!t)return Promise.resolve();try{return JSON.parse(t),Promise.resolve()}catch(e){return Promise.reject("Please enter valid JSON")}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8143-a060d3236c194d12.js b/litellm/proxy/_experimental/out/_next/static/chunks/8143-a060d3236c194d12.js deleted file mode 100644 index 4399298f84e..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8143-a060d3236c194d12.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8143],{18143:function(e,a,s){s.d(a,{Z:function(){return P}});var t=s(57437),l=s(40278),n=s(96889),r=s(12514),o=s(97765),i=s(21626),c=s(97214),d=s(28241),h=s(58834),u=s(69552),x=s(71876),m=s(96761),g=s(2265),p=s(47375),j=s(39789),Z=s(75105),y=s(78489),S=s(49804),_=s(14042),w=s(67101),f=s(92414),v=s(46030),k=s(27281),D=s(57365),E=s(12485),N=s(18135),C=s(35242),I=s(29706),F=s(77991),b=s(84264),T=s(19250),M=s(32176),A=s(59872);console.log("process.env.NODE_ENV","production");let L=e=>null!==e&&("Admin"===e||"Admin Viewer"===e);var P=e=>{let{accessToken:a,token:s,userRole:P,userID:V,keys:U,premiumUser:Y}=e,B=new Date,[O,q]=(0,g.useState)([]),[W,R]=(0,g.useState)([]),[G,K]=(0,g.useState)([]),[z,Q]=(0,g.useState)([]),[X,$]=(0,g.useState)([]),[H,J]=(0,g.useState)([]),[ee,ea]=(0,g.useState)([]),[es,et]=(0,g.useState)([]),[el,en]=(0,g.useState)([]),[er,eo]=(0,g.useState)([]),[ei,ec]=(0,g.useState)({}),[ed,eh]=(0,g.useState)([]),[eu,ex]=(0,g.useState)(""),[em,eg]=(0,g.useState)(["all-tags"]),[ep,ej]=(0,g.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[eZ,ey]=(0,g.useState)(null),[eS,e_]=(0,g.useState)(0),ew=new Date(B.getFullYear(),B.getMonth(),1),ef=new Date(B.getFullYear(),B.getMonth()+1,0),ev=eI(ew),ek=eI(ef);function eD(e){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0,notation:"compact",compactDisplay:"short"}).format(e)}console.log("keys in usage",U),console.log("premium user in usage",Y);let eE=async()=>{if(a)try{let e=await (0,T.getProxyUISettings)(a);return console.log("usage tab: proxy_settings",e),e}catch(e){console.error("Error fetching proxy settings:",e)}};(0,g.useEffect)(()=>{eC(ep.from,ep.to)},[ep,em]);let eN=async(e,s,t)=>{if(!e||!s||!a)return;console.log("uiSelectedKey",t);let l=await (0,T.adminTopEndUsersCall)(a,t,e.toISOString(),s.toISOString());console.log("End user data updated successfully",l),Q(l)},eC=async(e,s)=>{if(!e||!s||!a)return;let t=await eE();null!=t&&t.DISABLE_EXPENSIVE_DB_QUERIES||(J((await (0,T.tagsSpendLogsCall)(a,e.toISOString(),s.toISOString(),0===em.length?void 0:em)).spend_per_tag),console.log("Tag spend data updated successfully"))};function eI(e){let a=e.getFullYear(),s=e.getMonth()+1,t=e.getDate();return"".concat(a,"-").concat(s<10?"0"+s:s,"-").concat(t<10?"0"+t:t)}console.log("Start date is ".concat(ev)),console.log("End date is ".concat(ek));let eF=async(e,a,s)=>{try{let s=await e();a(s)}catch(e){console.error(s,e)}},eb=(e,a,s,t)=>{let l=[],n=new Date(a),r=e=>{if(e.includes("-"))return e;{let[a,s]=e.split(" ");return new Date(new Date().getFullYear(),new Date("".concat(a," 01 2024")).getMonth(),parseInt(s)).toISOString().split("T")[0]}},o=new Map(e.map(e=>{let a=r(e.date);return[a,{...e,date:a}]}));for(;n<=s;){let e=n.toISOString().split("T")[0];if(o.has(e))l.push(o.get(e));else{let a={date:e,api_requests:0,total_tokens:0};t.forEach(e=>{a[e]||(a[e]=0)}),l.push(a)}n.setDate(n.getDate()+1)}return l},eT=async()=>{if(a)try{let e=await (0,T.adminSpendLogsCall)(a),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0),n=eb(e,t,l,[]),r=Number(n.reduce((e,a)=>e+(a.spend||0),0).toFixed(2));e_(r),q(n)}catch(e){console.error("Error fetching overall spend:",e)}},eM=()=>eF(()=>a&&s?(0,T.adminspendByProvider)(a,s,ev,ek):Promise.reject("No access token or token"),eo,"Error fetching provider spend"),eA=async()=>{a&&await eF(async()=>(await (0,T.adminTopKeysCall)(a)).map(e=>({key:e.api_key.substring(0,10),api_key:e.api_key,key_alias:e.key_alias,spend:Number(e.total_spend.toFixed(2))})),R,"Error fetching top keys")},eL=async()=>{a&&await eF(async()=>(await (0,T.adminTopModelsCall)(a)).map(e=>({key:e.model,spend:(0,A.pw)(e.total_spend,2)})),K,"Error fetching top models")},eP=async()=>{a&&await eF(async()=>{let e=await (0,T.teamSpendLogsCall)(a),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0);return $(eb(e.daily_spend,t,l,e.teams)),et(e.teams),e.total_spend_per_team.map(e=>({name:e.team_id||"",value:(0,A.pw)(e.total_spend||0,2)}))},en,"Error fetching team spend")},eV=()=>{a&&eF(async()=>(await (0,T.allTagNamesCall)(a)).tag_names,ea,"Error fetching tag names")},eU=()=>{a&&eF(()=>{var e,s;return(0,T.tagsSpendLogsCall)(a,null===(e=ep.from)||void 0===e?void 0:e.toISOString(),null===(s=ep.to)||void 0===s?void 0:s.toISOString(),void 0)},e=>J(e.spend_per_tag),"Error fetching top tags")},eY=()=>{a&&eF(()=>(0,T.adminTopEndUsersCall)(a,null,void 0,void 0),Q,"Error fetching top end users")},eB=async()=>{if(a)try{let e=await (0,T.adminGlobalActivity)(a,ev,ek),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0),n=eb(e.daily_data||[],t,l,["api_requests","total_tokens"]);ec({...e,daily_data:n})}catch(e){console.error("Error fetching global activity:",e)}},eO=async()=>{if(a)try{let e=await (0,T.adminGlobalActivityPerModel)(a,ev,ek),s=new Date,t=new Date(s.getFullYear(),s.getMonth(),1),l=new Date(s.getFullYear(),s.getMonth()+1,0),n=e.map(e=>({...e,daily_data:eb(e.daily_data||[],t,l,["api_requests","total_tokens"])}));eh(n)}catch(e){console.error("Error fetching global activity per model:",e)}};return((0,g.useEffect)(()=>{(async()=>{if(a&&s&&P&&V){let e=await eE();e&&(ey(e),null!=e&&e.DISABLE_EXPENSIVE_DB_QUERIES)||(console.log("fetching data - valiue of proxySettings",eZ),eT(),eM(),eA(),eL(),eB(),eO(),L(P)&&(eP(),eV(),eU(),eY()))}})()},[a,s,P,V,ev,ek]),null==eZ?void 0:eZ.DISABLE_EXPENSIVE_DB_QUERIES)?(0,t.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Database Query Limit Reached"}),(0,t.jsxs)(b.Z,{className:"mt-4",children:["SpendLogs in DB has ",eZ.NUM_SPEND_LOGS_ROWS," rows.",(0,t.jsx)("br",{}),"Please follow our guide to view usage when SpendLogs has more than 1M rows."]}),(0,t.jsx)(y.Z,{className:"mt-4",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/spending_monitoring",target:"_blank",children:"View Usage Guide"})})]})}):(0,t.jsx)("div",{style:{width:"100%"},className:"p-8",children:(0,t.jsxs)(N.Z,{children:[(0,t.jsxs)(C.Z,{className:"mt-2",children:[(0,t.jsx)(E.Z,{children:"All Up"}),L(P)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.Z,{children:"Team Based Usage"}),(0,t.jsx)(E.Z,{children:"Customer Usage"}),(0,t.jsx)(E.Z,{children:"Tag Based Usage"})]}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{})})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(I.Z,{children:(0,t.jsxs)(N.Z,{children:[(0,t.jsxs)(C.Z,{variant:"solid",className:"mt-1",children:[(0,t.jsx)(E.Z,{children:"Cost"}),(0,t.jsx)(E.Z,{children:"Activity"})]}),(0,t.jsxs)(F.Z,{children:[(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[100vh] w-full",children:[(0,t.jsxs)(S.Z,{numColSpan:2,children:[(0,t.jsxs)(b.Z,{className:"text-tremor-default text-tremor-content dark:text-dark-tremor-content mb-2 mt-2 text-lg",children:["Project Spend ",new Date().toLocaleString("default",{month:"long"})," 1 -"," ",new Date(new Date().getFullYear(),new Date().getMonth()+1,0).getDate()]}),(0,t.jsx)(p.Z,{userSpend:eS,selectedTeam:null,userMaxBudget:null})]}),(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Monthly Spend"}),(0,t.jsx)(l.Z,{data:O,index:"date",categories:["spend"],colors:["cyan"],valueFormatter:e=>"$ ".concat((0,A.pw)(e,2)),yAxisWidth:100,tickGap:5})]})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(r.Z,{className:"h-full",children:[(0,t.jsx)(m.Z,{children:"Top Virtual Keys"}),(0,t.jsx)(M.Z,{topKeys:W,teams:null})]})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(r.Z,{className:"h-full",children:[(0,t.jsx)(m.Z,{children:"Top Models"}),(0,t.jsx)(l.Z,{className:"mt-4 h-40",data:G,index:"key",categories:["spend"],colors:["cyan"],yAxisWidth:200,layout:"vertical",showXAxis:!1,showLegend:!1,valueFormatter:e=>"$".concat((0,A.pw)(e,2))})]})}),(0,t.jsx)(S.Z,{numColSpan:1}),(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{className:"mb-2",children:[(0,t.jsx)(m.Z,{children:"Spend by Provider"}),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsx)(_.Z,{className:"mt-4 h-40",variant:"pie",data:er,index:"provider",category:"spend",colors:["cyan"],valueFormatter:e=>"$".concat((0,A.pw)(e,2))})}),(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsxs)(i.Z,{children:[(0,t.jsx)(h.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{children:"Provider"}),(0,t.jsx)(u.Z,{children:"Spend"})]})}),(0,t.jsx)(c.Z,{children:er.map(e=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(d.Z,{children:e.provider}),(0,t.jsx)(d.Z,{children:1e-5>parseFloat(e.spend.toFixed(2))?"less than 0.00":(0,A.pw)(e.spend,2)})]},e.provider))})]})})]})})]})})]})}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:1,className:"gap-2 h-[75vh] w-full",children:[(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"All Up"}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eD(ei.sum_api_requests)]}),(0,t.jsx)(Z.Z,{className:"h-40",data:ei.daily_data,valueFormatter:eD,index:"date",colors:["cyan"],categories:["api_requests"],onValueChange:e=>console.log(e)})]}),(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eD(ei.sum_total_tokens)]}),(0,t.jsx)(l.Z,{className:"h-40",data:ei.daily_data,valueFormatter:eD,index:"date",colors:["cyan"],categories:["total_tokens"],onValueChange:e=>console.log(e)})]})]})]}),(0,t.jsx)(t.Fragment,{children:ed.map((e,a)=>(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:e.model}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["API Requests ",eD(e.sum_api_requests)]}),(0,t.jsx)(Z.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["api_requests"],valueFormatter:eD,onValueChange:e=>console.log(e)})]}),(0,t.jsxs)(S.Z,{children:[(0,t.jsxs)(o.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Tokens ",eD(e.sum_total_tokens)]}),(0,t.jsx)(l.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["cyan"],categories:["total_tokens"],valueFormatter:eD,onValueChange:e=>console.log(e)})]})]})]},a))})]})})]})]})}),(0,t.jsx)(I.Z,{children:(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[75vh] w-full",children:[(0,t.jsxs)(S.Z,{numColSpan:2,children:[(0,t.jsxs)(r.Z,{className:"mb-2",children:[(0,t.jsx)(m.Z,{children:"Total Spend Per Team"}),(0,t.jsx)(n.Z,{data:el})]}),(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Daily Spend Per Team"}),(0,t.jsx)(l.Z,{className:"h-72",data:X,showLegend:!0,index:"date",categories:es,yAxisWidth:80,stack:!0})]})]}),(0,t.jsx)(S.Z,{numColSpan:2})]})}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:["Customers of your LLM API calls. Tracked when a `user` param is passed in your LLM calls"," ",(0,t.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/users",target:"_blank",children:"docs here"})]}),(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{children:(0,t.jsx)(j.Z,{value:ep,onValueChange:e=>{ej(e),eN(e.from,e.to,null)}})}),(0,t.jsxs)(S.Z,{children:[(0,t.jsx)(b.Z,{children:"Select Key"}),(0,t.jsxs)(k.Z,{defaultValue:"all-keys",children:[(0,t.jsx)(D.Z,{value:"all-keys",onClick:()=>{eN(ep.from,ep.to,null)},children:"All Keys"},"all-keys"),null==U?void 0:U.map((e,a)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,t.jsx)(D.Z,{value:String(a),onClick:()=>{eN(ep.from,ep.to,e.token)},children:e.key_alias},a):null)]})]})]}),(0,t.jsx)(r.Z,{className:"mt-4",children:(0,t.jsxs)(i.Z,{className:"max-h-[70vh] min-h-[500px]",children:[(0,t.jsx)(h.Z,{children:(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(u.Z,{children:"Customer"}),(0,t.jsx)(u.Z,{children:"Spend"}),(0,t.jsx)(u.Z,{children:"Total Events"})]})}),(0,t.jsx)(c.Z,{children:null==z?void 0:z.map((e,a)=>(0,t.jsxs)(x.Z,{children:[(0,t.jsx)(d.Z,{children:e.end_user}),(0,t.jsx)(d.Z,{children:(0,A.pw)(e.total_spend,2)}),(0,t.jsx)(d.Z,{children:e.total_count})]},a))})]})})]}),(0,t.jsxs)(I.Z,{children:[(0,t.jsxs)(w.Z,{numItems:2,children:[(0,t.jsx)(S.Z,{numColSpan:1,children:(0,t.jsx)(j.Z,{className:"mb-4",value:ep,onValueChange:e=>{ej(e),eC(e.from,e.to)}})}),(0,t.jsx)(S.Z,{children:Y?(0,t.jsx)("div",{children:(0,t.jsxs)(f.Z,{value:em,onValueChange:e=>eg(e),children:[(0,t.jsx)(v.Z,{value:"all-tags",onClick:()=>eg(["all-tags"]),children:"All Tags"},"all-tags"),ee&&ee.filter(e=>"all-tags"!==e).map((e,a)=>(0,t.jsx)(v.Z,{value:String(e),children:e},e))]})}):(0,t.jsx)("div",{children:(0,t.jsxs)(f.Z,{value:em,onValueChange:e=>eg(e),children:[(0,t.jsx)(v.Z,{value:"all-tags",onClick:()=>eg(["all-tags"]),children:"All Tags"},"all-tags"),ee&&ee.filter(e=>"all-tags"!==e).map((e,a)=>(0,t.jsxs)(D.Z,{value:String(e),disabled:!0,children:["✨ ",e," (Enterprise only Feature)"]},e))]})})})]}),(0,t.jsxs)(w.Z,{numItems:2,className:"gap-2 h-[75vh] w-full mb-4",children:[(0,t.jsx)(S.Z,{numColSpan:2,children:(0,t.jsxs)(r.Z,{children:[(0,t.jsx)(m.Z,{children:"Spend Per Tag"}),(0,t.jsxs)(b.Z,{children:["Get Started by Tracking cost per tag"," ",(0,t.jsx)("a",{className:"text-blue-500",href:"https://docs.litellm.ai/docs/proxy/cost_tracking",target:"_blank",children:"here"})]}),(0,t.jsx)(l.Z,{className:"h-72",data:H,index:"name",categories:["spend"],colors:["cyan"]})]})}),(0,t.jsx)(S.Z,{numColSpan:2})]})]})]})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/816-e7500f06e5b83b0f.js b/litellm/proxy/_experimental/out/_next/static/chunks/816-e7500f06e5b83b0f.js deleted file mode 100644 index 495ec91a3d6..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/816-e7500f06e5b83b0f.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[816],{79276:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z"}}]},name:"arrow-up",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},83322:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M632 888H392c-4.4 0-8 3.6-8 8v32c0 17.7 14.3 32 32 32h192c17.7 0 32-14.3 32-32v-32c0-4.4-3.6-8-8-8zM512 64c-181.1 0-328 146.9-328 328 0 121.4 66 227.4 164 284.1V792c0 17.7 14.3 32 32 32h264c17.7 0 32-14.3 32-32V676.1c98-56.7 164-162.7 164-284.1 0-181.1-146.9-328-328-328zm127.9 549.8L604 634.6V752H420V634.6l-35.9-20.8C305.4 568.3 256 484.5 256 392c0-141.4 114.6-256 256-256s256 114.6 256 256c0 92.5-49.4 176.3-128.1 221.8z"}}]},name:"bulb",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},26430:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6a25.95 25.95 0 0025.6 30.4h723c1.5 0 3-.1 4.4-.4a25.88 25.88 0 0021.2-30zM204 390h272V182h72v208h272v104H204V390zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260H672z"}}]},name:"clear",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},5540:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},11894:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"code",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},62670:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm47.7-395.2l-25.4-5.9V348.6c38 5.2 61.5 29 65.5 58.2.5 4 3.9 6.9 7.9 6.9h44.9c4.7 0 8.4-4.1 8-8.8-6.1-62.3-57.4-102.3-125.9-109.2V263c0-4.4-3.6-8-8-8h-28.1c-4.4 0-8 3.6-8 8v33c-70.8 6.9-126.2 46-126.2 119 0 67.6 49.8 100.2 102.1 112.7l24.7 6.3v142.7c-44.2-5.9-69-29.5-74.1-61.3-.6-3.8-4-6.6-7.9-6.6H363c-4.7 0-8.4 4-8 8.7 4.5 55 46.2 105.6 135.2 112.1V761c0 4.4 3.6 8 8 8h28.4c4.4 0 8-3.6 8-8.1l-.2-31.7c78.3-6.9 134.3-48.8 134.3-124-.1-69.4-44.2-100.4-109-116.4zm-68.6-16.2c-5.6-1.6-10.3-3.1-15-5-33.8-12.2-49.5-31.9-49.5-57.3 0-36.3 27.5-57 64.5-61.7v124zM534.3 677V543.3c3.1.9 5.9 1.6 8.8 2.2 47.3 14.4 63.2 34.4 63.2 65.1 0 39.1-29.4 62.6-72 66.4z"}}]},name:"dollar",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},11741:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},71282:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},16601:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 394c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H400V152c0-4.4-3.6-8-8-8h-64c-4.4 0-8 3.6-8 8v166H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v236H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h168v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h228v166c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V706h164c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8H708V394h164zM628 630H400V394h228v236z"}}]},name:"number",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},69993:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},58630:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(1119),l=n(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M876.6 239.5c-.5-.9-1.2-1.8-2-2.5-5-5-13.1-5-18.1 0L684.2 409.3l-67.9-67.9L788.7 169c.8-.8 1.4-1.6 2-2.5 3.6-6.1 1.6-13.9-4.5-17.5-98.2-58-226.8-44.7-311.3 39.7-67 67-89.2 162-66.5 247.4l-293 293c-3 3-2.8 7.9.3 11l169.7 169.7c3.1 3.1 8.1 3.3 11 .3l292.9-292.9c85.5 22.8 180.5.7 247.6-66.4 84.4-84.5 97.7-213.1 39.7-311.3zM786 499.8c-58.1 58.1-145.3 69.3-214.6 33.6l-8.8 8.8-.1-.1-274 274.1-79.2-79.2 230.1-230.1s0 .1.1.1l52.8-52.8c-35.7-69.3-24.5-156.5 33.6-214.6a184.2 184.2 0 01144-53.5L537 318.9a32.05 32.05 0 000 45.3l124.5 124.5a32.05 32.05 0 0045.3 0l132.8-132.8c3.7 51.8-14.4 104.8-53.6 143.9z"}}]},name:"tool",theme:"outlined"},o=n(55015),a=l.forwardRef(function(e,t){return l.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:i}))})},92570:function(e,t,n){n.d(t,{Z:function(){return r}});let r=e=>e?"function"==typeof e?e():e:null},20435:function(e,t,n){n.d(t,{aV:function(){return f}});var r=n(2265),l=n(36760),i=n.n(l),o=n(5769),a=n(92570),u=n(71744),c=n(72262),s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);lt.indexOf(r[l])&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};let f=e=>{let{title:t,content:n,prefixCls:l}=e;return t||n?r.createElement(r.Fragment,null,t&&r.createElement("div",{className:"".concat(l,"-title")},t),n&&r.createElement("div",{className:"".concat(l,"-inner-content")},n)):null},p=e=>{let{hashId:t,prefixCls:n,className:l,style:u,placement:c="top",title:s,content:p,children:d}=e,h=(0,a.Z)(s),m=(0,a.Z)(p),g=i()(t,n,"".concat(n,"-pure"),"".concat(n,"-placement-").concat(c),l);return r.createElement("div",{className:g,style:u},r.createElement("div",{className:"".concat(n,"-arrow")}),r.createElement(o.G,Object.assign({},e,{className:t,prefixCls:n}),d||r.createElement(f,{prefixCls:n,title:h,content:m})))};t.ZP=e=>{let{prefixCls:t,className:n}=e,l=s(e,["prefixCls","className"]),{getPrefixCls:o}=r.useContext(u.E_),a=o("popover",t),[f,d,h]=(0,c.Z)(a);return f(r.createElement(p,Object.assign({},l,{prefixCls:a,hashId:d,className:i()(n,h)})))}},79326:function(e,t,n){var r=n(2265),l=n(36760),i=n.n(l),o=n(50506),a=n(95814),u=n(92570),c=n(68710),s=n(19722),f=n(71744),p=n(99981),d=n(20435),h=n(72262),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,r=Object.getOwnPropertySymbols(e);lt.indexOf(r[l])&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(n[r[l]]=e[r[l]]);return n};let g=r.forwardRef((e,t)=>{var n,l;let{prefixCls:g,title:y,content:v,overlayClassName:x,placement:k="top",trigger:b="hover",children:w,mouseEnterDelay:S=.1,mouseLeaveDelay:C=.1,onOpenChange:E,overlayStyle:I={},styles:T,classNames:P}=e,z=m(e,["prefixCls","title","content","overlayClassName","placement","trigger","children","mouseEnterDelay","mouseLeaveDelay","onOpenChange","overlayStyle","styles","classNames"]),{getPrefixCls:A,className:O,style:M,classNames:L,styles:D}=(0,f.dj)("popover"),N=A("popover",g),[F,R,_]=(0,h.Z)(N),j=A(),B=i()(x,R,_,O,L.root,null==P?void 0:P.root),H=i()(L.body,null==P?void 0:P.body),[V,Z]=(0,o.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(l=e.defaultOpen)&&void 0!==l?l:e.defaultVisible}),U=(e,t)=>{Z(e,!0),null==E||E(e,t)},q=e=>{e.keyCode===a.Z.ESC&&U(!1,e)},W=(0,u.Z)(y),Y=(0,u.Z)(v);return F(r.createElement(p.Z,Object.assign({placement:k,trigger:b,mouseEnterDelay:S,mouseLeaveDelay:C},z,{prefixCls:N,classNames:{root:B,body:H},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},D.root),M),I),null==T?void 0:T.root),body:Object.assign(Object.assign({},D.body),null==T?void 0:T.body)},ref:t,open:V,onOpenChange:e=>{U(e)},overlay:W||Y?r.createElement(d.aV,{prefixCls:N,title:W,content:Y}):null,transitionName:(0,c.m)(j,"zoom-big",z.transitionName),"data-popover-inject":!0}),(0,s.Tm)(w,{onKeyDown:e=>{var t,n;(0,r.isValidElement)(w)&&(null===(n=null==w?void 0:(t=w.props).onKeyDown)||void 0===n||n.call(t,e)),q(e)}})))});g._InternalPanelDoNotUseOrYouWillBeFired=d.ZP,t.Z=g},72262:function(e,t,n){var r=n(12918),l=n(691),i=n(88260),o=n(34442),a=n(53454),u=n(99320),c=n(71140);let s=e=>{let{componentCls:t,popoverColor:n,titleMinWidth:l,fontWeightStrong:o,innerPadding:a,boxShadowSecondary:u,colorTextHeading:c,borderRadiusLG:s,zIndexPopup:f,titleMarginBottom:p,colorBgElevated:d,popoverBg:h,titleBorderBottom:m,innerContentPadding:g,titlePadding:y}=e;return[{[t]:Object.assign(Object.assign({},(0,r.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:f,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":d,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},["".concat(t,"-content")]:{position:"relative"},["".concat(t,"-inner")]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:s,boxShadow:u,padding:a},["".concat(t,"-title")]:{minWidth:l,marginBottom:p,color:c,fontWeight:o,borderBottom:m,padding:y},["".concat(t,"-inner-content")]:{color:n,padding:g}})},(0,i.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(t,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",["".concat(t,"-content")]:{display:"inline-block"}}}]},f=e=>{let{componentCls:t}=e;return{[t]:a.i.map(n=>{let r=e["".concat(n,"6")];return{["&".concat(t,"-").concat(n)]:{"--antd-arrow-background-color":r,["".concat(t,"-inner")]:{backgroundColor:r},["".concat(t,"-arrow")]:{background:"transparent"}}}})}};t.Z=(0,u.I$)("Popover",e=>{let{colorBgElevated:t,colorText:n}=e,r=(0,c.IX)(e,{popoverBg:t,popoverColor:n});return[s(r),f(r),(0,l._y)(r,"zoom-big")]},e=>{let{lineWidth:t,controlHeight:n,fontHeight:r,padding:l,wireframe:a,zIndexPopupBase:u,borderRadiusLG:c,marginXS:s,lineType:f,colorSplit:p,paddingSM:d}=e,h=n-r;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:u+30},(0,o.w)(e)),(0,i.wZ)({contentRadius:c,limitVerticalRadius:!0})),{innerPadding:a?0:12,titleMarginBottom:a?0:s,titlePadding:a?"".concat(h/2,"px ").concat(l,"px ").concat(h/2-t,"px"):0,titleBorderBottom:a?"".concat(t,"px ").concat(f," ").concat(p):"none",innerContentPadding:a?"".concat(d,"px ").concat(l,"px"):0})},{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]})},6500:function(e){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,l=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},o=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,l=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!l&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(l)return l(e,n).value}return e[n]};e.exports=function e(){var t,n,r,l,c,s,f=arguments[0],p=1,d=arguments.length,h=!1;for("boolean"==typeof f&&(h=f,f=arguments[1]||{},p=2),(null==f||"object"!=typeof f&&"function"!=typeof f)&&(f={});p code':{position:"relative",zIndex:"1",borderLeft:"10px solid #358ccb",boxShadow:"-1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf",backgroundColor:"#fdfdfd",backgroundImage:"linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%)",backgroundSize:"3em 3em",backgroundOrigin:"content-box",backgroundAttachment:"local"},':not(pre) > code[class*="language-"]':{backgroundColor:"#fdfdfd",WebkitBoxSizing:"border-box",MozBoxSizing:"border-box",boxSizing:"border-box",marginBottom:"1em",position:"relative",padding:".2em",borderRadius:"0.3em",color:"#c92c2c",border:"1px solid rgba(0, 0, 0, 0.1)",display:"inline",whiteSpace:"normal"},'pre[class*="language-"]:before':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"0.18em",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(-2deg)",MozTransform:"rotate(-2deg)",msTransform:"rotate(-2deg)",OTransform:"rotate(-2deg)",transform:"rotate(-2deg)"},'pre[class*="language-"]:after':{content:"''",display:"block",position:"absolute",bottom:"0.75em",left:"auto",width:"40%",height:"20%",maxHeight:"13em",boxShadow:"0px 13px 8px #979797",WebkitTransform:"rotate(2deg)",MozTransform:"rotate(2deg)",msTransform:"rotate(2deg)",OTransform:"rotate(2deg)",transform:"rotate(2deg)",right:"0.75em"},comment:{color:"#7D8B99"},"block-comment":{color:"#7D8B99"},prolog:{color:"#7D8B99"},doctype:{color:"#7D8B99"},cdata:{color:"#7D8B99"},punctuation:{color:"#5F6364"},property:{color:"#c92c2c"},tag:{color:"#c92c2c"},boolean:{color:"#c92c2c"},number:{color:"#c92c2c"},"function-name":{color:"#c92c2c"},constant:{color:"#c92c2c"},symbol:{color:"#c92c2c"},deleted:{color:"#c92c2c"},selector:{color:"#2f9c0a"},"attr-name":{color:"#2f9c0a"},string:{color:"#2f9c0a"},char:{color:"#2f9c0a"},function:{color:"#2f9c0a"},builtin:{color:"#2f9c0a"},inserted:{color:"#2f9c0a"},operator:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},entity:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)",cursor:"help"},url:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},variable:{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},atrule:{color:"#1990b8"},"attr-value":{color:"#1990b8"},keyword:{color:"#1990b8"},"class-name":{color:"#1990b8"},regex:{color:"#e90"},important:{color:"#e90",fontWeight:"normal"},".language-css .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},".style .token.string":{color:"#a67f59",background:"rgba(255, 255, 255, 0.5)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:".7"},'pre[class*="language-"].line-numbers.line-numbers':{paddingLeft:"0"},'pre[class*="language-"].line-numbers.line-numbers code':{paddingLeft:"3.8em"},'pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows':{left:"0"},'pre[class*="language-"][data-line]':{paddingTop:"0",paddingBottom:"0",paddingLeft:"0"},"pre[data-line] code":{position:"relative",paddingLeft:"4em"},"pre .line-highlight":{marginTop:"0"}}},95693:function(e,t,n){var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(52744)),l=n(96172);function i(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,l.camelCase)(e,t)]=r)}),n}i.default=i,e.exports=i},96172:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,l=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(e,t){return t.toUpperCase()},u=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var c;return(void 0===t&&(t={}),!(c=e)||l.test(c)||n.test(c))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,u):e.replace(i,u)).replace(r,a))}},52744:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,l.default)(e),i="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:l}=e;i?t(r,l,e):l&&((n=n||{})[r]=l)}),n};let l=r(n(30537))},62831:function(e,t,n){n.d(t,{UG:function(){return nq}});var r={};n.r(r),n.d(r,{boolean:function(){return g},booleanish:function(){return y},commaOrSpaceSeparated:function(){return w},commaSeparated:function(){return b},number:function(){return x},overloadedBoolean:function(){return v},spaceSeparated:function(){return k}});var l={};n.r(l),n.d(l,{attentionMarkers:function(){return tB},contentInitial:function(){return tD},disable:function(){return tH},document:function(){return tL},flow:function(){return tF},flowInitial:function(){return tN},insideSpan:function(){return tj},string:function(){return tR},text:function(){return t_}});let i=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a={};function u(e,t){return((t||a).jsx?o:i).test(e)}let c=/[ \t\n\f\r]/g;function s(e){return""===e.replace(c,"")}class f{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function p(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new f(n,r,t)}function d(e){return e.toLowerCase()}f.prototype.normal={},f.prototype.property={},f.prototype.space=void 0;class h{constructor(e,t){this.attribute=t,this.property=e}}h.prototype.attribute="",h.prototype.booleanish=!1,h.prototype.boolean=!1,h.prototype.commaOrSpaceSeparated=!1,h.prototype.commaSeparated=!1,h.prototype.defined=!1,h.prototype.mustUseProperty=!1,h.prototype.number=!1,h.prototype.overloadedBoolean=!1,h.prototype.property="",h.prototype.spaceSeparated=!1,h.prototype.space=void 0;let m=0,g=S(),y=S(),v=S(),x=S(),k=S(),b=S(),w=S();function S(){return 2**++m}let C=Object.keys(r);class E extends h{constructor(e,t,n,l){var i,o;let a=-1;if(super(e,t),l&&(this.space=l),"number"==typeof n)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function P(e,t){return t in e?e[t]:t}function z(e,t){return P(e,t.toLowerCase())}let A=I({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:b,acceptCharset:k,accessKey:k,action:null,allow:null,allowFullScreen:g,allowPaymentRequest:g,allowUserMedia:g,alt:null,as:null,async:g,autoCapitalize:null,autoComplete:k,autoFocus:g,autoPlay:g,blocking:k,capture:null,charSet:null,checked:g,cite:null,className:k,cols:x,colSpan:null,content:null,contentEditable:y,controls:g,controlsList:k,coords:x|b,crossOrigin:null,data:null,dateTime:null,decoding:null,default:g,defer:g,dir:null,dirName:null,disabled:g,download:v,draggable:y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:g,formTarget:null,headers:k,height:x,hidden:v,high:x,href:null,hrefLang:null,htmlFor:k,httpEquiv:k,id:null,imageSizes:null,imageSrcSet:null,inert:g,inputMode:null,integrity:null,is:null,isMap:g,itemId:null,itemProp:k,itemRef:k,itemScope:g,itemType:k,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:g,low:x,manifest:null,max:null,maxLength:x,media:null,method:null,min:null,minLength:x,multiple:g,muted:g,name:null,nonce:null,noModule:g,noValidate:g,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:g,optimum:x,pattern:null,ping:k,placeholder:null,playsInline:g,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:g,referrerPolicy:null,rel:k,required:g,reversed:g,rows:x,rowSpan:x,sandbox:k,scope:null,scoped:g,seamless:g,selected:g,shadowRootClonable:g,shadowRootDelegatesFocus:g,shadowRootMode:null,shape:null,size:x,sizes:null,slot:null,span:x,spellCheck:y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:x,step:null,style:null,tabIndex:x,target:null,title:null,translate:null,type:null,typeMustMatch:g,useMap:null,value:y,width:x,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:k,axis:null,background:null,bgColor:null,border:x,borderColor:null,bottomMargin:x,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:g,declare:g,event:null,face:null,frame:null,frameBorder:null,hSpace:x,leftMargin:x,link:null,longDesc:null,lowSrc:null,marginHeight:x,marginWidth:x,noResize:g,noHref:g,noShade:g,noWrap:g,object:null,profile:null,prompt:null,rev:null,rightMargin:x,rules:null,scheme:null,scrolling:y,standby:null,summary:null,text:null,topMargin:x,valueType:null,version:null,vAlign:null,vLink:null,vSpace:x,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:g,disableRemotePlayback:g,prefix:null,property:null,results:x,security:null,unselectable:null},space:"html",transform:z}),O=I({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:w,accentHeight:x,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:x,amplitude:x,arabicForm:null,ascent:x,attributeName:null,attributeType:null,azimuth:x,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:x,by:null,calcMode:null,capHeight:x,className:k,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:x,diffuseConstant:x,direction:null,display:null,dur:null,divisor:x,dominantBaseline:null,download:g,dx:null,dy:null,edgeMode:null,editable:null,elevation:x,enableBackground:null,end:null,event:null,exponent:x,externalResourcesRequired:null,fill:null,fillOpacity:x,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:b,g2:b,glyphName:b,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:x,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:x,horizOriginX:x,horizOriginY:x,id:null,ideographic:x,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:x,k:x,k1:x,k2:x,k3:x,k4:x,kernelMatrix:w,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:x,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:x,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:x,overlineThickness:x,paintOrder:null,panose1:null,path:null,pathLength:x,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:k,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:x,pointsAtY:x,pointsAtZ:x,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:w,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:w,rev:w,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:w,requiredFeatures:w,requiredFonts:w,requiredFormats:w,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:x,specularExponent:x,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:x,strikethroughThickness:x,string:null,stroke:null,strokeDashArray:w,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:x,strokeOpacity:x,strokeWidth:null,style:null,surfaceScale:x,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:w,tabIndex:x,tableValues:null,target:null,targetX:x,targetY:x,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:w,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:x,underlineThickness:x,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:x,values:null,vAlphabetic:x,vMathematical:x,vectorEffect:null,vHanging:x,vIdeographic:x,version:null,vertAdvY:x,vertOriginX:x,vertOriginY:x,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:x,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:P}),M=I({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),L=I({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:z}),D=I({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),N=p([T,A,M,L,D],"html"),F=p([T,O,M,L,D],"svg"),R=/[A-Z]/g,_=/-[a-z]/g,j=/^data[-\w.:]+$/i;function B(e){return"-"+e.toLowerCase()}function H(e){return e.charAt(1).toUpperCase()}let V={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var Z=n(95693);let U=W("end"),q=W("start");function W(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Y(e){return e&&"object"==typeof e?"position"in e||"type"in e?Q(e.position):"start"in e||"end"in e?Q(e):"line"in e||"column"in e?K(e):"":""}function K(e){return $(e&&e.line)+":"+$(e&&e.column)}function Q(e){return K(e&&e.start)+"-"+K(e&&e.end)}function $(e){return e&&"number"==typeof e?e:1}class X extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",l={},i=!1;if(t&&(l="line"in t&&"column"in t?{place:t}:"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!l.cause&&e&&(i=!0,r=e.message,l.cause=e),!l.ruleId&&!l.source&&"string"==typeof n){let e=n.indexOf(":");-1===e?l.ruleId=n:(l.source=n.slice(0,e),l.ruleId=n.slice(e+1))}if(!l.place&&l.ancestors&&l.ancestors){let e=l.ancestors[l.ancestors.length-1];e&&(l.place=e.position)}let o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=Y(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=i&&l.cause&&"string"==typeof l.cause.stack?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}X.prototype.file="",X.prototype.name="",X.prototype.reason="",X.prototype.message="",X.prototype.stack="",X.prototype.column=void 0,X.prototype.line=void 0,X.prototype.ancestors=void 0,X.prototype.cause=void 0,X.prototype.fatal=void 0,X.prototype.place=void 0,X.prototype.ruleId=void 0,X.prototype.source=void 0;let J={}.hasOwnProperty,G=new Map,ee=/[A-Z]/g,et=new Set(["table","tbody","thead","tfoot","tr"]),en=new Set(["td","th"]),er="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function el(e,t,n){return"element"===t.type?function(e,t,n){let r=e.schema,l=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(l=F,e.schema=l),e.ancestors.push(t);let i=eu(e,t.tagName,!1),o=function(e,t){let n,r;let l={};for(r in t.properties)if("children"!==r&&J.call(t.properties,r)){let i=function(e,t,n){let r=function(e,t){let n=d(t),r=t,l=h;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&j.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(_,H);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!_.test(e)){let n=e.replace(R,B);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}l=E}return new l(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e,t){let n={};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return Z(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new X("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=er+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t;let n={};for(t in e)J.call(e,t)&&(n[function(e){let t=e.replace(ee,es);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?V[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(i){let[r,o]=i;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof o&&en.has(t.tagName)?n=o:l[r]=o}}return n&&((l.style||(l.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),l}(e,t),a=ea(e,t);return et.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&s(e.value):s(e))})),ei(e,o,i,t),eo(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ec(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){let r=e.schema,l=r;"svg"===t.name&&"html"===r.space&&(l=F,e.schema=l),e.ancestors.push(t);let i=null===t.name?e.Fragment:eu(e,t.name,!0),o=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let l=t.expression;l.type;let i=l.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else ec(e,t.position)}else{let l;let i=r.name;if(r.value&&"object"==typeof r.value){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,l=e.evaluater.evaluateExpression(t.expression)}else ec(e,t.position)}else l=null===r.value||r.value;n[i]=l}return n}(e,t),a=ea(e,t);return ei(e,o,i,t),eo(o,a),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ec(e,t.position)}(e,t):"root"===t.type?function(e,t,n){let r={};return eo(r,ea(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?t.value:void 0}function ei(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eo(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ea(e,t){let n=[],r=-1,l=e.passKeys?new Map:G;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)(l=Array.from(r)).unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(eg(e,e.length,0,t),e):t}class ev{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),Number.POSITIVE_INFINITY);return n&&ex(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),ex(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ex(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length)){if(e-1&&e.test(String.fromCharCode(t))}}function eE(e,t,n,r){let l=r?r-1:Number.POSITIVE_INFINITY,i=0;return function(r){return eS(r)?(e.enter(n),function r(o){return eS(o)&&i++r))return;let a=l.events.length,u=a;for(;u--;)if("exit"===l.events[u][0]&&"chunkFlow"===l.events[u][1].type){if(e){n=l.events[u][1].end;break}e=!0}for(g(o),i=a;it;){let t=i[n];l.containerState=t[1],t[0].exit.call(l,e)}i.length=t}function y(){t.write([null]),n=void 0,t=void 0,l.containerState._closeFlow=void 0}}},eP={tokenize:function(e,t,n){return eE(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ez=e_(/[A-Za-z]/),eA=e_(/[\dA-Za-z]/),eO=e_(/[#-'*+\--9=?A-Z^-~]/),eM=e_(/\d/),eL=e_(/[\dA-Fa-f]/),eD=e_(/[!-/:-@[-`{-~]/);function eN(e){return null!==e&&e<-2}function eF(e){return null!==e&&(e<0||32===e)}function eR(e){return -2===e||-1===e||32===e}function e_(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function ej(e,t,n,r){let l=r?r-1:Number.POSITIVE_INFINITY,i=0;return function(r){return eR(r)?(e.enter(n),function r(o){return eR(o)&&i++=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}},eZ={tokenize:function(e){let t=this,n=e.attempt(eB,function(r){if(null===r){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,eE(e,e.attempt(this.parser.constructs.flow,r,e.attempt(eH,r)),"linePrefix")));return n;function r(r){if(null===r){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}},eU={resolveAll:eK()},eq=eY("string"),eW=eY("text");function eY(e){return{resolveAll:eK("text"===e?eQ:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],l=t.attempt(r,i,o);return i;function i(e){return u(e)?l(e):o(e)}function o(e){if(null===e){t.consume(e);return}return t.enter("data"),t.consume(e),a}function a(e){return u(e)?(t.exit("data"),l(e)):(t.consume(e),a)}function u(e){if(null===e)return!0;let t=r[e],l=-1;if(t)for(;++l=3&&(null===o||eN(o))?(e.exit("thematicBreak"),t(o)):n(o)}(i)}}},eX={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(eB,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ej(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!eR(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(eG,t,l)(n))});function l(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ej(e,e.attempt(eX,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,l=r.events[r.events.length-1],i=l&&"linePrefix"===l[1].type?l[2].sliceSerialize(l[1],!0).length:0,o=0;return function(t){let l=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===l?!r.containerState.marker||t===r.containerState.marker:eM(t)){if(r.containerState.type||(r.containerState.type=l,e.enter(l,{_container:!0})),"listUnordered"===l)return e.enter("listItemPrefix"),42===t||45===t?e.check(e$,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(l){return eM(l)&&++o<10?(e.consume(l),t):(!r.interrupt||o<2)&&(r.containerState.marker?l===r.containerState.marker:41===l||46===l)?(e.exit("listItemValue"),a(l)):n(l)}(t)}return n(t)};function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(eB,r.interrupt?n:u,e.attempt(eJ,s,c))}function u(e){return r.containerState.initialBlankLine=!0,i++,s(e)}function c(t){return eR(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),s):n(t)}function s(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},eJ={partial:!0,tokenize:function(e,t,n){let r=this;return ej(e,function(e){let l=r.events[r.events.length-1];return!eR(e)&&l&&"listItemPrefixWhitespace"===l[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},eG={partial:!0,tokenize:function(e,t,n){let r=this;return ej(e,function(e){let l=r.events[r.events.length-1];return l&&"listItemIndent"===l[1].type&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},e1={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return eR(t)?ej(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)};function l(r){return e.attempt(e1,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),l}return n(t)};function l(n){return eR(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};function e0(e){return null!==e&&(e<32||127===e)}function e2(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function e4(e,t,n,r,l,i,o,a,u){let c=u||Number.POSITIVE_INFINITY,s=0;return function(t){return 60===t?(e.enter(r),e.enter(l),e.enter(i),e.consume(t),e.exit(i),f):null===t||32===t||41===t||e0(t)?n(t):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),h(t))};function f(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(l),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(a),f(t)):null===t||60===t||null!==t&&t<-2?n(t):(e.consume(t),92===t?d:p)}function d(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(l){return!s&&(null===l||41===l||null!==l&&(l<0||32===l))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(l)):s-1&&e.test(String.fromCharCode(t))}}function e5(e,t,n,r,l,i){let o;let a=this,u=0;return function(t){return e.enter(r),e.enter(l),e.consume(t),e.exit(l),e.enter(i),c};function c(f){return u>999||null===f||91===f||93===f&&!o||94===f&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):93===f?(e.exit(i),e.enter(l),e.consume(f),e.exit(l),e.exit(r),t):e6(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),s(f))}function s(t){return null===t||91===t||93===t||e6(t)||u++>999?(e.exit("chunkString"),c(t)):(e.consume(t),!o&&(o=!(-2===t||-1===t||32===t)),92===t?f:s)}function f(t){return 91===t||92===t||93===t?(e.consume(t),u++,s):s(t)}}function e8(e){return null!==e&&e<-2}function e9(e){return -2===e||-1===e||32===e}function e7(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function te(e,t,n,r,l,i){let o;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(l),e.consume(t),e.exit(l),o=40===t?41:t,a):n(t)};function a(n){return n===o?(e.enter(l),e.consume(n),e.exit(l),e.exit(r),t):(e.enter(i),u(n))}function u(t){return t===o?(e.exit(i),a(o)):null===t?n(t):e8(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),function(e,t,n,r){let l=Number.POSITIVE_INFINITY,i=0;return function(r){return e9(r)?(e.enter(n),function r(o){return e9(o)&&i++-1&&e.test(String.fromCharCode(t))}}function tr(e,t){let n;return function r(l){return null!==l&&l<-2?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,r):tt(l)?(function(e,t,n,r){let l=Number.POSITIVE_INFINITY,i=0;return function(r){return tt(r)?(e.enter(n),function r(o){return tt(o)&&i++=4?function t(n){return null===n?i(n):eN(n)?e.attempt(ta,t,i)(n):(e.enter("codeFlowValue"),function n(r){return null===r||eN(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function i(n){return e.exit("codeIndented"),t(n)}}},ta={partial:!0,tokenize:function(e,t,n){let r=this;return l;function l(t){return r.parser.lazy[r.now().line]?n(t):eN(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):ej(e,i,"linePrefix",5)(t)}function i(e){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):eN(e)?l(e):n(e)}}},tu={name:"setextUnderline",resolveTo:function(e,t){let n,r,l,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),l||"definition"!==e[i][1].type||(l=i);let o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",l?(e.splice(r,0,["enter",o,t]),e.splice(l+1,0,["exit",e[n][1],t]),e[n][1].end={...e[l][1].end}):e[n][1]=o,e.push(["exit",o,t]),e},tokenize:function(e,t,n){let r;let l=this;return function(t){let o,a=l.events.length;for(;a--;)if("lineEnding"!==l.events[a][1].type&&"linePrefix"!==l.events[a][1].type&&"content"!==l.events[a][1].type){o="paragraph"===l.events[a][1].type;break}return!l.parser.lazy[l.now().line]&&(l.interrupt||o)?(e.enter("setextHeadingLine"),r=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),eR(n)?ej(e,i,"lineSuffix")(n):i(n))}(t)):n(t)};function i(r){return null===r||eN(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}},tc=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ts=["pre","script","style","textarea"],tf={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(eB,t,n)}}},tp={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return eN(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):n(t)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},td={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l)};function l(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},th={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r;let l=this,i={partial:!0,tokenize:function(e,t,n){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(t){return e.enter("codeFencedFence"),eR(t)?ej(e,u,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):u(t)}function u(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(l){return l===r?(i++,e.consume(l),t):i>=a?(e.exit("codeFencedFenceSequence"),eR(l)?ej(e,c,"whitespace")(l):c(l)):n(l)}(t)):n(t)}function c(r){return null===r||eN(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},o=0,a=0;return function(t){return function(t){let i=l.events[l.events.length-1];return o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,r=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(l){return l===r?(a++,e.consume(l),t):a<3?n(l):(e.exit("codeFencedFenceSequence"),eR(l)?ej(e,u,"whitespace")(l):u(l))}(t)}(t)};function u(i){return null===i||eN(i)?(e.exit("codeFencedFence"),l.interrupt?t(i):e.check(td,s,h)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||eN(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(l)):eR(l)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ej(e,c,"whitespace")(l)):96===l&&l===r?n(l):(e.consume(l),t)}(i))}function c(t){return null===t||eN(t)?u(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(l){return null===l||eN(l)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(l)):96===l&&l===r?n(l):(e.consume(l),t)}(t))}function s(t){return e.attempt(i,h,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return o>0&&eR(t)?ej(e,d,"linePrefix",o+1)(t):d(t)}function d(t){return null===t||eN(t)?e.check(td,s,h)(t):(e.enter("codeFlowValue"),function t(n){return null===n||eN(n)?(e.exit("codeFlowValue"),d(n)):(e.consume(n),t)}(t))}function h(n){return e.exit("codeFenced"),t(n)}}},tm=document.createElement("i");function tg(e){let t="&"+e+";";tm.innerHTML=t;let n=tm.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let ty={name:"characterReference",tokenize:function(e,t,n){let r,l;let i=this,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),r=31,l=eA,c(t))}function u(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,l=eL,c):(e.enter("characterReferenceValue"),r=7,l=eM,c(t))}function c(a){if(59===a&&o){let r=e.exit("characterReferenceValue");return l!==eA||tg(i.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return l(a)&&o++-1&&e.test(String.fromCharCode(t))}}function tz(e){return null===e||null!==e&&(e<0||32===e)||tT(e)?1:tI(e)?2:void 0}let tA={name:"attention",resolveAll:function(e,t){let n,r,l,i,o,a,u,c,s=-1;for(;++s1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;let f={...e[n][1].end},p={...e[s][1].start};tO(f,-a),tO(p,a),i={type:a>1?"strongSequence":"emphasisSequence",start:f,end:{...e[n][1].end}},o={type:a>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:p},l={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[s][1].start}},r={type:a>1?"strong":"emphasis",start:{...i.start},end:{...o.end}},e[n][1].end={...i.start},e[s][1].start={...o.end},u=[],e[n][1].end.offset-e[n][1].start.offset&&(u=ey(u,[["enter",e[n][1],t],["exit",e[n][1],t]])),u=ey(u,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",l,t]]),u=ey(u,tk(t.parser.constructs.insideSpan.null,e.slice(n+1,s),t)),u=ey(u,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",r,t]]),e[s][1].end.offset-e[s][1].start.offset?(c=2,u=ey(u,[["enter",e[s][1],t],["exit",e[s][1],t]])):c=0,eg(e,n-1,s-n+3,u),s=n+u.length-c-2;break}}for(s=-1;++si&&"whitespace"===e[l][1].type&&(l-=2),"atxHeadingSequence"===e[l][1].type&&(i===l-1||l-4>i&&"whitespace"===e[l-2][1].type)&&(l-=i+1===l?2:4),l>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[l][1].end},r={type:"chunkText",start:e[i][1].start,end:e[l][1].end,contentType:"text"},eg(e,i,l-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(l){return e.enter("atxHeading"),e.enter("atxHeadingSequence"),function l(i){return 35===i&&r++<6?(e.consume(i),l):null===i||eF(i)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||eN(r)?(e.exit("atxHeading"),t(r)):eR(r)?ej(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||eF(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(i)):n(i)}(l)}}},42:e$,45:[tu,e$],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,l,i,o,a;let u=this;return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c};function c(o){return 33===o?(e.consume(o),s):47===o?(e.consume(o),l=!0,d):63===o?(e.consume(o),r=3,u.interrupt?t:M):ez(o)?(e.consume(o),i=String.fromCharCode(o),h):n(o)}function s(l){return 45===l?(e.consume(l),r=2,f):91===l?(e.consume(l),r=5,o=0,p):ez(l)?(e.consume(l),r=4,u.interrupt?t:M):n(l)}function f(r){return 45===r?(e.consume(r),u.interrupt?t:M):n(r)}function p(r){let l="CDATA[";return r===l.charCodeAt(o++)?(e.consume(r),o===l.length)?u.interrupt?t:C:p:n(r)}function d(t){return ez(t)?(e.consume(t),i=String.fromCharCode(t),h):n(t)}function h(o){if(null===o||47===o||62===o||eF(o)){let a=47===o,c=i.toLowerCase();return!a&&!l&&ts.includes(c)?(r=1,u.interrupt?t(o):C(o)):tc.includes(i.toLowerCase())?(r=6,a)?(e.consume(o),m):u.interrupt?t(o):C(o):(r=7,u.interrupt&&!u.parser.lazy[u.now().line]?n(o):l?function t(n){return eR(n)?(e.consume(n),t):w(n)}(o):g(o))}return 45===o||eA(o)?(e.consume(o),i+=String.fromCharCode(o),h):n(o)}function m(r){return 62===r?(e.consume(r),u.interrupt?t:C):n(r)}function g(t){return 47===t?(e.consume(t),w):58===t||95===t||ez(t)?(e.consume(t),y):eR(t)?(e.consume(t),g):w(t)}function y(t){return 45===t||46===t||58===t||95===t||eA(t)?(e.consume(t),y):v(t)}function v(t){return 61===t?(e.consume(t),x):eR(t)?(e.consume(t),v):g(t)}function x(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,k):eR(t)?(e.consume(t),x):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||eF(n)?v(n):(e.consume(n),t)}(t)}function k(t){return t===a?(e.consume(t),a=null,b):null===t||eN(t)?n(t):(e.consume(t),k)}function b(e){return 47===e||62===e||eR(e)?g(e):n(e)}function w(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||eN(t)?C(t):eR(t)?(e.consume(t),S):n(t)}function C(t){return 45===t&&2===r?(e.consume(t),P):60===t&&1===r?(e.consume(t),z):62===t&&4===r?(e.consume(t),L):63===t&&3===r?(e.consume(t),M):93===t&&5===r?(e.consume(t),O):eN(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(tf,D,E)(t)):null===t||eN(t)?(e.exit("htmlFlowData"),E(t)):(e.consume(t),C)}function E(t){return e.check(tp,I,D)(t)}function I(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return null===t||eN(t)?E(t):(e.enter("htmlFlowData"),C(t))}function P(t){return 45===t?(e.consume(t),M):C(t)}function z(t){return 47===t?(e.consume(t),i="",A):C(t)}function A(t){if(62===t){let n=i.toLowerCase();return ts.includes(n)?(e.consume(t),L):C(t)}return ez(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),A):C(t)}function O(t){return 93===t?(e.consume(t),M):C(t)}function M(t){return 62===t?(e.consume(t),L):45===t&&2===r?(e.consume(t),M):C(t)}function L(t){return null===t||eN(t)?(e.exit("htmlFlowData"),D(t)):(e.consume(t),L)}function D(n){return e.exit("htmlFlow"),t(n)}}},61:tu,95:e$,96:th,126:th},tR={38:ty,92:tv},t_={[-5]:tx,[-4]:tx,[-3]:tx,33:tE,38:ty,42:tA,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l};function l(t){return ez(t)?(e.consume(t),i):64===t?n(t):a(t)}function i(t){return 43===t||45===t||46===t||eA(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,o):(43===n||45===n||46===n||eA(n))&&r++<32?(e.consume(n),t):(r=0,a(n))}(t)):a(t)}function o(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||null!==r&&(r<32||127===r)?n(r):(e.consume(r),o)}function a(t){return 64===t?(e.consume(t),u):eO(t)?(e.consume(t),a):n(t)}function u(l){return eA(l)?function l(i){return 46===i?(e.consume(i),r=0,u):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||eA(i))&&r++<63){let n=45===i?t:l;return e.consume(i),n}return n(i)}(i)}(l):n(l)}}},{name:"htmlText",tokenize:function(e,t,n){let r,l,i;let o=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),u):47===t?(e.consume(t),k):63===t?(e.consume(t),v):ez(t)?(e.consume(t),w):n(t)}function u(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),l=0,d):ez(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function s(t){return null===t?n(t):45===t?(e.consume(t),f):eN(t)?(i=s,A(t)):(e.consume(t),s)}function f(t){return 45===t?(e.consume(t),p):s(t)}function p(e){return 62===e?z(e):45===e?f(e):s(e)}function d(t){let r="CDATA[";return t===r.charCodeAt(l++)?(e.consume(t),l===r.length?h:d):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):eN(t)?(i=h,A(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?z(t):93===t?(e.consume(t),g):h(t)}function y(t){return null===t||62===t?z(t):eN(t)?(i=y,A(t)):(e.consume(t),y)}function v(t){return null===t?n(t):63===t?(e.consume(t),x):eN(t)?(i=v,A(t)):(e.consume(t),v)}function x(e){return 62===e?z(e):v(e)}function k(t){return ez(t)?(e.consume(t),b):n(t)}function b(t){return 45===t||eA(t)?(e.consume(t),b):function t(n){return eN(n)?(i=t,A(n)):eR(n)?(e.consume(n),t):z(n)}(t)}function w(t){return 45===t||eA(t)?(e.consume(t),w):47===t||62===t||eF(t)?S(t):n(t)}function S(t){return 47===t?(e.consume(t),z):58===t||95===t||ez(t)?(e.consume(t),C):eN(t)?(i=S,A(t)):eR(t)?(e.consume(t),S):z(t)}function C(t){return 45===t||46===t||58===t||95===t||eA(t)?(e.consume(t),C):function t(n){return 61===n?(e.consume(n),E):eN(n)?(i=t,A(n)):eR(n)?(e.consume(n),t):S(n)}(t)}function E(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,I):eN(t)?(i=E,A(t)):eR(t)?(e.consume(t),E):(e.consume(t),T)}function I(t){return t===r?(e.consume(t),r=void 0,P):null===t?n(t):eN(t)?(i=I,A(t)):(e.consume(t),I)}function T(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||eF(t)?S(t):(e.consume(t),T)}function P(e){return 47===e||62===e||eF(e)?S(e):n(e)}function z(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function A(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),O}function O(t){return eR(t)?ej(e,M,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):M(t)}function M(t){return e.enter("htmlTextData"),i(t)}}}],91:tM,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return eN(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},tv],93:tb,95:tA,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,l=3;if(("lineEnding"===e[3][1].type||"space"===e[l][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=l;++t13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let tU=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tq(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return tZ(n.slice(t?2:1),t?16:10)}return tg(n)||e}let tW={}.hasOwnProperty;function tY(e){return{line:e.line,column:e.column,offset:e.offset}}function tK(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+Y({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Y({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+Y({start:t.start,end:t.end})+") is still open")}function tQ(e){let t=this;t.parser=function(n){var r,i;let o,a,u,c;return"string"!=typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(y),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(h),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(d),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:r(d,l),codeText:r(function(){return{type:"inlineCode",value:""}},l),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,l),htmlFlowData:c,htmlText:r(g,l),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:l,link:r(y),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:r(h),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:o(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];if(!t.depth){let n=this.sliceSerialize(e).length;t.depth=n}},autolink:o(),autolinkEmail:function(e){s.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){s.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:o(),characterEscapeValue:s,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t;let n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=tZ(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tg(n);let l=this.stack[this.stack.length-1];l.value+=t},characterReference:function(e){this.stack.pop().position.end=tY(e.end)},codeFenced:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:s,codeIndented:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:s,data:s,definition:o(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=tl(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:o(),hardBreakEscape:o(f),hardBreakTrailing:o(f),htmlFlow:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:s,htmlText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:s,image:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){let t=e.children;n.children=t}else n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(tU,tq),n.identifier=tl(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=tY(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),s.call(this,e))},link:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=tl(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:o(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:o(),thematicBreak:o()}};(function e(t,n){let r=-1;for(;++r0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||tK).call(o,void 0,e[0])}for(r.position={start:tY(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:tY(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},s=-1;++s-1){let e=n[0];"string"==typeof e?n[0]=e.slice(l):n.shift()}o>0&&n.push(e[i].slice(0,o))}return n}(o,e)}function p(){let{_bufferIndex:e,_index:t,line:n,column:l,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:l,offset:i}}function d(e,t){t.restore()}function h(e,t){return function(n,l,i){let o,s,f,d;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){let t=null!==e&&n[e],r=null!==e&&n.null;return h([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)};function h(e){return(o=e,s=0,0===e.length)?i:m(e[s])}function m(e){return function(n){return(d=function(){let e=p(),t=c.previous,n=c.currentConstruct,l=c.events.length,i=Array.from(a);return{from:l,restore:function(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=l,a=i,g()}}}(),f=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?v(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,u,y,v)(n)}}function y(t){return e(f,d),l}function v(e){return(d.restore(),++s{let n=(t,n)=>(e.set(n,t),t),r=l=>{if(e.has(l))return e.get(l);let[i,o]=t[l];switch(i){case 0:case -1:return n(o,l);case 1:{let e=n([],l);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},l);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),l);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),l)}case 5:{let e=n(new Map,l);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,l);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new t$[e](t),l)}case 8:return n(BigInt(o),l);case"BigInt":return n(Object(BigInt(o)),l);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new t$[i](o),l)};return r},tJ=e=>tX(new Map,e)(0),{toString:tG}={},{keys:t1}=Object,t0=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=tG.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},t2=([e,t])=>0===e&&("function"===t||"symbol"===t),t4=(e,t,n,r)=>{let l=(e,t)=>{let l=r.push(e)-1;return n.set(t,l),l},i=r=>{if(n.has(r))return n.get(r);let[o,a]=t0(r);switch(o){case 0:{let t=r;switch(a){case"bigint":o=8,t=r.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+a);t=null;break;case"undefined":return l([-1],r)}return l([o,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),l([a,[...e]],r)}let e=[],t=l([o,e],r);for(let t of r)e.push(i(t));return t}case 2:{if(a)switch(a){case"BigInt":return l([a,r.toString()],r);case"Boolean":case"Number":case"String":return l([a,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());let n=[],u=l([o,n],r);for(let t of t1(r))(e||!t2(t0(r[t])))&&n.push([i(t),i(r[t])]);return u}case 3:return l([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return l([o,{source:e,flags:t}],r)}case 5:{let t=[],n=l([o,t],r);for(let[n,l]of r)(e||!(t2(t0(n))||t2(t0(l))))&&t.push([i(n),i(l)]);return n}case 6:{let t=[],n=l([o,t],r);for(let n of r)(e||!t2(t0(n)))&&t.push(i(n));return n}}let{message:u}=r;return l([o,{name:a,message:u}],r)};return i},t6=(e,{json:t,lossy:n}={})=>{let r=[];return t4(!(t||n),!!t,new Map,r)(e),r};var t3="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?tJ(t6(e,t)):structuredClone(e):(e,t)=>tJ(t6(e,t));t8(/[A-Za-z]/);let t5=t8(/[\dA-Za-z]/);function t8(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function t9(e){let t=[],n=-1,r=0,l=0;for(;++n55295&&i<57344){let t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(o=String.fromCharCode(i,t),l=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+l+1,o=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function t7(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ne(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}t8(/[#-'*+\--9=?A-Z^-~]/),t8(/\d/),t8(/[\dA-Fa-f]/),t8(/[!-/:-@[-`{-~]/),t8(/\p{P}|\p{S}/u),t8(/\s/);let nt=function(e){if(null==e)return nr;if("function"==typeof e)return nn(e);if("object"==typeof e)return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n":"")+")"})}return s;function s(){var c;let s,f,p,d=nl;if((!t||i(l,a,u[u.length-1]||void 0))&&!1===(d=Array.isArray(c=n(l,u))?c:"number"==typeof c?[!0,c]:null==c?nl:[c])[0])return d;if("children"in l&&l.children&&l.children&&"skip"!==d[0])for(f=(r?l.children.length:-1)+o,p=u.concat(l);f>-1&&f1:t}function nu(e,t,n){let r=0,l=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(l-1);for(;9===t||32===t;)l--,t=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}let nc={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l={type:"element",tagName:"pre",properties:{},children:[l=e.applyData(t,l)]},e.patch(t,l),l},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n;let r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",l=String(t.identifier).toUpperCase(),i=t9(l.toLowerCase()),o=e.footnoteOrder.indexOf(l),a=e.footnoteCounts.get(l);void 0===a?(a=0,e.footnoteOrder.push(l),n=e.footnoteOrder.length):n=o+1,a+=1,e.footnoteCounts.set(l,a);let u={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+i,id:r+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,u);let c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return no(e,t);let l={src:t9(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let n={src:t9(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return no(e,t);let l={href:t9(r.url||"")};null!==r.title&&void 0!==r.title&&(l.title=r.title);let i={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let n={href:t9(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),l=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=q(t.children[1]),o=U(t.children[t.children.length-1]);i&&o&&(r.position={start:i,end:o}),l.push(r)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,l=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,o=i?i.length:t.children.length,a=-1,u=[];for(;++a0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return i.push(nu(t.slice(l),l>0,!1)),i.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:ns,yaml:ns,definition:ns,footnoteDefinition:ns};function ns(){}let nf={}.hasOwnProperty,np={};function nd(e,t){e.position&&(t.position=function(e){let t=q(e),n=U(e);if(t&&n)return{start:t,end:n}}(e))}function nh(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,l=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&l&&Object.assign(n.properties,t3(l)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function nm(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r0&&n.push({type:"text",value:"\n"}),n}function ng(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ny(e,t){let n=function(e,t){let n=t||np,r=new Map,l=new Map,i={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r0&&f.push({type:"text",value:" "});let e="string"==typeof n?n:n(u,s);"string"==typeof e&&(e={type:"text",value:e}),f.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(s>1?"-"+s:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(u,s),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let d=i[i.length-1];if(d&&"element"===d.type&&"p"===d.tagName){let e=d.children[d.children.length-1];e&&"text"===e.type?e.value+=" ":d.children.push({type:"text",value:" "}),d.children.push(...f)}else i.push(...f);let h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(l,h),a.push(h)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...t3(o),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return l&&i.children.push({type:"text",value:"\n"},l),i}function nv(e,t){return e&&"run"in e?async function(n,r){let l=ny(n,{file:r,...t});await e.run(l,r)}:function(n,r){return ny(n,{file:r,...e||t})}}function nx(e){if(e)throw e}var nk=n(6500);function nb(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let nw={basename:function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');nS(e);let r=0,l=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1);return l<0?"":e.slice(r,l)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(l=i):(a=-1,l=o));return r===l?l=o:l<0&&(l=e.length),e.slice(r,l)},dirname:function(e){let t;if(nS(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){let t;nS(e);let n=e.length,r=-1,l=0,i=-1,o=0;for(;n--;){let a=e.codePointAt(n);if(47===a){if(t){l=n+1;break}continue}r<0&&(t=!0,r=n+1),46===a?i<0?i=n:1!==o&&(o=1):i>-1&&(o=-1)}return i<0||r<0||0===o||1===o&&i===r-1&&i===l+1?"":e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n2){if((r=l.lastIndexOf("/"))!==l.length-1){r<0?(l="",i=0):i=(l=l.slice(0,r)).length-1-l.lastIndexOf("/"),o=u,a=0;continue}}else if(l.length>0){l="",i=0,o=u,a=0;continue}}t&&(l=l.length>0?l+"/..":"..",i=2)}else l.length>0?l+="/"+e.slice(o+1,u):l=e.slice(o+1,u),i=u-o-1;o=u,a=0}else 46===n&&a>-1?a++:a=-1}return l}(e,!t);return 0!==n.length||t||(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function nS(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}let nC={cwd:function(){return"/"}};function nE(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let nI=["history","path","basename","stem","extname","dirname"];class nT{constructor(e){let t,n;t=e?nE(e)?{path:e}:"string"==typeof e||e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e?{value:e}:e:{},this.cwd="cwd"in t?"":nC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++rt.length;o&&t.push(r);try{i=e.apply(this,t)}catch(e){if(o&&n)throw e;return r(e)}o||(i&&i.then&&"function"==typeof i.then?i.then(l,r):i instanceof Error?r(i):l(i))};function r(e,...l){n||(n=!0,t(e,...l))}function l(e){r(null,e)}})(a,l)(...o):r(null,...o)})(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new nL,t=-1;for(;++t0){let[r,...i]=t,o=n[l][1];nb(o)&&nb(r)&&(r=nk(!0,o,r)),n[l]=[e,r,...i]}}}}let nD=new nL().freeze();function nN(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function nF(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function nR(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function n_(e){if(!nb(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function nj(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nB(e){return e&&"object"==typeof e&&"message"in e&&"messages"in e?e:new nT(e)}let nH=[],nV={allowDangerousHtml:!0},nZ=/^(https?|ircs?|mailto|xmpp)$/i,nU=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function nq(e){let t=function(e){let t=e.rehypePlugins||nH,n=e.remarkPlugins||nH,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nV}:nV;return nD().use(tQ).use(n).use(nv,r).use(t)}(e),n=function(e){let t=e.children||"",n=new nT;return"string"==typeof t&&(n.value=t),n}(e);return function(e,t){let n=t.allowedElements,r=t.allowElement,l=t.components,i=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||nW;for(let e of nU)Object.hasOwn(t,e.from)&&(e.from,e.to&&e.to,e.id);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:"root"===e.type?e.children:[e]}),ni(e,function(e,t,l){if("raw"===e.type&&l&&"number"==typeof t)return o?l.children.splice(t,1):l.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in ef)if(Object.hasOwn(ef,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=ef[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=u(String(n||""),t,e))}}if("element"===e.type){let o=n?!n.includes(e.tagName):!!i&&i.includes(e.tagName);if(!o&&r&&"number"==typeof t&&(o=!r(e,t,l)),o&&l&&"number"==typeof t)return a&&e.children?l.children.splice(t,1,...e.children):l.children.splice(t,1),t}}),function(e,t){var n,r,l;let i;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=t.jsxDEV,i=function(e,t,r,l){let i=Array.isArray(r.children),a=q(e);return n(t,r,l,i,{columnNumber:a?a.column-1:void 0,fileName:o,lineNumber:a?a.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");r=t.jsx,l=t.jsxs,i=function(e,t,n,i){let o=Array.isArray(n.children)?l:r;return i?o(t,n,i):o(t,n)}}let a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:i,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?F:N,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=el(a,e,void 0);return u&&"string"!=typeof u?u:a.create(e,a.Fragment,{children:u||void 0},void 0)}(e,{Fragment:ep.Fragment,components:l,ignoreInvalidStyle:!0,jsx:ep.jsx,jsxs:ep.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(n),n),e)}function nW(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),l=e.indexOf("/");return -1===t||-1!==l&&t>l||-1!==n&&t>n||-1!==r&&t>r||nZ.test(e.slice(0,t))?e:""}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9039-b27050bcf5fc1882.js b/litellm/proxy/_experimental/out/_next/static/chunks/9039-b27050bcf5fc1882.js deleted file mode 100644 index 071857a66f0..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9039-b27050bcf5fc1882.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9039],{69039:function(e,s,a){a.r(s),a.d(s,{default:function(){return ec}});var t=a(57437),r=a(2265),n=a(25992),l=a(9114),i=a(26430),o=a(96473),d=a(50010),c=a(26349),m=a(37592),u=a(4260),x=a(5545),g=a(99981),h=a(93837),p=a(27930),v=a(66830),f=a(95459),y=a(10703),j=a(91643),b=a(26832),N=a(32489),w=a(98728),k=a(79862),A=a(82222),S=a(51817),C=a(62831),T=a(17906),L=a(94263),P=a(88712),Z=a(94331),M=a(38398),U=a(33152);function E(e){let{messages:s,isLoading:a}=e;if(0===s.length)return(0,t.jsx)("div",{className:"h-full"});let r=[],n=0;for(;n(0,t.jsxs)("div",{className:"whitespace-pre-wrap break-words",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:[(0,t.jsx)(P.Z,{message:e}),(0,t.jsx)(C.UG,{components:{code(e){let{node:s,inline:a,className:r,children:n,...l}=e,i=/language-(\w+)/.exec(r||"");return!a&&i?(0,t.jsx)(T.Z,{style:L.Z,language:i[1],PreTag:"div",className:"rounded-md my-2",wrapLines:!0,wrapLongLines:!0,...l,children:String(n).replace(/\n$/,"")}):(0,t.jsx)("code",{className:"".concat(r," px-1.5 py-0.5 rounded bg-gray-100 text-sm font-mono"),...l,children:n})},pre:e=>{let{node:s,...a}=e;return(0,t.jsx)("pre",{style:{overflowX:"auto",maxWidth:"100%"},...a})}},children:"string"==typeof e.content?e.content:""})]});return(0,t.jsxs)("div",{className:"flex flex-col gap-6 min-w-0 w-full p-4",children:[r.map((e,s)=>{let n=e.assistant,i=(null==n?void 0:n.model)||"Assistant";return(0,t.jsxs)("div",{className:"space-y-4",children:[e.user&&(0,t.jsxs)("div",{className:"space-y-2 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-blue-100 text-blue-600",children:(0,t.jsx)(k.Z,{size:16})}),(0,t.jsx)("div",{className:"text-sm font-semibold text-gray-700",children:"You"})]}),l(e.user)]}),(0,t.jsx)("div",{className:"border-t border-gray-200"}),n?(0,t.jsxs)("div",{className:"space-y-3 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-gray-100 text-gray-600",children:(0,t.jsx)(A.Z,{size:16})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-gray-700",children:i}),n.toolName&&(0,t.jsx)("span",{className:"rounded bg-gray-100 px-2 py-0.5 text-xs text-gray-600",children:n.toolName})]})]}),n.reasoningContent&&(0,t.jsx)(Z.Z,{reasoningContent:n.reasoningContent}),n.searchResults&&(0,t.jsx)(U.J,{searchResults:n.searchResults}),l(n),(n.timeToFirstToken||n.totalLatency||n.usage)&&(0,t.jsx)(M.Z,{timeToFirstToken:n.timeToFirstToken,totalLatency:n.totalLatency,usage:n.usage,toolName:n.toolName})]}):a&&s===r.length-1?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,t.jsx)(S.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]}):(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"Waiting for a response..."})]},s)}),a&&0===r.length&&(0,t.jsxs)("div",{className:"flex items-center gap-2 text-gray-500",children:[(0,t.jsx)(S.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]})]})}var R=a(10353);function I(e){let{value:s,options:a,loading:r,config:n,onChange:l}=e;return(0,t.jsx)(m.default,{value:s||void 0,placeholder:r?"Loading ".concat(n.selectorLabel.toLowerCase(),"s..."):n.selectorPlaceholder,onChange:l,loading:r,showSearch:!0,filterOption:(e,s)=>{var a;return(null!==(a=null==s?void 0:s.label)&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())},options:a,className:"w-48",notFoundContent:r?(0,t.jsx)("div",{className:"flex items-center justify-center py-2",children:(0,t.jsx)(R.Z,{size:"small"})}):"No ".concat(n.selectorLabel.toLowerCase(),"s available")})}var _=a(99020),O=a(97415),z=a(67479),K=a(61994),B=a(23496),D=a(85847),W=a(79326);let F="/v1/chat/completions",G="/a2a",V={[F]:{id:F,label:"/v1/chat/completions",selectorType:"model",selectorLabel:"Model",selectorPlaceholder:"Select a model",inputPlaceholder:"Send a prompt to compare models",loadingMessage:"Gathering responses from all models...",validationMessage:"Select a model before sending a message."},[G]:{id:G,label:"/a2a (Agents)",selectorType:"agent",selectorLabel:"Agent",selectorPlaceholder:"Select an agent",inputPlaceholder:"Send a message to compare agents",loadingMessage:"Gathering responses from all agents...",validationMessage:"Select an agent before sending a message."}},H=()=>Object.values(V).map(e=>({value:e.id,label:e.label})),X=e=>V[e],Y=e=>"agent"===V[e].selectorType,q=e=>e.map(e=>({value:e,label:e})),J=e=>e.map(e=>({value:e.agent_name,label:e.agent_name||e.agent_id})),$=(e,s)=>Y(s)?e.agent:e.model,Q=(e,s)=>{let a=$(e,s);return!!(a&&a.trim())};function ee(e){let{comparison:s,onUpdate:a,onRemove:n,canRemove:l,selectorOptions:i,isLoadingOptions:o,endpointConfig:d,apiKey:c}=e,m=Y(d.id),u=$(s,d.id),[x,g]=(0,r.useState)(!1),h=e=>{e?a({applyAcrossModels:!0,temperature:s.temperature,maxTokens:s.maxTokens,tags:[...s.tags],vectorStores:[...s.vectorStores],guardrails:[...s.guardrails],useAdvancedParams:s.useAdvancedParams},{applyToAll:!0,keysToApply:["temperature","maxTokens","tags","vectorStores","guardrails","useAdvancedParams"]}):a({applyAcrossModels:!1})},p=e=>{a({useAdvancedParams:e},s.applyAcrossModels?{applyToAll:!0,keysToApply:["useAdvancedParams"]}:void 0)},v=(e,t)=>{a({[e]:t},s.applyAcrossModels?{applyToAll:!0,keysToApply:[e]}:void 0)},f=s.useAdvancedParams?1:.4,y=s.useAdvancedParams?"text-gray-700":"text-gray-400",j=()=>{g(e=>!e)},b=(0,t.jsxs)("div",{className:"w-[300px] max-h-[65vh] overflow-y-auto relative",children:[(0,t.jsx)("button",{onClick:()=>{g(!1)},className:"absolute top-0 right-0 p-1 hover:bg-gray-100 rounded transition-colors text-gray-500 hover:text-gray-700 z-10",children:(0,t.jsx)(N.Z,{size:14})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(K.Z,{checked:s.applyAcrossModels,onChange:e=>h(e.target.checked),children:(0,t.jsx)("span",{className:"text-xs font-medium",children:"Sync Settings Across Models"})})}),(0,t.jsx)(B.Z,{className:"border-gray-200"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-700 mb-1.5 uppercase tracking-wide",children:"General Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Tags"}),(0,t.jsx)(_.Z,{value:s.tags,onChange:e=>v("tags",e),accessToken:c})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Vector Stores"}),(0,t.jsx)(O.Z,{value:s.vectorStores,onChange:e=>v("vectorStores",e),accessToken:c})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-gray-600 block mb-0.5",children:"Guardrails"}),(0,t.jsx)(z.Z,{value:s.guardrails,onChange:e=>v("guardrails",e),accessToken:c})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"text-xs font-semibold text-gray-700 mb-1.5 uppercase tracking-wide",children:"Advanced Settings"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 pb-1",children:(0,t.jsx)(K.Z,{checked:s.useAdvancedParams,onChange:e=>p(e.target.checked),children:(0,t.jsx)("span",{className:"text-sm font-medium",children:"Use Advanced Parameters"})})}),(0,t.jsxs)("div",{className:"space-y-2 transition-opacity duration-200",style:{opacity:f},children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium ".concat(y),children:"Temperature"}),(0,t.jsx)("span",{className:"text-xs ".concat(y),children:s.temperature.toFixed(2)})]}),(0,t.jsx)(D.Z,{min:0,max:2,step:.01,value:s.temperature,onChange:e=>{v("temperature",Math.min(2,Math.max(0,Number((Array.isArray(e)?e[0]:e).toFixed(2)))))},disabled:!s.useAdvancedParams})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("label",{className:"text-xs font-medium ".concat(y),children:"Max Tokens"}),(0,t.jsx)("span",{className:"text-xs ".concat(y),children:s.maxTokens})]}),(0,t.jsx)(D.Z,{min:1,max:32768,step:1,value:s.maxTokens,onChange:e=>{v("maxTokens",Math.min(32768,Math.max(1,Math.round(Array.isArray(e)?e[0]:e))))},disabled:!s.useAdvancedParams})]})]})]})]})]})]});return(0,t.jsxs)("div",{className:"bg-white first:border-l-0 border-l border-gray-200 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"border-b flex items-center justify-between gap-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-1",children:[(0,t.jsx)(I,{value:u,options:i,loading:o,config:d,onChange:e=>a(m?{agent:e}:{model:e})}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(W.Z,{content:b,trigger:[],open:x,onOpenChange:()=>{},placement:"bottomRight",destroyTooltipOnHide:!1,children:(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),j()},className:"p-2 rounded-lg transition-colors ".concat(x?"bg-gray-200 text-gray-700":"hover:bg-gray-100 text-gray-600"),children:(0,t.jsx)(w.Z,{size:18})})})})]}),l&&(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},className:"p-2 hover:bg-red-50 text-red-600 rounded-lg transition-colors",children:(0,t.jsx)(N.Z,{size:18})})]}),(0,t.jsx)("div",{className:"relative flex-1 flex flex-col min-h-0",children:(0,t.jsx)("div",{className:"flex-1 max-h-[calc(100vh-385px)] overflow-auto rounded-b-2xl",children:(0,t.jsx)(E,{messages:s.messages,isLoading:s.isLoading})})})]})}var es=a(79276);let{TextArea:ea}=u.default;function et(e){let{value:s,onChange:a,onSend:r,disabled:n,hasAttachment:l,uploadComponent:i}=e,o=!n&&(s.trim().length>0||!!l);return(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsxs)("div",{className:"flex items-center flex-1 bg-white border border-gray-300 rounded-xl px-3 py-1 min-h-[44px]",children:[i&&(0,t.jsx)("div",{className:"flex-shrink-0 mr-2",children:i}),(0,t.jsx)(ea,{value:s,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),o&&r())},placeholder:"Type your message... (Shift+Enter for new line)",disabled:n,className:"flex-1",autoSize:{minRows:1,maxRows:4},style:{resize:"none",border:"none",boxShadow:"none",background:"transparent",padding:"4px 0",fontSize:"14px",lineHeight:"20px"}}),(0,t.jsx)(x.ZP,{onClick:r,disabled:!o,icon:(0,t.jsx)(es.Z,{}),shape:"circle"})]})})}let er=["Can you summarize the key points?","What assumptions did you make?","What are the next steps?"],en=["Write me a poem","Explain quantum computing","Draft a polite email requesting a meeting"];function el(e){let{accessToken:s,disabledPersonalKeyCreation:a}=e,[n,N]=(0,r.useState)([{id:"1",model:"",agent:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1},{id:"2",model:"",agent:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1}]),[w,k]=(0,r.useState)([]),[A,S]=(0,r.useState)([]),[C,T]=(0,r.useState)(!1),[L,P]=(0,r.useState)(!1),[Z,M]=(0,r.useState)(F),U=X(Z),E=Y(Z),R=E?J(A):q(w),I=E?L:C,[_,O]=(0,r.useState)(""),[z,K]=(0,r.useState)(null),[B,D]=(0,r.useState)(null),[W,G]=(0,r.useState)(a?"custom":"session"),[V,$]=(0,r.useState)(""),[es,ea]=(0,r.useState)(""),[el]=(0,r.useState)(()=>sessionStorage.getItem("customProxyBaseUrl")||"");(0,r.useEffect)(()=>{let e=setTimeout(()=>{ea(V)},300);return()=>clearTimeout(e)},[V]),(0,r.useEffect)(()=>()=>{B&&URL.revokeObjectURL(B)},[B]);let ei=(0,r.useMemo)(()=>"session"===W?s||"":es.trim(),[W,s,es]),eo=(0,r.useMemo)(()=>n.length>0&&n.every(e=>!e.isLoading&&e.messages.some(e=>"assistant"===e.role)),[n]);(0,r.useEffect)(()=>{let e=!0;return(async()=>{if(!ei){k([]);return}T(!0);try{let s=await (0,y.p)(ei);if(!e)return;let a=Array.from(new Set(s.map(e=>e.model_group)));k(a)}catch(s){console.error("CompareUI: failed to fetch models",s),e&&k([])}finally{e&&T(!1)}})(),()=>{e=!1}},[ei]),(0,r.useEffect)(()=>{let e=!0;return(async()=>{if(!ei||!E){S([]);return}P(!0);try{let s=await (0,j.o)(ei,el||void 0);if(!e)return;S(s)}catch(s){console.error("CompareUI: failed to fetch agents",s),e&&S([])}finally{e&&P(!1)}})(),()=>{e=!1}},[ei,E]),(0,r.useEffect)(()=>{0!==w.length&&N(e=>e.map((e,s)=>{var a,t,r,n,l;return{...e,temperature:null!==(a=e.temperature)&&void 0!==a?a:1,maxTokens:null!==(t=e.maxTokens)&&void 0!==t?t:2048,applyAcrossModels:null!==(r=e.applyAcrossModels)&&void 0!==r&&r,useAdvancedParams:null!==(n=e.useAdvancedParams)&&void 0!==n&&n,...e.model?{}:{model:null!==(l=w[s%w.length])&&void 0!==l?l:""}}}))},[w]);let ed=e=>{n.length>1&&N(s=>s.filter(s=>s.id!==e))},ec=(e,s,a)=>{N(t=>{var r;if((null==a?void 0:a.applyToAll)&&(null===(r=a.keysToApply)||void 0===r?void 0:r.length)){let r={};a.keysToApply.forEach(e=>{let a=s[e];void 0!==a&&(r[e]=Array.isArray(a)?[...a]:a)});let n=Object.keys(r).length>0;return t.map(a=>a.id===e?{...a,...s}:n?{...a,...r}:a)}return t.map(a=>a.id===e?{...a,...s}:a)})},em=()=>{B&&URL.revokeObjectURL(B),K(null),D(null)},eu=(e,s,a)=>{s&&N(t=>t.map(t=>{if(t.id!==e)return t;let r=[...t.messages],n=r[r.length-1];if(n&&"assistant"===n.role){var l;let e="string"==typeof n.content?n.content:"";r[r.length-1]={...n,content:e+s,model:null!==(l=n.model)&&void 0!==l?l:a}}else r.push({role:"assistant",content:s,model:a});return{...t,messages:r}}))},ex=(e,s)=>{s&&N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,reasoningContent:(r.reasoningContent||"")+s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",reasoningContent:s}),{...a,messages:t}}))},eg=(e,s)=>{N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,timeToFirstToken:s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",timeToFirstToken:s}),{...a,messages:t}}))},eh=(e,s)=>{N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role?t[t.length-1]={...r,totalLatency:s}:r&&"user"===r.role&&t.push({role:"assistant",content:"",totalLatency:s}),{...a,messages:t}}))},ep=(e,s,a)=>{N(t=>t.map(t=>{if(t.id!==e)return t;let r=[...t.messages],n=r[r.length-1];return n&&"assistant"===n.role&&(r[r.length-1]={...n,usage:s,toolName:a}),{...t,messages:r}}))},ev=(e,s)=>{s&&N(a=>a.map(a=>{if(a.id!==e)return a;let t=[...a.messages],r=t[t.length-1];return r&&"assistant"===r.role&&(t[t.length-1]={...r,searchResults:s}),{...a,messages:t}}))},ef=!!s,ey=async e=>{let s=e.trim(),a=!!z;if(!s&&!a)return;if(!ei){l.Z.fromBackend("Please provide a Virtual Key or select Current UI Session");return}if(0===n.length)return;if(n.some(e=>!Q(e,Z))){l.Z.fromBackend(U.validationMessage);return}let t=a?await (0,v.Sn)(s,z):{role:"user",content:s},r=(0,v.Hk)(s,a,B||void 0,null==z?void 0:z.name),i=new Map;n.forEach(e=>{var a;let n=null!==(a=e.traceId)&&void 0!==a?a:(0,h.Z)(),l=[...e.messages.map(e=>{let{role:s,content:a}=e;return{role:s,content:Array.isArray(a)?a:"string"==typeof a?a:""}}),t];i.set(e.id,{id:e.id,model:e.model,agent:e.agent,inputMessage:s,traceId:n,tags:e.tags,vectorStores:e.vectorStores,guardrails:e.guardrails,temperature:e.temperature,maxTokens:e.maxTokens,displayMessages:[...e.messages,r],apiChatHistory:l})}),0!==i.size&&(N(e=>e.map(e=>{let s=i.get(e.id);return s?{...e,traceId:s.traceId,messages:s.displayMessages,isLoading:!0}:e})),O(""),em(),i.forEach(e=>{var s;let a=e.tags.length>0?e.tags:void 0,t=e.vectorStores.length>0?e.vectorStores:void 0,r=e.guardrails.length>0?e.guardrails:void 0,i=n.find(s=>s.id===e.id),o=null!==(s=null==i?void 0:i.useAdvancedParams)&&void 0!==s&&s;(E?(0,b.m)(e.agent,e.inputMessage,(s,a)=>{N(t=>t.map(t=>{if(t.id!==e.id)return t;let r=[...t.messages],n=r[r.length-1];if(n&&"assistant"===n.role){var l;r[r.length-1]={...n,content:s,model:null!==(l=n.model)&&void 0!==l?l:a}}else r.push({role:"assistant",content:s,model:a});return{...t,messages:r}}))},ei,void 0,s=>eg(e.id,s),s=>eh(e.id,s),void 0,el||void 0):(0,f.n)(e.apiChatHistory,(s,a)=>eu(e.id,s,a),e.model,ei,a,void 0,s=>ex(e.id,s),s=>eg(e.id,s),s=>ep(e.id,s),e.traceId,t,r,void 0,void 0,s=>ev(e.id,s),o?e.temperature:void 0,o?e.maxTokens:void 0,s=>eh(e.id,s),el||void 0)).catch(s=>{let a=s instanceof Error?s.message:String(s);console.error("CompareUI: failed to fetch response",s),l.Z.fromBackend(a),N(s=>s.map(s=>{if(s.id!==e.id)return s;let t=[...s.messages],r=t[t.length-1],n=r&&"assistant"===r.role&&"string"==typeof r.content?r.content:"";return r&&"assistant"===r.role?t[t.length-1]={...r,content:n?"".concat(n,"\nError fetching response: ").concat(a):"Error fetching response: ".concat(a)}:t.push({role:"assistant",content:"Error fetching response: ".concat(a)}),{...s,messages:t}}))}).finally(()=>{N(s=>s.map(s=>s.id===e.id?{...s,isLoading:!1}:s))})}))},ej=e=>{O(e)},eb=n.some(e=>e.messages.length>0),eN=n.some(e=>e.isLoading),ew=!!z,ek=!!(null==z?void 0:z.name.toLowerCase().endsWith(".pdf")),eA=!eb&&!eN&&!ew;return(0,t.jsx)("div",{className:"w-full h-full p-4 bg-white",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white shadow-sm min-h-[calc(100vh-160px)] flex flex-col",children:[(0,t.jsx)("div",{className:"border-b px-4 py-2",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-600",children:"Virtual Key Source"}),(0,t.jsxs)(m.default,{value:W,onChange:e=>G(e),disabled:a,className:"w-48",children:[(0,t.jsx)(m.default.Option,{value:"session",disabled:!ef,children:"Current UI Session"}),(0,t.jsx)(m.default.Option,{value:"custom",children:"Virtual Key"})]}),"custom"===W&&(0,t.jsx)(u.default.Password,{value:V,onChange:e=>$(e.target.value),placeholder:"Enter Virtual Key",className:"w-56"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-gray-600",children:"Endpoint"}),(0,t.jsx)(m.default,{value:Z,onChange:e=>M(e),className:"w-56",children:H().map(e=>(0,t.jsx)(m.default.Option,{value:e.value,children:e.label},e.value))})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(x.ZP,{onClick:()=>{N(e=>e.map(e=>({...e,messages:[],traceId:void 0,isLoading:!1}))),O(""),em()},disabled:!eb,icon:(0,t.jsx)(i.Z,{}),children:"Clear All Chats"}),(0,t.jsx)(g.Z,{title:n.length>=3?"Compare up to 3 models at a time":"Add another comparison",children:(0,t.jsx)(x.ZP,{onClick:()=>{var e,s,a;if(n.length>=3)return;let t=null!==(s=w[n.length%(w.length||1)])&&void 0!==s?s:"",r=null!==(a=null===(e=A[n.length%(A.length||1)])||void 0===e?void 0:e.agent_name)&&void 0!==a?a:"",l={id:Date.now().toString(),model:t,agent:r,messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1};N(e=>[...e,l])},disabled:n.length>=3,icon:(0,t.jsx)(o.Z,{}),children:"Add Comparison"})})]})]})}),(0,t.jsx)("div",{className:"grid flex-1 min-h-0 auto-rows-[minmax(0,1fr)]",style:{gridTemplateColumns:"repeat(".concat(n.length,", minmax(0, 1fr))")},children:n.map(e=>(0,t.jsx)(ee,{comparison:e,onUpdate:(s,a)=>ec(e.id,s,a),onRemove:()=>ed(e.id),canRemove:n.length>1,selectorOptions:R,isLoadingOptions:I,endpointConfig:U,apiKey:ei},e.id))}),(0,t.jsx)("div",{className:"flex justify-center pb-4",children:(0,t.jsx)("div",{className:"w-full max-w-3xl px-4",children:(0,t.jsxs)("div",{className:"border border-gray-200 shadow-lg rounded-xl bg-white p-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-4 mb-3 min-h-8",children:ew?(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Attachment ready to send"}):eA?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:en.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ej(e),className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 cursor-pointer",children:e},e))}):eo&&!ew?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:er.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>ej(e),className:"shrink-0 rounded-full border border-gray-200 px-3 py-1 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100 cursor-pointer",children:e},e))}):eN?(0,t.jsxs)("span",{className:"flex items-center gap-2 text-sm text-gray-500",children:[(0,t.jsx)("span",{className:"h-2 w-2 rounded-full bg-blue-500 animate-pulse","aria-hidden":!0}),U.loadingMessage]}):(0,t.jsx)("span",{className:"text-sm text-gray-500",children:U.inputPlaceholder})}),z&&(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200",children:[(0,t.jsx)("div",{className:"relative inline-block",children:ek?(0,t.jsx)("div",{className:"w-10 h-10 rounded-md bg-red-500 flex items-center justify-center",children:(0,t.jsx)(d.Z,{style:{fontSize:"16px",color:"white"}})}):(0,t.jsx)("img",{src:B||"",alt:"Upload preview",className:"w-10 h-10 rounded-md border border-gray-200 object-cover"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-gray-900 truncate",children:z.name}),(0,t.jsx)("div",{className:"text-xs text-gray-500",children:ek?"PDF":"Image"})]}),(0,t.jsx)("button",{className:"flex items-center justify-center w-6 h-6 text-gray-400 hover:text-gray-600 hover:bg-gray-200 rounded-full transition-colors",onClick:em,children:(0,t.jsx)(c.Z,{style:{fontSize:"12px"}})})]})}),(0,t.jsx)(et,{value:_,onChange:e=>{O(e)},onSend:()=>{ey(_)},disabled:0===n.length||n.every(e=>e.isLoading),hasAttachment:ew,uploadComponent:(0,t.jsx)(p.Z,{chatUploadedImage:z,chatImagePreviewUrl:B,onImageUpload:e=>(B&&URL.revokeObjectURL(B),K(e),D(URL.createObjectURL(e)),!1),onRemoveImage:em})})]})})})]})})}var ei=a(58643),eo=a(39760),ed=a(91624);function ec(){let{accessToken:e,userRole:s,userId:a,disabledPersonalKeyCreation:l,token:i}=(0,eo.Z)(),[o,d]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{(async()=>{if(e){let s=await (0,ed.C)(e);s&&d({PROXY_BASE_URL:s.PROXY_BASE_URL,LITELLM_UI_API_DOC_BASE_URL:s.LITELLM_UI_API_DOC_BASE_URL})}})()},[e]),(0,t.jsxs)(ei.v0,{className:"h-full w-full",children:[(0,t.jsxs)(ei.td,{className:"mb-0",children:[(0,t.jsx)(ei.OK,{children:"Chat"}),(0,t.jsx)(ei.OK,{children:"Compare"})]}),(0,t.jsxs)(ei.nP,{className:"h-full",children:[(0,t.jsx)(ei.x4,{className:"h-full",children:(0,t.jsx)(n.Z,{accessToken:e,token:i,userRole:s,userID:a,disabledPersonalKeyCreation:l,proxySettings:o})}),(0,t.jsx)(ei.x4,{className:"h-full",children:(0,t.jsx)(el,{accessToken:e,disabledPersonalKeyCreation:l})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9042-d8cd1ebe1dccc37b.js b/litellm/proxy/_experimental/out/_next/static/chunks/9042-d8cd1ebe1dccc37b.js deleted file mode 100644 index b9cbdb34fdb..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9042-d8cd1ebe1dccc37b.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9042,1623],{69993:function(t,e,r){"use strict";r.d(e,{Z:function(){return s}});var n=r(1119),i=r(2265),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"},a=r(55015),s=i.forwardRef(function(t,e){return i.createElement(a.Z,(0,n.Z)({},t,{ref:e,icon:o}))})},47323:function(t,e,r){"use strict";r.d(e,{Z:function(){return p}});var n=r(5853),i=r(2265),o=r(47187),a=r(7084),s=r(13241),u=r(1153),c=r(26898);let l={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},d={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},h={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},f=(t,e)=>{switch(t){case"simple":return{textColor:e?(0,u.bM)(e,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:e?(0,u.bM)(e,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,s.q)((0,u.bM)(e,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:e?(0,u.bM)(e,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,s.q)((0,u.bM)(e,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:e?(0,u.bM)(e,c.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:e?(0,s.q)((0,u.bM)(e,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:e?(0,u.bM)(e,c.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:e?(0,s.q)((0,u.bM)(e,c.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:e?(0,u.bM)(e,c.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:e?(0,s.q)((0,u.bM)(e,c.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},m=(0,u.fn)("Icon"),p=i.forwardRef((t,e)=>{let{icon:r,variant:c="simple",tooltip:p,size:g=a.u8.SM,color:b,className:v}=t,y=(0,n._T)(t,["icon","variant","tooltip","size","color","className"]),w=f(c,b),{tooltipProps:k,getReferenceProps:C}=(0,o.l)();return i.createElement("span",Object.assign({ref:(0,u.lq)([e,k.refs.setReference]),className:(0,s.q)(m("root"),"inline-flex shrink-0 items-center justify-center",w.bgColor,w.textColor,w.borderColor,w.ringColor,h[c].rounded,h[c].border,h[c].shadow,h[c].ring,l[g].paddingX,l[g].paddingY,v)},C,y),i.createElement(o.Z,Object.assign({text:p},k)),i.createElement(r,{className:(0,s.q)(m("icon"),"shrink-0",d[g].height,d[g].width)}))});p.displayName="Icon"},49804:function(t,e,r){"use strict";r.d(e,{Z:function(){return c}});var n=r(5853),i=r(13241),o=r(1153),a=r(2265),s=r(9496);let u=(0,o.fn)("Col"),c=a.forwardRef((t,e)=>{let{numColSpan:r=1,numColSpanSm:o,numColSpanMd:c,numColSpanLg:l,children:d,className:h}=t,f=(0,n._T)(t,["numColSpan","numColSpanSm","numColSpanMd","numColSpanLg","children","className"]),m=(t,e)=>t&&Object.keys(e).includes(String(t))?e[t]:"";return a.createElement("div",Object.assign({ref:e,className:(0,i.q)(u("root"),(()=>{let t=m(r,s.PT),e=m(o,s.SP),n=m(c,s.VS),a=m(l,s._w);return(0,i.q)(t,e,n,a)})(),h)},f),d)});c.displayName="Col"},94789:function(t,e,r){"use strict";r.d(e,{Z:function(){return c}});var n=r(5853),i=r(2265),o=r(26898),a=r(13241),s=r(1153);let u=(0,s.fn)("Callout"),c=i.forwardRef((t,e)=>{let{title:r,icon:c,color:l,className:d,children:h}=t,f=(0,n._T)(t,["title","icon","color","className","children"]);return i.createElement("div",Object.assign({ref:e,className:(0,a.q)(u("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",l?(0,a.q)((0,s.bM)(l,o.K.background).bgColor,(0,s.bM)(l,o.K.darkBorder).borderColor,(0,s.bM)(l,o.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,a.q)("bg-tremor-brand-faint border-tremor-brand-emphasis text-tremor-brand-emphasis","dark:bg-dark-tremor-brand-muted/70 dark:border-dark-tremor-brand-emphasis dark:text-dark-tremor-brand-emphasis"),d)},f),i.createElement("div",{className:(0,a.q)(u("header"),"flex items-start")},c?i.createElement(c,{className:(0,a.q)(u("icon"),"flex-none h-5 w-5 mr-1.5")}):null,i.createElement("h4",{className:(0,a.q)(u("title"),"font-semibold")},r)),i.createElement("p",{className:(0,a.q)(u("body"),"overflow-y-auto",h?"mt-2":"")},h))});c.displayName="Callout"},23910:function(t,e,r){var n=r(74288).Symbol;t.exports=n},54506:function(t,e,r){var n=r(23910),i=r(4479),o=r(80910),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},41087:function(t,e,r){var n=r(5035),i=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(i,""):t}},17071:function(t,e,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;t.exports=n},4479:function(t,e,r){var n=r(23910),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),r=t[s];try{t[s]=void 0;var n=!0}catch(t){}var i=a.call(t);return n&&(e?t[s]=r:delete t[s]),i}},80910:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},74288:function(t,e,r){var n=r(17071),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},5035:function(t){var e=/\s/;t.exports=function(t){for(var r=t.length;r--&&e.test(t.charAt(r)););return r}},7310:function(t,e,r){var n=r(28302),i=r(11121),o=r(6660),a=Math.max,s=Math.min;t.exports=function(t,e,r){var u,c,l,d,h,f,m=0,p=!1,g=!1,b=!0;if("function"!=typeof t)throw TypeError("Expected a function");function v(e){var r=u,n=c;return u=c=void 0,m=e,d=t.apply(n,r)}function y(t){var r=t-f,n=t-m;return void 0===f||r>=e||r<0||g&&n>=l}function w(){var t,r,n,o=i();if(y(o))return k(o);h=setTimeout(w,(t=o-f,r=o-m,n=e-t,g?s(n,l-r):n))}function k(t){return(h=void 0,b&&u)?v(t):(u=c=void 0,d)}function C(){var t,r=i(),n=y(r);if(u=arguments,c=this,f=r,n){if(void 0===h)return m=t=f,h=setTimeout(w,e),p?v(t):d;if(g)return clearTimeout(h),h=setTimeout(w,e),v(f)}return void 0===h&&(h=setTimeout(w,e)),d}return e=o(e)||0,n(r)&&(p=!!r.leading,l=(g="maxWait"in r)?a(o(r.maxWait)||0,e):l,b="trailing"in r?!!r.trailing:b),C.cancel=function(){void 0!==h&&clearTimeout(h),m=0,u=f=c=h=void 0},C.flush=function(){return void 0===h?d:k(i())},C}},28302:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},10303:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},78371:function(t,e,r){var n=r(54506),i=r(10303);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==n(t)}},11121:function(t,e,r){var n=r(74288);t.exports=function(){return n.Date.now()}},6660:function(t,e,r){var n=r(41087),i=r(28302),o=r(78371),a=0/0,s=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return a;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var r=u.test(t);return r||c.test(t)?l(t.slice(2),r?2:8):s.test(t)?a:+t}},32489:function(t,e,r){"use strict";r.d(e,{Z:function(){return n}});let n=(0,r(79205).Z)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},10900:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.Z=i},91777:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"}))});e.Z=i},47686:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))});e.Z=i},44633:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});e.Z=i},58710:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.Z=i},82182:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))});e.Z=i},79814:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"}))});e.Z=i},2356:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"}))});e.Z=i},93416:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))});e.Z=i},77355:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"}))});e.Z=i},22452:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))});e.Z=i},25327:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))});e.Z=i},49084:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});e.Z=i},3497:function(t,e,r){"use strict";var n=r(2265);let i=n.forwardRef(function(t,e){return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:e},t),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}))});e.Z=i},2894:function(t,e,r){"use strict";r.d(e,{R:function(){return s},m:function(){return a}});var n=r(18238),i=r(7989),o=r(11255),a=class extends i.F{#t;#e;#r;#n;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#r=t.mutationCache,this.#e=[],this.state=t.state||s(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#r.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#r.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#i({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,o.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#i({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#r.canRun(this)});let n="pending"===this.state.status,i=!this.#n.canStart();try{if(n)e();else{this.#i({type:"pending",variables:t,isPaused:i}),await this.#r.config.onMutate?.(t,this,r);let e=await this.options.onMutate?.(t,r);e!==this.state.context&&this.#i({type:"pending",context:e,variables:t,isPaused:i})}let o=await this.#n.start();return await this.#r.config.onSuccess?.(o,t,this.state.context,this,r),await this.options.onSuccess?.(o,t,this.state.context,r),await this.#r.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,t,this.state.context,r),this.#i({type:"success",data:o}),o}catch(e){try{throw await this.#r.config.onError?.(e,t,this.state.context,this,r),await this.options.onError?.(e,t,this.state.context,r),await this.#r.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,e,t,this.state.context,r),e}finally{this.#i({type:"error",error:e})}}finally{this.#r.runNext(this)}}#i(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),n.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#r.notify({mutation:this,type:"updated",action:t})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21623:function(t,e,r){"use strict";r.d(e,{S:function(){return p}});var n=r(45345),i=r(21733),o=r(18238),a=r(24112),s=class extends a.l{constructor(t={}){super(),this.config=t,this.#o=new Map}#o;build(t,e,r){let o=e.queryKey,a=e.queryHash??(0,n.Rm)(o,e),s=this.get(a);return s||(s=new i.A({client:t,queryKey:o,queryHash:a,options:t.defaultQueryOptions(e),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){this.#o.has(t.queryHash)||(this.#o.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#o.get(t.queryHash);e&&(t.destroy(),e===t&&this.#o.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){o.Vr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#o.get(t)}getAll(){return[...this.#o.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,n._x)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,n._x)(t,e)):e}notify(t){o.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){o.Vr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){o.Vr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},u=r(2894),c=class extends a.l{constructor(t={}){super(),this.config=t,this.#a=new Set,this.#s=new Map,this.#u=0}#a;#s;#u;build(t,e,r){let n=new u.m({client:t,mutationCache:this,mutationId:++this.#u,options:t.defaultMutationOptions(e),state:r});return this.add(n),n}add(t){this.#a.add(t);let e=l(t);if("string"==typeof e){let r=this.#s.get(e);r?r.push(t):this.#s.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#a.delete(t)){let e=l(t);if("string"==typeof e){let r=this.#s.get(e);if(r){if(r.length>1){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}else r[0]===t&&this.#s.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=l(t);if("string"!=typeof e)return!0;{let r=this.#s.get(e),n=r?.find(t=>"pending"===t.state.status);return!n||n===t}}runNext(t){let e=l(t);if("string"!=typeof e)return Promise.resolve();{let r=this.#s.get(e)?.find(e=>e!==t&&e.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){o.Vr.batch(()=>{this.#a.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#a.clear(),this.#s.clear()})}getAll(){return Array.from(this.#a)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,n.X7)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,n.X7)(t,e))}notify(t){o.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return o.Vr.batch(()=>Promise.all(t.map(t=>t.continue().catch(n.ZT))))}};function l(t){return t.options.scope?.id}var d=r(87045),h=r(57853);function f(t){return{onFetch:(e,r)=>{let i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],s=e.state.data?.pageParams||[],u={pages:[],pageParams:[]},c=0,l=async()=>{let r=!1,l=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?r=!0:e.signal.addEventListener("abort",()=>{r=!0}),e.signal)})},d=(0,n.cG)(e.options,e.fetchOptions),h=async(t,i,o)=>{if(r)return Promise.reject();if(null==i&&t.pages.length)return Promise.resolve(t);let a=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:i,direction:o?"backward":"forward",meta:e.options.meta};return l(t),t})(),s=await d(a),{maxPages:u}=e.options,c=o?n.Ht:n.VX;return{pages:c(t.pages,s,u),pageParams:c(t.pageParams,i,u)}};if(o&&a.length){let t="backward"===o,e={pages:a,pageParams:s},r=(t?function(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}:m)(i,e);u=await h(e,r,t)}else{let e=t??a.length;do{let t=0===c?s[0]??i.initialPageParam:m(i,u);if(c>0&&null==t)break;u=await h(u,t),c++}while(ce.options.persister?.(l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=l}}}function m(t,{pages:e,pageParams:r}){let n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}var p=class{#c;#r;#l;#d;#h;#f;#m;#p;constructor(t={}){this.#c=t.queryCache||new s,this.#r=t.mutationCache||new c,this.#l=t.defaultOptions||{},this.#d=new Map,this.#h=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#m=d.j.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#c.onFocus())}),this.#p=h.N.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#c.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#m?.(),this.#m=void 0,this.#p?.(),this.#p=void 0)}isFetching(t){return this.#c.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#r.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#c.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=this.#c.build(this,e),i=r.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime((0,n.KC)(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#c.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,r){let i=this.defaultQueryOptions({queryKey:t}),o=this.#c.get(i.queryHash),a=o?.state.data,s=(0,n.SE)(e,a);if(void 0!==s)return this.#c.build(this,i).setData(s,{...r,manual:!0})}setQueriesData(t,e,r){return o.Vr.batch(()=>this.#c.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,r)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#c.get(e.queryHash)?.state}removeQueries(t){let e=this.#c;o.Vr.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let r=this.#c;return o.Vr.batch(()=>(r.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let r={revert:!0,...e};return Promise.all(o.Vr.batch(()=>this.#c.findAll(t).map(t=>t.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(t,e={}){return o.Vr.batch(()=>(this.#c.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let r={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(o.Vr.batch(()=>this.#c.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,r);return r.throwOnError||(e=e.catch(n.ZT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(n.ZT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let r=this.#c.build(this,e);return r.isStaleByTime((0,n.KC)(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(t){return t.behavior=f(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(t){return t.behavior=f(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return h.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#c}getMutationCache(){return this.#r}getDefaultOptions(){return this.#l}setDefaultOptions(t){this.#l=t}setQueryDefaults(t,e){this.#d.set((0,n.Ym)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#d.values()],r={};return e.forEach(e=>{(0,n.to)(t,e.queryKey)&&Object.assign(r,e.defaultOptions)}),r}setMutationDefaults(t,e){this.#h.set((0,n.Ym)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#h.values()],r={};return e.forEach(e=>{(0,n.to)(t,e.mutationKey)&&Object.assign(r,e.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#l.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,n.Rm)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===n.CN&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#l.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#c.clear(),this.#r.clear()}}},92668:function(t,e,r){"use strict";r.d(e,{I:function(){return s}});var n=r(59121),i=r(31091),o=r(63497),a=r(99649);function s(t,e){let{years:r=0,months:s=0,weeks:u=0,days:c=0,hours:l=0,minutes:d=0,seconds:h=0}=e,f=(0,a.Q)(t),m=s||r?(0,i.z)(f,s+12*r):f,p=c||u?(0,n.E)(m,c+7*u):m;return(0,o.L)(t,p.getTime()+1e3*(h+60*(d+60*l)))}},59121:function(t,e,r){"use strict";r.d(e,{E:function(){return o}});var n=r(99649),i=r(63497);function o(t,e){let r=(0,n.Q)(t);return isNaN(e)?(0,i.L)(t,NaN):(e&&r.setDate(r.getDate()+e),r)}},31091:function(t,e,r){"use strict";r.d(e,{z:function(){return o}});var n=r(99649),i=r(63497);function o(t,e){let r=(0,n.Q)(t);if(isNaN(e))return(0,i.L)(t,NaN);if(!e)return r;let o=r.getDate(),a=(0,i.L)(t,r.getTime());return(a.setMonth(r.getMonth()+e+1,0),o>=a.getDate())?a:(r.setFullYear(a.getFullYear(),a.getMonth(),o),r)}},63497:function(t,e,r){"use strict";function n(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}r.d(e,{L:function(){return n}})},99649:function(t,e,r){"use strict";function n(t){let e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):new Date("number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?t:NaN)}r.d(e,{Q:function(){return n}})}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9051-95743f0e60203e26.js b/litellm/proxy/_experimental/out/_next/static/chunks/9051-95743f0e60203e26.js deleted file mode 100644 index 04ebd3f7df4..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9051-95743f0e60203e26.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9051],{41649:function(e,r,t){t.d(r,{Z:function(){return p}});var o=t(5853),n=t(2265),a=t(47187),d=t(7084),l=t(26898),i=t(13241),s=t(1153);let c={xs:{paddingX:"px-2",paddingY:"py-0.5",fontSize:"text-xs"},sm:{paddingX:"px-2.5",paddingY:"py-0.5",fontSize:"text-sm"},md:{paddingX:"px-3",paddingY:"py-0.5",fontSize:"text-md"},lg:{paddingX:"px-3.5",paddingY:"py-0.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-1",fontSize:"text-xl"}},u={xs:{height:"h-4",width:"w-4"},sm:{height:"h-4",width:"w-4"},md:{height:"h-4",width:"w-4"},lg:{height:"h-5",width:"w-5"},xl:{height:"h-6",width:"w-6"}},m=(0,s.fn)("Badge"),p=n.forwardRef((e,r)=>{let{color:t,icon:p,size:b=d.u8.SM,tooltip:g,className:h,children:f}=e,x=(0,o._T)(e,["color","icon","size","tooltip","className","children"]),k=p||null,{tooltipProps:v,getReferenceProps:w}=(0,a.l)();return n.createElement("span",Object.assign({ref:(0,s.lq)([r,v.refs.setReference]),className:(0,i.q)(m("root"),"w-max shrink-0 inline-flex justify-center items-center cursor-default rounded-tremor-small ring-1 ring-inset",t?(0,i.q)((0,s.bM)(t,l.K.background).bgColor,(0,s.bM)(t,l.K.iconText).textColor,(0,s.bM)(t,l.K.iconRing).ringColor,"bg-opacity-10 ring-opacity-20","dark:bg-opacity-5 dark:ring-opacity-60"):(0,i.q)("bg-tremor-brand-faint text-tremor-brand-emphasis ring-tremor-brand/20","dark:bg-dark-tremor-brand-muted/50 dark:text-dark-tremor-brand dark:ring-dark-tremor-subtle/20"),c[b].paddingX,c[b].paddingY,c[b].fontSize,h)},w,x),n.createElement(a.Z,Object.assign({text:g},v)),k?n.createElement(k,{className:(0,i.q)(m("icon"),"shrink-0 -ml-1 mr-1.5",u[b].height,u[b].width)}):null,n.createElement("span",{className:(0,i.q)(m("text"),"whitespace-nowrap")},f))});p.displayName="Badge"},47323:function(e,r,t){t.d(r,{Z:function(){return g}});var o=t(5853),n=t(2265),a=t(47187),d=t(7084),l=t(13241),i=t(1153),s=t(26898);let c={xs:{paddingX:"px-1.5",paddingY:"py-1.5"},sm:{paddingX:"px-1.5",paddingY:"py-1.5"},md:{paddingX:"px-2",paddingY:"py-2"},lg:{paddingX:"px-2",paddingY:"py-2"},xl:{paddingX:"px-2.5",paddingY:"py-2.5"}},u={xs:{height:"h-3",width:"w-3"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-7",width:"w-7"},xl:{height:"h-9",width:"w-9"}},m={simple:{rounded:"",border:"",ring:"",shadow:""},light:{rounded:"rounded-tremor-default",border:"",ring:"",shadow:""},shadow:{rounded:"rounded-tremor-default",border:"border",ring:"",shadow:"shadow-tremor-card dark:shadow-dark-tremor-card"},solid:{rounded:"rounded-tremor-default",border:"border-2",ring:"ring-1",shadow:""},outlined:{rounded:"rounded-tremor-default",border:"border",ring:"ring-2",shadow:""}},p=(e,r)=>{switch(e){case"simple":return{textColor:r?(0,i.bM)(r,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:r?(0,i.bM)(r,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,i.bM)(r,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:r?(0,i.bM)(r,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,i.bM)(r,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:"border-tremor-border dark:border-dark-tremor-border",ringColor:""};case"solid":return{textColor:r?(0,i.bM)(r,s.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:r?(0,l.q)((0,i.bM)(r,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand dark:bg-dark-tremor-brand",borderColor:"border-tremor-brand-inverted dark:border-dark-tremor-brand-inverted",ringColor:"ring-tremor-ring dark:ring-dark-tremor-ring"};case"outlined":return{textColor:r?(0,i.bM)(r,s.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:r?(0,l.q)((0,i.bM)(r,s.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:r?(0,i.bM)(r,s.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:r?(0,l.q)((0,i.bM)(r,s.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},b=(0,i.fn)("Icon"),g=n.forwardRef((e,r)=>{let{icon:t,variant:s="simple",tooltip:g,size:h=d.u8.SM,color:f,className:x}=e,k=(0,o._T)(e,["icon","variant","tooltip","size","color","className"]),v=p(s,f),{tooltipProps:w,getReferenceProps:C}=(0,a.l)();return n.createElement("span",Object.assign({ref:(0,i.lq)([r,w.refs.setReference]),className:(0,l.q)(b("root"),"inline-flex shrink-0 items-center justify-center",v.bgColor,v.textColor,v.borderColor,v.ringColor,m[s].rounded,m[s].border,m[s].shadow,m[s].ring,c[h].paddingX,c[h].paddingY,x)},C,k),n.createElement(a.Z,Object.assign({text:g},w)),n.createElement(t,{className:(0,l.q)(b("icon"),"shrink-0",u[h].height,u[h].width)}))});g.displayName="Icon"},78489:function(e,r,t){t.d(r,{Z:function(){return E}});var o=t(5853),n=t(47187),a=t(2265);let d=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],l=e=>({_s:e,status:d[e],isEnter:e<3,isMounted:6!==e,isResolved:2===e||e>4}),i=e=>e?6:5,s=(e,r)=>{switch(e){case 1:case 0:return 2;case 4:case 3:return i(r)}},c=e=>"object"==typeof e?[e.enter,e.exit]:[e,e],u=(e,r)=>setTimeout(()=>{isNaN(document.body.offsetTop)||e(r+1)},0),m=(e,r,t,o,n)=>{clearTimeout(o.current);let a=l(e);r(a),t.current=a,n&&n({current:a})},p=({enter:e=!0,exit:r=!0,preEnter:t,preExit:o,timeout:n,initialEntered:d,mountOnEnter:p,unmountOnExit:b,onStateChange:g}={})=>{let[h,f]=(0,a.useState)(()=>l(d?2:i(p))),x=(0,a.useRef)(h),k=(0,a.useRef)(),[v,w]=c(n),C=(0,a.useCallback)(()=>{let e=s(x.current._s,b);e&&m(e,f,x,k,g)},[g,b]);return[h,(0,a.useCallback)(n=>{let a=e=>{switch(m(e,f,x,k,g),e){case 1:v>=0&&(k.current=setTimeout(C,v));break;case 4:w>=0&&(k.current=setTimeout(C,w));break;case 0:case 3:k.current=u(a,e)}},d=x.current.isEnter;"boolean"!=typeof n&&(n=!d),n?d||a(e?t?0:1:2):d&&a(r?o?3:4:i(b))},[C,g,e,r,t,o,v,w,b]),C]};var b=t(7084),g=t(13241),h=t(1153);let f=e=>{var r=(0,o._T)(e,[]);return a.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"}),a.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),a.createElement("path",{d:"M18.364 5.636L16.95 7.05A7 7 0 1 0 19 12h2a9 9 0 1 1-2.636-6.364z"}))};var x=t(26898);let k={xs:{height:"h-4",width:"w-4"},sm:{height:"h-5",width:"w-5"},md:{height:"h-5",width:"w-5"},lg:{height:"h-6",width:"w-6"},xl:{height:"h-6",width:"w-6"}},v=e=>"light"!==e?{xs:{paddingX:"px-2.5",paddingY:"py-1.5",fontSize:"text-xs"},sm:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-sm"},md:{paddingX:"px-4",paddingY:"py-2",fontSize:"text-md"},lg:{paddingX:"px-4",paddingY:"py-2.5",fontSize:"text-lg"},xl:{paddingX:"px-4",paddingY:"py-3",fontSize:"text-xl"}}:{xs:{paddingX:"",paddingY:"",fontSize:"text-xs"},sm:{paddingX:"",paddingY:"",fontSize:"text-sm"},md:{paddingX:"",paddingY:"",fontSize:"text-md"},lg:{paddingX:"",paddingY:"",fontSize:"text-lg"},xl:{paddingX:"",paddingY:"",fontSize:"text-xl"}},w=(e,r)=>{switch(e){case"primary":return{textColor:r?(0,h.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",hoverTextColor:r?(0,h.bM)("white").textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:r?(0,h.bM)(r,x.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",hoverBgColor:r?(0,h.bM)(r,x.K.darkBackground).hoverBgColor:"hover:bg-tremor-brand-emphasis dark:hover:bg-dark-tremor-brand-emphasis",borderColor:r?(0,h.bM)(r,x.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",hoverBorderColor:r?(0,h.bM)(r,x.K.darkBorder).hoverBorderColor:"hover:border-tremor-brand-emphasis dark:hover:border-dark-tremor-brand-emphasis"};case"secondary":return{textColor:r?(0,h.bM)(r,x.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:r?(0,h.bM)(r,x.K.text).textColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,h.bM)("transparent").bgColor,hoverBgColor:r?(0,g.q)((0,h.bM)(r,x.K.background).hoverBgColor,"hover:bg-opacity-20 dark:hover:bg-opacity-20"):"hover:bg-tremor-brand-faint dark:hover:bg-dark-tremor-brand-faint",borderColor:r?(0,h.bM)(r,x.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand"};case"light":return{textColor:r?(0,h.bM)(r,x.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",hoverTextColor:r?(0,h.bM)(r,x.K.darkText).hoverTextColor:"hover:text-tremor-brand-emphasis dark:hover:text-dark-tremor-brand-emphasis",bgColor:(0,h.bM)("transparent").bgColor,borderColor:"",hoverBorderColor:""}}},C=(0,h.fn)("Button"),y=e=>{let{loading:r,iconSize:t,iconPosition:o,Icon:n,needMargin:d,transitionStatus:l}=e,i=d?o===b.zS.Left?(0,g.q)("-ml-1","mr-1.5"):(0,g.q)("-mr-1","ml-1.5"):"",s=(0,g.q)("w-0 h-0"),c={default:s,entering:s,entered:t,exiting:t,exited:s};return r?a.createElement(f,{className:(0,g.q)(C("icon"),"animate-spin shrink-0",i,c.default,c[l]),style:{transition:"width 150ms"}}):a.createElement(n,{className:(0,g.q)(C("icon"),"shrink-0",t,i)})},E=a.forwardRef((e,r)=>{let{icon:t,iconPosition:d=b.zS.Left,size:l=b.u8.SM,color:i,variant:s="primary",disabled:c,loading:u=!1,loadingText:m,children:f,tooltip:x,className:E}=e,S=(0,o._T)(e,["icon","iconPosition","size","color","variant","disabled","loading","loadingText","children","tooltip","className"]),M=u||c,N=void 0!==t||u,T=u&&m,I=!(!f&&!T),z=(0,g.q)(k[l].height,k[l].width),q="light"!==s?(0,g.q)("rounded-tremor-default border","shadow-tremor-input","dark:shadow-dark-tremor-input"):"",P=w(s,i),B=v(s)[l],{tooltipProps:R,getReferenceProps:K}=(0,n.l)(300),[D,O]=p({timeout:50});return(0,a.useEffect)(()=>{O(u)},[u]),a.createElement("button",Object.assign({ref:(0,h.lq)([r,R.refs.setReference]),className:(0,g.q)(C("root"),"shrink-0 inline-flex justify-center items-center group font-medium outline-none",q,B.paddingX,B.paddingY,B.fontSize,P.textColor,P.bgColor,P.borderColor,P.hoverBorderColor,M?"opacity-50 cursor-not-allowed":(0,g.q)(w(s,i).hoverTextColor,w(s,i).hoverBgColor,w(s,i).hoverBorderColor),E),disabled:M},K,S),a.createElement(n.Z,Object.assign({text:x},R)),N&&d!==b.zS.Right?a.createElement(y,{loading:u,iconSize:z,iconPosition:d,Icon:t,transitionStatus:D.status,needMargin:I}):null,T||f?a.createElement("span",{className:(0,g.q)(C("text"),"text-tremor-default whitespace-nowrap")},T?m:f):null,N&&d===b.zS.Right?a.createElement(y,{loading:u,iconSize:z,iconPosition:d,Icon:t,transitionStatus:D.status,needMargin:I}):null)});E.displayName="Button"},30150:function(e,r,t){t.d(r,{Z:function(){return m}});var o=t(5853),n=t(2265);let a=e=>{var r=(0,o._T)(e,[]);return n.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),n.createElement("path",{d:"M12 4v16m8-8H4"}))},d=e=>{var r=(0,o._T)(e,[]);return n.createElement("svg",Object.assign({},r,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),n.createElement("path",{d:"M20 12H4"}))};var l=t(13241),i=t(1153),s=t(69262);let c="flex mx-auto text-tremor-content-subtle dark:text-dark-tremor-content-subtle",u="cursor-pointer hover:text-tremor-content dark:hover:text-dark-tremor-content",m=n.forwardRef((e,r)=>{let{onSubmit:t,enableStepper:m=!0,disabled:p,onValueChange:b,onChange:g}=e,h=(0,o._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),f=(0,n.useRef)(null),[x,k]=n.useState(!1),v=n.useCallback(()=>{k(!0)},[]),w=n.useCallback(()=>{k(!1)},[]),[C,y]=n.useState(!1),E=n.useCallback(()=>{y(!0)},[]),S=n.useCallback(()=>{y(!1)},[]);return n.createElement(s.Z,Object.assign({type:"number",ref:(0,i.lq)([f,r]),disabled:p,makeInputClassName:(0,i.fn)("NumberInput"),onKeyDown:e=>{var r;if("Enter"===e.key&&!e.ctrlKey&&!e.altKey&&!e.shiftKey){let e=null===(r=f.current)||void 0===r?void 0:r.value;null==t||t(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&v(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&w(),"ArrowUp"===e.key&&S()},onChange:e=>{p||(null==b||b(parseFloat(e.target.value)),null==g||g(e))},stepper:m?n.createElement("div",{className:(0,l.q)("flex justify-center align-middle")},n.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,r;p||(null===(e=f.current)||void 0===e||e.stepDown(),null===(r=f.current)||void 0===r||r.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&u,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},n.createElement(d,{"data-testid":"step-down",className:(x?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),n.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,r;p||(null===(e=f.current)||void 0===e||e.stepUp(),null===(r=f.current)||void 0===r||r.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,l.q)(!p&&u,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},n.createElement(a,{"data-testid":"step-up",className:(C?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},h))});m.displayName="NumberInput"},87452:function(e,r,t){t.d(r,{Z:function(){return u},r:function(){return c}});var o=t(5853),n=t(91054);t(42698),t(64016);var a=t(8710);t(33232);var d=t(13241),l=t(1153),i=t(2265);let s=(0,l.fn)("Accordion"),c=(0,i.createContext)({isOpen:!1}),u=i.forwardRef((e,r)=>{var t;let{defaultOpen:l=!1,children:u,className:m}=e,p=(0,o._T)(e,["defaultOpen","children","className"]),b=null!==(t=(0,i.useContext)(a.Z))&&void 0!==t?t:(0,d.q)("rounded-tremor-default border");return i.createElement(n.pJ,Object.assign({as:"div",ref:r,className:(0,d.q)(s("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",b,m),defaultOpen:l},p),e=>{let{open:r}=e;return i.createElement(c.Provider,{value:{isOpen:r}},u)})});u.displayName="Accordion"},88829:function(e,r,t){t.d(r,{Z:function(){return i}});var o=t(5853),n=t(2265),a=t(91054),d=t(13241);let l=(0,t(1153).fn)("AccordionBody"),i=n.forwardRef((e,r)=>{let{children:t,className:i}=e,s=(0,o._T)(e,["children","className"]);return n.createElement(a.pJ.Panel,Object.assign({ref:r,className:(0,d.q)(l("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",i)},s),t)});i.displayName="AccordionBody"},72208:function(e,r,t){t.d(r,{Z:function(){return c}});var o=t(5853),n=t(2265),a=t(91054);let d=e=>{var r=(0,o._T)(e,[]);return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},r),n.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"}))};var l=t(87452),i=t(13241);let s=(0,t(1153).fn)("AccordionHeader"),c=n.forwardRef((e,r)=>{let{children:t,className:c}=e,u=(0,o._T)(e,["children","className"]),{isOpen:m}=(0,n.useContext)(l.r);return n.createElement(a.pJ.Button,Object.assign({ref:r,className:(0,i.q)(s("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",c)},u),n.createElement("div",{className:(0,i.q)(s("children"),"flex flex-1 text-inherit mr-4")},t),n.createElement("div",null,n.createElement(d,{className:(0,i.q)(s("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",m?"transition-all":"transition-all -rotate-180")})))});c.displayName="AccordionHeader"},12514:function(e,r,t){t.d(r,{Z:function(){return u}});var o=t(5853),n=t(2265),a=t(7084),d=t(26898),l=t(13241),i=t(1153);let s=(0,i.fn)("Card"),c=e=>{if(!e)return"";switch(e){case a.zS.Left:return"border-l-4";case a.m.Top:return"border-t-4";case a.zS.Right:return"border-r-4";case a.m.Bottom:return"border-b-4";default:return""}},u=n.forwardRef((e,r)=>{let{decoration:t="",decorationColor:a,children:u,className:m}=e,p=(0,o._T)(e,["decoration","decorationColor","children","className"]);return n.createElement("div",Object.assign({ref:r,className:(0,l.q)(s("root"),"relative w-full text-left ring-1 rounded-tremor-default p-6","bg-tremor-background ring-tremor-ring shadow-tremor-card","dark:bg-dark-tremor-background dark:ring-dark-tremor-ring dark:shadow-dark-tremor-card",a?(0,i.bM)(a,d.K.border).borderColor:"border-tremor-brand dark:border-dark-tremor-brand",c(t),m)},p),u)});u.displayName="Card"},84264:function(e,r,t){t.d(r,{Z:function(){return l}});var o=t(26898),n=t(13241),a=t(1153),d=t(2265);let l=d.forwardRef((e,r)=>{let{color:t,className:l,children:i}=e;return d.createElement("p",{ref:r,className:(0,n.q)("text-tremor-default",t?(0,a.bM)(t,o.K.text).textColor:(0,n.q)("text-tremor-content","dark:text-dark-tremor-content"),l)},i)});l.displayName="Text"},44643:function(e,r,t){var o=t(2265);let n=o.forwardRef(function(e,r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});r.Z=n},51853:function(e,r,t){var o=t(2265);let n=o.forwardRef(function(e,r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"}))});r.Z=n},23628:function(e,r,t){var o=t(2265);let n=o.forwardRef(function(e,r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"}))});r.Z=n},71157:function(e,r,t){var o=t(2265);let n=o.forwardRef(function(e,r){return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:r},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))});r.Z=n},91054:function(e,r,t){let o,n;t.d(r,{pJ:function(){return P}});var a,d=t(71049),l=t(11323),i=t(2265),s=t(66797),c=t(93980),u=t(65573),m=t(67561),p=t(98218),b=t(33443),g=t(28294),h=t(31370),f=t(72468),x=t(5664),k=t(38929);let v=null!=(a=i.startTransition)?a:function(e){e()};var w=t(52724),C=((o=C||{})[o.Open=0]="Open",o[o.Closed=1]="Closed",o),y=((n=y||{})[n.ToggleDisclosure=0]="ToggleDisclosure",n[n.CloseDisclosure=1]="CloseDisclosure",n[n.SetButtonId=2]="SetButtonId",n[n.SetPanelId=3]="SetPanelId",n[n.SetButtonElement=4]="SetButtonElement",n[n.SetPanelElement=5]="SetPanelElement",n);let E={0:e=>({...e,disclosureState:(0,f.E)(e.disclosureState,{0:1,1:0})}),1:e=>1===e.disclosureState?e:{...e,disclosureState:1},2:(e,r)=>e.buttonId===r.buttonId?e:{...e,buttonId:r.buttonId},3:(e,r)=>e.panelId===r.panelId?e:{...e,panelId:r.panelId},4:(e,r)=>e.buttonElement===r.element?e:{...e,buttonElement:r.element},5:(e,r)=>e.panelElement===r.element?e:{...e,panelElement:r.element}},S=(0,i.createContext)(null);function M(e){let r=(0,i.useContext)(S);if(null===r){let r=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(r,M),r}return r}S.displayName="DisclosureContext";let N=(0,i.createContext)(null);N.displayName="DisclosureAPIContext";let T=(0,i.createContext)(null);function I(e,r){return(0,f.E)(r.type,E,e,r)}T.displayName="DisclosurePanelContext";let z=i.Fragment,q=k.VN.RenderStrategy|k.VN.Static,P=Object.assign((0,k.yV)(function(e,r){let{defaultOpen:t=!1,...o}=e,n=(0,i.useRef)(null),a=(0,m.T)(r,(0,m.h)(e=>{n.current=e},void 0===e.as||e.as===i.Fragment)),d=(0,i.useReducer)(I,{disclosureState:t?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:l,buttonId:s},u]=d,p=(0,c.z)(e=>{u({type:1});let r=(0,x.r)(n);if(!r||!s)return;let t=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:r.getElementById(s):r.getElementById(s);null==t||t.focus()}),h=(0,i.useMemo)(()=>({close:p}),[p]),v=(0,i.useMemo)(()=>({open:0===l,close:p}),[l,p]),w=(0,k.L6)();return i.createElement(S.Provider,{value:d},i.createElement(N.Provider,{value:h},i.createElement(b.Z,{value:p},i.createElement(g.up,{value:(0,f.E)(l,{0:g.ZM.Open,1:g.ZM.Closed})},w({ourProps:{ref:a},theirProps:o,slot:v,defaultTag:z,name:"Disclosure"})))))}),{Button:(0,k.yV)(function(e,r){let t=(0,i.useId)(),{id:o="headlessui-disclosure-button-".concat(t),disabled:n=!1,autoFocus:a=!1,...p}=e,[b,g]=M("Disclosure.Button"),f=(0,i.useContext)(T),x=null!==f&&f===b.panelId,v=(0,i.useRef)(null),C=(0,m.T)(v,r,(0,c.z)(e=>{if(!x)return g({type:4,element:e})}));(0,i.useEffect)(()=>{if(!x)return g({type:2,buttonId:o}),()=>{g({type:2,buttonId:null})}},[o,g,x]);let y=(0,c.z)(e=>{var r;if(x){if(1===b.disclosureState)return;switch(e.key){case w.R.Space:case w.R.Enter:e.preventDefault(),e.stopPropagation(),g({type:0}),null==(r=b.buttonElement)||r.focus()}}else switch(e.key){case w.R.Space:case w.R.Enter:e.preventDefault(),e.stopPropagation(),g({type:0})}}),E=(0,c.z)(e=>{e.key===w.R.Space&&e.preventDefault()}),S=(0,c.z)(e=>{var r;(0,h.P)(e.currentTarget)||n||(x?(g({type:0}),null==(r=b.buttonElement)||r.focus()):g({type:0}))}),{isFocusVisible:N,focusProps:I}=(0,d.F)({autoFocus:a}),{isHovered:z,hoverProps:q}=(0,l.X)({isDisabled:n}),{pressed:P,pressProps:B}=(0,s.x)({disabled:n}),R=(0,i.useMemo)(()=>({open:0===b.disclosureState,hover:z,active:P,disabled:n,focus:N,autofocus:a}),[b,z,P,N,n,a]),K=(0,u.f)(e,b.buttonElement),D=x?(0,k.dG)({ref:C,type:K,disabled:n||void 0,autoFocus:a,onKeyDown:y,onClick:S},I,q,B):(0,k.dG)({ref:C,id:o,type:K,"aria-expanded":0===b.disclosureState,"aria-controls":b.panelElement?b.panelId:void 0,disabled:n||void 0,autoFocus:a,onKeyDown:y,onKeyUp:E,onClick:S},I,q,B);return(0,k.L6)()({ourProps:D,theirProps:p,slot:R,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,k.yV)(function(e,r){let t=(0,i.useId)(),{id:o="headlessui-disclosure-panel-".concat(t),transition:n=!1,...a}=e,[d,l]=M("Disclosure.Panel"),{close:s}=function e(r){let t=(0,i.useContext)(N);if(null===t){let t=Error("<".concat(r," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}("Disclosure.Panel"),[u,b]=(0,i.useState)(null),h=(0,m.T)(r,(0,c.z)(e=>{v(()=>l({type:5,element:e}))}),b);(0,i.useEffect)(()=>(l({type:3,panelId:o}),()=>{l({type:3,panelId:null})}),[o,l]);let f=(0,g.oJ)(),[x,w]=(0,p.Y)(n,u,null!==f?(f&g.ZM.Open)===g.ZM.Open:0===d.disclosureState),C=(0,i.useMemo)(()=>({open:0===d.disclosureState,close:s}),[d.disclosureState,s]),y={ref:h,id:o,...(0,p.X)(w)},E=(0,k.L6)();return i.createElement(g.uu,null,i.createElement(T.Provider,{value:d.panelId},E({ourProps:y,theirProps:a,slot:C,defaultTag:"div",features:q,visible:x,name:"Disclosure.Panel"})))})})},33443:function(e,r,t){t.d(r,{Z:function(){return a}});var o=t(2265);let n=(0,o.createContext)(()=>{});function a(e){let{value:r,children:t}=e;return o.createElement(n.Provider,{value:r},t)}},87602:function(e,r,t){function o(){for(var e,r,t=0,o="",n=arguments.length;t{let t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t}))}catch(e){return atob(r)}}(a)}catch(e){throw new o(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(t)}catch(e){throw new o(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}o.prototype.name="InvalidTokenError"}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9140-28cd72e0efbaaf59.js b/litellm/proxy/_experimental/out/_next/static/chunks/9140-28cd72e0efbaaf59.js deleted file mode 100644 index 3486cb8518e..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9140-28cd72e0efbaaf59.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9140],{45822:function(e,t,r){r.d(t,{JO:function(){return o.Z},JX:function(){return l.Z},rj:function(){return a.Z},xv:function(){return n.Z},zx:function(){return s.Z}});var s=r(78489),l=r(49804),a=r(67101),o=r(47323),n=r(84264)},9140:function(e,t,r){r.d(t,{Z:function(){return et}});var s,l,a=r(57437),o=r(2265),n=r(45822),i=r(23628),c=r(19250),d=r(44633),x=r(86462),m=r(49084),h=r(71594),u=r(24525),p=r(19130),v=r(99981),j=r(39957),g=r(42673),f=e=>{let{data:t,onView:r,onEdit:s,onDelete:l}=e,[n,i]=o.useState([{id:"created_at",desc:!0}]),c=[{header:"Vector Store ID",accessorKey:"vector_store_id",cell:e=>{let{row:t}=e,s=t.original;return(0,a.jsx)("button",{onClick:()=>r(s.vector_store_id),className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5 text-left w-full truncate whitespace-nowrap cursor-pointer max-w-[15ch]",children:s.vector_store_id.length>15?"".concat(s.vector_store_id.slice(0,15),"..."):s.vector_store_id})}},{header:"Name",accessorKey:"vector_store_name",cell:e=>{let{row:t}=e,r=t.original;return(0,a.jsx)(v.Z,{title:r.vector_store_name,children:(0,a.jsx)("span",{className:"text-xs",children:r.vector_store_name||"-"})})}},{header:"Description",accessorKey:"vector_store_description",cell:e=>{let{row:t}=e,r=t.original;return(0,a.jsx)(v.Z,{title:r.vector_store_description,children:(0,a.jsx)("span",{className:"text-xs",children:r.vector_store_description||"-"})})}},{header:"Provider",accessorKey:"custom_llm_provider",cell:e=>{let{row:t}=e,r=t.original,{displayName:s,logo:l}=(0,g.dr)(r.custom_llm_provider);return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[l&&(0,a.jsx)("img",{src:l,alt:s,className:"h-4 w-4"}),(0,a.jsx)("span",{className:"text-xs",children:s})]})}},{header:"Created At",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:t}=e,r=t.original;return(0,a.jsx)("span",{className:"text-xs",children:new Date(r.created_at).toLocaleDateString()})}},{header:"Updated At",accessorKey:"updated_at",sortingFn:"datetime",cell:e=>{let{row:t}=e,r=t.original;return(0,a.jsx)("span",{className:"text-xs",children:new Date(r.updated_at).toLocaleDateString()})}},{id:"actions",header:"",cell:e=>{let{row:t}=e,r=t.original;return(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)(j.Z,{variant:"Edit",tooltipText:"Edit vector store",onClick:()=>s(r.vector_store_id)}),(0,a.jsx)(j.Z,{variant:"Delete",tooltipText:"Delete vector store",onClick:()=>l(r.vector_store_id)})]})}}],f=(0,h.b7)({data:t,columns:c,state:{sorting:n},onSortingChange:i,getCoreRowModel:(0,u.sC)(),getSortedRowModel:(0,u.tj)(),enableSorting:!0});return(0,a.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(p.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(p.ss,{children:f.getHeaderGroups().map(e=>(0,a.jsx)(p.SC,{children:e.headers.map(e=>(0,a.jsx)(p.xs,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,h.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,a.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,a.jsx)(d.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,a.jsx)(x.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,a.jsx)(m.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,a.jsx)(p.RM,{children:f.getRowModel().rows.length>0?f.getRowModel().rows.map(e=>(0,a.jsx)(p.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,a.jsx)(p.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,h.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,a.jsx)(p.SC,{children:(0,a.jsx)(p.pj,{colSpan:c.length,className:"h-8 text-center",children:(0,a.jsx)("div",{className:"text-center text-gray-500",children:(0,a.jsx)("p",{children:"No vector stores found"})})})})})]})})})},y=r(64504),_=r(10032),b=r(22116),N=r(37592),w=r(51653),S=r(4260),Z=r(15424);(s=l||(l={})).Bedrock="Amazon Bedrock",s.PgVector="PostgreSQL pgvector (LiteLLM Connector)",s.VertexRagEngine="Vertex AI RAG Engine",s.OpenAI="OpenAI",s.Azure="Azure OpenAI",s.Milvus="Milvus";let C={Bedrock:"bedrock",PgVector:"pg_vector",VertexRagEngine:"vertex_ai",OpenAI:"openai",Azure:"azure",Milvus:"milvus"},I="../ui/assets/logos/",k={"Amazon Bedrock":"".concat(I,"bedrock.svg"),"PostgreSQL pgvector (LiteLLM Connector)":"".concat(I,"postgresql.svg"),"Vertex AI RAG Engine":"".concat(I,"google.svg"),OpenAI:"".concat(I,"openai_small.svg"),"Azure OpenAI":"".concat(I,"microsoft_azure.svg"),Milvus:"".concat(I,"milvus.svg")},A={bedrock:[],pg_vector:[{name:"api_base",label:"API Base",tooltip:"Enter the base URL of your deployed litellm-pgvector server (e.g., http://your-server:8000)",placeholder:"http://your-deployed-server:8000",required:!0,type:"text"},{name:"api_key",label:"API Key",tooltip:"Enter the API key from your deployed litellm-pgvector server",placeholder:"your-deployed-api-key",required:!0,type:"password"}],vertex_rag_engine:[],openai:[{name:"api_key",label:"API Key",tooltip:"Enter your OpenAI API key",placeholder:"sk-...",required:!0,type:"password"}],azure:[{name:"api_key",label:"API Key",tooltip:"Enter your Azure OpenAI API key",placeholder:"your-azure-api-key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com/)",placeholder:"https://your-resource.openai.azure.com/",required:!0,type:"text"}],milvus:[{name:"api_key",label:"API Key",tooltip:"To obtain a token, you should use a colon (:) to concatenate the username and password that you use to access your Milvus instance (e.g., username:password)",placeholder:"username:password or api key",required:!0,type:"password"},{name:"api_base",label:"API Base",tooltip:"Enter your Milvus endpoint (e.g., https://your-milvus-endpoint.com/)",placeholder:"https://your-milvus-endpoint.com/",required:!0,type:"text"},{name:"embedding_model",label:"Embedding Model",tooltip:"Select the embedding model to use",placeholder:"text-embedding-3-small",required:!0,type:"select"}]},E=e=>A[e]||[];var L=r(10703),V=r(9114),D=e=>{let{isVisible:t,onCancel:r,onSuccess:s,accessToken:n,credentials:i}=e,[d]=_.Z.useForm(),[x,m]=(0,o.useState)("{}"),[h,u]=(0,o.useState)("bedrock"),[p,j]=(0,o.useState)([]);(0,o.useEffect)(()=>{n&&(async()=>{try{let e=await (0,L.p)(n);e.length>0&&j(e)}catch(e){console.error("Error fetching model info:",e)}})()},[n]);let g=async e=>{if(n)try{let t={};try{t=x.trim()?JSON.parse(x):{}}catch(e){V.Z.fromBackend("Invalid JSON in metadata field");return}let r={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:t,litellm_credential_name:e.litellm_credential_name},l=E(e.custom_llm_provider).reduce((t,r)=>(t[r.name]=e[r.name],t),{});r.litellm_params=l,await (0,c.vectorStoreCreateCall)(n,r),V.Z.success("Vector store created successfully"),d.resetFields(),m("{}"),s()}catch(e){console.error("Error creating vector store:",e),V.Z.fromBackend("Error creating vector store: "+e)}},f=()=>{d.resetFields(),m("{}"),u("bedrock"),r()};return(0,a.jsx)(b.Z,{title:"Add New Vector Store",visible:t,width:1e3,footer:null,onCancel:f,children:(0,a.jsxs)(_.Z,{form:d,onFinish:g,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:["Provider"," ",(0,a.jsx)(v.Z,{title:"Select the provider for this vector store",children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],initialValue:"bedrock",children:(0,a.jsx)(N.default,{onChange:e=>u(e),children:Object.entries(l).map(e=>{let[t,r]=e;return(0,a.jsx)(N.default.Option,{value:C[t],children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("img",{src:k[r],alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{let t=e.target,s=t.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=r.charAt(0),s.replaceChild(e,t)}}}),(0,a.jsx)("span",{children:r})]})},t)})})}),"pg_vector"===h&&(0,a.jsx)(w.Z,{message:"PG Vector Setup Required",description:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{children:"LiteLLM provides a server to connect to PG Vector. To use this provider:"}),(0,a.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,a.jsxs)("li",{children:["Deploy the litellm-pgvector server from:"," ",(0,a.jsx)("a",{href:"https://github.com/BerriAI/litellm-pgvector",target:"_blank",rel:"noopener noreferrer",children:"https://github.com/BerriAI/litellm-pgvector"})]}),(0,a.jsx)("li",{children:"Configure your PostgreSQL database with pgvector extension"}),(0,a.jsx)("li",{children:"Start the server and note the API base URL and API key"}),(0,a.jsx)("li",{children:"Enter those details in the fields below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),"vertex_rag_engine"===h&&(0,a.jsx)(w.Z,{message:"Vertex AI RAG Engine Setup",description:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{children:"To use Vertex AI RAG Engine:"}),(0,a.jsxs)("ol",{style:{marginLeft:"16px",marginTop:"8px"},children:[(0,a.jsxs)("li",{children:["Set up your Vertex AI RAG Engine corpus following the guide:"," ",(0,a.jsx)("a",{href:"https://cloud.google.com/vertex-ai/generative-ai/docs/rag-engine/rag-overview",target:"_blank",rel:"noopener noreferrer",children:"Vertex AI RAG Engine Overview"})]}),(0,a.jsx)("li",{children:"Create a corpus in your Google Cloud project"}),(0,a.jsx)("li",{children:"Note the corpus ID from the Vertex AI console"}),(0,a.jsx)("li",{children:"Enter the corpus ID in the Vector Store ID field below"})]})]}),type:"info",showIcon:!0,style:{marginBottom:"16px"}}),(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:["Vector Store ID"," ",(0,a.jsx)(v.Z,{title:"Enter the vector store ID from your api provider",children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_id",rules:[{required:!0,message:"Please input the vector store ID from your api provider"}],children:(0,a.jsx)(y.o,{placeholder:"vertex_rag_engine"===h?"6917529027641081856 (Get corpus ID from Vertex AI console)":"Enter vector store ID from your provider"})}),E(h).map(e=>{if("select"===e.type){let t=p.filter(e=>"embedding"===e.mode).map(e=>({value:e.model_group,label:e.model_group}));return(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:[e.label," ",(0,a.jsx)(v.Z,{title:e.tooltip,children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:"Please select the ".concat(e.label.toLowerCase())}]:[],children:(0,a.jsx)(N.default,{placeholder:e.placeholder,showSearch:!0,filterOption:(e,t)=>{var r;return(null!==(r=null==t?void 0:t.label)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},options:t,style:{width:"100%"}})},e.name)}return(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:[e.label," ",(0,a.jsx)(v.Z,{title:e.tooltip,children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:e.name,rules:e.required?[{required:!0,message:"Please input the ".concat(e.label.toLowerCase())}]:[],children:(0,a.jsx)(y.o,{type:e.type||"text",placeholder:e.placeholder})},e.name)}),(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:["Vector Store Name"," ",(0,a.jsx)(v.Z,{title:"Custom name you want to give to the vector store, this name will be rendered on the LiteLLM UI",children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"vector_store_name",children:(0,a.jsx)(y.o,{})}),(0,a.jsx)(_.Z.Item,{label:"Description",name:"vector_store_description",children:(0,a.jsx)(S.default.TextArea,{rows:4})}),(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:["Existing Credentials"," ",(0,a.jsx)(v.Z,{title:"Optionally select API provider credentials for this vector store eg. Bedrock API KEY",children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"litellm_credential_name",children:(0,a.jsx)(N.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,t)=>{var r;return(null!==(r=null==t?void 0:t.label)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...i.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:["Metadata"," ",(0,a.jsx)(v.Z,{title:"JSON metadata for the vector store (optional)",children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),children:(0,a.jsx)(S.default.TextArea,{rows:4,value:x,onChange:e=>m(e.target.value),placeholder:'{"key": "value"}'})}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,a.jsx)(y.z,{onClick:f,variant:"secondary",children:"Cancel"}),(0,a.jsx)(y.z,{variant:"primary",type:"submit",children:"Create"})]})]})})},P=r(21609),O=r(64748),z=r(5545),B=r(10900),R=r(57840),q=r(42264),M=r(5945),T=r(23496),K=r(10353),F=r(44625),J=r(70464),G=r(77565),U=r(61935),Q=r(23907);let{TextArea:H}=S.default,{Text:Y,Title:X}=R.default;var W=e=>{let{vectorStoreId:t,accessToken:r,className:s=""}=e,[l,n]=(0,o.useState)(""),[i,d]=(0,o.useState)(!1),[x,m]=(0,o.useState)([]),[h,u]=(0,o.useState)({}),p=async()=>{if(!l.trim()){q.ZP.warning("Please enter a search query");return}d(!0);try{let e=await (0,c.vectorStoreSearchCall)(r,t,l),s={query:l,response:e,timestamp:Date.now()};m(e=>[s,...e]),n("")}catch(e){console.error("Error searching vector store:",e),V.Z.fromBackend("Failed to search vector store")}finally{d(!1)}},v=e=>new Date(e).toLocaleString(),j=(e,t)=>{let r="".concat(e,"-").concat(t);u(e=>({...e,[r]:!e[r]}))};return(0,a.jsx)(M.Z,{className:"w-full rounded-xl shadow-md",children:(0,a.jsxs)("div",{className:"flex flex-col h-[600px]",children:[(0,a.jsxs)("div",{className:"p-4 border-b border-gray-200 flex justify-between items-center",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(F.Z,{className:"mr-2 text-blue-500"}),(0,a.jsx)(X,{level:4,className:"mb-0",children:"Test Vector Store"})]}),x.length>0&&(0,a.jsx)(z.ZP,{onClick:()=>{m([]),u({}),V.Z.success("Search history cleared")},size:"small",children:"Clear History"})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-auto p-4 pb-0",children:[0===x.length?(0,a.jsxs)("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[(0,a.jsx)(F.Z,{style:{fontSize:"48px",marginBottom:"16px"}}),(0,a.jsx)(Y,{children:"Test your vector store by entering a search query below"})]}):(0,a.jsx)("div",{className:"space-y-4",children:x.map((e,t)=>{var r;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-right",children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("strong",{className:"text-sm",children:"Query"}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:v(e.timestamp)})]}),(0,a.jsx)("div",{className:"text-left",children:e.query})]})}),(0,a.jsx)("div",{className:"text-left",children:(0,a.jsxs)("div",{className:"inline-block max-w-[80%] rounded-lg shadow-sm p-3 bg-white border border-gray-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)(F.Z,{className:"text-green-500"}),(0,a.jsx)("strong",{className:"text-sm",children:"Vector Store Results"}),e.response&&(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-gray-100 text-gray-600",children:[(null===(r=e.response.data)||void 0===r?void 0:r.length)||0," results"]})]}),e.response&&e.response.data&&e.response.data.length>0?(0,a.jsx)("div",{className:"space-y-3",children:e.response.data.map((e,r)=>{let s=h["".concat(t,"-").concat(r)]||!1;return(0,a.jsxs)("div",{className:"border rounded-lg overflow-hidden bg-gray-50",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center p-3 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>j(t,r),children:[(0,a.jsxs)("div",{className:"flex items-center",children:[s?(0,a.jsx)(J.Z,{className:"text-gray-500 mr-2"}):(0,a.jsx)(G.Z,{className:"text-gray-500 mr-2"}),(0,a.jsxs)("span",{className:"font-medium text-sm",children:["Result ",r+1]}),!s&&e.content&&e.content[0]&&(0,a.jsxs)("span",{className:"ml-2 text-xs text-gray-500 truncate max-w-md",children:["- ",e.content[0].text.substring(0,100),"..."]})]}),(0,a.jsxs)("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:["Score: ",e.score.toFixed(4)]})]}),s&&(0,a.jsxs)("div",{className:"border-t bg-white p-3",children:[e.content&&e.content.map((e,t)=>(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsxs)("div",{className:"text-xs text-gray-500 mb-1",children:["Content (",e.type,")"]}),(0,a.jsx)("div",{className:"text-sm bg-gray-50 p-3 rounded border text-gray-800 max-h-40 overflow-y-auto",children:e.text})]},t)),(e.file_id||e.filename||e.attributes)&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500 mb-2 font-medium",children:"Metadata"}),(0,a.jsxs)("div",{className:"space-y-2 text-xs",children:[e.file_id&&(0,a.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,a.jsx)("span",{className:"font-medium",children:"File ID:"})," ",e.file_id]}),e.filename&&(0,a.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,a.jsx)("span",{className:"font-medium",children:"Filename:"})," ",e.filename]}),e.attributes&&Object.keys(e.attributes).length>0&&(0,a.jsxs)("div",{className:"bg-gray-50 p-2 rounded",children:[(0,a.jsx)("span",{className:"font-medium block mb-1",children:"Attributes:"}),(0,a.jsx)("pre",{className:"text-xs bg-white p-2 rounded border overflow-x-auto",children:JSON.stringify(e.attributes,null,2)})]})]})]})]})]},r)})}):(0,a.jsx)("div",{className:"text-gray-500 text-sm",children:"No results found"})]})}),tn(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),p())},placeholder:"Enter your search query... (Shift+Enter for new line)",disabled:i,autoSize:{minRows:1,maxRows:4},style:{resize:"none"}})}),(0,a.jsx)(z.ZP,{type:"primary",onClick:p,disabled:i||!l.trim(),icon:(0,a.jsx)(Q.Z,{}),loading:i,children:"Search"})]})})]})})},$=e=>{let{vectorStoreId:t,onClose:r,accessToken:s,is_admin:l,editVectorStore:n}=e,[i]=_.Z.useForm(),[d,x]=(0,o.useState)(null),[m,h]=(0,o.useState)(n),[u,p]=(0,o.useState)("{}"),[j,f]=(0,o.useState)([]),[y,b]=(0,o.useState)("details"),w=async()=>{if(s)try{let e=await (0,c.vectorStoreInfoCall)(s,t);if(e&&e.vector_store){if(x(e.vector_store),e.vector_store.vector_store_metadata){let t="string"==typeof e.vector_store.vector_store_metadata?JSON.parse(e.vector_store.vector_store_metadata):e.vector_store.vector_store_metadata;p(JSON.stringify(t,null,2))}n&&i.setFieldsValue({vector_store_id:e.vector_store.vector_store_id,custom_llm_provider:e.vector_store.custom_llm_provider,vector_store_name:e.vector_store.vector_store_name,vector_store_description:e.vector_store.vector_store_description})}}catch(e){console.error("Error fetching vector store details:",e),V.Z.fromBackend("Error fetching vector store details: "+e)}},C=async()=>{if(s)try{let e=await (0,c.credentialListCall)(s);console.log("List credentials response:",e),f(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e)}};(0,o.useEffect)(()=>{w(),C()},[t,s]);let I=async e=>{if(s)try{let t={};try{t=u?JSON.parse(u):{}}catch(e){V.Z.fromBackend("Invalid JSON in metadata field");return}let r={vector_store_id:e.vector_store_id,custom_llm_provider:e.custom_llm_provider,vector_store_name:e.vector_store_name,vector_store_description:e.vector_store_description,vector_store_metadata:t};await (0,c.vectorStoreUpdateCall)(s,r),V.Z.success("Vector store updated successfully"),h(!1),w()}catch(e){console.error("Error updating vector store:",e),V.Z.fromBackend("Error updating vector store: "+e)}};return d?(0,a.jsxs)("div",{className:"p-4 max-w-full",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(O.zx,{icon:B.Z,variant:"light",className:"mb-4",onClick:r,children:"Back to Vector Stores"}),(0,a.jsxs)(O.Dx,{children:["Vector Store ID: ",d.vector_store_id]}),(0,a.jsx)(O.xv,{className:"text-gray-500",children:d.vector_store_description||"No description"})]}),l&&!m&&(0,a.jsx)(O.zx,{onClick:()=>h(!0),children:"Edit Vector Store"})]}),(0,a.jsxs)(O.v0,{children:[(0,a.jsxs)(O.td,{className:"mb-6",children:[(0,a.jsx)(O.OK,{children:"Details"}),(0,a.jsx)(O.OK,{children:"Test Vector Store"})]}),(0,a.jsxs)(O.nP,{children:[(0,a.jsx)(O.x4,{children:m?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,a.jsx)(O.Dx,{children:"Edit Vector Store"})}),(0,a.jsx)(O.Zb,{children:(0,a.jsxs)(_.Z,{form:i,onFinish:I,layout:"vertical",initialValues:d,children:[(0,a.jsx)(_.Z.Item,{label:"Vector Store ID",name:"vector_store_id",rules:[{required:!0,message:"Please input a vector store ID"}],children:(0,a.jsx)(S.default,{disabled:!0})}),(0,a.jsx)(_.Z.Item,{label:"Vector Store Name",name:"vector_store_name",children:(0,a.jsx)(S.default,{})}),(0,a.jsx)(_.Z.Item,{label:"Description",name:"vector_store_description",children:(0,a.jsx)(S.default.TextArea,{rows:4})}),(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:["Provider"," ",(0,a.jsx)(v.Z,{title:"Select the provider for this vector store",children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),name:"custom_llm_provider",rules:[{required:!0,message:"Please select a provider"}],children:(0,a.jsx)(N.default,{children:Object.entries(g.Cl).map(e=>{let[t,r]=e;return"Bedrock"===t?(0,a.jsx)(N.default.Option,{value:g.fK[t],children:(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("img",{src:g.cd[r],alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{let t=e.target,s=t.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=r.charAt(0),s.replaceChild(e,t)}}}),(0,a.jsx)("span",{children:r})]})},t):null})})}),(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(O.xv,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter provider credentials below"})}),(0,a.jsx)(_.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",children:(0,a.jsx)(N.default,{showSearch:!0,placeholder:"Select or search for existing credentials",optionFilterProp:"children",filterOption:(e,t)=>{var r;return(null!==(r=null==t?void 0:t.label)&&void 0!==r?r:"").toLowerCase().includes(e.toLowerCase())},options:[{value:null,label:"None"},...j.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,a.jsxs)("div",{className:"flex items-center my-4",children:[(0,a.jsx)("div",{className:"flex-grow border-t border-gray-200"}),(0,a.jsx)("span",{className:"px-4 text-gray-500 text-sm",children:"OR"}),(0,a.jsx)("div",{className:"flex-grow border-t border-gray-200"})]}),(0,a.jsx)(_.Z.Item,{label:(0,a.jsxs)("span",{children:["Metadata"," ",(0,a.jsx)(v.Z,{title:"JSON metadata for the vector store",children:(0,a.jsx)(Z.Z,{style:{marginLeft:"4px"}})})]}),children:(0,a.jsx)(S.default.TextArea,{rows:4,value:u,onChange:e=>p(e.target.value),placeholder:'{"key": "value"}'})}),(0,a.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,a.jsx)(z.ZP,{onClick:()=>h(!1),children:"Cancel"}),(0,a.jsx)(z.ZP,{type:"primary",htmlType:"submit",children:"Save Changes"})]})]})})]}):(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(O.Dx,{children:"Vector Store Details"}),l&&(0,a.jsx)(O.zx,{onClick:()=>h(!0),children:"Edit Vector Store"})]}),(0,a.jsx)(O.Zb,{children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(O.xv,{className:"font-medium",children:"ID"}),(0,a.jsx)(O.xv,{children:d.vector_store_id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(O.xv,{className:"font-medium",children:"Name"}),(0,a.jsx)(O.xv,{children:d.vector_store_name||"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(O.xv,{className:"font-medium",children:"Description"}),(0,a.jsx)(O.xv,{children:d.vector_store_description||"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(O.xv,{className:"font-medium",children:"Provider"}),(0,a.jsx)("div",{className:"flex items-center space-x-2 mt-1",children:(()=>{let e=d.custom_llm_provider||"bedrock",{displayName:t,logo:r}=(()=>{let t=Object.keys(g.fK).find(t=>g.fK[t].toLowerCase()===e.toLowerCase());if(!t)return{displayName:e,logo:""};let r=g.Cl[t],s=g.cd[r];return{displayName:r,logo:s}})();return(0,a.jsxs)(a.Fragment,{children:[r&&(0,a.jsx)("img",{src:r,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{let r=e.target,s=r.parentElement;if(s){let e=document.createElement("div");e.className="w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",e.textContent=t.charAt(0),s.replaceChild(e,r)}}}),(0,a.jsx)(O.Ct,{color:"blue",children:t})]})})()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(O.xv,{className:"font-medium",children:"Metadata"}),(0,a.jsx)("div",{className:"bg-gray-50 p-3 rounded mt-2 font-mono text-xs overflow-auto max-h-48",children:(0,a.jsx)("pre",{children:u})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(O.xv,{className:"font-medium",children:"Created"}),(0,a.jsx)(O.xv,{children:d.created_at?new Date(d.created_at).toLocaleString():"-"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(O.xv,{className:"font-medium",children:"Last Updated"}),(0,a.jsx)(O.xv,{children:d.updated_at?new Date(d.updated_at).toLocaleString():"-"})]})]})})]})}),(0,a.jsx)(O.x4,{children:(0,a.jsx)(W,{vectorStoreId:d.vector_store_id,accessToken:s||""})})]})]})]}):(0,a.jsx)("div",{children:"Loading..."})},ee=r(20347),et=e=>{let{accessToken:t,userID:r,userRole:s}=e,[l,d]=(0,o.useState)([]),[x,m]=(0,o.useState)(!1),[h,u]=(0,o.useState)(!1),[p,v]=(0,o.useState)(null),[j,g]=(0,o.useState)(""),[y,_]=(0,o.useState)([]),[b,N]=(0,o.useState)(null),[w,S]=(0,o.useState)(!1),[Z,C]=(0,o.useState)(!1),I=async()=>{if(t)try{let e=await (0,c.vectorStoreListCall)(t);console.log("List vector stores response:",e),d(e.data||[])}catch(e){console.error("Error fetching vector stores:",e),V.Z.fromBackend("Error fetching vector stores: "+e)}},k=async()=>{if(t)try{let e=await (0,c.credentialListCall)(t);console.log("List credentials response:",e),_(e.credentials||[])}catch(e){console.error("Error fetching credentials:",e),V.Z.fromBackend("Error fetching credentials: "+e)}},A=async e=>{v(e),u(!0)},E=async()=>{if(t&&p){C(!0);try{await (0,c.vectorStoreDeleteCall)(t,p),V.Z.success("Vector store deleted successfully"),I()}catch(e){console.error("Error deleting vector store:",e),V.Z.fromBackend("Error deleting vector store: "+e)}finally{C(!1),u(!1),v(null)}}};return(0,o.useEffect)(()=>{I(),k()},[t]),b?(0,a.jsx)("div",{className:"w-full h-full",children:(0,a.jsx)($,{vectorStoreId:b,onClose:()=>{N(null),S(!1),I()},accessToken:t,is_admin:(0,ee.tY)(s||""),editVectorStore:w})}):(0,a.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,a.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,a.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,a.jsx)("h1",{children:"Vector Store Management"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[j&&(0,a.jsxs)(n.xv,{children:["Last Refreshed: ",j]}),(0,a.jsx)(n.JO,{icon:i.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{I(),k(),g(new Date().toLocaleString())}})]})]}),(0,a.jsx)(n.xv,{className:"mb-4",children:(0,a.jsx)("p",{children:"You can use vector stores to store and retrieve LLM embeddings.."})}),(0,a.jsx)(n.zx,{className:"mb-4",onClick:()=>m(!0),children:"+ Add Vector Store"}),(0,a.jsx)(n.rj,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,a.jsx)(n.JX,{numColSpan:1,children:(0,a.jsx)(f,{data:l,onView:e=>{N(e),S(!1)},onEdit:e=>{N(e),S(!0)},onDelete:A})})}),(0,a.jsx)(D,{isVisible:x,onCancel:()=>m(!1),onSuccess:()=>{m(!1),I()},accessToken:t,credentials:y}),(0,a.jsx)(P.Z,{isOpen:h,title:"Delete Vector Store",message:"Are you sure you want to delete this vector store? This action cannot be undone.",resourceInformationTitle:"Vector Store Information",resourceInformation:[{label:"Vector Store ID",value:p,code:!0}],onCancel:()=>u(!1),onOk:E,confirmLoading:Z})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9145-93c7b6227c4920ff.js b/litellm/proxy/_experimental/out/_next/static/chunks/9145-93c7b6227c4920ff.js deleted file mode 100644 index 2bcfb639dae..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9145-93c7b6227c4920ff.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9145],{39145:function(e,s,t){t.d(s,{Z:function(){return J}});var l=t(57437),a=t(2265),i=t(45822),r=t(23628),n=t(87452),d=t(88829),c=t(72208),o=t(41649),m=t(78489),x=t(12514),h=t(84264),u=t(96761),g=t(10032),j=t(4260),p=t(99981),b=t(37592),f=t(15424),v=t(19640),_=t(46468),Z=t(19250),y=t(9114),N=t(24199),w=t(65925),C=t(59872),S=t(30401),k=t(78867),D=t(5545),M=e=>{let{tagId:s,onClose:t,accessToken:i,is_admin:r,editTag:M}=e,[T]=g.Z.useForm(),[L,I]=(0,a.useState)(null),[E,B]=(0,a.useState)(M),[A,z]=(0,a.useState)([]),[R,F]=(0,a.useState)({}),P=async(e,s)=>{await (0,C.vQ)(e)&&(F(e=>({...e,[s]:!0})),setTimeout(()=>{F(e=>({...e,[s]:!1}))},2e3))},O=async()=>{if(i)try{let l=(await (0,Z.tagInfoCall)(i,[s]))[s];if(l&&(I(l),M)){var e,t;T.setFieldsValue({name:l.name,description:l.description,models:l.models,max_budget:null===(e=l.litellm_budget_table)||void 0===e?void 0:e.max_budget,budget_duration:null===(t=l.litellm_budget_table)||void 0===t?void 0:t.budget_duration})}}catch(e){console.error("Error fetching tag details:",e),y.Z.fromBackend("Error fetching tag details: "+e)}};(0,a.useEffect)(()=>{O()},[s,i]),(0,a.useEffect)(()=>{i&&(0,v.Nr)("dummy-user","Admin",i,z)},[i]);let q=async e=>{if(i)try{await (0,Z.tagUpdateCall)(i,{name:e.name,description:e.description,models:e.models,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,budget_duration:e.budget_duration}),y.Z.success("Tag updated successfully"),B(!1),O()}catch(e){console.error("Error updating tag:",e),y.Z.fromBackend("Error updating tag: "+e)}};return L?(0,l.jsxs)("div",{className:"p-4",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(m.Z,{onClick:t,className:"mb-4",children:"← Back to Tags"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Tag Name:"}),(0,l.jsx)("span",{className:"font-mono px-2 py-1 bg-gray-100 rounded text-sm border border-gray-200",children:L.name}),(0,l.jsx)(D.ZP,{type:"text",size:"small",icon:R["tag-name"]?(0,l.jsx)(S.Z,{size:12}):(0,l.jsx)(k.Z,{size:12}),onClick:()=>P(L.name,"tag-name"),className:"transition-all duration-200 ".concat(R["tag-name"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,l.jsx)(h.Z,{className:"text-gray-500",children:L.description||"No description"})]}),r&&!E&&(0,l.jsx)(m.Z,{onClick:()=>B(!0),children:"Edit Tag"})]}),E?(0,l.jsx)(x.Z,{children:(0,l.jsxs)(g.Z,{form:T,onFinish:q,layout:"vertical",initialValues:L,children:[(0,l.jsx)(g.Z.Item,{label:"Tag Name",name:"name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,l.jsx)(j.default,{className:"rounded-md border-gray-300"})}),(0,l.jsx)(g.Z.Item,{label:"Description",name:"description",children:(0,l.jsx)(j.default.TextArea,{rows:4})}),(0,l.jsx)(g.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed Models",(0,l.jsx)(p.Z,{title:"Select which models are allowed to process this type of data",children:(0,l.jsx)(f.Z,{style:{marginLeft:"4px"}})})]}),name:"models",children:(0,l.jsx)(b.default,{mode:"multiple",placeholder:"Select Models",children:A.map(e=>(0,l.jsx)(b.default.Option,{value:e,children:(0,_.W0)(e)},e))})}),(0,l.jsxs)(n.Z,{className:"mt-4 mb-4",children:[(0,l.jsx)(c.Z,{children:(0,l.jsx)(u.Z,{className:"m-0",children:"Budget & Rate Limits"})}),(0,l.jsxs)(d.Z,{children:[(0,l.jsx)(g.Z.Item,{label:(0,l.jsxs)("span",{children:["Max Budget (USD)"," ",(0,l.jsx)(p.Z,{title:"Maximum amount in USD this tag can spend",children:(0,l.jsx)(f.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",children:(0,l.jsx)(N.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(g.Z.Item,{label:(0,l.jsxs)("span",{children:["Reset Budget"," ",(0,l.jsx)(p.Z,{title:"How often the budget should reset",children:(0,l.jsx)(f.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",children:(0,l.jsx)(w.Z,{onChange:e=>T.setFieldValue("budget_duration",e)})}),(0,l.jsx)("div",{className:"mt-4 p-3 bg-gray-50 rounded-md border border-gray-200",children:(0,l.jsxs)("p",{className:"text-sm text-gray-600",children:["TPM/RPM limits for tags are not currently supported. If you need this feature, please"," ",(0,l.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"create a GitHub issue"}),"."]})})]})]}),(0,l.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,l.jsx)(m.Z,{onClick:()=>B(!1),children:"Cancel"}),(0,l.jsx)(m.Z,{type:"submit",children:"Save Changes"})]})]})}):(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)(x.Z,{children:[(0,l.jsx)(u.Z,{children:"Tag Details"}),(0,l.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Name"}),(0,l.jsx)(h.Z,{children:L.name})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Description"}),(0,l.jsx)(h.Z,{children:L.description||"-"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Allowed Models"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:L.models&&0!==L.models.length?L.models.map(e=>{var s;return(0,l.jsx)(o.Z,{color:"blue",children:(0,l.jsx)(p.Z,{title:"ID: ".concat(e),children:(null===(s=L.model_info)||void 0===s?void 0:s[e])||e})},e)}):(0,l.jsx)(o.Z,{color:"red",children:"All Models"})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Created"}),(0,l.jsx)(h.Z,{children:L.created_at?new Date(L.created_at).toLocaleString():"-"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Last Updated"}),(0,l.jsx)(h.Z,{children:L.updated_at?new Date(L.updated_at).toLocaleString():"-"})]})]})]}),L.litellm_budget_table&&(0,l.jsxs)(x.Z,{children:[(0,l.jsx)(u.Z,{children:"Budget & Rate Limits"}),(0,l.jsxs)("div",{className:"space-y-4 mt-4",children:[void 0!==L.litellm_budget_table.max_budget&&null!==L.litellm_budget_table.max_budget&&(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Max Budget"}),(0,l.jsxs)(h.Z,{children:["$",L.litellm_budget_table.max_budget]})]}),L.litellm_budget_table.budget_duration&&(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"Budget Duration"}),(0,l.jsx)(h.Z,{children:L.litellm_budget_table.budget_duration})]}),void 0!==L.litellm_budget_table.tpm_limit&&null!==L.litellm_budget_table.tpm_limit&&(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"TPM Limit"}),(0,l.jsx)(h.Z,{children:L.litellm_budget_table.tpm_limit.toLocaleString()})]}),void 0!==L.litellm_budget_table.rpm_limit&&null!==L.litellm_budget_table.rpm_limit&&(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"font-medium",children:"RPM Limit"}),(0,l.jsx)(h.Z,{children:L.litellm_budget_table.rpm_limit.toLocaleString()})]})]})]})]})]}):(0,l.jsx)("div",{children:"Loading..."})},T=t(53410),L=t(74998),I=t(44633),E=t(86462),B=t(49084),A=t(71594),z=t(24525),R=t(9513);let F="This is just a spend tag that was passed dynamically in a request. It does not control any LLM models.";var P=e=>{let{data:s,onEdit:t,onDelete:i,onSelectTag:r}=e,[n,d]=a.useState([{id:"created_at",desc:!0}]),c=[{header:"Tag Name",accessorKey:"name",cell:e=>{let{row:s}=e,t=s.original,a=t.description===F;return(0,l.jsx)("div",{className:"overflow-hidden",children:(0,l.jsx)(p.Z,{title:a?"You cannot view the information of a dynamically generated spend tag":t.name,children:(0,l.jsx)(R.zx,{size:"xs",variant:"light",className:"font-mono text-blue-500 bg-blue-50 hover:bg-blue-100 text-xs font-normal px-2 py-0.5",onClick:()=>r(t.name),disabled:a,children:t.name})})})}},{header:"Description",accessorKey:"description",cell:e=>{let{row:s}=e,t=s.original;return(0,l.jsx)(p.Z,{title:t.description,children:(0,l.jsx)("span",{className:"text-xs",children:t.description||"-"})})}},{header:"Allowed Models",accessorKey:"models",cell:e=>{var s,t;let{row:a}=e,i=a.original;return(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:(null==i?void 0:null===(s=i.models)||void 0===s?void 0:s.length)===0?(0,l.jsx)(R.Ct,{size:"xs",className:"mb-1",color:"red",children:"All Models"}):null==i?void 0:null===(t=i.models)||void 0===t?void 0:t.map(e=>{var s;return(0,l.jsx)(R.Ct,{size:"xs",className:"mb-1",color:"blue",children:(0,l.jsx)(p.Z,{title:"ID: ".concat(e),children:(0,l.jsx)(R.xv,{children:(null===(s=i.model_info)||void 0===s?void 0:s[e])||e})})},e)})})}},{header:"Created",accessorKey:"created_at",sortingFn:"datetime",cell:e=>{let{row:s}=e,t=s.original;return(0,l.jsx)("span",{className:"text-xs",children:new Date(t.created_at).toLocaleDateString()})}},{id:"actions",header:"Actions",cell:e=>{let{row:s}=e,a=s.original,r=a.description===F;return(0,l.jsxs)("div",{className:"flex space-x-2",children:[r?(0,l.jsx)(p.Z,{title:"Dynamically generated spend tags cannot be edited",children:(0,l.jsx)(R.JO,{icon:T.Z,size:"sm",className:"opacity-50 cursor-not-allowed","aria-label":"Edit tag (disabled)"})}):(0,l.jsx)(p.Z,{title:"Edit tag",children:(0,l.jsx)(R.JO,{icon:T.Z,size:"sm",onClick:()=>t(a),className:"cursor-pointer hover:text-blue-500"})}),r?(0,l.jsx)(p.Z,{title:"Dynamically generated spend tags cannot be deleted",children:(0,l.jsx)(R.JO,{icon:L.Z,size:"sm",className:"opacity-50 cursor-not-allowed","aria-label":"Delete tag (disabled)"})}):(0,l.jsx)(p.Z,{title:"Delete tag",children:(0,l.jsx)(R.JO,{icon:L.Z,size:"sm",onClick:()=>i(a.name),className:"cursor-pointer hover:text-red-500"})})]})}}],o=(0,A.b7)({data:s,columns:c,state:{sorting:n},onSortingChange:d,getCoreRowModel:(0,z.sC)(),getSortedRowModel:(0,z.tj)(),enableSorting:!0});return(0,l.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,l.jsx)("div",{className:"overflow-x-auto",children:(0,l.jsxs)(R.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,l.jsx)(R.ss,{children:o.getHeaderGroups().map(e=>(0,l.jsx)(R.SC,{children:e.headers.map(e=>(0,l.jsx)(R.xs,{className:"py-1 h-8 ".concat("actions"===e.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),onClick:e.column.getToggleSortingHandler(),children:(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,l.jsx)("div",{className:"flex items-center",children:e.isPlaceholder?null:(0,A.ie)(e.column.columnDef.header,e.getContext())}),"actions"!==e.id&&(0,l.jsx)("div",{className:"w-4",children:e.column.getIsSorted()?({asc:(0,l.jsx)(I.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,l.jsx)(E.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,l.jsx)(B.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,l.jsx)(R.RM,{children:o.getRowModel().rows.length>0?o.getRowModel().rows.map(e=>(0,l.jsx)(R.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,l.jsx)(R.pj,{className:"py-0.5 max-h-8 overflow-hidden text-ellipsis whitespace-nowrap ".concat("actions"===e.column.id?"sticky right-0 bg-white shadow-[-4px_0_8px_-6px_rgba(0,0,0,0.1)]":""),children:(0,A.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,l.jsx)(R.SC,{children:(0,l.jsx)(R.pj,{colSpan:c.length,className:"h-8 text-center",children:(0,l.jsx)("div",{className:"text-center text-gray-500",children:(0,l.jsx)("p",{children:"No tags found"})})})})})]})})})},O=t(49566),q=t(22116),H=e=>{let{visible:s,onCancel:t,onSubmit:a,availableModels:i}=e,[r]=g.Z.useForm();return(0,l.jsx)(q.Z,{title:"Create New Tag",visible:s,width:800,footer:null,onCancel:()=>{r.resetFields(),t()},children:(0,l.jsxs)(g.Z,{form:r,onFinish:e=>{a(e),r.resetFields()},labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsx)(g.Z.Item,{label:"Tag Name",name:"tag_name",rules:[{required:!0,message:"Please input a tag name"}],children:(0,l.jsx)(O.Z,{})}),(0,l.jsx)(g.Z.Item,{label:"Description",name:"description",children:(0,l.jsx)(j.default.TextArea,{rows:4})}),(0,l.jsx)(g.Z.Item,{label:(0,l.jsxs)("span",{children:["Allowed Models",(0,l.jsx)(p.Z,{title:"Select which models are allowed to process requests from this tag",children:(0,l.jsx)(f.Z,{style:{marginLeft:"4px"}})})]}),name:"allowed_llms",children:(0,l.jsx)(b.default,{mode:"multiple",placeholder:"Select Models",children:i.map(e=>(0,l.jsx)(b.default.Option,{value:e.model_info.id,children:(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{children:e.model_name}),(0,l.jsxs)("span",{className:"text-gray-400 ml-2",children:["(",e.model_info.id,")"]})]})},e.model_info.id))})}),(0,l.jsxs)(n.Z,{className:"mt-4 mb-4",children:[(0,l.jsx)(c.Z,{children:(0,l.jsx)(u.Z,{className:"m-0",children:"Budget & Rate Limits (Optional)"})}),(0,l.jsxs)(d.Z,{children:[(0,l.jsx)(g.Z.Item,{className:"mt-4",label:(0,l.jsxs)("span",{children:["Max Budget (USD)"," ",(0,l.jsx)(p.Z,{title:"Maximum amount in USD this tag can spend. When reached, requests with this tag will be blocked",children:(0,l.jsx)(f.Z,{style:{marginLeft:"4px"}})})]}),name:"max_budget",children:(0,l.jsx)(N.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(g.Z.Item,{className:"mt-4",label:(0,l.jsxs)("span",{children:["Reset Budget"," ",(0,l.jsx)(p.Z,{title:"How often the budget should reset. For example, setting 'daily' will reset the budget every 24 hours",children:(0,l.jsx)(f.Z,{style:{marginLeft:"4px"}})})]}),name:"budget_duration",children:(0,l.jsx)(w.Z,{onChange:e=>r.setFieldValue("budget_duration",e)})}),(0,l.jsx)("div",{className:"mt-4 p-3 bg-gray-50 rounded-md border border-gray-200",children:(0,l.jsxs)("p",{className:"text-sm text-gray-600",children:["TPM/RPM limits for tags are not currently supported. If you need this feature, please"," ",(0,l.jsx)("a",{href:"https://github.com/BerriAI/litellm/issues/new",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 underline",children:"create a GitHub issue"}),"."]})})]})]}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(m.Z,{type:"submit",children:"Create Tag"})})]})})},J=e=>{let{accessToken:s,userID:t,userRole:n}=e,[d,c]=(0,a.useState)([]),[o,m]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[u,g]=(0,a.useState)(!1),[j,p]=(0,a.useState)(!1),[b,f]=(0,a.useState)(null),[v,_]=(0,a.useState)(""),[N,w]=(0,a.useState)([]),C=async()=>{if(s)try{let e=await (0,Z.tagListCall)(s);console.log("List tags response:",e),c(Object.values(e))}catch(e){console.error("Error fetching tags:",e),y.Z.fromBackend("Error fetching tags: "+e)}},S=async e=>{if(s)try{await (0,Z.tagCreateCall)(s,{name:e.tag_name,description:e.description,models:e.allowed_llms,max_budget:e.max_budget,soft_budget:e.soft_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,budget_duration:e.budget_duration}),y.Z.success("Tag created successfully"),m(!1),C()}catch(e){console.error("Error creating tag:",e),y.Z.fromBackend("Error creating tag: "+e)}},k=async e=>{f(e),p(!0)},D=async()=>{if(s&&b){try{await (0,Z.tagDeleteCall)(s,b),y.Z.success("Tag deleted successfully"),C()}catch(e){console.error("Error deleting tag:",e),y.Z.fromBackend("Error deleting tag: "+e)}p(!1),f(null)}};return(0,a.useEffect)(()=>{t&&n&&s&&(async()=>{try{let e=await (0,Z.modelInfoCall)(s,t,n);e&&e.data&&w(e.data)}catch(e){console.error("Error fetching models:",e),y.Z.fromBackend("Error fetching models: "+e)}})()},[s,t,n]),(0,a.useEffect)(()=>{C()},[s]),(0,l.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:x?(0,l.jsx)(M,{tagId:x,onClose:()=>{h(null),g(!1)},accessToken:s,is_admin:"Admin"===n,editTag:u}):(0,l.jsxs)("div",{className:"gap-2 p-8 h-[75vh] w-full mt-2",children:[(0,l.jsxs)("div",{className:"flex justify-between mt-2 w-full items-center mb-4",children:[(0,l.jsx)("h1",{children:"Tag Management"}),(0,l.jsxs)("div",{className:"flex items-center space-x-2",children:[v&&(0,l.jsxs)(i.xv,{children:["Last Refreshed: ",v]}),(0,l.jsx)(i.JO,{icon:r.Z,variant:"shadow",size:"xs",className:"self-center cursor-pointer",onClick:()=>{C(),_(new Date().toLocaleString())}})]})]}),(0,l.jsxs)(i.xv,{className:"mb-4",children:["Click on a tag name to view and edit its details.",(0,l.jsxs)("p",{children:["You can use tags to restrict the usage of certain LLMs based on tags passed in the request. Read more about tag routing"," ",(0,l.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/tag_routing",target:"_blank",rel:"noopener noreferrer",children:"here"}),"."]})]}),(0,l.jsx)(i.zx,{className:"mb-4",onClick:()=>m(!0),children:"+ Create New Tag"}),(0,l.jsx)(i.rj,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,l.jsx)(i.JX,{numColSpan:1,children:(0,l.jsx)(P,{data:d,onEdit:e=>{h(e.name),g(!0)},onDelete:k,onSelectTag:h})})}),(0,l.jsx)(H,{visible:o,onCancel:()=>m(!1),onSubmit:S,availableModels:N}),j&&(0,l.jsx)("div",{className:"fixed z-10 inset-0 overflow-y-auto",children:(0,l.jsxs)("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[(0,l.jsx)("div",{className:"fixed inset-0 transition-opacity","aria-hidden":"true",children:(0,l.jsx)("div",{className:"absolute inset-0 bg-gray-500 opacity-75"})}),(0,l.jsxs)("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full",children:[(0,l.jsx)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:(0,l.jsx)("div",{className:"sm:flex sm:items-start",children:(0,l.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,l.jsx)("h3",{className:"text-lg leading-6 font-medium text-gray-900",children:"Delete Tag"}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)("p",{className:"text-sm text-gray-500",children:"Are you sure you want to delete this tag?"})})]})})}),(0,l.jsxs)("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[(0,l.jsx)(i.zx,{onClick:D,color:"red",className:"ml-2",children:"Delete"}),(0,l.jsx)(i.zx,{onClick:()=>{p(!1),f(null)},children:"Cancel"})]})]})]})})]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9165-82d12d1c73da639d.js b/litellm/proxy/_experimental/out/_next/static/chunks/9165-82d12d1c73da639d.js deleted file mode 100644 index e656f036b7b..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9165-82d12d1c73da639d.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9165],{46346:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M899.6 276.5L705 396.4 518.4 147.5a8.06 8.06 0 00-12.9 0L319 396.4 124.3 276.5c-5.7-3.5-13.1 1.2-12.2 7.9L188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.8-6.7-6.5-11.4-12.3-7.9zm-126 534.1H250.3l-53.8-409.4 139.8 86.1L512 252.9l175.7 234.4 139.8-86.1-53.9 409.4zM512 509c-62.1 0-112.6 50.5-112.6 112.6S449.9 734.2 512 734.2s112.6-50.5 112.6-112.6S574.1 509 512 509zm0 160.9c-26.6 0-48.2-21.6-48.2-48.3 0-26.6 21.6-48.3 48.2-48.3s48.2 21.6 48.2 48.3c0 26.6-21.6 48.3-48.2 48.3z"}}]},name:"crown",theme:"outlined"},i=n(55015),u=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},40428:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"logout",theme:"outlined"},i=n(55015),u=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},91870:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z"}}]},name:"mail",theme:"outlined"},i=n(55015),u=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},45524:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 000 13.8z"}}]},name:"menu-fold",theme:"outlined"},i=n(55015),u=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},83884:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 000-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0014.4 7z"}}]},name:"menu-unfold",theme:"outlined"},i=n(55015),u=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},57400:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64L128 192v384c0 212.1 171.9 384 384 384s384-171.9 384-384V192L512 64zm312 512c0 172.3-139.7 312-312 312S200 748.3 200 576V246l312-110 312 110v330z"}},{tag:"path",attrs:{d:"M378.4 475.1a35.91 35.91 0 00-50.9 0 35.91 35.91 0 000 50.9l129.4 129.4 2.1 2.1a33.98 33.98 0 0048.1 0L730.6 434a33.98 33.98 0 000-48.1l-2.8-2.8a33.98 33.98 0 00-48.1 0L483 579.7 378.4 475.1z"}}]},name:"safety",theme:"outlined"},i=n(55015),u=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},15883:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},i=n(55015),u=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},27648:function(e,t,n){n.d(t,{default:function(){return o.a}});var r=n(72972),o=n.n(r)},55449:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return r}}),n(33068);let r=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;ra?e.prefetch(t,o):e.prefetch(t,n,r))().catch(e=>{})}}function R(e){return"string"==typeof e?e:(0,c.formatUrl)(e)}let v=a.default.forwardRef(function(e,t){let n,r;let{href:c,as:_,children:v,prefetch:y=null,passHref:S,replace:b,shallow:P,scroll:A,locale:O,onClick:T,onMouseEnter:N,onTouchStart:I,legacyBehavior:C=!1,...x}=e;n=v,C&&("string"==typeof n||"number"==typeof n)&&(n=(0,o.jsx)("a",{children:n}));let M=a.default.useContext(f.RouterContext),w=a.default.useContext(d.AppRouterContext),j=null!=M?M:w,L=!M,D=!1!==y,U=null===y?m.PrefetchKind.AUTO:m.PrefetchKind.FULL,{href:k,as:H}=a.default.useMemo(()=>{if(!M){let e=R(c);return{href:e,as:_?R(_):e}}let[e,t]=(0,i.resolveHref)(M,c,!0);return{href:e,as:_?(0,i.resolveHref)(M,_):t||e}},[M,c,_]),F=a.default.useRef(k),z=a.default.useRef(H);C&&(r=a.default.Children.only(n));let X=C?r&&"object"==typeof r&&r.ref:t,[W,B,G]=(0,p.useIntersection)({rootMargin:"200px"}),V=a.default.useCallback(e=>{(z.current!==H||F.current!==k)&&(G(),z.current=H,F.current=k),W(e),X&&("function"==typeof X?X(e):"object"==typeof X&&(X.current=e))},[H,X,k,G,W]);a.default.useEffect(()=>{j&&B&&D&&E(j,k,H,{locale:O},{kind:U},L)},[H,k,B,O,D,null==M?void 0:M.locale,j,L,U]);let Z={ref:V,onClick(e){C||"function"!=typeof T||T(e),C&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),j&&!e.defaultPrevented&&function(e,t,n,r,o,i,c,s,l){let{nodeName:f}=e.currentTarget;if("A"===f.toUpperCase()&&(function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!l&&!(0,u.isLocalURL)(n)))return;e.preventDefault();let d=()=>{let e=null==c||c;"beforePopState"in t?t[o?"replace":"push"](n,r,{shallow:i,locale:s,scroll:e}):t[o?"replace":"push"](r||n,{scroll:e})};l?a.default.startTransition(d):d()}(e,j,k,H,b,P,A,O,L)},onMouseEnter(e){C||"function"!=typeof N||N(e),C&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),j&&(D||!L)&&E(j,k,H,{locale:O,priority:!0,bypassPrefetchedCheck:!0},{kind:U},L)},onTouchStart:function(e){C||"function"!=typeof I||I(e),C&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),j&&(D||!L)&&E(j,k,H,{locale:O,priority:!0,bypassPrefetchedCheck:!0},{kind:U},L)}};if((0,s.isAbsoluteUrl)(H))Z.href=H;else if(!C||S||"a"===r.type&&!("href"in r.props)){let e=void 0!==O?O:null==M?void 0:M.locale,t=(null==M?void 0:M.isLocaleDomain)&&(0,h.getDomainLocale)(H,e,null==M?void 0:M.locales,null==M?void 0:M.domainLocales);Z.href=t||(0,g.addBasePath)((0,l.addLocale)(H,e,null==M?void 0:M.defaultLocale))}return C?a.default.cloneElement(r,Z):(0,o.jsx)("a",{...x,...Z,children:n})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63515:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{cancelIdleCallback:function(){return r},requestIdleCallback:function(){return n}});let n="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},r="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25246:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return f}});let r=n(48637),o=n(57497),a=n(17053),i=n(3987),u=n(33068),c=n(53552),s=n(86279),l=n(37205);function f(e,t,n){let f;let d="string"==typeof t?t:(0,o.formatWithValidation)(t),p=d.match(/^[a-zA-Z]{1,}:\/\//),h=p?d.slice(p[0].length):d;if((h.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+d+"' passed to next/router in page: '"+e.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");let t=(0,i.normalizeRepeatedSlashes)(h);d=(p?p[0]:"")+t}if(!(0,c.isLocalURL)(d))return n?[d]:d;try{f=new URL(d.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){f=new URL("/","http://n")}try{let e=new URL(d,f);e.pathname=(0,u.normalizePathTrailingSlash)(e.pathname);let t="";if((0,s.isDynamicRoute)(e.pathname)&&e.searchParams&&n){let n=(0,r.searchParamsToUrlQuery)(e.searchParams),{result:i,params:u}=(0,l.interpolateAs)(e.pathname,e.pathname,n);i&&(t=(0,o.formatWithValidation)({pathname:i,hash:e.hash,query:(0,a.omit)(n,u)}))}let i=e.origin===f.origin?e.href.slice(e.origin.length):e.href;return n?[i,t||i]:i}catch(e){return n?[d]:d}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16081:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return c}});let r=n(2265),o=n(63515),a="function"==typeof IntersectionObserver,i=new Map,u=[];function c(e){let{rootRef:t,rootMargin:n,disabled:c}=e,s=c||!a,[l,f]=(0,r.useState)(!1),d=(0,r.useRef)(null),p=(0,r.useCallback)(e=>{d.current=e},[]);return(0,r.useEffect)(()=>{if(a){if(s||l)return;let e=d.current;if(e&&e.tagName)return function(e,t,n){let{id:r,observer:o,elements:a}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},r=u.find(e=>e.root===n.root&&e.margin===n.margin);if(r&&(t=i.get(r)))return t;let o=new Map;return t={id:n,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e),elements:o},u.push(n),i.set(n,t),t}(n);return a.set(e,t),o.observe(e),function(){if(a.delete(e),o.unobserve(e),0===a.size){o.disconnect(),i.delete(r);let e=u.findIndex(e=>e.root===r.root&&e.margin===r.margin);e>-1&&u.splice(e,1)}}}(e,e=>e&&f(e),{root:null==t?void 0:t.current,rootMargin:n})}else if(!l){let e=(0,o.requestIdleCallback)(()=>f(!0));return()=>(0,o.cancelIdleCallback)(e)}},[s,n,t,l,d.current]),[p,l,(0,r.useCallback)(()=>{f(!1)},[])]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19259:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_SUFFIX:function(){return c},APP_DIR_ALIAS:function(){return T},CACHE_ONE_YEAR:function(){return v},DOT_NEXT_ALIAS:function(){return A},ESLINT_DEFAULT_DIRS:function(){return G},GSP_NO_RETURNED_VALUE:function(){return H},GSSP_COMPONENT_MEMBER_ERROR:function(){return X},GSSP_NO_RETURNED_VALUE:function(){return F},INSTRUMENTATION_HOOK_FILENAME:function(){return b},MIDDLEWARE_FILENAME:function(){return y},MIDDLEWARE_LOCATION_REGEXP:function(){return S},NEXT_BODY_SUFFIX:function(){return f},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return R},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return h},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return g},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return p},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return E},NEXT_CACHE_TAGS_HEADER:function(){return d},NEXT_CACHE_TAG_MAX_ITEMS:function(){return m},NEXT_CACHE_TAG_MAX_LENGTH:function(){return _},NEXT_DATA_SUFFIX:function(){return s},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return r},NEXT_META_SUFFIX:function(){return l},NEXT_QUERY_PARAM_PREFIX:function(){return n},NON_STANDARD_NODE_ENV:function(){return W},PAGES_DIR_ALIAS:function(){return P},PRERENDER_REVALIDATE_HEADER:function(){return o},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return w},ROOT_DIR_ALIAS:function(){return O},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return M},RSC_ACTION_ENCRYPTION_ALIAS:function(){return x},RSC_ACTION_PROXY_ALIAS:function(){return C},RSC_ACTION_VALIDATE_ALIAS:function(){return I},RSC_MOD_REF_PROXY_ALIAS:function(){return N},RSC_PREFETCH_SUFFIX:function(){return i},RSC_SUFFIX:function(){return u},SERVER_PROPS_EXPORT_ERROR:function(){return k},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return L},SERVER_PROPS_SSG_CONFLICT:function(){return D},SERVER_RUNTIME:function(){return V},SSG_FALLBACK_EXPORT_ERROR:function(){return B},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return j},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return U},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return z},WEBPACK_LAYERS:function(){return Y},WEBPACK_RESOURCE_QUERIES:function(){return K}});let n="nxtP",r="nxtI",o="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",i=".prefetch.rsc",u=".rsc",c=".action",s=".json",l=".meta",f=".body",d="x-next-cache-tags",p="x-next-cache-soft-tags",h="x-next-revalidated-tags",g="x-next-revalidate-tag-token",m=128,_=256,E=1024,R="_N_T_",v=31536e3,y="middleware",S=`(?:src/)?${y}`,b="instrumentation",P="private-next-pages",A="private-dot-next",O="private-next-root-dir",T="private-next-app-dir",N="private-next-rsc-mod-ref-proxy",I="private-next-rsc-action-validate",C="private-next-rsc-server-reference",x="private-next-rsc-action-encryption",M="private-next-rsc-action-client-wrapper",w="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",j="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",L="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",D="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",U="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",k="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",H="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",F="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",z="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",X="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",W='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',B="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",G=["app","pages","components","lib","src"],V={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},Z={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"},Y={...Z,GROUP:{serverOnly:[Z.reactServerComponents,Z.actionBrowser,Z.appMetadataRoute,Z.appRouteHandler,Z.instrument],clientOnly:[Z.serverSideRendering,Z.appPagesBrowser],nonClientServerTarget:[Z.middleware,Z.api],app:[Z.reactServerComponents,Z.actionBrowser,Z.appMetadataRoute,Z.appRouteHandler,Z.serverSideRendering,Z.appPagesBrowser,Z.shared,Z.instrument]}},K={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},90042:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return o}});let n=/[|\\{}()[\]^$+*?.-]/,r=/[|\\{}()[\]^$+*?.-]/g;function o(e){return n.test(e)?e.replace(r,"\\$&"):e}},25523:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});let r=n(47043)._(n(2265)).default.createContext(null)},57497:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{formatUrl:function(){return a},formatWithValidation:function(){return u},urlObjectKeys:function(){return i}});let r=n(53099)._(n(48637)),o=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:n}=e,a=e.protocol||"",i=e.pathname||"",u=e.hash||"",c=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:n&&(s=t+(~n.indexOf(":")?"["+n+"]":n),e.port&&(s+=":"+e.port)),c&&"object"==typeof c&&(c=String(r.urlQueryToSearchParams(c)));let l=e.search||c&&"?"+c||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||o.test(a))&&!1!==s?(s="//"+(s||""),i&&"/"!==i[0]&&(i="/"+i)):s||(s=""),u&&"#"!==u[0]&&(u="#"+u),l&&"?"!==l[0]&&(l="?"+l),""+a+s+(i=i.replace(/[?#]/g,encodeURIComponent))+(l=l.replace("#","%23"))+u}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return a(e)}},86279:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getSortedRoutes:function(){return r.getSortedRoutes},isDynamicRoute:function(){return o.isDynamicRoute}});let r=n(14777),o=n(38104)},37205:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return a}});let r=n(4199),o=n(9964);function a(e,t,n){let a="",i=(0,o.getRouteRegex)(e),u=i.groups,c=(t!==e?(0,r.getRouteMatcher)(i)(t):"")||n;a=e;let s=Object.keys(u);return s.every(e=>{let t=c[e]||"",{repeat:n,optional:r}=u[e],o="["+(n?"...":"")+e+"]";return r&&(o=(t?"":"/")+"["+o+"]"),n&&!Array.isArray(t)&&(t=[t]),(r||e in c)&&(a=a.replace(o,n?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(a=""),{params:s,result:a}}},38104:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return a}});let r=n(91182),o=/\/\[[^/]+?\](?=\/|$)/;function a(e){return(0,r.isInterceptionRouteAppPath)(e)&&(e=(0,r.extractInterceptionRouteInformation)(e).interceptedRoute),o.test(e)}},53552:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return a}});let r=n(3987),o=n(11283);function a(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,o.hasBasePath)(n.pathname)}catch(e){return!1}}},17053:function(e,t){function n(e,t){let n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return n}})},48637:function(e,t){function n(e){let t={};return e.forEach((e,n)=>{void 0===t[n]?t[n]=e:Array.isArray(t[n])?t[n].push(e):t[n]=[t[n],e]}),t}function r(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[n,o]=e;Array.isArray(o)?o.forEach(e=>t.append(n,r(e))):t.set(n,r(o))}),t}function a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,n)=>e.append(n,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{assign:function(){return a},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}})},4199:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return o}});let r=n(3987);function o(e){let{re:t,groups:n}=e;return e=>{let o=t.exec(e);if(!o)return!1;let a=e=>{try{return decodeURIComponent(e)}catch(e){throw new r.DecodeError("failed to decode param")}},i={};return Object.keys(n).forEach(e=>{let t=n[e],r=o[t.pos];void 0!==r&&(i[e]=~r.indexOf("/")?r.split("/").map(e=>a(e)):t.repeat?[a(r)]:a(r))}),i}}},9964:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getNamedMiddlewareRegex:function(){return p},getNamedRouteRegex:function(){return d},getRouteRegex:function(){return s},parseParameter:function(){return u}});let r=n(19259),o=n(91182),a=n(90042),i=n(26674);function u(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let n=e.startsWith("...");return n&&(e=e.slice(3)),{key:e,repeat:n,optional:t}}function c(e){let t=(0,i.removeTrailingSlash)(e).slice(1).split("/"),n={},r=1;return{parameterizedRoute:t.map(e=>{let t=o.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&i){let{key:e,optional:o,repeat:c}=u(i[1]);return n[e]={pos:r++,repeat:c,optional:o},"/"+(0,a.escapeStringRegexp)(t)+"([^/]+?)"}if(!i)return"/"+(0,a.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:o}=u(i[1]);return n[e]={pos:r++,repeat:t,optional:o},t?o?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:n}}function s(e){let{parameterizedRoute:t,groups:n}=c(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:n}}function l(e){let{interceptionMarker:t,getSafeRouteKey:n,segment:r,routeKeys:o,keyPrefix:i}=e,{key:c,optional:s,repeat:l}=u(r),f=c.replace(/\W/g,"");i&&(f=""+i+f);let d=!1;(0===f.length||f.length>30)&&(d=!0),isNaN(parseInt(f.slice(0,1)))||(d=!0),d&&(f=n()),i?o[f]=""+i+c:o[f]=c;let p=t?(0,a.escapeStringRegexp)(t):"";return l?s?"(?:/"+p+"(?<"+f+">.+?))?":"/"+p+"(?<"+f+">.+?)":"/"+p+"(?<"+f+">[^/]+?)"}function f(e,t){let n;let u=(0,i.removeTrailingSlash)(e).slice(1).split("/"),c=(n=0,()=>{let e="",t=++n;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),s={};return{namedParameterizedRoute:u.map(e=>{let n=o.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(n&&i){let[n]=e.split(i[0]);return l({getSafeRouteKey:c,interceptionMarker:n,segment:i[1],routeKeys:s,keyPrefix:t?r.NEXT_INTERCEPTION_MARKER_PREFIX:void 0})}return i?l({getSafeRouteKey:c,segment:i[1],routeKeys:s,keyPrefix:t?r.NEXT_QUERY_PARAM_PREFIX:void 0}):"/"+(0,a.escapeStringRegexp)(e)}).join(""),routeKeys:s}}function d(e,t){let n=f(e,t);return{...s(e),namedRegex:"^"+n.namedParameterizedRoute+"(?:/)?$",routeKeys:n.routeKeys}}function p(e,t){let{parameterizedRoute:n}=c(e),{catchAll:r=!0}=t;if("/"===n)return{namedRegex:"^/"+(r?".*":"")+"$"};let{namedParameterizedRoute:o}=f(e,!1);return{namedRegex:"^"+o+(r?"(?:(/.*)?)":"")+"$"}}},14777:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return r}});class n{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let n=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&n.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").');n.unshift(t)}return null!==this.restSlugName&&n.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&n.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),n}_insert(e,t,r){if(0===e.length){this.placeholder=!1;return}if(r)throw Error("Catch-all must be the last part of the URL.");let o=e[0];if(o.startsWith("[")&&o.endsWith("]")){let n=o.slice(1,-1),i=!1;if(n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1),i=!0),n.startsWith("...")&&(n=n.substring(3),r=!0),n.startsWith("[")||n.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+n+"').");if(n.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+n+"').");function a(e,n){if(null!==e&&e!==n)throw Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+n+"').");t.forEach(e=>{if(e===n)throw Error('You cannot have the same slug name "'+n+'" repeat within a single dynamic path');if(e.replace(/\W/g,"")===o.replace(/\W/g,""))throw Error('You cannot have the slug names "'+e+'" and "'+n+'" differ only by non-word symbols within a single dynamic path')}),t.push(n)}if(r){if(i){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).');a(this.optionalRestSlugName,n),this.optionalRestSlugName=n,o="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").');a(this.restSlugName,n),this.restSlugName=n,o="[...]"}}else{if(i)throw Error('Optional route parameters are not yet supported ("'+e[0]+'").');a(this.slugName,n),this.slugName=n,o="[]"}}this.children.has(o)||this.children.set(o,new n),this.children.get(o)._insert(e.slice(1),t,r)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function r(e){let t=new n;return e.forEach(e=>t.insert(e)),t.smoosh()}},3987:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return E},MissingStaticPage:function(){return _},NormalizeError:function(){return g},PageNotFoundError:function(){return m},SP:function(){return d},ST:function(){return p},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return c},getLocationOrigin:function(){return i},getURL:function(){return u},isAbsoluteUrl:function(){return a},isResSent:function(){return s},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return l},stringifyError:function(){return R}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(e){let t,n=!1;return function(){for(var r=arguments.length,o=Array(r),a=0;ao.test(e);function i(){let{protocol:e,hostname:t,port:n}=window.location;return e+"//"+t+(n?":"+n:"")}function u(){let{href:e}=window.location,t=i();return e.substring(t.length)}function c(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function s(e){return e.finished||e.headersSent}function l(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&s(n))return r;if(!r)throw Error('"'+c(e)+'.getInitialProps()" should resolve to an object. But found "'+r+'" instead.');return r}let d="undefined"!=typeof performance,p=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class h extends Error{}class g extends Error{}class m extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class _ extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class E extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function R(e){return JSON.stringify({message:e.message,stack:e.stack})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9264-f3f681df00e28eb2.js b/litellm/proxy/_experimental/out/_next/static/chunks/9264-f3f681df00e28eb2.js deleted file mode 100644 index d48ce8f54f2..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9264-f3f681df00e28eb2.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9264],{89264:function(e,l,t){t.d(l,{Z:function(){return eM}});var a=t(57437),s=t(78489),n=t(12514),r=t(67101),i=t(57365),o=t(59341),c=t(12485),d=t(18135),u=t(35242),m=t(29706),h=t(77991),g=t(21626),x=t(97214),f=t(28241),p=t(58834),y=t(69552),j=t(71876),v=t(84264),b=t(49566),Z=t(2265),C=t(57840),k=t(4260),_=t(37592),w=t(10032),N=t(22116),S=t(5545),E=t(9114),P=t(19250),T=t(23496),F=t(10353),A=t(61994);let{Title:I}=C.default;var z=e=>{let{accessToken:l}=e,[t,r]=(0,Z.useState)(!0),[i,o]=(0,Z.useState)([]);(0,Z.useEffect)(()=>{c()},[l]);let c=async()=>{if(l){r(!0);try{let e=await (0,P.getEmailEventSettings)(l);o(e.settings)}catch(e){console.error("Failed to fetch email event settings:",e),E.Z.fromBackend(e)}finally{r(!1)}}},d=(e,l)=>{o(i.map(t=>t.event===e?{...t,enabled:l}:t))},u=async()=>{if(l)try{await (0,P.updateEmailEventSettings)(l,{settings:i}),E.Z.success("Email event settings updated successfully")}catch(e){console.error("Failed to update email event settings:",e),E.Z.fromBackend(e)}},m=async()=>{if(l)try{await (0,P.resetEmailEventSettings)(l),E.Z.success("Email event settings reset to defaults"),c()}catch(e){console.error("Failed to reset email event settings:",e),E.Z.fromBackend(e)}},h=e=>{if(e.includes("Virtual Key Created"))return"An email will be sent to the user when a new virtual key is created with their user ID";if(e.includes("New User Invitation"))return"An email will be sent to the email address of the user when a new user is created";{let l=e.split(/(?=[A-Z])/).join(" ").toLowerCase();return"Receive an email notification when ".concat(l)}};return(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(I,{level:4,children:"Email Notifications"}),(0,a.jsx)(v.Z,{children:"Select which events should trigger email notifications."}),(0,a.jsx)(T.Z,{}),t?(0,a.jsx)("div",{style:{textAlign:"center",padding:"20px"},children:(0,a.jsx)(F.Z,{size:"large"})}):(0,a.jsx)("div",{className:"space-y-4",children:i.map(e=>(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(A.Z,{checked:e.enabled,onChange:l=>d(e.event,l.target.checked)}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)(v.Z,{children:e.event}),(0,a.jsx)("div",{className:"text-sm text-gray-500 block",children:h(e.event)})]})]},e.event))}),(0,a.jsxs)("div",{className:"mt-6 flex space-x-4",children:[(0,a.jsx)(s.Z,{onClick:u,disabled:t,children:"Save Changes"}),(0,a.jsx)(s.Z,{onClick:m,variant:"secondary",disabled:t,children:"Reset to Defaults"})]})]})};let{Title:O}=C.default;var L=e=>{let{accessToken:l,premiumUser:t,alerts:i}=e,o=async()=>{if(!l)return;let e={};i.filter(e=>"email"===e.name).forEach(l=>{var t;Object.entries(null!==(t=l.variables)&&void 0!==t?t:{}).forEach(l=>{let[t,a]=l,s=document.querySelector('input[name="'.concat(t,'"]'));s&&s.value&&(e[t]=null==s?void 0:s.value)})}),console.log("updatedVariables",e);try{await (0,P.setCallbacksCall)(l,{general_settings:{alerting:["email"]},environment_variables:e}),E.Z.success("Email settings updated successfully")}catch(e){E.Z.fromBackend(e)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mt-6 mb-6",children:(0,a.jsx)(z,{accessToken:l})}),(0,a.jsxs)(n.Z,{children:[(0,a.jsx)(O,{level:4,children:"Email Server Settings"}),(0,a.jsxs)(v.Z,{children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/email",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: email alerts"]})," ",(0,a.jsx)("br",{})]}),(0,a.jsx)("div",{className:"flex w-full",children:i.filter(e=>"email"===e.name).map((e,l)=>{var s;return(0,a.jsx)(f.Z,{children:(0,a.jsx)("ul",{children:(0,a.jsx)(r.Z,{numItems:2,children:Object.entries(null!==(s=e.variables)&&void 0!==s?s:{}).map(e=>{let[l,s]=e;return(0,a.jsxs)("li",{className:"mx-2 my-2",children:[!0!=t&&("EMAIL_LOGO_URL"===l||"EMAIL_SUPPORT_CONTACT"===l)?(0,a.jsxs)("div",{children:[(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:(0,a.jsxs)(v.Z,{className:"mt-2",children:[" ✨ ",l]})}),(0,a.jsx)(b.Z,{name:l,defaultValue:s,type:"password",disabled:!0,style:{width:"400px"}})]}):(0,a.jsxs)("div",{children:[(0,a.jsx)(v.Z,{className:"mt-2",children:l}),(0,a.jsx)(b.Z,{name:l,defaultValue:s,type:"password",style:{width:"400px"}})]}),(0,a.jsxs)("p",{style:{fontSize:"small",fontStyle:"italic"},children:["SMTP_HOST"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP host address, e.g. `smtp.resend.com`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PORT"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP port number, e.g. `587`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_USERNAME"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the SMTP username, e.g. `username`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"SMTP_PASSWORD"===l&&(0,a.jsx)("span",{style:{color:"red"},children:" Required * "}),"SMTP_SENDER_EMAIL"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Enter the sender email address, e.g. `sender@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"TEST_EMAIL_ADDRESS"===l&&(0,a.jsxs)("div",{style:{color:"gray"},children:["Email Address to send `Test Email Alert` to. example: `info@berri.ai`",(0,a.jsx)("span",{style:{color:"red"},children:" Required * "})]}),"EMAIL_LOGO_URL"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the Logo that appears in the email, pass a url to your logo"}),"EMAIL_SUPPORT_CONTACT"===l&&(0,a.jsx)("div",{style:{color:"gray"},children:"(Optional) Customize the support email address that appears in the email. Default is support@berri.ai"})]})]},l)})})})},l)})}),(0,a.jsx)(s.Z,{className:"mt-2",onClick:()=>o(),children:"Save Changes"}),(0,a.jsx)(s.Z,{onClick:async()=>{if(l)try{await (0,P.serviceHealthCheck)(l,"email"),E.Z.success("Email test triggered. Check your configured email inbox/logs.")}catch(e){E.Z.fromBackend(e)}},className:"mx-2",children:"Test Email Alerts"})]})]})},D=t(2740),U=t(19015),R=t(44643),B=t(74998),q=t(41649),M=t(47323),W=e=>{let{alertingSettings:l,handleInputChange:t,handleResetField:n,handleSubmit:r,premiumUser:i}=e,[c]=w.Z.useForm();return(0,a.jsxs)(w.Z,{form:c,onFinish:()=>{console.log("INSIDE ONFINISH");let e=c.getFieldsValue(),l=Object.entries(e).every(e=>{let[l,t]=e;return"boolean"!=typeof t&&(""===t||null==t)});console.log("formData: ".concat(JSON.stringify(e),", isEmpty: ").concat(l)),l?console.log("Some form fields are empty."):r(e)},labelAlign:"left",children:[l.map((e,l)=>(0,a.jsxs)(j.Z,{children:[(0,a.jsxs)(f.Z,{align:"center",children:[(0,a.jsx)(v.Z,{children:e.field_name}),(0,a.jsx)("p",{style:{fontSize:"0.65rem",color:"#808080",fontStyle:"italic"},className:"mt-1",children:e.field_description})]}),e.premium_field?i?(0,a.jsx)(w.Z.Item,{name:e.field_name,children:(0,a.jsx)(f.Z,{children:"Integer"===e.field_type?(0,a.jsx)(U.Z,{step:1,value:e.field_value,onChange:l=>t(e.field_name,l)}):"Boolean"===e.field_type?(0,a.jsx)(o.Z,{checked:e.field_value,onChange:l=>t(e.field_name,l)}):(0,a.jsx)(k.default,{value:e.field_value,onChange:l=>t(e.field_name,l)})})}):(0,a.jsx)(f.Z,{children:(0,a.jsx)(s.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})})}):(0,a.jsx)(w.Z.Item,{name:e.field_name,className:"mb-0",valuePropName:"Boolean"===e.field_type?"checked":"value",children:(0,a.jsx)(f.Z,{children:"Integer"===e.field_type?(0,a.jsx)(U.Z,{step:1,value:e.field_value,onChange:l=>t(e.field_name,l),className:"p-0"}):"Boolean"===e.field_type?(0,a.jsx)(o.Z,{checked:e.field_value,onChange:l=>{t(e.field_name,l),c.setFieldsValue({[e.field_name]:l})}}):(0,a.jsx)(k.default,{value:e.field_value,onChange:l=>t(e.field_name,l)})})}),(0,a.jsx)(f.Z,{children:!0==e.stored_in_db?(0,a.jsx)(q.Z,{icon:R.Z,className:"text-white",children:"In DB"}):!1==e.stored_in_db?(0,a.jsx)(q.Z,{className:"text-gray bg-white outline",children:"In Config"}):(0,a.jsx)(q.Z,{className:"text-gray bg-white outline",children:"Not Set"})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(M.Z,{icon:B.Z,color:"red",onClick:()=>n(e.field_name,l),children:"Reset"})})]},l)),(0,a.jsx)("div",{children:(0,a.jsx)(S.ZP,{htmlType:"submit",children:"Update Settings"})})]})},H=e=>{let{accessToken:l,premiumUser:t}=e,[s,n]=(0,Z.useState)([]);return(0,Z.useEffect)(()=>{l&&(0,P.alertingSettingsCall)(l).then(e=>{n(e)})},[l]),(0,a.jsx)(W,{alertingSettings:s,handleInputChange:(e,l)=>{let t=s.map(t=>t.field_name===e?{...t,field_value:l}:t);console.log("updatedSettings: ".concat(JSON.stringify(t))),n(t)},handleResetField:(e,t)=>{if(l)try{let l=s.map(l=>l.field_name===e?{...l,stored_in_db:null,field_value:l.field_default_value}:l);n(l)}catch(e){console.log("ERROR OCCURRED!")}},handleSubmit:e=>{if(!l||(console.log("formValues: ".concat(e)),null==e||void 0==e))return;let t={};s.forEach(e=>{t[e.field_name]=e.field_value});let a={...e,...t};console.log("mergedFormValues: ".concat(JSON.stringify(a)));let{slack_alerting:n,...r}=a;console.log("slack_alerting: ".concat(n,", alertingArgs: ").concat(JSON.stringify(r)));try{(0,P.updateConfigFieldSetting)(l,"alerting_args",r),"boolean"==typeof n&&(!0==n?(0,P.updateConfigFieldSetting)(l,"alerting",["slack"]):(0,P.updateConfigFieldSetting)(l,"alerting",[])),E.Z.success("Wait 10s for proxy to update.")}catch(e){}},premiumUser:t})},J=t(11713),K=t(29827),V=t(21770),G=t(90246);let Q=(0,G.n)("cloudZeroSettings"),X=async e=>{let l=(0,P.getProxyBaseUrl)(),t=await fetch(l?"".concat(l,"/cloudzero/settings"):"/cloudzero/settings",{method:"GET",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e="Failed to fetch CloudZero settings";try{let l=await t.json();if("object"==typeof l&&null!==l){var a;e=(null==l?void 0:null===(a=l.error)||void 0===a?void 0:a.message)||(null==l?void 0:l.error)||(null==l?void 0:l.message)||(null==l?void 0:l.detail)||("string"==typeof(null==l?void 0:l.error)?l.error:e)}else"string"==typeof l&&(e=l)}catch(l){e=t.statusText||e}throw Error(e)}let s=await t.json();return s&&(s.api_key_masked||s.connection_id)?s:null},Y=e=>(0,J.a)({queryKey:Q.list({}),queryFn:async()=>await X(e),enabled:!!e&&!!(0,P.getProxyBaseUrl)(),staleTime:36e5,gcTime:36e5}),$=async(e,l)=>{let t=(0,P.getProxyBaseUrl)(),a=await fetch(t?"".concat(t,"/cloudzero/settings"):"/cloudzero/settings",{method:"PUT",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({...l.connection_id&&{connection_id:l.connection_id},...l.timezone&&{timezone:l.timezone},...l.api_key&&{api_key:l.api_key}})});if(!a.ok){let e="Failed to update CloudZero settings";try{let l=await a.json();if("object"==typeof l&&null!==l){var s;e=(null==l?void 0:null===(s=l.error)||void 0===s?void 0:s.message)||(null==l?void 0:l.error)||(null==l?void 0:l.message)||(null==l?void 0:l.detail)||("string"==typeof(null==l?void 0:l.error)?l.error:e)}else"string"==typeof l&&(e=l)}catch(l){e=a.statusText||e}throw Error(e)}return await a.json()},ee=e=>{let l=(0,K.NL)();return(0,V.D)({mutationFn:async l=>{if(!e)throw Error("Access token is required");return await $(e,l)},onSuccess:()=>{l.invalidateQueries({queryKey:Q.list({})})}})},el=async e=>{let l=(0,P.getProxyBaseUrl)(),t=await fetch(l?"".concat(l,"/cloudzero/delete"):"/cloudzero/delete",{method:"DELETE",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}});if(!t.ok){let e="Failed to delete CloudZero settings";try{let l=await t.json();if("object"==typeof l&&null!==l){var a;e=(null==l?void 0:null===(a=l.error)||void 0===a?void 0:a.message)||(null==l?void 0:l.error)||(null==l?void 0:l.message)||(null==l?void 0:l.detail)||("string"==typeof(null==l?void 0:l.error)?l.error:e)}else"string"==typeof l&&(e=l)}catch(l){e=t.statusText||e}throw Error(e)}return await t.json()},et=e=>{let l=(0,K.NL)();return(0,V.D)({mutationFn:async()=>{if(!e)throw Error("Access token is required");return await el(e)},onSuccess:()=>{l.invalidateQueries({queryKey:Q.list({})})}})};var ea=t(39760),es=t(5945),en=t(85180);let{Title:er,Paragraph:ei}=C.default;function eo(e){let{startCreation:l}=e;return(0,a.jsx)("div",{className:"bg-white p-12 rounded-lg border border-dashed border-gray-300 text-center max-w-2xl mx-auto mt-8",children:(0,a.jsx)(en.Z,{image:en.Z.PRESENTED_IMAGE_SIMPLE,description:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(er,{level:4,children:"No CloudZero Integration Found"}),(0,a.jsx)(ei,{type:"secondary",className:"max-w-md mx-auto",children:"Connect your CloudZero account to start tracking and analyzing your cloud costs directly from LiteLLM."})]}),children:(0,a.jsx)(S.ZP,{type:"primary",size:"large",onClick:l,className:"flex items-center gap-2 mx-auto mt-4",children:"Add CloudZero Integration"})})})}var ec=t(42264);let ed=async(e,l)=>{var t,a;let s=(0,P.getProxyBaseUrl)(),n=await fetch(s?"".concat(s,"/cloudzero/init"):"/cloudzero/init",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({connection_id:l.connection_id,timezone:null!==(t=l.timezone)&&void 0!==t?t:"UTC",...l.api_key&&{api_key:l.api_key}})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error((null==e?void 0:null===(a=e.error)||void 0===a?void 0:a.message)||(null==e?void 0:e.message)||(null==e?void 0:e.detail)||"Failed to create CloudZero integration")}return await n.json()},eu=e=>(0,V.D)({mutationFn:async l=>{if(!e)throw Error("Access token is required");return await ed(e,l)}});function em(e){let{open:l,onOk:t,onCancel:s}=e,{accessToken:n}=(0,ea.Z)(),[r]=w.Z.useForm(),i=eu(n||"");(0,Z.useEffect)(()=>{l&&r.resetFields()},[l,r]);let o=async()=>{try{let e=await r.validateFields();i.mutate({connection_id:e.connection_id,timezone:e.timezone||"UTC",...e.api_key&&{api_key:e.api_key}},{onSuccess:()=>{ec.ZP.success("CloudZero integration created successfully"),r.resetFields(),t()},onError:e=>{null!=e&&e.errorFields||ec.ZP.error((null==e?void 0:e.message)||"Failed to create CloudZero integration")}})}catch(e){if(null==e?void 0:e.errorFields)return;ec.ZP.error((null==e?void 0:e.message)||"Failed to create CloudZero integration")}};return(0,a.jsx)(N.Z,{title:"Create CloudZero Integration",open:l,onOk:o,onCancel:()=>{r.resetFields(),s()},confirmLoading:i.isPending,okText:i.isPending?"Creating...":"Create",cancelText:"Cancel",okButtonProps:{disabled:i.isPending},cancelButtonProps:{disabled:i.isPending},children:(0,a.jsxs)(w.Z,{form:r,layout:"vertical",onFinish:o,children:[(0,a.jsx)(w.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!0,message:"Please enter your CloudZero API key"}],children:(0,a.jsx)(k.default.Password,{placeholder:"Enter your CloudZero API key"})}),(0,a.jsx)(w.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter your CloudZero connection ID"}],children:(0,a.jsx)(k.default,{placeholder:"Enter your CloudZero connection ID"})}),(0,a.jsx)(w.Z.Item,{label:"Timezone",name:"timezone",tooltip:"Timezone for date handling (defaults to UTC if not provided)",children:(0,a.jsx)(k.default,{placeholder:"UTC"})})]})})}let eh=async function(e){var l,t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=(0,P.getProxyBaseUrl)(),n=await fetch(s?"".concat(s,"/cloudzero/dry-run"):"/cloudzero/dry-run",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({limit:null!==(l=a.limit)&&void 0!==l?l:10})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error((null==e?void 0:null===(t=e.error)||void 0===t?void 0:t.message)||(null==e?void 0:e.message)||(null==e?void 0:e.detail)||"Failed to perform dry run")}return await n.json()},eg=e=>(0,V.D)({mutationFn:async function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)throw Error("Access token is required");return await eh(e,l)}}),ex=async function(e){var l,t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=(0,P.getProxyBaseUrl)(),n=await fetch(s?"".concat(s,"/cloudzero/export"):"/cloudzero/export",{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({operation:null!==(l=a.operation)&&void 0!==l?l:"replace_hourly"})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error((null==e?void 0:null===(t=e.error)||void 0===t?void 0:t.message)||(null==e?void 0:e.message)||(null==e?void 0:e.detail)||"Failed to export data")}return await n.json()},ef=e=>(0,V.D)({mutationFn:async function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)throw Error("Access token is required");return await ex(e,l)}});var ep=t(21609),ey=t(3810),ej=t(76188),ev=t(867),eb=t(51653),eZ=t(15868),eC=t(18930),ek=t(33276),e_=t(17689),ew=t(41671);function eN(e){let{open:l,onOk:t,onCancel:s,settings:n}=e,{accessToken:r}=(0,ea.Z)(),[i]=w.Z.useForm(),o=ee(r||"");(0,Z.useEffect)(()=>{l&&n?i.setFieldsValue({connection_id:n.connection_id,timezone:n.timezone||"UTC",api_key:""}):l&&i.resetFields()},[l,n,i]);let c=async()=>{try{let e=await i.validateFields();o.mutate({connection_id:e.connection_id,timezone:e.timezone||"UTC",...e.api_key&&{api_key:e.api_key}},{onSuccess:()=>{ec.ZP.success("CloudZero integration updated successfully"),i.resetFields(),t()},onError:e=>{null!=e&&e.errorFields||ec.ZP.error((null==e?void 0:e.message)||"Failed to update CloudZero integration")}})}catch(e){if(null==e?void 0:e.errorFields)return;ec.ZP.error((null==e?void 0:e.message)||"Failed to update CloudZero integration")}};return(0,a.jsx)(N.Z,{title:"Edit CloudZero Integration",open:l,onOk:c,onCancel:()=>{i.resetFields(),s()},confirmLoading:o.isPending,okText:o.isPending?"Updating...":"Update",cancelText:"Cancel",okButtonProps:{disabled:o.isPending},cancelButtonProps:{disabled:o.isPending},children:(0,a.jsxs)(w.Z,{form:i,layout:"vertical",onFinish:c,children:[(0,a.jsx)(w.Z.Item,{label:"CloudZero API Key",name:"api_key",rules:[{required:!1,message:"Please enter your CloudZero API key"}],tooltip:"Leave empty to keep the existing API key",children:(0,a.jsx)(k.default.Password,{placeholder:"Leave empty to keep existing"})}),(0,a.jsx)(w.Z.Item,{label:"Connection ID",name:"connection_id",rules:[{required:!0,message:"Please enter your CloudZero connection ID"}],children:(0,a.jsx)(k.default,{placeholder:"Enter your CloudZero connection ID"})}),(0,a.jsx)(w.Z.Item,{label:"Timezone",name:"timezone",tooltip:"Timezone for date handling (defaults to UTC if not provided)",children:(0,a.jsx)(k.default,{placeholder:"UTC"})})]})})}function eS(e){let{settings:l,onSettingsUpdated:t}=e,{accessToken:s}=(0,ea.Z)(),[n,r]=(0,Z.useState)(!1),[i,o]=(0,Z.useState)(!1),c=eg(s||""),d=ef(s||""),u=et(s||""),m=c.data?JSON.stringify(c.data,null,2):null,h=async()=>{r(!1),t()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"space-y-6 w-full max-w-4xl mx-auto",children:(0,a.jsxs)(es.Z,{title:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg font-semibold",children:"CloudZero Configuration"}),(0,a.jsx)(ey.Z,{color:"success",className:"ml-2 capitalize",children:l.status||"Active"})]}),extra:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(S.ZP,{icon:(0,a.jsx)(eZ.Z,{size:16}),onClick:()=>{r(!0)},className:"flex items-center gap-2",children:"Edit"}),(0,a.jsx)(S.ZP,{danger:!0,icon:(0,a.jsx)(eC.Z,{size:16}),onClick:()=>{o(!0)},className:"flex items-center gap-2",children:"Delete"})]}),className:"shadow-sm",children:[(0,a.jsxs)(ej.Z,{bordered:!0,column:{xxl:1,xl:1,lg:1,md:1,sm:1,xs:1},children:[(0,a.jsx)(ej.Z.Item,{label:"API Key (Redacted)",children:(0,a.jsx)("span",{className:"font-mono text-gray-600",children:l.api_key_masked||(0,a.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})})}),(0,a.jsx)(ej.Z.Item,{label:"Connection ID",children:(0,a.jsx)("span",{className:"font-mono text-gray-600",children:l.connection_id||(0,a.jsx)("span",{className:"text-gray-400 italic",children:"Not configured"})})}),(0,a.jsx)(ej.Z.Item,{label:"Timezone",children:l.timezone||(0,a.jsx)("span",{className:"text-gray-400 italic",children:"Default (UTC)"})})]}),(0,a.jsx)(T.Z,{orientation:"left",className:"text-gray-500",children:"Actions"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 mb-6",children:[(0,a.jsx)(S.ZP,{onClick:()=>{s&&c.mutate({limit:10},{onSuccess:e=>{ec.ZP.success("Dry run completed successfully")},onError:e=>{ec.ZP.error((null==e?void 0:e.message)||"Failed to perform dry run")}})},loading:c.isPending,icon:(0,a.jsx)(ek.Z,{size:16}),className:"flex items-center gap-2",children:"Run Dry Run Simulation"}),(0,a.jsx)(ev.Z,{title:"Export Data to CloudZero",description:"This will push the current accumulated cost data to CloudZero. Continue?",onConfirm:()=>{s&&d.mutate({operation:"replace_hourly"},{onSuccess:()=>{ec.ZP.success("Data successfully exported to CloudZero")},onError:e=>{ec.ZP.error((null==e?void 0:e.message)||"Failed to export data")}})},okText:"Export",cancelText:"Cancel",children:(0,a.jsx)(S.ZP,{type:"primary",loading:d.isPending,icon:(0,a.jsx)(e_.Z,{size:16}),className:"flex items-center gap-2",children:"Export Data Now"})})]}),m&&(0,a.jsx)("div",{className:"mt-6 animate-in fade-in slide-in-from-top-4 duration-300",children:(0,a.jsx)(eb.Z,{message:"Dry Run Results",description:(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("p",{className:"mb-2 text-gray-600",children:["Simulation output for connection: ",l.connection_id]}),(0,a.jsx)("pre",{className:"bg-gray-50 p-4 rounded-md border border-gray-200 overflow-x-auto text-xs font-mono text-gray-800",children:m})]}),type:"info",showIcon:!0,icon:(0,a.jsx)(ew.Z,{className:"text-blue-500"})})})]})}),(0,a.jsx)(eN,{open:n,onOk:h,onCancel:()=>{r(!1)},settings:l}),(0,a.jsx)(ep.Z,{isOpen:i,title:"Delete CloudZero Integration?",message:"Are you sure you want to delete this CloudZero integration? All associated settings and configurations will be permanently removed.",resourceInformationTitle:"Integration Details",resourceInformation:[{label:"Connection ID",value:l.connection_id,code:!0},{label:"Timezone",value:l.timezone||"Default (UTC)"}],onCancel:()=>{o(!1)},onOk:()=>{s&&u.mutate(void 0,{onSuccess:()=>{ec.ZP.success("CloudZero integration deleted successfully"),o(!1),t()},onError:e=>{ec.ZP.error((null==e?void 0:e.message)||"Failed to delete CloudZero integration")}})},confirmLoading:u.isPending})]})}function eE(){let{accessToken:e}=(0,ea.Z)(),{data:l,isLoading:t,error:s}=Y(e),n=(0,K.NL)(),r=(0,G.n)("cloudZeroSettings"),[i,o]=(0,Z.useState)(!1),c=async()=>{o(!1),await n.invalidateQueries({queryKey:r.list({})})};return t?(0,a.jsx)(es.Z,{children:(0,a.jsx)(C.default.Text,{children:"Loading CloudZero settings..."})}):s?(0,a.jsx)(es.Z,{children:(0,a.jsxs)(C.default.Text,{className:"text-red-600",children:["Error loading CloudZero settings: ",s instanceof Error?s.message:String(s)]})}):l?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(eS,{settings:l,onSettingsUpdated:c})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eo,{startCreation:()=>o(!0)}),(0,a.jsx)(em,{open:i,onOk:c,onCancel:()=>{o(!1)}})]})}var eP=t(16312),eT=t(56609),eF=t(6833),eA=t(39957);let eI=[{value:"success",label:"Success"},{value:"failure",label:"Failure"},{value:"success_and_failure",label:"Success & Failure"}],ez=e=>{let{callbacks:l,availableCallbacks:t={},onTest:s=()=>{},onEdit:n=()=>{},onDelete:r=()=>{},onAdd:i=()=>{}}=e,o=[{title:(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Callback Name"}),dataIndex:"name",key:"name",render:(e,l)=>{var s;let n=l.name;console.log("availableCallbacks",t);let r=(null===(s=t[n])||void 0===s?void 0:s.ui_callback_name)||n;return(0,a.jsx)("div",{className:"font-medium text-gray-800",children:r})}},{title:(0,a.jsx)("span",{className:"font-medium text-gray-700",children:"Mode"}),key:"mode",render:(e,l)=>{var t;let s=l.mode||"success",n=(null===(t=eI.find(e=>e.value===s))||void 0===t?void 0:t.label)||s,r="success"===s?"bg-green-100 text-green-800":"failure"===s?"bg-red-100 text-red-800":"bg-blue-100 text-blue-800";return(0,a.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ".concat(r),children:n})},width:240},{title:(0,a.jsx)("span",{className:"font-medium text-gray-700 text-right w-full block",children:"Actions"}),key:"actions",align:"right",render:(e,l)=>(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(eA.Z,{variant:"Test",tooltipText:"Test Callback",onClick:()=>s(l)}),(0,a.jsx)(eA.Z,{variant:"Edit",tooltipText:"Edit Callback",onClick:()=>n(l)}),(0,a.jsx)(eA.Z,{variant:"Delete",tooltipText:"Delete Callback",onClick:()=>r(l)})]}),width:240}];return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"w-full mt-4",children:[(0,a.jsx)(eP.z,{onClick:i,className:"mx-auto",children:"+ Add Callback"}),(0,a.jsx)("div",{className:"flex justify-between items-center my-2",children:(0,a.jsx)(eF.Z,{level:4,children:"Active Logging Callbacks"})}),0===l.length?(0,a.jsx)("div",{className:"flex flex-col items-center justify-center p-8 bg-gray-50 border border-gray-200 rounded-lg",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-700 mb-2",children:"No callbacks configured"}),(0,a.jsx)("p",{className:"text-gray-500",children:"Add your first callback to start logging data to external services."})]})}):(0,a.jsx)("div",{className:"bg-white border border-gray-200 rounded-lg overflow-hidden",children:(0,a.jsx)(eT.Z,{columns:o,dataSource:l,rowKey:e=>e.name,pagination:!1,rowClassName:()=>"hover:bg-gray-50"})})]})})};var eO=t(85968);let{Title:eL,Paragraph:eD}=C.default,eU=e=>{let{params:l,callbackConfigs:t,selectedCallback:s}=e;return l&&0!==l.length?(0,a.jsx)("div",{className:"space-y-4 mt-6 p-4 bg-gray-50 rounded-lg border",children:l.map(e=>{var l;let n=t.find(e=>e.id===s),r=(null==n?void 0:null===(l=n.dynamic_params)||void 0===l?void 0:l[e])||{},i=r.type||"text",o=r.ui_name||e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()),c=r.required||!1;return(0,a.jsx)(D.Z,{label:(0,a.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[o," "]}),name:e,className:"mb-4",rules:c?[{required:!0,message:"Please enter the ".concat(o.toLowerCase())}]:void 0,children:"password"===i?(0,a.jsx)(k.default.Password,{size:"large",placeholder:"Enter your ".concat(o.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}):"number"===i?(0,a.jsx)(k.default,{type:"number",size:"large",placeholder:"Enter ".concat(o.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",min:0,max:1,step:.1}):(0,a.jsx)(k.default,{size:"large",placeholder:"Enter your ".concat(o.toLowerCase()),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})},e)})}):null},eR=e=>{let{callbackConfigs:l,selectedCallback:t,onCallbackChange:s,disabled:n=!1}=e;return(0,a.jsx)(D.Z,{label:"Callback",name:"callback",rules:n?void 0:[{required:!0,message:"Please select a callback"}],children:(0,a.jsx)(_.default,{placeholder:"Choose a logging callback...",size:"large",className:"w-full",showSearch:!0,disabled:n,value:t,filterOption:(e,l)=>{var t,a;return(null!==(a=null==l?void 0:null===(t=l.value)||void 0===t?void 0:t.toString())&&void 0!==a?a:"").toLowerCase().includes(e.toLowerCase())},onChange:s,children:l.map(e=>{let l=e.logo,t=l&&(l.includes("/")||l.startsWith("data:")||l.startsWith("http"))?l:"".concat("../ui/assets/logos/").concat(l);return(0,a.jsx)(i.Z,{value:e.id,children:(0,a.jsxs)("div",{className:"flex items-center space-x-3 py-1",children:[(0,a.jsx)("div",{className:"w-6 h-6 flex items-center justify-center",children:(0,a.jsx)("img",{src:t,alt:"".concat(e.displayName," logo"),className:"w-6 h-6 rounded object-contain",onError:e=>{e.currentTarget.style.display="none"}})}),(0,a.jsx)("span",{className:"font-medium text-gray-900",children:e.displayName})]})},e.id)})})})},eB=(e,l,t)=>{if(!e)return t?Object.keys(t):[];let a=l.find(l=>l.id===e);return(null==a?void 0:a.dynamic_params)?Object.keys(a.dynamic_params):t?Object.keys(t):[]},eq=(e,l)=>({environment_variables:e,litellm_settings:{success_callback:[l]}});var eM=e=>{let{accessToken:l,userRole:t,userID:i,premiumUser:C}=e,[k,_]=(0,Z.useState)([]),[T,F]=(0,Z.useState)([]),[A,I]=(0,Z.useState)(!1),[z]=w.Z.useForm(),[O]=w.Z.useForm(),[D,U]=(0,Z.useState)(null),[R,B]=(0,Z.useState)(""),[q,M]=(0,Z.useState)({}),[W,J]=(0,Z.useState)([]),[K,V]=(0,Z.useState)(!1),[G,Q]=(0,Z.useState)([]),[X,Y]=(0,Z.useState)({}),[$,ee]=(0,Z.useState)([]),[el,et]=(0,Z.useState)(!1),[ea,es]=(0,Z.useState)(null),[en,er]=(0,Z.useState)(!1),[ei,eo]=(0,Z.useState)(null),[ec,ed]=(0,Z.useState)(!1),[eu,em]=(0,Z.useState)(!1),[eh,eg]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{l&&(0,P.getCallbackConfigsCall)(l).then(e=>{Q(e||[])}).catch(e=>{E.Z.fromBackend("Failed to load callback configs: "+(0,eO.O)(e))})},[l]),(0,Z.useEffect)(()=>{if(el&&ea){let e=Object.fromEntries(Object.entries(ea.variables||{}).map(e=>{let[l,t]=e;return[l,null!=t?t:""]}));O.setFieldsValue({...e,callback:ea.name})}},[el,ea,O]);let ex=e=>{W.includes(e)?J(W.filter(l=>l!==e)):J([...W,e])},ef={llm_exceptions:"LLM Exceptions",llm_too_slow:"LLM Responses Too Slow",llm_requests_hanging:"LLM Requests Hanging",budget_alerts:"Budget Alerts (API Keys, Users)",db_exceptions:"Database Exceptions (Read/Write)",daily_reports:"Weekly/Monthly Spend Reports",outage_alerts:"Outage Alerts",region_outage_alerts:"Region Outage Alerts"};(0,Z.useEffect)(()=>{l&&t&&i&&(0,P.getCallbacksCall)(l,i,t).then(e=>{_(e.callbacks),Y(e.available_callbacks);let l=e.alerts;if(l&&l.length>0){let e=l[0],t=e.variables.SLACK_WEBHOOK_URL;J(e.active_alerts),B(t),M(e.alerts_to_webhook)}F(l)})},[l,t,i]);let ey=e=>W&&W.includes(e),ej=async(e,a,s)=>{if(!l)return;s?ed(!0):em(!0);let n=eq(e,a);try{if(await (0,P.setCallbacksCall)(l,n),E.Z.success(s?"Callback updated successfully":"Callback ".concat(a," added successfully")),s?(et(!1),O.resetFields(),es(null)):(V(!1),z.resetFields(),U(null),ee([])),i&&t){let e=await (0,P.getCallbacksCall)(l,i,t);_(e.callbacks)}}catch(e){E.Z.fromBackend(e)}finally{s?ed(!1):em(!1)}},ev=async e=>{ea&&await ej(e,ea.name,!0)},eb=async e=>{let l=null==e?void 0:e.callback;l&&await ej(e,l,!1)},eZ=async()=>{if(!l)return;let e={};Object.entries(ef).forEach(l=>{let[t,a]=l,s=document.querySelector('input[name="'.concat(t,'"]')),n=(null==s?void 0:s.value)||"";e[t]=n});try{await (0,P.setCallbacksCall)(l,{general_settings:{alert_to_webhook_url:e,alert_types:W}})}catch(e){E.Z.fromBackend(e)}E.Z.success("Alerts updated successfully")},eC=e=>{eo(e),er(!0)},ek=async()=>{if(ei&&l)try{if(eg(!0),await (0,P.deleteCallback)(l,ei.name),E.Z.success("Callback ".concat(ei.name," deleted successfully")),i&&t){let e=await (0,P.getCallbacksCall)(l,i,t);_(e.callbacks)}er(!1),eo(null)}catch(e){console.error("Failed to delete callback:",e),E.Z.fromBackend(e)}finally{eg(!1)}};return l?(0,a.jsxs)("div",{className:"w-full mx-4",children:[(0,a.jsx)(r.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,a.jsxs)(d.Z,{children:[(0,a.jsxs)(u.Z,{variant:"line",defaultValue:"1",children:[(0,a.jsx)(c.Z,{value:"1",children:"Logging Callbacks"}),(0,a.jsx)(c.Z,{value:"2",children:"CloudZero Cost Tracking"}),(0,a.jsx)(c.Z,{value:"2",children:"Alerting Types"}),(0,a.jsx)(c.Z,{value:"3",children:"Alerting Settings"}),(0,a.jsx)(c.Z,{value:"4",children:"Email Alerts"})]}),(0,a.jsxs)(h.Z,{children:[(0,a.jsx)(m.Z,{children:(0,a.jsx)(ez,{callbacks:k,availableCallbacks:X,onAdd:()=>V(!0),onEdit:e=>{es(e),et(!0)},onDelete:e=>eC(e),onTest:async e=>{try{await (0,P.serviceHealthCheck)(l,e.name),E.Z.success("Health check triggered")}catch(e){E.Z.fromBackend((0,eO.O)(e))}}})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)("div",{className:"p-8",children:(0,a.jsx)(eE,{})})}),(0,a.jsx)(m.Z,{children:(0,a.jsxs)(n.Z,{children:[(0,a.jsxs)(v.Z,{className:"my-2",children:["Alerts are only supported for Slack Webhook URLs. Get your webhook urls from"," ",(0,a.jsx)("a",{href:"https://api.slack.com/messaging/webhooks",target:"_blank",style:{color:"blue"},children:"here"})]}),(0,a.jsxs)(g.Z,{children:[(0,a.jsx)(p.Z,{children:(0,a.jsxs)(j.Z,{children:[(0,a.jsx)(y.Z,{}),(0,a.jsx)(y.Z,{}),(0,a.jsx)(y.Z,{children:"Slack Webhook URL"})]})}),(0,a.jsx)(x.Z,{children:Object.entries(ef).map((e,l)=>{let[t,n]=e;return(0,a.jsxs)(j.Z,{children:[(0,a.jsx)(f.Z,{children:"region_outage_alerts"==t?C?(0,a.jsx)(o.Z,{id:"switch",name:"switch",checked:ey(t),onChange:()=>ex(t)}):(0,a.jsx)(s.Z,{className:"flex items-center justify-center",children:(0,a.jsx)("a",{href:"https://forms.gle/W3U4PZpJGFHWtHyA9",target:"_blank",children:"✨ Enterprise Feature"})}):(0,a.jsx)(o.Z,{id:"switch",name:"switch",checked:ey(t),onChange:()=>ex(t)})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(v.Z,{children:n})}),(0,a.jsx)(f.Z,{children:(0,a.jsx)(b.Z,{name:t,type:"password",defaultValue:q&&q[t]?q[t]:R})})]},l)})})]}),(0,a.jsx)(s.Z,{size:"xs",className:"mt-2",onClick:eZ,children:"Save Changes"}),(0,a.jsx)(s.Z,{onClick:async()=>{try{await (0,P.serviceHealthCheck)(l,"slack"),E.Z.success("Alert test triggered. Test request to slack made - check logs/alerts on slack to verify")}catch(e){E.Z.fromBackend((0,eO.O)(e))}},className:"mx-2",children:"Test Alerts"})]})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(H,{accessToken:l,premiumUser:C})}),(0,a.jsx)(m.Z,{children:(0,a.jsx)(L,{accessToken:l,premiumUser:C,alerts:T})})]})]})}),(0,a.jsxs)(N.Z,{title:"Add Logging Callback",open:K,width:800,onCancel:()=>{V(!1),U(null),ee([])},footer:null,children:[(0,a.jsxs)("a",{href:"https://docs.litellm.ai/docs/proxy/logging",className:"mb-8 mt-4",target:"_blank",style:{color:"blue"},children:[" ","LiteLLM Docs: Logging"]}),(0,a.jsxs)(w.Z,{form:z,onFinish:eb,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,a.jsx)(eR,{callbackConfigs:G,selectedCallback:D,onCallbackChange:e=>{U(e),ee(eB(e,G))}}),(0,a.jsx)(eU,{params:$,callbackConfigs:G,selectedCallback:D}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,a.jsx)(S.ZP,{onClick:()=>{V(!1),U(null),ee([]),z.resetFields()},disabled:eu,children:"Cancel"}),(0,a.jsx)(S.ZP,{htmlType:"submit",loading:eu,disabled:eu,children:eu?"Adding...":"Add Callback"})]})]})]}),(0,a.jsx)(N.Z,{open:el,width:800,title:"Edit Callback Settings",onCancel:()=>{et(!1),es(null),O.resetFields()},footer:null,children:(0,a.jsxs)(w.Z,{form:O,onFinish:ev,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[ea&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eR,{callbackConfigs:G,selectedCallback:ea.name,onCallbackChange:()=>{},disabled:!0}),(0,a.jsx)(eU,{params:eB(ea.name,G,ea.variables),callbackConfigs:G,selectedCallback:ea.name})]}),(0,a.jsxs)("div",{className:"flex justify-end space-x-3 pt-6 mt-6 border-t border-gray-200",children:[(0,a.jsx)(S.ZP,{onClick:()=>{et(!1),es(null),O.resetFields()},disabled:ec,children:"Cancel"}),(0,a.jsx)(S.ZP,{onClick:()=>{O.submit()},loading:ec,disabled:ec,children:ec?"Saving...":"Save Changes"})]})]})}),(0,a.jsx)(ep.Z,{isOpen:en,title:"Delete Callback",message:"Are you sure you want to delete this callback? This action cannot be undone.",resourceInformationTitle:"Callback Information",resourceInformation:[{label:"Callback Name",value:null==ei?void 0:ei.name},{label:"Mode",value:(null==ei?void 0:ei.mode)||"success"}],onCancel:()=>{er(!1),eo(null)},onOk:ek,confirmLoading:eh})]}):null}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/9409-6eefc92a7f8433ff.js b/litellm/proxy/_experimental/out/_next/static/chunks/9409-6eefc92a7f8433ff.js deleted file mode 100644 index d978a180535..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/9409-6eefc92a7f8433ff.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9409],{57943:function(e,t,n){"use strict";n.d(t,{iN:function(){return b},R_:function(){return l},EV:function(){return p},Ti:function(){return C},ez:function(){return s}});var r=n(54558),o=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function a(e,t,n){var r;return(r=Math.round(e.h)>=60&&240>=Math.round(e.h)?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function i(e,t,n){var r;return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(100*r)/100)}function c(e,t,n){return Math.round(100*Math.max(0,Math.min(1,n?e.v+.05*t:e.v-.15*t)))/100}function l(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],l=new r.t(e),s=l.toHsv(),u=5;u>0;u-=1){var d=new r.t({h:a(s,u,!0),s:i(s,u,!0),v:c(s,u,!0)});n.push(d)}n.push(l);for(var f=1;f<=4;f+=1){var p=new r.t({h:a(s,f),s:i(s,f),v:c(s,f)});n.push(p)}return"dark"===t.theme?o.map(function(e){var o=e.index,a=e.amount;return new r.t(t.backgroundColor||"#141414").mix(n[o],a).toHexString()}):n.map(function(e){return e.toHexString()})}var s={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},u=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];u.primary=u[5];var d=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];d.primary=d[5];var f=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];f.primary=f[5];var p=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];p.primary=p[5];var m=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];m.primary=m[5];var g=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];g.primary=g[5];var v=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];v.primary=v[5];var h=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];h.primary=h[5];var b=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];b.primary=b[5];var y=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];y.primary=y[5];var x=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];x.primary=x[5];var w=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];w.primary=w[5];var E=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];E.primary=E[5];var C={red:u,volcano:d,orange:f,gold:p,yellow:m,lime:g,green:v,cyan:h,blue:b,geekblue:y,purple:x,magenta:w,grey:E},Z=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];Z.primary=Z[5];var S=["#2b1611","#441d12","#592716","#7c3118","#aa3e19","#d84a1b","#e87040","#f3956a","#f8b692","#fad4bc"];S.primary=S[5];var O=["#2b1d11","#442a11","#593815","#7c4a15","#aa6215","#d87a16","#e89a3c","#f3b765","#f8cf8d","#fae3b7"];O.primary=O[5];var k=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];k.primary=k[5];var j=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];j.primary=j[5];var I=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];I.primary=I[5];var M=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];M.primary=M[5];var R=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];R.primary=R[5];var N=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];N.primary=N[5];var P=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];P.primary=P[5];var F=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];F.primary=F[5];var T=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];T.primary=T[5];var A=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];A.primary=A[5]},71140:function(e,t,n){"use strict";n.d(t,{rb:function(){return N},IX:function(){return S}});var r=n(41154),o=n(26365),a=n(11993),i=n(31686),c=n(2265),l=n(93463),s=n(76405),u=n(25049),d=n(63496),f=n(41690),p=n(15900),m=(0,u.Z)(function e(){(0,s.Z)(this,e)}),g="CALC_UNIT",v=RegExp(g,"g");function h(e){return"number"==typeof e?"".concat(e).concat(g):e}var b=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e,o){(0,s.Z)(this,n),i=t.call(this),(0,a.Z)((0,d.Z)(i),"result",""),(0,a.Z)((0,d.Z)(i),"unitlessCssVar",void 0),(0,a.Z)((0,d.Z)(i),"lowPriority",void 0);var i,c=(0,r.Z)(e);return i.unitlessCssVar=o,e instanceof n?i.result="(".concat(e.result,")"):"number"===c?i.result=h(e):"string"===c&&(i.result=e),i}return(0,u.Z)(n,[{key:"add",value:function(e){return e instanceof n?this.result="".concat(this.result," + ").concat(e.getResult()):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," + ").concat(h(e))),this.lowPriority=!0,this}},{key:"sub",value:function(e){return e instanceof n?this.result="".concat(this.result," - ").concat(e.getResult()):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," - ").concat(h(e))),this.lowPriority=!0,this}},{key:"mul",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof n?this.result="".concat(this.result," * ").concat(e.getResult(!0)):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," * ").concat(e)),this.lowPriority=!1,this}},{key:"div",value:function(e){return this.lowPriority&&(this.result="(".concat(this.result,")")),e instanceof n?this.result="".concat(this.result," / ").concat(e.getResult(!0)):("number"==typeof e||"string"==typeof e)&&(this.result="".concat(this.result," / ").concat(e)),this.lowPriority=!1,this}},{key:"getResult",value:function(e){return this.lowPriority||e?"(".concat(this.result,")"):this.result}},{key:"equal",value:function(e){var t=this,n=(e||{}).unit,r=!0;return("boolean"==typeof n?r=n:Array.from(this.unitlessCssVar).some(function(e){return t.result.includes(e)})&&(r=!1),this.result=this.result.replace(v,r?"px":""),void 0!==this.lowPriority)?"calc(".concat(this.result,")"):this.result}}]),n}(m),y=function(e){(0,f.Z)(n,e);var t=(0,p.Z)(n);function n(e){var r;return(0,s.Z)(this,n),r=t.call(this),(0,a.Z)((0,d.Z)(r),"result",0),e instanceof n?r.result=e.result:"number"==typeof e&&(r.result=e),r}return(0,u.Z)(n,[{key:"add",value:function(e){return e instanceof n?this.result+=e.result:"number"==typeof e&&(this.result+=e),this}},{key:"sub",value:function(e){return e instanceof n?this.result-=e.result:"number"==typeof e&&(this.result-=e),this}},{key:"mul",value:function(e){return e instanceof n?this.result*=e.result:"number"==typeof e&&(this.result*=e),this}},{key:"div",value:function(e){return e instanceof n?this.result/=e.result:"number"==typeof e&&(this.result/=e),this}},{key:"equal",value:function(){return this.result}}]),n}(m),x=function(e,t){var n="css"===e?b:y;return function(e){return new n(e,t)}},w=function(e,t){return"".concat([t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2")].filter(Boolean).join("-"))};n(74126);var E=function(e,t,n,r){var a=(0,i.Z)({},t[e]);null!=r&&r.deprecatedTokens&&r.deprecatedTokens.forEach(function(e){var t,n=(0,o.Z)(e,2),r=n[0],i=n[1];(null!=a&&a[r]||null!=a&&a[i])&&(null!==(t=a[i])&&void 0!==t||(a[i]=null==a?void 0:a[r]))});var c=(0,i.Z)((0,i.Z)({},n),a);return Object.keys(c).forEach(function(e){c[e]===t[e]&&delete c[e]}),c},C="undefined"!=typeof CSSINJS_STATISTIC,Z=!0;function S(){for(var e=arguments.length,t=Array(e),n=0;n1e4){var t=Date.now();this.lastAccessBeat.forEach(function(n,r){t-n>6e5&&(e.map.delete(r),e.lastAccessBeat.delete(r))}),this.accessBeat=0}}}]),e}()),R=function(){return{}},N=function(e){var t=e.useCSP,n=void 0===t?R:t,s=e.useToken,u=e.usePrefix,d=e.getResetStyles,f=e.getCommonStyle,p=e.getCompUnitless;function m(t,a,p){var m=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},g=Array.isArray(t)?t:[t,t],v=(0,o.Z)(g,1)[0],h=g.join("-"),b=e.layer||{name:"antd"};return function(e){var t,o,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,y=s(),C=y.theme,Z=y.realToken,O=y.hashId,k=y.token,R=y.cssVar,N=u(),P=N.rootPrefixCls,F=N.iconPrefixCls,T=n(),A=R?"css":"js",_=(t=function(){var e=new Set;return R&&Object.keys(m.unitless||{}).forEach(function(t){e.add((0,l.ks)(t,R.prefix)),e.add((0,l.ks)(t,w(v,R.prefix)))}),x(A,e)},o=[A,v,null==R?void 0:R.prefix],c.useMemo(function(){var e=M.get(o);if(e)return e;var n=t();return M.set(o,n),n},o)),B="js"===A?{max:Math.max,min:Math.min}:{max:function(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:e,n=S(e,t),r=(0,o.Z)(n,2)[1],a=O(t),i=(0,o.Z)(a,2);return[i[0],r,i[1]]}},genSubStyleComponent:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=m(e,t,n,(0,i.Z)({resetStyle:!1,order:-998},r));return function(e){var t=e.prefixCls,n=e.rootCls,r=void 0===n?t:n;return o(t,r),null}},genComponentStyleHook:m}}},93463:function(e,t,n){"use strict";n.d(t,{E4:function(){return eF},uP:function(){return y},jG:function(){return k},ks:function(){return A},bf:function(){return F},CI:function(){return eP},fp:function(){return G},xy:function(){return eR}});var r,o=n(11993),a=n(26365),i=n(83145),c=n(31686),l=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))*1540483477+((t>>>16)*59797<<16),t^=t>>>24,n=(65535&t)*1540483477+((t>>>16)*59797<<16)^(65535&n)*1540483477+((n>>>16)*59797<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n^=255&e.charCodeAt(r),n=(65535&n)*1540483477+((n>>>16)*59797<<16)}return n^=n>>>13,(((n=(65535&n)*1540483477+((n>>>16)*59797<<16))^n>>>15)>>>0).toString(36)},s=n(21717),u=n(2265),d=n.t(u,2);n(6397),n(16671);var f=n(76405),p=n(25049);function m(e){return e.join("%")}var g=function(){function e(t){(0,f.Z)(this,e),(0,o.Z)(this,"instanceId",void 0),(0,o.Z)(this,"cache",new Map),(0,o.Z)(this,"extracted",new Set),this.instanceId=t}return(0,p.Z)(e,[{key:"get",value:function(e){return this.opGet(m(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(m(e),t)}},{key:"opUpdate",value:function(e,t){var n=t(this.cache.get(e));null===n?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),v="data-token-hash",h="data-css-hash",b="__cssinjs_instance__",y=u.createContext({hashPriority:"low",cache:function(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(h,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[b]=t[b]||e,t[b]===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll("style[".concat(h,"]"))).forEach(function(t){var n,o=t.getAttribute(h);r[o]?t[b]===e&&(null===(n=t.parentNode)||void 0===n||n.removeChild(t)):r[o]=!0})}return new g(e)}(),defaultCache:!0}),x=n(41154),w=n(94981),E=function(){function e(){(0,f.Z)(this,e),(0,o.Z)(this,"cache",void 0),(0,o.Z)(this,"keys",void 0),(0,o.Z)(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return(0,p.Z)(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o={map:this.cache};return e.forEach(function(e){if(o){var t;o=null===(t=o)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e)}else o=void 0}),null!==(t=o)&&void 0!==t&&t.value&&r&&(o.value[1]=this.cacheCallTimes++),null===(n=o)||void 0===n?void 0:n.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(e,t){var n=(0,a.Z)(e,2)[1];return r.internalGet(t)[1]0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Z+=1}return(0,p.Z)(e,[{key:"getDerivativeToken",value:function(e){return this.derivatives.reduce(function(t,n){return n(e,t)},void 0)}}]),e}(),O=new E;function k(e){var t=Array.isArray(e)?e:[e];return O.has(t)||O.set(t,new S(t)),O.get(t)}var j=new WeakMap,I={},M=new WeakMap;function R(e){var t=M.get(e)||"";return t||(Object.keys(e).forEach(function(n){var r=e[n];t+=n,r instanceof S?t+=r.id:r&&"object"===(0,x.Z)(r)?t+=R(r):t+=r}),t=l(t),M.set(e,t)),t}function N(e,t){return l("".concat(t,"_").concat(R(e)))}"random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,"");var P=(0,w.Z)();function F(e){return"number"==typeof e?"".concat(e,"px"):e}function T(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(a)return e;var i=(0,c.Z)((0,c.Z)({},r),{},(0,o.Z)((0,o.Z)({},v,t),h,n)),l=Object.keys(i).map(function(e){var t=i[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"")}var A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"--".concat(t?"".concat(t,"-"):"").concat(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase()},_=function(e,t,n){var r,o={},i={};return Object.entries(e).forEach(function(e){var t=(0,a.Z)(e,2),r=t[0],c=t[1];if(null!=n&&null!==(l=n.preserve)&&void 0!==l&&l[r])i[r]=c;else if(("string"==typeof c||"number"==typeof c)&&!(null!=n&&null!==(s=n.ignore)&&void 0!==s&&s[r])){var l,s,u,d=A(r,null==n?void 0:n.prefix);o[d]="number"!=typeof c||null!=n&&null!==(u=n.unitless)&&void 0!==u&&u[r]?String(c):"".concat(c,"px"),i[r]="var(".concat(d,")")}}),[i,(r={scope:null==n?void 0:n.scope},Object.keys(o).length?".".concat(t).concat(null!=r&&r.scope?".".concat(r.scope):"","{").concat(Object.entries(o).map(function(e){var t=(0,a.Z)(e,2),n=t[0],r=t[1];return"".concat(n,":").concat(r,";")}).join(""),"}"):"")]},B=n(27380),H=(0,c.Z)({},d).useInsertionEffect,z=H?function(e,t,n){return H(function(){return e(),t()},n)}:function(e,t,n){u.useMemo(e,n),(0,B.Z)(function(){return t(!0)},n)},L=void 0!==(0,c.Z)({},d).useInsertionEffect?function(e){var t=[],n=!1;return u.useEffect(function(){return n=!1,function(){n=!0,t.length&&t.forEach(function(e){return e()})}},e),function(e){n||t.push(e)}}:function(){return function(e){e()}};function D(e,t,n,r,o){var c=u.useContext(y).cache,l=m([e].concat((0,i.Z)(t))),s=L([l]),d=function(e){c.opUpdate(l,function(t){var r=(0,a.Z)(t||[void 0,void 0],2),o=r[0],i=[void 0===o?0:o,r[1]||n()];return e?e(i):i})};u.useMemo(function(){d()},[l]);var f=c.opGet(l)[1];return z(function(){null==o||o(f)},function(e){return d(function(t){var n=(0,a.Z)(t,2),r=n[0],i=n[1];return e&&0===r&&(null==o||o(f)),[r+1,i]}),function(){c.opUpdate(l,function(t){var n=(0,a.Z)(t||[],2),o=n[0],i=void 0===o?0:o,u=n[1];return 0==i-1?(s(function(){(e||!c.opGet(l))&&(null==r||r(u,!1))}),null):[i-1,u]})}},[l]),f}var W={},V=new Map,q=function(e,t,n,r){var o=n.getDerivativeToken(e),a=(0,c.Z)((0,c.Z)({},o),t);return r&&(a=r(a)),a},X="token";function G(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,u.useContext)(y),o=r.cache.instanceId,d=r.container,f=n.salt,p=void 0===f?"":f,m=n.override,g=void 0===m?W:m,x=n.formatToken,w=n.getComputedToken,E=n.cssVar,C=function(e,t){for(var n=j,r=0;r0&&n.forEach(function(e){"undefined"!=typeof document&&document.querySelectorAll("style[".concat(v,'="').concat(e,'"]')).forEach(function(e){if(e[b]===o){var t;null===(t=e.parentNode)||void 0===t||t.removeChild(e)}}),V.delete(e)})},function(e){var t=(0,a.Z)(e,4),n=t[0],r=t[3];if(E&&r){var i=(0,s.hq)(r,l("css-variables-".concat(n._themeKey)),{mark:h,prepend:"queue",attachTo:d,priority:-999});i[b]=o,i.setAttribute(v,n._themeKey)}})}var U=n(1119),$={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},K="comm",Y="rule",Q="decl",J=Math.abs,ee=String.fromCharCode;function et(e,t,n){return e.replace(t,n)}function en(e,t){return 0|e.charCodeAt(t)}function er(e,t,n){return e.slice(t,n)}function eo(e){return e.length}function ea(e,t){return t.push(e),e}function ei(e,t){for(var n="",r=0;r0?p[b]+" "+y:et(y,/&\f/g,p[b])).trim())&&(l[h++]=x);return em(e,t,n,0===o?Y:c,l,s,u,d)}function ex(e,t,n,r,o){return em(e,t,n,Q,er(e,0,r),er(e,r+1,-1),r,o)}var ew="data-ant-cssinjs-cache-path",eE="_FILE_STYLE__",eC=!0,eZ="_multi_value_";function eS(e){var t,n,r;return ei((r=function e(t,n,r,o,a,i,c,l,s){for(var u,d,f,p=0,m=0,g=c,v=0,h=0,b=0,y=1,x=1,w=1,E=0,C="",Z=a,S=i,O=o,k=C;x;)switch(b=E,E=eg()){case 40:if(108!=b&&58==en(k,g-1)){-1!=(d=k+=et(eb(E),"&","&\f"),f=J(p?l[p-1]:0),d.indexOf("&\f",f))&&(w=-1);break}case 34:case 39:case 91:k+=eb(E);break;case 9:case 10:case 13:case 32:k+=function(e){for(;ef=ev();)if(ef<33)eg();else break;return eh(e)>2||eh(ef)>3?"":" "}(b);break;case 92:k+=function(e,t){for(var n;--t&&eg()&&!(ef<48)&&!(ef>102)&&(!(ef>57)||!(ef<65))&&(!(ef>70)||!(ef<97)););return n=ed+(t<6&&32==ev()&&32==eg()),er(ep,e,n)}(ed-1,7);continue;case 47:switch(ev()){case 42:case 47:ea(em(u=function(e,t){for(;eg();)if(e+ef===57)break;else if(e+ef===84&&47===ev())break;return"/*"+er(ep,t,ed-1)+"*"+ee(47===e?e:eg())}(eg(),ed),n,r,K,ee(ef),er(u,2,-2),0,s),s),(5==eh(b||1)||5==eh(ev()||1))&&eo(k)&&" "!==er(k,-1,void 0)&&(k+=" ");break;default:k+="/"}break;case 123*y:l[p++]=eo(k)*w;case 125*y:case 59:case 0:switch(E){case 0:case 125:x=0;case 59+m:-1==w&&(k=et(k,/\f/g,"")),h>0&&(eo(k)-g||0===y&&47===b)&&ea(h>32?ex(k+";",o,r,g-1,s):ex(et(k," ","")+";",o,r,g-2,s),s);break;case 59:k+=";";default:if(ea(O=ey(k,n,r,p,m,a,l,C,Z=[],S=[],g,i),i),123===E){if(0===m)e(k,n,O,O,Z,i,g,l,S);else{switch(v){case 99:if(110===en(k,3))break;case 108:if(97===en(k,2))break;default:m=0;case 100:case 109:case 115:}m?e(t,O,O,o&&ea(ey(t,O,O,0,0,a,l,C,a,Z=[],g,S),S),a,S,g,l,o?Z:S):e(k,O,O,O,[""],S,0,l,S)}}}p=m=h=0,y=w=1,C=k="",g=c;break;case 58:g=1+eo(k),h=b;default:if(y<1){if(123==E)--y;else if(125==E&&0==y++&&125==(ef=ed>0?en(ep,--ed):0,es--,10===ef&&(es=1,el--),ef))continue}switch(k+=ee(E),E*y){case 38:w=m>0?1:(k+="\f",-1);break;case 44:l[p++]=(eo(k)-1)*w,w=1;break;case 64:45===ev()&&(k+=eb(eg())),v=ev(),m=g=eo(C=k+=function(e){for(;!eh(ev());)eg();return er(ep,e,ed)}(ed)),E++;break;case 45:45===b&&2==eo(k)&&(y=0)}}return i}("",null,null,null,[""],(n=t=e,el=es=1,eu=eo(ep=n),ed=0,t=[]),0,[0],t),ep="",r),ec).replace(/\{%%%\:[^;];}/g,";")}function eO(e,t,n){if(!t)return e;var r=".".concat(t),o="low"===n?":where(".concat(r,")"):r;return e.split(",").map(function(e){var t,n=e.trim().split(/\s+/),r=n[0]||"",a=(null===(t=r.match(/^\w+/))||void 0===t?void 0:t[0])||"";return[r="".concat(a).concat(o).concat(r.slice(a.length))].concat((0,i.Z)(n.slice(1))).join(" ")}).join(",")}var ek=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{root:!0,parentSelectors:[]},o=r.root,l=r.injectHash,s=r.parentSelectors,u=n.hashId,d=n.layer,f=(n.path,n.hashPriority),p=n.transformers,m=void 0===p?[]:p;n.linters;var g="",v={};function h(t){var r=t.getName(u);if(!v[r]){var o=e(t.style,n,{root:!1,parentSelectors:s}),i=(0,a.Z)(o,1)[0];v[r]="@keyframes ".concat(t.getName(u)).concat(i)}}return(function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.forEach(function(t){Array.isArray(t)?e(t,n):t&&n.push(t)}),n})(Array.isArray(t)?t:[t]).forEach(function(t){var r="string"!=typeof t||o?t:{};if("string"==typeof r)g+="".concat(r,"\n");else if(r._keyframe)h(r);else{var d=m.reduce(function(e,t){var n;return(null==t||null===(n=t.visit)||void 0===n?void 0:n.call(t,e))||e},r);Object.keys(d).forEach(function(t){var r=d[t];if("object"!==(0,x.Z)(r)||!r||"animationName"===t&&r._keyframe||"object"===(0,x.Z)(r)&&r&&("_skip_check_"in r||eZ in r)){function p(e,t){var n=e.replace(/[A-Z]/g,function(e){return"-".concat(e.toLowerCase())}),r=t;$[e]||"number"!=typeof r||0===r||(r="".concat(r,"px")),"animationName"===e&&null!=t&&t._keyframe&&(h(t),r=t.getName(u)),g+="".concat(n,":").concat(r,";")}var m,b=null!==(m=null==r?void 0:r.value)&&void 0!==m?m:r;"object"===(0,x.Z)(r)&&null!=r&&r[eZ]&&Array.isArray(b)?b.forEach(function(e){p(t,e)}):p(t,b)}else{var y=!1,w=t.trim(),E=!1;(o||l)&&u?w.startsWith("@")?y=!0:w="&"===w?eO("",u,f):eO(t,u,f):o&&!u&&("&"===w||""===w)&&(w="",E=!0);var C=e(r,n,{root:E,injectHash:y,parentSelectors:[].concat((0,i.Z)(s),[w])}),Z=(0,a.Z)(C,2),S=Z[0],O=Z[1];v=(0,c.Z)((0,c.Z)({},v),O),g+="".concat(w).concat(S)}})}}),o?d&&(g&&(g="@layer ".concat(d.name," {").concat(g,"}")),d.dependencies&&(v["@layer ".concat(d.name)]=d.dependencies.map(function(e){return"@layer ".concat(e,", ").concat(d.name,";")}).join("\n"))):g="{".concat(g,"}"),[g,v]};function ej(e,t){return l("".concat(e.join("%")).concat(t))}function eI(){return null}var eM="style";function eR(e,t){var n=e.token,l=e.path,d=e.hashId,f=e.layer,p=e.nonce,m=e.clientOnly,g=e.order,x=void 0===g?0:g,E=u.useContext(y),C=E.autoClear,Z=(E.mock,E.defaultCache),S=E.hashPriority,O=E.container,k=E.ssrInline,j=E.transformers,I=E.linters,M=E.cache,R=E.layer,N=n._tokenKey,F=[N];R&&F.push("layer"),F.push.apply(F,(0,i.Z)(l));var T=D(eM,F,function(){var e=F.join("|");if(!function(){if(!r&&(r={},(0,w.Z)())){var e,t=document.createElement("div");t.className=ew,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);var n=getComputedStyle(t).content||"";(n=n.replace(/^"/,"").replace(/"$/,"")).split(";").forEach(function(e){var t=e.split(":"),n=(0,a.Z)(t,2),o=n[0],i=n[1];r[o]=i});var o=document.querySelector("style[".concat(ew,"]"));o&&(eC=!1,null===(e=o.parentNode)||void 0===e||e.removeChild(o)),document.body.removeChild(t)}}(),r[e]){var n=function(e){var t=r[e],n=null;if(t&&(0,w.Z)()){if(eC)n=eE;else{var o=document.querySelector("style[".concat(h,'="').concat(r[e],'"]'));o?n=o.innerHTML:delete r[e]}}return[n,t]}(e),o=(0,a.Z)(n,2),i=o[0],c=o[1];if(i)return[i,N,c,{},m,x]}var s=ek(t(),{hashId:d,hashPriority:S,layer:R?f:void 0,path:l.join("-"),transformers:j,linters:I}),u=(0,a.Z)(s,2),p=u[0],g=u[1],v=eS(p),b=ej(F,v);return[v,N,b,g,m,x]},function(e,t){var n=(0,a.Z)(e,3)[2];(t||C)&&P&&(0,s.jL)(n,{mark:h,attachTo:O})},function(e){var t=(0,a.Z)(e,4),n=t[0],r=(t[1],t[2]),o=t[3];if(P&&n!==eE){var i={mark:h,prepend:!R&&"queue",attachTo:O,priority:x},l="function"==typeof p?p():p;l&&(i.csp={nonce:l});var u=[],d=[];Object.keys(o).forEach(function(e){e.startsWith("@layer")?u.push(e):d.push(e)}),u.forEach(function(e){(0,s.hq)(eS(o[e]),"_layer-".concat(e),(0,c.Z)((0,c.Z)({},i),{},{prepend:!0}))});var f=(0,s.hq)(n,r,i);f[b]=M.instanceId,f.setAttribute(v,N),d.forEach(function(e){(0,s.hq)(eS(o[e]),"_effect-".concat(e),i)})}}),A=(0,a.Z)(T,3),_=A[0],B=A[1],H=A[2];return function(e){var t;return t=k&&!P&&Z?u.createElement("style",(0,U.Z)({},(0,o.Z)((0,o.Z)({},v,B),h,H),{dangerouslySetInnerHTML:{__html:_}})):u.createElement(eI,null),u.createElement(u.Fragment,null,t,e)}}var eN="cssVar",eP=function(e,t){var n=e.key,r=e.prefix,o=e.unitless,c=e.ignore,l=e.token,d=e.scope,f=void 0===d?"":d,p=(0,u.useContext)(y),m=p.cache.instanceId,g=p.container,x=l._tokenKey,w=[].concat((0,i.Z)(e.path),[n,f,x]);return D(eN,w,function(){var e=_(t(),n,{prefix:r,unitless:o,ignore:c,scope:f}),i=(0,a.Z)(e,2),l=i[0],s=i[1],u=ej(w,s);return[l,s,u,n]},function(e){var t=(0,a.Z)(e,3)[2];P&&(0,s.jL)(t,{mark:h,attachTo:g})},function(e){var t=(0,a.Z)(e,3),r=t[1],o=t[2];if(r){var i=(0,s.hq)(r,o,{mark:h,prepend:"queue",attachTo:g,priority:-999});i[b]=m,i.setAttribute(v,n)}})};(0,o.Z)((0,o.Z)((0,o.Z)({},eM,function(e,t,n){var r=(0,a.Z)(e,6),o=r[0],i=r[1],c=r[2],l=r[3],s=r[4],u=r[5],d=(n||{}).plain;if(s)return null;var f=o,p={"data-rc-order":"prependQueue","data-rc-priority":"".concat(u)};return f=T(o,i,c,p,d),l&&Object.keys(l).forEach(function(e){if(!t[e]){t[e]=!0;var n=T(eS(l[e]),i,"_effect-".concat(e),p,d);e.startsWith("@layer")?f=n+f:f+=n}}),[u,c,f]}),X,function(e,t,n){var r=(0,a.Z)(e,5),o=r[2],i=r[3],c=r[4],l=(n||{}).plain;if(!i)return null;var s=o._tokenKey,u=T(i,c,s,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,s,u]}),eN,function(e,t,n){var r=(0,a.Z)(e,4),o=r[1],i=r[2],c=r[3],l=(n||{}).plain;if(!o)return null;var s=T(o,c,i,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},l);return[-999,i,s]});var eF=function(){function e(t,n){(0,f.Z)(this,e),(0,o.Z)(this,"name",void 0),(0,o.Z)(this,"style",void 0),(0,o.Z)(this,"_keyframe",!0),this.name=t,this.style=n}return(0,p.Z)(e,[{key:"getName",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?"".concat(e,"-").concat(this.name):this.name}}]),e}();function eT(e){return e.notSplit=!0,e}eT(["borderTop","borderBottom"]),eT(["borderTop"]),eT(["borderBottom"]),eT(["borderLeft","borderRight"]),eT(["borderLeft"]),eT(["borderRight"])},54558:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var r=n(11993);let o=Math.round;function a(e,t){let n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||"",e);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}let i=(e,t,n)=>0===n?e:e/100;function c(e,t){let n=t||255;return e>n?n:e<0?0:e}class l{constructor(e){function t(t){return t[0]in e&&t[1]in e&&t[2]in e}if((0,r.Z)(this,"isValid",!0),(0,r.Z)(this,"r",0),(0,r.Z)(this,"g",0),(0,r.Z)(this,"b",0),(0,r.Z)(this,"a",1),(0,r.Z)(this,"_h",void 0),(0,r.Z)(this,"_s",void 0),(0,r.Z)(this,"_l",void 0),(0,r.Z)(this,"_v",void 0),(0,r.Z)(this,"_max",void 0),(0,r.Z)(this,"_min",void 0),(0,r.Z)(this,"_brightness",void 0),e){if("string"==typeof e){let t=e.trim();function n(e){return t.startsWith(e)}/^#?[A-F\d]{3,8}$/i.test(t)?this.fromHexString(t):n("rgb")?this.fromRgbString(t):n("hsl")?this.fromHslString(t):(n("hsv")||n("hsb"))&&this.fromHsvString(t)}else if(e instanceof l)this.r=e.r,this.g=e.g,this.b=e.b,this.a=e.a,this._h=e._h,this._s=e._s,this._l=e._l,this._v=e._v;else if(t("rgb"))this.r=c(e.r),this.g=c(e.g),this.b=c(e.b),this.a="number"==typeof e.a?c(e.a,1):1;else if(t("hsl"))this.fromHsl(e);else if(t("hsv"))this.fromHsv(e);else throw Error("@ant-design/fast-color: unsupported input "+JSON.stringify(e))}}setR(e){return this._sc("r",e)}setG(e){return this._sc("g",e)}setB(e){return this._sc("b",e)}setA(e){return this._sc("a",e,1)}setHue(e){let t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}return .2126*e(this.r)+.7152*e(this.g)+.0722*e(this.b)}getHue(){if(void 0===this._h){let e=this.getMax()-this.getMin();0===e?this._h=0:this._h=o(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){let n=this._c(e),r=t/100,a=e=>(n[e]-this[e])*r+this[e],i={r:o(a("r")),g:o(a("g")),b:o(a("b")),a:o(100*a("a"))/100};return this._c(i)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){let t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>o((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r("r"),g:r("g"),b:r("b"),a:n})}isDark(){return 128>this.getBrightness()}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e="#",t=(this.r||0).toString(16);e+=2===t.length?t:"0"+t;let n=(this.g||0).toString(16);e+=2===n.length?n:"0"+n;let r=(this.b||0).toString(16);if(e+=2===r.length?r:"0"+r,"number"==typeof this.a&&this.a>=0&&this.a<1){let t=o(255*this.a).toString(16);e+=2===t.length?t:"0"+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){let e=this.getHue(),t=o(100*this.getSaturation()),n=o(100*this.getLightness());return 1!==this.a?`hsla(${e},${t}%,${n}%,${this.a})`:`hsl(${e},${t}%,${n}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(e,t,n){let r=this.clone();return r[e]=c(t,n),r}_c(e){return new this.constructor(e)}getMax(){return void 0===this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return void 0===this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){let t=e.replace("#","");function n(e,n){return parseInt(t[e]+t[n||e],16)}t.length<6?(this.r=n(0),this.g=n(1),this.b=n(2),this.a=t[3]?n(3)/255:1):(this.r=n(0,1),this.g=n(2,3),this.b=n(4,5),this.a=t[6]?n(6,7)/255:1)}fromHsl({h:e,s:t,l:n,a:r}){if(this._h=e%360,this._s=t,this._l=n,this.a="number"==typeof r?r:1,t<=0){let e=o(255*n);this.r=e,this.g=e,this.b=e}let a=0,i=0,c=0,l=e/60,s=(1-Math.abs(2*n-1))*t,u=s*(1-Math.abs(l%2-1));l>=0&&l<1?(a=s,i=u):l>=1&&l<2?(a=u,i=s):l>=2&&l<3?(i=s,c=u):l>=3&&l<4?(i=u,c=s):l>=4&&l<5?(a=u,c=s):l>=5&&l<6&&(a=s,c=u);let d=n-s/2;this.r=o((a+d)*255),this.g=o((i+d)*255),this.b=o((c+d)*255)}fromHsv({h:e,s:t,v:n,a:r}){this._h=e%360,this._s=t,this._v=n,this.a="number"==typeof r?r:1;let a=o(255*n);if(this.r=a,this.g=a,this.b=a,t<=0)return;let i=e/60,c=Math.floor(i),l=i-c,s=o(n*(1-t)*255),u=o(n*(1-t*l)*255),d=o(n*(1-t*(1-l))*255);switch(c){case 0:this.g=d,this.b=s;break;case 1:this.r=u,this.b=s;break;case 2:this.r=s,this.b=d;break;case 3:this.r=s,this.g=u;break;case 4:this.r=d,this.g=s;break;default:this.g=s,this.b=u}}fromHsvString(e){let t=a(e,i);this.fromHsv({h:t[0],s:t[1],v:t[2],a:t[3]})}fromHslString(e){let t=a(e,i);this.fromHsl({h:t[0],s:t[1],l:t[2],a:t[3]})}fromRgbString(e){let t=a(e,(e,t)=>t.includes("%")?o(e/100*255):e);this.r=t[0],this.g=t[1],this.b=t[2],this.a=t[3]}}},55015:function(e,t,n){"use strict";n.d(t,{Z:function(){return j}});var r=n(1119),o=n(26365),a=n(11993),i=n(6989),c=n(2265),l=n(36760),s=n.n(l),u=n(57943),d=n(20902),f=n(31686),p=n(41154),m=n(21717),g=n(13211),v=n(32559);function h(e){return"object"===(0,p.Z)(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===(0,p.Z)(e.icon)||"function"==typeof e.icon)}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):(delete t[n],t[n.replace(/-(.)/g,function(e,t){return t.toUpperCase()})]=r),t},{})}function y(e){return(0,u.R_)(e)[0]}function x(e){return e?Array.isArray(e)?e:[e]:[]}var w=function(e){var t=(0,c.useContext)(d.Z),n=t.csp,r=t.prefixCls,o=t.layer,a="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";r&&(a=a.replace(/anticon/g,r)),o&&(a="@layer ".concat(o," {\n").concat(a,"\n}")),(0,c.useEffect)(function(){var t=e.current,r=(0,g.A)(t);(0,m.hq)(a,"@ant-design-icons",{prepend:!o,csp:n,attachTo:r})},[])},E=["icon","className","onClick","style","primaryColor","secondaryColor"],C={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},Z=function(e){var t,n,r=e.icon,o=e.className,a=e.onClick,l=e.style,s=e.primaryColor,u=e.secondaryColor,d=(0,i.Z)(e,E),p=c.useRef(),m=C;if(s&&(m={primaryColor:s,secondaryColor:u||y(s)}),w(p),t=h(r),n="icon should be icon definiton, but got ".concat(r),(0,v.ZP)(t,"[@ant-design/icons] ".concat(n)),!h(r))return null;var g=r;return g&&"function"==typeof g.icon&&(g=(0,f.Z)((0,f.Z)({},g),{},{icon:g.icon(m.primaryColor,m.secondaryColor)})),function e(t,n,r){return r?c.createElement(t.tag,(0,f.Z)((0,f.Z)({key:n},b(t.attrs)),r),(t.children||[]).map(function(r,o){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(o))})):c.createElement(t.tag,(0,f.Z)({key:n},b(t.attrs)),(t.children||[]).map(function(r,o){return e(r,"".concat(n,"-").concat(t.tag,"-").concat(o))}))}(g.icon,"svg-".concat(g.name),(0,f.Z)((0,f.Z)({className:o,onClick:a,style:l,"data-icon":g.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:p}))};function S(e){var t=x(e),n=(0,o.Z)(t,2),r=n[0],a=n[1];return Z.setTwoToneColors({primaryColor:r,secondaryColor:a})}Z.displayName="IconReact",Z.getTwoToneColors=function(){return(0,f.Z)({},C)},Z.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;C.primaryColor=t,C.secondaryColor=n||y(t),C.calculated=!!n};var O=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];S(u.iN.primary);var k=c.forwardRef(function(e,t){var n=e.className,l=e.icon,u=e.spin,f=e.rotate,p=e.tabIndex,m=e.onClick,g=e.twoToneColor,v=(0,i.Z)(e,O),h=c.useContext(d.Z),b=h.prefixCls,y=void 0===b?"anticon":b,w=h.rootClassName,E=s()(w,y,(0,a.Z)((0,a.Z)({},"".concat(y,"-").concat(l.name),!!l.name),"".concat(y,"-spin"),!!u||"loading"===l.name),n),C=p;void 0===C&&m&&(C=-1);var S=x(g),k=(0,o.Z)(S,2),j=k[0],I=k[1];return c.createElement("span",(0,r.Z)({role:"img","aria-label":l.name},v,{ref:t,tabIndex:C,onClick:m,className:E}),c.createElement(Z,{icon:l,primaryColor:j,secondaryColor:I,style:f?{msTransform:"rotate(".concat(f,"deg)"),transform:"rotate(".concat(f,"deg)")}:void 0}))});k.displayName="AntdIcon",k.getTwoToneColor=function(){var e=Z.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},k.setTwoToneColor=S;var j=k},20902:function(e,t,n){"use strict";var r=(0,n(2265).createContext)({});t.Z=r},8900:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},9738:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},39725:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},49638:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},70464:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},54537:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},97416:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},6520:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},55726:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},15424:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},61935:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},67187:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},29436:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(1119),o=n(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},i=n(55015),c=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,r.Z)({},e,{ref:t,icon:a}))})},75669:function(e,t,n){"use strict";n.d(t,{Il:function(){return v}}),n(2265);var r,o=n(76405),a=n(25049),i=n(41690),c=n(15900),l=n(31686),s=n(6989),u=n(41154),d=n(54558),f=["b"],p=["v"],m=function(e){return Math.round(Number(e||0))},g=function(e){if(e instanceof d.t)return e;if(e&&"object"===(0,u.Z)(e)&&"h"in e&&"b"in e){var t=e.b,n=(0,s.Z)(e,f);return(0,l.Z)((0,l.Z)({},n),{},{v:t})}return"string"==typeof e&&/hsb/.test(e)?e.replace(/hsb/,"hsv"):e},v=function(e){(0,i.Z)(n,e);var t=(0,c.Z)(n);function n(e){return(0,o.Z)(this,n),t.call(this,g(e))}return(0,a.Z)(n,[{key:"toHsbString",value:function(){var e=this.toHsb(),t=m(100*e.s),n=m(100*e.b),r=m(e.h),o=e.a,a="hsb(".concat(r,", ").concat(t,"%, ").concat(n,"%)"),i="hsba(".concat(r,", ").concat(t,"%, ").concat(n,"%, ").concat(o.toFixed(0===o?0:2),")");return 1===o?a:i}},{key:"toHsb",value:function(){var e=this.toHsv(),t=e.v,n=(0,s.Z)(e,p);return(0,l.Z)((0,l.Z)({},n),{},{b:t,a:this.a})}}]),n}(d.t);(r="#1677ff")instanceof v||new v(r),n(36760),n(74126)},28036:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(26365),o=n(2265),a=n(54887),i=n(94981);n(32559);var c=n(28791),l=o.createContext(null),s=n(83145),u=n(27380),d=[],f=n(21717),p=n(3208),m="rc-util-locker-".concat(Date.now()),g=0,v=function(e){return!1!==e&&((0,i.Z)()&&e?"string"==typeof e?document.querySelector(e):"function"==typeof e?e():e:null)},h=o.forwardRef(function(e,t){var n,h,b,y=e.open,x=e.autoLock,w=e.getContainer,E=(e.debug,e.autoDestroy),C=void 0===E||E,Z=e.children,S=o.useState(y),O=(0,r.Z)(S,2),k=O[0],j=O[1],I=k||y;o.useEffect(function(){(C||y)&&j(y)},[y,C]);var M=o.useState(function(){return v(w)}),R=(0,r.Z)(M,2),N=R[0],P=R[1];o.useEffect(function(){var e=v(w);P(null!=e?e:null)});var F=function(e,t){var n=o.useState(function(){return(0,i.Z)()?document.createElement("div"):null}),a=(0,r.Z)(n,1)[0],c=o.useRef(!1),f=o.useContext(l),p=o.useState(d),m=(0,r.Z)(p,2),g=m[0],v=m[1],h=f||(c.current?void 0:function(e){v(function(t){return[e].concat((0,s.Z)(t))})});function b(){a.parentElement||document.body.appendChild(a),c.current=!0}function y(){var e;null===(e=a.parentElement)||void 0===e||e.removeChild(a),c.current=!1}return(0,u.Z)(function(){return e?f?f(b):b():y(),y},[e]),(0,u.Z)(function(){g.length&&(g.forEach(function(e){return e()}),v(d))},[g]),[a,h]}(I&&!N,0),T=(0,r.Z)(F,2),A=T[0],_=T[1],B=null!=N?N:A;n=!!(x&&y&&(0,i.Z)()&&(B===A||B===document.body)),h=o.useState(function(){return g+=1,"".concat(m,"_").concat(g)}),b=(0,r.Z)(h,1)[0],(0,u.Z)(function(){if(n){var e=(0,p.o)(document.body).width,t=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth;(0,f.hq)("\nhtml body {\n overflow-y: hidden;\n ".concat(t?"width: calc(100% - ".concat(e,"px);"):"","\n}"),b)}else(0,f.jL)(b);return function(){(0,f.jL)(b)}},[n,b]);var H=null;Z&&(0,c.Yr)(Z)&&t&&(H=Z.ref);var z=(0,c.x1)(H,t);if(!I||!(0,i.Z)()||void 0===N)return null;var L=!1===B,D=Z;return t&&(D=o.cloneElement(Z,{ref:z})),o.createElement(l.Provider,{value:_},L?D:(0,a.createPortal)(D,B))})},97821:function(e,t,n){"use strict";n.d(t,{Z:function(){return L}});var r=n(31686),o=n(26365),a=n(6989),i=n(28036),c=n(36760),l=n.n(c),s=n(31474),u=n(2868),d=n(13211),f=n(58525),p=n(92491),m=n(27380),g=n(79267),v=n(2265),h=n(1119),b=n(66632),y=n(28791);function x(e){var t=e.prefixCls,n=e.align,r=e.arrow,o=e.arrowPos,a=r||{},i=a.className,c=a.content,s=o.x,u=o.y,d=v.useRef();if(!n||!n.points)return null;var f={position:"absolute"};if(!1!==n.autoArrow){var p=n.points[0],m=n.points[1],g=p[0],h=p[1],b=m[0],y=m[1];g!==b&&["t","b"].includes(g)?"t"===g?f.top=0:f.bottom=0:f.top=void 0===u?0:u,h!==y&&["l","r"].includes(h)?"l"===h?f.left=0:f.right=0:f.left=void 0===s?0:s}return v.createElement("div",{ref:d,className:l()("".concat(t,"-arrow"),i),style:f},c)}function w(e){var t=e.prefixCls,n=e.open,r=e.zIndex,o=e.mask,a=e.motion;return o?v.createElement(b.ZP,(0,h.Z)({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(e){var n=e.className;return v.createElement("div",{style:{zIndex:r},className:l()("".concat(t,"-mask"),n)})}):null}var E=v.memo(function(e){return e.children},function(e,t){return t.cache}),C=v.forwardRef(function(e,t){var n=e.popup,a=e.className,i=e.prefixCls,c=e.style,u=e.target,d=e.onVisibleChanged,f=e.open,p=e.keepDom,g=e.fresh,C=e.onClick,Z=e.mask,S=e.arrow,O=e.arrowPos,k=e.align,j=e.motion,I=e.maskMotion,M=e.forceRender,R=e.getPopupContainer,N=e.autoDestroy,P=e.portal,F=e.zIndex,T=e.onMouseEnter,A=e.onMouseLeave,_=e.onPointerEnter,B=e.onPointerDownCapture,H=e.ready,z=e.offsetX,L=e.offsetY,D=e.offsetR,W=e.offsetB,V=e.onAlign,q=e.onPrepare,X=e.stretch,G=e.targetWidth,U=e.targetHeight,$="function"==typeof n?n():n,K=f||p,Y=(null==R?void 0:R.length)>0,Q=v.useState(!R||!Y),J=(0,o.Z)(Q,2),ee=J[0],et=J[1];if((0,m.Z)(function(){!ee&&Y&&u&&et(!0)},[ee,Y,u]),!ee)return null;var en="auto",er={left:"-1000vw",top:"-1000vh",right:en,bottom:en};if(H||!f){var eo,ea=k.points,ei=k.dynamicInset||(null===(eo=k._experimental)||void 0===eo?void 0:eo.dynamicInset),ec=ei&&"r"===ea[0][1],el=ei&&"b"===ea[0][0];ec?(er.right=D,er.left=en):(er.left=z,er.right=en),el?(er.bottom=W,er.top=en):(er.top=L,er.bottom=en)}var es={};return X&&(X.includes("height")&&U?es.height=U:X.includes("minHeight")&&U&&(es.minHeight=U),X.includes("width")&&G?es.width=G:X.includes("minWidth")&&G&&(es.minWidth=G)),f||(es.pointerEvents="none"),v.createElement(P,{open:M||K,getContainer:R&&function(){return R(u)},autoDestroy:N},v.createElement(w,{prefixCls:i,open:f,zIndex:F,mask:Z,motion:I}),v.createElement(s.Z,{onResize:V,disabled:!f},function(e){return v.createElement(b.ZP,(0,h.Z)({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:M,leavedClassName:"".concat(i,"-hidden")},j,{onAppearPrepare:q,onEnterPrepare:q,visible:f,onVisibleChanged:function(e){var t;null==j||null===(t=j.onVisibleChanged)||void 0===t||t.call(j,e),d(e)}}),function(n,o){var s=n.className,u=n.style,d=l()(i,s,a);return v.createElement("div",{ref:(0,y.sQ)(e,t,o),className:d,style:(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({"--arrow-x":"".concat(O.x||0,"px"),"--arrow-y":"".concat(O.y||0,"px")},er),es),u),{},{boxSizing:"border-box",zIndex:F},c),onMouseEnter:T,onMouseLeave:A,onPointerEnter:_,onClick:C,onPointerDownCapture:B},S&&v.createElement(x,{prefixCls:i,arrow:S,arrowPos:O,align:k}),v.createElement(E,{cache:!f&&!g},$))})}))}),Z=v.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,o=(0,y.Yr)(n),a=v.useCallback(function(e){(0,y.mH)(t,r?r(e):e)},[r]),i=(0,y.x1)(a,(0,y.C4)(n));return o?v.cloneElement(n,{ref:i}):n}),S=v.createContext(null);function O(e){return e?Array.isArray(e)?e:[e]:[]}var k=n(2857);function j(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function I(e){return e.ownerDocument.defaultView}function M(e){for(var t=[],n=null==e?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var o=I(n).getComputedStyle(n);[o.overflowX,o.overflowY,o.overflow].some(function(e){return r.includes(e)})&&t.push(n),n=n.parentElement}return t}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Number.isNaN(e)?t:e}function N(e){return R(parseFloat(e),0)}function P(e,t){var n=(0,r.Z)({},e);return(t||[]).forEach(function(e){if(!(e instanceof HTMLBodyElement||e instanceof HTMLHtmlElement)){var t=I(e).getComputedStyle(e),r=t.overflow,o=t.overflowClipMargin,a=t.borderTopWidth,i=t.borderBottomWidth,c=t.borderLeftWidth,l=t.borderRightWidth,s=e.getBoundingClientRect(),u=e.offsetHeight,d=e.clientHeight,f=e.offsetWidth,p=e.clientWidth,m=N(a),g=N(i),v=N(c),h=N(l),b=R(Math.round(s.width/f*1e3)/1e3),y=R(Math.round(s.height/u*1e3)/1e3),x=m*y,w=v*b,E=0,C=0;if("clip"===r){var Z=N(o);E=Z*b,C=Z*y}var S=s.x+w-E,O=s.y+x-C,k=S+s.width+2*E-w-h*b-(f-p-v-h)*b,j=O+s.height+2*C-x-g*y-(u-d-m-g)*y;n.left=Math.max(n.left,S),n.top=Math.max(n.top,O),n.right=Math.min(n.right,k),n.bottom=Math.min(n.bottom,j)}}),n}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?parseFloat(r[1])/100*e:parseFloat(n)}function T(e,t){var n=(0,o.Z)(t||[],2),r=n[0],a=n[1];return[F(e.width,r),F(e.height,a)]}function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[e[0],e[1]]}function _(e,t){var n,r=t[0],o=t[1];return n="t"===r?e.y:"b"===r?e.y+e.height:e.y+e.height/2,{x:"l"===o?e.x:"r"===o?e.x+e.width:e.x+e.width/2,y:n}}function B(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(e,r){return r===t?n[e]||"c":e}).join("")}var H=n(83145);n(32559);var z=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"],L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.Z;return v.forwardRef(function(t,n){var i,c,h,b,y,x,w,E,N,F,L,D,W,V,q,X,G,U=t.prefixCls,$=void 0===U?"rc-trigger-popup":U,K=t.children,Y=t.action,Q=t.showAction,J=t.hideAction,ee=t.popupVisible,et=t.defaultPopupVisible,en=t.onPopupVisibleChange,er=t.afterPopupVisibleChange,eo=t.mouseEnterDelay,ea=t.mouseLeaveDelay,ei=void 0===ea?.1:ea,ec=t.focusDelay,el=t.blurDelay,es=t.mask,eu=t.maskClosable,ed=t.getPopupContainer,ef=t.forceRender,ep=t.autoDestroy,em=t.destroyPopupOnHide,eg=t.popup,ev=t.popupClassName,eh=t.popupStyle,eb=t.popupPlacement,ey=t.builtinPlacements,ex=void 0===ey?{}:ey,ew=t.popupAlign,eE=t.zIndex,eC=t.stretch,eZ=t.getPopupClassNameFromAlign,eS=t.fresh,eO=t.alignPoint,ek=t.onPopupClick,ej=t.onPopupAlign,eI=t.arrow,eM=t.popupMotion,eR=t.maskMotion,eN=t.popupTransitionName,eP=t.popupAnimation,eF=t.maskTransitionName,eT=t.maskAnimation,eA=t.className,e_=t.getTriggerDOMNode,eB=(0,a.Z)(t,z),eH=v.useState(!1),ez=(0,o.Z)(eH,2),eL=ez[0],eD=ez[1];(0,m.Z)(function(){eD((0,g.Z)())},[]);var eW=v.useRef({}),eV=v.useContext(S),eq=v.useMemo(function(){return{registerSubPopup:function(e,t){eW.current[e]=t,null==eV||eV.registerSubPopup(e,t)}}},[eV]),eX=(0,p.Z)(),eG=v.useState(null),eU=(0,o.Z)(eG,2),e$=eU[0],eK=eU[1],eY=v.useRef(null),eQ=(0,f.Z)(function(e){eY.current=e,(0,u.Sh)(e)&&e$!==e&&eK(e),null==eV||eV.registerSubPopup(eX,e)}),eJ=v.useState(null),e0=(0,o.Z)(eJ,2),e1=e0[0],e2=e0[1],e6=v.useRef(null),e5=(0,f.Z)(function(e){(0,u.Sh)(e)&&e1!==e&&(e2(e),e6.current=e)}),e4=v.Children.only(K),e3=(null==e4?void 0:e4.props)||{},e7={},e9=(0,f.Z)(function(e){var t,n;return(null==e1?void 0:e1.contains(e))||(null===(t=(0,d.A)(e1))||void 0===t?void 0:t.host)===e||e===e1||(null==e$?void 0:e$.contains(e))||(null===(n=(0,d.A)(e$))||void 0===n?void 0:n.host)===e||e===e$||Object.values(eW.current).some(function(t){return(null==t?void 0:t.contains(e))||e===t})}),e8=j($,eM,eP,eN),te=j($,eR,eT,eF),tt=v.useState(et||!1),tn=(0,o.Z)(tt,2),tr=tn[0],to=tn[1],ta=null!=ee?ee:tr,ti=(0,f.Z)(function(e){void 0===ee&&to(e)});(0,m.Z)(function(){to(ee||!1)},[ee]);var tc=v.useRef(ta);tc.current=ta;var tl=v.useRef([]);tl.current=[];var ts=(0,f.Z)(function(e){var t;ti(e),(null!==(t=tl.current[tl.current.length-1])&&void 0!==t?t:ta)!==e&&(tl.current.push(e),null==en||en(e))}),tu=v.useRef(),td=function(){clearTimeout(tu.current)},tf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;td(),0===t?ts(e):tu.current=setTimeout(function(){ts(e)},1e3*t)};v.useEffect(function(){return td},[]);var tp=v.useState(!1),tm=(0,o.Z)(tp,2),tg=tm[0],tv=tm[1];(0,m.Z)(function(e){(!e||ta)&&tv(!0)},[ta]);var th=v.useState(null),tb=(0,o.Z)(th,2),ty=tb[0],tx=tb[1],tw=v.useState(null),tE=(0,o.Z)(tw,2),tC=tE[0],tZ=tE[1],tS=function(e){tZ([e.clientX,e.clientY])},tO=(i=eO&&null!==tC?tC:e1,c=v.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:ex[eb]||{}}),b=(h=(0,o.Z)(c,2))[0],y=h[1],x=v.useRef(0),w=v.useMemo(function(){return e$?M(e$):[]},[e$]),E=v.useRef({}),ta||(E.current={}),N=(0,f.Z)(function(){if(e$&&i&&ta){var e=e$.ownerDocument,t=I(e$),n=t.getComputedStyle(e$).position,a=e$.style.left,c=e$.style.top,l=e$.style.right,s=e$.style.bottom,d=e$.style.overflow,f=(0,r.Z)((0,r.Z)({},ex[eb]),ew),p=e.createElement("div");if(null===(b=e$.parentElement)||void 0===b||b.appendChild(p),p.style.left="".concat(e$.offsetLeft,"px"),p.style.top="".concat(e$.offsetTop,"px"),p.style.position=n,p.style.height="".concat(e$.offsetHeight,"px"),p.style.width="".concat(e$.offsetWidth,"px"),e$.style.left="0",e$.style.top="0",e$.style.right="auto",e$.style.bottom="auto",e$.style.overflow="hidden",Array.isArray(i))S={x:i[0],y:i[1],width:0,height:0};else{var m,g,v,h,b,x,C,Z,S,O,j,M=i.getBoundingClientRect();M.x=null!==(O=M.x)&&void 0!==O?O:M.left,M.y=null!==(j=M.y)&&void 0!==j?j:M.top,S={x:M.x,y:M.y,width:M.width,height:M.height}}var N=e$.getBoundingClientRect(),F=t.getComputedStyle(e$),H=F.height,z=F.width;N.x=null!==(x=N.x)&&void 0!==x?x:N.left,N.y=null!==(C=N.y)&&void 0!==C?C:N.top;var L=e.documentElement,D=L.clientWidth,W=L.clientHeight,V=L.scrollWidth,q=L.scrollHeight,X=L.scrollTop,G=L.scrollLeft,U=N.height,$=N.width,K=S.height,Y=S.width,Q=f.htmlRegion,J="visible",ee="visibleFirst";"scroll"!==Q&&Q!==ee&&(Q=J);var et=Q===ee,en=P({left:-G,top:-X,right:V-G,bottom:q-X},w),er=P({left:0,top:0,right:D,bottom:W},w),eo=Q===J?er:en,ea=et?er:eo;e$.style.left="auto",e$.style.top="auto",e$.style.right="0",e$.style.bottom="0";var ei=e$.getBoundingClientRect();e$.style.left=a,e$.style.top=c,e$.style.right=l,e$.style.bottom=s,e$.style.overflow=d,null===(Z=e$.parentElement)||void 0===Z||Z.removeChild(p);var ec=R(Math.round($/parseFloat(z)*1e3)/1e3),el=R(Math.round(U/parseFloat(H)*1e3)/1e3);if(!(0===ec||0===el||(0,u.Sh)(i)&&!(0,k.Z)(i))){var es=f.offset,eu=f.targetOffset,ed=T(N,es),ef=(0,o.Z)(ed,2),ep=ef[0],em=ef[1],eg=T(S,eu),ev=(0,o.Z)(eg,2),eh=ev[0],ey=ev[1];S.x-=eh,S.y-=ey;var eE=f.points||[],eC=(0,o.Z)(eE,2),eZ=eC[0],eS=A(eC[1]),eO=A(eZ),ek=_(S,eS),eI=_(N,eO),eM=(0,r.Z)({},f),eR=ek.x-eI.x+ep,eN=ek.y-eI.y+em,eP=tc(eR,eN),eF=tc(eR,eN,er),eT=_(S,["t","l"]),eA=_(N,["t","l"]),e_=_(S,["b","r"]),eB=_(N,["b","r"]),eH=f.overflow||{},ez=eH.adjustX,eL=eH.adjustY,eD=eH.shiftX,eW=eH.shiftY,eV=function(e){return"boolean"==typeof e?e:e>=0};tl();var eq=eV(eL),eX=eO[0]===eS[0];if(eq&&"t"===eO[0]&&(g>ea.bottom||E.current.bt)){var eG=eN;eX?eG-=U-K:eG=eT.y-eB.y-em;var eU=tc(eR,eG),eK=tc(eR,eG,er);eU>eP||eU===eP&&(!et||eK>=eF)?(E.current.bt=!0,eN=eG,em=-em,eM.points=[B(eO,0),B(eS,0)]):E.current.bt=!1}if(eq&&"b"===eO[0]&&(meP||eQ===eP&&(!et||eJ>=eF)?(E.current.tb=!0,eN=eY,em=-em,eM.points=[B(eO,0),B(eS,0)]):E.current.tb=!1}var e0=eV(ez),e1=eO[1]===eS[1];if(e0&&"l"===eO[1]&&(h>ea.right||E.current.rl)){var e2=eR;e1?e2-=$-Y:e2=eT.x-eB.x-ep;var e6=tc(e2,eN),e5=tc(e2,eN,er);e6>eP||e6===eP&&(!et||e5>=eF)?(E.current.rl=!0,eR=e2,ep=-ep,eM.points=[B(eO,1),B(eS,1)]):E.current.rl=!1}if(e0&&"r"===eO[1]&&(veP||e3===eP&&(!et||e7>=eF)?(E.current.lr=!0,eR=e4,ep=-ep,eM.points=[B(eO,1),B(eS,1)]):E.current.lr=!1}tl();var e9=!0===eD?0:eD;"number"==typeof e9&&(ver.right&&(eR-=h-er.right-ep,S.x>er.right-e9&&(eR+=S.x-er.right+e9)));var e8=!0===eW?0:eW;"number"==typeof e8&&(mer.bottom&&(eN-=g-er.bottom-em,S.y>er.bottom-e8&&(eN+=S.y-er.bottom+e8)));var te=N.x+eR,tt=N.y+eN,tn=S.x,tr=S.y;null==ej||ej(e$,eM);var to=ei.right-N.x-(eR+N.width),ti=ei.bottom-N.y-(eN+N.height);1===ec&&(eR=Math.round(eR),to=Math.round(to)),1===el&&(eN=Math.round(eN),ti=Math.round(ti)),y({ready:!0,offsetX:eR/ec,offsetY:eN/el,offsetR:to/ec,offsetB:ti/el,arrowX:((Math.max(te,tn)+Math.min(te+$,tn+Y))/2-te)/ec,arrowY:((Math.max(tt,tr)+Math.min(tt+U,tr+K))/2-tt)/el,scaleX:ec,scaleY:el,align:eM})}function tc(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eo,r=N.x+e,o=N.y+t,a=Math.max(r,n.left),i=Math.max(o,n.top);return Math.max(0,(Math.min(r+$,n.right)-a)*(Math.min(o+U,n.bottom)-i))}function tl(){g=(m=N.y+eN)+U,h=(v=N.x+eR)+$}}}),F=function(){y(function(e){return(0,r.Z)((0,r.Z)({},e),{},{ready:!1})})},(0,m.Z)(F,[eb]),(0,m.Z)(function(){ta||F()},[ta]),[b.ready,b.offsetX,b.offsetY,b.offsetR,b.offsetB,b.arrowX,b.arrowY,b.scaleX,b.scaleY,b.align,function(){x.current+=1;var e=x.current;Promise.resolve().then(function(){x.current===e&&N()})}]),tk=(0,o.Z)(tO,11),tj=tk[0],tI=tk[1],tM=tk[2],tR=tk[3],tN=tk[4],tP=tk[5],tF=tk[6],tT=tk[7],tA=tk[8],t_=tk[9],tB=tk[10],tH=(L=void 0===Y?"hover":Y,v.useMemo(function(){var e=O(null!=Q?Q:L),t=O(null!=J?J:L),n=new Set(e),r=new Set(t);return eL&&(n.has("hover")&&(n.delete("hover"),n.add("click")),r.has("hover")&&(r.delete("hover"),r.add("click"))),[n,r]},[eL,L,Q,J])),tz=(0,o.Z)(tH,2),tL=tz[0],tD=tz[1],tW=tL.has("click"),tV=tD.has("click")||tD.has("contextMenu"),tq=(0,f.Z)(function(){tg||tB()});D=function(){tc.current&&eO&&tV&&tf(!1)},(0,m.Z)(function(){if(ta&&e1&&e$){var e=M(e1),t=M(e$),n=I(e$),r=new Set([n].concat((0,H.Z)(e),(0,H.Z)(t)));function o(){tq(),D()}return r.forEach(function(e){e.addEventListener("scroll",o,{passive:!0})}),n.addEventListener("resize",o,{passive:!0}),tq(),function(){r.forEach(function(e){e.removeEventListener("scroll",o),n.removeEventListener("resize",o)})}}},[ta,e1,e$]),(0,m.Z)(function(){tq()},[tC,eb]),(0,m.Z)(function(){ta&&!(null!=ex&&ex[eb])&&tq()},[JSON.stringify(ew)]);var tX=v.useMemo(function(){var e=function(e,t,n,r){for(var o=n.points,a=Object.keys(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}(null===(c=e[l])||void 0===c?void 0:c.points,o,r))return"".concat(t,"-placement-").concat(l)}return""}(ex,$,t_,eO);return l()(e,null==eZ?void 0:eZ(t_))},[t_,eZ,ex,$,eO]);v.useImperativeHandle(n,function(){return{nativeElement:e6.current,popupElement:eY.current,forceAlign:tq}});var tG=v.useState(0),tU=(0,o.Z)(tG,2),t$=tU[0],tK=tU[1],tY=v.useState(0),tQ=(0,o.Z)(tY,2),tJ=tQ[0],t0=tQ[1],t1=function(){if(eC&&e1){var e=e1.getBoundingClientRect();tK(e.width),t0(e.height)}};function t2(e,t,n,r){e7[e]=function(o){var a;null==r||r(o),tf(t,n);for(var i=arguments.length,c=Array(i>1?i-1:0),l=1;l1?n-1:0),o=1;o1?n-1:0),o=1;o{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM11 15V17H13V15H11ZM11 7V13H13V7H11Z"}))},i=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M1.18164 12C2.12215 6.87976 6.60812 3 12.0003 3C17.3924 3 21.8784 6.87976 22.8189 12C21.8784 17.1202 17.3924 21 12.0003 21C6.60812 21 2.12215 17.1202 1.18164 12ZM12.0003 17C14.7617 17 17.0003 14.7614 17.0003 12C17.0003 9.23858 14.7617 7 12.0003 7C9.23884 7 7.00026 9.23858 7.00026 12C7.00026 14.7614 9.23884 17 12.0003 17ZM12.0003 15C10.3434 15 9.00026 13.6569 9.00026 12C9.00026 10.3431 10.3434 9 12.0003 9C13.6571 9 15.0003 10.3431 15.0003 12C15.0003 13.6569 13.6571 15 12.0003 15Z"}))},c=e=>{var t=(0,r._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),o.createElement("path",{d:"M4.52047 5.93457L1.39366 2.80777L2.80788 1.39355L22.6069 21.1925L21.1927 22.6068L17.8827 19.2968C16.1814 20.3755 14.1638 21.0002 12.0003 21.0002C6.60812 21.0002 2.12215 17.1204 1.18164 12.0002C1.61832 9.62282 2.81932 7.5129 4.52047 5.93457ZM14.7577 16.1718L13.2937 14.7078C12.902 14.8952 12.4634 15.0002 12.0003 15.0002C10.3434 15.0002 9.00026 13.657 9.00026 12.0002C9.00026 11.537 9.10522 11.0984 9.29263 10.7067L7.82866 9.24277C7.30514 10.0332 7.00026 10.9811 7.00026 12.0002C7.00026 14.7616 9.23884 17.0002 12.0003 17.0002C13.0193 17.0002 13.9672 16.6953 14.7577 16.1718ZM7.97446 3.76015C9.22127 3.26959 10.5793 3.00016 12.0003 3.00016C17.3924 3.00016 21.8784 6.87992 22.8189 12.0002C22.5067 13.6998 21.8038 15.2628 20.8068 16.5925L16.947 12.7327C16.9821 12.4936 17.0003 12.249 17.0003 12.0002C17.0003 9.23873 14.7617 7.00016 12.0003 7.00016C11.7514 7.00016 11.5068 7.01833 11.2677 7.05343L7.97446 3.76015Z"}))};var l=n(96398),s=n(13241),u=n(1153);let d=o.forwardRef((e,t)=>{let{value:n,defaultValue:d,type:f,placeholder:p="Type...",icon:m,error:g=!1,errorMessage:v,disabled:h=!1,stepper:b,makeInputClassName:y,className:x,onChange:w,onValueChange:E,autoFocus:C,pattern:Z}=e,S=(0,r._T)(e,["value","defaultValue","type","placeholder","icon","error","errorMessage","disabled","stepper","makeInputClassName","className","onChange","onValueChange","autoFocus","pattern"]),[O,k]=(0,o.useState)(C||!1),[j,I]=(0,o.useState)(!1),M=(0,o.useCallback)(()=>I(!j),[j,I]),R=(0,o.useRef)(null),N=(0,l.Uh)(n||d);return o.useEffect(()=>{let e=()=>k(!0),t=()=>k(!1),n=R.current;return n&&(n.addEventListener("focus",e),n.addEventListener("blur",t),C&&n.focus()),()=>{n&&(n.removeEventListener("focus",e),n.removeEventListener("blur",t))}},[C]),o.createElement(o.Fragment,null,o.createElement("div",{className:(0,s.q)(y("root"),"relative w-full flex items-center min-w-[10rem] outline-none rounded-tremor-default transition duration-100 border","shadow-tremor-input","dark:shadow-dark-tremor-input",(0,l.um)(N,h,g),O&&(0,s.q)("ring-2","border-tremor-brand-subtle ring-tremor-brand-muted","dark:border-dark-tremor-brand-subtle dark:ring-dark-tremor-brand-muted"),x)},m?o.createElement(m,{className:(0,s.q)(y("icon"),"shrink-0 h-5 w-5 mx-2.5 absolute left-0 flex items-center","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}):null,o.createElement("input",Object.assign({ref:(0,u.lq)([R,t]),defaultValue:d,value:n,type:j?"text":f,className:(0,s.q)(y("input"),"w-full bg-transparent focus:outline-none focus:ring-0 border-none text-tremor-default rounded-tremor-default transition duration-100 py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis","[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none","password"===f?g?"pr-16":"pr-12":g?"pr-8":"pr-3",m?"pl-10":"pl-3",h?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content"),placeholder:p,disabled:h,"data-testid":"base-input",onChange:e=>{null==w||w(e),null==E||E(e.target.value)},pattern:Z},S)),"password"!==f||h?null:o.createElement("button",{className:(0,s.q)(y("toggleButton"),"absolute inset-y-0 right-0 flex items-center px-2.5 rounded-lg"),type:"button",onClick:()=>M(),"aria-label":j?"Hide password":"Show Password"},j?o.createElement(c,{className:(0,s.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0}):o.createElement(i,{className:(0,s.q)("flex-none h-5 w-5 transition","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle hover:dark:text-dark-tremor-content"),"aria-hidden":!0})),g?o.createElement(a,{className:(0,s.q)(y("errorIcon"),"text-red-500 shrink-0 h-5 w-5 absolute right-0 flex items-center","password"===f?"mr-10":"number"===f?b?"mr-20":"mr-3":"mx-2.5")}):null,null!=b?b:null),g&&v?o.createElement("p",{className:(0,s.q)(y("errorMessage"),"text-sm text-red-500 mt-1")},v):null)});d.displayName="BaseInput"},49566:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(5853),o=n(2265);n(13241);var a=n(1153),i=n(69262);let c=(0,a.fn)("TextInput"),l=o.forwardRef((e,t)=>{let{type:n="text"}=e,a=(0,r._T)(e,["type"]);return o.createElement(i.Z,Object.assign({ref:t,type:n,makeInputClassName:c},a))});l.displayName="TextInput"},96398:function(e,t,n){"use strict";n.d(t,{Uh:function(){return s},n0:function(){return c},qg:function(){return a},sl:function(){return i},um:function(){return l}});var r=n(13241),o=n(2265);let a=e=>["string","number"].includes(typeof e)?e:e instanceof Array?e.map(a).join(""):"object"==typeof e&&e?a(e.props.children):void 0;function i(e){let t=new Map;return o.Children.map(e,e=>{var n;t.set(e.props.value,null!==(n=a(e))&&void 0!==n?n:e.props.value)}),t}function c(e,t){return o.Children.map(t,t=>{var n;if((null!==(n=a(t))&&void 0!==n?n:t.props.value).toLowerCase().includes(e.toLowerCase()))return t})}let l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,r.q)(t?"bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle":"bg-tremor-background dark:bg-dark-tremor-background",!t&&"hover:bg-tremor-background-muted dark:hover:bg-dark-tremor-background-muted",e?"text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis":"text-tremor-content dark:text-dark-tremor-content",t&&"text-tremor-content-subtle dark:text-dark-tremor-content-subtle",n&&"text-red-500 placeholder:text-red-500 dark:text-red-500 dark:placeholder:text-red-500",n?"border-red-500 dark:border-red-500":"border-tremor-border dark:border-dark-tremor-border")};function s(e){return null!=e&&""!==e}},391:function(e,t,n){"use strict";var r=n(2265),o=n(39109),a=n(77685);t.Z=e=>{let{space:t,form:n,children:i}=e;if(null==i)return null;let c=i;return n&&(c=r.createElement(o.Ux,{override:!0,status:!0},c)),t&&(c=r.createElement(a.BR,null,c)),c}},93942:function(e,t,n){"use strict";n.d(t,{i:function(){return c}});var r=n(2265),o=n(50506),a=n(18310),i=n(71744);function c(e){return t=>r.createElement(a.ZP,{theme:{token:{motion:!1,zIndexPopupBase:0}}},r.createElement(e,Object.assign({},t)))}t.Z=(e,t,n,a,l)=>c(c=>{let{prefixCls:s,style:u}=c,d=r.useRef(null),[f,p]=r.useState(0),[m,g]=r.useState(0),[v,h]=(0,o.Z)(!1,{value:c.open}),{getPrefixCls:b}=r.useContext(i.E_),y=b(a||"select",s);r.useEffect(()=>{if(h(!0),"undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{let t=e[0].target;p(t.offsetHeight+8),g(t.offsetWidth)}),t=setInterval(()=>{var n;let r=l?".".concat(l(y)):".".concat(y,"-dropdown"),o=null===(n=d.current)||void 0===n?void 0:n.querySelector(r);o&&(clearInterval(t),e.observe(o))},10);return()=>{clearInterval(t),e.disconnect()}}},[y]);let x=Object.assign(Object.assign({},c),{style:Object.assign(Object.assign({},u),{margin:0}),open:v,visible:v,getPopupContainer:()=>d.current});return n&&(x=n(x)),t&&Object.assign(x,{[t]:{overflow:{adjustX:!1,adjustY:!1}}}),r.createElement("div",{ref:d,style:{paddingBottom:f,position:"relative",minWidth:m}},r.createElement(e,Object.assign({},x)))})},93350:function(e,t,n){"use strict";n.d(t,{o2:function(){return c},yT:function(){return l}});var r=n(83145),o=n(53454);let a=o.i.map(e=>"".concat(e,"-inverse")),i=["success","processing","error","default","warning"];function c(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return t?[].concat((0,r.Z)(a),(0,r.Z)(o.i)).includes(e):o.i.includes(e)}function l(e){return i.includes(e)}},94611:function(e,t,n){"use strict";var r=n(2265),o=n(39725);t.Z=e=>{let t;return"object"==typeof e&&(null==e?void 0:e.clearIcon)?t=e:e&&(t={clearIcon:r.createElement(o.Z,null)}),t}},51646:function(e,t,n){"use strict";n.d(t,{N:function(){return o}});var r=n(2265);let o=()=>r.useReducer(e=>e+1,0)},62236:function(e,t,n){"use strict";n.d(t,{Cn:function(){return s},u6:function(){return i}});var r=n(2265),o=n(84951),a=n(95140);let i=1e3,c={Modal:100,Drawer:100,Popover:100,Popconfirm:100,Tooltip:100,Tour:100,FloatButton:100},l={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1},s=(e,t)=>{let n;let[,i]=(0,o.ZP)(),s=r.useContext(a.Z);if(void 0!==t)n=[t,t];else{let r=null!=s?s:0;e in c?r+=(s?0:i.zIndexPopupBase)+c[e]:r+=l[e],n=[void 0===s?t:r,r]}return n}},16774:function(e,t,n){"use strict";n.d(t,{h:function(){return o},x:function(){return r}});let r=(e,t)=>{void 0!==(null==e?void 0:e.addEventListener)?e.addEventListener("change",t):void 0!==(null==e?void 0:e.addListener)&&e.addListener(t)},o=(e,t)=>{void 0!==(null==e?void 0:e.removeEventListener)?e.removeEventListener("change",t):void 0!==(null==e?void 0:e.removeListener)&&e.removeListener(t)}},68710:function(e,t,n){"use strict";n.d(t,{m:function(){return l}});var r=n(71744);let o=()=>({height:0,opacity:0}),a=e=>{let{scrollHeight:t}=e;return{height:t,opacity:1}},i=e=>({height:e?e.offsetHeight:0}),c=(e,t)=>(null==t?void 0:t.deadline)===!0||"height"===t.propertyName,l=(e,t,n)=>void 0!==n?n:"".concat(e,"-").concat(t);t.Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.Rf;return{motionName:"".concat(e,"-motion-collapse"),onAppearStart:o,onEnterStart:o,onAppearActive:a,onEnterActive:a,onLeaveStart:i,onLeaveActive:o,onAppearEnd:c,onEnterEnd:c,onLeaveEnd:c,motionDeadline:500}}},92736:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(88260);let o={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},a={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},i=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function c(e){let{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:c,offset:l,borderRadius:s,visibleFirst:u}=e,d=t/2,f={},p=(0,r.wZ)({contentRadius:s,limitVerticalRadius:!0});return Object.keys(o).forEach(e=>{let r=Object.assign(Object.assign({},c&&a[e]||o[e]),{offset:[0,0],dynamicInset:!0});switch(f[e]=r,i.has(e)&&(r.autoArrow=!1),e){case"top":case"topLeft":case"topRight":r.offset[1]=-d-l;break;case"bottom":case"bottomLeft":case"bottomRight":r.offset[1]=d+l;break;case"left":case"leftTop":case"leftBottom":r.offset[0]=-d-l;break;case"right":case"rightTop":case"rightBottom":r.offset[0]=d+l}if(c)switch(e){case"topLeft":case"bottomLeft":r.offset[0]=-p.arrowOffsetHorizontal-d;break;case"topRight":case"bottomRight":r.offset[0]=p.arrowOffsetHorizontal+d;break;case"leftTop":case"rightTop":r.offset[1]=-(2*p.arrowOffsetHorizontal)+d;break;case"leftBottom":case"rightBottom":r.offset[1]=2*p.arrowOffsetHorizontal-d}r.overflow=function(e,t,n,r){if(!1===r)return{adjustX:!1,adjustY:!1};let o={};switch(e){case"top":case"bottom":o.shiftX=2*t.arrowOffsetHorizontal+n,o.shiftY=!0,o.adjustY=!0;break;case"left":case"right":o.shiftY=2*t.arrowOffsetVertical+n,o.shiftX=!0,o.adjustX=!0}let a=Object.assign(Object.assign({},o),r&&"object"==typeof r?r:{});return a.shiftX||(a.adjustX=!0),a.shiftY||(a.adjustY=!0),a}(e,p,t,n),u&&(r.htmlRegion="visibleFirst")}),f}},19722:function(e,t,n){"use strict";n.d(t,{M2:function(){return o},Tm:function(){return i},wm:function(){return a}});var r=n(2265);function o(e){return e&&r.isValidElement(e)&&e.type===r.Fragment}let a=(e,t,n)=>r.isValidElement(e)?r.cloneElement(e,"function"==typeof n?n(e.props||{}):n):t;function i(e,t){return a(e,e,t)}},6543:function(e,t,n){"use strict";n.d(t,{c4:function(){return i},m9:function(){return s}});var r=n(2265),o=n(84951),a=n(16774);let i=["xxl","xl","lg","md","sm","xs"],c=e=>({xs:"(max-width: ".concat(e.screenXSMax,"px)"),sm:"(min-width: ".concat(e.screenSM,"px)"),md:"(min-width: ".concat(e.screenMD,"px)"),lg:"(min-width: ".concat(e.screenLG,"px)"),xl:"(min-width: ".concat(e.screenXL,"px)"),xxl:"(min-width: ".concat(e.screenXXL,"px)")}),l=e=>{let t=[].concat(i).reverse();return t.forEach((n,r)=>{let o=n.toUpperCase(),a="screen".concat(o,"Min"),i="screen".concat(o);if(!(e[a]<=e[i]))throw Error("".concat(a,"<=").concat(i," fails : !(").concat(e[a],"<=").concat(e[i],")"));if(r{if(t){for(let n of i)if(e[n]&&(null==t?void 0:t[n])!==void 0)return t[n]}};t.ZP=()=>{let[,e]=(0,o.ZP)(),t=c(l(e));return r.useMemo(()=>{let e=new Map,n=-1,r={};return{responsiveMap:t,matchHandlers:{},dispatch:t=>(r=t,e.forEach(e=>e(r)),e.size>=1),subscribe(t){return e.size||this.register(),n+=1,e.set(n,t),t(r),n},unsubscribe(t){e.delete(t),e.size||this.unregister()},register(){Object.entries(t).forEach(e=>{let[t,n]=e,o=e=>{let{matches:n}=e;this.dispatch(Object.assign(Object.assign({},r),{[t]:n}))},i=window.matchMedia(n);(0,a.x)(i,o),this.matchHandlers[n]={mql:i,listener:o},o(i)})},unregister(){Object.values(t).forEach(e=>{let t=this.matchHandlers[e];(0,a.h)(null==t?void 0:t.mql,null==t?void 0:t.listener)}),e.clear()}}},[t])}},12757:function(e,t,n){"use strict";n.d(t,{F:function(){return i},Z:function(){return a}});var r=n(36760),o=n.n(r);function a(e,t,n){return o()({["".concat(e,"-status-success")]:"success"===t,["".concat(e,"-status-warning")]:"warning"===t,["".concat(e,"-status-error")]:"error"===t,["".concat(e,"-status-validating")]:"validating"===t,["".concat(e,"-has-feedback")]:n})}let i=(e,t)=>t||e},13613:function(e,t,n){"use strict";n.d(t,{G8:function(){return a},ln:function(){return i}});var r=n(2265);function o(){}n(32559);let a=r.createContext({}),i=()=>{let e=()=>{};return e.deprecated=o,e}},6694:function(e,t,n){"use strict";n.d(t,{Z:function(){return E}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2857),c=n(28791),l=n(71744),s=n(19722),u=(0,n(99320).A1)("Wave",e=>{let{componentCls:t,colorPrimary:n}=e;return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:"var(--wave-color, ".concat(n,")"),boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:["box-shadow 0.4s ".concat(e.motionEaseOutCirc),"opacity 2s ".concat(e.motionEaseOutCirc)].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:["box-shadow ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut),"opacity ".concat(e.motionDurationSlow," ").concat(e.motionEaseInOut)].join(",")}}}}}),d=n(58525),f=n(53346),p=n(84951),m=n(34709),g=n(66632),v=n(66061);function h(e){return e&&"#fff"!==e&&"#ffffff"!==e&&"rgb(255, 255, 255)"!==e&&"rgba(255, 255, 255, 1)"!==e&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&"transparent"!==e&&"canvastext"!==e}function b(e){return Number.isNaN(e)?0:e}let y=e=>{let{className:t,target:n,component:o,registerUnmount:i}=e,l=r.useRef(null),s=r.useRef(null);r.useEffect(()=>{s.current=i()},[]);let[u,d]=r.useState(null),[p,v]=r.useState([]),[y,x]=r.useState(0),[w,E]=r.useState(0),[C,Z]=r.useState(0),[S,O]=r.useState(0),[k,j]=r.useState(!1),I={left:y,top:w,width:C,height:S,borderRadius:p.map(e=>"".concat(e,"px")).join(" ")};function M(){let e=getComputedStyle(n);d(function(e){var t;let{borderTopColor:n,borderColor:r,backgroundColor:o}=getComputedStyle(e);return null!==(t=[n,r,o].find(h))&&void 0!==t?t:null}(n));let t="static"===e.position,{borderLeftWidth:r,borderTopWidth:o}=e;x(t?n.offsetLeft:b(-Number.parseFloat(r))),E(t?n.offsetTop:b(-Number.parseFloat(o))),Z(n.offsetWidth),O(n.offsetHeight);let{borderTopLeftRadius:a,borderTopRightRadius:i,borderBottomLeftRadius:c,borderBottomRightRadius:l}=e;v([a,i,l,c].map(e=>b(Number.parseFloat(e))))}if(u&&(I["--wave-color"]=u),r.useEffect(()=>{if(n){let e;let t=(0,f.Z)(()=>{M(),j(!0)});return"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(M)).observe(n),()=>{f.Z.cancel(t),null==e||e.disconnect()}}},[n]),!k)return null;let R=("Checkbox"===o||"Radio"===o)&&(null==n?void 0:n.classList.contains(m.A));return r.createElement(g.ZP,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(e,t)=>{var n,r;if(t.deadline||"opacity"===t.propertyName){let e=null===(n=l.current)||void 0===n?void 0:n.parentElement;null===(r=s.current)||void 0===r||r.call(s).then(()=>{null==e||e.remove()})}return!1}},(e,n)=>{let{className:o}=e;return r.createElement("div",{ref:(0,c.sQ)(l,n),className:a()(t,o,{"wave-quick":R}),style:I})})};var x=(e,t)=>{var n;let{component:o}=t;if("Checkbox"===o&&!(null===(n=e.querySelector("input"))||void 0===n?void 0:n.checked))return;let a=document.createElement("div");a.style.position="absolute",a.style.left="0px",a.style.top="0px",null==e||e.insertBefore(a,null==e?void 0:e.firstChild);let i=(0,v.q)(),c=null;c=i(r.createElement(y,Object.assign({},t,{target:e,registerUnmount:function(){return c}})),a)},w=(e,t,n)=>{let{wave:o}=r.useContext(l.E_),[,a,i]=(0,p.ZP)(),c=(0,d.Z)(r=>{let c=e.current;if((null==o?void 0:o.disabled)||!c)return;let l=c.querySelector(".".concat(m.A))||c,{showEffect:s}=o||{};(s||x)(l,{className:t,token:a,component:n,event:r,hashId:i})}),s=r.useRef(null);return e=>{f.Z.cancel(s.current),s.current=(0,f.Z)(()=>{c(e)})}},E=e=>{let{children:t,disabled:n,component:o}=e,{getPrefixCls:d}=(0,r.useContext)(l.E_),f=(0,r.useRef)(null),p=d("wave"),[,m]=u(p),g=w(f,a()(p,m),o);if(r.useEffect(()=>{let e=f.current;if(!e||e.nodeType!==window.Node.ELEMENT_NODE||n)return;let t=t=>{!(0,i.Z)(t.target)||!e.getAttribute||e.getAttribute("disabled")||e.disabled||e.className.includes("disabled")&&!e.className.includes("disabled:")||"true"===e.getAttribute("aria-disabled")||e.className.includes("-leave")||g(t)};return e.addEventListener("click",t,!0),()=>{e.removeEventListener("click",t,!0)}},[n]),!r.isValidElement(t))return null!=t?t:null;let v=(0,c.Yr)(t)?(0,c.sQ)((0,c.C4)(t),f):f;return(0,s.Tm)(t,{ref:v})}},34709:function(e,t,n){"use strict";n.d(t,{A:function(){return o}});var r=n(71744);let o="".concat(r.Rf,"-wave-target")},95140:function(e,t,n){"use strict";let r=n(2265).createContext(void 0);t.Z=r},52402:function(e,t,n){"use strict";n.d(t,{J:function(){return r}});let r=n(2265).createContext({})},51248:function(e,t,n){"use strict";n.d(t,{Dn:function(){return d},aG:function(){return l},hU:function(){return f},nx:function(){return s}});var r=n(83145),o=n(2265),a=n(19722),i=n(53454);let c=/^[\u4E00-\u9FA5]{2}$/,l=c.test.bind(c);function s(e){return"danger"===e?{danger:!0}:{type:e}}function u(e){return"string"==typeof e}function d(e){return"text"===e||"link"===e}function f(e,t){let n=!1,r=[];return o.Children.forEach(e,e=>{let t=typeof e,o="string"===t||"number"===t;if(n&&o){let t=r.length-1,n=r[t];r[t]="".concat(n).concat(e)}else r.push(e);n=o}),o.Children.map(r,e=>(function(e,t){if(null==e)return;let n=t?" ":"";return"string"!=typeof e&&"number"!=typeof e&&u(e.type)&&l(e.props.children)?(0,a.Tm)(e,{children:e.props.children.split("").join(n)}):u(e)?l(e)?o.createElement("span",null,e.split("").join(n)):o.createElement("span",null,e):(0,a.M2)(e)?o.createElement("span",null,e):e})(e,t))}["default","primary","danger"].concat((0,r.Z)(i.i))},5545:function(e,t,n){"use strict";n.d(t,{ZP:function(){return eh}});var r=n(2265),o=n(36760),a=n.n(o),i=n(27380),c=n(18694),l=n(28791),s=n(6694),u=n(71744),d=n(86586),f=n(33759),p=n(77685),m=n(84951),g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let v=r.createContext(void 0);var h=n(51248),b=n(61935),y=n(66632);let x=(0,r.forwardRef)((e,t)=>{let{className:n,style:o,children:i,prefixCls:c}=e,l=a()("".concat(c,"-icon"),n);return r.createElement("span",{ref:t,className:l,style:o},i)}),w=(0,r.forwardRef)((e,t)=>{let{prefixCls:n,className:o,style:i,iconClassName:c}=e,l=a()("".concat(n,"-loading-icon"),o);return r.createElement(x,{prefixCls:n,className:l,style:i,ref:t},r.createElement(b.Z,{className:c}))}),E=()=>({width:0,opacity:0,transform:"scale(0)"}),C=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"});var Z=e=>{let{prefixCls:t,loading:n,existIcon:o,className:i,style:c,mount:l}=e;return o?r.createElement(w,{prefixCls:t,className:i,style:c}):r.createElement(y.ZP,{visible:!!n,motionName:"".concat(t,"-loading-icon-motion"),motionAppear:!l,motionEnter:!l,motionLeave:!l,removeOnLeave:!0,onAppearStart:E,onAppearActive:C,onEnterStart:E,onEnterActive:C,onLeaveStart:C,onLeaveActive:E},(e,n)=>{let{className:o,style:l}=e,s=Object.assign(Object.assign({},c),l);return r.createElement(w,{prefixCls:t,className:a()(i,o),style:s,ref:n})})},S=n(93463),O=n(12918),k=n(53454),j=n(71140),I=n(99320);let M=(e,t)=>({["> span, > ".concat(e)]:{"&:not(:last-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{["&, & > ".concat(e)]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}});var R=e=>{let{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:o,colorErrorHover:a}=e;return{["".concat(t,"-group")]:[{position:"relative",display:"inline-flex",["> span, > ".concat(t)]:{"&:not(:last-child)":{["&, & > ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),["&, & > ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},["".concat(t,"-icon-only")]:{fontSize:n}},M("".concat(t,"-primary"),o),M("".concat(t,"-danger"),a)]}},N=n(11357),P=n(75669);n(50506);let F=(e,t)=>{let{r:n,g:r,b:o,a}=e.toRgb(),i=new P.Il(e.toRgbString()).onBackground(t).toHsv();return a<=.5?i.v>.5:.299*n+.587*r+.114*o>192};var T=n(1319),A=n(17431);let _=e=>{let{paddingInline:t,onlyIconSize:n}=e;return(0,j.IX)(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},B=e=>{var t,n,r,o,a,i;let c=null!==(t=e.contentFontSize)&&void 0!==t?t:e.fontSize,l=null!==(n=e.contentFontSizeSM)&&void 0!==n?n:e.fontSize,s=null!==(r=e.contentFontSizeLG)&&void 0!==r?r:e.fontSizeLG,u=null!==(o=e.contentLineHeight)&&void 0!==o?o:(0,T.D)(c),d=null!==(a=e.contentLineHeightSM)&&void 0!==a?a:(0,T.D)(l),f=null!==(i=e.contentLineHeightLG)&&void 0!==i?i:(0,T.D)(s),p=F(new N.y9(e.colorBgSolid),"#fff")?"#000":"#fff";return Object.assign(Object.assign({},k.i.reduce((t,n)=>Object.assign(Object.assign({},t),{["".concat(n,"ShadowColor")]:"0 ".concat((0,S.bf)(e.controlOutlineWidth)," 0 ").concat((0,A.Z)(e["".concat(n,"1")],e.colorBgContainer))}),{})),{fontWeight:400,iconGap:e.marginXS,defaultShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.controlTmpOutline),primaryShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.controlOutline),dangerShadow:"0 ".concat(e.controlOutlineWidth,"px 0 ").concat(e.colorErrorOutline),primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:p,contentFontSize:c,contentFontSizeSM:l,contentFontSizeLG:s,contentLineHeight:u,contentLineHeightSM:d,contentLineHeightLG:f,paddingBlock:Math.max((e.controlHeight-c*u)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-l*d)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-s*f)/2-e.lineWidth,0)})},H=e=>{let{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:o,motionDurationSlow:a,motionEaseInOut:i,iconGap:c,calc:l}=e;return{[t]:{outline:"none",position:"relative",display:"inline-flex",gap:c,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",background:"transparent",border:"".concat((0,S.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),cursor:"pointer",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut),userSelect:"none",touchAction:"manipulation",color:e.colorText,"&:disabled > *":{pointerEvents:"none"},["".concat(t,"-icon > svg")]:(0,O.Ro)(),"> a":{color:"currentColor"},"&:not(:disabled)":(0,O.Qy)(e),["&".concat(t,"-two-chinese-chars::first-letter")]:{letterSpacing:"0.34em"},["&".concat(t,"-two-chinese-chars > *:not(").concat(n,")")]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},["&".concat(t,"-icon-only")]:{paddingInline:0,["&".concat(t,"-compact-item")]:{flex:"none"}},["&".concat(t,"-loading")]:{opacity:o,cursor:"default"},["".concat(t,"-loading-icon")]:{transition:["width","opacity","margin"].map(e=>"".concat(e," ").concat(a," ").concat(i)).join(",")},["&:not(".concat(t,"-icon-end)")]:{["".concat(t,"-loading-icon-motion")]:{"&-appear-start, &-enter-start":{marginInlineEnd:l(c).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:l(c).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",["".concat(t,"-loading-icon-motion")]:{"&-appear-start, &-enter-start":{marginInlineStart:l(c).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:l(c).mul(-1).equal()}}}}}},z=(e,t,n)=>({["&:not(:disabled):not(".concat(e,"-disabled)")]:{"&:hover":t,"&:active":n}}),L=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:"50%"}),D=e=>({cursor:"not-allowed",borderColor:e.borderColorDisabled,color:e.colorTextDisabled,background:e.colorBgContainerDisabled,boxShadow:"none"}),W=(e,t,n,r,o,a,i,c)=>({["&".concat(e,"-background-ghost")]:Object.assign(Object.assign({color:n||void 0,background:t,borderColor:r||void 0,boxShadow:"none"},z(e,Object.assign({background:t},i),Object.assign({background:t},c))),{"&:disabled":{cursor:"not-allowed",color:o||void 0,borderColor:a||void 0}})}),V=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:Object.assign({},D(e))}),q=e=>({["&:disabled, &".concat(e.componentCls,"-disabled")]:{cursor:"not-allowed",color:e.colorTextDisabled}}),X=(e,t,n,r)=>Object.assign(Object.assign({},(r&&["link","text"].includes(r)?q:V)(e)),z(e.componentCls,t,n)),G=(e,t,n,r,o)=>({["&".concat(e.componentCls,"-variant-solid")]:Object.assign({color:t,background:n},X(e,r,o))}),U=(e,t,n,r,o)=>({["&".concat(e.componentCls,"-variant-outlined, &").concat(e.componentCls,"-variant-dashed")]:Object.assign({borderColor:t,background:n},X(e,r,o))}),$=e=>({["&".concat(e.componentCls,"-variant-dashed")]:{borderStyle:"dashed"}}),K=(e,t,n,r)=>({["&".concat(e.componentCls,"-variant-filled")]:Object.assign({boxShadow:"none",background:t},X(e,n,r))}),Y=(e,t,n,r,o)=>({["&".concat(e.componentCls,"-variant-").concat(n)]:Object.assign({color:t,boxShadow:"none"},X(e,r,o,n))}),Q=e=>{let{componentCls:t}=e;return k.i.reduce((n,r)=>{let o=e["".concat(r,"6")],a=e["".concat(r,"1")],i=e["".concat(r,"5")],c=e["".concat(r,"2")],l=e["".concat(r,"3")],s=e["".concat(r,"7")];return Object.assign(Object.assign({},n),{["&".concat(t,"-color-").concat(r)]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:o,boxShadow:e["".concat(r,"ShadowColor")]},G(e,e.colorTextLightSolid,o,{background:i},{background:s})),U(e,o,e.colorBgContainer,{color:i,borderColor:i,background:e.colorBgContainer},{color:s,borderColor:s,background:e.colorBgContainer})),$(e)),K(e,a,{color:o,background:c},{color:o,background:l})),Y(e,o,"link",{color:i},{color:s})),Y(e,o,"text",{color:i,background:a},{color:s,background:l}))})},{})},J=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.defaultColor,boxShadow:e.defaultShadow},G(e,e.solidTextColor,e.colorBgSolid,{color:e.solidTextColor,background:e.colorBgSolidHover},{color:e.solidTextColor,background:e.colorBgSolidActive})),$(e)),K(e,e.colorFillTertiary,{color:e.defaultColor,background:e.colorFillSecondary},{color:e.defaultColor,background:e.colorFill})),W(e.componentCls,e.ghostBg,e.defaultGhostColor,e.defaultGhostBorderColor,e.colorTextDisabled,e.colorBorder)),Y(e,e.textTextColor,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),ee=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorPrimary,boxShadow:e.primaryShadow},U(e,e.colorPrimary,e.colorBgContainer,{color:e.colorPrimaryTextHover,borderColor:e.colorPrimaryHover,background:e.colorBgContainer},{color:e.colorPrimaryTextActive,borderColor:e.colorPrimaryActive,background:e.colorBgContainer})),$(e)),K(e,e.colorPrimaryBg,{color:e.colorPrimary,background:e.colorPrimaryBgHover},{color:e.colorPrimary,background:e.colorPrimaryBorder})),Y(e,e.colorPrimaryText,"text",{color:e.colorPrimaryTextHover,background:e.colorPrimaryBg},{color:e.colorPrimaryTextActive,background:e.colorPrimaryBorder})),Y(e,e.colorPrimaryText,"link",{color:e.colorPrimaryTextHover,background:e.linkHoverBg},{color:e.colorPrimaryTextActive})),W(e.componentCls,e.ghostBg,e.colorPrimary,e.colorPrimary,e.colorTextDisabled,e.colorBorder,{color:e.colorPrimaryHover,borderColor:e.colorPrimaryHover},{color:e.colorPrimaryActive,borderColor:e.colorPrimaryActive})),et=e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorError,boxShadow:e.dangerShadow},G(e,e.dangerColor,e.colorError,{background:e.colorErrorHover},{background:e.colorErrorActive})),U(e,e.colorError,e.colorBgContainer,{color:e.colorErrorHover,borderColor:e.colorErrorBorderHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),$(e)),K(e,e.colorErrorBg,{color:e.colorError,background:e.colorErrorBgFilledHover},{color:e.colorError,background:e.colorErrorBgActive})),Y(e,e.colorError,"text",{color:e.colorErrorHover,background:e.colorErrorBg},{color:e.colorErrorHover,background:e.colorErrorBgActive})),Y(e,e.colorError,"link",{color:e.colorErrorHover},{color:e.colorErrorActive})),W(e.componentCls,e.ghostBg,e.colorError,e.colorError,e.colorTextDisabled,e.colorBorder,{color:e.colorErrorHover,borderColor:e.colorErrorHover},{color:e.colorErrorActive,borderColor:e.colorErrorActive})),en=e=>Object.assign(Object.assign({},Y(e,e.colorLink,"link",{color:e.colorLinkHover},{color:e.colorLinkActive})),W(e.componentCls,e.ghostBg,e.colorInfo,e.colorInfo,e.colorTextDisabled,e.colorBorder,{color:e.colorInfoHover,borderColor:e.colorInfoHover},{color:e.colorInfoActive,borderColor:e.colorInfoActive})),er=e=>{let{componentCls:t}=e;return Object.assign({["".concat(t,"-color-default")]:J(e),["".concat(t,"-color-primary")]:ee(e),["".concat(t,"-color-dangerous")]:et(e),["".concat(t,"-color-link")]:en(e)},Q(e))},eo=e=>Object.assign(Object.assign(Object.assign(Object.assign({},U(e,e.defaultBorderColor,e.defaultBg,{color:e.defaultHoverColor,borderColor:e.defaultHoverBorderColor,background:e.defaultHoverBg},{color:e.defaultActiveColor,borderColor:e.defaultActiveBorderColor,background:e.defaultActiveBg})),Y(e,e.textTextColor,"text",{color:e.textTextHoverColor,background:e.textHoverBg},{color:e.textTextActiveColor,background:e.colorBgTextActive})),G(e,e.primaryColor,e.colorPrimary,{background:e.colorPrimaryHover,color:e.primaryColor},{background:e.colorPrimaryActive,color:e.primaryColor})),Y(e,e.colorLink,"link",{color:e.colorLinkHover,background:e.linkHoverBg},{color:e.colorLinkActive})),ea=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",{componentCls:n,controlHeight:r,fontSize:o,borderRadius:a,buttonPaddingHorizontal:i,iconCls:c,buttonPaddingVertical:l,buttonIconOnlyFontSize:s}=e;return[{[t]:{fontSize:o,height:r,padding:"".concat((0,S.bf)(l)," ").concat((0,S.bf)(i)),borderRadius:a,["&".concat(n,"-icon-only")]:{width:r,[c]:{fontSize:s}}}},{["".concat(n).concat(n,"-circle").concat(t)]:L(e)},{["".concat(n).concat(n,"-round").concat(t)]:{borderRadius:e.controlHeight,["&:not(".concat(n,"-icon-only)")]:{paddingInline:e.buttonPaddingHorizontal}}}]},ei=e=>ea((0,j.IX)(e,{fontSize:e.contentFontSize}),e.componentCls),ec=e=>ea((0,j.IX)(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM}),"".concat(e.componentCls,"-sm")),el=e=>ea((0,j.IX)(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG}),"".concat(e.componentCls,"-lg")),es=e=>{let{componentCls:t}=e;return{[t]:{["&".concat(t,"-block")]:{width:"100%"}}}};var eu=(0,I.I$)("Button",e=>{let t=_(e);return[H(t),ei(t),ec(t),el(t),es(t),er(t),eo(t),R(t)]},B,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}}),ed=n(17691);let ef=e=>{let{componentCls:t,colorPrimaryHover:n,lineWidth:r,calc:o}=e,a=o(r).mul(-1).equal(),i=e=>{let o="".concat(t,"-compact").concat(e?"-vertical":"","-item").concat(t,"-primary:not([disabled])");return{["".concat(o," + ").concat(o,"::before")]:{position:"absolute",top:e?a:0,insetInlineStart:e?0:a,backgroundColor:n,content:'""',width:e?"100%":r,height:e?r:"100%"}}};return Object.assign(Object.assign({},i()),i(!0))};var ep=(0,I.bk)(["Button","compact"],e=>{let t=_(e);return[(0,ed.c)(t),function(e){var t,n;let r="".concat(e.componentCls,"-compact-vertical");return{[r]:Object.assign(Object.assign({},(t=e.componentCls,{["&-item:not(".concat(r,"-last-item)")]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},["&-item:not(".concat(t,"-status-success)")]:{zIndex:2},"&-item":{"&:hover,&:focus,&:active":{zIndex:3},"&[disabled]":{zIndex:0}}})),(n=e.componentCls,{["&-item:not(".concat(r,"-first-item):not(").concat(r,"-last-item)")]:{borderRadius:0},["&-item".concat(r,"-first-item:not(").concat(r,"-last-item)")]:{["&, &".concat(n,"-sm, &").concat(n,"-lg")]:{borderEndEndRadius:0,borderEndStartRadius:0}},["&-item".concat(r,"-last-item:not(").concat(r,"-first-item)")]:{["&, &".concat(n,"-sm, &").concat(n,"-lg")]:{borderStartStartRadius:0,borderStartEndRadius:0}}}))}}(t),ef(t)]},B),em=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eg={default:["default","outlined"],primary:["primary","solid"],dashed:["default","dashed"],link:["link","link"],text:["default","text"]},ev=r.forwardRef((e,t)=>{var n,o;let{loading:m=!1,prefixCls:g,color:b,variant:y,type:w,danger:E=!1,shape:C,size:S,styles:O,disabled:k,className:j,rootClassName:I,children:M,icon:R,iconPosition:N="start",ghost:P=!1,block:F=!1,htmlType:T="button",classNames:A,style:_={},autoInsertSpace:B,autoFocus:H}=e,z=em(e,["loading","prefixCls","color","variant","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","iconPosition","ghost","block","htmlType","classNames","style","autoInsertSpace","autoFocus"]),L=w||"default",{button:D}=r.useContext(u.E_),W=C||(null==D?void 0:D.shape)||"default",[V,q]=(0,r.useMemo)(()=>{if(b&&y)return[b,y];if(w||E){let e=eg[L]||[];return E?["danger",e[1]]:e}return(null==D?void 0:D.color)&&(null==D?void 0:D.variant)?[D.color,D.variant]:["default","outlined"]},[b,y,w,E,null==D?void 0:D.color,null==D?void 0:D.variant,L]),X="danger"===V?"dangerous":V,{getPrefixCls:G,direction:U,autoInsertSpace:$,className:K,style:Y,classNames:Q,styles:J}=(0,u.dj)("button"),ee=null===(n=null!=B?B:$)||void 0===n||n,et=G("btn",g),[en,er,eo]=eu(et),ea=(0,r.useContext)(d.Z),ei=null!=k?k:ea,ec=(0,r.useContext)(v),el=(0,r.useMemo)(()=>(function(e){if("object"==typeof e&&e){let t=null==e?void 0:e.delay;return{loading:(t=Number.isNaN(t)||"number"!=typeof t?0:t)<=0,delay:t}}return{loading:!!e,delay:0}})(m),[m]),[es,ed]=(0,r.useState)(el.loading),[ef,ev]=(0,r.useState)(!1),eh=(0,r.useRef)(null),eb=(0,l.x1)(t,eh),ey=1===r.Children.count(M)&&!R&&!(0,h.Dn)(q),ex=(0,r.useRef)(!0);r.useEffect(()=>(ex.current=!1,()=>{ex.current=!0}),[]),(0,i.Z)(()=>{let e=null;return el.delay>0?e=setTimeout(()=>{e=null,ed(!0)},el.delay):ed(el.loading),function(){e&&(clearTimeout(e),e=null)}},[el.delay,el.loading]),(0,r.useEffect)(()=>{if(!eh.current||!ee)return;let e=eh.current.textContent||"";ey&&(0,h.aG)(e)?ef||ev(!0):ef&&ev(!1)}),(0,r.useEffect)(()=>{H&&eh.current&&eh.current.focus()},[]);let ew=r.useCallback(t=>{var n;if(es||ei){t.preventDefault();return}null===(n=e.onClick)||void 0===n||n.call(e,t)},[e.onClick,es,ei]),{compactSize:eE,compactItemClassnames:eC}=(0,p.ri)(et,U),eZ=(0,f.Z)(e=>{var t,n;return null!==(n=null!==(t=null!=S?S:eE)&&void 0!==t?t:ec)&&void 0!==n?n:e}),eS=eZ&&null!==(o=({large:"lg",small:"sm",middle:void 0})[eZ])&&void 0!==o?o:"",eO=es?"loading":R,ek=(0,c.Z)(z,["navigate"]),ej=a()(et,er,eo,{["".concat(et,"-").concat(W)]:"default"!==W&&W,["".concat(et,"-").concat(L)]:L,["".concat(et,"-dangerous")]:E,["".concat(et,"-color-").concat(X)]:X,["".concat(et,"-variant-").concat(q)]:q,["".concat(et,"-").concat(eS)]:eS,["".concat(et,"-icon-only")]:!M&&0!==M&&!!eO,["".concat(et,"-background-ghost")]:P&&!(0,h.Dn)(q),["".concat(et,"-loading")]:es,["".concat(et,"-two-chinese-chars")]:ef&&ee&&!es,["".concat(et,"-block")]:F,["".concat(et,"-rtl")]:"rtl"===U,["".concat(et,"-icon-end")]:"end"===N},eC,j,I,K),eI=Object.assign(Object.assign({},Y),_),eM=a()(null==A?void 0:A.icon,Q.icon),eR=Object.assign(Object.assign({},(null==O?void 0:O.icon)||{}),J.icon||{}),eN=R&&!es?r.createElement(x,{prefixCls:et,className:eM,style:eR},R):m&&"object"==typeof m&&m.icon?r.createElement(x,{prefixCls:et,className:eM,style:eR},m.icon):r.createElement(Z,{existIcon:!!R,prefixCls:et,loading:es,mount:ex.current}),eP=M||0===M?(0,h.hU)(M,ey&&ee):null;if(void 0!==ek.href)return en(r.createElement("a",Object.assign({},ek,{className:a()(ej,{["".concat(et,"-disabled")]:ei}),href:ei?void 0:ek.href,style:eI,onClick:ew,ref:eb,tabIndex:ei?-1:0,"aria-disabled":ei}),eN,eP));let eF=r.createElement("button",Object.assign({},z,{type:T,className:ej,style:eI,onClick:ew,disabled:ei,ref:eb}),eN,eP,eC&&r.createElement(ep,{prefixCls:et}));return(0,h.Dn)(q)||(eF=r.createElement(s.Z,{component:"Button",disabled:es},eF)),en(eF)});ev.Group=e=>{let{getPrefixCls:t,direction:n}=r.useContext(u.E_),{prefixCls:o,size:i,className:c}=e,l=g(e,["prefixCls","size","className"]),s=t("btn-group",o),[,,d]=(0,m.ZP)(),f=r.useMemo(()=>{switch(i){case"large":return"lg";case"small":return"sm";default:return""}},[i]),p=a()(s,{["".concat(s,"-").concat(f)]:f,["".concat(s,"-rtl")]:"rtl"===n},c,d);return r.createElement(v.Provider,{value:i},r.createElement("div",Object.assign({},l,{className:p})))},ev.__ANT_BUTTON=!0;var eh=ev},11357:function(e,t,n){"use strict";n.d(t,{y9:function(){return l}});var r=n(76405),o=n(25049),a=n(75669);let i=(e,t)=>(null==e?void 0:e.replace(/[^\w/]/g,"").slice(0,t?8:6))||"",c=(e,t)=>e?i(e,t):"",l=(0,o.Z)(function e(t){var n;if((0,r.Z)(this,e),this.cleared=!1,t instanceof e){this.metaColor=t.metaColor.clone(),this.colors=null===(n=t.colors)||void 0===n?void 0:n.map(t=>({color:new e(t.color),percent:t.percent})),this.cleared=t.cleared;return}let o=Array.isArray(t);o&&t.length?(this.colors=t.map(t=>{let{color:n,percent:r}=t;return{color:new e(n),percent:r}}),this.metaColor=new a.Il(this.colors[0].color.metaColor)):this.metaColor=new a.Il(o?"":t),t&&(!o||this.colors)||(this.metaColor=this.metaColor.setA(0),this.cleared=!0)},[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return c(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){let{colors:e}=this;if(e){let t=e.map(e=>"".concat(e.color.toRgbString()," ").concat(e.percent,"%")).join(", ");return"linear-gradient(90deg, ".concat(t,")")}return this.metaColor.toRgbString()}},{key:"equals",value:function(e){return!!e&&this.isGradient()===e.isGradient()&&(this.isGradient()?this.colors.length===e.colors.length&&this.colors.every((t,n)=>{let r=e.colors[n];return t.percent===r.percent&&t.color.equals(r.color)}):this.toHexString()===e.toHexString())}}])},86586:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n(2265);let o=r.createContext(!1),a=e=>{let{children:t,disabled:n}=e,a=r.useContext(o);return r.createElement(o.Provider,{value:null!=n?n:a},t)};t.Z=o},59189:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var r=n(2265);let o=r.createContext(void 0),a=e=>{let{children:t,size:n}=e,a=r.useContext(o);return r.createElement(o.Provider,{value:n||a},t)};t.Z=o},66061:function(e,t,n){"use strict";n.d(t,{q:function(){return b}}),n(2265);var r,o=n(54887),a=n.t(o,2),i=n(75143),c=n(54580),l=n(41154),s=(0,n(31686).Z)({},a),u=s.version,d=s.render,f=s.unmountComponentAtNode;try{Number((u||"").split(".")[0])>=18&&(r=s.createRoot)}catch(e){}function p(e){var t=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===(0,l.Z)(t)&&(t.usingClientEntryPoint=e)}var m="__rc_react_root__";function g(){return(g=(0,c.Z)((0,i.Z)().mark(function e(t){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then(function(){var e;null===(e=t[m])||void 0===e||e.unmount(),delete t[m]}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function v(){return(v=(0,c.Z)((0,i.Z)().mark(function e(t){return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(void 0!==r)){e.next=2;break}return e.abrupt("return",function(e){return g.apply(this,arguments)}(t));case 2:f(t);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}let h=(e,t)=>(!function(e,t){var n;if(r){p(!0),n=t[m]||r(t),p(!1),n.render(e),t[m]=n;return}null==d||d(e,t)}(e,t),()=>(function(e){return v.apply(this,arguments)})(t));function b(e){return e&&(h=e),h}},71744:function(e,t,n){"use strict";n.d(t,{E_:function(){return c},Rf:function(){return o},dj:function(){return u},oR:function(){return a},tr:function(){return i}});var r=n(2265);let o="ant",a="anticon",i=["outlined","borderless","filled","underlined"],c=r.createContext({getPrefixCls:(e,t)=>t||(e?"".concat(o,"-").concat(e):o),iconPrefixCls:a}),{Consumer:l}=c,s={};function u(e){let t=r.useContext(c),{getPrefixCls:n,direction:o,getPopupContainer:a}=t;return Object.assign(Object.assign({classNames:s,styles:s},t[e]),{getPrefixCls:n,direction:o,getPopupContainer:a})}},91086:function(e,t,n){"use strict";var r=n(2265),o=n(71744),a=n(85180);t.Z=e=>{let{componentName:t}=e,{getPrefixCls:n}=(0,r.useContext)(o.E_),i=n("empty");switch(t){case"Table":case"List":return r.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return r.createElement(a.Z,{image:a.Z.PRESENTED_IMAGE_SIMPLE,className:"".concat(i,"-small")});case"Table.filter":return null;default:return r.createElement(a.Z,null)}}},64024:function(e,t,n){"use strict";var r=n(84951);t.Z=e=>{let[,,,,t]=(0,r.ZP)();return t?"".concat(e,"-css-var"):""}},33759:function(e,t,n){"use strict";var r=n(2265),o=n(59189);t.Z=e=>{let t=r.useContext(o.Z);return r.useMemo(()=>e?"string"==typeof e?null!=e?e:t:"function"==typeof e?e(t):t:t,[e,t])}},18310:function(e,t,n){"use strict";let r,o,a,i;n.d(t,{ZP:function(){return G},w6:function(){return V}});var c=n(2265),l=n.t(c,2),s=n(93463),u=n(20902),d=n(6397),f=n(23789),p=n(13613),m=n(77360),g=n(92246),v=n(91325),h=e=>{let{locale:t={},children:n,_ANT_MARK__:r}=e;c.useEffect(()=>(0,g.f)(null==t?void 0:t.Modal),[t]);let o=c.useMemo(()=>Object.assign(Object.assign({},t),{exist:!0}),[t]);return c.createElement(v.Z.Provider,{value:o},n)},b=n(37381),y=n(57862),x=n(25119),w=n(70774),E=n(71744),C=n(57943),Z=n(54558),S=n(94981),O=n(21717);let k="-ant-".concat(Date.now(),"-").concat(Math.random());var j=n(86586),I=n(59189),M=n(16671);let{useId:R}=Object.assign({},l);var N=void 0===R?()=>"":R,P=n(66632),F=n(84951);let T=c.createContext(!0);function A(e){let t=c.useContext(T),{children:n}=e,[,r]=(0,F.ZP)(),{motion:o}=r,a=c.useRef(!1);return(a.current||(a.current=t!==o),a.current)?c.createElement(T.Provider,{value:o},c.createElement(P.zt,{motion:o},n)):n}var _=()=>null,B=n(12918),H=(e,t)=>{let[n,r]=(0,F.ZP)();return(0,s.xy)({theme:n,token:r,hashId:"",path:["ant-design-icons",e],nonce:()=>null==t?void 0:t.nonce,layer:{name:"antd"}},()=>(0,B.JT)(e))},z=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let L=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];function D(){return r||E.Rf}function W(){return o||E.oR}let V=()=>({getPrefixCls:(e,t)=>t||(e?"".concat(D(),"-").concat(e):D()),getIconPrefixCls:W,getRootPrefixCls:()=>r||D(),getTheme:()=>a,holderRender:i}),q=e=>{let{children:t,csp:n,autoInsertSpaceInButton:r,alert:o,anchor:a,form:i,locale:l,componentSize:g,direction:v,space:C,splitter:Z,virtual:S,dropdownMatchSelectWidth:O,popupMatchSelectWidth:k,popupOverflow:R,legacyLocale:P,parentContext:F,iconPrefixCls:T,theme:B,componentDisabled:D,segmented:W,statistic:V,spin:q,calendar:X,carousel:G,cascader:U,collapse:$,typography:K,checkbox:Y,descriptions:Q,divider:J,drawer:ee,skeleton:et,steps:en,image:er,layout:eo,list:ea,mentions:ei,modal:ec,progress:el,result:es,slider:eu,breadcrumb:ed,menu:ef,pagination:ep,input:em,textArea:eg,empty:ev,badge:eh,radio:eb,rate:ey,switch:ex,transfer:ew,avatar:eE,message:eC,tag:eZ,table:eS,card:eO,tabs:ek,timeline:ej,timePicker:eI,upload:eM,notification:eR,tree:eN,colorPicker:eP,datePicker:eF,rangePicker:eT,flex:eA,wave:e_,dropdown:eB,warning:eH,tour:ez,tooltip:eL,popover:eD,popconfirm:eW,floatButton:eV,floatButtonGroup:eq,variant:eX,inputNumber:eG,treeSelect:eU}=e,e$=c.useCallback((t,n)=>{let{prefixCls:r}=e;if(n)return n;let o=r||F.getPrefixCls("");return t?"".concat(o,"-").concat(t):o},[F.getPrefixCls,e.prefixCls]),eK=T||F.iconPrefixCls||E.oR,eY=n||F.csp;H(eK,eY);let eQ=function(e,t,n){var r;(0,p.ln)("ConfigProvider");let o=e||{},a=!1!==o.inherit&&t?t:Object.assign(Object.assign({},x.u_),{hashed:null!==(r=null==t?void 0:t.hashed)&&void 0!==r?r:x.u_.hashed,cssVar:null==t?void 0:t.cssVar}),i=N();return(0,d.Z)(()=>{var r,c;if(!e)return t;let l=Object.assign({},a.components);Object.keys(e.components||{}).forEach(t=>{l[t]=Object.assign(Object.assign({},l[t]),e.components[t])});let s="css-var-".concat(i.replace(/:/g,"")),u=(null!==(r=o.cssVar)&&void 0!==r?r:a.cssVar)&&Object.assign(Object.assign(Object.assign({prefix:null==n?void 0:n.prefixCls},"object"==typeof a.cssVar?a.cssVar:{}),"object"==typeof o.cssVar?o.cssVar:{}),{key:"object"==typeof o.cssVar&&(null===(c=o.cssVar)||void 0===c?void 0:c.key)||s});return Object.assign(Object.assign(Object.assign({},a),o),{token:Object.assign(Object.assign({},a.token),o.token),components:l,cssVar:u})},[o,a],(e,t)=>e.some((e,n)=>{let r=t[n];return!(0,M.Z)(e,r,!0)}))}(B,F.theme,{prefixCls:e$("")}),eJ={csp:eY,autoInsertSpaceInButton:r,alert:o,anchor:a,locale:l||P,direction:v,space:C,splitter:Z,virtual:S,popupMatchSelectWidth:null!=k?k:O,popupOverflow:R,getPrefixCls:e$,iconPrefixCls:eK,theme:eQ,segmented:W,statistic:V,spin:q,calendar:X,carousel:G,cascader:U,collapse:$,typography:K,checkbox:Y,descriptions:Q,divider:J,drawer:ee,skeleton:et,steps:en,image:er,input:em,textArea:eg,layout:eo,list:ea,mentions:ei,modal:ec,progress:el,result:es,slider:eu,breadcrumb:ed,menu:ef,pagination:ep,empty:ev,badge:eh,radio:eb,rate:ey,switch:ex,transfer:ew,avatar:eE,message:eC,tag:eZ,table:eS,card:eO,tabs:ek,timeline:ej,timePicker:eI,upload:eM,notification:eR,tree:eN,colorPicker:eP,datePicker:eF,rangePicker:eT,flex:eA,wave:e_,dropdown:eB,warning:eH,tour:ez,tooltip:eL,popover:eD,popconfirm:eW,floatButton:eV,floatButtonGroup:eq,variant:eX,inputNumber:eG,treeSelect:eU},e0=Object.assign({},F);Object.keys(eJ).forEach(e=>{void 0!==eJ[e]&&(e0[e]=eJ[e])}),L.forEach(t=>{let n=e[t];n&&(e0[t]=n)}),void 0!==r&&(e0.button=Object.assign({autoInsertSpace:r},e0.button));let e1=(0,d.Z)(()=>e0,e0,(e,t)=>{let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||n.some(n=>e[n]!==t[n])}),{layer:e2}=c.useContext(s.uP),e6=c.useMemo(()=>({prefixCls:eK,csp:eY,layer:e2?"antd":void 0}),[eK,eY,e2]),e5=c.createElement(c.Fragment,null,c.createElement(_,{dropdownMatchSelectWidth:O}),t),e4=c.useMemo(()=>{var e,t,n,r;return(0,f.T)((null===(e=b.Z.Form)||void 0===e?void 0:e.defaultValidateMessages)||{},(null===(n=null===(t=e1.locale)||void 0===t?void 0:t.Form)||void 0===n?void 0:n.defaultValidateMessages)||{},(null===(r=e1.form)||void 0===r?void 0:r.validateMessages)||{},(null==i?void 0:i.validateMessages)||{})},[e1,null==i?void 0:i.validateMessages]);Object.keys(e4).length>0&&(e5=c.createElement(m.Z.Provider,{value:e4},e5)),l&&(e5=c.createElement(h,{locale:l,_ANT_MARK__:"internalMark"},e5)),(eK||eY)&&(e5=c.createElement(u.Z.Provider,{value:e6},e5)),g&&(e5=c.createElement(I.q,{size:g},e5)),e5=c.createElement(A,null,e5);let e3=c.useMemo(()=>{let e=eQ||{},{algorithm:t,token:n,components:r,cssVar:o}=e,a=z(e,["algorithm","token","components","cssVar"]),i=t&&(!Array.isArray(t)||t.length>0)?(0,s.jG)(t):y.Z,c={};Object.entries(r||{}).forEach(e=>{let[t,n]=e,r=Object.assign({},n);"algorithm"in r&&(!0===r.algorithm?r.theme=i:(Array.isArray(r.algorithm)||"function"==typeof r.algorithm)&&(r.theme=(0,s.jG)(r.algorithm)),delete r.algorithm),c[t]=r});let l=Object.assign(Object.assign({},w.Z),n);return Object.assign(Object.assign({},a),{theme:i,token:l,components:c,override:Object.assign({override:l},c),cssVar:o})},[eQ]);return B&&(e5=c.createElement(x.Mj.Provider,{value:e3},e5)),e1.warning&&(e5=c.createElement(p.G8.Provider,{value:e1.warning},e5)),void 0!==D&&(e5=c.createElement(j.n,{disabled:D},e5)),c.createElement(E.E_.Provider,{value:e1},e5)},X=e=>{let t=c.useContext(E.E_),n=c.useContext(v.Z);return c.createElement(q,Object.assign({parentContext:t,legacyLocale:n},e))};X.ConfigContext=E.E_,X.SizeContext=I.Z,X.config=e=>{let{prefixCls:t,iconPrefixCls:n,theme:c,holderRender:l}=e;void 0!==t&&(r=t),void 0!==n&&(o=n),"holderRender"in e&&(i=l),c&&(Object.keys(c).some(e=>e.endsWith("Color"))?function(e,t){let n=function(e,t){let n={},r=(e,t)=>{let n=e.clone();return(n=(null==t?void 0:t(n))||n).toRgbString()},o=(e,t)=>{let o=new Z.t(e),a=(0,C.R_)(o.toRgbString());n["".concat(t,"-color")]=r(o),n["".concat(t,"-color-disabled")]=a[1],n["".concat(t,"-color-hover")]=a[4],n["".concat(t,"-color-active")]=a[6],n["".concat(t,"-color-outline")]=o.clone().setA(.2).toRgbString(),n["".concat(t,"-color-deprecated-bg")]=a[0],n["".concat(t,"-color-deprecated-border")]=a[2]};if(t.primaryColor){o(t.primaryColor,"primary");let e=new Z.t(t.primaryColor),a=(0,C.R_)(e.toRgbString());a.forEach((e,t)=>{n["primary-".concat(t+1)]=e}),n["primary-color-deprecated-l-35"]=r(e,e=>e.lighten(35)),n["primary-color-deprecated-l-20"]=r(e,e=>e.lighten(20)),n["primary-color-deprecated-t-20"]=r(e,e=>e.tint(20)),n["primary-color-deprecated-t-50"]=r(e,e=>e.tint(50)),n["primary-color-deprecated-f-12"]=r(e,e=>e.setA(.12*e.a));let i=new Z.t(a[0]);n["primary-color-active-deprecated-f-30"]=r(i,e=>e.setA(.3*e.a)),n["primary-color-active-deprecated-d-02"]=r(i,e=>e.darken(2))}t.successColor&&o(t.successColor,"success"),t.warningColor&&o(t.warningColor,"warning"),t.errorColor&&o(t.errorColor,"error"),t.infoColor&&o(t.infoColor,"info");let a=Object.keys(n).map(t=>"--".concat(e,"-").concat(t,": ").concat(n[t],";"));return"\n :root {\n ".concat(a.join("\n"),"\n }\n ").trim()}(e,t);(0,S.Z)()&&(0,O.hq)(n,"".concat(k,"-dynamic-theme"))}(D(),c):a=c)},X.useConfig=function(){return{componentDisabled:(0,c.useContext)(j.Z),componentSize:(0,c.useContext)(I.Z)}},Object.defineProperty(X,"SizeContext",{get:()=>I.Z});var G=X},85180:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(55274),l=n(54558),s=n(84951),u=n(99320),d=n(71140);let f=e=>{let{componentCls:t,margin:n,marginXS:r,marginXL:o,fontSize:a,lineHeight:i}=e;return{[t]:{marginInline:r,fontSize:a,lineHeight:i,textAlign:"center",["".concat(t,"-image")]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},["".concat(t,"-description")]:{color:e.colorTextDescription},["".concat(t,"-footer")]:{marginTop:n},"&-normal":{marginBlock:o,color:e.colorTextDescription,["".concat(t,"-description")]:{color:e.colorTextDescription},["".concat(t,"-image")]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDescription,["".concat(t,"-image")]:{height:e.emptyImgHeightSM}}}}};var p=(0,u.I$)("Empty",e=>{let{componentCls:t,controlHeightLG:n,calc:r}=e;return f((0,d.IX)(e,{emptyImgCls:"".concat(t,"-img"),emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()}))}),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let g=r.createElement(()=>{let[,e]=(0,s.ZP)(),[t]=(0,c.Z)("Empty"),n=new l.t(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return r.createElement("svg",{style:n,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},r.createElement("title",null,(null==t?void 0:t.description)||"Empty"),r.createElement("g",{fill:"none",fillRule:"evenodd"},r.createElement("g",{transform:"translate(24 31.67)"},r.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),r.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),r.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),r.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),r.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),r.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),r.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},r.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),r.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},null),v=r.createElement(()=>{let[,e]=(0,s.ZP)(),[t]=(0,c.Z)("Empty"),{colorFill:n,colorFillTertiary:o,colorFillQuaternary:a,colorBgContainer:i}=e,{borderColor:u,shadowColor:d,contentColor:f}=(0,r.useMemo)(()=>({borderColor:new l.t(n).onBackground(i).toHexString(),shadowColor:new l.t(o).onBackground(i).toHexString(),contentColor:new l.t(a).onBackground(i).toHexString()}),[n,o,a,i]);return r.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},r.createElement("title",null,(null==t?void 0:t.description)||"Empty"),r.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},r.createElement("ellipse",{fill:d,cx:"32",cy:"33",rx:"32",ry:"7"}),r.createElement("g",{fillRule:"nonzero",stroke:u},r.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),r.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:f}))))},null),h=e=>{var t;let{className:n,rootClassName:o,prefixCls:l,image:s,description:u,children:d,imageStyle:f,style:h,classNames:b,styles:y}=e,x=m(e,["className","rootClassName","prefixCls","image","description","children","imageStyle","style","classNames","styles"]),{getPrefixCls:w,direction:E,className:C,style:Z,classNames:S,styles:O,image:k}=(0,i.dj)("empty"),j=w("empty",l),[I,M,R]=p(j),[N]=(0,c.Z)("Empty"),P=void 0!==u?u:null==N?void 0:N.description,F=null!==(t=null!=s?s:k)&&void 0!==t?t:g,T=null;return T="string"==typeof F?r.createElement("img",{draggable:!1,alt:"string"==typeof P?P:"empty",src:F}):F,I(r.createElement("div",Object.assign({className:a()(M,R,j,C,{["".concat(j,"-normal")]:F===v,["".concat(j,"-rtl")]:"rtl"===E},n,o,S.root,null==b?void 0:b.root),style:Object.assign(Object.assign(Object.assign(Object.assign({},O.root),Z),null==y?void 0:y.root),h)},x),r.createElement("div",{className:a()("".concat(j,"-image"),S.image,null==b?void 0:b.image),style:Object.assign(Object.assign(Object.assign({},f),O.image),null==y?void 0:y.image)},T),P&&r.createElement("div",{className:a()("".concat(j,"-description"),S.description,null==b?void 0:b.description),style:Object.assign(Object.assign({},O.description),null==y?void 0:y.description)},P),d&&r.createElement("div",{className:a()("".concat(j,"-footer"),S.footer,null==b?void 0:b.footer),style:Object.assign(Object.assign({},O.footer),null==y?void 0:y.footer)},d)))};h.PRESENTED_IMAGE_DEFAULT=g,h.PRESENTED_IMAGE_SIMPLE=v;var b=h},14605:function(e,t,n){"use strict";var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),c=n(66632),l=n(68710),s=n(64024),u=n(39109),d=n(4064),f=n(47713);let p=[];function m(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{key:"string"==typeof e?e:"".concat(t,"-").concat(r),error:e,errorStatus:n}}t.Z=e=>{let{help:t,helpStatus:n,errors:a=p,warnings:g=p,className:v,fieldId:h,onVisibleChanged:b}=e,{prefixCls:y}=o.useContext(u.Rk),x="".concat(y,"-item-explain"),w=(0,s.Z)(y),[E,C,Z]=(0,f.ZP)(y,w),S=o.useMemo(()=>(0,l.Z)(y),[y]),O=(0,d.Z)(a),k=(0,d.Z)(g),j=o.useMemo(()=>null!=t?[m(t,"help",n)]:[].concat((0,r.Z)(O.map((e,t)=>m(e,"error","error",t))),(0,r.Z)(k.map((e,t)=>m(e,"warning","warning",t)))),[t,n,O,k]),I=o.useMemo(()=>{let e={};return j.forEach(t=>{let{key:n}=t;e[n]=(e[n]||0)+1}),j.map((t,n)=>Object.assign(Object.assign({},t),{key:e[t.key]>1?"".concat(t.key,"-fallback-").concat(n):t.key}))},[j]),M={};return h&&(M.id="".concat(h,"_help")),E(o.createElement(c.ZP,{motionDeadline:S.motionDeadline,motionName:"".concat(y,"-show-help"),visible:!!I.length,onVisibleChanged:b},e=>{let{className:t,style:n}=e;return o.createElement("div",Object.assign({},M,{className:i()(x,t,Z,w,v,C),style:n}),o.createElement(c.V4,Object.assign({keys:I},(0,l.Z)(y),{motionName:"".concat(y,"-show-help-item"),component:!1}),e=>{let{key:t,error:n,errorStatus:r,className:a,style:c}=e;return o.createElement("div",{key:t,className:i()(a,{["".concat(x,"-").concat(r)]:r}),style:c},n)}))}))}},2740:function(e,t,n){"use strict";n.d(t,{Z:function(){return K}});var r=n(83145),o=n(2265),a=n(36760),i=n.n(a),c=n(87379),l=n(69819),s=n(28791),u=n(19722),d=n(13613),f=n(71744),p=n(64024),m=n(39109),g=n(45287);let v=()=>{let{status:e,errors:t=[],warnings:n=[]}=o.useContext(m.aM);return{status:e,errors:t,warnings:n}};v.Context=m.aM;var h=n(53346),b=n(47713),y=n(13861),x=n(2857),w=n(27380),E=n(18694),C=n(77774),Z=n(74126),S=n(54998),O=n(14605),k=n(99320);let j=e=>{let{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{["".concat(t,"-control")]:{display:"flex"}}}};var I=(0,k.bk)(["Form","item-item"],(e,t)=>{let{rootPrefixCls:n}=t;return j((0,b.B4)(e,n))}),M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},R=e=>{let{prefixCls:t,status:n,labelCol:r,wrapperCol:a,children:c,errors:l,warnings:s,_internalItemRender:u,extra:d,help:f,fieldId:p,marginBottom:g,onErrorVisibleChanged:v,label:h}=e,b="".concat(t,"-item"),y=o.useContext(m.q3),x=o.useMemo(()=>{let e=Object.assign({},a||y.wrapperCol||{});return null!==h||r||a||!y.labelCol||[void 0,"xs","sm","md","lg","xl","xxl"].forEach(t=>{let n=t?[t]:[],r=(0,Z.U2)(y.labelCol,n),o="object"==typeof r?r:{},a=(0,Z.U2)(e,n);"span"in o&&!("offset"in("object"==typeof a?a:{}))&&o.span<24&&(e=(0,Z.t8)(e,[].concat(n,["offset"]),o.span))}),e},[a,y.wrapperCol,y.labelCol,h,r]),E=i()("".concat(b,"-control"),x.className),C=o.useMemo(()=>{let{labelCol:e,wrapperCol:t}=y;return M(y,["labelCol","wrapperCol"])},[y]),k=o.useRef(null),[j,R]=o.useState(0);(0,w.Z)(()=>{d&&k.current?R(k.current.clientHeight):R(0)},[d]);let N=o.createElement("div",{className:"".concat(b,"-control-input")},o.createElement("div",{className:"".concat(b,"-control-input-content")},c)),P=o.useMemo(()=>({prefixCls:t,status:n}),[t,n]),F=null!==g||l.length||s.length?o.createElement(m.Rk.Provider,{value:P},o.createElement(O.Z,{fieldId:p,errors:l,warnings:s,help:f,helpStatus:n,className:"".concat(b,"-explain-connected"),onVisibleChanged:v})):null,T={};p&&(T.id="".concat(p,"_extra"));let A=d?o.createElement("div",Object.assign({},T,{className:"".concat(b,"-extra"),ref:k}),d):null,_=F||A?o.createElement("div",{className:"".concat(b,"-additional"),style:g?{minHeight:g+j}:{}},F,A):null,B=u&&"pro_table_render"===u.mark&&u.render?u.render(e,{input:N,errorList:F,extra:A}):o.createElement(o.Fragment,null,N,_);return o.createElement(m.q3.Provider,{value:C},o.createElement(S.Z,Object.assign({},x,{className:E}),B),o.createElement(I,{prefixCls:t}))},N=n(67187),P=n(55274),F=n(37381),T=n(99981),A=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},_=e=>{var t;let n,{prefixCls:r,label:a,htmlFor:c,labelCol:l,labelAlign:s,colon:u,required:d,requiredMark:f,tooltip:p,vertical:g}=e,[v]=(0,P.Z)("Form"),{labelAlign:h,labelCol:b,labelWrap:y,colon:x}=o.useContext(m.q3);if(!a)return null;let w=l||b||{},E="".concat(r,"-item-label"),C=i()(E,"left"===(s||h)&&"".concat(E,"-left"),w.className,{["".concat(E,"-wrap")]:!!y}),Z=a,O=!0===u||!1!==x&&!1!==u;O&&!g&&"string"==typeof a&&a.trim()&&(Z=a.replace(/[:|:]\s*$/,""));let k=null==p?null:"object"!=typeof p||(0,o.isValidElement)(p)?{title:p}:p;if(k){let{icon:e=o.createElement(N.Z,null)}=k,t=A(k,["icon"]),n=o.createElement(T.Z,Object.assign({},t),o.cloneElement(e,{className:"".concat(r,"-item-tooltip"),title:"",onClick:e=>{e.preventDefault()},tabIndex:null}));Z=o.createElement(o.Fragment,null,Z,n)}let j="optional"===f,I="function"==typeof f;I?Z=f(Z,{required:!!d}):j&&!d&&(Z=o.createElement(o.Fragment,null,Z,o.createElement("span",{className:"".concat(r,"-item-optional"),title:""},(null==v?void 0:v.optional)||(null===(t=F.Z.Form)||void 0===t?void 0:t.optional)))),!1===f?n="hidden":(j||I)&&(n="optional");let M=i()({["".concat(r,"-item-required")]:d,["".concat(r,"-item-required-mark-").concat(n)]:n,["".concat(r,"-item-no-colon")]:!O});return o.createElement(S.Z,Object.assign({},w,{className:C}),o.createElement("label",{htmlFor:c,className:M,title:"string"==typeof a?a:""},Z))},B=n(4064),H=n(8900),z=n(39725),L=n(54537),D=n(61935);let W={success:H.Z,warning:L.Z,error:z.Z,validating:D.Z};function V(e){let{children:t,errors:n,warnings:r,hasFeedback:a,validateStatus:c,prefixCls:l,meta:s,noStyle:u,name:d}=e,f="".concat(l,"-item"),{feedbackIcons:p}=o.useContext(m.q3),g=(0,y.lR)(n,r,s,null,!!a,c),{isFormItemInput:v,status:h,hasFeedback:b,feedbackIcon:x,name:w}=o.useContext(m.aM),E=o.useMemo(()=>{var e;let t;if(a){let c=!0!==a&&a.icons||p,l=g&&(null===(e=null==c?void 0:c({status:g,errors:n,warnings:r}))||void 0===e?void 0:e[g]),s=g?W[g]:null;t=!1!==l&&s?o.createElement("span",{className:i()("".concat(f,"-feedback-icon"),"".concat(f,"-feedback-icon-").concat(g))},l||o.createElement(s,null)):null}let c={status:g||"",errors:n,warnings:r,hasFeedback:!!a,feedbackIcon:t,isFormItemInput:!0,name:d};return u&&(c.status=(null!=g?g:h)||"",c.isFormItemInput=v,c.hasFeedback=!!(null!=a?a:b),c.feedbackIcon=void 0!==a?c.feedbackIcon:x,c.name=null!=d?d:w),c},[g,a,u,v,h]);return o.createElement(m.aM.Provider,{value:E},t)}var q=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function X(e){let{prefixCls:t,className:n,rootClassName:r,style:a,help:c,errors:l,warnings:s,validateStatus:u,meta:d,hasFeedback:f,hidden:p,children:g,fieldId:v,required:h,isRequired:b,onSubItemMetaChange:Z,layout:S,name:O}=e,k=q(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange","layout","name"]),j="".concat(t,"-item"),{requiredMark:I,layout:M}=o.useContext(m.q3),N=S||M,P="vertical"===N,F=o.useRef(null),T=(0,B.Z)(l),A=(0,B.Z)(s),H=null!=c,z=!!(H||l.length||s.length),L=!!F.current&&(0,x.Z)(F.current),[D,W]=o.useState(null);(0,w.Z)(()=>{z&&F.current&&W(Number.parseInt(getComputedStyle(F.current).marginBottom,10))},[z,L]);let X=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?T:d.errors,n=e?A:d.warnings;return(0,y.lR)(t,n,d,"",!!f,u)}(),G=i()(j,n,r,{["".concat(j,"-with-help")]:H||T.length||A.length,["".concat(j,"-has-feedback")]:X&&f,["".concat(j,"-has-success")]:"success"===X,["".concat(j,"-has-warning")]:"warning"===X,["".concat(j,"-has-error")]:"error"===X,["".concat(j,"-is-validating")]:"validating"===X,["".concat(j,"-hidden")]:p,["".concat(j,"-").concat(N)]:N});return o.createElement("div",{className:G,style:a,ref:F},o.createElement(C.Z,Object.assign({className:"".concat(j,"-row")},(0,E.Z)(k,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),o.createElement(_,Object.assign({htmlFor:v},e,{requiredMark:I,required:null!=h?h:b,prefixCls:t,vertical:P})),o.createElement(R,Object.assign({},e,d,{errors:T,warnings:A,prefixCls:t,status:X,help:c,marginBottom:D,onErrorVisibleChanged:e=>{e||W(null)}}),o.createElement(m.qI.Provider,{value:Z},o.createElement(V,{prefixCls:t,meta:d,errors:d.errors,warnings:d.warnings,hasFeedback:f,validateStatus:X,name:O},g)))),!!D&&o.createElement("div",{className:"".concat(j,"-margin-offset"),style:{marginBottom:-D}}))}let G=o.memo(e=>{let{children:t}=e;return t},(e,t)=>(function(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>{let r=e[n],o=t[n];return r===o||"function"==typeof r||"function"==typeof o})})(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((e,n)=>e===t.childProps[n]));function U(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}let $=function(e){let{name:t,noStyle:n,className:a,dependencies:v,prefixCls:x,shouldUpdate:w,rules:E,children:C,required:Z,label:S,messageVariables:O,trigger:k="onChange",validateTrigger:j,hidden:I,help:M,layout:R}=e,{getPrefixCls:N}=o.useContext(f.E_),{name:P}=o.useContext(m.q3),F=function(e){if("function"==typeof e)return e;let t=(0,g.Z)(e);return t.length<=1?t[0]:t}(C),T="function"==typeof F,A=o.useContext(m.qI),{validateTrigger:_}=o.useContext(c.zb),B=void 0!==j?j:_,H=null!=t,z=N("form",x),L=(0,p.Z)(z),[D,W,q]=(0,b.ZP)(z,L);(0,d.ln)("Form.Item");let $=o.useContext(c.ZM),K=o.useRef(null),[Y,Q]=function(e){let[t,n]=o.useState(e),r=o.useRef(null),a=o.useRef([]),i=o.useRef(!1);return o.useEffect(()=>(i.current=!1,()=>{i.current=!0,h.Z.cancel(r.current),r.current=null}),[]),[t,function(e){i.current||(null===r.current&&(a.current=[],r.current=(0,h.Z)(()=>{r.current=null,n(e=>{let t=e;return a.current.forEach(e=>{t=e(t)}),t})})),a.current.push(e))}]}({}),[J,ee]=(0,l.Z)(()=>U()),et=(e,t)=>{Q(n=>{let o=Object.assign({},n),a=[].concat((0,r.Z)(e.name.slice(0,-1)),(0,r.Z)(t)).join("__SPLIT__");return e.destroy?delete o[a]:o[a]=e,o})},[en,er]=o.useMemo(()=>{let e=(0,r.Z)(J.errors),t=(0,r.Z)(J.warnings);return Object.values(Y).forEach(n=>{e.push.apply(e,(0,r.Z)(n.errors||[])),t.push.apply(t,(0,r.Z)(n.warnings||[]))}),[e,t]},[Y,J.errors,J.warnings]),eo=function(){let{itemRef:e}=o.useContext(m.q3),t=o.useRef({});return function(n,r){let o=r&&"object"==typeof r&&(0,s.C4)(r),a=n.join("_");return(t.current.name!==a||t.current.originRef!==o)&&(t.current.name=a,t.current.originRef=o,t.current.ref=(0,s.sQ)(e(n),o)),t.current.ref}}();function ea(r,c,l){return n&&!I?o.createElement(V,{prefixCls:z,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:J,errors:en,warnings:er,noStyle:!0,name:t},r):o.createElement(X,Object.assign({key:"row"},e,{className:i()(a,q,L,W),prefixCls:z,fieldId:c,isRequired:l,errors:en,warnings:er,meta:J,onSubItemMetaChange:et,layout:R,name:t}),r)}if(!H&&!T&&!v)return D(ea(F));let ei={};return"string"==typeof S?ei.label=S:t&&(ei.label=String(t)),O&&(ei=Object.assign(Object.assign({},ei),O)),D(o.createElement(c.gN,Object.assign({},e,{messageVariables:ei,trigger:k,validateTrigger:B,onMetaChange:e=>{let t=null==$?void 0:$.getKey(e.name);if(ee(e.destroy?U():e,!0),n&&!1!==M&&A){let n=e.name;if(e.destroy)n=K.current||n;else if(void 0!==t){let[e,o]=t;n=[e].concat((0,r.Z)(o)),K.current=n}A(e,n)}}}),(n,a,i)=>{let c=(0,y.qo)(t).length&&a?a.name:[],l=(0,y.dD)(c,P),d=void 0!==Z?Z:!!(null==E?void 0:E.some(e=>{if(e&&"object"==typeof e&&e.required&&!e.warningOnly)return!0;if("function"==typeof e){let t=e(i);return(null==t?void 0:t.required)&&!(null==t?void 0:t.warningOnly)}return!1})),f=Object.assign({},n),p=null;if(Array.isArray(F)&&H)p=F;else if(T&&(!(w||v)||H));else if(!v||T||H){if(o.isValidElement(F)){let t=Object.assign(Object.assign({},F.props),f);if(t.id||(t.id=l),M||en.length>0||er.length>0||e.extra){let n=[];(M||en.length>0)&&n.push("".concat(l,"_help")),e.extra&&n.push("".concat(l,"_extra")),t["aria-describedby"]=n.join(" ")}en.length>0&&(t["aria-invalid"]="true"),d&&(t["aria-required"]="true"),(0,s.Yr)(F)&&(t.ref=eo(c,F)),new Set([].concat((0,r.Z)((0,y.qo)(k)),(0,r.Z)((0,y.qo)(B)))).forEach(e=>{t[e]=function(){for(var t,n,r,o=arguments.length,a=Array(o),i=0;i{}}),c=r.createContext(null),l=e=>{let t=(0,a.Z)(e,["prefixCls"]);return r.createElement(o.RV,Object.assign({},t))},s=r.createContext({prefixCls:""}),u=r.createContext({}),d=e=>{let{children:t,status:n,override:o}=e,a=r.useContext(u),i=r.useMemo(()=>{let e=Object.assign({},a);return o&&delete e.isFormItemInput,n&&(delete e.status,delete e.hasFeedback,delete e.feedbackIcon),e},[n,o,a]);return r.createElement(u.Provider,{value:i},t)},f=r.createContext(void 0)},4064:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e){let[t,n]=r.useState(e);return r.useEffect(()=>{let t=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(t)}},[e]),t}},29487:function(e,t,n){"use strict";n.d(t,{Z:function(){return h},S:function(){return g}});var r=n(2265),o=n(87379),a=n(2868);let i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,c=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,l=(e,t)=>{if(e.clientHeight{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightat||a>e&&i=t&&c>=n?a-e-r:i>t&&cn?i-t+o:0,u=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},d=(e,t)=>{var n,r,o,a;if("undefined"==typeof document)return[];let{scrollMode:c,block:d,inline:f,boundary:p,skipOverflowHiddenElements:m}=t,g="function"==typeof p?p:e=>e!==p;if(!i(e))throw TypeError("Invalid target");let v=document.scrollingElement||document.documentElement,h=[],b=e;for(;i(b)&&g(b);){if((b=u(b))===v){h.push(b);break}null!=b&&b===document.body&&l(b)&&!l(document.documentElement)||null!=b&&l(b,m)&&h.push(b)}let y=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,x=null!=(a=null==(o=window.visualViewport)?void 0:o.height)?a:innerHeight,{scrollX:w,scrollY:E}=window,{height:C,width:Z,top:S,right:O,bottom:k,left:j}=e.getBoundingClientRect(),{top:I,right:M,bottom:R,left:N}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),P="start"===d||"nearest"===d?S-I:"end"===d?k+R:S+C/2-I+R,F="center"===f?j+Z/2-N+M:"end"===f?O+M:j-N,T=[];for(let e=0;e=0&&j>=0&&k<=x&&O<=y&&(t===v&&!l(t)||S>=o&&k<=i&&j>=u&&O<=a))break;let p=getComputedStyle(t),m=parseInt(p.borderLeftWidth,10),g=parseInt(p.borderTopWidth,10),b=parseInt(p.borderRightWidth,10),I=parseInt(p.borderBottomWidth,10),M=0,R=0,N="offsetWidth"in t?t.offsetWidth-t.clientWidth-m-b:0,A="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-I:0,_="offsetWidth"in t?0===t.offsetWidth?0:r/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(v===t)M="start"===d?P:"end"===d?P-x:"nearest"===d?s(E,E+x,x,g,I,E+P,E+P+C,C):P-x/2,R="start"===f?F:"center"===f?F-y/2:"end"===f?F-y:s(w,w+y,y,m,b,w+F,w+F+Z,Z),M=Math.max(0,M+E),R=Math.max(0,R+w);else{M="start"===d?P-o-g:"end"===d?P-i+I+A:"nearest"===d?s(o,i,n,g,I+A,P,P+C,C):P-(o+n/2)+A/2,R="start"===f?F-u-m:"center"===f?F-(u+r/2)+N/2:"end"===f?F-a+b+N:s(u,a,r,m,b+N,F,F+Z,Z);let{scrollLeft:e,scrollTop:c}=t;M=0===B?0:Math.max(0,Math.min(c+M/B,t.scrollHeight-n/B+A)),R=0===_?0:Math.max(0,Math.min(e+R/_,t.scrollWidth-r/_+N)),P+=c-M,F+=e-R}T.push({el:t,top:M,left:R})}return T},f=e=>!1===e?{block:"end",inline:"nearest"}:e===Object(e)&&0!==Object.keys(e).length?e:{block:"start",inline:"nearest"};var p=n(13861),m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function g(e){return(0,p.qo)(e).join("_")}function v(e,t){let n=t.getFieldInstance(e),r=(0,a.bn)(n);if(r)return r;let o=(0,p.dD)((0,p.qo)(e),t.__INTERNAL__.name);if(o)return document.getElementById(o)}function h(e){let[t]=(0,o.cI)(),n=r.useRef({}),a=r.useMemo(()=>null!=e?e:Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:e=>t=>{let r=g(e);t?n.current[r]=t:delete n.current[r]}},scrollToField:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{focus:n}=t,r=m(t,["focus"]),o=v(e,a);o&&(!function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(d(e,t));let r="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:o,top:a,left:i}of d(e,f(t))){let e=a-n.top+n.bottom,t=i-n.left+n.right;o.scroll({top:e,left:t,behavior:r})}}(o,Object.assign({scrollMode:"if-needed",block:"nearest"},r)),n&&a.focusField(e))},focusField:e=>{var t,n;let r=a.getFieldInstance(e);"function"==typeof(null==r?void 0:r.focus)?r.focus():null===(n=null===(t=v(e,a))||void 0===t?void 0:t.focus)||void 0===n||n.call(t)},getFieldInstance:e=>{let t=g(e);return n.current[t]}}),[e,t]);return[a]}},56250:function(e,t,n){"use strict";var r=n(2265),o=n(71744),a=n(39109);t.Z=(e,t,n)=>{var i,c;let l;let{variant:s,[e]:u}=r.useContext(o.E_),d=r.useContext(a.pg),f=null==u?void 0:u.variant;l=void 0!==t?t:!1===n?"borderless":null!==(c=null!==(i=null!=d?d:f)&&void 0!==i?i:s)&&void 0!==c?c:"outlined";let p=o.tr.includes(l);return[l,p]}},10032:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(39109),o=n(14605),a=n(2265),i=n(36760),c=n.n(i),l=n(87379),s=n(71744),u=n(86586),d=n(64024),f=n(33759),p=n(59189),m=n(29487),g=n(47713),v=n(77360),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let b=a.forwardRef((e,t)=>{let n=a.useContext(u.Z),{getPrefixCls:o,direction:i,requiredMark:b,colon:y,scrollToFirstError:x,className:w,style:E}=(0,s.dj)("form"),{prefixCls:C,className:Z,rootClassName:S,size:O,disabled:k=n,form:j,colon:I,labelAlign:M,labelWrap:R,labelCol:N,wrapperCol:P,hideRequiredMark:F,layout:T="horizontal",scrollToFirstError:A,requiredMark:_,onFinishFailed:B,name:H,style:z,feedbackIcons:L,variant:D}=e,W=h(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),V=(0,f.Z)(O),q=a.useContext(v.Z),X=a.useMemo(()=>void 0!==_?_:!F&&(void 0===b||b),[F,_,b]),G=null!=I?I:y,U=o("form",C),$=(0,d.Z)(U),[K,Y,Q]=(0,g.ZP)(U,$),J=c()(U,"".concat(U,"-").concat(T),{["".concat(U,"-hide-required-mark")]:!1===X,["".concat(U,"-rtl")]:"rtl"===i,["".concat(U,"-").concat(V)]:V},Q,$,Y,w,Z,S),[ee]=(0,m.Z)(j),{__INTERNAL__:et}=ee;et.name=H;let en=a.useMemo(()=>({name:H,labelAlign:M,labelCol:N,labelWrap:R,wrapperCol:P,layout:T,colon:G,requiredMark:X,itemRef:et.itemRef,form:ee,feedbackIcons:L}),[H,M,N,P,T,G,X,ee,L]),er=a.useRef(null);a.useImperativeHandle(t,()=>{var e;return Object.assign(Object.assign({},ee),{nativeElement:null===(e=er.current)||void 0===e?void 0:e.nativeElement})});let eo=(e,t)=>{if(e){let n={block:"nearest"};"object"==typeof e&&(n=Object.assign(Object.assign({},n),e)),ee.scrollToField(t,n)}};return K(a.createElement(r.pg.Provider,{value:D},a.createElement(u.n,{disabled:k},a.createElement(p.Z.Provider,{value:V},a.createElement(r.RV,{validateMessages:q},a.createElement(r.q3.Provider,{value:en},a.createElement(r.Ux,{status:!0},a.createElement(l.ZP,Object.assign({id:H},W,{name:H,onFinishFailed:e=>{if(null==B||B(e),e.errorFields.length){let t=e.errorFields[0].name;if(void 0!==A){eo(A,t);return}void 0!==x&&eo(x,t)}},form:ee,ref:er,style:Object.assign(Object.assign({},E),z),className:J})))))))))});var y=n(2740),x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};b.Item=y.Z,b.List=e=>{var{prefixCls:t,children:n}=e,o=x(e,["prefixCls","children"]);let{getPrefixCls:i}=a.useContext(s.E_),c=i("form",t),u=a.useMemo(()=>({prefixCls:c,status:"error"}),[c]);return a.createElement(l.aV,Object.assign({},o),(e,t,o)=>a.createElement(r.Rk.Provider,{value:u},n(e.map(e=>Object.assign(Object.assign({},e),{fieldKey:e.key})),t,{errors:o.errors,warnings:o.warnings})))},b.ErrorList=o.Z,b.useForm=m.Z,b.useFormInstance=function(){let{form:e}=a.useContext(r.q3);return e},b.useWatch=l.qo,b.Provider=r.RV,b.create=()=>{};var w=b},47713:function(e,t,n){"use strict";n.d(t,{ZP:function(){return x},B4:function(){return y}});var r=n(93463),o=n(12918),a=n(691),i=n(63074),c=n(71140),l=n(99320),s=e=>{let{componentCls:t}=e,n="".concat(t,"-show-help"),r="".concat(t,"-show-help-item");return{[n]:{transition:"opacity ".concat(e.motionDurationFast," ").concat(e.motionEaseInOut),"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:"hidden",transition:"height ".concat(e.motionDurationFast," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationFast," ").concat(e.motionEaseInOut,",\n transform ").concat(e.motionDurationFast," ").concat(e.motionEaseInOut," !important"),["&".concat(r,"-appear, &").concat(r,"-enter")]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},["&".concat(r,"-leave-active")]:{transform:"translateY(-5px)"}}}}};let u=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:"0 0 0 ".concat((0,r.bf)(e.controlOutlineWidth)," ").concat(e.controlOutline)},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),d=(e,t)=>{let{formItemCls:n}=e;return{[n]:{["".concat(n,"-label > label")]:{height:t},["".concat(n,"-control-input")]:{minHeight:t}}}},f=e=>{let{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),u(e)),{["".concat(t,"-text")]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},d(e,e.controlHeightSM)),"&-large":Object.assign({},d(e,e.controlHeightLG))})}},p=e=>{let{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:i,labelRequiredMarkColor:c,labelColor:l,labelFontSize:s,labelHeight:u,labelColonMarginInlineStart:d,labelColonMarginInlineEnd:f,itemMarginBottom:p}=e;return{[t]:Object.assign(Object.assign({},(0,o.Wf)(e)),{marginBottom:p,verticalAlign:"top","&-with-help":{transition:"none"},["&-hidden,\n &-hidden".concat(i,"-row")]:{display:"none"},"&-has-warning":{["".concat(t,"-split")]:{color:e.colorError}},"&-has-error":{["".concat(t,"-split")]:{color:e.colorWarning}},["".concat(t,"-label")]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset","> label":{verticalAlign:"middle",textWrap:"balance"}},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:u,color:l,fontSize:s,["> ".concat(n)]:{fontSize:e.fontSize,verticalAlign:"top"},["&".concat(t,"-required")]:{"&::before":{display:"inline-block",marginInlineEnd:e.marginXXS,color:c,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"'},["&".concat(t,"-required-mark-hidden, &").concat(t,"-required-mark-optional")]:{"&::before":{display:"none"}}},["".concat(t,"-optional")]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,["&".concat(t,"-required-mark-hidden")]:{display:"none"}},["".concat(t,"-tooltip")]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:d,marginInlineEnd:f},["&".concat(t,"-no-colon::after")]:{content:'"\\a0"'}}},["".concat(t,"-control")]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,["&:first-child:not([class^=\"'".concat(r,"-col-'\"]):not([class*=\"' ").concat(r,"-col-'\"])")]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%",["&:has(> ".concat(i,"-switch:only-child, > ").concat(i,"-rate:only-child)")]:{display:"flex",alignItems:"center"}}}},[t]:{"&-additional":{display:"flex",flexDirection:"column"},"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:"color ".concat(e.motionDurationMid," ").concat(e.motionEaseOut)},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},["&-with-help ".concat(t,"-explain")]:{height:"auto",opacity:1},["".concat(t,"-feedback-icon")]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:a.kr,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},m=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),g=e=>{let{antCls:t,formItemCls:n}=e;return{["".concat(n,"-horizontal")]:{["".concat(n,"-label")]:{flexGrow:0},["".concat(n,"-control")]:{flex:"1 1 0",minWidth:0},["".concat(n,"-label[class$='-24'], ").concat(n,"-label[class*='-24 ']")]:{["& + ".concat(n,"-control")]:{minWidth:"unset"}},["".concat(t,"-col-24").concat(n,"-label,\n ").concat(t,"-col-xl-24").concat(n,"-label")]:m(e)}}},v=e=>{let{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{["".concat(t,"-inline")]:{display:"flex",flexWrap:"wrap",["".concat(n,"-inline")]:{flex:"none",marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:"nowrap"},["> ".concat(n,"-label,\n > ").concat(n,"-control")]:{display:"inline-block",verticalAlign:"top"},["> ".concat(n,"-label")]:{flex:"none"},["".concat(t,"-text")]:{display:"inline-block"},["".concat(n,"-has-feedback")]:{display:"inline-block"}}}}},h=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{["".concat(n," ").concat(n,"-label")]:m(e),["".concat(t,":not(").concat(t,"-inline)")]:{[n]:{flexWrap:"wrap",["".concat(n,"-label, ").concat(n,"-control")]:{['&:not([class*=" '.concat(r,'-col-xs"])')]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},b=e=>{let{componentCls:t,formItemCls:n,antCls:o}=e;return{["".concat(n,"-vertical")]:{["".concat(n,"-row")]:{flexDirection:"column"},["".concat(n,"-label > label")]:{height:"auto"},["".concat(n,"-control")]:{width:"100%"},["".concat(n,"-label,\n ").concat(o,"-col-24").concat(n,"-label,\n ").concat(o,"-col-xl-24").concat(n,"-label")]:m(e)},["@media (max-width: ".concat((0,r.bf)(e.screenXSMax),")")]:[h(e),{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-xs-24").concat(n,"-label")]:m(e)}}}],["@media (max-width: ".concat((0,r.bf)(e.screenSMMax),")")]:{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-sm-24").concat(n,"-label")]:m(e)}}},["@media (max-width: ".concat((0,r.bf)(e.screenMDMax),")")]:{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-md-24").concat(n,"-label")]:m(e)}}},["@media (max-width: ".concat((0,r.bf)(e.screenLGMax),")")]:{[t]:{["".concat(n,":not(").concat(n,"-horizontal)")]:{["".concat(o,"-col-lg-24").concat(n,"-label")]:m(e)}}}}},y=(e,t)=>(0,c.IX)(e,{formItemCls:"".concat(e.componentCls,"-item"),rootPrefixCls:t});var x=(0,l.I$)("Form",(e,t)=>{let{rootPrefixCls:n}=t,r=y(e,n);return[f(r),p(r),s(r),g(r),v(r),b(r),(0,i.Z)(r),a.kr]},e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:"0 0 ".concat(e.paddingXS,"px"),verticalLabelMargin:0,inlineItemMarginBottom:0}),{order:-1e3})},13861:function(e,t,n){"use strict";n.d(t,{dD:function(){return a},lR:function(){return i},qo:function(){return o}});let r=["parentNode"];function o(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function a(e,t){if(!e.length)return;let n=e.join("_");return t?"".concat(t,"_").concat(n):r.includes(n)?"".concat("form_item","_").concat(n):n}function i(e,t,n,r,o,a){let i=r;return void 0!==a?i=a:n.validating?i="validating":e.length?i="error":t.length?i="warning":(n.touched||o&&n.validated)&&(i="success"),i}},77360:function(e,t,n){"use strict";var r=n(2265);t.Z=(0,r.createContext)(void 0)},62807:function(e,t,n){"use strict";let r=(0,n(2265).createContext)({});t.Z=r},54998:function(e,t,n){"use strict";var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(62807),l=n(96776),s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function u(e){return"auto"===e?"1 1 auto":"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}let d=["xs","sm","md","lg","xl","xxl"],f=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:o}=r.useContext(i.E_),{gutter:f,wrap:p}=r.useContext(c.Z),{prefixCls:m,span:g,order:v,offset:h,push:b,pull:y,className:x,children:w,flex:E,style:C}=e,Z=s(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),S=n("col",m),[O,k,j]=(0,l.cG)(S),I={},M={};d.forEach(t=>{let n={},r=e[t];"number"==typeof r?n.span=r:"object"==typeof r&&(n=r||{}),delete Z[t],M=Object.assign(Object.assign({},M),{["".concat(S,"-").concat(t,"-").concat(n.span)]:void 0!==n.span,["".concat(S,"-").concat(t,"-order-").concat(n.order)]:n.order||0===n.order,["".concat(S,"-").concat(t,"-offset-").concat(n.offset)]:n.offset||0===n.offset,["".concat(S,"-").concat(t,"-push-").concat(n.push)]:n.push||0===n.push,["".concat(S,"-").concat(t,"-pull-").concat(n.pull)]:n.pull||0===n.pull,["".concat(S,"-rtl")]:"rtl"===o}),n.flex&&(M["".concat(S,"-").concat(t,"-flex")]=!0,I["--".concat(S,"-").concat(t,"-flex")]=u(n.flex))});let R=a()(S,{["".concat(S,"-").concat(g)]:void 0!==g,["".concat(S,"-order-").concat(v)]:v,["".concat(S,"-offset-").concat(h)]:h,["".concat(S,"-push-").concat(b)]:b,["".concat(S,"-pull-").concat(y)]:y},x,M,k,j),N={};if(null==f?void 0:f[0]){let e="number"==typeof f[0]?"".concat(f[0]/2,"px"):"calc(".concat(f[0]," / 2)");N.paddingLeft=e,N.paddingRight=e}return E&&(N.flex=u(E),!1!==p||N.minWidth||(N.minWidth=0)),O(r.createElement("div",Object.assign({},Z,{style:Object.assign(Object.assign(Object.assign({},N),C),I),className:R,ref:t}),w))});t.Z=f},28617:function(e,t,n){"use strict";var r=n(2265),o=n(27380),a=n(51646),i=n(6543);t.Z=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,r.useRef)(t),[,c]=(0,a.N)(),l=(0,i.ZP)();return(0,o.Z)(()=>{let t=l.subscribe(t=>{n.current=t,e&&c()});return()=>l.unsubscribe(t)},[]),n.current}},77774:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var r=n(2265),o=n(36760),a=n.n(o),i=n(6543),c=n(71744),l=n(28617),s=n(62807),u=n(96776),d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function f(e,t){let[n,o]=r.useState("string"==typeof e?e:""),a=()=>{if("string"==typeof e&&o(e),"object"==typeof e)for(let n=0;n{a()},[JSON.stringify(e),t]),n}var p=r.forwardRef((e,t)=>{let{prefixCls:n,justify:o,align:p,className:m,style:g,children:v,gutter:h=0,wrap:b}=e,y=d(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),{getPrefixCls:x,direction:w}=r.useContext(c.E_),E=(0,l.Z)(!0,null),C=f(p,E),Z=f(o,E),S=x("row",n),[O,k,j]=(0,u.VM)(S),I=function(e,t){let n=[void 0,void 0],r=Array.isArray(e)?e:[e,void 0],o=t||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0};return r.forEach((e,t)=>{if("object"==typeof e&&null!==e)for(let r=0;r({gutter:[N,P],wrap:b}),[N,P,b]);return O(r.createElement(s.Z.Provider,{value:F},r.createElement("div",Object.assign({},y,{className:M,style:Object.assign(Object.assign({},R),g),ref:t}),v)))})},96776:function(e,t,n){"use strict";n.d(t,{VM:function(){return u},cG:function(){return f},hd:function(){return d}});var r=n(93463),o=n(99320),a=n(71140);let i=e=>{let{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},c=(e,t)=>{let{prefixCls:n,componentCls:r,gridColumns:o}=e,a={};for(let e=o;e>=0;e--)0===e?(a["".concat(r).concat(t,"-").concat(e)]={display:"none"},a["".concat(r,"-push-").concat(e)]={insetInlineStart:"auto"},a["".concat(r,"-pull-").concat(e)]={insetInlineEnd:"auto"},a["".concat(r).concat(t,"-push-").concat(e)]={insetInlineStart:"auto"},a["".concat(r).concat(t,"-pull-").concat(e)]={insetInlineEnd:"auto"},a["".concat(r).concat(t,"-offset-").concat(e)]={marginInlineStart:0},a["".concat(r).concat(t,"-order-").concat(e)]={order:0}):(a["".concat(r).concat(t,"-").concat(e)]=[{"--ant-display":"block",display:"block"},{display:"var(--ant-display)",flex:"0 0 ".concat(e/o*100,"%"),maxWidth:"".concat(e/o*100,"%")}],a["".concat(r).concat(t,"-push-").concat(e)]={insetInlineStart:"".concat(e/o*100,"%")},a["".concat(r).concat(t,"-pull-").concat(e)]={insetInlineEnd:"".concat(e/o*100,"%")},a["".concat(r).concat(t,"-offset-").concat(e)]={marginInlineStart:"".concat(e/o*100,"%")},a["".concat(r).concat(t,"-order-").concat(e)]={order:e});return a["".concat(r).concat(t,"-flex")]={flex:"var(--".concat(n).concat(t,"-flex)")},a},l=(e,t)=>c(e,t),s=(e,t,n)=>({["@media (min-width: ".concat((0,r.bf)(t),")")]:Object.assign({},l(e,n))}),u=(0,o.I$)("Grid",e=>{let{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},()=>({})),d=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin}),f=(0,o.I$)("Grid",e=>{let t=(0,a.IX)(e,{gridColumns:24}),n=d(t);return delete n.xs,[i(t),l(t,""),l(t,"-xs"),Object.keys(n).map(e=>s(t,n[e],"-".concat(e))).reduce((e,t)=>Object.assign(Object.assign({},e),t),{})]},()=>({}))},19015:function(e,t,n){"use strict";n.d(t,{Z:function(){return ev}});var r=n(2265),o=n(70464),a=n(1119),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},c=n(55015),l=r.forwardRef(function(e,t){return r.createElement(c.Z,(0,a.Z)({},e,{ref:t,icon:i}))}),s=n(36760),u=n.n(s),d=n(11993),f=n(41154),p=n(26365),m=n(6989),g=n(76405),v=n(25049);function h(){return"function"==typeof BigInt}function b(e){return!e&&0!==e&&!Number.isNaN(e)||!String(e).trim()}function y(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),(t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,"")).startsWith(".")&&(t="0".concat(t));var r=t||"0",o=r.split("."),a=o[0]||"0",i=o[1]||"0";"0"===a&&"0"===i&&(n=!1);var c=n?"-":"";return{negative:n,negativeStr:c,trimStr:r,integerStr:a,decimalStr:i,fullStr:"".concat(c).concat(r)}}function x(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function w(e){var t=String(e);if(x(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return null!=r&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&C(t)?t.length-t.indexOf(".")-1:0}function E(e){var t=String(e);if(x(e)){if(e>Number.MAX_SAFE_INTEGER)return String(h()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(e=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":y("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}(),S=function(){function e(t){if((0,g.Z)(this,e),(0,d.Z)(this,"origin",""),(0,d.Z)(this,"number",void 0),(0,d.Z)(this,"empty",void 0),b(t)){this.empty=!0;return}this.origin=String(t),this.number=Number(t)}return(0,v.Z)(e,[{key:"negate",value:function(){return new e(-this.toNumber())}},{key:"add",value:function(t){if(this.isInvalidate())return new e(t);var n=Number(t);if(Number.isNaN(n))return this;var r=this.number+n;if(r>Number.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(rNumber.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(r=this.add(e.negate().toString()).toNumber()}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return e?this.isInvalidate()?"":E(this.number):this.origin}}]),e}();function O(e){return h()?new Z(e):new S(e)}function k(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(""===e)return"";var o=y(e),a=o.negativeStr,i=o.integerStr,c=o.decimalStr,l="".concat(t).concat(c),s="".concat(a).concat(i);if(n>=0){var u=Number(c[n]);return u>=5&&!r?k(O(e).add("".concat(a,"0.").concat("0".repeat(n)).concat(10-u)).toString(),t,n,r):0===n?s:"".concat(s).concat(t).concat(c.padEnd(n,"0").slice(0,n))}return".0"===l?s:"".concat(s).concat(l)}var j=n(2027),I=n(27380),M=n(28791),R=n(32559),N=n(79267),P=function(){var e=(0,r.useState)(!1),t=(0,p.Z)(e,2),n=t[0],o=t[1];return(0,I.Z)(function(){o((0,N.Z)())},[]),n},F=n(53346);function T(e){var t=e.prefixCls,n=e.upNode,o=e.downNode,i=e.upDisabled,c=e.downDisabled,l=e.onStep,s=r.useRef(),f=r.useRef([]),p=r.useRef();p.current=l;var m=function(){clearTimeout(s.current)},g=function(e,t){e.preventDefault(),m(),p.current(t),s.current=setTimeout(function e(){p.current(t),s.current=setTimeout(e,200)},600)};if(r.useEffect(function(){return function(){m(),f.current.forEach(function(e){return F.Z.cancel(e)})}},[]),P())return null;var v="".concat(t,"-handler"),h=u()(v,"".concat(v,"-up"),(0,d.Z)({},"".concat(v,"-up-disabled"),i)),b=u()(v,"".concat(v,"-down"),(0,d.Z)({},"".concat(v,"-down-disabled"),c)),y=function(){return f.current.push((0,F.Z)(m))},x={unselectable:"on",role:"button",onMouseUp:y,onMouseLeave:y};return r.createElement("div",{className:"".concat(v,"-wrap")},r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){g(e,!0)},"aria-label":"Increase Value","aria-disabled":i,className:h}),n||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})),r.createElement("span",(0,a.Z)({},x,{onMouseDown:function(e){g(e,!1)},"aria-label":"Decrease Value","aria-disabled":c,className:b}),o||r.createElement("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})))}function A(e){var t="number"==typeof e?E(e):y(e).fullStr;return t.includes(".")?y(t.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:e+"0"}var _=n(55041),B=function(){var e=(0,r.useRef)(0),t=function(){F.Z.cancel(e.current)};return(0,r.useEffect)(function(){return t},[]),function(n){t(),e.current=(0,F.Z)(function(){n()})}},H=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","changeOnWheel","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep","changeOnBlur","domRef"],z=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","className","classNames"],L=function(e,t){return e||t.isEmpty()?t.toString():t.toNumber()},D=function(e){var t=O(e);return t.isInvalidate()?null:t},W=r.forwardRef(function(e,t){var n,o,i=e.prefixCls,c=e.className,l=e.style,s=e.min,g=e.max,v=e.step,h=void 0===v?1:v,b=e.defaultValue,y=e.value,x=e.disabled,Z=e.readOnly,S=e.upHandler,j=e.downHandler,N=e.keyboard,P=e.changeOnWheel,F=void 0!==P&&P,_=e.controls,z=(e.classNames,e.stringMode),W=e.parser,V=e.formatter,q=e.precision,X=e.decimalSeparator,G=e.onChange,U=e.onInput,$=e.onPressEnter,K=e.onStep,Y=e.changeOnBlur,Q=void 0===Y||Y,J=e.domRef,ee=(0,m.Z)(e,H),et="".concat(i,"-input"),en=r.useRef(null),er=r.useState(!1),eo=(0,p.Z)(er,2),ea=eo[0],ei=eo[1],ec=r.useRef(!1),el=r.useRef(!1),es=r.useRef(!1),eu=r.useState(function(){return O(null!=y?y:b)}),ed=(0,p.Z)(eu,2),ef=ed[0],ep=ed[1],em=r.useCallback(function(e,t){return t?void 0:q>=0?q:Math.max(w(e),w(h))},[q,h]),eg=r.useCallback(function(e){var t=String(e);if(W)return W(t);var n=t;return X&&(n=n.replace(X,".")),n.replace(/[^\w.-]+/g,"")},[W,X]),ev=r.useRef(""),eh=r.useCallback(function(e,t){if(V)return V(e,{userTyping:t,input:String(ev.current)});var n="number"==typeof e?E(e):e;if(!t){var r=em(n,t);C(n)&&(X||r>=0)&&(n=k(n,X||".",r))}return n},[V,em,X]),eb=r.useState(function(){var e=null!=b?b:y;return ef.isInvalidate()&&["string","number"].includes((0,f.Z)(e))?Number.isNaN(e)?"":e:eh(ef.toString(),!1)}),ey=(0,p.Z)(eb,2),ex=ey[0],ew=ey[1];function eE(e,t){ew(eh(e.isInvalidate()?e.toString(!1):e.toString(!t),t))}ev.current=ex;var eC=r.useMemo(function(){return D(g)},[g,q]),eZ=r.useMemo(function(){return D(s)},[s,q]),eS=r.useMemo(function(){return!(!eC||!ef||ef.isInvalidate())&&eC.lessEquals(ef)},[eC,ef]),eO=r.useMemo(function(){return!(!eZ||!ef||ef.isInvalidate())&&ef.lessEquals(eZ)},[eZ,ef]),ek=(n=en.current,o=(0,r.useRef)(null),[function(){try{var e=n.selectionStart,t=n.selectionEnd,r=n.value,a=r.substring(0,e),i=r.substring(t);o.current={start:e,end:t,value:r,beforeTxt:a,afterTxt:i}}catch(e){}},function(){if(n&&o.current&&ea)try{var e=n.value,t=o.current,r=t.beforeTxt,a=t.afterTxt,i=t.start,c=e.length;if(e.startsWith(r))c=r.length;else if(e.endsWith(a))c=e.length-o.current.afterTxt.length;else{var l=r[i-1],s=e.indexOf(l,i-1);-1!==s&&(c=s+1)}n.setSelectionRange(c,c)}catch(e){(0,R.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(e.message))}}]),ej=(0,p.Z)(ek,2),eI=ej[0],eM=ej[1],eR=function(e){return eC&&!e.lessEquals(eC)?eC:eZ&&!eZ.lessEquals(e)?eZ:null},eN=function(e){return!eR(e)},eP=function(e,t){var n=e,r=eN(n)||n.isEmpty();if(n.isEmpty()||t||(n=eR(n)||n,r=!0),!Z&&!x&&r){var o,a=n.toString(),i=em(a,t);return i>=0&&!eN(n=O(k(a,".",i)))&&(n=O(k(a,".",i,!0))),n.equals(ef)||(o=n,void 0===y&&ep(o),null==G||G(n.isEmpty()?null:L(z,n)),void 0===y&&eE(n,t)),n}return ef},eF=B(),eT=function e(t){if(eI(),ev.current=t,ew(t),!el.current){var n=O(eg(t));n.isNaN()||eP(n,!0)}null==U||U(t),eF(function(){var n=t;W||(n=t.replace(/。/g,".")),n!==t&&e(n)})},eA=function(e){if((!e||!eS)&&(e||!eO)){ec.current=!1;var t,n=O(es.current?A(h):h);e||(n=n.negate());var r=eP((ef||O(0)).add(n.toString()),!1);null==K||K(L(z,r),{offset:es.current?A(h):h,type:e?"up":"down"}),null===(t=en.current)||void 0===t||t.focus()}},e_=function(e){var t,n=O(eg(ex));t=n.isNaN()?eP(ef,e):eP(n,e),void 0!==y?eE(ef,!1):t.isNaN()||eE(t,!1)};return r.useEffect(function(){if(F&&ea){var e=function(e){eA(e.deltaY<0),e.preventDefault()},t=en.current;if(t)return t.addEventListener("wheel",e,{passive:!1}),function(){return t.removeEventListener("wheel",e)}}}),(0,I.o)(function(){ef.isInvalidate()||eE(ef,!1)},[q,V]),(0,I.o)(function(){var e=O(y);ep(e);var t=O(eg(ex));e.equals(t)&&ec.current&&!V||eE(e,ec.current)},[y]),(0,I.o)(function(){V&&eM()},[ex]),r.createElement("div",{ref:J,className:u()(i,c,(0,d.Z)((0,d.Z)((0,d.Z)((0,d.Z)((0,d.Z)({},"".concat(i,"-focused"),ea),"".concat(i,"-disabled"),x),"".concat(i,"-readonly"),Z),"".concat(i,"-not-a-number"),ef.isNaN()),"".concat(i,"-out-of-range"),!ef.isInvalidate()&&!eN(ef))),style:l,onFocus:function(){ei(!0)},onBlur:function(){Q&&e_(!1),ei(!1),ec.current=!1},onKeyDown:function(e){var t=e.key,n=e.shiftKey;ec.current=!0,es.current=n,"Enter"===t&&(el.current||(ec.current=!1),e_(!1),null==$||$(e)),!1!==N&&!el.current&&["Up","ArrowUp","Down","ArrowDown"].includes(t)&&(eA("Up"===t||"ArrowUp"===t),e.preventDefault())},onKeyUp:function(){ec.current=!1,es.current=!1},onCompositionStart:function(){el.current=!0},onCompositionEnd:function(){el.current=!1,eT(en.current.value)},onBeforeInput:function(){ec.current=!0}},(void 0===_||_)&&r.createElement(T,{prefixCls:i,upNode:S,downNode:j,upDisabled:eS,downDisabled:eO,onStep:eA}),r.createElement("div",{className:"".concat(et,"-wrap")},r.createElement("input",(0,a.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":s,"aria-valuemax":g,"aria-valuenow":ef.isInvalidate()?null:ef.toString(),step:h},ee,{ref:(0,M.sQ)(en,t),className:et,value:ex,onChange:function(e){eT(e.target.value)},disabled:x,readOnly:Z}))))}),V=r.forwardRef(function(e,t){var n=e.disabled,o=e.style,i=e.prefixCls,c=void 0===i?"rc-input-number":i,l=e.value,s=e.prefix,u=e.suffix,d=e.addonBefore,f=e.addonAfter,p=e.className,g=e.classNames,v=(0,m.Z)(e,z),h=r.useRef(null),b=r.useRef(null),y=r.useRef(null),x=function(e){y.current&&(0,_.nH)(y.current,e)};return r.useImperativeHandle(t,function(){var e,t;return e=y.current,t={focus:x,nativeElement:h.current.nativeElement||b.current},"undefined"!=typeof Proxy&&e?new Proxy(e,{get:function(e,n){if(t[n])return t[n];var r=e[n];return"function"==typeof r?r.bind(e):r}}):e}),r.createElement(j.Q,{className:p,triggerFocus:x,prefixCls:c,value:l,disabled:n,style:o,prefix:s,suffix:u,addonAfter:f,addonBefore:d,classNames:g,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"},ref:h},r.createElement(W,(0,a.Z)({prefixCls:c,disabled:n,ref:y,domRef:b,className:null==g?void 0:g.input},v)))}),q=n(391),X=n(12757),G=n(71744),U=n(18310),$=n(86586),K=n(64024),Y=n(33759),Q=n(39109),J=n(56250),ee=n(77685),et=n(93463),en=n(31282),er=n(37433),eo=n(65265),ea=n(12918),ei=n(17691),ec=n(99320),el=n(71140),es=n(54558);let eu=(e,t)=>{let{componentCls:n,borderRadiusSM:r,borderRadiusLG:o}=e,a="lg"===t?o:r;return{["&-".concat(t)]:{["".concat(n,"-handler-wrap")]:{borderStartEndRadius:a,borderEndEndRadius:a},["".concat(n,"-handler-up")]:{borderStartEndRadius:a},["".concat(n,"-handler-down")]:{borderEndEndRadius:a}}}},ed=e=>{let{componentCls:t,lineWidth:n,lineType:r,borderRadius:o,inputFontSizeSM:a,inputFontSizeLG:i,controlHeightLG:c,controlHeightSM:l,colorError:s,paddingInlineSM:u,paddingBlockSM:d,paddingBlockLG:f,paddingInlineLG:p,colorIcon:m,motionDurationMid:g,handleHoverColor:v,handleOpacity:h,paddingInline:b,paddingBlock:y,handleBg:x,handleActiveBg:w,colorTextDisabled:E,borderRadiusSM:C,borderRadiusLG:Z,controlWidth:S,handleBorderColor:O,filledHandleBg:k,lineHeightLG:j,calc:I}=e;return[{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,ea.Wf)(e)),(0,en.ik)(e)),{display:"inline-block",width:S,margin:0,padding:0,borderRadius:o}),(0,eo.qG)(e,{["".concat(t,"-handler-wrap")]:{background:x,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O)}}})),(0,eo.H8)(e,{["".concat(t,"-handler-wrap")]:{background:k,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O)}},"&:focus-within":{["".concat(t,"-handler-wrap")]:{background:x}}})),(0,eo.vc)(e,{["".concat(t,"-handler-wrap")]:{background:x,["".concat(t,"-handler-down")]:{borderBlockStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O)}}})),(0,eo.Mu)(e)),{"&-rtl":{direction:"rtl",["".concat(t,"-input")]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:i,lineHeight:j,borderRadius:Z,["input".concat(t,"-input")]:{height:I(c).sub(I(n).mul(2)).equal(),padding:"".concat((0,et.bf)(f)," ").concat((0,et.bf)(p))}},"&-sm":{padding:0,fontSize:a,borderRadius:C,["input".concat(t,"-input")]:{height:I(l).sub(I(n).mul(2)).equal(),padding:"".concat((0,et.bf)(d)," ").concat((0,et.bf)(u))}},"&-out-of-range":{["".concat(t,"-input-wrap")]:{input:{color:s}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,ea.Wf)(e)),(0,en.s7)(e)),{"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",textAlign:"start",verticalAlign:"top",["".concat(t,"-affix-wrapper")]:{width:"100%"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:Z,fontSize:e.fontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:C}}},(0,eo.ir)(e)),(0,eo.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})}),["&-disabled ".concat(t,"-input")]:{cursor:"not-allowed"},[t]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,ea.Wf)(e)),{width:"100%",padding:"".concat((0,et.bf)(y)," ").concat((0,et.bf)(b)),textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:o,outline:0,transition:"all ".concat(g," linear"),appearance:"textfield",fontSize:"inherit"}),(0,en.nz)(e.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,appearance:"none"}})},["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{width:e.handleWidth,opacity:1}})},{[t]:Object.assign(Object.assign(Object.assign({["".concat(t,"-handler-wrap")]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:e.handleVisibleWidth,opacity:h,height:"100%",borderStartStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o,borderEndStartRadius:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:"all ".concat(g),overflow:"hidden",["".concat(t,"-handler")]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{marginInlineEnd:0,fontSize:e.handleFontSize}}},["".concat(t,"-handler")]:{height:"50%",overflow:"hidden",color:m,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:"".concat((0,et.bf)(n)," ").concat(r," ").concat(O),transition:"all ".concat(g," linear"),"&:active":{background:w},"&:hover":{height:"60%",["\n ".concat(t,"-handler-up-inner,\n ").concat(t,"-handler-down-inner\n ")]:{color:v}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,ea.Ro)()),{color:m,transition:"all ".concat(g," linear"),userSelect:"none"})},["".concat(t,"-handler-up")]:{borderStartEndRadius:o},["".concat(t,"-handler-down")]:{borderEndEndRadius:o}},eu(e,"lg")),eu(e,"sm")),{"&-disabled, &-readonly":{["".concat(t,"-handler-wrap")]:{display:"none"},["".concat(t,"-input")]:{color:"inherit"}},["\n ".concat(t,"-handler-up-disabled,\n ").concat(t,"-handler-down-disabled\n ")]:{cursor:"not-allowed"},["\n ".concat(t,"-handler-up-disabled:hover &-handler-up-inner,\n ").concat(t,"-handler-down-disabled:hover &-handler-down-inner\n ")]:{color:E}})}]},ef=e=>{let{componentCls:t,paddingBlock:n,paddingInline:r,inputAffixPadding:o,controlWidth:a,borderRadiusLG:i,borderRadiusSM:c,paddingInlineLG:l,paddingInlineSM:s,paddingBlockLG:u,paddingBlockSM:d,motionDurationMid:f}=e;return{["".concat(t,"-affix-wrapper")]:Object.assign(Object.assign({["input".concat(t,"-input")]:{padding:"".concat((0,et.bf)(n)," 0")}},(0,en.ik)(e)),{position:"relative",display:"inline-flex",alignItems:"center",width:a,padding:0,paddingInlineStart:r,"&-lg":{borderRadius:i,paddingInlineStart:l,["input".concat(t,"-input")]:{padding:"".concat((0,et.bf)(u)," 0")}},"&-sm":{borderRadius:c,paddingInlineStart:s,["input".concat(t,"-input")]:{padding:"".concat((0,et.bf)(d)," 0")}},["&:not(".concat(t,"-disabled):hover")]:{zIndex:1},"&-focused, &:focus":{zIndex:1},["&-disabled > ".concat(t,"-disabled")]:{background:"transparent"},["> div".concat(t)]:{width:"100%",border:"none",outline:"none",["&".concat(t,"-focused")]:{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},["".concat(t,"-handler-wrap")]:{zIndex:2},[t]:{position:"static",color:"inherit","&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:o},"&-suffix":{insetBlockStart:0,insetInlineEnd:0,height:"100%",marginInlineEnd:r,marginInlineStart:o,transition:"margin ".concat(f)}},["&:hover ".concat(t,"-handler-wrap, &-focused ").concat(t,"-handler-wrap")]:{width:e.handleWidth,opacity:1},["&:not(".concat(t,"-affix-wrapper-without-controls):hover ").concat(t,"-suffix")]:{marginInlineEnd:e.calc(e.handleWidth).add(r).equal()}}),["".concat(t,"-underlined")]:{borderRadius:0}}};var ep=(0,ec.I$)("InputNumber",e=>{let t=(0,el.IX)(e,(0,er.e)(e));return[ed(t),ef(t),(0,ei.c)(t)]},e=>{var t;let n=null!==(t=e.handleVisible)&&void 0!==t?t:"auto",r=e.controlHeightSM-2*e.lineWidth;return Object.assign(Object.assign({},(0,er.T)(e)),{controlWidth:90,handleWidth:r,handleFontSize:e.fontSize/2,handleVisible:n,handleActiveBg:e.colorFillAlter,handleBg:e.colorBgContainer,filledHandleBg:new es.t(e.colorFillSecondary).onBackground(e.colorBgContainer).toHexString(),handleHoverColor:e.colorPrimary,handleBorderColor:e.colorBorder,handleOpacity:!0===n?1:0,handleVisibleWidth:!0===n?r:0})},{unitless:{handleOpacity:!0},resetFont:!1}),em=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let eg=r.forwardRef((e,t)=>{let{getPrefixCls:n,direction:a}=r.useContext(G.E_),i=r.useRef(null);r.useImperativeHandle(t,()=>i.current);let{className:c,rootClassName:s,size:d,disabled:f,prefixCls:p,addonBefore:m,addonAfter:g,prefix:v,suffix:h,bordered:b,readOnly:y,status:x,controls:w,variant:E}=e,C=em(e,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","suffix","bordered","readOnly","status","controls","variant"]),Z=n("input-number",p),S=(0,K.Z)(Z),[O,k,j]=ep(Z,S),{compactSize:I,compactItemClassnames:M}=(0,ee.ri)(Z,a),R=r.createElement(l,{className:"".concat(Z,"-handler-up-inner")}),N=r.createElement(o.Z,{className:"".concat(Z,"-handler-down-inner")});"object"==typeof w&&(R=void 0===w.upIcon?R:r.createElement("span",{className:"".concat(Z,"-handler-up-inner")},w.upIcon),N=void 0===w.downIcon?N:r.createElement("span",{className:"".concat(Z,"-handler-down-inner")},w.downIcon));let{hasFeedback:P,status:F,isFormItemInput:T,feedbackIcon:A}=r.useContext(Q.aM),_=(0,X.F)(F,x),B=(0,Y.Z)(e=>{var t;return null!==(t=null!=d?d:I)&&void 0!==t?t:e}),H=r.useContext($.Z),z=null!=f?f:H,[L,D]=(0,J.Z)("inputNumber",E,b),W=P&&r.createElement(r.Fragment,null,A),U=u()({["".concat(Z,"-lg")]:"large"===B,["".concat(Z,"-sm")]:"small"===B,["".concat(Z,"-rtl")]:"rtl"===a,["".concat(Z,"-in-form-item")]:T},k),et="".concat(Z,"-group");return O(r.createElement(V,Object.assign({ref:i,disabled:z,className:u()(j,S,c,s,M),upHandler:R,downHandler:N,prefixCls:Z,readOnly:y,controls:"boolean"==typeof w?w:void 0,prefix:v,suffix:W||h,addonBefore:m&&r.createElement(q.Z,{form:!0,space:!0},m),addonAfter:g&&r.createElement(q.Z,{form:!0,space:!0},g),classNames:{input:U,variant:u()({["".concat(Z,"-").concat(L)]:D},(0,X.Z)(Z,_,P)),affixWrapper:u()({["".concat(Z,"-affix-wrapper-sm")]:"small"===B,["".concat(Z,"-affix-wrapper-lg")]:"large"===B,["".concat(Z,"-affix-wrapper-rtl")]:"rtl"===a,["".concat(Z,"-affix-wrapper-without-controls")]:!1===w||z||y},k),wrapper:u()({["".concat(et,"-rtl")]:"rtl"===a},k),groupWrapper:u()({["".concat(Z,"-group-wrapper-sm")]:"small"===B,["".concat(Z,"-group-wrapper-lg")]:"large"===B,["".concat(Z,"-group-wrapper-rtl")]:"rtl"===a,["".concat(Z,"-group-wrapper-").concat(L)]:D},(0,X.Z)("".concat(Z,"-group-wrapper"),_,P),k)}},C)))});eg._InternalPanelDoNotUseOrYouWillBeFired=e=>r.createElement(U.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},r.createElement(eg,Object.assign({},e)));var ev=eg},39454:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var r=n(2265),o=n(36760),a=n.n(o),i=n(2027),c=n(28791),l=n(391),s=n(94611),u=n(12757),d=n(71744),f=n(86586),p=n(64024),m=n(33759),g=n(39109),v=n(56250),h=n(77685),b=n(39164),y=n(31282),x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},w=(0,r.forwardRef)((e,t)=>{let{prefixCls:n,bordered:o=!0,status:w,size:E,disabled:C,onBlur:Z,onFocus:S,suffix:O,allowClear:k,addonAfter:j,addonBefore:I,className:M,style:R,styles:N,rootClassName:P,onChange:F,classNames:T,variant:A}=e,_=x(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames","variant"]),{getPrefixCls:B,direction:H,allowClear:z,autoComplete:L,className:D,style:W,classNames:V,styles:q}=(0,d.dj)("input"),X=B("input",n),G=(0,r.useRef)(null),U=(0,p.Z)(X),[$,K,Y]=(0,y.TI)(X,P),[Q]=(0,y.ZP)(X,U),{compactSize:J,compactItemClassnames:ee}=(0,h.ri)(X,H),et=(0,m.Z)(e=>{var t;return null!==(t=null!=E?E:J)&&void 0!==t?t:e}),en=r.useContext(f.Z),{status:er,hasFeedback:eo,feedbackIcon:ea}=(0,r.useContext)(g.aM),ei=(0,u.F)(er,w),ec=!!(e.prefix||e.suffix||e.allowClear||e.showCount)||!!eo;(0,r.useRef)(ec);let el=(0,b.Z)(G,!0),es=(eo||O)&&r.createElement(r.Fragment,null,O,eo&&ea),eu=(0,s.Z)(null!=k?k:z),[ed,ef]=(0,v.Z)("input",A,o);return $(Q(r.createElement(i.Z,Object.assign({ref:(0,c.sQ)(t,G),prefixCls:X,autoComplete:L},_,{disabled:null!=C?C:en,onBlur:e=>{el(),null==Z||Z(e)},onFocus:e=>{el(),null==S||S(e)},style:Object.assign(Object.assign({},W),R),styles:Object.assign(Object.assign({},q),N),suffix:es,allowClear:eu,className:a()(M,P,Y,U,ee,D),onChange:e=>{el(),null==F||F(e)},addonBefore:I&&r.createElement(l.Z,{form:!0,space:!0},I),addonAfter:j&&r.createElement(l.Z,{form:!0,space:!0},j),classNames:Object.assign(Object.assign(Object.assign({},T),V),{input:a()({["".concat(X,"-sm")]:"small"===et,["".concat(X,"-lg")]:"large"===et,["".concat(X,"-rtl")]:"rtl"===H},null==T?void 0:T.input,V.input,K),variant:a()({["".concat(X,"-").concat(ed)]:ef},(0,u.Z)(X,ei)),affixWrapper:a()({["".concat(X,"-affix-wrapper-sm")]:"small"===et,["".concat(X,"-affix-wrapper-lg")]:"large"===et,["".concat(X,"-affix-wrapper-rtl")]:"rtl"===H},K),wrapper:a()({["".concat(X,"-group-rtl")]:"rtl"===H},K),groupWrapper:a()({["".concat(X,"-group-wrapper-sm")]:"small"===et,["".concat(X,"-group-wrapper-lg")]:"large"===et,["".concat(X,"-group-wrapper-rtl")]:"rtl"===H,["".concat(X,"-group-wrapper-").concat(ed)]:ef},(0,u.Z)("".concat(X,"-group-wrapper"),ei,eo),K)})}))))})},34766:function(e,t,n){"use strict";n.d(t,{Z:function(){return W}});var r,o=n(2265),a=n(36760),i=n.n(a),c=n(1119),l=n(11993),s=n(31686),u=n(83145),d=n(26365),f=n(6989),p=n(2027),m=n(96032),g=n(55041),v=n(50506),h=n(41154),b=n(31474),y=n(27380),x=n(53346),w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],E={},C=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Z=o.forwardRef(function(e,t){var n=e.prefixCls,a=e.defaultValue,u=e.value,p=e.autoSize,m=e.onResize,g=e.className,Z=e.style,S=e.disabled,O=e.onChange,k=(e.onInternalAutoSize,(0,f.Z)(e,C)),j=(0,v.Z)(a,{value:u,postState:function(e){return null!=e?e:""}}),I=(0,d.Z)(j,2),M=I[0],R=I[1],N=o.useRef();o.useImperativeHandle(t,function(){return{textArea:N.current}});var P=o.useMemo(function(){return p&&"object"===(0,h.Z)(p)?[p.minRows,p.maxRows]:[]},[p]),F=(0,d.Z)(P,2),T=F[0],A=F[1],_=!!p,B=o.useState(2),H=(0,d.Z)(B,2),z=H[0],L=H[1],D=o.useState(),W=(0,d.Z)(D,2),V=W[0],q=W[1],X=function(){L(0)};(0,y.Z)(function(){_&&X()},[u,T,A,_]),(0,y.Z)(function(){if(0===z)L(1);else if(1===z){var e=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;r||((r=document.createElement("textarea")).setAttribute("tab-index","-1"),r.setAttribute("aria-hidden","true"),r.setAttribute("name","hiddenTextarea"),document.body.appendChild(r)),e.getAttribute("wrap")?r.setAttribute("wrap",e.getAttribute("wrap")):r.removeAttribute("wrap");var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&E[n])return E[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),a=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),i=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),c={sizingStyle:w.map(function(e){return"".concat(e,":").concat(r.getPropertyValue(e))}).join(";"),paddingSize:a,borderSize:i,boxSizing:o};return t&&n&&(E[n]=c),c}(e,n),c=i.paddingSize,l=i.borderSize,s=i.boxSizing,u=i.sizingStyle;r.setAttribute("style","".concat(u,";").concat("\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n")),r.value=e.value||e.placeholder||"";var d=void 0,f=void 0,p=r.scrollHeight;if("border-box"===s?p+=l:"content-box"===s&&(p-=c),null!==o||null!==a){r.value=" ";var m=r.scrollHeight-c;null!==o&&(d=m*o,"border-box"===s&&(d=d+c+l),p=Math.max(d,p)),null!==a&&(f=m*a,"border-box"===s&&(f=f+c+l),t=p>f?"":"hidden",p=Math.min(f,p))}var g={height:p,overflowY:t,resize:"none"};return d&&(g.minHeight=d),f&&(g.maxHeight=f),g}(N.current,!1,T,A);L(2),q(e)}},[z]);var G=o.useRef(),U=function(){x.Z.cancel(G.current)};o.useEffect(function(){return U},[]);var $=(0,s.Z)((0,s.Z)({},Z),_?V:null);return(0===z||1===z)&&($.overflowY="hidden",$.overflowX="hidden"),o.createElement(b.Z,{onResize:function(e){2===z&&(null==m||m(e),p&&(U(),G.current=(0,x.Z)(function(){X()})))},disabled:!(p||m)},o.createElement("textarea",(0,c.Z)({},k,{ref:N,style:$,className:i()(n,g,(0,l.Z)({},"".concat(n,"-disabled"),S)),disabled:S,value:M,onChange:function(e){R(e.target.value),null==O||O(e)}})))}),S=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],O=o.forwardRef(function(e,t){var n,r,a=e.defaultValue,h=e.value,b=e.onFocus,y=e.onBlur,x=e.onChange,w=e.allowClear,E=e.maxLength,C=e.onCompositionStart,O=e.onCompositionEnd,k=e.suffix,j=e.prefixCls,I=void 0===j?"rc-textarea":j,M=e.showCount,R=e.count,N=e.className,P=e.style,F=e.disabled,T=e.hidden,A=e.classNames,_=e.styles,B=e.onResize,H=e.onClear,z=e.onPressEnter,L=e.readOnly,D=e.autoSize,W=e.onKeyDown,V=(0,f.Z)(e,S),q=(0,v.Z)(a,{value:h,defaultValue:a}),X=(0,d.Z)(q,2),G=X[0],U=X[1],$=null==G?"":String(G),K=o.useState(!1),Y=(0,d.Z)(K,2),Q=Y[0],J=Y[1],ee=o.useRef(!1),et=o.useState(null),en=(0,d.Z)(et,2),er=en[0],eo=en[1],ea=(0,o.useRef)(null),ei=(0,o.useRef)(null),ec=function(){var e;return null===(e=ei.current)||void 0===e?void 0:e.textArea},el=function(){ec().focus()};(0,o.useImperativeHandle)(t,function(){var e;return{resizableTextArea:ei.current,focus:el,blur:function(){ec().blur()},nativeElement:(null===(e=ea.current)||void 0===e?void 0:e.nativeElement)||ec()}}),(0,o.useEffect)(function(){J(function(e){return!F&&e})},[F]);var es=o.useState(null),eu=(0,d.Z)(es,2),ed=eu[0],ef=eu[1];o.useEffect(function(){if(ed){var e;(e=ec()).setSelectionRange.apply(e,(0,u.Z)(ed))}},[ed]);var ep=(0,m.Z)(R,M),em=null!==(n=ep.max)&&void 0!==n?n:E,eg=Number(em)>0,ev=ep.strategy($),eh=!!em&&ev>em,eb=function(e,t){var n=t;!ee.current&&ep.exceedFormatter&&ep.max&&ep.strategy(t)>ep.max&&(n=ep.exceedFormatter(t,{max:ep.max}),t!==n&&ef([ec().selectionStart||0,ec().selectionEnd||0])),U(n),(0,g.rJ)(e.currentTarget,e,x,n)},ey=k;ep.show&&(r=ep.showFormatter?ep.showFormatter({value:$,count:ev,maxLength:em}):"".concat(ev).concat(eg?" / ".concat(em):""),ey=o.createElement(o.Fragment,null,ey,o.createElement("span",{className:i()("".concat(I,"-data-count"),null==A?void 0:A.count),style:null==_?void 0:_.count},r)));var ex=!D&&!M&&!w;return o.createElement(p.Q,{ref:ea,value:$,allowClear:w,handleReset:function(e){U(""),el(),(0,g.rJ)(ec(),e,x)},suffix:ey,prefixCls:I,classNames:(0,s.Z)((0,s.Z)({},A),{},{affixWrapper:i()(null==A?void 0:A.affixWrapper,(0,l.Z)((0,l.Z)({},"".concat(I,"-show-count"),M),"".concat(I,"-textarea-allow-clear"),w))}),disabled:F,focused:Q,className:i()(N,eh&&"".concat(I,"-out-of-range")),style:(0,s.Z)((0,s.Z)({},P),er&&!ex?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof r?r:void 0}},hidden:T,readOnly:L,onClear:H},o.createElement(Z,(0,c.Z)({},V,{autoSize:D,maxLength:E,onKeyDown:function(e){"Enter"===e.key&&z&&z(e),null==W||W(e)},onChange:function(e){eb(e,e.target.value)},onFocus:function(e){J(!0),null==b||b(e)},onBlur:function(e){J(!1),null==y||y(e)},onCompositionStart:function(e){ee.current=!0,null==C||C(e)},onCompositionEnd:function(e){ee.current=!1,eb(e,e.currentTarget.value),null==O||O(e)},className:i()(null==A?void 0:A.textarea),style:(0,s.Z)((0,s.Z)({},null==_?void 0:_.textarea),{},{resize:null==P?void 0:P.resize}),disabled:F,prefixCls:I,onResize:function(e){var t;null==B||B(e),null!==(t=ec())&&void 0!==t&&t.style.height&&eo(!0)},ref:ei,readOnly:L})))}),k=n(94611),j=n(12757),I=n(71744),M=n(86586),R=n(64024),N=n(33759),P=n(39109),F=n(56250),T=n(77685),A=n(31282),_=n(99320),B=n(71140),H=n(37433);let z=e=>{let{componentCls:t,paddingLG:n}=e,r="".concat(t,"-textarea");return{["textarea".concat(t)]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:"all ".concat(e.motionDurationSlow),resize:"vertical",["&".concat(t,"-mouse-active")]:{transition:"all ".concat(e.motionDurationSlow,", height 0s, width 0s")}},["".concat(t,"-textarea-affix-wrapper-resize-dirty")]:{width:"auto"},[r]:{position:"relative","&-show-count":{["".concat(t,"-data-count")]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},["\n &-allow-clear > ".concat(t,",\n &-affix-wrapper").concat(r,"-has-feedback ").concat(t,"\n ")]:{paddingInlineEnd:n},["&-affix-wrapper".concat(t,"-affix-wrapper")]:{padding:0,["> textarea".concat(t)]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},["".concat(t,"-suffix")]:{margin:0,"> *:not(:last-child)":{marginInline:0},["".concat(t,"-clear-icon")]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},["".concat(r,"-suffix")]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},["&-affix-wrapper".concat(t,"-affix-wrapper-rtl")]:{["".concat(t,"-suffix")]:{["".concat(t,"-data-count")]:{direction:"ltr",insetInlineStart:0}}},["&-affix-wrapper".concat(t,"-affix-wrapper-sm")]:{["".concat(t,"-suffix")]:{["".concat(t,"-clear-icon")]:{insetInlineEnd:e.paddingInlineSM}}}}}};var L=(0,_.I$)(["Input","TextArea"],e=>z((0,B.IX)(e,(0,H.e)(e))),H.T,{resetFont:!1}),D=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},W=(0,o.forwardRef)((e,t)=>{var n;let{prefixCls:r,bordered:a=!0,size:c,disabled:l,status:s,allowClear:u,classNames:d,rootClassName:f,className:p,style:m,styles:v,variant:h,showCount:b,onMouseDown:y,onResize:x}=e,w=D(e,["prefixCls","bordered","size","disabled","status","allowClear","classNames","rootClassName","className","style","styles","variant","showCount","onMouseDown","onResize"]),{getPrefixCls:E,direction:C,allowClear:Z,autoComplete:S,className:_,style:B,classNames:H,styles:z}=(0,I.dj)("textArea"),W=o.useContext(M.Z),{status:V,hasFeedback:q,feedbackIcon:X}=o.useContext(P.aM),G=(0,j.F)(V,s),U=o.useRef(null);o.useImperativeHandle(t,()=>{var e;return{resizableTextArea:null===(e=U.current)||void 0===e?void 0:e.resizableTextArea,focus:e=>{var t,n;(0,g.nH)(null===(n=null===(t=U.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:()=>{var e;return null===(e=U.current)||void 0===e?void 0:e.blur()}}});let $=E("input",r),K=(0,R.Z)($),[Y,Q,J]=(0,A.TI)($,f),[ee]=L($,K),{compactSize:et,compactItemClassnames:en}=(0,T.ri)($,C),er=(0,N.Z)(e=>{var t;return null!==(t=null!=c?c:et)&&void 0!==t?t:e}),[eo,ea]=(0,F.Z)("textArea",h,a),ei=(0,k.Z)(null!=u?u:Z),[ec,el]=o.useState(!1),[es,eu]=o.useState(!1);return Y(ee(o.createElement(O,Object.assign({autoComplete:S},w,{style:Object.assign(Object.assign({},B),m),styles:Object.assign(Object.assign({},z),v),disabled:null!=l?l:W,allowClear:ei,className:i()(J,K,p,f,en,_,es&&"".concat($,"-textarea-affix-wrapper-resize-dirty")),classNames:Object.assign(Object.assign(Object.assign({},d),H),{textarea:i()({["".concat($,"-sm")]:"small"===er,["".concat($,"-lg")]:"large"===er},Q,null==d?void 0:d.textarea,H.textarea,ec&&"".concat($,"-mouse-active")),variant:i()({["".concat($,"-").concat(eo)]:ea},(0,j.Z)($,G)),affixWrapper:i()("".concat($,"-textarea-affix-wrapper"),{["".concat($,"-affix-wrapper-rtl")]:"rtl"===C,["".concat($,"-affix-wrapper-sm")]:"small"===er,["".concat($,"-affix-wrapper-lg")]:"large"===er,["".concat($,"-textarea-show-count")]:b||(null===(n=e.count)||void 0===n?void 0:n.show)},Q)}),prefixCls:$,suffix:q&&o.createElement("span",{className:"".concat($,"-textarea-suffix")},X),showCount:b,ref:U,onResize:e=>{var t,n;if(null==x||x(e),ec&&"function"==typeof getComputedStyle){let e=null===(n=null===(t=U.current)||void 0===t?void 0:t.nativeElement)||void 0===n?void 0:n.querySelector("textarea");e&&"both"===getComputedStyle(e).resize&&eu(!0)}},onMouseDown:e=>{el(!0),null==y||y(e);let t=()=>{el(!1),document.removeEventListener("mouseup",t)};document.addEventListener("mouseup",t)}}))))})},39164:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e,t){let n=(0,r.useRef)([]),o=()=>{n.current.push(setTimeout(()=>{var t,n,r,o;(null===(t=e.current)||void 0===t?void 0:t.input)&&(null===(n=e.current)||void 0===n?void 0:n.input.getAttribute("type"))==="password"&&(null===(r=e.current)||void 0===r?void 0:r.input.hasAttribute("value"))&&(null===(o=e.current)||void 0===o||o.input.removeAttribute("value"))}))};return(0,r.useEffect)(()=>(t&&o(),()=>n.current.forEach(e=>{e&&clearTimeout(e)})),[]),o}},4260:function(e,t,n){"use strict";n.d(t,{default:function(){return q}});var r=n(2265),o=n(36760),a=n.n(o),i=n(71744),c=n(39109),l=n(31282),s=n(39454),u=n(83145),d=n(58525),f=n(18242),p=n(12757),m=n(33759),g=n(99320),v=n(71140),h=n(37433);let b=e=>{let{componentCls:t,paddingXS:n}=e;return{[t]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,["".concat(t,"-input-wrapper")]:{position:"relative",["".concat(t,"-mask-icon")]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},["".concat(t,"-mask-input")]:{color:"transparent",caretColor:e.colorText},["".concat(t,"-mask-input[type=number]::-webkit-inner-spin-button")]:{"-webkit-appearance":"none",margin:0},["".concat(t,"-mask-input[type=number]")]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},["".concat(t,"-input")]:{textAlign:"center",paddingInline:e.paddingXXS},["&".concat(t,"-sm ").concat(t,"-input")]:{paddingInline:e.calc(e.paddingXXS).div(2).equal()},["&".concat(t,"-lg ").concat(t,"-input")]:{paddingInline:e.paddingXS}}}};var y=(0,g.I$)(["Input","OTP"],e=>b((0,v.IX)(e,(0,h.e)(e))),h.T),x=n(53346),w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let E=r.forwardRef((e,t)=>{let{className:n,value:o,onChange:c,onActiveChange:l,index:u,mask:d}=e,f=w(e,["className","value","onChange","onActiveChange","index","mask"]),{getPrefixCls:p}=r.useContext(i.E_),m=p("otp"),g="string"==typeof d?d:o,v=r.useRef(null);r.useImperativeHandle(t,()=>v.current);let h=()=>{(0,x.Z)(()=>{var e;let t=null===(e=v.current)||void 0===e?void 0:e.input;document.activeElement===t&&t&&t.select()})};return r.createElement("span",{className:"".concat(m,"-input-wrapper"),role:"presentation"},d&&""!==o&&void 0!==o&&r.createElement("span",{className:"".concat(m,"-mask-icon"),"aria-hidden":"true"},g),r.createElement(s.Z,Object.assign({"aria-label":"OTP Input ".concat(u+1),type:!0===d?"password":"text"},f,{ref:v,value:o,onInput:e=>{c(u,e.target.value)},onFocus:h,onKeyDown:e=>{let{key:t,ctrlKey:n,metaKey:r}=e;"ArrowLeft"===t?l(u-1):"ArrowRight"===t?l(u+1):"z"===t&&(n||r)?e.preventDefault():"Backspace"!==t||o||l(u-1),h()},onMouseDown:h,onMouseUp:h,className:a()(n,{["".concat(m,"-mask-input")]:d})})))});var C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Z(e){return(e||"").split("")}let S=e=>{let{index:t,prefixCls:n,separator:o}=e,a="function"==typeof o?o(t):o;return a?r.createElement("span",{className:"".concat(n,"-separator")},a):null},O=r.forwardRef((e,t)=>{let{prefixCls:n,length:o=6,size:l,defaultValue:s,value:g,onChange:v,formatter:h,separator:b,variant:x,disabled:w,status:O,autoFocus:k,mask:j,type:I,onInput:M,inputMode:R}=e,N=C(e,["prefixCls","length","size","defaultValue","value","onChange","formatter","separator","variant","disabled","status","autoFocus","mask","type","onInput","inputMode"]),{getPrefixCls:P,direction:F}=r.useContext(i.E_),T=P("otp",n),A=(0,f.Z)(N,{aria:!0,data:!0,attr:!0}),[_,B,H]=y(T),z=(0,m.Z)(e=>null!=l?l:e),L=r.useContext(c.aM),D=(0,p.F)(L.status,O),W=r.useMemo(()=>Object.assign(Object.assign({},L),{status:D,hasFeedback:!1,feedbackIcon:null}),[L,D]),V=r.useRef(null),q=r.useRef({});r.useImperativeHandle(t,()=>({focus:()=>{var e;null===(e=q.current[0])||void 0===e||e.focus()},blur:()=>{var e;for(let t=0;th?h(e):e,[G,U]=r.useState(()=>Z(X(s||"")));r.useEffect(()=>{void 0!==g&&U(Z(g))},[g]);let $=(0,d.Z)(e=>{U(e),M&&M(e),v&&e.length===o&&e.every(e=>e)&&e.some((e,t)=>G[t]!==e)&&v(e.join(""))}),K=(0,d.Z)((e,t)=>{let n=(0,u.Z)(G);for(let t=0;t=0&&!n[e];e-=1)n.pop();return n=Z(X(n.map(e=>e||" ").join(""))).map((e,t)=>" "!==e||n[t]?e:n[t])}),Y=(e,t)=>{var n;let r=K(e,t),a=Math.min(e+t.length,o-1);a!==e&&void 0!==r[e]&&(null===(n=q.current[a])||void 0===n||n.focus()),$(r)},Q=e=>{var t;null===(t=q.current[e])||void 0===t||t.focus()},J={variant:x,disabled:w,status:D,mask:j,type:I,inputMode:R};return _(r.createElement("div",Object.assign({},A,{ref:V,className:a()(T,{["".concat(T,"-sm")]:"small"===z,["".concat(T,"-lg")]:"large"===z,["".concat(T,"-rtl")]:"rtl"===F},H,B),role:"group"}),r.createElement(c.aM.Provider,{value:W},Array.from({length:o}).map((e,t)=>{let n="otp-".concat(t),a=G[t]||"";return r.createElement(r.Fragment,{key:n},r.createElement(E,Object.assign({ref:e=>{q.current[t]=e},index:t,size:z,htmlSize:1,className:"".concat(T,"-input"),onChange:Y,value:a,onActiveChange:Q,autoFocus:0===t&&k},J)),tt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let F=e=>e?r.createElement(j.Z,null):r.createElement(k.Z,null),T={click:"onClick",hover:"onMouseOver"},A=r.forwardRef((e,t)=>{let{disabled:n,action:o="click",visibilityToggle:c=!0,iconRender:l=F,suffix:u}=e,d=r.useContext(R.Z),f=null!=n?n:d,p="object"==typeof c&&void 0!==c.visible,[m,g]=(0,r.useState)(()=>!!p&&c.visible),v=(0,r.useRef)(null);r.useEffect(()=>{p&&g(c.visible)},[p,c]);let h=(0,N.Z)(v),b=()=>{var e;if(f)return;m&&h();let t=!m;g(t),"object"==typeof c&&(null===(e=c.onVisibleChange)||void 0===e||e.call(c,t))},{className:y,prefixCls:x,inputPrefixCls:w,size:E}=e,C=P(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:Z}=r.useContext(i.E_),S=Z("input",w),O=Z("input-password",x),k=c&&(e=>{let t=T[o]||"",n=l(m);return r.cloneElement(r.isValidElement(n)?n:r.createElement("span",null,n),{[t]:b,className:"".concat(e,"-icon"),key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}})})(O),j=a()(O,y,{["".concat(O,"-").concat(E)]:!!E}),A=Object.assign(Object.assign({},(0,I.Z)(C,["suffix","iconRender","visibilityToggle"])),{type:m?"text":"password",className:j,prefixCls:S,suffix:r.createElement(r.Fragment,null,k,u)});return E&&(A.size=E),r.createElement(s.Z,Object.assign({ref:(0,M.sQ)(t,v)},A))});var _=n(29436),B=n(19722),H=n(5545),z=n(77685),L=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let D=r.forwardRef((e,t)=>{let n;let{prefixCls:o,inputPrefixCls:c,className:l,size:u,suffix:d,enterButton:f=!1,addonAfter:p,loading:g,disabled:v,onSearch:h,onChange:b,onCompositionStart:y,onCompositionEnd:x,variant:w,onPressEnter:E}=e,C=L(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd","variant","onPressEnter"]),{getPrefixCls:Z,direction:S}=r.useContext(i.E_),O=r.useRef(!1),k=Z("input-search",o),j=Z("input",c),{compactSize:I}=(0,z.ri)(k,S),R=(0,m.Z)(e=>{var t;return null!==(t=null!=u?u:I)&&void 0!==t?t:e}),N=r.useRef(null),P=e=>{var t;document.activeElement===(null===(t=N.current)||void 0===t?void 0:t.input)&&e.preventDefault()},F=e=>{var t,n;h&&h(null===(n=null===(t=N.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e,{source:"input"})},T="boolean"==typeof f?r.createElement(_.Z,null):null,A="".concat(k,"-button"),D=f||{},W=D.type&&!0===D.type.__ANT_BUTTON;n=W||"button"===D.type?(0,B.Tm)(D,Object.assign({onMouseDown:P,onClick:e=>{var t,n;null===(n=null===(t=null==D?void 0:D.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),F(e)},key:"enterButton"},W?{className:A,size:R}:{})):r.createElement(H.ZP,{className:A,color:f?"primary":"default",size:R,disabled:v,key:"enterButton",onMouseDown:P,onClick:F,loading:g,icon:T,variant:"borderless"===w||"filled"===w||"underlined"===w?"text":f?"solid":void 0},f),p&&(n=[n,(0,B.Tm)(p,{key:"addonAfter"})]);let V=a()(k,{["".concat(k,"-rtl")]:"rtl"===S,["".concat(k,"-").concat(R)]:!!R,["".concat(k,"-with-button")]:!!f},l),q=Object.assign(Object.assign({},C),{className:V,prefixCls:j,type:"search",size:R,variant:w,onPressEnter:e=>{O.current||g||(null==E||E(e),F(e))},onCompositionStart:e=>{O.current=!0,null==y||y(e)},onCompositionEnd:e=>{O.current=!1,null==x||x(e)},addonAfter:n,suffix:d,onChange:e=>{(null==e?void 0:e.target)&&"click"===e.type&&h&&h(e.target.value,e,{source:"clear"}),null==b||b(e)},disabled:v});return r.createElement(s.Z,Object.assign({ref:(0,M.sQ)(N,t)},q))});var W=n(34766);let V=s.Z;V.Group=e=>{let{getPrefixCls:t,direction:n}=(0,r.useContext)(i.E_),{prefixCls:o,className:s}=e,u=t("input-group",o),d=t("input"),[f,p,m]=(0,l.ZP)(d),g=a()(u,m,{["".concat(u,"-lg")]:"large"===e.size,["".concat(u,"-sm")]:"small"===e.size,["".concat(u,"-compact")]:e.compact,["".concat(u,"-rtl")]:"rtl"===n},p,s),v=(0,r.useContext)(c.aM),h=(0,r.useMemo)(()=>Object.assign(Object.assign({},v),{isFormItemInput:!1}),[v]);return f(r.createElement("span",{className:g,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},r.createElement(c.aM.Provider,{value:h},e.children)))},V.Search=D,V.TextArea=W.Z,V.Password=A,V.OTP=O;var q=V},31282:function(e,t,n){"use strict";n.d(t,{TI:function(){return w},ik:function(){return p},nz:function(){return u},s7:function(){return m},x0:function(){return f}});var r=n(93463),o=n(12918),a=n(17691),i=n(99320),c=n(71140),l=n(37433),s=n(65265);let u=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),d=e=>{let{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:o,paddingInlineLG:a}=e;return{padding:"".concat((0,r.bf)(t)," ").concat((0,r.bf)(a)),fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:o}},f=e=>({padding:"".concat((0,r.bf)(e.paddingBlockSM)," ").concat((0,r.bf)(e.paddingInlineSM)),fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),p=e=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:"".concat((0,r.bf)(e.paddingBlock)," ").concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationMid)},u(e.colorTextPlaceholder)),{"&-lg":Object.assign({},d(e)),"&-sm":Object.assign({},f(e)),"&-rtl, &-textarea-rtl":{direction:"rtl"}}),m=e=>{let{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},["&-lg ".concat(t,", &-lg > ").concat(t,"-group-addon")]:Object.assign({},d(e)),["&-sm ".concat(t,", &-sm > ").concat(t,"-group-addon")]:Object.assign({},f(e)),["&-lg ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightLG},["&-sm ".concat(n,"-select-single ").concat(n,"-select-selector")]:{height:e.controlHeightSM},["> ".concat(t)]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},["".concat(t,"-group")]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:"0 ".concat((0,r.bf)(e.paddingInline)),color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:"all ".concat(e.motionDurationSlow),lineHeight:1,["".concat(n,"-select")]:{margin:"".concat((0,r.bf)(e.calc(e.paddingBlock).add(1).mul(-1).equal())," ").concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),["&".concat(n,"-select-single:not(").concat(n,"-select-customize-input):not(").concat(n,"-pagination-size-changer)")]:{["".concat(n,"-select-selector")]:{backgroundColor:"inherit",border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),boxShadow:"none"}}},["".concat(n,"-cascader-picker")]:{margin:"-9px ".concat((0,r.bf)(e.calc(e.paddingInline).mul(-1).equal())),backgroundColor:"transparent",["".concat(n,"-cascader-input")]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,["".concat(t,"-search-with-button &")]:{zIndex:0}}},["> ".concat(t,":first-child, ").concat(t,"-group-addon:first-child")]:{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,"-affix-wrapper")]:{["&:not(:first-child) ".concat(t)]:{borderStartStartRadius:0,borderEndStartRadius:0},["&:not(:last-child) ".concat(t)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["> ".concat(t,":last-child, ").concat(t,"-group-addon:last-child")]:{borderStartStartRadius:0,borderEndStartRadius:0,["".concat(n,"-select ").concat(n,"-select-selector")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["".concat(t,"-affix-wrapper")]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,["".concat(t,"-search &")]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius}},["&:not(:first-child), ".concat(t,"-search &:not(:first-child)")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&".concat(t,"-group-compact")]:Object.assign(Object.assign({display:"block"},(0,o.dF)()),{["".concat(t,"-group-addon, ").concat(t,"-group-wrap, > ").concat(t)]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},["\n & > ".concat(t,"-affix-wrapper,\n & > ").concat(t,"-number-affix-wrapper,\n & > ").concat(n,"-picker-range\n ")]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:"none"},["& > ".concat(n,"-select > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete ").concat(t,",\n & > ").concat(n,"-cascader-picker ").concat(t,",\n & > ").concat(t,"-group-wrapper ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},["& > ".concat(n,"-select-focused")]:{zIndex:1},["& > ".concat(n,"-select > ").concat(n,"-select-arrow")]:{zIndex:1},["& > *:first-child,\n & > ".concat(n,"-select:first-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-select-auto-complete:first-child ").concat(t,",\n & > ").concat(n,"-cascader-picker:first-child ").concat(t)]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},["& > *:last-child,\n & > ".concat(n,"-select:last-child > ").concat(n,"-select-selector,\n & > ").concat(n,"-cascader-picker:last-child ").concat(t,",\n & > ").concat(n,"-cascader-picker-focused:last-child ").concat(t)]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},["& > ".concat(n,"-select-auto-complete ").concat(t)]:{verticalAlign:"top"},["".concat(t,"-group-wrapper + ").concat(t,"-group-wrapper")]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),["".concat(t,"-affix-wrapper")]:{borderRadius:0}},["".concat(t,"-group-wrapper:not(:last-child)")]:{["&".concat(t,"-search > ").concat(t,"-group")]:{["& > ".concat(t,"-group-addon > ").concat(t,"-search-button")]:{borderRadius:0},["& > ".concat(t)]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},g=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:a}=e,i=a(n).sub(a(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),p(e)),(0,s.qG)(e)),(0,s.H8)(e)),(0,s.Mu)(e)),(0,s.vc)(e)),{'&[type="color"]':{height:e.controlHeight,["&".concat(t,"-lg")]:{height:e.controlHeightLG},["&".concat(t,"-sm")]:{height:n,paddingTop:i,paddingBottom:i}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}})}},v=e=>{let{componentCls:t}=e;return{["".concat(t,"-clear-icon")]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:"0 ".concat((0,r.bf)(e.inputAffixPadding))}}}},h=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:a,colorIconHover:i,iconCls:c}=e,l="".concat(t,"-affix-wrapper"),s="".concat(t,"-affix-wrapper-disabled");return{[l]:Object.assign(Object.assign(Object.assign(Object.assign({},p(e)),{display:"inline-flex",["&:not(".concat(t,"-disabled):hover")]:{zIndex:1,["".concat(t,"-search-with-button &")]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},["> input".concat(t)]:{padding:0},["> input".concat(t,", > textarea").concat(t)]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),v(e)),{["".concat(c).concat(t,"-password-icon")]:{color:a,cursor:"pointer",transition:"all ".concat(o),"&:hover":{color:i}}}),["".concat(t,"-underlined")]:{borderRadius:0},[s]:{["".concat(c).concat(t,"-password-icon")]:{color:a,cursor:"not-allowed","&:hover":{color:a}}}}},b=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{["".concat(t,"-group")]:Object.assign(Object.assign(Object.assign({},(0,o.Wf)(e)),m(e)),{"&-rtl":{direction:"rtl"},"&-wrapper":Object.assign(Object.assign(Object.assign({display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{["".concat(t,"-group-addon")]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{["".concat(t,"-group-addon")]:{borderRadius:r}}},(0,s.ir)(e)),(0,s.S5)(e)),{["&:not(".concat(t,"-compact-first-item):not(").concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-first-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-last-item")]:{["".concat(t,", ").concat(t,"-group-addon")]:{borderStartStartRadius:0,borderEndStartRadius:0}},["&:not(".concat(t,"-compact-last-item)").concat(t,"-compact-item")]:{["".concat(t,"-affix-wrapper")]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&:not(".concat(t,"-compact-first-item)").concat(t,"-compact-item")]:{["".concat(t,"-affix-wrapper")]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},y=e=>{let{componentCls:t,antCls:n}=e,r="".concat(t,"-search");return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{["+ ".concat(t,"-group-addon ").concat(r,"-button:not(").concat(n,"-btn-color-primary):not(").concat(n,"-btn-variant-text)")]:{borderInlineStartColor:e.colorPrimaryHover}}},["".concat(t,"-affix-wrapper")]:{height:e.controlHeight,borderRadius:0},["".concat(t,"-lg")]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},["> ".concat(t,"-group")]:{["> ".concat(t,"-group-addon:last-child")]:{insetInlineStart:-1,padding:0,border:0,["".concat(r,"-button")]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:"none"},["".concat(r,"-button:not(").concat(n,"-btn-color-primary)")]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},["&".concat(n,"-btn-loading::before")]:{inset:0}}}},["".concat(r,"-button")]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{["".concat(t,"-affix-wrapper, ").concat(r,"-button")]:{height:e.controlHeightLG}},"&-small":{["".concat(t,"-affix-wrapper, ").concat(r,"-button")]:{height:e.controlHeightSM}},"&-rtl":{direction:"rtl"},["&".concat(t,"-compact-item")]:{["&:not(".concat(t,"-compact-last-item)")]:{["".concat(t,"-group-addon")]:{["".concat(t,"-search-button")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderRadius:0}}},["&:not(".concat(t,"-compact-first-item)")]:{["".concat(t,",").concat(t,"-affix-wrapper")]:{borderRadius:0}},["> ".concat(t,"-group-addon ").concat(t,"-search-button,\n > ").concat(t,",\n ").concat(t,"-affix-wrapper")]:{"&:hover, &:focus, &:active":{zIndex:2}},["> ".concat(t,"-affix-wrapper-focused")]:{zIndex:2}}}}},x=e=>{let{componentCls:t}=e;return{["".concat(t,"-out-of-range")]:{["&, & input, & textarea, ".concat(t,"-show-count-suffix, ").concat(t,"-data-count")]:{color:e.colorError}}}},w=(0,i.I$)(["Input","Shared"],e=>{let t=(0,c.IX)(e,(0,l.e)(e));return[g(t),h(t)]},l.T,{resetFont:!1});t.ZP=(0,i.I$)(["Input","Component"],e=>{let t=(0,c.IX)(e,(0,l.e)(e));return[b(t),y(t),x(t),(0,a.c)(t)]},l.T,{resetFont:!1})},37433:function(e,t,n){"use strict";n.d(t,{T:function(){return a},e:function(){return o}});var r=n(71140);function o(e){return(0,r.IX)(e,{inputAffixPadding:e.paddingXXS})}let a=e=>{let{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:a,controlHeightLG:i,fontSizeLG:c,lineHeightLG:l,paddingSM:s,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:f,colorPrimaryHover:p,colorPrimary:m,controlOutlineWidth:g,controlOutline:v,colorErrorOutline:h,colorWarningOutline:b,colorBgContainer:y,inputFontSize:x,inputFontSizeLG:w,inputFontSizeSM:E}=e,C=x||n,Z=E||C,S=w||c;return{paddingBlock:Math.max(Math.round((t-C*r)/2*10)/10-o,0),paddingBlockSM:Math.max(Math.round((a-Z*r)/2*10)/10-o,0),paddingBlockLG:Math.max(Math.ceil((i-S*l)/2*10)/10-o,0),paddingInline:s-o,paddingInlineSM:u-o,paddingInlineLG:d-o,addonBg:f,activeBorderColor:m,hoverBorderColor:p,activeShadow:"0 0 0 ".concat(g,"px ").concat(v),errorActiveShadow:"0 0 0 ".concat(g,"px ").concat(h),warningActiveShadow:"0 0 0 ".concat(g,"px ").concat(b),hoverBg:y,activeBg:y,inputFontSize:C,inputFontSizeLG:S,inputFontSizeSM:Z}}},65265:function(e,t,n){"use strict";n.d(t,{$U:function(){return c},H8:function(){return g},Mu:function(){return f},S5:function(){return h},Xy:function(){return i},ir:function(){return d},qG:function(){return s},vc:function(){return x}});var r=n(93463),o=n(71140);let a=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),i=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":Object.assign({},a((0,o.IX)(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled})))}),c=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),l=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},c(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}}),["&".concat(e.componentCls,"-status-").concat(t.status).concat(e.componentCls,"-disabled")]:{borderColor:t.borderColor}}),s=(e,t)=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},c(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),l(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),l(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)}),u=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),d=e=>({"&-outlined":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.addonBg,border:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}}},u(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText})),u(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group-addon")]:Object.assign({},i(e))}})}),f=(e,t)=>{let{componentCls:n}=e;return{"&-borderless":Object.assign({background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},["&".concat(n,"-disabled, &[disabled]")]:{color:e.colorTextDisabled,cursor:"not-allowed"},["&".concat(n,"-status-error")]:{"&, & input, & textarea":{color:e.colorError}},["&".concat(n,"-status-warning")]:{"&, & input, & textarea":{color:e.colorWarning}}},t)}},p=(e,t)=>{var n;return{background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:null!==(n=null==t?void 0:t.inputColor)&&void 0!==n?n:"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}},m=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},p(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}})}),g=(e,t)=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:Object.assign({},i(e))}),m(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError})),m(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning})),t)}),v=(e,t)=>({["&".concat(e.componentCls,"-group-wrapper-status-").concat(t.status)]:{["".concat(e.componentCls,"-group-addon")]:{background:t.addonBg,color:t.addonColor}}}),h=e=>({"&-filled":Object.assign(Object.assign(Object.assign({["".concat(e.componentCls,"-group-addon")]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}}},v(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText})),v(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText})),{["&".concat(e.componentCls,"-group-wrapper-disabled")]:{["".concat(e.componentCls,"-group")]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)},"&-addon:last-child":{borderInlineEnd:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderTop:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderBottom:"".concat((0,r.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder)}}}})}),b=(e,t)=>({background:e.colorBgContainer,borderWidth:"".concat((0,r.bf)(e.lineWidth)," 0"),borderStyle:"".concat(e.lineType," none"),borderColor:"transparent transparent ".concat(t.borderColor," transparent"),borderRadius:0,"&:hover":{borderColor:"transparent transparent ".concat(t.hoverBorderColor," transparent"),backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:"transparent transparent ".concat(t.activeBorderColor," transparent"),outline:0,backgroundColor:e.activeBg}}),y=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status,":not(").concat(e.componentCls,"-disabled)")]:Object.assign(Object.assign({},b(e,t)),{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-suffix")]:{color:t.affixColor}}),["&".concat(e.componentCls,"-status-").concat(t.status).concat(e.componentCls,"-disabled")]:{borderColor:"transparent transparent ".concat(t.borderColor," transparent")}}),x=(e,t)=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},b(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow})),{["&".concat(e.componentCls,"-disabled, &[disabled]")]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:"transparent transparent ".concat(e.colorBorder," transparent")}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"}}),y(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError})),y(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning})),t)})},91325:function(e,t,n){"use strict";let r=(0,n(2265).createContext)(void 0);t.Z=r},37381:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(96257),o=n(31686),a=(0,o.Z)((0,o.Z)({},{yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0}),{},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",week:"Week",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",dateFormat:"M/D/YYYY",dateTimeFormat:"M/D/YYYY HH:mm:ss",previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"}),i={placeholder:"Select time",rangePlaceholder:["Start time","End time"]};let c={lang:Object.assign({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},a),timePickerLocale:Object.assign({},i)},l="${label} is not a valid ${type}";var s={locale:"en",Pagination:r.Z,DatePicker:c,TimePicker:i,Calendar:c,global:{placeholder:"Please select",close:"Close"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckAll:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",deselectAll:"Deselect all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand",collapse:"Collapse"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:l,method:l,array:l,object:l,number:l,date:l,boolean:l,integer:l,float:l,regexp:l,email:l,url:l,hex:l},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"},QRCode:{expired:"QR code expired",refresh:"Refresh",scanned:"Scanned"},ColorPicker:{presetEmpty:"Empty",transparent:"Transparent",singleColor:"Single",gradientColor:"Gradient"}}},55274:function(e,t,n){"use strict";var r=n(2265),o=n(91325),a=n(37381);t.Z=(e,t)=>{let n=r.useContext(o.Z);return[r.useMemo(()=>{var r;let o=t||a.Z[e],i=null!==(r=null==n?void 0:n[e])&&void 0!==r?r:{};return Object.assign(Object.assign({},"function"==typeof o?o():o),i||{})},[e,t,n]),r.useMemo(()=>{let e=null==n?void 0:n.locale;return(null==n?void 0:n.exist)&&!e?a.Z.locale:e},[n])]}},42264:function(e,t,n){"use strict";n.d(t,{ZP:function(){return X}});var r=n(83145),o=n(2265),a=n(52402),i=n(71744),c=n(18310),l=n(66061),s=n(8900),u=n(39725),d=n(54537),f=n(55726),p=n(61935),m=n(36760),g=n.n(m),v=n(49283),h=n(64024),b=n(93463),y=n(62236),x=n(12918),w=n(99320),E=n(71140);let C=e=>{let{componentCls:t,iconCls:n,boxShadow:r,colorText:o,colorSuccess:a,colorError:i,colorWarning:c,colorInfo:l,fontSizeLG:s,motionEaseInOutCirc:u,motionDurationSlow:d,marginXS:f,paddingXS:p,borderRadiusLG:m,zIndexPopup:g,contentPadding:v,contentBg:h}=e,y="".concat(t,"-notice"),w=new b.E4("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:p,transform:"translateY(0)",opacity:1}}),E=new b.E4("MessageMoveOut",{"0%":{maxHeight:e.height,padding:p,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),C={padding:p,textAlign:"center",["".concat(t,"-custom-content")]:{display:"flex",alignItems:"center"},["".concat(t,"-custom-content > ").concat(n)]:{marginInlineEnd:f,fontSize:s},["".concat(y,"-content")]:{display:"inline-block",padding:v,background:h,borderRadius:m,boxShadow:r,pointerEvents:"all"},["".concat(t,"-success > ").concat(n)]:{color:a},["".concat(t,"-error > ").concat(n)]:{color:i},["".concat(t,"-warning > ").concat(n)]:{color:c},["".concat(t,"-info > ").concat(n,",\n ").concat(t,"-loading > ").concat(n)]:{color:l}};return[{[t]:Object.assign(Object.assign({},(0,x.Wf)(e)),{color:o,position:"fixed",top:f,width:"100%",pointerEvents:"none",zIndex:g,["".concat(t,"-move-up")]:{animationFillMode:"forwards"},["\n ".concat(t,"-move-up-appear,\n ").concat(t,"-move-up-enter\n ")]:{animationName:w,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["\n ".concat(t,"-move-up-appear").concat(t,"-move-up-appear-active,\n ").concat(t,"-move-up-enter").concat(t,"-move-up-enter-active\n ")]:{animationPlayState:"running"},["".concat(t,"-move-up-leave")]:{animationName:E,animationDuration:d,animationPlayState:"paused",animationTimingFunction:u},["".concat(t,"-move-up-leave").concat(t,"-move-up-leave-active")]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}})},{[t]:{["".concat(y,"-wrapper")]:Object.assign({},C)}},{["".concat(t,"-notice-pure-panel")]:Object.assign(Object.assign({},C),{padding:0,textAlign:"start"})}]};var Z=(0,w.I$)("Message",e=>C((0,E.IX)(e,{height:150})),e=>({zIndexPopup:e.zIndexPopupBase+y.u6+10,contentBg:e.colorBgElevated,contentPadding:"".concat((e.controlHeightLG-e.fontSize*e.lineHeight)/2,"px ").concat(e.paddingSM,"px")})),S=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let O={info:o.createElement(f.Z,null),success:o.createElement(s.Z,null),error:o.createElement(u.Z,null),warning:o.createElement(d.Z,null),loading:o.createElement(p.Z,null)},k=e=>{let{prefixCls:t,type:n,icon:r,children:a}=e;return o.createElement("div",{className:g()("".concat(t,"-custom-content"),"".concat(t,"-").concat(n))},r||O[n],o.createElement("span",null,a))};var j=n(49638),I=n(13613);function M(e){let t;let n=new Promise(n=>{t=e(()=>{n(!0)})}),r=()=>{null==t||t()};return r.then=(e,t)=>n.then(e,t),r.promise=n,r}var R=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let N=e=>{let{children:t,prefixCls:n}=e,r=(0,h.Z)(n),[a,i,c]=Z(n,r);return a(o.createElement(v.JB,{classNames:{list:g()(i,c,r)}},t))},P=(e,t)=>{let{prefixCls:n,key:r}=t;return o.createElement(N,{prefixCls:n,key:r},e)},F=o.forwardRef((e,t)=>{let{top:n,prefixCls:r,getContainer:a,maxCount:c,duration:l=3,rtl:s,transitionName:u,onAllRemoved:d}=e,{getPrefixCls:f,getPopupContainer:p,message:m,direction:h}=o.useContext(i.E_),b=r||f("message"),y=o.createElement("span",{className:"".concat(b,"-close-x")},o.createElement(j.Z,{className:"".concat(b,"-close-icon")})),[x,w]=(0,v.lm)({prefixCls:b,style:()=>({left:"50%",transform:"translateX(-50%)",top:null!=n?n:8}),className:()=>g()({["".concat(b,"-rtl")]:null!=s?s:"rtl"===h}),motion:()=>({motionName:null!=u?u:"".concat(b,"-move-up")}),closable:!1,closeIcon:y,duration:l,getContainer:()=>(null==a?void 0:a())||(null==p?void 0:p())||document.body,maxCount:c,onAllRemoved:d,renderNotifications:P});return o.useImperativeHandle(t,()=>Object.assign(Object.assign({},x),{prefixCls:b,message:m})),w}),T=0;function A(e){let t=o.useRef(null);return(0,I.ln)("Message"),[o.useMemo(()=>{let e=e=>{var n;null===(n=t.current)||void 0===n||n.close(e)},n=n=>{if(!t.current){let e=()=>{};return e.then=()=>{},e}let{open:r,prefixCls:a,message:i}=t.current,c="".concat(a,"-notice"),{content:l,icon:s,type:u,key:d,className:f,style:p,onClose:m}=n,v=R(n,["content","icon","type","key","className","style","onClose"]),h=d;return null==h&&(T+=1,h="antd-message-".concat(T)),M(t=>(r(Object.assign(Object.assign({},v),{key:h,content:o.createElement(k,{prefixCls:a,type:u,icon:s},l),placement:"top",className:g()(u&&"".concat(c,"-").concat(u),f,null==i?void 0:i.className),style:Object.assign(Object.assign({},null==i?void 0:i.style),p),onClose:()=>{null==m||m(),t()}})),()=>{e(h)}))},r={open:n,destroy:n=>{var r;void 0!==n?e(n):null===(r=t.current)||void 0===r||r.destroy()}};return["info","success","warning","error","loading"].forEach(e=>{r[e]=(t,r,o)=>{let a,i,c;return a=t&&"object"==typeof t&&"content"in t?t:{content:t},"function"==typeof r?c=r:(i=r,c=o),n(Object.assign(Object.assign({onClose:c,duration:i},a),{type:e}))}}),r},[]),o.createElement(F,Object.assign({key:"message-holder"},e,{ref:t}))]}let _=null,B=e=>e(),H=[],z={};function L(){let{getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=z,a=(null==e?void 0:e())||document.body;return{getContainer:()=>a,duration:t,rtl:n,maxCount:r,top:o}}let D=o.forwardRef((e,t)=>{let{messageConfig:n,sync:r}=e,{getPrefixCls:c}=(0,o.useContext)(i.E_),l=z.prefixCls||c("message"),s=(0,o.useContext)(a.J),[u,d]=A(Object.assign(Object.assign(Object.assign({},n),{prefixCls:l}),s.message));return o.useImperativeHandle(t,()=>{let e=Object.assign({},u);return Object.keys(e).forEach(t=>{e[t]=function(){for(var e=arguments.length,n=Array(e),o=0;o{let[n,r]=o.useState(L),a=()=>{r(L)};o.useEffect(a,[]);let i=(0,c.w6)(),l=i.getRootPrefixCls(),s=i.getIconPrefixCls(),u=i.getTheme(),d=o.createElement(D,{ref:t,sync:a,messageConfig:n});return o.createElement(c.ZP,{prefixCls:l,iconPrefixCls:s,theme:u},i.holderRender?i.holderRender(d):d)}),V=()=>{if(!_){let e=document.createDocumentFragment(),t={fragment:e};_=t,B(()=>{(0,l.q)()(o.createElement(W,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,V())})}}),e)});return}_.instance&&(H.forEach(e=>{let{type:t,skipped:n}=e;if(!n)switch(t){case"open":B(()=>{let t=_.instance.open(Object.assign(Object.assign({},z),e.config));null==t||t.then(e.resolve),e.setCloseFn(t)});break;case"destroy":B(()=>{null==_||_.instance.destroy(e.key)});break;default:B(()=>{var n;let o=(n=_.instance)[t].apply(n,(0,r.Z)(e.args));null==o||o.then(e.resolve),e.setCloseFn(o)})}}),H=[])},q={open:function(e){let t=M(t=>{let n;let r={type:"open",config:e,resolve:t,setCloseFn:e=>{n=e}};return H.push(r),()=>{n?B(()=>{n()}):r.skipped=!0}});return V(),t},destroy:e=>{H.push({type:"destroy",key:e}),V()},config:function(e){z=Object.assign(Object.assign({},z),e),B(()=>{var e;null===(e=null==_?void 0:_.sync)||void 0===e||e.call(_)})},useMessage:function(e){return A(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,type:r,icon:a,content:c}=e,l=S(e,["prefixCls","className","type","icon","content"]),{getPrefixCls:s}=o.useContext(i.E_),u=t||s("message"),d=(0,h.Z)(u),[f,p,m]=Z(u,d);return f(o.createElement(v.qX,Object.assign({},l,{prefixCls:u,className:g()(n,p,"".concat(u,"-notice-pure-panel"),m,d),eventKey:"pure",duration:null,content:o.createElement(k,{prefixCls:u,type:r,icon:a},c)})))}};["success","info","warning","error","loading"].forEach(e=>{q[e]=function(){for(var t=arguments.length,n=Array(t),r=0;r{let r;let o={type:e,args:t,resolve:n,setCloseFn:e=>{r=e}};return H.push(o),()=>{r?B(()=>{r()}):o.skipped=!0}});return V(),n}(e,n)}});var X=q},92246:function(e,t,n){"use strict";n.d(t,{A:function(){return l},f:function(){return c}});var r=n(37381);let o=Object.assign({},r.Z.Modal),a=[],i=()=>a.reduce((e,t)=>Object.assign(Object.assign({},e),t),r.Z.Modal);function c(e){if(e){let t=Object.assign({},e);return a.push(t),o=i(),()=>{a=a.filter(e=>e!==t),o=i()}}o=Object.assign({},r.Z.Modal)}function l(){return o}},57271:function(e,t,n){"use strict";n.d(t,{ZP:function(){return er}});var r=n(2265),o=n(52402),a=n(71744),i=n(18310),c=n(66061),l=n(8900),s=n(39725),u=n(49638),d=n(54537),f=n(55726),p=n(61935),m=n(36760),g=n.n(m),v=n(49283),h=n(64024),b=n(93463),y=n(62236),x=n(12918),w=n(71140),E=n(99320),C=e=>{let{componentCls:t,notificationMarginEdge:n,animationMaxHeight:r}=e,o="".concat(t,"-notice"),a=new b.E4("antNotificationFadeIn",{"0%":{transform:"translate3d(100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}}),i=new b.E4("antNotificationTopFadeIn",{"0%":{top:-r,opacity:0},"100%":{top:0,opacity:1}}),c=new b.E4("antNotificationBottomFadeIn",{"0%":{bottom:e.calc(r).mul(-1).equal(),opacity:0},"100%":{bottom:0,opacity:1}}),l=new b.E4("antNotificationLeftFadeIn",{"0%":{transform:"translate3d(-100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}});return{[t]:{["&".concat(t,"-top, &").concat(t,"-bottom")]:{marginInline:0,[o]:{marginInline:"auto auto"}},["&".concat(t,"-top")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:i}},["&".concat(t,"-bottom")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:c}},["&".concat(t,"-topRight, &").concat(t,"-bottomRight")]:{["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:a}},["&".concat(t,"-topLeft, &").concat(t,"-bottomLeft")]:{marginRight:{value:0,_skip_check_:!0},marginLeft:{value:n,_skip_check_:!0},[o]:{marginInlineEnd:"auto",marginInlineStart:0},["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationName:l}}}}};let Z=["top","topLeft","topRight","bottom","bottomLeft","bottomRight"],S={topLeft:"left",topRight:"right",bottomLeft:"left",bottomRight:"right",top:"left",bottom:"left"},O=(e,t)=>{let{componentCls:n}=e;return{["".concat(n,"-").concat(t)]:{["&".concat(n,"-stack > ").concat(n,"-notice-wrapper")]:{[t.startsWith("top")?"top":"bottom"]:0,[S[t]]:{value:0,_skip_check_:!0}}}}},k=e=>{let t={};for(let n=1;n ".concat(e.componentCls,"-notice")]:{opacity:0,transition:"opacity ".concat(e.motionDurationMid)}};return Object.assign({["&:not(:nth-last-child(-n+".concat(e.notificationStackLayer,"))")]:{opacity:0,overflow:"hidden",color:"transparent",pointerEvents:"none"}},t)},j=e=>{let t={};for(let n=1;n{let{componentCls:t}=e;return Object.assign({["".concat(t,"-stack")]:{["& > ".concat(t,"-notice-wrapper")]:Object.assign({transition:"transform ".concat(e.motionDurationSlow,", backdrop-filter 0s"),willChange:"transform, opacity",position:"absolute"},k(e))},["".concat(t,"-stack:not(").concat(t,"-stack-expanded)")]:{["& > ".concat(t,"-notice-wrapper")]:Object.assign({},j(e))},["".concat(t,"-stack").concat(t,"-stack-expanded")]:{["& > ".concat(t,"-notice-wrapper")]:{"&:not(:nth-last-child(-n + 1))":{opacity:1,overflow:"unset",color:"inherit",pointerEvents:"auto",["& > ".concat(e.componentCls,"-notice")]:{opacity:1}},"&:after":{content:'""',position:"absolute",height:e.margin,width:"100%",insetInline:0,bottom:e.calc(e.margin).mul(-1).equal(),background:"transparent",pointerEvents:"auto"}}}},Z.map(t=>O(e,t)).reduce((e,t)=>Object.assign(Object.assign({},e),t),{}))};let M=e=>{let{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:a,borderRadiusLG:i,colorSuccess:c,colorInfo:l,colorWarning:s,colorError:u,colorTextHeading:d,notificationBg:f,notificationPadding:p,notificationMarginEdge:m,notificationProgressBg:g,notificationProgressHeight:v,fontSize:h,lineHeight:y,width:w,notificationIconSize:E,colorText:C,colorSuccessBg:Z,colorErrorBg:S,colorInfoBg:O,colorWarningBg:k}=e,j="".concat(n,"-notice");return{position:"relative",marginBottom:a,marginInlineStart:"auto",background:f,borderRadius:i,boxShadow:r,[j]:{padding:p,width:w,maxWidth:"calc(100vw - ".concat((0,b.bf)(e.calc(m).mul(2).equal()),")"),lineHeight:y,wordWrap:"break-word",borderRadius:i,overflow:"hidden","&-success":{background:Z},"&-error":{background:S},"&-info":{background:O},"&-warning":{background:k}},["".concat(j,"-message")]:{color:d,fontSize:o,lineHeight:e.lineHeightLG},["".concat(j,"-description")]:{fontSize:h,color:C,marginTop:e.marginXS},["".concat(j,"-closable ").concat(j,"-message")]:{paddingInlineEnd:e.paddingLG},["".concat(j,"-with-icon ").concat(j,"-message")]:{marginInlineStart:e.calc(e.marginSM).add(E).equal(),fontSize:o},["".concat(j,"-with-icon ").concat(j,"-description")]:{marginInlineStart:e.calc(e.marginSM).add(E).equal(),fontSize:h},["".concat(j,"-icon")]:{position:"absolute",fontSize:E,lineHeight:1,["&-success".concat(t)]:{color:c},["&-info".concat(t)]:{color:l},["&-warning".concat(t)]:{color:s},["&-error".concat(t)]:{color:u}},["".concat(j,"-close")]:Object.assign({position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:"background-color ".concat(e.motionDurationMid,", color ").concat(e.motionDurationMid),display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none","&:hover":{color:e.colorIconHover,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},(0,x.Qy)(e)),["".concat(j,"-progress")]:{position:"absolute",display:"block",appearance:"none",inlineSize:"calc(100% - ".concat((0,b.bf)(i)," * 2)"),left:{_skip_check_:!0,value:i},right:{_skip_check_:!0,value:i},bottom:0,blockSize:v,border:0,"&, &::-webkit-progress-bar":{borderRadius:i,backgroundColor:"rgba(0, 0, 0, 0.04)"},"&::-moz-progress-bar":{background:g},"&::-webkit-progress-value":{borderRadius:i,background:g}},["".concat(j,"-actions")]:{float:"right",marginTop:e.marginSM}}},R=e=>{let{componentCls:t,notificationMarginBottom:n,notificationMarginEdge:r,motionDurationMid:o,motionEaseInOut:a}=e,i="".concat(t,"-notice"),c=new b.E4("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:n},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}});return[{[t]:Object.assign(Object.assign({},(0,x.Wf)(e)),{position:"fixed",zIndex:e.zIndexPopup,marginRight:{value:r,_skip_check_:!0},["".concat(t,"-hook-holder")]:{position:"relative"},["".concat(t,"-fade-appear-prepare")]:{opacity:"0 !important"},["".concat(t,"-fade-enter, ").concat(t,"-fade-appear")]:{animationDuration:e.motionDurationMid,animationTimingFunction:a,animationFillMode:"both",opacity:0,animationPlayState:"paused"},["".concat(t,"-fade-leave")]:{animationTimingFunction:a,animationFillMode:"both",animationDuration:o,animationPlayState:"paused"},["".concat(t,"-fade-enter").concat(t,"-fade-enter-active, ").concat(t,"-fade-appear").concat(t,"-fade-appear-active")]:{animationPlayState:"running"},["".concat(t,"-fade-leave").concat(t,"-fade-leave-active")]:{animationName:c,animationPlayState:"running"},"&-rtl":{direction:"rtl",["".concat(i,"-actions")]:{float:"left"}}})},{[t]:{["".concat(i,"-wrapper")]:M(e)}}]},N=e=>({zIndexPopup:e.zIndexPopupBase+y.u6+50,width:384,colorSuccessBg:e.colorSuccessBg,colorErrorBg:e.colorErrorBg,colorInfoBg:e.colorInfoBg,colorWarningBg:e.colorWarningBg}),P=e=>{let t=e.paddingMD,n=e.paddingLG;return(0,w.IX)(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.calc(e.fontSizeLG).mul(e.lineHeightLG).equal(),notificationCloseButtonSize:e.calc(e.controlHeightLG).mul(.55).equal(),notificationMarginBottom:e.margin,notificationPadding:"".concat((0,b.bf)(e.paddingMD)," ").concat((0,b.bf)(e.paddingContentHorizontalLG)),notificationMarginEdge:e.marginLG,animationMaxHeight:150,notificationStackLayer:3,notificationProgressHeight:2,notificationProgressBg:"linear-gradient(90deg, ".concat(e.colorPrimaryBorderHover,", ").concat(e.colorPrimary,")")})};var F=(0,E.I$)("Notification",e=>{let t=P(e);return[R(t),C(t),I(t)]},N),T=(0,E.bk)(["Notification","PurePanel"],e=>{let t="".concat(e.componentCls,"-notice"),n=P(e);return{["".concat(t,"-pure-panel")]:Object.assign(Object.assign({},M(n)),{width:n.width,maxWidth:"calc(100vw - ".concat((0,b.bf)(e.calc(n.notificationMarginEdge).mul(2).equal()),")"),margin:0})}},N),A=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function _(e,t){return null===t||!1===t?null:t||r.createElement(u.Z,{className:"".concat(e,"-close-icon")})}f.Z,l.Z,s.Z,d.Z,p.Z;let B={success:l.Z,info:f.Z,error:s.Z,warning:d.Z},H=e=>{let{prefixCls:t,icon:n,type:o,message:a,description:i,actions:c,role:l="alert"}=e,s=null;return n?s=r.createElement("span",{className:"".concat(t,"-icon")},n):o&&(s=r.createElement(B[o]||null,{className:g()("".concat(t,"-icon"),"".concat(t,"-icon-").concat(o))})),r.createElement("div",{className:g()({["".concat(t,"-with-icon")]:s}),role:l},s,r.createElement("div",{className:"".concat(t,"-message")},a),i&&r.createElement("div",{className:"".concat(t,"-description")},i),c&&r.createElement("div",{className:"".concat(t,"-actions")},c))};var z=n(13613),L=n(84951),D=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let W=e=>{let{children:t,prefixCls:n}=e,o=(0,h.Z)(n),[a,i,c]=F(n,o);return a(r.createElement(v.JB,{classNames:{list:g()(i,c,o)}},t))},V=(e,t)=>{let{prefixCls:n,key:o}=t;return r.createElement(W,{prefixCls:n,key:o},e)},q=r.forwardRef((e,t)=>{let{top:n,bottom:o,prefixCls:i,getContainer:c,maxCount:l,rtl:s,onAllRemoved:u,stack:d,duration:f,pauseOnHover:p=!0,showProgress:m}=e,{getPrefixCls:h,getPopupContainer:b,notification:y,direction:x}=(0,r.useContext)(a.E_),[,w]=(0,L.ZP)(),E=i||h("notification"),[C,Z]=(0,v.lm)({prefixCls:E,style:e=>(function(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n}}return r})(e,null!=n?n:24,null!=o?o:24),className:()=>g()({["".concat(E,"-rtl")]:null!=s?s:"rtl"===x}),motion:()=>({motionName:"".concat(E,"-fade")}),closable:!0,closeIcon:_(E),duration:null!=f?f:4.5,getContainer:()=>(null==c?void 0:c())||(null==b?void 0:b())||document.body,maxCount:l,pauseOnHover:p,showProgress:m,onAllRemoved:u,renderNotifications:V,stack:!1!==d&&{threshold:"object"==typeof d?null==d?void 0:d.threshold:void 0,offset:8,gap:w.margin}});return r.useImperativeHandle(t,()=>Object.assign(Object.assign({},C),{prefixCls:E,notification:y})),Z});function X(e){let t=r.useRef(null);return(0,z.ln)("Notification"),[r.useMemo(()=>{let n=n=>{var o;if(!t.current)return;let{open:a,prefixCls:i,notification:c}=t.current,l="".concat(i,"-notice"),{message:s,description:u,icon:d,type:f,btn:p,actions:m,className:v,style:h,role:b="alert",closeIcon:y,closable:x}=n,w=D(n,["message","description","icon","type","btn","actions","className","style","role","closeIcon","closable"]),E=_(l,void 0!==y?y:void 0!==(null==e?void 0:e.closeIcon)?e.closeIcon:null==c?void 0:c.closeIcon);return a(Object.assign(Object.assign({placement:null!==(o=null==e?void 0:e.placement)&&void 0!==o?o:"topRight"},w),{content:r.createElement(H,{prefixCls:l,icon:d,type:f,message:s,description:u,actions:null!=m?m:p,role:b}),className:g()(f&&"".concat(l,"-").concat(f),v,null==c?void 0:c.className),style:Object.assign(Object.assign({},null==c?void 0:c.style),h),closeIcon:E,closable:null!=x?x:!!E}))},o={open:n,destroy:e=>{var n,r;void 0!==e?null===(n=t.current)||void 0===n||n.close(e):null===(r=t.current)||void 0===r||r.destroy()}};return["success","info","warning","error"].forEach(e=>{o[e]=t=>n(Object.assign(Object.assign({},t),{type:e}))}),o},[]),r.createElement(q,Object.assign({key:"notification-holder"},e,{ref:t}))]}let G=null,U=e=>e(),$=[],K={};function Y(){let{getContainer:e,rtl:t,maxCount:n,top:r,bottom:o,showProgress:a,pauseOnHover:i}=K,c=(null==e?void 0:e())||document.body;return{getContainer:()=>c,rtl:t,maxCount:n,top:r,bottom:o,showProgress:a,pauseOnHover:i}}let Q=r.forwardRef((e,t)=>{let{notificationConfig:n,sync:i}=e,{getPrefixCls:c}=(0,r.useContext)(a.E_),l=K.prefixCls||c("notification"),s=(0,r.useContext)(o.J),[u,d]=X(Object.assign(Object.assign(Object.assign({},n),{prefixCls:l}),s.notification));return r.useEffect(i,[]),r.useImperativeHandle(t,()=>{let e=Object.assign({},u);return Object.keys(e).forEach(t=>{e[t]=function(){for(var e=arguments.length,n=Array(e),r=0;r{let[n,o]=r.useState(Y),a=()=>{o(Y)};r.useEffect(a,[]);let c=(0,i.w6)(),l=c.getRootPrefixCls(),s=c.getIconPrefixCls(),u=c.getTheme(),d=r.createElement(Q,{ref:t,sync:a,notificationConfig:n});return r.createElement(i.ZP,{prefixCls:l,iconPrefixCls:s,theme:u},c.holderRender?c.holderRender(d):d)}),ee=()=>{if(!G){let e=document.createDocumentFragment(),t={fragment:e};G=t,U(()=>{(0,c.q)()(r.createElement(J,{ref:e=>{let{instance:n,sync:r}=e||{};Promise.resolve().then(()=>{!t.instance&&n&&(t.instance=n,t.sync=r,ee())})}}),e)});return}G.instance&&($.forEach(e=>{switch(e.type){case"open":U(()=>{G.instance.open(Object.assign(Object.assign({},K),e.config))});break;case"destroy":U(()=>{var t;null===(t=null==G?void 0:G.instance)||void 0===t||t.destroy(e.key)})}}),$=[])};function et(e){(0,i.w6)(),$.push({type:"open",config:e}),ee()}let en={open:et,destroy:e=>{$.push({type:"destroy",key:e}),ee()},config:function(e){K=Object.assign(Object.assign({},K),e),U(()=>{var e;null===(e=null==G?void 0:G.sync)||void 0===e||e.call(G)})},useNotification:function(e){return X(e)},_InternalPanelDoNotUseOrYouWillBeFired:e=>{let{prefixCls:t,className:n,icon:o,type:i,message:c,description:l,btn:s,actions:u,closable:d=!0,closeIcon:f,className:p}=e,m=A(e,["prefixCls","className","icon","type","message","description","btn","actions","closable","closeIcon","className"]),{getPrefixCls:b}=r.useContext(a.E_),y=t||b("notification"),x="".concat(y,"-notice"),w=(0,h.Z)(y),[E,C,Z]=F(y,w);return E(r.createElement("div",{className:g()("".concat(x,"-pure-panel"),C,n,Z,w)},r.createElement(T,{prefixCls:y}),r.createElement(v.qX,Object.assign({},m,{prefixCls:y,eventKey:"pure",duration:null,closable:d,className:g()({notificationClassName:p}),closeIcon:_(y,f),content:r.createElement(H,{prefixCls:x,icon:o,type:i,message:c,description:l,actions:null!=u?u:s})}))))}};["success","info","warning","error"].forEach(e=>{en[e]=t=>et(Object.assign(Object.assign({},t),{type:e}))});var er=en},37592:function(e,t,n){"use strict";n.d(t,{default:function(){return tf}});var r=n(2265),o=n(36760),a=n.n(o),i=n(1119),c=n(83145),l=n(11993),s=n(31686),u=n(26365),d=n(6989),f=n(41154),p=n(50506),m=n(32559),g=n(27380),v=n(79267),h=n(28791),b=function(e){var t=e.className,n=e.customizeIcon,o=e.customizeIconProps,i=e.children,c=e.onMouseDown,l=e.onClick,s="function"==typeof n?n(o):n;return r.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==c||c(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:l,"aria-hidden":!0},void 0!==s?s:r.createElement("span",{className:a()(t.split(/\s+/).map(function(e){return"".concat(e,"-icon")}))},i))},y=function(e,t,n,o,a){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=arguments.length>6?arguments[6]:void 0,l=arguments.length>7?arguments[7]:void 0,s=r.useMemo(function(){return"object"===(0,f.Z)(o)?o.clearIcon:a||void 0},[o,a]);return{allowClear:r.useMemo(function(){return!i&&!!o&&(!!n.length||!!c)&&!("combobox"===l&&""===c)},[o,i,n.length,c,l]),clearIcon:r.createElement(b,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:s},"\xd7")}},x=r.createContext(null);function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=r.useRef(null),n=r.useRef(null);return r.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]),[function(){return t.current},function(r){(r||null===t.current)&&(t.current=r),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}]}var E=n(95814),C=n(18242),Z=n(1699),S=function(e,t,n){var r=(0,s.Z)((0,s.Z)({},e),n?t:{});return Object.keys(t).forEach(function(n){var o=t[n];"function"==typeof o&&(r[n]=function(){for(var t,r=arguments.length,a=Array(r),i=0;ij&&(a="".concat(i.slice(0,j),"..."))}var c=function(t){t&&t.stopPropagation(),_(e)};return"function"==typeof T?eo(r,a,t,o,c):er(e,a,t,o,c)},renderRest:function(e){if(!c.length)return null;var t="function"==typeof F?F(e):F;return"function"==typeof T?eo(void 0,t,!1,!1,void 0,!0):er({title:t},t,!1)},suffix:ea,itemKey:N,maxCount:O});return r.createElement("span",{className:"".concat(ee,"-wrap")},ei,!c.length&&!et&&r.createElement("span",{className:"".concat(ee,"-placeholder")},m))},T=function(e){var t=e.inputElement,n=e.prefixCls,o=e.id,a=e.inputRef,i=e.disabled,c=e.autoFocus,l=e.autoComplete,s=e.activeDescendantId,d=e.mode,f=e.open,p=e.values,m=e.placeholder,g=e.tabIndex,v=e.showSearch,h=e.searchValue,b=e.activeValue,y=e.maxLength,x=e.onInputKeyDown,w=e.onInputMouseDown,E=e.onInputChange,Z=e.onInputPaste,S=e.onInputCompositionStart,O=e.onInputCompositionEnd,j=e.onInputBlur,I=e.title,M=r.useState(!1),N=(0,u.Z)(M,2),P=N[0],F=N[1],T="combobox"===d,A=T||v,_=p[0],B=h||"";T&&b&&!P&&(B=b),r.useEffect(function(){T&&F(!1)},[T,b]);var H=("combobox"===d||!!f||!!v)&&!!B,z=void 0===I?R(_):I,L=r.useMemo(function(){return _?null:r.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:H?{visibility:"hidden"}:void 0},m)},[_,H,m,n]);return r.createElement("span",{className:"".concat(n,"-selection-wrap")},r.createElement("span",{className:"".concat(n,"-selection-search")},r.createElement(k,{ref:a,prefixCls:n,id:o,open:f,inputElement:t,disabled:i,autoFocus:c,autoComplete:l,editable:A,activeDescendantId:s,value:B,onKeyDown:x,onMouseDown:w,onChange:function(e){F(!0),E(e)},onPaste:Z,onCompositionStart:S,onCompositionEnd:O,onBlur:j,tabIndex:g,attrs:(0,C.Z)(e,!0),maxLength:T?y:void 0})),!T&&_?r.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:H?{visibility:"hidden"}:void 0},_.label):null,L)},A=r.forwardRef(function(e,t){var n=(0,r.useRef)(null),o=(0,r.useRef)(!1),a=e.prefixCls,c=e.open,l=e.mode,s=e.showSearch,d=e.tokenWithEnter,f=e.disabled,p=e.prefix,m=e.autoClearSearchValue,g=e.onSearch,v=e.onSearchSubmit,h=e.onToggleOpen,b=e.onInputKeyDown,y=e.onInputBlur,x=e.domRef;r.useImperativeHandle(t,function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}});var C=w(0),Z=(0,u.Z)(C,2),S=Z[0],O=Z[1],k=(0,r.useRef)(null),j=function(e){!1!==g(e,!0,o.current)&&h(!0)},I={inputRef:n,onInputKeyDown:function(e){var t=e.which,r=n.current instanceof HTMLTextAreaElement;!r&&c&&(t===E.Z.UP||t===E.Z.DOWN)&&e.preventDefault(),b&&b(e),t!==E.Z.ENTER||"tags"!==l||o.current||c||null==v||v(e.target.value),r&&!c&&~[E.Z.UP,E.Z.DOWN,E.Z.LEFT,E.Z.RIGHT].indexOf(t)||!t||[E.Z.ESC,E.Z.SHIFT,E.Z.BACKSPACE,E.Z.TAB,E.Z.WIN_KEY,E.Z.ALT,E.Z.META,E.Z.WIN_KEY_RIGHT,E.Z.CTRL,E.Z.SEMICOLON,E.Z.EQUALS,E.Z.CAPS_LOCK,E.Z.CONTEXT_MENU,E.Z.F1,E.Z.F2,E.Z.F3,E.Z.F4,E.Z.F5,E.Z.F6,E.Z.F7,E.Z.F8,E.Z.F9,E.Z.F10,E.Z.F11,E.Z.F12].includes(t)||h(!0)},onInputMouseDown:function(){O(!0)},onInputChange:function(e){var t=e.target.value;if(d&&k.current&&/[\r\n]/.test(k.current)){var n=k.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,k.current)}k.current=null,j(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");k.current=n||""},onInputCompositionStart:function(){o.current=!0},onInputCompositionEnd:function(e){o.current=!1,"combobox"!==l&&j(e.target.value)},onInputBlur:y},M="multiple"===l||"tags"===l?r.createElement(F,(0,i.Z)({},e,I)):r.createElement(T,(0,i.Z)({},e,I));return r.createElement("div",{ref:x,className:"".concat(a,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout(function(){n.current.focus()}):n.current.focus())},onMouseDown:function(e){var t=S();e.target===n.current||t||"combobox"===l&&f||e.preventDefault(),("combobox"===l||s&&t)&&c||(c&&!1!==m&&g("",!0,!1),h())}},p&&r.createElement("div",{className:"".concat(a,"-prefix")},p),M)}),_=n(97821),B=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],H=function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}},z=r.forwardRef(function(e,t){var n=e.prefixCls,o=(e.disabled,e.visible),c=e.children,u=e.popupElement,f=e.animation,p=e.transitionName,m=e.dropdownStyle,g=e.dropdownClassName,v=e.direction,h=e.placement,b=e.builtinPlacements,y=e.dropdownMatchSelectWidth,x=e.dropdownRender,w=e.dropdownAlign,E=e.getPopupContainer,C=e.empty,Z=e.getTriggerDOMNode,S=e.onPopupVisibleChange,O=e.onPopupMouseEnter,k=(0,d.Z)(e,B),j="".concat(n,"-dropdown"),I=u;x&&(I=x(u));var M=r.useMemo(function(){return b||H(y)},[b,y]),R=f?"".concat(j,"-").concat(f):p,N="number"==typeof y,P=r.useMemo(function(){return N?null:!1===y?"minWidth":"width"},[y,N]),F=m;N&&(F=(0,s.Z)((0,s.Z)({},F),{},{width:y}));var T=r.useRef(null);return r.useImperativeHandle(t,function(){return{getPopupElement:function(){var e;return null===(e=T.current)||void 0===e?void 0:e.popupElement}}}),r.createElement(_.Z,(0,i.Z)({},k,{showAction:S?["click"]:[],hideAction:S?["click"]:[],popupPlacement:h||("rtl"===(void 0===v?"ltr":v)?"bottomRight":"bottomLeft"),builtinPlacements:M,prefixCls:j,popupTransitionName:R,popup:r.createElement("div",{onMouseEnter:O},I),ref:T,stretch:P,popupAlign:w,popupVisible:o,getPopupContainer:E,popupClassName:a()(g,(0,l.Z)({},"".concat(j,"-empty"),C)),popupStyle:F,getTriggerDOMNode:Z,onPopupVisibleChange:S}),c)}),L=n(87099);function D(e,t){var n,r=e.key;return("value"in e&&(n=e.value),null!=r)?r:void 0!==n?n:"rc-index-key-".concat(t)}function W(e){return void 0!==e&&!Number.isNaN(e)}function V(e,t){var n=e||{},r=n.label,o=n.value,a=n.options,i=n.groupLabel,c=r||(t?"children":"label");return{label:c,value:o||"value",options:a||"options",groupLabel:i||c}}function q(e){var t=(0,s.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,m.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var X=function(e,t,n){if(!t||!t.length)return null;var r=!1,o=function e(t,n){var o=(0,L.Z)(n),a=o[0],i=o.slice(1);if(!a)return[t];var l=t.split(a);return r=r||l.length>1,l.reduce(function(t,n){return[].concat((0,c.Z)(t),(0,c.Z)(e(n,i)))},[]).filter(Boolean)}(e,t);return r?void 0!==n?o.slice(0,n):o:null},G=r.createContext(null);function U(e){var t=e.visible,n=e.values;return t?r.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,50).map(function(e){var t=e.label,n=e.value;return["number","string"].includes((0,f.Z)(t))?t:n}).join(", ")),n.length>50?", ...":null):null}var $=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],K=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Y=function(e){return"tags"===e||"multiple"===e},Q=r.forwardRef(function(e,t){var n,o,f,m,E,C,Z,S=e.id,O=e.prefixCls,k=e.className,j=e.showSearch,I=e.tagRender,M=e.direction,R=e.omitDomProps,N=e.displayValues,P=e.onDisplayValuesChange,F=e.emptyOptions,T=e.notFoundContent,_=void 0===T?"Not Found":T,B=e.onClear,H=e.mode,L=e.disabled,D=e.loading,V=e.getInputElement,q=e.getRawInputElement,Q=e.open,J=e.defaultOpen,ee=e.onDropdownVisibleChange,et=e.activeValue,en=e.onActiveValueChange,er=e.activeDescendantId,eo=e.searchValue,ea=e.autoClearSearchValue,ei=e.onSearch,ec=e.onSearchSplit,el=e.tokenSeparators,es=e.allowClear,eu=e.prefix,ed=e.suffixIcon,ef=e.clearIcon,ep=e.OptionList,em=e.animation,eg=e.transitionName,ev=e.dropdownStyle,eh=e.dropdownClassName,eb=e.dropdownMatchSelectWidth,ey=e.dropdownRender,ex=e.dropdownAlign,ew=e.placement,eE=e.builtinPlacements,eC=e.getPopupContainer,eZ=e.showAction,eS=void 0===eZ?[]:eZ,eO=e.onFocus,ek=e.onBlur,ej=e.onKeyUp,eI=e.onKeyDown,eM=e.onMouseDown,eR=(0,d.Z)(e,$),eN=Y(H),eP=(void 0!==j?j:eN)||"combobox"===H,eF=(0,s.Z)({},eR);K.forEach(function(e){delete eF[e]}),null==R||R.forEach(function(e){delete eF[e]});var eT=r.useState(!1),eA=(0,u.Z)(eT,2),e_=eA[0],eB=eA[1];r.useEffect(function(){eB((0,v.Z)())},[]);var eH=r.useRef(null),ez=r.useRef(null),eL=r.useRef(null),eD=r.useRef(null),eW=r.useRef(null),eV=r.useRef(!1),eq=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=r.useState(!1),n=(0,u.Z)(t,2),o=n[0],a=n[1],i=r.useRef(null),c=function(){window.clearTimeout(i.current)};return r.useEffect(function(){return c},[]),[o,function(t,n){c(),i.current=window.setTimeout(function(){a(t),n&&n()},e)},c]}(),eX=(0,u.Z)(eq,3),eG=eX[0],eU=eX[1],e$=eX[2];r.useImperativeHandle(t,function(){var e,t;return{focus:null===(e=eD.current)||void 0===e?void 0:e.focus,blur:null===(t=eD.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=eW.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:eH.current||ez.current}});var eK=r.useMemo(function(){if("combobox"!==H)return eo;var e,t=null===(e=N[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""},[eo,H,N]),eY="combobox"===H&&"function"==typeof V&&V()||null,eQ="function"==typeof q&&q(),eJ=(0,h.x1)(ez,null==eQ||null===(m=eQ.props)||void 0===m?void 0:m.ref),e0=r.useState(!1),e1=(0,u.Z)(e0,2),e2=e1[0],e6=e1[1];(0,g.Z)(function(){e6(!0)},[]);var e5=(0,p.Z)(!1,{defaultValue:J,value:Q}),e4=(0,u.Z)(e5,2),e3=e4[0],e7=e4[1],e9=!!e2&&e3,e8=!_&&F;(L||e8&&e9&&"combobox"===H)&&(e9=!1);var te=!e8&&e9,tt=r.useCallback(function(e){var t=void 0!==e?e:!e9;L||(e7(t),e9!==t&&(null==ee||ee(t)))},[L,e9,e7,ee]),tn=r.useMemo(function(){return(el||[]).some(function(e){return["\n","\r\n"].includes(e)})},[el]),tr=r.useContext(G)||{},to=tr.maxCount,ta=tr.rawValues,ti=function(e,t,n){if(!(eN&&W(to))||!((null==ta?void 0:ta.size)>=to)){var r=!0,o=e;null==en||en(null);var a=X(e,el,W(to)?to-ta.size:void 0),i=n?null:a;return"combobox"!==H&&i&&(o="",null==ec||ec(i),tt(!1),r=!1),ei&&eK!==o&&ei(o,{source:t?"typing":"effect"}),r}};r.useEffect(function(){e9||eN||"combobox"===H||ti("",!1,!1)},[e9]),r.useEffect(function(){e3&&L&&e7(!1),L&&!eV.current&&eU(!1)},[L]);var tc=w(),tl=(0,u.Z)(tc,2),ts=tl[0],tu=tl[1],td=r.useRef(!1),tf=r.useRef(!1),tp=[];r.useEffect(function(){return function(){tp.forEach(function(e){return clearTimeout(e)}),tp.splice(0,tp.length)}},[]);var tm=r.useState({}),tg=(0,u.Z)(tm,2)[1];eQ&&(E=function(e){tt(e)}),n=function(){var e;return[eH.current,null===(e=eL.current)||void 0===e?void 0:e.getPopupElement()]},o=!!eQ,(f=r.useRef(null)).current={open:te,triggerOpen:tt,customizedTrigger:o},r.useEffect(function(){function e(e){if(null===(t=f.current)||void 0===t||!t.customizedTrigger){var t,r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),f.current.open&&n().filter(function(e){return e}).every(function(e){return!e.contains(r)&&e!==r})&&f.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}},[]);var tv=r.useMemo(function(){return(0,s.Z)((0,s.Z)({},e),{},{notFoundContent:_,open:e9,triggerOpen:te,id:S,showSearch:eP,multiple:eN,toggleOpen:tt})},[e,_,te,e9,S,eP,eN,tt]),th=!!ed||D;th&&(C=r.createElement(b,{className:a()("".concat(O,"-arrow"),(0,l.Z)({},"".concat(O,"-arrow-loading"),D)),customizeIcon:ed,customizeIconProps:{loading:D,searchValue:eK,open:e9,focused:eG,showSearch:eP}}));var tb=y(O,function(){var e;null==B||B(),null===(e=eD.current)||void 0===e||e.focus(),P([],{type:"clear",values:N}),ti("",!1,!1)},N,es,ef,L,eK,H),ty=tb.allowClear,tx=tb.clearIcon,tw=r.createElement(ep,{ref:eW}),tE=a()(O,k,(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},"".concat(O,"-focused"),eG),"".concat(O,"-multiple"),eN),"".concat(O,"-single"),!eN),"".concat(O,"-allow-clear"),es),"".concat(O,"-show-arrow"),th),"".concat(O,"-disabled"),L),"".concat(O,"-loading"),D),"".concat(O,"-open"),e9),"".concat(O,"-customize-input"),eY),"".concat(O,"-show-search"),eP)),tC=r.createElement(z,{ref:eL,disabled:L,prefixCls:O,visible:te,popupElement:tw,animation:em,transitionName:eg,dropdownStyle:ev,dropdownClassName:eh,direction:M,dropdownMatchSelectWidth:eb,dropdownRender:ey,dropdownAlign:ex,placement:ew,builtinPlacements:eE,getPopupContainer:eC,empty:F,getTriggerDOMNode:function(e){return ez.current||e},onPopupVisibleChange:E,onPopupMouseEnter:function(){tg({})}},eQ?r.cloneElement(eQ,{ref:eJ}):r.createElement(A,(0,i.Z)({},e,{domRef:ez,prefixCls:O,inputElement:eY,ref:eD,id:S,prefix:eu,showSearch:eP,autoClearSearchValue:ea,mode:H,activeDescendantId:er,tagRender:I,values:N,open:e9,onToggleOpen:tt,activeValue:et,searchValue:eK,onSearch:ti,onSearchSubmit:function(e){e&&e.trim()&&ei(e,{source:"submit"})},onRemove:function(e){P(N.filter(function(t){return t!==e}),{type:"remove",values:[e]})},tokenWithEnter:tn,onInputBlur:function(){td.current=!1}})));return Z=eQ?tC:r.createElement("div",(0,i.Z)({className:tE},eF,{ref:eH,onMouseDown:function(e){var t,n=e.target,r=null===(t=eL.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var o=setTimeout(function(){var e,t=tp.indexOf(o);-1!==t&&tp.splice(t,1),e$(),e_||r.contains(document.activeElement)||null===(e=eD.current)||void 0===e||e.focus()});tp.push(o)}for(var a=arguments.length,i=Array(a>1?a-1:0),c=1;c=0;l-=1){var s=a[l];if(!s.disabled){a.splice(l,1),i=s;break}}i&&P(a,{type:"remove",values:[i]})}for(var u=arguments.length,d=Array(u>1?u-1:0),f=1;f1?n-1:0),o=1;o=Z},[p,Z,null==M?void 0:M.size]),L=function(e){e.preventDefault()},D=function(e){var t;null===(t=H.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},V=r.useCallback(function(e){return"combobox"!==m&&M.has(e)},[m,(0,c.Z)(M).toString(),M.size]),q=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=B.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];K(e);var n={source:t?"keyboard":"mouse"},r=B[e];if(!r){O(null,-1,n);return}O(r.value,e,n)};(0,r.useEffect)(function(){Y(!1!==k?q(0):-1)},[B.length,g]);var Q=r.useCallback(function(e){return"combobox"===m?String(e).toLowerCase()===g.toLowerCase():M.has(e)},[m,g,(0,c.Z)(M).toString(),M.size]);(0,r.useEffect)(function(){var e,t=setTimeout(function(){if(!p&&f&&1===M.size){var e=Array.from(M)[0],t=B.findIndex(function(t){var n=t.data;return g?String(n.value).startsWith(g):n.value===e});-1!==t&&(Y(t),D(t))}});return f&&(null===(e=H.current)||void 0===e||e.scrollTo(void 0)),function(){return clearTimeout(t)}},[f,g]);var J=function(e){void 0!==e&&j(e,{selected:!M.has(e)}),p||v(!1)};if(r.useImperativeHandle(t,function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case E.Z.N:case E.Z.P:case E.Z.UP:case E.Z.DOWN:var r=0;if(t===E.Z.UP?r=-1:t===E.Z.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===E.Z.N?r=1:t===E.Z.P&&(r=-1)),0!==r){var o=q($+r,r);D(o),Y(o,!0)}break;case E.Z.TAB:case E.Z.ENTER:var a,i=B[$];!i||null!=i&&null!==(a=i.data)&&void 0!==a&&a.disabled||z?J(void 0):J(i.value),f&&e.preventDefault();break;case E.Z.ESC:v(!1),f&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){D(e)}}}),0===B.length)return r.createElement("div",{role:"listbox",id:"".concat(s,"_list"),className:"".concat(_,"-empty"),onMouseDown:L},h);var ee=Object.keys(R).map(function(e){return R[e]}),ei=function(e){return e.label};function ec(e,t){return{role:e.group?"presentation":"option",id:"".concat(s,"_list_").concat(t)}}var el=function(e){var t=B[e];if(!t)return null;var n=t.data||{},o=n.value,a=t.group,c=(0,C.Z)(n,!0),l=ei(t);return t?r.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof l||a?null:l},c,{key:e},ec(t,e),{"aria-selected":Q(o)}),o):null},es={role:"listbox",id:"".concat(s,"_list")};return r.createElement(r.Fragment,null,N&&r.createElement("div",(0,i.Z)({},es,{style:{height:0,width:0,overflow:"hidden"}}),el($-1),el($),el($+1)),r.createElement(er.Z,{itemKey:"key",ref:H,data:B,height:F,itemHeight:T,fullHeight:!1,onMouseDown:L,onScroll:y,virtual:N,direction:P,innerProps:N?null:es},function(e,t){var n=e.group,o=e.groupOption,c=e.data,s=e.label,u=e.value,f=c.key;if(n){var p,m=null!==(p=c.title)&&void 0!==p?p:ea(s)?s.toString():void 0;return r.createElement("div",{className:a()(_,"".concat(_,"-group"),c.className),title:m},void 0!==s?s:f)}var g=c.disabled,v=c.title,h=(c.children,c.style),y=c.className,x=(0,d.Z)(c,eo),w=(0,en.Z)(x,ee),E=V(u),Z=g||!E&&z,S="".concat(_,"-option"),O=a()(_,S,y,(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({},"".concat(S,"-grouped"),o),"".concat(S,"-active"),$===t&&!Z),"".concat(S,"-disabled"),Z),"".concat(S,"-selected"),E)),k=ei(e),j=!I||"function"==typeof I||E,M="number"==typeof k?k:k||u,R=ea(M)?M.toString():void 0;return void 0!==v&&(R=v),r.createElement("div",(0,i.Z)({},(0,C.Z)(w),N?{}:ec(e,t),{"aria-selected":Q(u),className:O,title:R,onMouseMove:function(){$===t||Z||Y(t)},onClick:function(){Z||J(u)},style:h}),r.createElement("div",{className:"".concat(S,"-content")},"function"==typeof A?A(e,{index:t}):M),r.isValidElement(I)||E,j&&r.createElement(b,{className:"".concat(_,"-option-state"),customizeIcon:I,customizeIconProps:{value:u,disabled:Z,isSelected:E}},E?"✓":null))}))}),ec=function(e,t){var n=r.useRef({values:new Map,options:new Map});return[r.useMemo(function(){var r=n.current,o=r.values,a=r.options,i=e.map(function(e){if(void 0===e.label){var t;return(0,s.Z)((0,s.Z)({},e),{},{label:null===(t=o.get(e.value))||void 0===t?void 0:t.label})}return e}),c=new Map,l=new Map;return i.forEach(function(e){c.set(e.value,e),l.set(e.value,t.get(e.value)||a.get(e.value))}),n.current.values=c,n.current.options=l,i},[e,t]),r.useCallback(function(e){return t.get(e)||n.current.options.get(e)},[t])]};function el(e,t){return j(e).join("").toUpperCase().includes(t)}var es=n(94981),eu=0,ed=(0,es.Z)(),ef=n(45287),ep=["children","value"],em=["children"];function eg(e){var t=r.useRef();return t.current=e,r.useCallback(function(){return t.current.apply(t,arguments)},[])}var ev=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],eh=["inputValue"],eb=r.forwardRef(function(e,t){var n,o,a,m,g,v=e.id,h=e.mode,b=e.prefixCls,y=e.backfill,x=e.fieldNames,w=e.inputValue,E=e.searchValue,C=e.onSearch,Z=e.autoClearSearchValue,S=void 0===Z||Z,O=e.onSelect,k=e.onDeselect,I=e.dropdownMatchSelectWidth,M=void 0===I||I,R=e.filterOption,N=e.filterSort,P=e.optionFilterProp,F=e.optionLabelProp,T=e.options,A=e.optionRender,_=e.children,B=e.defaultActiveFirstOption,H=e.menuItemSelectedIcon,z=e.virtual,L=e.direction,W=e.listHeight,X=void 0===W?200:W,U=e.listItemHeight,$=void 0===U?20:U,K=e.labelRender,J=e.value,ee=e.defaultValue,et=e.labelInValue,en=e.onChange,er=e.maxCount,eo=(0,d.Z)(e,ev),ea=(n=r.useState(),a=(o=(0,u.Z)(n,2))[0],m=o[1],r.useEffect(function(){var e;m("rc_select_".concat((ed?(e=eu,eu+=1):e="TEST_OR_SSR",e)))},[]),v||a),es=Y(h),eb=!!(!T&&_),ey=r.useMemo(function(){return(void 0!==R||"combobox"!==h)&&R},[R,h]),ex=r.useMemo(function(){return V(x,eb)},[JSON.stringify(x),eb]),ew=(0,p.Z)("",{value:void 0!==E?E:w,postState:function(e){return e||""}}),eE=(0,u.Z)(ew,2),eC=eE[0],eZ=eE[1],eS=r.useMemo(function(){var e=T;T||(e=function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,ef.Z)(t).map(function(t,o){if(!r.isValidElement(t)||!t.type)return null;var a,i,c,l,u,f=t.type.isSelectOptGroup,p=t.key,m=t.props,g=m.children,v=(0,d.Z)(m,em);return n||!f?(a=t.key,c=(i=t.props).children,l=i.value,u=(0,d.Z)(i,ep),(0,s.Z)({key:a,value:void 0!==l?l:a,children:c},u)):(0,s.Z)((0,s.Z)({key:"__RC_SELECT_GRP__".concat(null===p?o:p,"__"),label:p},v),{},{options:e(g)})}).filter(function(e){return e})}(_));var t=new Map,n=new Map,o=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(r){for(var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0;i0?e(t.options):t.options}):t})}(eD):eD},[eD,N,eC]),eV=r.useMemo(function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,o=[],a=V(n,!1),i=a.label,c=a.value,l=a.options,s=a.groupLabel;return!function e(t,n){Array.isArray(t)&&t.forEach(function(t){if(!n&&l in t){var a=t[s];void 0===a&&r&&(a=t.label),o.push({key:D(t,o.length),group:!0,data:t,label:a}),e(t[l],!0)}else{var u=t[c];o.push({key:D(t,o.length),groupOption:n,data:t,label:t[i],value:u})}})}(e,!1),o}(eW,{fieldNames:ex,childrenAsData:eb})},[eW,ex,eb]),eq=function(e){var t=eI(e);if(eP(t),en&&(t.length!==eA.length||t.some(function(e,t){var n;return(null===(n=eA[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)}))){var n=et?t:t.map(function(e){return e.value}),r=t.map(function(e){return q(e_(e.value))});en(es?n:n[0],es?r:r[0])}},eX=r.useState(null),eG=(0,u.Z)(eX,2),eU=eG[0],e$=eG[1],eK=r.useState(0),eY=(0,u.Z)(eK,2),eQ=eY[0],eJ=eY[1],e0=void 0!==B?B:"combobox"!==h,e1=r.useCallback(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.source;eJ(t),y&&"combobox"===h&&null!==e&&"keyboard"===(void 0===r?"keyboard":r)&&e$(String(e))},[y,h]),e2=function(e,t,n){var r=function(){var t,n=e_(e);return[et?{label:null==n?void 0:n[ex.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,q(n)]};if(t&&O){var o=r(),a=(0,u.Z)(o,2);O(a[0],a[1])}else if(!t&&k&&"clear"!==n){var i=r(),c=(0,u.Z)(i,2);k(c[0],c[1])}},e6=eg(function(e,t){var n=!es||t.selected;eq(n?es?[].concat((0,c.Z)(eA),[e]):[e]:eA.filter(function(t){return t.value!==e})),e2(e,n),"combobox"===h?e$(""):(!Y||S)&&(eZ(""),e$(""))}),e5=r.useMemo(function(){var e=!1!==z&&!1!==M;return(0,s.Z)((0,s.Z)({},eS),{},{flattenOptions:eV,onActiveValue:e1,defaultActiveFirstOption:e0,onSelect:e6,menuItemSelectedIcon:H,rawValues:eH,fieldNames:ex,virtual:e,direction:L,listHeight:X,listItemHeight:$,childrenAsData:eb,maxCount:er,optionRender:A})},[er,eS,eV,e1,e0,e6,H,eH,ex,z,M,L,X,$,eb,A]);return r.createElement(G.Provider,{value:e5},r.createElement(Q,(0,i.Z)({},eo,{id:ea,prefixCls:void 0===b?"rc-select":b,ref:t,omitDomProps:eh,mode:h,displayValues:eB,onDisplayValuesChange:function(e,t){eq(e);var n=t.type,r=t.values;("remove"===n||"clear"===n)&&r.forEach(function(e){e2(e.value,!1,n)})},direction:L,searchValue:eC,onSearch:function(e,t){if(eZ(e),e$(null),"submit"===t.source){var n=(e||"").trim();n&&(eq(Array.from(new Set([].concat((0,c.Z)(eH),[n])))),e2(n,!0),eZ(""));return}"blur"!==t.source&&("combobox"===h&&eq(e),null==C||C(e))},autoClearSearchValue:S,onSearchSplit:function(e){var t=e;"tags"!==h&&(t=e.map(function(e){var t=ek.get(e);return null==t?void 0:t.value}).filter(function(e){return void 0!==e}));var n=Array.from(new Set([].concat((0,c.Z)(eH),(0,c.Z)(t))));eq(n),n.forEach(function(e){e2(e,!0)})},dropdownMatchSelectWidth:M,OptionList:ei,emptyOptions:!eV.length,activeValue:eU,activeDescendantId:"".concat(ea,"_list_").concat(eQ)})))});eb.Option=ee,eb.OptGroup=J;var ey=n(62236),ex=n(68710),ew=n(93942),eE=n(12757),eC=n(71744),eZ=n(91086),eS=n(86586),eO=n(64024),ek=n(33759),ej=n(39109),eI=n(56250),eM=n(77685),eR=n(84951);let eN=e=>{let t={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:"scroll"===e?"scroll":"visible",dynamicInset:!0};return{bottomLeft:Object.assign(Object.assign({},t),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},t),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},t),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},t),{points:["br","tr"],offset:[0,-4]})}};var eP=n(12918),eF=n(17691),eT=n(99320),eA=n(71140),e_=n(18544),eB=n(29382);let eH=e=>{let{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:o}=e;return{position:"relative",display:"block",minHeight:t,padding:o,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}};var ez=e=>{let{antCls:t,componentCls:n}=e,r="".concat(n,"-item"),o="&".concat(t,"-slide-up-enter").concat(t,"-slide-up-enter-active"),a="&".concat(t,"-slide-up-appear").concat(t,"-slide-up-appear-active"),i="&".concat(t,"-slide-up-leave").concat(t,"-slide-up-leave-active"),c="".concat(n,"-dropdown-placement-"),l="".concat(r,"-option-selected");return[{["".concat(n,"-dropdown")]:Object.assign(Object.assign({},(0,eP.Wf)(e)),{position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,["\n ".concat(o).concat(c,"bottomLeft,\n ").concat(a).concat(c,"bottomLeft\n ")]:{animationName:e_.fJ},["\n ".concat(o).concat(c,"topLeft,\n ").concat(a).concat(c,"topLeft,\n ").concat(o).concat(c,"topRight,\n ").concat(a).concat(c,"topRight\n ")]:{animationName:e_.Qt},["".concat(i).concat(c,"bottomLeft")]:{animationName:e_.Uw},["\n ".concat(i).concat(c,"topLeft,\n ").concat(i).concat(c,"topRight\n ")]:{animationName:e_.ly},"&-hidden":{display:"none"},[r]:Object.assign(Object.assign({},eH(e)),{cursor:"pointer",transition:"background ".concat(e.motionDurationSlow," ease"),borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},eP.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},["&-active:not(".concat(r,"-option-disabled)")]:{backgroundColor:e.optionActiveBg},["&-selected:not(".concat(r,"-option-disabled)")]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,["".concat(r,"-option-state")]:{color:e.colorPrimary}},"&-disabled":{["&".concat(r,"-option-selected")]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},eH(e)),{color:e.colorTextDisabled})}),["".concat(l,":has(+ ").concat(l,")")]:{borderEndStartRadius:0,borderEndEndRadius:0,["& + ".concat(l)]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}})},(0,e_.oN)(e,"slide-up"),(0,e_.oN)(e,"slide-down"),(0,eB.Fm)(e,"move-up"),(0,eB.Fm)(e,"move-down")]},eL=n(93463);let eD=e=>{let{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:o}=e,a=e.max(e.calc(n).sub(r).equal(),0),i=e.max(e.calc(a).sub(o).equal(),0);return{basePadding:a,containerPadding:i,itemHeight:(0,eL.bf)(t),itemLineHeight:(0,eL.bf)(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}},eW=e=>{let{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()},eV=e=>{let{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:o,paddingXS:a,multipleItemColorDisabled:i,multipleItemBorderColorDisabled:c,colorIcon:l,colorIconHover:s,INTERNAL_FIXED_ITEM_MARGIN:u}=e;return{["".concat(t,"-selection-overflow")]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"calc(100% - 4px)",display:"inline-flex"},["".concat(t,"-selection-item")]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:u,borderRadius:r,cursor:"default",transition:"font-size ".concat(o,", line-height ").concat(o,", height ").concat(o),marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:e.calc(a).div(2).equal(),["".concat(t,"-disabled&")]:{color:i,borderColor:c,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(a).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,eP.Ro)()),{display:"inline-flex",alignItems:"center",color:l,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",["> ".concat(n)]:{verticalAlign:"-0.2em"},"&:hover":{color:s}})}}}},eq=(e,t)=>{let{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,o="".concat(n,"-selection-overflow"),a=e.multipleSelectItemHeight,i=eW(e),c=t?"".concat(n,"-").concat(t):"",l=eD(e);return{["".concat(n,"-multiple").concat(c)]:Object.assign(Object.assign({},eV(e)),{["".concat(n,"-selector")]:{display:"flex",alignItems:"center",width:"100%",height:"100%",paddingInline:l.basePadding,paddingBlock:l.containerPadding,borderRadius:e.borderRadius,["".concat(n,"-disabled&")]:{background:e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:"".concat((0,eL.bf)(r)," 0"),lineHeight:(0,eL.bf)(a),visibility:"hidden",content:'"\\a0"'}},["".concat(n,"-selection-item")]:{height:l.itemHeight,lineHeight:(0,eL.bf)(l.itemLineHeight)},["".concat(n,"-selection-wrap")]:{alignSelf:"flex-start","&:after":{lineHeight:(0,eL.bf)(a),marginBlock:r}},["".concat(n,"-prefix")]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal()},["".concat(o,"-item + ").concat(o,"-item,\n ").concat(n,"-prefix + ").concat(n,"-selection-wrap\n ")]:{["".concat(n,"-selection-search")]:{marginInlineStart:0},["".concat(n,"-selection-placeholder")]:{insetInlineStart:0}},["".concat(o,"-item-suffix")]:{minHeight:l.itemHeight,marginBlock:r},["".concat(n,"-selection-search")]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(i).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:(0,eL.bf)(a),transition:"all ".concat(e.motionDurationSlow)},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},["".concat(n,"-selection-placeholder")]:{position:"absolute",top:"50%",insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(l.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:"all ".concat(e.motionDurationSlow)}})}};function eX(e,t){let{componentCls:n}=e,r=t?"".concat(n,"-").concat(t):"",o={["".concat(n,"-multiple").concat(r)]:{fontSize:e.fontSize,["".concat(n,"-selector")]:{["".concat(n,"-show-search&")]:{cursor:"text"}},["\n &".concat(n,"-show-arrow ").concat(n,"-selector,\n &").concat(n,"-allow-clear ").concat(n,"-selector\n ")]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[eq(e,t),o]}var eG=e=>{let{componentCls:t}=e,n=(0,eA.IX)(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=(0,eA.IX)(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[eX(e),eX(n,"sm"),{["".concat(t,"-multiple").concat(t,"-sm")]:{["".concat(t,"-selection-placeholder")]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},["".concat(t,"-selection-search")]:{marginInlineStart:2}}},eX(r,"lg")]};function eU(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:o}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),i=t?"".concat(n,"-").concat(t):"";return{["".concat(n,"-single").concat(i)]:{fontSize:e.fontSize,height:e.controlHeight,["".concat(n,"-selector")]:Object.assign(Object.assign({},(0,eP.Wf)(e,!0)),{display:"flex",borderRadius:o,flex:"1 1 auto",["".concat(n,"-selection-wrap:after")]:{lineHeight:(0,eL.bf)(a)},["".concat(n,"-selection-search")]:{position:"absolute",inset:0,width:"100%","&-input":{width:"100%",WebkitAppearance:"textfield"}},["\n ".concat(n,"-selection-item,\n ").concat(n,"-selection-placeholder\n ")]:{display:"block",padding:0,lineHeight:(0,eL.bf)(a),transition:"all ".concat(e.motionDurationSlow,", visibility 0s"),alignSelf:"center"},["".concat(n,"-selection-placeholder")]:{transition:"none",pointerEvents:"none"},[["&:after","".concat(n,"-selection-item:empty:after"),"".concat(n,"-selection-placeholder:empty:after")].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),["\n &".concat(n,"-show-arrow ").concat(n,"-selection-item,\n &").concat(n,"-show-arrow ").concat(n,"-selection-search,\n &").concat(n,"-show-arrow ").concat(n,"-selection-placeholder\n ")]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},["&".concat(n,"-open ").concat(n,"-selection-item")]:{color:e.colorTextPlaceholder},["&:not(".concat(n,"-customize-input)")]:{["".concat(n,"-selector")]:{width:"100%",height:"100%",alignItems:"center",padding:"0 ".concat((0,eL.bf)(r)),["".concat(n,"-selection-search-input")]:{height:a,fontSize:e.fontSize},"&:after":{lineHeight:(0,eL.bf)(a)}}},["&".concat(n,"-customize-input")]:{["".concat(n,"-selector")]:{"&:after":{display:"none"},["".concat(n,"-selection-search")]:{position:"static",width:"100%"},["".concat(n,"-selection-placeholder")]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:"0 ".concat((0,eL.bf)(r)),"&:after":{display:"none"}}}}}}}let e$=(e,t)=>{let{componentCls:n,antCls:r,controlOutlineWidth:o}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(t.borderColor),background:e.selectorBg},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{borderColor:t.hoverBorderHover},["".concat(n,"-focused& ").concat(n,"-selector")]:{borderColor:t.activeBorderColor,boxShadow:"0 0 0 ".concat((0,eL.bf)(o)," ").concat(t.activeOutlineColor),outline:0},["".concat(n,"-prefix")]:{color:t.color}}}},eK=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},e$(e,t))}),eY=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},e$(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),eK(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),eK(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}})}),eQ=(e,t)=>{let{componentCls:n,antCls:r}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{background:t.bg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," transparent"),color:t.color},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{background:t.hoverBg},["".concat(n,"-focused& ").concat(n,"-selector")]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},eJ=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},eQ(e,t))}),e0=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},eQ(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),eJ(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),eJ(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.colorBgContainer,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorSplit)}})}),e1=e=>({"&-borderless":{["".concat(e.componentCls,"-selector")]:{background:"transparent",border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," transparent")},["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)},["&".concat(e.componentCls,"-status-error")]:{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-selection-item")]:{color:e.colorError}},["&".concat(e.componentCls,"-status-warning")]:{["".concat(e.componentCls,"-prefix, ").concat(e.componentCls,"-selection-item")]:{color:e.colorWarning}}}}),e2=(e,t)=>{let{componentCls:n,antCls:r}=e;return{["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:{borderWidth:"".concat((0,eL.bf)(e.lineWidth)," 0"),borderStyle:"".concat(e.lineType," none"),borderColor:"transparent transparent ".concat(t.borderColor," transparent"),background:e.selectorBg,borderRadius:0},["&:not(".concat(n,"-disabled):not(").concat(n,"-customize-input):not(").concat(r,"-pagination-size-changer)")]:{["&:hover ".concat(n,"-selector")]:{borderColor:"transparent transparent ".concat(t.hoverBorderHover," transparent")},["".concat(n,"-focused& ").concat(n,"-selector")]:{borderColor:"transparent transparent ".concat(t.activeBorderColor," transparent"),outline:0},["".concat(n,"-prefix")]:{color:t.color}}}},e6=(e,t)=>({["&".concat(e.componentCls,"-status-").concat(t.status)]:Object.assign({},e2(e,t))}),e5=e=>({"&-underlined":Object.assign(Object.assign(Object.assign(Object.assign({},e2(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),e6(e,{status:"error",borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),e6(e,{status:"warning",borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{["&".concat(e.componentCls,"-disabled")]:{["&:not(".concat(e.componentCls,"-customize-input) ").concat(e.componentCls,"-selector")]:{color:e.colorTextDisabled}},["&".concat(e.componentCls,"-multiple ").concat(e.componentCls,"-selection-item")]:{background:e.multipleItemBg,border:"".concat((0,eL.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.multipleItemBorderColor)}})});var e4=e=>({[e.componentCls]:Object.assign(Object.assign(Object.assign(Object.assign({},eY(e)),e0(e)),e1(e)),e5(e))});let e3=e=>{let{componentCls:t}=e;return{position:"relative",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut),input:{cursor:"pointer"},["".concat(t,"-show-search&")]:{cursor:"text",input:{cursor:"auto",color:"inherit",height:"100%"}},["".concat(t,"-disabled&")]:{cursor:"not-allowed",input:{cursor:"not-allowed"}}}},e7=e=>{let{componentCls:t}=e;return{["".concat(t,"-selection-search-input")]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none",fontFamily:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},e9=e=>{let{antCls:t,componentCls:n,inputPaddingHorizontalBase:r,iconCls:o}=e,a={["".concat(n,"-clear")]:{opacity:1,background:e.colorBgBase,borderRadius:"50%"}};return{[n]:Object.assign(Object.assign({},(0,eP.Wf)(e)),{position:"relative",display:"inline-flex",cursor:"pointer",["&:not(".concat(n,"-customize-input) ").concat(n,"-selector")]:Object.assign(Object.assign({},e3(e)),e7(e)),["".concat(n,"-selection-item")]:Object.assign(Object.assign({flex:1,fontWeight:"normal",position:"relative",userSelect:"none"},eP.vS),{["> ".concat(t,"-typography")]:{display:"inline"}}),["".concat(n,"-selection-placeholder")]:Object.assign(Object.assign({},eP.vS),{flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}),["".concat(n,"-arrow")]:Object.assign(Object.assign({},(0,eP.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",transition:"opacity ".concat(e.motionDurationSlow," ease"),[o]:{verticalAlign:"top",transition:"transform ".concat(e.motionDurationSlow),"> svg":{verticalAlign:"top"},["&:not(".concat(n,"-suffix)")]:{pointerEvents:"auto"}},["".concat(n,"-disabled &")]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),["".concat(n,"-selection-wrap")]:{display:"flex",width:"100%",position:"relative",minWidth:0,"&:after":{content:'"\\a0"',width:0,overflow:"hidden"}},["".concat(n,"-prefix")]:{flex:"none",marginInlineEnd:e.selectAffixPadding},["".concat(n,"-clear")]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:"color ".concat(e.motionDurationMid," ease, opacity ").concat(e.motionDurationSlow," ease"),textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:e.colorIcon}},"@media(hover:none)":a,"&:hover":a}),["".concat(n,"-status")]:{"&-error, &-warning, &-success, &-validating":{["&".concat(n,"-has-feedback")]:{["".concat(n,"-clear")]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}}}},e8=e=>{let{componentCls:t}=e;return[{[t]:{["&".concat(t,"-in-form-item")]:{width:"100%"}}},e9(e),function(e){let{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[eU(e),eU((0,eA.IX)(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),"sm"),{["".concat(t,"-single").concat(t,"-sm")]:{["&:not(".concat(t,"-customize-input)")]:{["".concat(t,"-selector")]:{padding:"0 ".concat((0,eL.bf)(n))},["&".concat(t,"-show-arrow ").concat(t,"-selection-search")]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},["\n &".concat(t,"-show-arrow ").concat(t,"-selection-item,\n &").concat(t,"-show-arrow ").concat(t,"-selection-placeholder\n ")]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},eU((0,eA.IX)(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),"lg")]}(e),eG(e),ez(e),{["".concat(t,"-rtl")]:{direction:"rtl"}},(0,eF.c)(e,{borderElCls:"".concat(t,"-selector"),focusElCls:"".concat(t,"-focused")})]};var te=(0,eT.I$)("Select",(e,t)=>{let{rootPrefixCls:n}=t,r=(0,eA.IX)(e,{rootPrefixCls:n,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[e8(r),e4(r)]},e=>{let{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:o,controlHeightSM:a,controlHeightLG:i,paddingXXS:c,controlPaddingHorizontal:l,zIndexPopupBase:s,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:m,colorFillSecondary:g,colorBgContainerDisabled:v,colorTextDisabled:h,colorPrimaryHover:b,colorPrimary:y,controlOutline:x}=e,w=2*c,E=2*r;return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(c/2),zIndexPopup:s+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:"".concat((o-t*n)/2,"px ").concat(l,"px"),optionFontSize:t,optionLineHeight:n,optionHeight:o,selectorBg:m,clearBg:m,singleItemHeightLG:i,multipleItemBg:g,multipleItemBorderColor:"transparent",multipleItemHeight:Math.min(o-w,o-E),multipleItemHeightSM:Math.min(a-w,a-E),multipleItemHeightLG:Math.min(i-w,i-E),multipleSelectorBgDisabled:v,multipleItemColorDisabled:h,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(1.25*e.fontSize),hoverBorderColor:b,activeBorderColor:y,activeOutlineColor:x,selectAffixPadding:c}},{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}}),tt=n(9738),tn=n(39725),tr=n(49638),to=n(70464),ta=n(61935),ti=n(29436),tc=n(391),tl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let ts="SECRET_COMBOBOX_MODE_DO_NOT_USE",tu=r.forwardRef((e,t)=>{var n,o,i,c,l,s,u,d;let f;let{prefixCls:p,bordered:m,className:g,rootClassName:v,getPopupContainer:h,popupClassName:b,dropdownClassName:y,listHeight:x=256,placement:w,listItemHeight:E,size:C,disabled:Z,notFoundContent:S,status:O,builtinPlacements:k,dropdownMatchSelectWidth:j,popupMatchSelectWidth:I,direction:M,style:R,allowClear:N,variant:P,dropdownStyle:F,transitionName:T,tagRender:A,maxCount:_,prefix:B,dropdownRender:H,popupRender:z,onDropdownVisibleChange:L,onOpenChange:D,styles:W,classNames:V}=e,q=tl(e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear","variant","dropdownStyle","transitionName","tagRender","maxCount","prefix","dropdownRender","popupRender","onDropdownVisibleChange","onOpenChange","styles","classNames"]),{getPopupContainer:X,getPrefixCls:G,renderEmpty:U,direction:$,virtual:K,popupMatchSelectWidth:Y,popupOverflow:Q}=r.useContext(eC.E_),{showSearch:J,style:ee,styles:et,className:er,classNames:eo}=(0,eC.dj)("select"),[,ea]=(0,eR.ZP)(),ei=null!=E?E:null==ea?void 0:ea.controlHeight,ec=G("select",p),el=G(),es=null!=M?M:$,{compactSize:eu,compactItemClassnames:ed}=(0,eM.ri)(ec,es),[ef,ep]=(0,eI.Z)("select",P,m),em=(0,eO.Z)(ec),[eg,ev,eh]=te(ec,em),ew=r.useMemo(()=>{let{mode:t}=e;return"combobox"===t?void 0:t===ts?"combobox":t},[e.mode]),eP="multiple"===ew||"tags"===ew,eF=(s=e.suffixIcon,void 0!==(u=e.showArrow)?u:null!==s),eT=null!==(n=null!=I?I:j)&&void 0!==n?n:Y,eA=(null===(o=null==W?void 0:W.popup)||void 0===o?void 0:o.root)||(null===(i=et.popup)||void 0===i?void 0:i.root)||F,e_=(d=z||H,r.useMemo(()=>{if(d)return function(){for(var e=arguments.length,t=Array(e),n=0;nnull!==t||l||f?r.createElement(r.Fragment,null,!1!==u&&e,l&&d):null,v=null;if(void 0!==t)v=g(t);else if(i)v=g(r.createElement(ta.Z,{spin:!0}));else{let e="".concat(s,"-suffix");v=t=>{let{open:n,showSearch:o}=t;return n&&o?g(r.createElement(ti.Z,{className:e})):g(r.createElement(to.Z,{className:e}))}}let h=null;return h=void 0!==o?o:c?r.createElement(tt.Z,null):null,{clearIcon:m,suffixIcon:v,itemIcon:h,removeIcon:void 0!==a?a:r.createElement(tr.Z,null)}}(Object.assign(Object.assign({},q),{multiple:eP,hasFeedback:eH,feedbackIcon:eL,showSuffixIcon:eF,prefixCls:ec,componentName:"Select"})),eG=(0,en.Z)(q,["suffixIcon","itemIcon"]),eU=a()((null===(c=null==V?void 0:V.popup)||void 0===c?void 0:c.root)||(null===(l=null==eo?void 0:eo.popup)||void 0===l?void 0:l.root)||b||y,{["".concat(ec,"-dropdown-").concat(es)]:"rtl"===es},v,eo.root,null==V?void 0:V.root,eh,em,ev),e$=(0,ek.Z)(e=>{var t;return null!==(t=null!=C?C:eu)&&void 0!==t?t:e}),eK=r.useContext(eS.Z),eY=a()({["".concat(ec,"-lg")]:"large"===e$,["".concat(ec,"-sm")]:"small"===e$,["".concat(ec,"-rtl")]:"rtl"===es,["".concat(ec,"-").concat(ef)]:ep,["".concat(ec,"-in-form-item")]:ez},(0,eE.Z)(ec,eD,eH),ed,er,g,eo.root,null==V?void 0:V.root,v,eh,em,ev),eQ=r.useMemo(()=>void 0!==w?w:"rtl"===es?"bottomRight":"bottomLeft",[w,es]),[eJ]=(0,ey.Cn)("SelectLike",null==eA?void 0:eA.zIndex);return eg(r.createElement(eb,Object.assign({ref:t,virtual:K,showSearch:J},eG,{style:Object.assign(Object.assign(Object.assign(Object.assign({},et.root),null==W?void 0:W.root),ee),R),dropdownMatchSelectWidth:eT,transitionName:(0,ex.m)(el,"slide-up",T),builtinPlacements:k||eN(Q),listHeight:x,listItemHeight:ei,mode:ew,prefixCls:ec,placement:eQ,direction:es,prefix:B,suffixIcon:eW,menuItemSelectedIcon:eV,removeIcon:eq,allowClear:!0===N?{clearIcon:eX}:N,notFoundContent:f,className:eY,getPopupContainer:h||X,dropdownClassName:eU,disabled:null!=Z?Z:eK,dropdownStyle:Object.assign(Object.assign({},eA),{zIndex:eJ}),maxCount:eP?_:void 0,tagRender:eP?A:void 0,dropdownRender:e_,onDropdownVisibleChange:D||L})))}),td=(0,ew.Z)(tu,"dropdownAlign");tu.SECRET_COMBOBOX_MODE_DO_NOT_USE=ts,tu.Option=ee,tu.OptGroup=J,tu._InternalPanelDoNotUseOrYouWillBeFired=td;var tf=tu},77685:function(e,t,n){"use strict";n.d(t,{BR:function(){return g},ZP:function(){return h},ri:function(){return m}});var r=n(2265),o=n(36760),a=n.n(o),i=n(45287),c=n(71744),l=n(33759),s=n(99320);let u=e=>{let{componentCls:t}=e;return{[t]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"}}}};var d=(0,s.I$)(["Space","Compact"],e=>[u(e)],()=>({}),{resetStyle:!1}),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let p=r.createContext(null),m=(e,t)=>{let n=r.useContext(p),o=r.useMemo(()=>{if(!n)return"";let{compactDirection:r,isFirstItem:o,isLastItem:i}=n,c="vertical"===r?"-vertical-":"-";return a()("".concat(e,"-compact").concat(c,"item"),{["".concat(e,"-compact").concat(c,"first-item")]:o,["".concat(e,"-compact").concat(c,"last-item")]:i,["".concat(e,"-compact").concat(c,"item-rtl")]:"rtl"===t})},[e,t,n]);return{compactSize:null==n?void 0:n.compactSize,compactDirection:null==n?void 0:n.compactDirection,compactItemClassnames:o}},g=e=>{let{children:t}=e;return r.createElement(p.Provider,{value:null},t)},v=e=>{let{children:t}=e,n=f(e,["children"]);return r.createElement(p.Provider,{value:r.useMemo(()=>n,[n])},t)};var h=e=>{let{getPrefixCls:t,direction:n}=r.useContext(c.E_),{size:o,direction:s,block:u,prefixCls:m,className:g,rootClassName:h,children:b}=e,y=f(e,["size","direction","block","prefixCls","className","rootClassName","children"]),x=(0,l.Z)(e=>null!=o?o:e),w=t("space-compact",m),[E,C]=d(w),Z=a()(w,C,{["".concat(w,"-rtl")]:"rtl"===n,["".concat(w,"-block")]:u,["".concat(w,"-vertical")]:"vertical"===s},g,h),S=r.useContext(p),O=(0,i.Z)(b),k=r.useMemo(()=>O.map((e,t)=>{let n=(null==e?void 0:e.key)||"".concat(w,"-item-").concat(t);return r.createElement(v,{key:n,compactSize:x,compactDirection:s,isFirstItem:0===t&&(!S||(null==S?void 0:S.isFirstItem)),isLastItem:t===O.length-1&&(!S||(null==S?void 0:S.isLastItem))},e)}),[O,S,s,x,w]);return 0===O.length?null:E(r.createElement("div",Object.assign({className:Z},y),k))}},17691:function(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{focus:!0},{componentCls:n}=e,{componentCls:r}=t,o=r||n,a="".concat(o,"-compact");return{[a]:Object.assign(Object.assign({},function(e,t,n,r){let{focusElCls:o,focus:a,borderElCls:i}=n,c=i?"> *":"",l=["hover",a?"focus":null,"active"].filter(Boolean).map(e=>"&:".concat(e," ").concat(c)).join(",");return{["&-item:not(".concat(t,"-last-item)")]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},["&-item:not(".concat(r,"-status-success)")]:{zIndex:2},"&-item":Object.assign(Object.assign({[l]:{zIndex:3}},o?{["&".concat(o)]:{zIndex:3}}:{}),{["&[disabled] ".concat(c)]:{zIndex:0}})}}(e,a,t,o)),function(e,t,n){let{borderElCls:r}=n,o=r?"> ".concat(r):"";return{["&-item:not(".concat(t,"-first-item):not(").concat(t,"-last-item) ").concat(o)]:{borderRadius:0},["&-item:not(".concat(t,"-last-item)").concat(t,"-first-item")]:{["& ".concat(o,", &").concat(e,"-sm ").concat(o,", &").concat(e,"-lg ").concat(o)]:{borderStartEndRadius:0,borderEndEndRadius:0}},["&-item:not(".concat(t,"-first-item)").concat(t,"-last-item")]:{["& ".concat(o,", &").concat(e,"-sm ").concat(o,", &").concat(e,"-lg ").concat(o)]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}(o,a,t))}}n.d(t,{c:function(){return r}})},12918:function(e,t,n){"use strict";n.d(t,{JT:function(){return f},Lx:function(){return l},Nd:function(){return p},Qy:function(){return d},Ro:function(){return i},Wf:function(){return a},dF:function(){return c},du:function(){return s},oN:function(){return u},vS:function(){return o}});var r=n(93463);let o={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}},i=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),c=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),l=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:"color ".concat(e.motionDurationSlow),"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),s=(e,t,n,r)=>{let o='[class^="'.concat(t,'"], [class*=" ').concat(t,'"]'),a=n?".".concat(n):o,i={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}},c={};return!1!==r&&(c={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},c),i),{[o]:i})}},u=(e,t)=>({outline:"".concat((0,r.bf)(e.lineWidthFocus)," solid ").concat(e.colorPrimaryBorder),outlineOffset:null!=t?t:1,transition:"outline-offset 0s, outline 0s"}),d=(e,t)=>({"&:focus-visible":u(e,t)}),f=e=>({[".".concat(e)]:Object.assign(Object.assign({},i()),{[".".concat(e," .").concat(e,"-icon")]:{display:"block"}})}),p=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:"all ".concat(e.motionDurationSlow),border:0,padding:0,background:"none",userSelect:"none"},d(e)),{"&:hover":{color:e.colorLinkHover,textDecoration:e.linkHoverDecoration},"&:focus":{color:e.colorLinkHover,textDecoration:e.linkFocusDecoration},"&:active":{color:e.colorLinkActive,textDecoration:e.linkHoverDecoration}})},63074:function(e,t){"use strict";t.Z=e=>({[e.componentCls]:{["".concat(e.antCls,"-motion-collapse-legacy")]:{overflow:"hidden","&-active":{transition:"height ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationMid," ").concat(e.motionEaseInOut," !important")}},["".concat(e.antCls,"-motion-collapse")]:{overflow:"hidden",transition:"height ".concat(e.motionDurationMid," ").concat(e.motionEaseInOut,",\n opacity ").concat(e.motionDurationMid," ").concat(e.motionEaseInOut," !important")}}})},37133:function(e,t,n){"use strict";n.d(t,{R:function(){return a}});let r=e=>({animationDuration:e,animationFillMode:"both"}),o=e=>({animationDuration:e,animationFillMode:"both"}),a=function(e,t,n,a){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],c=i?"&":"";return{["\n ".concat(c).concat(e,"-enter,\n ").concat(c).concat(e,"-appear\n ")]:Object.assign(Object.assign({},r(a)),{animationPlayState:"paused"}),["".concat(c).concat(e,"-leave")]:Object.assign(Object.assign({},o(a)),{animationPlayState:"paused"}),["\n ".concat(c).concat(e,"-enter").concat(e,"-enter-active,\n ").concat(c).concat(e,"-appear").concat(e,"-appear-active\n ")]:{animationName:t,animationPlayState:"running"},["".concat(c).concat(e,"-leave").concat(e,"-leave-active")]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}}},29382:function(e,t,n){"use strict";n.d(t,{Fm:function(){return f}});var r=n(93463),o=n(37133);let a=new r.E4("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),i=new r.E4("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),c=new r.E4("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),l=new r.E4("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),s=new r.E4("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),u=new r.E4("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),d={"move-up":{inKeyframes:new r.E4("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),outKeyframes:new r.E4("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}})},"move-down":{inKeyframes:a,outKeyframes:i},"move-left":{inKeyframes:c,outKeyframes:l},"move-right":{inKeyframes:s,outKeyframes:u}},f=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=d[t];return[(0,o.R)(r,a,i,e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInOutCirc}}]}},18544:function(e,t,n){"use strict";n.d(t,{Qt:function(){return c},Uw:function(){return i},fJ:function(){return a},ly:function(){return l},oN:function(){return d}});var r=n(93463),o=n(37133);let a=new r.E4("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),i=new r.E4("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),c=new r.E4("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),l=new r.E4("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),s=new r.E4("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),u={"slide-up":{inKeyframes:a,outKeyframes:i},"slide-down":{inKeyframes:c,outKeyframes:l},"slide-left":{inKeyframes:s,outKeyframes:new r.E4("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}})},"slide-right":{inKeyframes:new r.E4("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),outKeyframes:new r.E4("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}})}},d=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=u[t];return[(0,o.R)(r,a,i,e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInQuint}}]}},691:function(e,t,n){"use strict";n.d(t,{_y:function(){return g},kr:function(){return a}});var r=n(93463),o=n(37133);let a=new r.E4("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),i=new r.E4("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),c=new r.E4("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),l=new r.E4("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),s=new r.E4("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),u=new r.E4("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),d=new r.E4("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),f=new r.E4("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),p=new r.E4("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),m={zoom:{inKeyframes:a,outKeyframes:i},"zoom-big":{inKeyframes:c,outKeyframes:l},"zoom-big-fast":{inKeyframes:c,outKeyframes:l},"zoom-left":{inKeyframes:d,outKeyframes:f},"zoom-right":{inKeyframes:p,outKeyframes:new r.E4("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}})},"zoom-up":{inKeyframes:s,outKeyframes:u},"zoom-down":{inKeyframes:new r.E4("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),outKeyframes:new r.E4("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}})}},g=(e,t)=>{let{antCls:n}=e,r="".concat(n,"-").concat(t),{inKeyframes:a,outKeyframes:i}=m[t];return[(0,o.R)(r,a,i,"zoom-big-fast"===t?e.motionDurationFast:e.motionDurationMid),{["\n ".concat(r,"-enter,\n ").concat(r,"-appear\n ")]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},["".concat(r,"-leave")]:{animationTimingFunction:e.motionEaseInOutCirc}}]}},88260:function(e,t,n){"use strict";n.d(t,{ZP:function(){return c},qN:function(){return a},wZ:function(){return i}});var r=n(93463),o=n(34442);let a=8;function i(e){let{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?a:r}}function c(e,t,n){var a,i,c,l,s,u,d,f;let{componentCls:p,boxShadowPopoverArrow:m,arrowOffsetVertical:g,arrowOffsetHorizontal:v}=e,{arrowDistance:h=0,arrowPlacement:b={left:!0,right:!0,top:!0,bottom:!0}}=n||{};return{[p]:Object.assign(Object.assign(Object.assign(Object.assign({["".concat(p,"-arrow")]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},(0,o.W)(e,t,m)),{"&:before":{background:t}})]},(a=!!b.top,i={[["&-placement-top > ".concat(p,"-arrow"),"&-placement-topLeft > ".concat(p,"-arrow"),"&-placement-topRight > ".concat(p,"-arrow")].join(",")]:{bottom:h,transform:"translateY(100%) rotate(180deg)"},["&-placement-top > ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":v,["> ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:v}}},"&-placement-topRight":{"--arrow-offset-horizontal":"calc(100% - ".concat((0,r.bf)(v),")"),["> ".concat(p,"-arrow")]:{right:{_skip_check_:!0,value:v}}}},a?i:{})),(c=!!b.bottom,l={[["&-placement-bottom > ".concat(p,"-arrow"),"&-placement-bottomLeft > ".concat(p,"-arrow"),"&-placement-bottomRight > ".concat(p,"-arrow")].join(",")]:{top:h,transform:"translateY(-100%)"},["&-placement-bottom > ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":v,["> ".concat(p,"-arrow")]:{left:{_skip_check_:!0,value:v}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":"calc(100% - ".concat((0,r.bf)(v),")"),["> ".concat(p,"-arrow")]:{right:{_skip_check_:!0,value:v}}}},c?l:{})),(s=!!b.left,u={[["&-placement-left > ".concat(p,"-arrow"),"&-placement-leftTop > ".concat(p,"-arrow"),"&-placement-leftBottom > ".concat(p,"-arrow")].join(",")]:{right:{_skip_check_:!0,value:h},transform:"translateX(100%) rotate(90deg)"},["&-placement-left > ".concat(p,"-arrow")]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},["&-placement-leftTop > ".concat(p,"-arrow")]:{top:g},["&-placement-leftBottom > ".concat(p,"-arrow")]:{bottom:g}},s?u:{})),(d=!!b.right,f={[["&-placement-right > ".concat(p,"-arrow"),"&-placement-rightTop > ".concat(p,"-arrow"),"&-placement-rightBottom > ".concat(p,"-arrow")].join(",")]:{left:{_skip_check_:!0,value:h},transform:"translateX(-100%) rotate(-90deg)"},["&-placement-right > ".concat(p,"-arrow")]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},["&-placement-rightTop > ".concat(p,"-arrow")]:{top:g},["&-placement-rightBottom > ".concat(p,"-arrow")]:{bottom:g}},d?f:{}))}}},34442:function(e,t,n){"use strict";n.d(t,{W:function(){return a},w:function(){return o}});var r=n(93463);function o(e){let{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,o=t/2,a=1*r/Math.sqrt(2),i=o-r*(1-1/Math.sqrt(2)),c=o-1/Math.sqrt(2)*n,l=r*(Math.sqrt(2)-1)+1/Math.sqrt(2)*n,s=2*o-c,u=2*o-a,d=2*o-0,f=o*Math.sqrt(2)+r*(Math.sqrt(2)-2),p=r*(Math.sqrt(2)-1),m="polygon(".concat(p,"px 100%, 50% ").concat(p,"px, ").concat(2*o-p,"px 100%, ").concat(p,"px 100%)");return{arrowShadowWidth:f,arrowPath:"path('M ".concat(0," ").concat(o," A ").concat(r," ").concat(r," 0 0 0 ").concat(a," ").concat(i," L ").concat(c," ").concat(l," A ").concat(n," ").concat(n," 0 0 1 ").concat(s," ").concat(l," L ").concat(u," ").concat(i," A ").concat(r," ").concat(r," 0 0 0 ").concat(d," ").concat(o," Z')"),arrowPolygon:m}}let a=(e,t,n)=>{let{sizePopupArrow:o,arrowPolygon:a,arrowPath:i,arrowShadowWidth:c,borderRadiusXS:l,calc:s}=e;return{pointerEvents:"none",width:o,height:o,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:o,height:s(o).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[a,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:c,height:c,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:"0 0 ".concat((0,r.bf)(l)," 0")},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}}},25119:function(e,t,n){"use strict";n.d(t,{Mj:function(){return i},u_:function(){return a}});var r=n(2265),o=n(70774);let a={token:o.Z,override:{override:o.Z},hashed:!0},i=r.createContext(a)},53454:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});let r=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"]},57862:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(93463),o=n(57943),a=n(70774),i=n(54558),c=e=>{let t=e,n=e,r=e,o=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?o=4:e>=8&&(o=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:o}},l=e=>{let{controlHeight:t}=e;return{controlHeightSM:.75*t,controlHeightXS:.5*t,controlHeightLG:1.25*t}},s=n(1319),u=e=>{let t=(0,s.Z)(e),n=t.map(e=>e.size),r=t.map(e=>e.lineHeight),o=n[1],a=n[0],i=n[2],c=r[1],l=r[0],u=r[2];return{fontSizeSM:a,fontSize:o,fontSizeLG:i,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:c,lineHeightLG:u,lineHeightSM:l,fontHeight:Math.round(c*o),fontHeightLG:Math.round(u*i),fontHeightSM:Math.round(l*a),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};let d=(e,t)=>new i.t(e).setA(t).toRgbString(),f=(e,t)=>new i.t(e).darken(t).toHexString(),p=e=>{let t=(0,o.R_)(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},m=(e,t)=>{let n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:d(r,.88),colorTextSecondary:d(r,.65),colorTextTertiary:d(r,.45),colorTextQuaternary:d(r,.25),colorFill:d(r,.15),colorFillSecondary:d(r,.06),colorFillTertiary:d(r,.04),colorFillQuaternary:d(r,.02),colorBgSolid:d(r,1),colorBgSolidHover:d(r,.75),colorBgSolidActive:d(r,.95),colorBgLayout:f(n,4),colorBgContainer:f(n,0),colorBgElevated:f(n,0),colorBgSpotlight:d(r,.85),colorBgBlur:"transparent",colorBorder:f(n,15),colorBorderSecondary:f(n,6)}};var g=(0,r.jG)(function(e){o.ez.pink=o.ez.magenta,o.Ti.pink=o.Ti.magenta;let t=Object.keys(a.M).map(t=>{let n=e[t]===o.ez[t]?o.Ti[t]:(0,o.R_)(e[t]);return Array.from({length:10},()=>1).reduce((e,r,o)=>(e["".concat(t,"-").concat(o+1)]=n[o],e["".concat(t).concat(o+1)]=n[o],e),{})}).reduce((e,t)=>e=Object.assign(Object.assign({},e),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),t),function(e,t){let{generateColorPalettes:n,generateNeutralColorPalettes:r}=t,{colorSuccess:o,colorWarning:a,colorError:c,colorInfo:l,colorPrimary:s,colorBgBase:u,colorTextBase:d}=e,f=n(s),p=n(o),m=n(a),g=n(c),v=n(l),h=r(u,d),b=n(e.colorLink||e.colorInfo),y=new i.t(g[1]).mix(new i.t(g[3]),50).toHexString();return Object.assign(Object.assign({},h),{colorPrimaryBg:f[1],colorPrimaryBgHover:f[2],colorPrimaryBorder:f[3],colorPrimaryBorderHover:f[4],colorPrimaryHover:f[5],colorPrimary:f[6],colorPrimaryActive:f[7],colorPrimaryTextHover:f[8],colorPrimaryText:f[9],colorPrimaryTextActive:f[10],colorSuccessBg:p[1],colorSuccessBgHover:p[2],colorSuccessBorder:p[3],colorSuccessBorderHover:p[4],colorSuccessHover:p[4],colorSuccess:p[6],colorSuccessActive:p[7],colorSuccessTextHover:p[8],colorSuccessText:p[9],colorSuccessTextActive:p[10],colorErrorBg:g[1],colorErrorBgHover:g[2],colorErrorBgFilledHover:y,colorErrorBgActive:g[3],colorErrorBorder:g[3],colorErrorBorderHover:g[4],colorErrorHover:g[5],colorError:g[6],colorErrorActive:g[7],colorErrorTextHover:g[8],colorErrorText:g[9],colorErrorTextActive:g[10],colorWarningBg:m[1],colorWarningBgHover:m[2],colorWarningBorder:m[3],colorWarningBorderHover:m[4],colorWarningHover:m[4],colorWarning:m[6],colorWarningActive:m[7],colorWarningTextHover:m[8],colorWarningText:m[9],colorWarningTextActive:m[10],colorInfoBg:v[1],colorInfoBgHover:v[2],colorInfoBorder:v[3],colorInfoBorderHover:v[4],colorInfoHover:v[4],colorInfo:v[6],colorInfoActive:v[7],colorInfoTextHover:v[8],colorInfoText:v[9],colorInfoTextActive:v[10],colorLinkHover:b[4],colorLink:b[6],colorLinkActive:b[7],colorBgMask:new i.t("#000").setA(.45).toRgbString(),colorWhite:"#fff"})}(e,{generateColorPalettes:p,generateNeutralColorPalettes:m})),u(e.fontSize)),function(e){let{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}(e)),l(e)),function(e){let{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:o}=e;return Object.assign({motionDurationFast:"".concat((n+t).toFixed(1),"s"),motionDurationMid:"".concat((n+2*t).toFixed(1),"s"),motionDurationSlow:"".concat((n+3*t).toFixed(1),"s"),lineWidthBold:o+1},c(r))}(e))})},70774:function(e,t,n){"use strict";n.d(t,{M:function(){return r}});let r={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},o=Object.assign(Object.assign({},r),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,\n'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',\n'Noto Color Emoji'",fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0});t.Z=o},1319:function(e,t,n){"use strict";function r(e){return(e+8)/e}function o(e){let t=Array.from({length:10}).map((t,n)=>{let r=e*Math.pow(Math.E,(n-1)/5);return 2*Math.floor((n>1?Math.floor(r):Math.ceil(r))/2)});return t[1]=e,t.map(e=>({size:e,lineHeight:r(e)}))}n.d(t,{D:function(){return r},Z:function(){return o}})},84951:function(e,t,n){"use strict";n.d(t,{ZP:function(){return h},NJ:function(){return p}});var r=n(2265),o=n(93463),a=n(25119),i=n(57862),c=n(70774),l=n(54558),s=n(17431),u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function d(e){let{override:t}=e,n=u(e,["override"]),r=Object.assign({},t);Object.keys(c.Z).forEach(e=>{delete r[e]});let o=Object.assign(Object.assign({},n),r);return!1===o.motion&&(o.motionDurationFast="0s",o.motionDurationMid="0s",o.motionDurationSlow="0s"),Object.assign(Object.assign(Object.assign({},o),{colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:(0,s.Z)(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:(0,s.Z)(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:(0,s.Z)(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:3*o.lineWidth,lineWidth:o.lineWidth,controlOutlineWidth:2*o.lineWidth,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:(0,s.Z)(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowSecondary:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTertiary:"\n 0 1px 2px 0 rgba(0, 0, 0, 0.03),\n 0 1px 6px -1px rgba(0, 0, 0, 0.02),\n 0 2px 4px 0 rgba(0, 0, 0, 0.02)\n ",screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:1200,screenXLMin:1200,screenXLMax:1599,screenXXL:1600,screenXXLMin:1600,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:"\n 0 1px 2px -2px ".concat(new l.t("rgba(0, 0, 0, 0.16)").toRgbString(),",\n 0 3px 6px 0 ").concat(new l.t("rgba(0, 0, 0, 0.12)").toRgbString(),",\n 0 5px 12px 4px ").concat(new l.t("rgba(0, 0, 0, 0.09)").toRgbString(),"\n "),boxShadowDrawerRight:"\n -6px 0 16px 0 rgba(0, 0, 0, 0.08),\n -3px 0 6px -4px rgba(0, 0, 0, 0.12),\n -9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerLeft:"\n 6px 0 16px 0 rgba(0, 0, 0, 0.08),\n 3px 0 6px -4px rgba(0, 0, 0, 0.12),\n 9px 0 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerUp:"\n 0 6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowDrawerDown:"\n 0 -6px 16px 0 rgba(0, 0, 0, 0.08),\n 0 -3px 6px -4px rgba(0, 0, 0, 0.12),\n 0 -9px 28px 8px rgba(0, 0, 0, 0.05)\n ",boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),r)}var f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let p={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},m={motionBase:!0,motionUnit:!0},g={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},v=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:o}=t,a=f(t,["override"]),i=Object.assign(Object.assign({},r),{override:o});return i=d(i),a&&Object.entries(a).forEach(e=>{let[t,n]=e,{theme:r}=n,o=f(n,["theme"]),a=o;r&&(a=v(Object.assign(Object.assign({},i),o),{override:o},r)),i[t]=a}),i};function h(){let{token:e,hashed:t,theme:n,override:l,cssVar:s}=r.useContext(a.Mj),u="".concat("5.29.1","-").concat(t||""),f=n||i.Z,[h,b,y]=(0,o.fp)(f,[c.Z,e],{salt:u,override:l,getComputedToken:v,formatToken:d,cssVar:s&&{prefix:s.prefix,key:s.key,unitless:p,ignore:m,preserve:g}});return[f,y,t?b:"",h,s]}},18536:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(53454);function o(e,t){return r.i.reduce((n,r)=>{let o=e["".concat(r,"1")],a=e["".concat(r,"3")],i=e["".concat(r,"6")],c=e["".concat(r,"7")];return Object.assign(Object.assign({},n),t(r,{lightColor:o,lightBorderColor:a,darkColor:i,textColor:c}))},{})}},99320:function(e,t,n){"use strict";n.d(t,{A1:function(){return s},I$:function(){return l},bk:function(){return u}});var r=n(2265),o=n(71140),a=n(71744),i=n(12918),c=n(84951);let{genStyleHooks:l,genComponentStyleHook:s,genSubStyleComponent:u}=(0,o.rb)({usePrefix:()=>{let{getPrefixCls:e,iconPrefixCls:t}=(0,r.useContext)(a.E_);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{let[e,t,n,r,o]=(0,c.ZP)();return{theme:e,realToken:t,hashId:n,token:r,cssVar:o}},useCSP:()=>{let{csp:e}=(0,r.useContext)(a.E_);return null!=e?e:{}},getResetStyles:(e,t)=>{var n;let r=(0,i.Lx)(e);return[r,{"&":r},(0,i.JT)(null!==(n=null==t?void 0:t.prefix.iconPrefixCls)&&void 0!==n?n:a.oR)]},getCommonStyle:i.du,getCompUnitless:()=>c.NJ})},17431:function(e,t,n){"use strict";var r=n(54558);function o(e){return e>=0&&e<=255}t.Z=function(e,t){let{r:n,g:a,b:i,a:c}=new r.t(e).toRgb();if(c<1)return e;let{r:l,g:s,b:u}=new r.t(t).toRgb();for(let e=.01;e<=1;e+=.01){let t=Math.round((n-l*(1-e))/e),c=Math.round((a-s*(1-e))/e),d=Math.round((i-u*(1-e))/e);if(o(t)&&o(c)&&o(d))return new r.t({r:t,g:c,b:d,a:Math.round(100*e)/100}).toRgbString()}return new r.t({r:n,g:a,b:i,a:1}).toRgbString()}},99981:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var r=n(2265),o=n(36760),a=n.n(o),i=n(5769),c=n(50506),l=n(391),s=n(62236),u=n(68710),d=n(92736),f=n(19722),p=n(13613),m=n(95140),g=n(71744),v=n(84951),h=n(93463),b=n(12918),y=n(691),x=n(88260),w=n(34442),E=n(18536),C=n(71140),Z=n(99320);let S=e=>{let{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:o,tooltipBg:a,tooltipBorderRadius:i,zIndexPopup:c,controlHeight:l,boxShadowSecondary:s,paddingSM:u,paddingXS:d,arrowOffsetHorizontal:f,sizePopupArrow:p}=e,m=t(i).add(p).add(f).equal(),g=t(i).mul(2).add(p).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,b.Wf)(e)),{position:"absolute",zIndex:c,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:"var(--valid-offset-x, 50%) var(--arrow-y, 50%)","&-hidden":{display:"none"},"--antd-arrow-background-color":a,["".concat(n,"-inner")]:{minWidth:g,minHeight:l,padding:"".concat((0,h.bf)(e.calc(u).div(2).equal())," ").concat((0,h.bf)(d)),color:"var(--ant-tooltip-color, ".concat(o,")"),textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:i,boxShadow:s,boxSizing:"border-box"},"&-placement-topLeft,&-placement-topRight,&-placement-bottomLeft,&-placement-bottomRight":{minWidth:m},"&-placement-left,&-placement-leftTop,&-placement-leftBottom,&-placement-right,&-placement-rightTop,&-placement-rightBottom":{["".concat(n,"-inner")]:{borderRadius:e.min(i,x.qN)}},["".concat(n,"-content")]:{position:"relative"}}),(0,E.Z)(e,(e,t)=>{let{darkColor:r}=t;return{["&".concat(n,"-").concat(e)]:{["".concat(n,"-inner")]:{backgroundColor:r},["".concat(n,"-arrow")]:{"--antd-arrow-background-color":r}}}})),{"&-rtl":{direction:"rtl"}})},(0,x.ZP)(e,"var(--antd-arrow-background-color)"),{["".concat(n,"-pure")]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},O=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},(0,x.wZ)({contentRadius:e.borderRadius,limitVerticalRadius:!0})),(0,w.w)((0,C.IX)(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)})));function k(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return(0,Z.I$)("Tooltip",e=>{let{borderRadius:t,colorTextLightSolid:n,colorBgSpotlight:r}=e;return[S((0,C.IX)(e,{tooltipMaxWidth:250,tooltipColor:n,tooltipBorderRadius:t,tooltipBg:r})),(0,y._y)(e,"zoom-big-fast")]},O,{resetStyle:!1,injectStyle:t})(e)}var j=n(93350);n(75669);var I=n(11357);let M=e=>e instanceof I.y9?e:new I.y9(e);function R(e,t){let n=(0,j.o2)(t),r=a()({["".concat(e,"-").concat(t)]:t&&n}),o={},i={},c=M(t).toRgb(),l=(.299*c.r+.587*c.g+.114*c.b)/255;return t&&!n&&(o.background=t,o["--ant-tooltip-color"]=l<.5?"#FFF":"#000",i["--antd-arrow-background-color"]=t),{className:r,overlayStyle:o,arrowStyle:i}}var N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);ot.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};let P=r.forwardRef((e,t)=>{var n,o;let{prefixCls:h,openClassName:b,getTooltipContainer:y,color:x,overlayInnerStyle:w,children:E,afterOpenChange:C,afterVisibleChange:Z,destroyTooltipOnHide:S,destroyOnHidden:O,arrow:j=!0,title:I,overlay:M,builtinPlacements:P,arrowPointAtCenter:F=!1,autoAdjustOverflow:T=!0,motion:A,getPopupContainer:_,placement:B="top",mouseEnterDelay:H=.1,mouseLeaveDelay:z=.1,overlayStyle:L,rootClassName:D,overlayClassName:W,styles:V,classNames:q}=e,X=N(e,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),G=!!j,[,U]=(0,v.ZP)(),{getPopupContainer:$,getPrefixCls:K,direction:Y,className:Q,style:J,classNames:ee,styles:et}=(0,g.dj)("tooltip"),en=(0,p.ln)("Tooltip"),er=r.useRef(null),eo=()=>{var e;null===(e=er.current)||void 0===e||e.forceAlign()};r.useImperativeHandle(t,()=>{var e,t;return{forceAlign:eo,forcePopupAlign:()=>{en.deprecated(!1,"forcePopupAlign","forceAlign"),eo()},nativeElement:null===(e=er.current)||void 0===e?void 0:e.nativeElement,popupElement:null===(t=er.current)||void 0===t?void 0:t.popupElement}});let[ea,ei]=(0,c.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(o=e.defaultOpen)&&void 0!==o?o:e.defaultVisible}),ec=!I&&!M&&0!==I,el=r.useMemo(()=>{var e,t;let n=F;return"object"==typeof j&&(n=null!==(t=null!==(e=j.pointAtCenter)&&void 0!==e?e:j.arrowPointAtCenter)&&void 0!==t?t:F),P||(0,d.Z)({arrowPointAtCenter:n,autoAdjustOverflow:T,arrowWidth:G?U.sizePopupArrow:0,borderRadius:U.borderRadius,offset:U.marginXXS,visibleFirst:!0})},[F,j,P,U]),es=r.useMemo(()=>0===I?I:M||I||"",[M,I]),eu=r.createElement(l.Z,{space:!0},"function"==typeof es?es():es),ed=K("tooltip",h),ef=K(),ep=e["data-popover-inject"],em=ea;"open"in e||"visible"in e||!ec||(em=!1);let eg=r.isValidElement(E)&&!(0,f.M2)(E)?E:r.createElement("span",null,E),ev=eg.props,eh=ev.className&&"string"!=typeof ev.className?ev.className:a()(ev.className,b||"".concat(ed,"-open")),[eb,ey,ex]=k(ed,!ep),ew=R(ed,x),eE=ew.arrowStyle,eC=a()(W,{["".concat(ed,"-rtl")]:"rtl"===Y},ew.className,D,ey,ex,Q,ee.root,null==q?void 0:q.root),eZ=a()(ee.body,null==q?void 0:q.body),[eS,eO]=(0,s.Cn)("Tooltip",X.zIndex),ek=r.createElement(i.Z,Object.assign({},X,{zIndex:eS,showArrow:G,placement:B,mouseEnterDelay:H,mouseLeaveDelay:z,prefixCls:ed,classNames:{root:eC,body:eZ},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},eE),et.root),J),L),null==V?void 0:V.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},et.body),w),null==V?void 0:V.body),ew.overlayStyle)},getTooltipContainer:_||y||$,ref:er,builtinPlacements:el,overlay:eu,visible:em,onVisibleChange:t=>{var n,r;ei(!ec&&t),ec||(null===(n=e.onOpenChange)||void 0===n||n.call(e,t),null===(r=e.onVisibleChange)||void 0===r||r.call(e,t))},afterVisibleChange:null!=C?C:Z,arrowContent:r.createElement("span",{className:"".concat(ed,"-arrow-content")}),motion:{motionName:(0,u.m)(ef,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:null!=O?O:!!S}),em?(0,f.Tm)(eg,{className:eh}):eg);return eb(r.createElement(m.Z.Provider,{value:eO},ek))});P._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,className:n,placement:o="top",title:c,color:l,overlayInnerStyle:s}=e,{getPrefixCls:u}=r.useContext(g.E_),d=u("tooltip",t),[f,p,m]=k(d),v=R(d,l),h=v.arrowStyle,b=Object.assign(Object.assign({},s),v.overlayStyle),y=a()(p,m,d,"".concat(d,"-pure"),"".concat(d,"-placement-").concat(o),n,v.className);return f(r.createElement("div",{className:y,style:h},r.createElement("div",{className:"".concat(d,"-arrow")}),r.createElement(i.G,Object.assign({},e,{className:p,prefixCls:d,overlayInnerStyle:b}),c)))};var F=P},99376:function(e,t,n){"use strict";var r=n(35475);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},40257:function(e,t,n){"use strict";var r,o;e.exports=(null==(r=n.g.process)?void 0:r.env)&&"object"==typeof(null==(o=n.g.process)?void 0:o.env)?n.g.process:n(44227)},44227:function(e){!function(){var t={229:function(e){var t,n,r,o=e.exports={};function a(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===a||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:a}catch(e){t=a}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var l=[],s=!1,u=-1;function d(){s&&r&&(s=!1,r.length?l=r.concat(l):u=-1,l.length&&f())}function f(){if(!s){var e=c(d);s=!0;for(var t=l.length;t;){for(r=l,l=[];++u1)for(var n=1;n1?t-1:0),r=1;r=a)return e;switch(e){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch(e){return"[Circular]"}break;default:return e}}):e}function A(e,t){return!!(null==e||"array"===t&&Array.isArray(e)&&!e.length)||("string"===t||"url"===t||"hex"===t||"email"===t||"date"===t||"pattern"===t)&&"string"==typeof e&&!e}function _(e,t,n){var r=0,o=e.length;!function a(i){if(i&&i.length){n(i);return}var c=r;r+=1,c()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},q={integer:function(e){return q.number(e)&&parseInt(e,10)===e},float:function(e){return q.number(e)&&!q.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return new RegExp(e),!0}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"===(0,S.Z)(e)&&!q.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(V.email)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(W())},hex:function(e){return"string"==typeof e&&!!e.match(V.hex)}},X={required:D,whitespace:function(e,t,n,r,o){(/^\s+$/.test(t)||""===t)&&r.push(T(o.messages.whitespace,e.fullField))},type:function(e,t,n,r,o){if(e.required&&void 0===t){D(e,t,n,r,o);return}var a=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(a)>-1?q[a](t)||r.push(T(o.messages.types[a],e.fullField,e.type)):a&&(0,S.Z)(t)!==e.type&&r.push(T(o.messages.types[a],e.fullField,e.type))},range:function(e,t,n,r,o){var a="number"==typeof e.len,i="number"==typeof e.min,c="number"==typeof e.max,l=t,s=null,u="number"==typeof t,d="string"==typeof t,f=Array.isArray(t);if(u?s="number":d?s="string":f&&(s="array"),!s)return!1;f&&(l=t.length),d&&(l=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),a?l!==e.len&&r.push(T(o.messages[s].len,e.fullField,e.len)):i&&!c&&le.max?r.push(T(o.messages[s].max,e.fullField,e.max)):i&&c&&(le.max)&&r.push(T(o.messages[s].range,e.fullField,e.min,e.max))},enum:function(e,t,n,r,o){e[L]=Array.isArray(e[L])?e[L]:[],-1===e[L].indexOf(t)&&r.push(T(o.messages[L],e.fullField,e[L].join(", ")))},pattern:function(e,t,n,r,o){!e.pattern||(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(T(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"!=typeof e.pattern||new RegExp(e.pattern).test(t)||r.push(T(o.messages.pattern.mismatch,e.fullField,t,e.pattern)))}},G=function(e,t,n,r,o){var a=e.type,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,a)&&!e.required)return n();X.required(e,t,r,i,o,a),A(t,a)||X.type(e,t,r,i,o)}n(i)},U={string:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,"string")&&!e.required)return n();X.required(e,t,r,a,o,"string"),A(t,"string")||(X.type(e,t,r,a,o),X.range(e,t,r,a,o),X.pattern(e,t,r,a,o),!0===e.whitespace&&X.whitespace(e,t,r,a,o))}n(a)},method:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.type(e,t,r,a,o)}n(a)},number:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},boolean:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.type(e,t,r,a,o)}n(a)},regexp:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),A(t)||X.type(e,t,r,a,o)}n(a)},integer:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},float:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},array:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();X.required(e,t,r,a,o,"array"),null!=t&&(X.type(e,t,r,a,o),X.range(e,t,r,a,o))}n(a)},object:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.type(e,t,r,a,o)}n(a)},enum:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o),void 0!==t&&X.enum(e,t,r,a,o)}n(a)},pattern:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,"string")&&!e.required)return n();X.required(e,t,r,a,o),A(t,"string")||X.pattern(e,t,r,a,o)}n(a)},date:function(e,t,n,r,o){var a,i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t,"date")&&!e.required)return n();X.required(e,t,r,i,o),!A(t,"date")&&(a=t instanceof Date?t:new Date(t),X.type(e,a,r,i,o),a&&X.range(e,a.getTime(),r,i,o))}n(i)},url:G,hex:G,email:G,required:function(e,t,n,r,o){var a=[],i=Array.isArray(t)?"array":(0,S.Z)(t);X.required(e,t,r,a,o,i),n(a)},any:function(e,t,n,r,o){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(A(t)&&!e.required)return n();X.required(e,t,r,a,o)}n(a)}},$=function(){function e(t){(0,d.Z)(this,e),(0,v.Z)(this,"rules",null),(0,v.Z)(this,"_messages",k),this.define(t)}return(0,f.Z)(e,[{key:"define",value:function(e){var t=this;if(!e)throw Error("Cannot configure a schema with no rules");if("object"!==(0,S.Z)(e)||Array.isArray(e))throw Error("Rules must be an object");this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})}},{key:"messages",value:function(e){return e&&(this._messages=z(O(),e)),this._messages}},{key:"validate",value:function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},a=t,i=r,c=o;if("function"==typeof i&&(c=i,i={}),!this.rules||0===Object.keys(this.rules).length)return c&&c(null,a),Promise.resolve(a);if(i.messages){var l=this.messages();l===k&&(l=O()),z(l,i.messages),i.messages=l}else i.messages=this.messages();var d={};(i.keys||Object.keys(this.rules)).forEach(function(e){var r=n.rules[e],o=a[e];r.forEach(function(r){var i=r;"function"==typeof i.transform&&(a===t&&(a=(0,s.Z)({},a)),null!=(o=a[e]=i.transform(o))&&(i.type=i.type||(Array.isArray(o)?"array":(0,S.Z)(o)))),(i="function"==typeof i?{validator:i}:(0,s.Z)({},i)).validator=n.getValidationMethod(i),i.validator&&(i.field=e,i.fullField=i.fullField||e,i.type=n.getType(i),d[e]=d[e]||[],d[e].push({rule:i,value:o,source:a,field:e}))})});var f={};return function(e,t,n,r,o){if(t.first){var a=new Promise(function(t,a){var i;_((i=[],Object.keys(e).forEach(function(t){i.push.apply(i,(0,u.Z)(e[t]||[]))}),i),n,function(e){return r(e),e.length?a(new B(e,F(e))):t(o)})});return a.catch(function(e){return e}),a}var i=!0===t.firstFields?Object.keys(e):t.firstFields||[],c=Object.keys(e),l=c.length,s=0,d=[],f=new Promise(function(t,a){var f=function(e){if(d.push.apply(d,e),++s===l)return r(d),d.length?a(new B(d,F(d))):t(o)};c.length||(r(d),t(o)),c.forEach(function(t){var r=e[t];-1!==i.indexOf(t)?_(r,n,f):function(e,t,n){var r=[],o=0,a=e.length;function i(e){r.push.apply(r,(0,u.Z)(e||[])),++o===a&&n(r)}e.forEach(function(e){t(e,i)})}(r,n,f)})});return f.catch(function(e){return e}),f}(d,i,function(t,n){var r,o,c,l=t.rule,d=("object"===l.type||"array"===l.type)&&("object"===(0,S.Z)(l.fields)||"object"===(0,S.Z)(l.defaultField));function p(e,t){return(0,s.Z)((0,s.Z)({},t),{},{fullField:"".concat(l.fullField,".").concat(e),fullFields:l.fullFields?[].concat((0,u.Z)(l.fullFields),[e]):[e]})}function m(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=Array.isArray(r)?r:[r];!i.suppressWarning&&o.length&&e.warning("async-validator:",o),o.length&&void 0!==l.message&&(o=[].concat(l.message));var c=o.map(H(l,a));if(i.first&&c.length)return f[l.field]=1,n(c);if(d){if(l.required&&!t.value)return void 0!==l.message?c=[].concat(l.message).map(H(l,a)):i.error&&(c=[i.error(l,T(i.messages.required,l.field))]),n(c);var m={};l.defaultField&&Object.keys(t.value).map(function(e){m[e]=l.defaultField});var g={};Object.keys(m=(0,s.Z)((0,s.Z)({},m),t.rule.fields)).forEach(function(e){var t=m[e],n=Array.isArray(t)?t:[t];g[e]=n.map(p.bind(null,e))});var v=new e(g);v.messages(i.messages),t.rule.options&&(t.rule.options.messages=i.messages,t.rule.options.error=i.error),v.validate(t.value,t.rule.options||i,function(e){var t=[];c&&c.length&&t.push.apply(t,(0,u.Z)(c)),e&&e.length&&t.push.apply(t,(0,u.Z)(e)),n(t.length?t:null)})}else n(c)}if(d=d&&(l.required||!l.required&&t.value),l.field=t.field,l.asyncValidator)r=l.asyncValidator(l,t.value,m,t.source,i);else if(l.validator){try{r=l.validator(l,t.value,m,t.source,i)}catch(e){null===(o=(c=console).error)||void 0===o||o.call(c,e),i.suppressValidatorError||setTimeout(function(){throw e},0),m(e.message)}!0===r?m():!1===r?m("function"==typeof l.message?l.message(l.fullField||l.field):l.message||"".concat(l.fullField||l.field," fails")):r instanceof Array?m(r):r instanceof Error&&m(r.message)}r&&r.then&&r.then(function(){return m()},function(e){return m(e)})},function(e){!function(e){for(var t=[],n={},r=0;r0)){e.next=23;break}return e.next=21,Promise.all(n.map(function(e,n){return ee("".concat(t,".").concat(n),e,f,a,i)}));case 21:return h=e.sent,e.abrupt("return",h.reduce(function(e,t){return[].concat((0,u.Z)(e),(0,u.Z)(t))},[]));case 23:return b=(0,s.Z)((0,s.Z)({},r),{},{name:t,enum:(r.enum||[]).join(", ")},i),y=g.map(function(e){return"string"==typeof e?function(e,t){return e.replace(/\\?\$\{\w+\}/g,function(e){return e.startsWith("\\")?e.slice(1):t[e.slice(2,-1)]})}(e,b):e}),e.abrupt("return",y);case 26:case"end":return e.stop()}},e,null,[[10,15]])}))).apply(this,arguments)}function en(){return(en=(0,l.Z)((0,c.Z)().mark(function e(t){return(0,c.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t).then(function(e){var t;return(t=[]).concat.apply(t,(0,u.Z)(e))}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function er(){return(er=(0,l.Z)((0,c.Z)().mark(function e(t){var n;return(0,c.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=0,e.abrupt("return",new Promise(function(e){t.forEach(function(r){r.then(function(r){r.errors.length&&e([r]),(n+=1)===t.length&&e([])})})}));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}var eo=n(16847);function ea(e){return Z(e)}function ei(e,t){var n={};return t.forEach(function(t){var r=(0,eo.Z)(e,t);n=(0,Q.Z)(n,t,r)}),n}function ec(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e&&e.some(function(e){return el(t,e,n)})}function el(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!e&&!!t&&(!!n||e.length===t.length)&&t.every(function(t,n){return e[n]===t})}function es(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&"object"===(0,S.Z)(t.target)&&e in t.target?t.target[e]:t}function eu(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var o=e[t],a=t-n;return a>0?[].concat((0,u.Z)(e.slice(0,n)),[o],(0,u.Z)(e.slice(n,t)),(0,u.Z)(e.slice(t+1,r))):a<0?[].concat((0,u.Z)(e.slice(0,t)),(0,u.Z)(e.slice(t+1,n+1)),[o],(0,u.Z)(e.slice(n+1,r))):e}var ed=["name"],ef=[];function ep(e,t,n,r,o,a){return"function"==typeof e?e(t,n,"source"in a?{source:a.source}:{}):r!==o}var em=function(e){(0,m.Z)(n,e);var t=(0,g.Z)(n);function n(e){var r;return(0,d.Z)(this,n),r=t.call(this,e),(0,v.Z)((0,p.Z)(r),"state",{resetCount:0}),(0,v.Z)((0,p.Z)(r),"cancelRegisterFunc",null),(0,v.Z)((0,p.Z)(r),"mounted",!1),(0,v.Z)((0,p.Z)(r),"touched",!1),(0,v.Z)((0,p.Z)(r),"dirty",!1),(0,v.Z)((0,p.Z)(r),"validatePromise",void 0),(0,v.Z)((0,p.Z)(r),"prevValidating",void 0),(0,v.Z)((0,p.Z)(r),"errors",ef),(0,v.Z)((0,p.Z)(r),"warnings",ef),(0,v.Z)((0,p.Z)(r),"cancelRegister",function(){var e=r.props,t=e.preserve,n=e.isListField,o=e.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(n,t,ea(o)),r.cancelRegisterFunc=null}),(0,v.Z)((0,p.Z)(r),"getNamePath",function(){var e=r.props,t=e.name,n=e.fieldContext.prefixName;return void 0!==t?[].concat((0,u.Z)(void 0===n?[]:n),(0,u.Z)(t)):[]}),(0,v.Z)((0,p.Z)(r),"getRules",function(){var e=r.props,t=e.rules,n=e.fieldContext;return(void 0===t?[]:t).map(function(e){return"function"==typeof e?e(n):e})}),(0,v.Z)((0,p.Z)(r),"refresh",function(){r.mounted&&r.setState(function(e){return{resetCount:e.resetCount+1}})}),(0,v.Z)((0,p.Z)(r),"metaCache",null),(0,v.Z)((0,p.Z)(r),"triggerMetaEvent",function(e){var t=r.props.onMetaChange;if(t){var n=(0,s.Z)((0,s.Z)({},r.getMeta()),{},{destroy:e});(0,b.Z)(r.metaCache,n)||t(n),r.metaCache=n}else r.metaCache=null}),(0,v.Z)((0,p.Z)(r),"onStoreChange",function(e,t,n){var o=r.props,a=o.shouldUpdate,i=o.dependencies,c=void 0===i?[]:i,l=o.onReset,s=n.store,u=r.getNamePath(),d=r.getValue(e),f=r.getValue(s),p=t&&ec(t,u);switch("valueUpdate"!==n.type||"external"!==n.source||(0,b.Z)(d,f)||(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=ef,r.warnings=ef,r.triggerMetaEvent()),n.type){case"reset":if(!t||p){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=ef,r.warnings=ef,r.triggerMetaEvent(),null==l||l(),r.refresh();return}break;case"remove":if(a&&ep(a,e,s,d,f,n)){r.reRender();return}break;case"setField":var m=n.data;if(p){"touched"in m&&(r.touched=m.touched),"validating"in m&&!("originRCField"in m)&&(r.validatePromise=m.validating?Promise.resolve([]):null),"errors"in m&&(r.errors=m.errors||ef),"warnings"in m&&(r.warnings=m.warnings||ef),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}if("value"in m&&ec(t,u,!0)||a&&!u.length&&ep(a,e,s,d,f,n)){r.reRender();return}break;case"dependenciesUpdate":if(c.map(ea).some(function(e){return ec(n.relatedFields,e)})){r.reRender();return}break;default:if(p||(!c.length||u.length||a)&&ep(a,e,s,d,f,n)){r.reRender();return}}!0===a&&r.reRender()}),(0,v.Z)((0,p.Z)(r),"validateRules",function(e){var t=r.getNamePath(),n=r.getValue(),o=e||{},a=o.triggerName,i=o.validateOnly,d=Promise.resolve().then((0,l.Z)((0,c.Z)().mark(function o(){var i,f,p,m,g,v,h;return(0,c.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r.mounted){o.next=2;break}return o.abrupt("return",[]);case 2:if(p=void 0!==(f=(i=r.props).validateFirst)&&f,m=i.messageVariables,g=i.validateDebounce,v=r.getRules(),a&&(v=v.filter(function(e){return e}).filter(function(e){var t=e.validateTrigger;return!t||Z(t).includes(a)})),!(g&&a)){o.next=10;break}return o.next=8,new Promise(function(e){setTimeout(e,g)});case 8:if(!(r.validatePromise!==d)){o.next=10;break}return o.abrupt("return",[]);case 10:return(h=function(e,t,n,r,o,a){var i,u,d=e.join("."),f=n.map(function(e,t){var n=e.validator,r=(0,s.Z)((0,s.Z)({},e),{},{ruleIndex:t});return n&&(r.validator=function(e,t,r){var o=!1,a=n(e,t,function(){for(var e=arguments.length,t=Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:ef;if(r.validatePromise===d){r.validatePromise=null;var t,n=[],o=[];null===(t=e.forEach)||void 0===t||t.call(e,function(e){var t=e.rule.warningOnly,r=e.errors,a=void 0===r?ef:r;t?o.push.apply(o,(0,u.Z)(a)):n.push.apply(n,(0,u.Z)(a))}),r.errors=n,r.warnings=o,r.triggerMetaEvent(),r.reRender()}}),o.abrupt("return",h);case 13:case"end":return o.stop()}},o)})));return void 0!==i&&i||(r.validatePromise=d,r.dirty=!0,r.errors=ef,r.warnings=ef,r.triggerMetaEvent(),r.reRender()),d}),(0,v.Z)((0,p.Z)(r),"isFieldValidating",function(){return!!r.validatePromise}),(0,v.Z)((0,p.Z)(r),"isFieldTouched",function(){return r.touched}),(0,v.Z)((0,p.Z)(r),"isFieldDirty",function(){return!!r.dirty||void 0!==r.props.initialValue||void 0!==(0,r.props.fieldContext.getInternalHooks(x).getInitialValue)(r.getNamePath())}),(0,v.Z)((0,p.Z)(r),"getErrors",function(){return r.errors}),(0,v.Z)((0,p.Z)(r),"getWarnings",function(){return r.warnings}),(0,v.Z)((0,p.Z)(r),"isListField",function(){return r.props.isListField}),(0,v.Z)((0,p.Z)(r),"isList",function(){return r.props.isList}),(0,v.Z)((0,p.Z)(r),"isPreserve",function(){return r.props.preserve}),(0,v.Z)((0,p.Z)(r),"getMeta",function(){return r.prevValidating=r.isFieldValidating(),{touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:null===r.validatePromise}}),(0,v.Z)((0,p.Z)(r),"getOnlyChild",function(e){if("function"==typeof e){var t=r.getMeta();return(0,s.Z)((0,s.Z)({},r.getOnlyChild(e(r.getControlled(),t,r.props.fieldContext))),{},{isFunction:!0})}var n=(0,h.Z)(e);return 1===n.length&&o.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}}),(0,v.Z)((0,p.Z)(r),"getValue",function(e){var t=r.props.fieldContext.getFieldsValue,n=r.getNamePath();return(0,eo.Z)(e||t(!0),n)}),(0,v.Z)((0,p.Z)(r),"getControlled",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.props,n=t.name,o=t.trigger,a=t.validateTrigger,i=t.getValueFromEvent,c=t.normalize,l=t.valuePropName,u=t.getValueProps,d=t.fieldContext,f=void 0!==a?a:d.validateTrigger,p=r.getNamePath(),m=d.getInternalHooks,g=d.getFieldsValue,h=m(x).dispatch,b=r.getValue(),y=u||function(e){return(0,v.Z)({},l,e)},w=e[o],E=void 0!==n?y(b):{},C=(0,s.Z)((0,s.Z)({},e),E);return C[o]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var e,t=arguments.length,n=Array(t),o=0;o=0&&t<=n.length?(f.keys=[].concat((0,u.Z)(f.keys.slice(0,t)),[f.id],(0,u.Z)(f.keys.slice(t))),o([].concat((0,u.Z)(n.slice(0,t)),[e],(0,u.Z)(n.slice(t))))):(f.keys=[].concat((0,u.Z)(f.keys),[f.id]),o([].concat((0,u.Z)(n),[e]))),f.id+=1},remove:function(e){var t=i(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(f.keys=f.keys.filter(function(e,t){return!n.has(t)}),o(t.filter(function(e,t){return!n.has(t)})))},move:function(e,t){if(e!==t){var n=i();e<0||e>=n.length||t<0||t>=n.length||(f.keys=eu(f.keys,e,t),o(eu(n,e,t)))}}},t)})))},eh=n(26365),eb="__@field_split__";function ey(e){return e.map(function(e){return"".concat((0,S.Z)(e),":").concat(e)}).join(eb)}var ex=function(){function e(){(0,d.Z)(this,e),(0,v.Z)(this,"kvs",new Map)}return(0,f.Z)(e,[{key:"set",value:function(e,t){this.kvs.set(ey(e),t)}},{key:"get",value:function(e){return this.kvs.get(ey(e))}},{key:"update",value:function(e,t){var n=t(this.get(e));n?this.set(e,n):this.delete(e)}},{key:"delete",value:function(e){this.kvs.delete(ey(e))}},{key:"map",value:function(e){return(0,u.Z)(this.kvs.entries()).map(function(t){var n=(0,eh.Z)(t,2),r=n[0],o=n[1];return e({key:r.split(eb).map(function(e){var t=e.match(/^([^:]*):(.*)$/),n=(0,eh.Z)(t,3),r=n[1],o=n[2];return"number"===r?Number(o):o}),value:o})})}},{key:"toJSON",value:function(){var e={};return this.map(function(t){var n=t.key,r=t.value;return e[n.join(".")]=r,null}),e}}]),e}(),ew=["name"],eE=(0,f.Z)(function e(t){var n=this;(0,d.Z)(this,e),(0,v.Z)(this,"formHooked",!1),(0,v.Z)(this,"forceRootUpdate",void 0),(0,v.Z)(this,"subscribable",!0),(0,v.Z)(this,"store",{}),(0,v.Z)(this,"fieldEntities",[]),(0,v.Z)(this,"initialValues",{}),(0,v.Z)(this,"callbacks",{}),(0,v.Z)(this,"validateMessages",null),(0,v.Z)(this,"preserve",null),(0,v.Z)(this,"lastValidatePromise",null),(0,v.Z)(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),(0,v.Z)(this,"getInternalHooks",function(e){return e===x?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):((0,y.ZP)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),(0,v.Z)(this,"useSubscribe",function(e){n.subscribable=e}),(0,v.Z)(this,"prevWithoutPreserves",null),(0,v.Z)(this,"setInitialValues",function(e,t){if(n.initialValues=e||{},t){var r,o=(0,Q.T)(e,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map(function(t){var n=t.key;o=(0,Q.Z)(o,n,(0,eo.Z)(e,n))}),n.prevWithoutPreserves=null,n.updateStore(o)}}),(0,v.Z)(this,"destroyForm",function(e){if(e)n.updateStore({});else{var t=new ex;n.getFieldEntities(!0).forEach(function(e){n.isMergedPreserve(e.isPreserve())||t.set(e.getNamePath(),!0)}),n.prevWithoutPreserves=t}}),(0,v.Z)(this,"getInitialValue",function(e){var t=(0,eo.Z)(n.initialValues,e);return e.length?(0,Q.T)(t):t}),(0,v.Z)(this,"setCallbacks",function(e){n.callbacks=e}),(0,v.Z)(this,"setValidateMessages",function(e){n.validateMessages=e}),(0,v.Z)(this,"setPreserve",function(e){n.preserve=e}),(0,v.Z)(this,"watchList",[]),(0,v.Z)(this,"registerWatch",function(e){return n.watchList.push(e),function(){n.watchList=n.watchList.filter(function(t){return t!==e})}}),(0,v.Z)(this,"notifyWatch",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var t=n.getFieldsValue(),r=n.getFieldsValue(!0);n.watchList.forEach(function(n){n(t,r,e)})}}),(0,v.Z)(this,"timeoutId",null),(0,v.Z)(this,"warningUnhooked",function(){}),(0,v.Z)(this,"updateStore",function(e){n.store=e}),(0,v.Z)(this,"getFieldEntities",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?n.fieldEntities.filter(function(e){return e.getNamePath().length}):n.fieldEntities}),(0,v.Z)(this,"getFieldsMap",function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new ex;return n.getFieldEntities(e).forEach(function(e){var n=e.getNamePath();t.set(n,e)}),t}),(0,v.Z)(this,"getFieldEntitiesForNamePathList",function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map(function(e){var n=ea(e);return t.get(n)||{INVALIDATE_NAME_PATH:ea(e)}})}),(0,v.Z)(this,"getFieldsValue",function(e,t){if(n.warningUnhooked(),!0===e||Array.isArray(e)?(r=e,o=t):e&&"object"===(0,S.Z)(e)&&(a=e.strict,o=e.filter),!0===r&&!o)return n.store;var r,o,a,i=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),c=[];return i.forEach(function(e){var t,n,i,l="INVALIDATE_NAME_PATH"in e?e.INVALIDATE_NAME_PATH:e.getNamePath();if(a){if(null!==(i=e.isList)&&void 0!==i&&i.call(e))return}else if(!r&&null!==(t=(n=e).isListField)&&void 0!==t&&t.call(n))return;if(o){var s="getMeta"in e?e.getMeta():null;o(s)&&c.push(l)}else c.push(l)}),ei(n.store,c.map(ea))}),(0,v.Z)(this,"getFieldValue",function(e){n.warningUnhooked();var t=ea(e);return(0,eo.Z)(n.store,t)}),(0,v.Z)(this,"getFieldsError",function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map(function(t,n){return!t||"INVALIDATE_NAME_PATH"in t?{name:ea(e[n]),errors:[],warnings:[]}:{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}})}),(0,v.Z)(this,"getFieldError",function(e){n.warningUnhooked();var t=ea(e);return n.getFieldsError([t])[0].errors}),(0,v.Z)(this,"getFieldWarning",function(e){n.warningUnhooked();var t=ea(e);return n.getFieldsError([t])[0].warnings}),(0,v.Z)(this,"isFieldsTouched",function(){n.warningUnhooked();for(var e,t=arguments.length,r=Array(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=new ex,o=n.getFieldEntities(!0);o.forEach(function(e){var t=e.props.initialValue,n=e.getNamePath();if(void 0!==t){var o=r.get(n)||new Set;o.add({entity:e,value:t}),r.set(n,o)}}),t.entities?e=t.entities:t.namePathList?(e=[],t.namePathList.forEach(function(t){var n,o=r.get(t);o&&(n=e).push.apply(n,(0,u.Z)((0,u.Z)(o).map(function(e){return e.entity})))})):e=o,function(e){e.forEach(function(e){if(void 0!==e.props.initialValue){var o=e.getNamePath();if(void 0!==n.getInitialValue(o))(0,y.ZP)(!1,"Form already set 'initialValues' with path '".concat(o.join("."),"'. Field can not overwrite it."));else{var a=r.get(o);if(a&&a.size>1)(0,y.ZP)(!1,"Multiple Field with path '".concat(o.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(a){var i=n.getFieldValue(o);e.isListField()||t.skipExist&&void 0!==i||n.updateStore((0,Q.Z)(n.store,o,(0,u.Z)(a)[0].value))}}}})}(e)}),(0,v.Z)(this,"resetFields",function(e){n.warningUnhooked();var t=n.store;if(!e){n.updateStore((0,Q.T)(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(t,null,{type:"reset"}),n.notifyWatch();return}var r=e.map(ea);r.forEach(function(e){var t=n.getInitialValue(e);n.updateStore((0,Q.Z)(n.store,e,t))}),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"}),n.notifyWatch(r)}),(0,v.Z)(this,"setFields",function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach(function(e){var o=e.name,a=(0,i.Z)(e,ew),c=ea(o);r.push(c),"value"in a&&n.updateStore((0,Q.Z)(n.store,c,a.value)),n.notifyObservers(t,[c],{type:"setField",data:e})}),n.notifyWatch(r)}),(0,v.Z)(this,"getFields",function(){return n.getFieldEntities(!0).map(function(e){var t=e.getNamePath(),r=e.getMeta(),o=(0,s.Z)((0,s.Z)({},r),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(o,"originRCField",{value:!0}),o})}),(0,v.Z)(this,"initEntityValue",function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===(0,eo.Z)(n.store,r)&&n.updateStore((0,Q.Z)(n.store,r,t))}}),(0,v.Z)(this,"isMergedPreserve",function(e){var t=void 0!==e?e:n.preserve;return null==t||t}),(0,v.Z)(this,"registerField",function(e){n.fieldEntities.push(e);var t=e.getNamePath();if(n.notifyWatch([t]),void 0!==e.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(r,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,o){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(t){return t!==e}),!n.isMergedPreserve(o)&&(!r||a.length>1)){var i=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==i&&n.fieldEntities.every(function(e){return!el(e.getNamePath(),t)})){var c=n.store;n.updateStore((0,Q.Z)(c,t,i,!0)),n.notifyObservers(c,[t],{type:"remove"}),n.triggerDependenciesUpdate(c,t)}}n.notifyWatch([t])}}),(0,v.Z)(this,"dispatch",function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var o=e.namePath,a=e.triggerName;n.validateFields([o],{triggerName:a})}}),(0,v.Z)(this,"notifyObservers",function(e,t,r){if(n.subscribable){var o=(0,s.Z)((0,s.Z)({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(n){(0,n.onStoreChange)(e,t,o)})}else n.forceRootUpdate()}),(0,v.Z)(this,"triggerDependenciesUpdate",function(e,t){var r=n.getDependencyChildrenFields(t);return r.length&&n.validateFields(r),n.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t].concat((0,u.Z)(r))}),r}),(0,v.Z)(this,"updateValue",function(e,t){var r=ea(e),o=n.store;n.updateStore((0,Q.Z)(n.store,r,t)),n.notifyObservers(o,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var a=n.triggerDependenciesUpdate(o,r),i=n.callbacks.onValuesChange;i&&i(ei(n.store,[r]),n.getFieldsValue()),n.triggerOnFieldsChange([r].concat((0,u.Z)(a)))}),(0,v.Z)(this,"setFieldsValue",function(e){n.warningUnhooked();var t=n.store;if(e){var r=(0,Q.T)(n.store,e);n.updateStore(r)}n.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),(0,v.Z)(this,"setFieldValue",function(e,t){n.setFields([{name:e,value:t,errors:[],warnings:[]}])}),(0,v.Z)(this,"getDependencyChildrenFields",function(e){var t=new Set,r=[],o=new ex;return n.getFieldEntities().forEach(function(e){(e.props.dependencies||[]).forEach(function(t){var n=ea(t);o.update(n,function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t})})}),function e(n){(o.get(n)||new Set).forEach(function(n){if(!t.has(n)){t.add(n);var o=n.getNamePath();n.isFieldDirty()&&o.length&&(r.push(o),e(o))}})}(e),r}),(0,v.Z)(this,"triggerOnFieldsChange",function(e,t){var r=n.callbacks.onFieldsChange;if(r){var o=n.getFields();if(t){var a=new ex;t.forEach(function(e){var t=e.name,n=e.errors;a.set(t,n)}),o.forEach(function(e){e.errors=a.get(e.name)||e.errors})}var i=o.filter(function(t){return ec(e,t.name)});i.length&&r(i,o)}}),(0,v.Z)(this,"validateFields",function(e,t){n.warningUnhooked(),Array.isArray(e)||"string"==typeof e||"string"==typeof t?(i=e,c=t):c=e;var r,o,a,i,c,l=!!i,d=l?i.map(ea):[],f=[],p=String(Date.now()),m=new Set,g=c||{},v=g.recursive,h=g.dirty;n.getFieldEntities(!0).forEach(function(e){if(l||d.push(e.getNamePath()),e.props.rules&&e.props.rules.length&&(!h||e.isFieldDirty())){var t=e.getNamePath();if(m.add(t.join(p)),!l||ec(d,t,v)){var r=e.validateRules((0,s.Z)({validateMessages:(0,s.Z)((0,s.Z)({},Y),n.validateMessages)},c));f.push(r.then(function(){return{name:t,errors:[],warnings:[]}}).catch(function(e){var n,r=[],o=[];return(null===(n=e.forEach)||void 0===n||n.call(e,function(e){var t=e.rule.warningOnly,n=e.errors;t?o.push.apply(o,(0,u.Z)(n)):r.push.apply(r,(0,u.Z)(n))}),r.length)?Promise.reject({name:t,errors:r,warnings:o}):{name:t,errors:r,warnings:o}}))}}});var b=(r=!1,o=f.length,a=[],f.length?new Promise(function(e,t){f.forEach(function(n,i){n.catch(function(e){return r=!0,e}).then(function(n){o-=1,a[i]=n,o>0||(r&&t(a),e(a))})})}):Promise.resolve([]));n.lastValidatePromise=b,b.catch(function(e){return e}).then(function(e){var t=e.map(function(e){return e.name});n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)});var y=b.then(function(){return n.lastValidatePromise===b?Promise.resolve(n.getFieldsValue(d)):Promise.reject([])}).catch(function(e){var t=e.filter(function(e){return e&&e.errors.length});return Promise.reject({values:n.getFieldsValue(d),errorFields:t,outOfDate:n.lastValidatePromise!==b})});y.catch(function(e){return e});var x=d.filter(function(e){return m.has(e.join(p))});return n.triggerOnFieldsChange(x),y}),(0,v.Z)(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(e){console.error(e)}}).catch(function(e){var t=n.callbacks.onFinishFailed;t&&t(e)})}),this.forceRootUpdate=t}),eC=function(e){var t=o.useRef(),n=o.useState({}),r=(0,eh.Z)(n,2)[1];if(!t.current){if(e)t.current=e;else{var a=new eE(function(){r({})});t.current=a.getForm()}}return[t.current]},eZ=o.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),eS=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,a=e.children,i=o.useContext(eZ),c=o.useRef({});return o.createElement(eZ.Provider,{value:(0,s.Z)((0,s.Z)({},i),{},{validateMessages:(0,s.Z)((0,s.Z)({},i.validateMessages),t),triggerFormChange:function(e,t){n&&n(e,{changedFields:t,forms:c.current}),i.triggerFormChange(e,t)},triggerFormFinish:function(e,t){r&&r(e,{values:t,forms:c.current}),i.triggerFormFinish(e,t)},registerForm:function(e,t){e&&(c.current=(0,s.Z)((0,s.Z)({},c.current),{},(0,v.Z)({},e,t))),i.registerForm(e,t)},unregisterForm:function(e){var t=(0,s.Z)({},c.current);delete t[e],c.current=t,i.unregisterForm(e)}})},a)},eO=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"];function ek(e){try{return JSON.stringify(e)}catch(e){return Math.random()}}var ej=function(){},eI=function(){for(var e=arguments.length,t=Array(e),n=0;n1?t-1:0),o=1;oea;(0,s.useImperativeHandle)(t,function(){var e;return{focus:U,blur:function(){var e;null===(e=X.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=X.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=X.current)||void 0===e||e.select()},input:X.current,nativeElement:(null===(e=G.current)||void 0===e?void 0:e.nativeElement)||X.current}}),(0,s.useEffect)(function(){q.current&&(q.current=!1),W(function(e){return(!e||!O)&&e})},[O]);var el=function(e,t,n){var r,o,a=t;if(!V.current&&eo.exceedFormatter&&eo.max&&eo.strategy(t)>eo.max)a=eo.exceedFormatter(t,{max:eo.max}),t!==a&&er([(null===(r=X.current)||void 0===r?void 0:r.selectionStart)||0,(null===(o=X.current)||void 0===o?void 0:o.selectionEnd)||0]);else if("compositionEnd"===n.source)return;Q(a),X.current&&(0,u.rJ)(X.current,e,c,a)};(0,s.useEffect)(function(){if(en){var e;null===(e=X.current)||void 0===e||e.setSelectionRange.apply(e,(0,f.Z)(en))}},[en]);var es=ec&&"".concat(S,"-out-of-range");return s.createElement(d,(0,o.Z)({},H,{prefixCls:S,className:l()(j,es),handleReset:function(e){Q(""),U(),X.current&&(0,u.rJ)(X.current,e,c)},value:J,focused:D,triggerFocus:U,suffix:function(){var e=Number(ea)>0;if(M||eo.show){var t=eo.showFormatter?eo.showFormatter({value:J,count:ei,maxLength:ea}):"".concat(ei).concat(e?" / ".concat(ea):"");return s.createElement(s.Fragment,null,eo.show&&s.createElement("span",{className:l()("".concat(S,"-show-count-suffix"),(0,a.Z)({},"".concat(S,"-show-count-has-suffix"),!!M),null==T?void 0:T.count),style:(0,r.Z)({},null==A?void 0:A.count)},t),M)}return null}(),disabled:O,classes:F,classNames:T,styles:A,ref:G}),(n=(0,v.Z)(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]),s.createElement("input",(0,o.Z)({autoComplete:i},n,{onChange:function(e){el(e,e.target.value,{source:"change"})},onFocus:function(e){W(!0),null==y||y(e)},onBlur:function(e){q.current&&(q.current=!1),W(!1),null==x||x(e)},onKeyDown:function(e){w&&"Enter"===e.key&&!q.current&&(q.current=!0,w(e)),null==E||E(e)},onKeyUp:function(e){"Enter"===e.key&&(q.current=!1),null==C||C(e)},className:l()(S,(0,a.Z)({},"".concat(S,"-disabled"),O),null==T?void 0:T.input),style:null==A?void 0:A.input,ref:X,size:k,type:void 0===P?"text":P,onCompositionStart:function(e){V.current=!0,null==_||_(e)},onCompositionEnd:function(e){V.current=!1,el(e,e.currentTarget.value,{source:"compositionEnd"}),null==B||B(e)}}))))})},55041:function(e,t,n){"use strict";function r(e){return!!(e.addonBefore||e.addonAfter)}function o(e){return!!(e.prefix||e.suffix||e.allowClear)}function a(e,t,n){var r=t.cloneNode(!0),o=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,"number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},o}function i(e,t,n,r){if(n){var o=t;if("click"===t.type){n(o=a(t,e,""));return}if("file"!==e.type&&void 0!==r){n(o=a(t,e,r));return}n(o)}}function c(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}n.d(t,{He:function(){return r},X3:function(){return o},nH:function(){return c},rJ:function(){return i}})},66632:function(e,t,n){"use strict";n.d(t,{V4:function(){return eg},zt:function(){return x},ZP:function(){return ev}});var r,o,a,i,c,l=n(11993),s=n(31686),u=n(26365),d=n(41154),f=n(36760),p=n.n(f),m=n(2868),g=n(28791),v=n(2265),h=n(6989),b=["children"],y=v.createContext({});function x(e){var t=e.children,n=(0,h.Z)(e,b);return v.createElement(y.Provider,{value:n},t)}var w=n(76405),E=n(25049),C=n(41690),Z=n(15900),S=function(e){(0,C.Z)(n,e);var t=(0,Z.Z)(n);function n(){return(0,w.Z)(this,n),t.apply(this,arguments)}return(0,E.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(v.Component),O=n(74126),k=n(69819),j=n(58525),I="none",M="appear",R="enter",N="leave",P="none",F="prepare",T="start",A="active",_="prepared",B=n(94981);function H(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}var z=(r=(0,B.Z)(),o="undefined"!=typeof window?window:{},a={animationend:H("Animation","AnimationEnd"),transitionend:H("Transition","TransitionEnd")},!r||("AnimationEvent"in o||delete a.animationend.animation,"TransitionEvent"in o||delete a.transitionend.transition),a),L={};(0,B.Z)()&&(L=document.createElement("div").style);var D={};function W(e){if(D[e])return D[e];var t=z[e];if(t)for(var n=Object.keys(t),r=n.length,o=0;o1&&void 0!==arguments[1]?arguments[1]:2;t();var a=(0,Q.Z)(function(){o<=1?r({isCanceled:function(){return a!==e.current}}):n(r,o-1)});e.current=a},t]},ee=[F,T,A,"end"],et=[F,_];function en(e){return e===A||"end"===e}var er=function(e,t,n){var r=(0,k.Z)(P),o=(0,u.Z)(r,2),a=o[0],i=o[1],c=J(),l=(0,u.Z)(c,2),s=l[0],d=l[1],f=t?et:ee;return Y(function(){if(a!==P&&"end"!==a){var e=f.indexOf(a),t=f[e+1],r=n(a);!1===r?i(t,!0):t&&s(function(e){function n(){e.isCanceled()||i(t,!0)}!0===r?n():Promise.resolve(r).then(n)})}},[e,a]),v.useEffect(function(){return function(){d()}},[]),[function(){i(F,!0)},a]},eo=(i=X,"object"===(0,d.Z)(X)&&(i=X.transitionSupport),(c=v.forwardRef(function(e,t){var n=e.visible,r=void 0===n||n,o=e.removeOnLeave,a=void 0===o||o,c=e.forceRender,d=e.children,f=e.motionName,h=e.leavedClassName,b=e.eventProps,x=v.useContext(y).motion,w=!!(e.motionName&&i&&!1!==x),E=(0,v.useRef)(),C=(0,v.useRef)(),Z=function(e,t,n,r){var o,a,i,c=r.motionEnter,d=void 0===c||c,f=r.motionAppear,p=void 0===f||f,m=r.motionLeave,g=void 0===m||m,h=r.motionDeadline,b=r.motionLeaveImmediately,y=r.onAppearPrepare,x=r.onEnterPrepare,w=r.onLeavePrepare,E=r.onAppearStart,C=r.onEnterStart,Z=r.onLeaveStart,S=r.onAppearActive,P=r.onEnterActive,B=r.onLeaveActive,H=r.onAppearEnd,z=r.onEnterEnd,L=r.onLeaveEnd,D=r.onVisibleChanged,W=(0,k.Z)(),V=(0,u.Z)(W,2),q=V[0],X=V[1],G=(o=v.useReducer(function(e){return e+1},0),a=(0,u.Z)(o,2)[1],i=v.useRef(I),[(0,j.Z)(function(){return i.current}),(0,j.Z)(function(e){i.current="function"==typeof e?e(i.current):e,a()})]),U=(0,u.Z)(G,2),$=U[0],Q=U[1],J=(0,k.Z)(null),ee=(0,u.Z)(J,2),et=ee[0],eo=ee[1],ea=$(),ei=(0,v.useRef)(!1),ec=(0,v.useRef)(null),el=(0,v.useRef)(!1);function es(){Q(I),eo(null,!0)}var eu=(0,O.zX)(function(e){var t,r=$();if(r!==I){var o=n();if(!e||e.deadline||e.target===o){var a=el.current;r===M&&a?t=null==H?void 0:H(o,e):r===R&&a?t=null==z?void 0:z(o,e):r===N&&a&&(t=null==L?void 0:L(o,e)),a&&!1!==t&&es()}}}),ed=K(eu),ef=(0,u.Z)(ed,1)[0],ep=function(e){switch(e){case M:return(0,l.Z)((0,l.Z)((0,l.Z)({},F,y),T,E),A,S);case R:return(0,l.Z)((0,l.Z)((0,l.Z)({},F,x),T,C),A,P);case N:return(0,l.Z)((0,l.Z)((0,l.Z)({},F,w),T,Z),A,B);default:return{}}},em=v.useMemo(function(){return ep(ea)},[ea]),eg=er(ea,!e,function(e){if(e===F){var t,r=em[F];return!!r&&r(n())}return eb in em&&eo((null===(t=em[eb])||void 0===t?void 0:t.call(em,n(),null))||null),eb===A&&ea!==I&&(ef(n()),h>0&&(clearTimeout(ec.current),ec.current=setTimeout(function(){eu({deadline:!0})},h))),eb===_&&es(),!0}),ev=(0,u.Z)(eg,2),eh=ev[0],eb=ev[1],ey=en(eb);el.current=ey;var ex=(0,v.useRef)(null);Y(function(){if(!ei.current||ex.current!==t){X(t);var n,r=ei.current;ei.current=!0,!r&&t&&p&&(n=M),r&&t&&d&&(n=R),(r&&!t&&g||!r&&b&&!t&&g)&&(n=N);var o=ep(n);n&&(e||o[F])?(Q(n),eh()):Q(I),ex.current=t}},[t]),(0,v.useEffect)(function(){(ea!==M||p)&&(ea!==R||d)&&(ea!==N||g)||Q(I)},[p,d,g]),(0,v.useEffect)(function(){return function(){ei.current=!1,clearTimeout(ec.current)}},[]);var ew=v.useRef(!1);(0,v.useEffect)(function(){q&&(ew.current=!0),void 0!==q&&ea===I&&((ew.current||q)&&(null==D||D(q)),ew.current=!0)},[q,ea]);var eE=et;return em[F]&&eb===T&&(eE=(0,s.Z)({transition:"none"},eE)),[ea,eb,eE,null!=q?q:t]}(w,r,function(){try{return E.current instanceof HTMLElement?E.current:(0,m.ZP)(C.current)}catch(e){return null}},e),P=(0,u.Z)(Z,4),B=P[0],H=P[1],z=P[2],L=P[3],D=v.useRef(L);L&&(D.current=!0);var W=v.useCallback(function(e){E.current=e,(0,g.mH)(t,e)},[t]),V=(0,s.Z)((0,s.Z)({},b),{},{visible:r});if(d){if(B===I)q=L?d((0,s.Z)({},V),W):!a&&D.current&&h?d((0,s.Z)((0,s.Z)({},V),{},{className:h}),W):!c&&(a||h)?null:d((0,s.Z)((0,s.Z)({},V),{},{style:{display:"none"}}),W);else{H===F?X="prepare":en(H)?X="active":H===T&&(X="start");var q,X,G=$(f,"".concat(B,"-").concat(X));q=d((0,s.Z)((0,s.Z)({},V),{},{className:p()($(f,B),(0,l.Z)((0,l.Z)({},G,G&&X),f,"string"==typeof f)),style:z}),W)}}else q=null;return v.isValidElement(q)&&(0,g.Yr)(q)&&!(0,g.C4)(q)&&(q=v.cloneElement(q,{ref:W})),v.createElement(S,{ref:C},q)})).displayName="CSSMotion",c),ea=n(1119),ei=n(63496),ec="keep",el="remove",es="removed";function eu(e){var t;return t=e&&"object"===(0,d.Z)(e)&&"key"in e?e:{key:e},(0,s.Z)((0,s.Z)({},t),{},{key:String(t.key)})}function ed(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(eu)}var ef=["component","children","onVisibleChanged","onAllRemoved"],ep=["status"],em=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"],eg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eo,n=function(e){(0,C.Z)(r,e);var n=(0,Z.Z)(r);function r(){var e;(0,w.Z)(this,r);for(var t=arguments.length,o=Array(t),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,a=ed(e),i=ed(t);a.forEach(function(e){for(var t=!1,a=r;a1}).forEach(function(e){(n=n.filter(function(t){var n=t.key,r=t.status;return n!==e||r!==el})).forEach(function(t){t.key===e&&(t.status=ec)})}),n})(r,ed(n)).filter(function(e){var t=r.find(function(t){var n=t.key;return e.key===n});return!t||t.status!==es||e.status!==el})}}}]),r}(v.Component);return(0,l.Z)(n,"defaultProps",{component:"div"}),n}(X),ev=eo},49283:function(e,t,n){"use strict";n.d(t,{qX:function(){return h},JB:function(){return y},lm:function(){return j}});var r=n(83145),o=n(26365),a=n(6989),i=n(2265),c=n(31686),l=n(54887),s=n(1119),u=n(11993),d=n(36760),f=n.n(d),p=n(66632),m=n(41154),g=n(95814),v=n(18242),h=i.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,a=e.className,c=e.duration,l=void 0===c?4.5:c,d=e.showProgress,p=e.pauseOnHover,h=void 0===p||p,b=e.eventKey,y=e.content,x=e.closable,w=e.closeIcon,E=void 0===w?"x":w,C=e.props,Z=e.onClick,S=e.onNoticeClose,O=e.times,k=e.hovering,j=i.useState(!1),I=(0,o.Z)(j,2),M=I[0],R=I[1],N=i.useState(0),P=(0,o.Z)(N,2),F=P[0],T=P[1],A=i.useState(0),_=(0,o.Z)(A,2),B=_[0],H=_[1],z=k||M,L=l>0&&d,D=function(){S(b)};i.useEffect(function(){if(!z&&l>0){var e=Date.now()-B,t=setTimeout(function(){D()},1e3*l-B);return function(){h&&clearTimeout(t),H(Date.now()-e)}}},[l,z,O]),i.useEffect(function(){if(!z&&L&&(h||0===B)){var e,t=performance.now();return function n(){cancelAnimationFrame(e),e=requestAnimationFrame(function(e){var r=Math.min((e+B-t)/(1e3*l),1);T(100*r),r<1&&n()})}(),function(){h&&cancelAnimationFrame(e)}}},[l,B,z,L,O]);var W=i.useMemo(function(){return"object"===(0,m.Z)(x)&&null!==x?x:x?{closeIcon:E}:{}},[x,E]),V=(0,v.Z)(W,!0),q=100-(!F||F<0?0:F>100?100:F),X="".concat(n,"-notice");return i.createElement("div",(0,s.Z)({},C,{ref:t,className:f()(X,a,(0,u.Z)({},"".concat(X,"-closable"),x)),style:r,onMouseEnter:function(e){var t;R(!0),null==C||null===(t=C.onMouseEnter)||void 0===t||t.call(C,e)},onMouseLeave:function(e){var t;R(!1),null==C||null===(t=C.onMouseLeave)||void 0===t||t.call(C,e)},onClick:Z}),i.createElement("div",{className:"".concat(X,"-content")},y),x&&i.createElement("a",(0,s.Z)({tabIndex:0,className:"".concat(X,"-close"),onKeyDown:function(e){("Enter"===e.key||"Enter"===e.code||e.keyCode===g.Z.ENTER)&&D()},"aria-label":"Close"},V,{onClick:function(e){e.preventDefault(),e.stopPropagation(),D()}}),W.closeIcon),L&&i.createElement("progress",{className:"".concat(X,"-progress"),max:"100",value:q},q+"%"))}),b=i.createContext({}),y=function(e){var t=e.children,n=e.classNames;return i.createElement(b.Provider,{value:{classNames:n}},t)},x=function(e){var t,n,r,o={offset:8,threshold:3,gap:16};return e&&"object"===(0,m.Z)(e)&&(o.offset=null!==(t=e.offset)&&void 0!==t?t:8,o.threshold=null!==(n=e.threshold)&&void 0!==n?n:3,o.gap=null!==(r=e.gap)&&void 0!==r?r:16),[!!e,o]},w=["className","style","classNames","styles"],E=function(e){var t=e.configList,n=e.placement,l=e.prefixCls,d=e.className,m=e.style,g=e.motion,v=e.onAllNoticeRemoved,y=e.onNoticeClose,E=e.stack,C=(0,i.useContext)(b).classNames,Z=(0,i.useRef)({}),S=(0,i.useState)(null),O=(0,o.Z)(S,2),k=O[0],j=O[1],I=(0,i.useState)([]),M=(0,o.Z)(I,2),R=M[0],N=M[1],P=t.map(function(e){return{config:e,key:String(e.key)}}),F=x(E),T=(0,o.Z)(F,2),A=T[0],_=T[1],B=_.offset,H=_.threshold,z=_.gap,L=A&&(R.length>0||P.length<=H),D="function"==typeof g?g(n):g;return(0,i.useEffect)(function(){A&&R.length>1&&N(function(e){return e.filter(function(e){return P.some(function(t){return e===t.key})})})},[R,P,A]),(0,i.useEffect)(function(){var e,t;A&&Z.current[null===(e=P[P.length-1])||void 0===e?void 0:e.key]&&j(Z.current[null===(t=P[P.length-1])||void 0===t?void 0:t.key])},[P,A]),i.createElement(p.V4,(0,s.Z)({key:n,className:f()(l,"".concat(l,"-").concat(n),null==C?void 0:C.list,d,(0,u.Z)((0,u.Z)({},"".concat(l,"-stack"),!!A),"".concat(l,"-stack-expanded"),L)),style:m,keys:P,motionAppear:!0},D,{onAllRemoved:function(){v(n)}}),function(e,t){var o=e.config,u=e.className,d=e.style,p=e.index,m=o.key,g=o.times,v=String(m),b=o.className,x=o.style,E=o.classNames,S=o.styles,O=(0,a.Z)(o,w),j=P.findIndex(function(e){return e.key===v}),I={};if(A){var M=P.length-1-(j>-1?j:p-1),F="top"===n||"bottom"===n?"-50%":"0";if(M>0){I.height=L?null===(T=Z.current[v])||void 0===T?void 0:T.offsetHeight:null==k?void 0:k.offsetHeight;for(var T,_,H,D,W=0,V=0;V-1?Z.current[v]=e:delete Z.current[v]},prefixCls:l,classNames:E,styles:S,className:f()(b,null==C?void 0:C.notice),style:x,times:g,key:m,eventKey:m,onNoticeClose:y,hovering:A&&R.length>0})))})},C=i.forwardRef(function(e,t){var n=e.prefixCls,a=void 0===n?"rc-notification":n,s=e.container,u=e.motion,d=e.maxCount,f=e.className,p=e.style,m=e.onAllRemoved,g=e.stack,v=e.renderNotifications,h=i.useState([]),b=(0,o.Z)(h,2),y=b[0],x=b[1],w=function(e){var t,n=y.find(function(t){return t.key===e});null==n||null===(t=n.onClose)||void 0===t||t.call(n),x(function(t){return t.filter(function(t){return t.key!==e})})};i.useImperativeHandle(t,function(){return{open:function(e){x(function(t){var n,o=(0,r.Z)(t),a=o.findIndex(function(t){return t.key===e.key}),i=(0,c.Z)({},e);return a>=0?(i.times=((null===(n=t[a])||void 0===n?void 0:n.times)||0)+1,o[a]=i):(i.times=0,o.push(i)),d>0&&o.length>d&&(o=o.slice(-d)),o})},close:function(e){w(e)},destroy:function(){x([])}}});var C=i.useState({}),Z=(0,o.Z)(C,2),S=Z[0],O=Z[1];i.useEffect(function(){var e={};y.forEach(function(t){var n=t.placement,r=void 0===n?"topRight":n;r&&(e[r]=e[r]||[],e[r].push(t))}),Object.keys(S).forEach(function(t){e[t]=e[t]||[]}),O(e)},[y]);var k=function(e){O(function(t){var n=(0,c.Z)({},t);return(n[e]||[]).length||delete n[e],n})},j=i.useRef(!1);if(i.useEffect(function(){Object.keys(S).length>0?j.current=!0:j.current&&(null==m||m(),j.current=!1)},[S]),!s)return null;var I=Object.keys(S);return(0,l.createPortal)(i.createElement(i.Fragment,null,I.map(function(e){var t=S[e],n=i.createElement(E,{key:e,configList:t,placement:e,prefixCls:a,className:null==f?void 0:f(e),style:null==p?void 0:p(e),motion:u,onNoticeClose:w,onAllNoticeRemoved:k,stack:g});return v?v(n,{prefixCls:a,key:e}):n})),s)}),Z=n(74126),S=["getContainer","motion","prefixCls","maxCount","className","style","onAllRemoved","stack","renderNotifications"],O=function(){return document.body},k=0;function j(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getContainer,n=void 0===t?O:t,c=e.motion,l=e.prefixCls,s=e.maxCount,u=e.className,d=e.style,f=e.onAllRemoved,p=e.stack,m=e.renderNotifications,g=(0,a.Z)(e,S),v=i.useState(),h=(0,o.Z)(v,2),b=h[0],y=h[1],x=i.useRef(),w=i.createElement(C,{container:b,ref:x,prefixCls:l,motion:c,maxCount:s,className:u,style:d,onAllRemoved:f,stack:p,renderNotifications:m}),E=i.useState([]),j=(0,o.Z)(E,2),I=j[0],M=j[1],R=(0,Z.zX)(function(e){var t=function(){for(var e={},t=arguments.length,n=Array(t),r=0;rN,eP=(0,c.useMemo)(function(){var e=g;return eM?e=null===q&&L?g:g.slice(0,Math.min(g.length,G/j)):"number"==typeof N&&(e=g.slice(0,N)),e},[g,j,q,N,eM]),eF=(0,c.useMemo)(function(){return eM?g.slice(eE+1):g.slice(eP.length)},[g,eP,eM,eE]),eT=(0,c.useCallback)(function(e,t){var n;return"function"==typeof E?E(e):null!==(n=E&&(null==e?void 0:e[E]))&&void 0!==n?n:t},[E]),eA=(0,c.useCallback)(x||function(e){return e},[x]);function e_(e,t,n){(ex!==e||void 0!==t&&t!==ev)&&(ew(e),n||(eO(eG){e_(r-1,e-o-ef+eo);break}}A&&eH(0)+ef>G&&eh(null)}},[G,K,eo,el,ef,eT,eP]);var ez=eS&&!!eF.length,eL={};null!==ev&&eM&&(eL={position:"absolute",left:ev,top:0});var eD={prefixCls:ek,responsive:eM,component:B,invalidate:eR},eW=w?function(e,t){var n=eT(e,t);return c.createElement(y.Provider,{key:n,value:(0,o.Z)((0,o.Z)({},eD),{},{order:t,item:e,itemKey:n,registerSize:eB,display:t<=eE})},w(e,t))}:function(e,t){var n=eT(e,t);return c.createElement(m,(0,r.Z)({},eD,{order:t,key:n,item:e,renderItem:eA,itemKey:n,registerSize:eB,display:t<=eE}))},eV={order:ez?eE:Number.MAX_SAFE_INTEGER,className:"".concat(ek,"-rest"),registerSize:function(e,t){ea(t),et(eo)},display:ez},eq=P||k,eX=F?c.createElement(y.Provider,{value:(0,o.Z)((0,o.Z)({},eD),eV)},F(eF)):c.createElement(m,(0,r.Z)({},eD,eV),"function"==typeof eq?eq(eF):eq),eG=c.createElement(void 0===_?"div":_,(0,r.Z)({className:s()(!eR&&f,R),style:M,ref:t},z),T&&c.createElement(m,(0,r.Z)({},eD,{responsive:eI,responsiveDisabled:!eM,order:-1,className:"".concat(ek,"-prefix"),registerSize:function(e,t){es(t)},display:!0}),T),eP.map(eW),eN?eX:null,A&&c.createElement(m,(0,r.Z)({},eD,{responsive:eI,responsiveDisabled:!eM,order:eE,className:"".concat(ek,"-suffix"),registerSize:function(e,t){ep(t)},display:!0,style:eL}),A));return eI?c.createElement(u.Z,{onResize:function(e,t){X(t.clientWidth)},disabled:!eM},eG):eG});j.displayName="Overflow",j.Item=C,j.RESPONSIVE=S,j.INVALIDATE=O;var I=j},96257:function(e,t){"use strict";t.Z={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"}},31474:function(e,t,n){"use strict";n.d(t,{Z:function(){return z}});var r=n(1119),o=n(2265),a=n(45287);n(32559);var i=n(31686),c=n(41154),l=n(2868),s=n(28791),u=o.createContext(null),d=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){f&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),v?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){f&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;g.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),b=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),j="undefined"!=typeof WeakMap?new WeakMap:new d,I=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var n=new k(t,h.getInstance(),this);j.set(this,n)};["observe","unobserve","disconnect"].forEach(function(e){I.prototype[e]=function(){var t;return(t=j.get(this))[e].apply(t,arguments)}});var M=void 0!==p.ResizeObserver?p.ResizeObserver:I,R=new Map,N=new M(function(e){e.forEach(function(e){var t,n=e.target;null===(t=R.get(n))||void 0===t||t.forEach(function(e){return e(n)})})}),P=n(76405),F=n(25049),T=n(41690),A=n(15900),_=function(e){(0,T.Z)(n,e);var t=(0,A.Z)(n);function n(){return(0,P.Z)(this,n),t.apply(this,arguments)}return(0,F.Z)(n,[{key:"render",value:function(){return this.props.children}}]),n}(o.Component),B=o.forwardRef(function(e,t){var n=e.children,r=e.disabled,a=o.useRef(null),d=o.useRef(null),f=o.useContext(u),p="function"==typeof n,m=p?n(a):n,g=o.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),v=!p&&o.isValidElement(m)&&(0,s.Yr)(m),h=v?(0,s.C4)(m):null,b=(0,s.x1)(h,a),y=function(){var e;return(0,l.ZP)(a.current)||(a.current&&"object"===(0,c.Z)(a.current)?(0,l.ZP)(null===(e=a.current)||void 0===e?void 0:e.nativeElement):null)||(0,l.ZP)(d.current)};o.useImperativeHandle(t,function(){return y()});var x=o.useRef(e);x.current=e;var w=o.useCallback(function(e){var t=x.current,n=t.onResize,r=t.data,o=e.getBoundingClientRect(),a=o.width,c=o.height,l=e.offsetWidth,s=e.offsetHeight,u=Math.floor(a),d=Math.floor(c);if(g.current.width!==u||g.current.height!==d||g.current.offsetWidth!==l||g.current.offsetHeight!==s){var p={width:u,height:d,offsetWidth:l,offsetHeight:s};g.current=p;var m=(0,i.Z)((0,i.Z)({},p),{},{offsetWidth:l===Math.round(a)?a:l,offsetHeight:s===Math.round(c)?c:s});null==f||f(m,e,r),n&&Promise.resolve().then(function(){n(m,e)})}},[]);return o.useEffect(function(){var e=y();return e&&!r&&(R.has(e)||(R.set(e,new Set),N.observe(e)),R.get(e).add(w)),function(){R.has(e)&&(R.get(e).delete(w),R.get(e).size||(N.unobserve(e),R.delete(e)))}},[a.current,r]),o.createElement(_,{ref:d},v?o.cloneElement(m,{ref:b}):m)}),H=o.forwardRef(function(e,t){var n=e.children;return("function"==typeof n?[n]:(0,a.Z)(n)).map(function(n,a){var i=(null==n?void 0:n.key)||"".concat("rc-observer-key","-").concat(a);return o.createElement(B,(0,r.Z)({},e,{key:i,ref:0===a?t:void 0}),n)})});H.Collection=function(e){var t=e.children,n=e.onBatchResize,r=o.useRef(0),a=o.useRef([]),i=o.useContext(u),c=o.useCallback(function(e,t,o){r.current+=1;var c=r.current;a.current.push({size:e,element:t,data:o}),Promise.resolve().then(function(){c===r.current&&(null==n||n(a.current),a.current=[])}),null==i||i(e,t,o)},[n,i]);return o.createElement(u.Provider,{value:c},t)};var z=H},5769:function(e,t,n){"use strict";n.d(t,{G:function(){return i},Z:function(){return h}});var r=n(36760),o=n.n(r),a=n(2265);function i(e){var t=e.children,n=e.prefixCls,r=e.id,i=e.overlayInnerStyle,c=e.bodyClassName,l=e.className,s=e.style;return a.createElement("div",{className:o()("".concat(n,"-content"),l),style:s},a.createElement("div",{className:o()("".concat(n,"-inner"),c),id:r,role:"tooltip",style:i},"function"==typeof t?t():t))}var c=n(1119),l=n(31686),s=n(6989),u=n(97821),d={shiftX:64,adjustY:1},f={adjustX:1,shiftY:!0},p=[0,0],m={left:{points:["cr","cl"],overflow:f,offset:[-4,0],targetOffset:p},right:{points:["cl","cr"],overflow:f,offset:[4,0],targetOffset:p},top:{points:["bc","tc"],overflow:d,offset:[0,-4],targetOffset:p},bottom:{points:["tc","bc"],overflow:d,offset:[0,4],targetOffset:p},topLeft:{points:["bl","tl"],overflow:d,offset:[0,-4],targetOffset:p},leftTop:{points:["tr","tl"],overflow:f,offset:[-4,0],targetOffset:p},topRight:{points:["br","tr"],overflow:d,offset:[0,-4],targetOffset:p},rightTop:{points:["tl","tr"],overflow:f,offset:[4,0],targetOffset:p},bottomRight:{points:["tr","br"],overflow:d,offset:[0,4],targetOffset:p},rightBottom:{points:["bl","br"],overflow:f,offset:[4,0],targetOffset:p},bottomLeft:{points:["tl","bl"],overflow:d,offset:[0,4],targetOffset:p},leftBottom:{points:["br","bl"],overflow:f,offset:[-4,0],targetOffset:p}},g=n(92491),v=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],h=(0,a.forwardRef)(function(e,t){var n,r,d,f=e.overlayClassName,p=e.trigger,h=e.mouseEnterDelay,b=e.mouseLeaveDelay,y=e.overlayStyle,x=e.prefixCls,w=void 0===x?"rc-tooltip":x,E=e.children,C=e.onVisibleChange,Z=e.afterVisibleChange,S=e.transitionName,O=e.animation,k=e.motion,j=e.placement,I=e.align,M=e.destroyTooltipOnHide,R=e.defaultVisible,N=e.getTooltipContainer,P=e.overlayInnerStyle,F=(e.arrowContent,e.overlay),T=e.id,A=e.showArrow,_=e.classNames,B=e.styles,H=(0,s.Z)(e,v),z=(0,g.Z)(T),L=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,function(){return L.current});var D=(0,l.Z)({},H);return"visible"in e&&(D.popupVisible=e.visible),a.createElement(u.Z,(0,c.Z)({popupClassName:o()(f,null==_?void 0:_.root),prefixCls:w,popup:function(){return a.createElement(i,{key:"content",prefixCls:w,id:z,bodyClassName:null==_?void 0:_.body,overlayInnerStyle:(0,l.Z)((0,l.Z)({},P),null==B?void 0:B.body)},F)},action:void 0===p?["hover"]:p,builtinPlacements:m,popupPlacement:void 0===j?"right":j,ref:L,popupAlign:void 0===I?{}:I,getPopupContainer:N,onPopupVisibleChange:C,afterPopupVisibleChange:Z,popupTransitionName:S,popupAnimation:O,popupMotion:k,defaultPopupVisible:R,autoDestroy:void 0!==M&&M,mouseLeaveDelay:void 0===b?.1:b,popupStyle:(0,l.Z)((0,l.Z)({},y),null==B?void 0:B.root),mouseEnterDelay:void 0===h?0:h,arrow:void 0===A||A},D),(r=(null==(n=a.Children.only(E))?void 0:n.props)||{},d=(0,l.Z)((0,l.Z)({},r),{},{"aria-describedby":F?z:null}),a.cloneElement(E,d)))})},45287:function(e,t,n){"use strict";n.d(t,{Z:function(){return function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=[];return o.Children.forEach(t,function(t){(null!=t||n.keepEmpty)&&(Array.isArray(t)?a=a.concat(e(t)):(0,r.Z)(t)&&t.props?a=a.concat(e(t.props.children,n)):a.push(t))}),a}}});var r=n(10477),o=n(2265)},94981:function(e,t,n){"use strict";function r(){return!!("undefined"!=typeof window&&window.document&&window.document.createElement)}n.d(t,{Z:function(){return r}})},2161:function(e,t,n){"use strict";function r(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}n.d(t,{Z:function(){return r}})},21717:function(e,t,n){"use strict";n.d(t,{hq:function(){return g},jL:function(){return m}});var r=n(31686),o=n(94981),a=n(2161),i="data-rc-order",c="data-rc-priority",l=new Map;function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):"rc-util-key"}function u(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function d(e){return Array.from((l.get(e)||e).children).filter(function(e){return"STYLE"===e.tagName})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,o.Z)())return null;var n=t.csp,r=t.prepend,a=t.priority,l=void 0===a?0:a,s="queue"===r?"prependQueue":r?"prepend":"append",f="prependQueue"===s,p=document.createElement("style");p.setAttribute(i,s),f&&l&&p.setAttribute(c,"".concat(l)),null!=n&&n.nonce&&(p.nonce=null==n?void 0:n.nonce),p.innerHTML=e;var m=u(t),g=m.firstChild;if(r){if(f){var v=(t.styles||d(m)).filter(function(e){return!!["prepend","prependQueue"].includes(e.getAttribute(i))&&l>=Number(e.getAttribute(c)||0)});if(v.length)return m.insertBefore(p,v[v.length-1].nextSibling),p}m.insertBefore(p,g)}else m.appendChild(p);return p}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=u(t);return(t.styles||d(n)).find(function(n){return n.getAttribute(s(t))===e})}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=p(e,t);n&&u(t).removeChild(n)}function g(e,t){var n,o,i,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},m=u(c),g=d(m),v=(0,r.Z)((0,r.Z)({},c),{},{styles:g});!function(e,t){var n=l.get(e);if(!n||!(0,a.Z)(document,n)){var r=f("",t),o=r.parentNode;l.set(e,o),e.removeChild(r)}}(m,v);var h=p(t,v);if(h)return null!==(n=v.csp)&&void 0!==n&&n.nonce&&h.nonce!==(null===(o=v.csp)||void 0===o?void 0:o.nonce)&&(h.nonce=null===(i=v.csp)||void 0===i?void 0:i.nonce),h.innerHTML!==e&&(h.innerHTML=e),h;var b=f(e,v);return b.setAttribute(s(v),t),b}},2868:function(e,t,n){"use strict";n.d(t,{Sh:function(){return i},ZP:function(){return l},bn:function(){return c}});var r=n(41154),o=n(2265),a=n(54887);function i(e){return e instanceof HTMLElement||e instanceof SVGElement}function c(e){return e&&"object"===(0,r.Z)(e)&&i(e.nativeElement)?e.nativeElement:i(e)?e:null}function l(e){var t;return c(e)||(e instanceof o.Component?null===(t=a.findDOMNode)||void 0===t?void 0:t.call(a,e):null)}},2857:function(e,t){"use strict";t.Z=function(e){if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox(),n=t.width,r=t.height;if(n||r)return!0}if(e.getBoundingClientRect){var o=e.getBoundingClientRect(),a=o.width,i=o.height;if(a||i)return!0}}return!1}},13211:function(e,t,n){"use strict";function r(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}function o(e){return r(e) instanceof ShadowRoot?r(e):null}n.d(t,{A:function(){return o}})},95814:function(e,t){"use strict";var n={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=n.F1&&t<=n.F12)return!1;switch(t){case n.ALT:case n.CAPS_LOCK:case n.CONTEXT_MENU:case n.CTRL:case n.DOWN:case n.END:case n.ESC:case n.HOME:case n.INSERT:case n.LEFT:case n.MAC_FF_META:case n.META:case n.NUMLOCK:case n.NUM_CENTER:case n.PAGE_DOWN:case n.PAGE_UP:case n.PAUSE:case n.PRINT_SCREEN:case n.RIGHT:case n.SHIFT:case n.UP:case n.WIN_KEY:case n.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=n.ZERO&&e<=n.NINE||e>=n.NUM_ZERO&&e<=n.NUM_MULTIPLY||e>=n.A&&e<=n.Z||-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case n.SPACE:case n.QUESTION_MARK:case n.NUM_PLUS:case n.NUM_MINUS:case n.NUM_PERIOD:case n.NUM_DIVISION:case n.SEMICOLON:case n.DASH:case n.EQUALS:case n.COMMA:case n.PERIOD:case n.SLASH:case n.APOSTROPHE:case n.SINGLE_QUOTE:case n.OPEN_SQUARE_BRACKET:case n.BACKSLASH:case n.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};t.Z=n},10477:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var r=n(41154),o=Symbol.for("react.element"),a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(e){return e&&"object"===(0,r.Z)(e)&&(e.$$typeof===o||e.$$typeof===a)&&e.type===i}},3208:function(e,t,n){"use strict";n.d(t,{Z:function(){return i},o:function(){return c}});var r,o=n(21717);function a(e){var t,n,r="rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)),a=document.createElement("div");a.id=r;var i=a.style;if(i.position="absolute",i.left="0",i.top="0",i.width="100px",i.height="100px",i.overflow="scroll",e){var c=getComputedStyle(e);i.scrollbarColor=c.scrollbarColor,i.scrollbarWidth=c.scrollbarWidth;var l=getComputedStyle(e,"::-webkit-scrollbar"),s=parseInt(l.width,10),u=parseInt(l.height,10);try{var d=s?"width: ".concat(l.width,";"):"",f=u?"height: ".concat(l.height,";"):"";(0,o.hq)("\n#".concat(r,"::-webkit-scrollbar {\n").concat(d,"\n").concat(f,"\n}"),r)}catch(e){console.error(e),t=s,n=u}}document.body.appendChild(a);var p=e&&t&&!isNaN(t)?t:a.offsetWidth-a.clientWidth,m=e&&n&&!isNaN(n)?n:a.offsetHeight-a.clientHeight;return document.body.removeChild(a),(0,o.jL)(r),{width:p,height:m}}function i(e){return"undefined"==typeof document?0:((e||void 0===r)&&(r=a()),r.width)}function c(e){return"undefined"!=typeof document&&e&&e instanceof Element?a(e):{width:0,height:0}}},58525:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(2265);function o(e){var t=r.useRef();return t.current=e,r.useCallback(function(){for(var e,n=arguments.length,r=Array(n),o=0;o2&&void 0!==arguments[2]&&arguments[2],a=new Set;return function e(t,i){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,l=a.has(t);if((0,o.ZP)(!l,"Warning: There may be circular references"),l)return!1;if(t===i)return!0;if(n&&c>1)return!1;a.add(t);var s=c+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var u=0;u