From dfe3124335fe7576af5a214d189fe99a768cf5cd Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Thu, 4 Dec 2025 16:34:59 -0800 Subject: [PATCH] UI new build --- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 .../out/_next/static/chunks/1200-72b27753cc974b47.js | 1 + .../out/_next/static/chunks/1301-739c2d4a8ce60896.js | 1 + .../{1518-4475f8385da5ac78.js => 1518-af5eabc2040f5a96.js} | 2 +- .../out/_next/static/chunks/1529-59ce29afdf8ccc9b.js | 1 - .../{1602-dda1d35341543457.js => 1602-158ea5a27f7c5d7c.js} | 0 .../out/_next/static/chunks/1623-995fddc2b5647961.js | 1 - .../out/_next/static/chunks/1674-de8248fbd0c554ba.js | 1 - .../out/_next/static/chunks/1713-ce16d8a0e658a15d.js | 1 + .../{1739-23e7361486c2cc74.js => 1739-1616f1e28b151332.js} | 2 +- .../out/_next/static/chunks/1971-00859360d0630018.js | 1 + .../out/_next/static/chunks/1973-26a414084f96c69b.js | 1 - .../{2004-294ce010a90069b4.js => 2004-1eb16c345c0044ae.js} | 2 +- .../out/_next/static/chunks/2012-c09fa25a9cbf6028.js | 1 - .../out/_next/static/chunks/2012-dcbd62e829c6106f.js | 1 + .../out/_next/static/chunks/2106-df512fb0bae97b5c.js | 1 - .../out/_next/static/chunks/2202-75f4ebfcb55c7701.js | 1 - .../out/_next/static/chunks/2202-859c1cb8c2214ee1.js | 1 + .../out/_next/static/chunks/2249-01a36f26b1cecba3.js | 1 - .../out/_next/static/chunks/2249-3be1a049d707c166.js | 1 + .../{2273-d8bd63b2792d0fd2.js => 2273-c902438b7579c117.js} | 0 .../{2377-674bd40044d10e16.js => 2377-7121736141e67af2.js} | 0 .../{2409-e94c05c6f11bb939.js => 2409-79fdc0573d81b0e4.js} | 0 .../out/_next/static/chunks/2831-780a653f6bb335ce.js | 1 + .../{2901-964a2f81e9258ad6.js => 2901-0cdd0656eb7463d6.js} | 0 .../out/_next/static/chunks/3163-8b2c3b9e10ac4f04.js | 1 + .../out/_next/static/chunks/3250-6c57da6c11f342fa.js | 1 - .../out/_next/static/chunks/3341-852c4599adcc0f2b.js | 1 - .../out/_next/static/chunks/3367-33bb84b3d3d247b2.js | 1 + .../out/_next/static/chunks/337-bb33d149e9f461b3.js | 1 + .../{3705-124a560b74decaa8.js => 3705-1dcdbda1985a6786.js} | 0 .../{3801-ff2404f6d0c38247.js => 3801-5abad9290d1ac527.js} | 2 +- .../out/_next/static/chunks/3881-fb9362275df4cfb8.js | 1 + .../out/_next/static/chunks/395-053deae1a24be648.js | 1 - .../{8541-04c822145b2301f8.js => 4073-c83ea30de699cedc.js} | 2 +- .../out/_next/static/chunks/4292-28669d6dfecbbf62.js | 1 - .../out/_next/static/chunks/4292-c551871b8fc9bf85.js | 1 + .../out/_next/static/chunks/4388-eb8fa49a76501802.js | 1 - .../out/_next/static/chunks/4623-3d995c58e378474f.js | 1 + .../out/_next/static/chunks/4679-12d9b222cdd9a545.js | 1 + .../out/_next/static/chunks/475-3985fee235e827f8.js | 1 - .../out/_next/static/chunks/4865-c1c0885a93c327fa.js | 1 + .../out/_next/static/chunks/5096-d9222b69b30b3d56.js | 1 - .../{5333-438ba079aae9630c.js => 5333-1540faf81c7d7006.js} | 2 +- .../out/_next/static/chunks/54-56a8e045d64789e2.js | 1 - .../out/_next/static/chunks/5458-16bb926d82ad4bf2.js | 1 + .../out/_next/static/chunks/5572-d4f8dc9b2bf09618.js | 1 - .../out/_next/static/chunks/5690-3bf2d6edf2ad3488.js | 1 - .../{5830-30dbbe6913297258.js => 5830-887d1be7a21571e6.js} | 2 +- .../{5869-99bf8c2997f4811f.js => 5869-1bf16ccc36c11fdf.js} | 0 .../out/_next/static/chunks/6043-4308da67f056896d.js | 1 + .../out/_next/static/chunks/611-daf8f83b94cdb4b5.js | 5 +++++ .../{630-f305780b75c36612.js => 630-84f939b9d5c498f8.js} | 2 +- .../{6600-1c55511ad9da9e4d.js => 6600-f6ef8cab1138b91c.js} | 2 +- .../{6609-d93906f43161f066.js => 6609-2ab6b0b5a3184f98.js} | 0 .../out/_next/static/chunks/667-213a9fbd82e0ada7.js | 1 - .../out/_next/static/chunks/6843-98abf1271c25c6e0.js | 1 - .../out/_next/static/chunks/7140-937050711ba264d3.js | 1 + .../out/_next/static/chunks/7155-459bc53437553b96.js | 1 - .../out/_next/static/chunks/7155-502603f8c00d5377.js | 1 + .../out/_next/static/chunks/7164-8de9ea967cd5d031.js | 1 - .../out/_next/static/chunks/7164-c65c1ea80db7bbed.js | 1 + .../out/_next/static/chunks/7187-d4c57193fb558148.js | 1 - .../{2525-a7d77bb2600c3955.js => 7318-c50027425e9c9b90.js} | 4 ++-- .../out/_next/static/chunks/7526-9d5ec51e0920ffc6.js | 1 - .../out/_next/static/chunks/7526-b11ab7441c450bb0.js | 1 + .../out/_next/static/chunks/7641-2d52ba6eada33bb5.js | 1 + .../out/_next/static/chunks/7641-fa9cc1f68c670e1c.js | 1 - .../out/_next/static/chunks/7692-bb659e8208e54b90.js | 1 + .../{773-b02e89f4d1193982.js => 773-ff02700a337e55b2.js} | 0 .../{7906-1b1cdd8da2773bb2.js => 7906-ff470037aad6df61.js} | 2 +- .../out/_next/static/chunks/7941-c02dc43abfb07ee7.js | 1 + .../{7975-d5ed9d0e73f8f3a9.js => 7975-045081d670913e3f.js} | 0 .../{7996-14bf1f249416672e.js => 7996-dc0963f1c599e551.js} | 0 .../out/_next/static/chunks/8049-26cbf3211b47269e.js | 1 - .../out/_next/static/chunks/8049-7e649ed7fd33f9a4.js | 1 + .../{8093-a70cb8468c3bacb1.js => 8093-9d2ba51fd9bdba69.js} | 2 +- .../out/_next/static/chunks/8135-269532e44b9e1cc0.js | 1 + .../out/_next/static/chunks/8135-bccf92b547029b20.js | 1 - .../out/_next/static/chunks/8143-c29004baeaecd6ab.js | 1 - .../out/_next/static/chunks/8143-e63ee1f43fb589a8.js | 1 + .../{816-e7500f06e5b83b0f.js => 816-2599f468473a536f.js} | 2 +- .../{8237-253c15ae006496fe.js => 8237-f24147b4d37757de.js} | 2 +- .../out/_next/static/chunks/8468-27ea05e25918ba32.js | 1 + .../out/_next/static/chunks/849-d1cabf66d71a8808.js | 1 + .../{8524-8f4aa1548d36fa46.js => 8524-838767236028144d.js} | 2 +- .../out/_next/static/chunks/8533-b7d5b2f50457d35a.js | 1 - .../out/_next/static/chunks/8568-8f9d2dfeed21cd24.js | 5 ----- .../{9798-a47f1a4423863a8a.js => 8650-bdc42de3748f9feb.js} | 2 +- .../out/_next/static/chunks/874-27200b3305585521.js | 1 - .../out/_next/static/chunks/874-6c05723839f68713.js | 1 + .../out/_next/static/chunks/8948-da16df3286be8c9b.js | 1 - .../out/_next/static/chunks/9028-2bfc9f09930a0d61.js | 1 + .../{9111-9b9192c9fb4809ff.js => 9111-12f794ec35b5648b.js} | 2 +- .../out/_next/static/chunks/9165-82d12d1c73da639d.js | 1 - .../out/_next/static/chunks/9265-ff87d261426cb5a5.js | 1 + .../out/_next/static/chunks/9301-905e8491f42289c0.js | 1 - .../{5170-eddf033da66a3d25.js => 9349-1fa3ff8b930b9fad.js} | 2 +- .../{9409-83062cad6bf21c62.js => 9409-1929f646c1a44e2b.js} | 0 .../{9411-3630d7fd1940320c.js => 9411-f0809661e32b97a3.js} | 0 .../out/_next/static/chunks/9566-1dfa2dbabae5c638.js | 1 + .../out/_next/static/chunks/9611-8bd2ffcee22edc34.js | 1 - .../out/_next/static/chunks/9611-a9f5d684e3034570.js | 1 + .../out/_next/static/chunks/9877-ff2a01b39a318119.js | 1 - .../out/_next/static/chunks/9878-52c3826c6d453296.js | 1 + .../app/(dashboard)/api-reference/page-e1a54745192ab0f1.js | 1 + .../app/(dashboard)/api-reference/page-efca3b67652c1db6.js | 1 - .../experimental/api-playground/page-936a5ab17aafdc68.js | 1 + .../experimental/api-playground/page-e66957ea53741305.js | 1 - .../{page-349dab403faa8586.js => page-b0d3ede3f043c0c8.js} | 2 +- .../{page-29593a3a38ff72cd.js => page-f4b21704c11c2d9d.js} | 2 +- .../{page-392368af0265ebf3.js => page-670a9deb6340686a.js} | 2 +- .../experimental/prompts/page-93572aaa30148895.js | 1 + .../experimental/prompts/page-a188489df21ffc96.js | 1 - .../{page-04b44e5847f0e275.js => page-5a0e12e4e22b19fe.js} | 2 +- .../{page-df254f7363ecac47.js => page-b19ec0d898a6b0ce.js} | 2 +- ...yout-a0258e2243643336.js => layout-2ae9b739c939bec1.js} | 2 +- .../chunks/app/(dashboard)/logs/page-24f7ccafa5658895.js | 1 - .../chunks/app/(dashboard)/logs/page-9c53033b0cf58112.js | 1 + .../app/(dashboard)/model-hub/page-1af734262ac00fb0.js | 1 + .../app/(dashboard)/model-hub/page-cb5b5c184df1920f.js | 1 - .../models-and-endpoints/page-2d0d5d2d6271bd9f.js | 1 + .../models-and-endpoints/page-7526ca663daec9bf.js | 1 - .../app/(dashboard)/organizations/page-c5c54ec599dda90a.js | 1 - .../app/(dashboard)/organizations/page-d9bd41055f261912.js | 1 + .../{page-f66c8c75efc80fa3.js => page-896105d02e58444f.js} | 2 +- .../settings/admin-settings/page-b14017f2434341b6.js | 1 - .../settings/admin-settings/page-e7b94e2b6d895dc1.js | 1 + .../settings/logging-and-alerts/page-73e2aa132fcafea5.js | 1 - .../settings/logging-and-alerts/page-9831981fcd33899f.js | 1 + .../{page-ce416427bf19a1dc.js => page-61fab4542b0b4417.js} | 2 +- .../{page-e723d4c81fc7d9a9.js => page-8b03f770c177a049.js} | 2 +- .../chunks/app/(dashboard)/teams/page-464d4ef166df7211.js | 1 - .../chunks/app/(dashboard)/teams/page-6c7d5084fd0d9f69.js | 1 + .../{page-4dd219948b528c92.js => page-fbfae949bb4fca35.js} | 2 +- .../{page-4a1119ecd30d2b39.js => page-1f13af87ed0f771a.js} | 2 +- .../tools/vector-stores/page-0d2fcb35bc6b40f5.js | 1 + .../tools/vector-stores/page-c4aed80b18ca0651.js | 1 - .../chunks/app/(dashboard)/usage/page-0c3dbc37d3f69993.js | 1 + .../chunks/app/(dashboard)/usage/page-2098a2b6e214223c.js | 1 - .../chunks/app/(dashboard)/users/page-80eaf816a6ca5c75.js | 1 - .../chunks/app/(dashboard)/users/page-eb8e2b637961037d.js | 1 + .../app/(dashboard)/virtual-keys/page-52c22b525906afcf.js | 1 - .../app/(dashboard)/virtual-keys/page-58606ceee2a35fed.js | 1 + ...yout-5681449b28aa197a.js => layout-86876c52b469bf46.js} | 2 +- .../_next/static/chunks/app/login/page-6295f0e1ae107bef.js | 1 + .../{page-e50863ece139886b.js => page-4cdcc0d632ab220d.js} | 2 +- .../static/chunks/app/model_hub/page-68bb7f322f019ac9.js | 1 + .../static/chunks/app/model_hub/page-ca976de28014d49a.js | 1 - .../chunks/app/model_hub_table/page-3c0b30cf20ca0ad3.js | 1 + .../chunks/app/model_hub_table/page-623abbf7f2315887.js | 1 - .../static/chunks/app/onboarding/page-6f2572027a406495.js | 1 - .../static/chunks/app/onboarding/page-b8a970754f478199.js | 1 + .../out/_next/static/chunks/app/page-28eb040917ca1710.js | 1 - .../out/_next/static/chunks/app/page-a2629d10a20e0fef.js | 1 + .../{main-cefebbba2af77d3d.js => main-598d78e71630173a.js} | 2 +- ...pp-ce1f29ef0860719b.js => main-app-77a6ca3c04ee9adf.js} | 2 +- litellm/proxy/_experimental/out/api-reference.html | 1 + litellm/proxy/_experimental/out/api-reference.txt | 6 +++--- litellm/proxy/_experimental/out/api-reference/index.html | 1 - .../_experimental/out/experimental/api-playground.html | 2 +- .../_experimental/out/experimental/api-playground.txt | 6 +++--- litellm/proxy/_experimental/out/experimental/budgets.html | 2 +- litellm/proxy/_experimental/out/experimental/budgets.txt | 6 +++--- litellm/proxy/_experimental/out/experimental/caching.html | 2 +- litellm/proxy/_experimental/out/experimental/caching.txt | 6 +++--- .../proxy/_experimental/out/experimental/old-usage.html | 2 +- litellm/proxy/_experimental/out/experimental/old-usage.txt | 6 +++--- litellm/proxy/_experimental/out/experimental/prompts.html | 2 +- litellm/proxy/_experimental/out/experimental/prompts.txt | 6 +++--- .../_experimental/out/experimental/tag-management.html | 2 +- .../_experimental/out/experimental/tag-management.txt | 6 +++--- 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 ++-- litellm/proxy/_experimental/out/login.html | 1 + litellm/proxy/_experimental/out/login.txt | 7 +++++++ litellm/proxy/_experimental/out/logs.html | 1 + litellm/proxy/_experimental/out/logs.txt | 6 +++--- litellm/proxy/_experimental/out/logs/index.html | 1 - litellm/proxy/_experimental/out/mcp/oauth/callback.html | 2 +- litellm/proxy/_experimental/out/mcp/oauth/callback.txt | 4 ++-- litellm/proxy/_experimental/out/model-hub.html | 1 + litellm/proxy/_experimental/out/model-hub.txt | 6 +++--- litellm/proxy/_experimental/out/model-hub/index.html | 1 - 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 +++--- .../_experimental/out/models-and-endpoints/index.html | 1 - litellm/proxy/_experimental/out/onboarding.html | 1 + litellm/proxy/_experimental/out/onboarding.txt | 4 ++-- litellm/proxy/_experimental/out/organizations.html | 1 + litellm/proxy/_experimental/out/organizations.txt | 6 +++--- litellm/proxy/_experimental/out/organizations/index.html | 1 - litellm/proxy/_experimental/out/playground.html | 1 + litellm/proxy/_experimental/out/playground.txt | 6 +++--- litellm/proxy/_experimental/out/playground/index.html | 1 - .../proxy/_experimental/out/settings/admin-settings.html | 2 +- .../proxy/_experimental/out/settings/admin-settings.txt | 6 +++--- .../_experimental/out/settings/logging-and-alerts.html | 2 +- .../_experimental/out/settings/logging-and-alerts.txt | 6 +++--- .../proxy/_experimental/out/settings/router-settings.html | 2 +- .../proxy/_experimental/out/settings/router-settings.txt | 6 +++--- litellm/proxy/_experimental/out/settings/ui-theme.html | 2 +- litellm/proxy/_experimental/out/settings/ui-theme.txt | 6 +++--- litellm/proxy/_experimental/out/teams.html | 1 + litellm/proxy/_experimental/out/teams.txt | 6 +++--- litellm/proxy/_experimental/out/teams/index.html | 1 - litellm/proxy/_experimental/out/test-key.html | 1 + litellm/proxy/_experimental/out/test-key.txt | 6 +++--- litellm/proxy/_experimental/out/test-key/index.html | 1 - litellm/proxy/_experimental/out/tools/mcp-servers.html | 2 +- litellm/proxy/_experimental/out/tools/mcp-servers.txt | 6 +++--- litellm/proxy/_experimental/out/tools/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 - litellm/proxy/_experimental/out/virtual-keys.html | 1 + litellm/proxy/_experimental/out/virtual-keys.txt | 6 +++--- litellm/proxy/_experimental/out/virtual-keys/index.html | 1 - 229 files changed, 212 insertions(+), 200 deletions(-) rename litellm/proxy/_experimental/out/_next/static/{6DVsIIQxhiSKdAYpN-pIf => 62Q_aEBtV1y_OBZw06lMc}/_buildManifest.js (100%) rename litellm/proxy/_experimental/out/_next/static/{6DVsIIQxhiSKdAYpN-pIf => 62Q_aEBtV1y_OBZw06lMc}/_ssgManifest.js (100%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1200-72b27753cc974b47.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1301-739c2d4a8ce60896.js rename litellm/proxy/_experimental/out/_next/static/chunks/{1518-4475f8385da5ac78.js => 1518-af5eabc2040f5a96.js} (65%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1529-59ce29afdf8ccc9b.js rename litellm/proxy/_experimental/out/_next/static/chunks/{1602-dda1d35341543457.js => 1602-158ea5a27f7c5d7c.js} (100%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1623-995fddc2b5647961.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1674-de8248fbd0c554ba.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1713-ce16d8a0e658a15d.js rename litellm/proxy/_experimental/out/_next/static/chunks/{1739-23e7361486c2cc74.js => 1739-1616f1e28b151332.js} (55%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1971-00859360d0630018.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/1973-26a414084f96c69b.js rename litellm/proxy/_experimental/out/_next/static/chunks/{2004-294ce010a90069b4.js => 2004-1eb16c345c0044ae.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2012-c09fa25a9cbf6028.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2012-dcbd62e829c6106f.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2106-df512fb0bae97b5c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2202-75f4ebfcb55c7701.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2202-859c1cb8c2214ee1.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2249-01a36f26b1cecba3.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2249-3be1a049d707c166.js rename litellm/proxy/_experimental/out/_next/static/chunks/{2273-d8bd63b2792d0fd2.js => 2273-c902438b7579c117.js} (100%) rename litellm/proxy/_experimental/out/_next/static/chunks/{2377-674bd40044d10e16.js => 2377-7121736141e67af2.js} (100%) rename litellm/proxy/_experimental/out/_next/static/chunks/{2409-e94c05c6f11bb939.js => 2409-79fdc0573d81b0e4.js} (100%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/2831-780a653f6bb335ce.js rename litellm/proxy/_experimental/out/_next/static/chunks/{2901-964a2f81e9258ad6.js => 2901-0cdd0656eb7463d6.js} (100%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3163-8b2c3b9e10ac4f04.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3250-6c57da6c11f342fa.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3341-852c4599adcc0f2b.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3367-33bb84b3d3d247b2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/337-bb33d149e9f461b3.js rename litellm/proxy/_experimental/out/_next/static/chunks/{3705-124a560b74decaa8.js => 3705-1dcdbda1985a6786.js} (100%) rename litellm/proxy/_experimental/out/_next/static/chunks/{3801-ff2404f6d0c38247.js => 3801-5abad9290d1ac527.js} (99%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/3881-fb9362275df4cfb8.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/395-053deae1a24be648.js rename litellm/proxy/_experimental/out/_next/static/chunks/{8541-04c822145b2301f8.js => 4073-c83ea30de699cedc.js} (80%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4292-28669d6dfecbbf62.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4292-c551871b8fc9bf85.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4388-eb8fa49a76501802.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4623-3d995c58e378474f.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4679-12d9b222cdd9a545.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/475-3985fee235e827f8.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/4865-c1c0885a93c327fa.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5096-d9222b69b30b3d56.js rename litellm/proxy/_experimental/out/_next/static/chunks/{5333-438ba079aae9630c.js => 5333-1540faf81c7d7006.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/54-56a8e045d64789e2.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5458-16bb926d82ad4bf2.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5572-d4f8dc9b2bf09618.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/5690-3bf2d6edf2ad3488.js rename litellm/proxy/_experimental/out/_next/static/chunks/{5830-30dbbe6913297258.js => 5830-887d1be7a21571e6.js} (99%) rename litellm/proxy/_experimental/out/_next/static/chunks/{5869-99bf8c2997f4811f.js => 5869-1bf16ccc36c11fdf.js} (100%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6043-4308da67f056896d.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/611-daf8f83b94cdb4b5.js rename litellm/proxy/_experimental/out/_next/static/chunks/{630-f305780b75c36612.js => 630-84f939b9d5c498f8.js} (99%) rename litellm/proxy/_experimental/out/_next/static/chunks/{6600-1c55511ad9da9e4d.js => 6600-f6ef8cab1138b91c.js} (86%) rename litellm/proxy/_experimental/out/_next/static/chunks/{6609-d93906f43161f066.js => 6609-2ab6b0b5a3184f98.js} (100%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/667-213a9fbd82e0ada7.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/6843-98abf1271c25c6e0.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7140-937050711ba264d3.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7155-459bc53437553b96.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7155-502603f8c00d5377.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7164-8de9ea967cd5d031.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7164-c65c1ea80db7bbed.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7187-d4c57193fb558148.js rename litellm/proxy/_experimental/out/_next/static/chunks/{2525-a7d77bb2600c3955.js => 7318-c50027425e9c9b90.js} (90%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7526-9d5ec51e0920ffc6.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7526-b11ab7441c450bb0.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7641-2d52ba6eada33bb5.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7641-fa9cc1f68c670e1c.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7692-bb659e8208e54b90.js rename litellm/proxy/_experimental/out/_next/static/chunks/{773-b02e89f4d1193982.js => 773-ff02700a337e55b2.js} (100%) rename litellm/proxy/_experimental/out/_next/static/chunks/{7906-1b1cdd8da2773bb2.js => 7906-ff470037aad6df61.js} (99%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/7941-c02dc43abfb07ee7.js rename litellm/proxy/_experimental/out/_next/static/chunks/{7975-d5ed9d0e73f8f3a9.js => 7975-045081d670913e3f.js} (100%) rename litellm/proxy/_experimental/out/_next/static/chunks/{7996-14bf1f249416672e.js => 7996-dc0963f1c599e551.js} (100%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8049-26cbf3211b47269e.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8049-7e649ed7fd33f9a4.js rename litellm/proxy/_experimental/out/_next/static/chunks/{8093-a70cb8468c3bacb1.js => 8093-9d2ba51fd9bdba69.js} (99%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8135-269532e44b9e1cc0.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8135-bccf92b547029b20.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8143-c29004baeaecd6ab.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8143-e63ee1f43fb589a8.js rename litellm/proxy/_experimental/out/_next/static/chunks/{816-e7500f06e5b83b0f.js => 816-2599f468473a536f.js} (99%) rename litellm/proxy/_experimental/out/_next/static/chunks/{8237-253c15ae006496fe.js => 8237-f24147b4d37757de.js} (99%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8468-27ea05e25918ba32.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/849-d1cabf66d71a8808.js rename litellm/proxy/_experimental/out/_next/static/chunks/{8524-8f4aa1548d36fa46.js => 8524-838767236028144d.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8533-b7d5b2f50457d35a.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8568-8f9d2dfeed21cd24.js rename litellm/proxy/_experimental/out/_next/static/chunks/{9798-a47f1a4423863a8a.js => 8650-bdc42de3748f9feb.js} (62%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/874-27200b3305585521.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/874-6c05723839f68713.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/8948-da16df3286be8c9b.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9028-2bfc9f09930a0d61.js rename litellm/proxy/_experimental/out/_next/static/chunks/{9111-9b9192c9fb4809ff.js => 9111-12f794ec35b5648b.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9165-82d12d1c73da639d.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9265-ff87d261426cb5a5.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9301-905e8491f42289c0.js rename litellm/proxy/_experimental/out/_next/static/chunks/{5170-eddf033da66a3d25.js => 9349-1fa3ff8b930b9fad.js} (57%) rename litellm/proxy/_experimental/out/_next/static/chunks/{9409-83062cad6bf21c62.js => 9409-1929f646c1a44e2b.js} (100%) rename litellm/proxy/_experimental/out/_next/static/chunks/{9411-3630d7fd1940320c.js => 9411-f0809661e32b97a3.js} (100%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9566-1dfa2dbabae5c638.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9611-8bd2ffcee22edc34.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9611-a9f5d684e3034570.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9877-ff2a01b39a318119.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/9878-52c3826c6d453296.js create 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)/api-reference/page-efca3b67652c1db6.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-936a5ab17aafdc68.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/api-playground/page-e66957ea53741305.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/budgets/{page-349dab403faa8586.js => page-b0d3ede3f043c0c8.js} (98%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/caching/{page-29593a3a38ff72cd.js => page-f4b21704c11c2d9d.js} (93%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/old-usage/{page-392368af0265ebf3.js => page-670a9deb6340686a.js} (92%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-93572aaa30148895.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/prompts/page-a188489df21ffc96.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/experimental/tag-management/{page-04b44e5847f0e275.js => page-5a0e12e4e22b19fe.js} (89%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/guardrails/{page-df254f7363ecac47.js => page-b19ec0d898a6b0ce.js} (95%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/{layout-a0258e2243643336.js => layout-2ae9b739c939bec1.js} (99%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-24f7ccafa5658895.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/logs/page-9c53033b0cf58112.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-1af734262ac00fb0.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/model-hub/page-cb5b5c184df1920f.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-2d0d5d2d6271bd9f.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/models-and-endpoints/page-7526ca663daec9bf.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-c5c54ec599dda90a.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/organizations/page-d9bd41055f261912.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/playground/{page-f66c8c75efc80fa3.js => page-896105d02e58444f.js} (85%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-b14017f2434341b6.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/admin-settings/page-e7b94e2b6d895dc1.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-73e2aa132fcafea5.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/logging-and-alerts/page-9831981fcd33899f.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/router-settings/{page-ce416427bf19a1dc.js => page-61fab4542b0b4417.js} (95%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/settings/ui-theme/{page-e723d4c81fc7d9a9.js => page-8b03f770c177a049.js} (98%) delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-464d4ef166df7211.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/teams/page-6c7d5084fd0d9f69.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/test-key/{page-4dd219948b528c92.js => page-fbfae949bb4fca35.js} (90%) rename litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/mcp-servers/{page-4a1119ecd30d2b39.js => page-1f13af87ed0f771a.js} (95%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-0d2fcb35bc6b40f5.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/tools/vector-stores/page-c4aed80b18ca0651.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-0c3dbc37d3f69993.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/usage/page-2098a2b6e214223c.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-80eaf816a6ca5c75.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/users/page-eb8e2b637961037d.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-52c22b525906afcf.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/(dashboard)/virtual-keys/page-58606ceee2a35fed.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/{layout-5681449b28aa197a.js => layout-86876c52b469bf46.js} (73%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/login/page-6295f0e1ae107bef.js rename litellm/proxy/_experimental/out/_next/static/chunks/app/mcp/oauth/callback/{page-e50863ece139886b.js => page-4cdcc0d632ab220d.js} (89%) create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-68bb7f322f019ac9.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub/page-ca976de28014d49a.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-3c0b30cf20ca0ad3.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/model_hub_table/page-623abbf7f2315887.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-6f2572027a406495.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/onboarding/page-b8a970754f478199.js delete mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-28eb040917ca1710.js create mode 100644 litellm/proxy/_experimental/out/_next/static/chunks/app/page-a2629d10a20e0fef.js rename litellm/proxy/_experimental/out/_next/static/chunks/{main-cefebbba2af77d3d.js => main-598d78e71630173a.js} (67%) rename litellm/proxy/_experimental/out/_next/static/chunks/{main-app-ce1f29ef0860719b.js => main-app-77a6ca3c04ee9adf.js} (81%) create mode 100644 litellm/proxy/_experimental/out/api-reference.html delete mode 100644 litellm/proxy/_experimental/out/api-reference/index.html create mode 100644 litellm/proxy/_experimental/out/guardrails.html create mode 100644 litellm/proxy/_experimental/out/login.html create mode 100644 litellm/proxy/_experimental/out/login.txt create mode 100644 litellm/proxy/_experimental/out/logs.html delete mode 100644 litellm/proxy/_experimental/out/logs/index.html create mode 100644 litellm/proxy/_experimental/out/model-hub.html delete mode 100644 litellm/proxy/_experimental/out/model-hub/index.html 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 create mode 100644 litellm/proxy/_experimental/out/organizations.html delete mode 100644 litellm/proxy/_experimental/out/organizations/index.html create mode 100644 litellm/proxy/_experimental/out/playground.html delete mode 100644 litellm/proxy/_experimental/out/playground/index.html create mode 100644 litellm/proxy/_experimental/out/teams.html delete mode 100644 litellm/proxy/_experimental/out/teams/index.html create mode 100644 litellm/proxy/_experimental/out/test-key.html delete mode 100644 litellm/proxy/_experimental/out/test-key/index.html 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 create mode 100644 litellm/proxy/_experimental/out/virtual-keys.html delete mode 100644 litellm/proxy/_experimental/out/virtual-keys/index.html diff --git a/litellm/proxy/_experimental/out/_next/static/6DVsIIQxhiSKdAYpN-pIf/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/62Q_aEBtV1y_OBZw06lMc/_buildManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/6DVsIIQxhiSKdAYpN-pIf/_buildManifest.js rename to litellm/proxy/_experimental/out/_next/static/62Q_aEBtV1y_OBZw06lMc/_buildManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/6DVsIIQxhiSKdAYpN-pIf/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/62Q_aEBtV1y_OBZw06lMc/_ssgManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/6DVsIIQxhiSKdAYpN-pIf/_ssgManifest.js rename to litellm/proxy/_experimental/out/_next/static/62Q_aEBtV1y_OBZw06lMc/_ssgManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1200-72b27753cc974b47.js b/litellm/proxy/_experimental/out/_next/static/chunks/1200-72b27753cc974b47.js new file mode 100644 index 0000000000..07e7706744 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1200-72b27753cc974b47.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1200],{90246:function(e,l,t){t.d(l,{n:function(){return s}});function s(e){let l=[e];return{all:l,lists:()=>[...l,"list"],list:e=>[...l,"list",{params:e}],details:()=>[...l,"detail"],detail:e=>[...l,"detail",e]}}},31200:function(e,l,t){t.d(l,{Z:function(){return lK}});var s=t(57437),a=t(29827),r=t(49804),i=t(67101),n=t(84264),o=t(2265),d=t(9114),c=t(19250),m=t(42673);let u=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=m.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=m.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 d.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 d.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){d.Z.fromBackend("Failed to create model: "+e)}},h=async(e,l,t,s)=>{try{let a=await u(e,l,t);if(!a||0===a.length)return;for(let e of a){let{litellmParamsObj:t,modelInfoObj:s,modelName:a}=e,r={model_name:a,litellm_params:t,model_info:s},i=await (0,c.modelCreateCall)(l,r);console.log("response for model create call: ".concat(i.data))}s&&s(),t.resetFields()}catch(e){d.Z.fromBackend("Failed to add model: "+e)}};var x=t(11713),p=t(90246);let g=(0,p.n)("credentials"),f=e=>(0,x.a)({queryKey:g.list({}),queryFn:async()=>await (0,c.credentialListCall)(e),enabled:!!e}),j=(0,p.n)("models");(0,p.n)("modelHub");let v=(e,l,t)=>(0,x.a)({queryKey:j.list({filters:{...l&&{userID:l},...t&&{userRole:t}}}),queryFn:async()=>await (0,c.modelInfoCall)(e,l,t),enabled:!!(e&&l&&t)});var _=t(53410),y=t(74998),b=t(62490),N=t(10032),Z=t(21609),w=t(31283),C=t(57840),S=t(22116),k=t(37592),A=t(99981),E=t(5545);let M=(0,p.n)("providerFields"),I=()=>(0,x.a)({queryKey:M.list({}),queryFn:async()=>await (0,c.getProviderCreateMetadata)(),staleTime:864e5,gcTime:864e5});var F=t(3632),P=t(56522),L=t(47451),T=t(69410),R=t(65319);let{Link:O}=C.default,V=e=>{var l,t,s,a,r;let i="password"===e.field_type?"password":"select"===e.field_type?"select":"upload"===e.field_type?"upload":"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}},D={};var z=e=>{let{selectedProvider:l,uploadProps:t}=e,a=m.Cl[l],r=N.Z.useFormInstance(),{data:i,isLoading:n,error:d}=I(),c=o.useMemo(()=>{if(!i)return null;let e={};return i.forEach(l=>{let t=l.provider_display_name,s=l.credential_fields.map(V);e[t]=s,l.provider&&(e[l.provider]=s),l.litellm_provider&&(e[l.litellm_provider]=s)}),e},[i]);o.useEffect(()=>{c&&Object.assign(D,c)},[c]);let u=o.useMemo(()=>{var e;let t=null!==(e=D[a])&&void 0!==e?e:D[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(V);return D[s.provider_display_name]=r,s.provider&&(D[s.provider]=r),s.litellm_provider&&(D[s.litellm_provider]=r),r},[a,l,i]),h={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===u.length&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{span:24,children:(0,s.jsx)(P.x,{className:"mb-2",children:"Loading provider fields..."})})}),d&&0===u.length&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{span:24,children:(0,s.jsx)(P.x,{className:"mb-2 text-red-500",children:d instanceof Error?d.message:"Failed to load provider credential fields"})})}),u.map(e=>{var l;return(0,s.jsxs)(o.Fragment,{children:[(0,s.jsx)(N.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)(k.default,{placeholder:e.placeholder,defaultValue:e.defaultValue,children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,s.jsx)(k.default.Option,{value:e,children:e},e))}):"upload"===e.type?(0,s.jsx)(R.default,{...h,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)(E.ZP,{icon:(0,s.jsx)(F.Z,{}),children:"Click to Upload"})}):(0,s.jsx)(P.o,{placeholder:e.placeholder,type:"password"===e.type?"password":"text",defaultValue:e.defaultValue})}),"vertex_credentials"===e.key&&(0,s.jsx)(L.Z,{children:(0,s.jsx)(T.Z,{children:(0,s.jsx)(P.x,{className:"mb-3 mt-1",children:"Give a gcp service account(.json file)"})})}),"base_model"===e.key&&(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(P.x,{className:"mb-2",children:["The actual model your azure deployment uses. Used for accurate cost tracking. Select name from"," ",(0,s.jsx)(O,{href:"https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json",target:"_blank",children:"here"})]})})]})]},e.key)})]})};let{Link:q}=C.default;var B=e=>{let{open:l,onCancel:t,onAddCredential:a,uploadProps:r}=e,[i]=N.Z.useForm(),[n,d]=(0,o.useState)(m.Cl.OpenAI);return(0,s.jsx)(S.Z,{title:"Add New Credential",open:l,onCancel:()=>{t(),i.resetFields()},footer:null,width:600,children:(0,s.jsxs)(N.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)(N.Z.Item,{label:"Credential Name:",name:"credential_name",rules:[{required:!0,message:"Credential name is required"}],children:(0,s.jsx)(w.o,{placeholder:"Enter a friendly name for these credentials"})}),(0,s.jsx)(N.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)(k.default,{showSearch:!0,onChange:e=>{d(e),i.setFieldValue("custom_llm_provider",e)},children:Object.entries(m.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(k.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:m.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)(z,{selectedProvider:n,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(q,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),i.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Add Credential"})]})]})]})})};let{Link:U}=C.default;function G(e){let{open:l,onCancel:t,onUpdateCredential:a,uploadProps:r,existingCredential:i}=e,[n]=N.Z.useForm(),[d,c]=(0,o.useState)(m.Cl.Anthropic);return(0,o.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}),c(i.credential_info.custom_llm_provider)}},[i]),(0,s.jsx)(S.Z,{title:"Edit Credential",open:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,destroyOnHidden:!0,children:(0,s.jsxs)(N.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)(N.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)(w.o,{placeholder:"Enter a friendly name for these credentials",disabled:null!=i&&!!i.credential_name})}),(0,s.jsx)(N.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)(k.default,{showSearch:!0,onChange:e=>{c(e),n.setFieldValue("custom_llm_provider",e)},children:Object.entries(m.Cl).map(e=>{let[l,t]=e;return(0,s.jsx)(k.default.Option,{value:l,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("img",{src:m.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)(z,{selectedProvider:d,uploadProps:r}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(U,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Update Credential"})]})]})]})})}var H=t(39760),K=e=>{var l;let{uploadProps:t}=e,{accessToken:a}=(0,H.Z)(),{data:r,refetch:i}=f(a),n=(null==r?void 0:r.credentials)||[],[m,u]=(0,o.useState)(!1),[h,x]=(0,o.useState)(!1),[p,g]=(0,o.useState)(null),[j,v]=(0,o.useState)(null),[w,C]=(0,o.useState)(!1),[S,k]=(0,o.useState)(!1),[A]=N.Z.useForm(),E=["credential_name","custom_llm_provider"],M=async e=>{if(!a)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!E.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,c.credentialUpdateCall)(a,e.credential_name,t),d.Z.success("Credential updated successfully"),x(!1),await i()},I=async e=>{if(!a)return;let l=Object.entries(e).filter(e=>{let[l]=e;return!E.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,c.credentialCreateCall)(a,t),d.Z.success("Credential added successfully"),u(!1),await i()},F=e=>{let l={openai:"blue",azure:"indigo",anthropic:"purple",default:"gray"},t=l[e.toLowerCase()]||l.default;return(0,s.jsx)(b.Ct,{color:t,size:"xs",children:e})},P=async()=>{if(a&&j){k(!0);try{await (0,c.credentialDeleteCall)(a,j.credential_name),d.Z.success("Credential deleted successfully"),await i()}catch(e){d.Z.error("Failed to delete credential")}finally{v(null),C(!1),k(!1)}}},L=e=>{v(e),C(!0)};return(0,s.jsxs)("div",{className:"w-full mx-auto flex-auto overflow-y-auto p-2",children:[(0,s.jsx)(b.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)(b.xv,{children:"Configured credentials for different AI providers. Add and manage your API credentials."})}),(0,s.jsx)(b.Zb,{children:(0,s.jsxs)(b.iA,{children:[(0,s.jsx)(b.ss,{children:(0,s.jsxs)(b.SC,{children:[(0,s.jsx)(b.xs,{children:"Credential Name"}),(0,s.jsx)(b.xs,{children:"Provider"}),(0,s.jsx)(b.xs,{children:"Actions"})]})}),(0,s.jsx)(b.RM,{children:n&&0!==n.length?n.map((e,l)=>{var t;return(0,s.jsxs)(b.SC,{children:[(0,s.jsx)(b.pj,{children:e.credential_name}),(0,s.jsx)(b.pj,{children:F((null===(t=e.credential_info)||void 0===t?void 0:t.custom_llm_provider)||"-")}),(0,s.jsxs)(b.pj,{children:[(0,s.jsx)(b.zx,{icon:_.Z,variant:"light",size:"sm",onClick:()=>{g(e),x(!0)}}),(0,s.jsx)(b.zx,{icon:y.Z,variant:"light",size:"sm",onClick:()=>L(e),className:"ml-2"})]})]},l)}):(0,s.jsx)(b.SC,{children:(0,s.jsx)(b.pj,{colSpan:4,className:"text-center py-4 text-gray-500",children:"No credentials configured"})})})]})}),m&&(0,s.jsx)(B,{onAddCredential:I,open:m,onCancel:()=>u(!1),uploadProps:t}),h&&(0,s.jsx)(G,{open:h,existingCredential:p,onUpdateCredential:M,uploadProps:t,onCancel:()=>x(!1)}),(0,s.jsx)(Z.Z,{isOpen:w,onCancel:()=>{v(null),C(!1)},onOk:P,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==j?void 0:j.credential_name},{label:"Provider",value:(null==j?void 0:null===(l=j.credential_info)||void 0===l?void 0:l.custom_llm_provider)||"-"}],confirmLoading:S,requiredConfirmation:null==j?void 0:j.credential_name})]})};let J=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 W=t(23628),Y=t(47323),$=t(12485),Q=t(18135),X=t(35242),ee=t(29706),el=t(77991),et=t(20347),es=t(59341),ea=t(5945),er=t(84376),ei=t(29),en=t.n(ei),eo=t(23496),ed=t(35291),ec=t(23639),em=t(15424);let{Text:eu}=C.default;var eh=e=>{let{formValues:l,accessToken:t,testMode:a,modelName:r="this model",onClose:i,onTestComplete:n}=e,[m,h]=o.useState(null),[x,p]=o.useState(null),[g,f]=o.useState(null),[j,v]=o.useState(!0),[_,y]=o.useState(!1),[b,N]=o.useState(!1),Z=async()=>{v(!0),N(!1),h(null),p(null),f(null),y(!1),await new Promise(e=>setTimeout(e,100));try{console.log("Testing connection with form values:",l);let a=await u(l,t,null);if(!a){console.log("No result from prepareModelAddRequest"),h("Failed to prepare model data. Please check your form inputs."),y(!1),v(!1);return}console.log("Result from prepareModelAddRequest:",a);let{litellmParamsObj:r,modelInfoObj:i,modelName:n}=a[0],o=await (0,c.testConnectionRequest)(t,r,i,null==i?void 0:i.mode);if("success"===o.status)d.Z.success("Connection test successful!"),h(null),y(!0);else{var e,s;let l=(null===(e=o.result)||void 0===e?void 0:e.error)||o.message||"Unknown error";h(l),p(r),f(null===(s=o.result)||void 0===s?void 0:s.raw_request_typed_dict),y(!1)}}catch(e){console.error("Test connection error:",e),h(e instanceof Error?e.message:String(e)),y(!1)}finally{v(!1),n&&n()}};o.useEffect(()=>{let e=setTimeout(()=>{Z()},200);return()=>clearTimeout(e)},[]);let w=e=>e?e.split("stack trace:")[0].trim().replace(/^litellm\.(.*?)Error: /,""):"Unknown error",C="string"==typeof m?w(m):(null==m?void 0:m.message)?w(m.message):"Unknown error",S=g?((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 }'")})(g.raw_request_api_base,g.raw_request_body,g.raw_request_headers||{}):"";return(0,s.jsxs)("div",{style:{padding:"24px",borderRadius:"8px",backgroundColor:"#fff"},children:[j?(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)(eu,{style:{fontSize:"16px"},children:["Testing connection to ",r,"..."]}),(0,s.jsx)(en(),{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)}}"})]}):_?(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)(eu,{type:"success",style:{fontSize:"18px",fontWeight:500,marginLeft:"10px"},children:["Connection to ",r," 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)(ed.Z,{style:{color:"#ff4d4f",fontSize:"24px",marginRight:"12px"}}),(0,s.jsxs)(eu,{type:"danger",style:{fontSize:"18px",fontWeight:500},children:["Connection to ",r," 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)(eu,{strong:!0,style:{display:"block",marginBottom:"8px"},children:["Error:"," "]}),(0,s.jsx)(eu,{type:"danger",style:{fontSize:"14px",lineHeight:"1.5"},children:C}),m&&(0,s.jsx)("div",{style:{marginTop:"12px"},children:(0,s.jsx)(E.ZP,{type:"link",onClick:()=>N(!b),style:{paddingLeft:0,height:"auto"},children:b?"Hide Details":"Show Details"})})]}),b&&(0,s.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,s.jsx)(eu,{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 m?m:JSON.stringify(m,null,2)})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(eu,{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:S||"No request data available"}),(0,s.jsx)(E.ZP,{style:{marginTop:"8px"},icon:(0,s.jsx)(ec.Z,{}),onClick:()=>{navigator.clipboard.writeText(S||""),d.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)(E.ZP,{type:"link",href:"https://docs.litellm.ai/docs/providers",target:"_blank",icon:(0,s.jsx)(em.Z,{}),children:"View Documentation"})})]})};let ex=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 a={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?a.litellm_params.auto_router_embedding_model=e.auto_router_embedding_model:e.custom_embedding_model&&(a.litellm_params.auto_router_embedding_model=e.custom_embedding_model),e.team_id&&(a.model_info.team_id=e.team_id),e.model_access_group&&e.model_access_group.length>0&&(a.model_info.access_groups=e.model_access_group),console.log("Auto router configuration to be created:",a),console.log("Auto router config (stringified):",a.litellm_params.auto_router_config),console.log("Calling modelCreateCall with:",{accessToken:l?"Present":"Missing",config:a});let r=await (0,c.modelCreateCall)(l,a);console.log("response for auto router create call:",r),t.resetFields()}catch(e){console.error("Failed to add auto router:",e),d.Z.fromBackend("Failed to add auto router: "+e)}};var ep=t(10703),eg=t(4260),ef=t(44851),ej=t(19015),ev=t(96473),e_=t(70464),ey=t(26349),eb=t(92280);let{TextArea:eN}=eg.default,{Panel:eZ}=ef.default;var ew=e=>{let{modelInfo:l,value:t,onChange:a}=e,[r,i]=(0,o.useState)([]),[n,d]=(0,o.useState)(!1),[c,m]=(0,o.useState)([]);(0,o.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),m(e.map(e=>e.id))}else i([]),m([])},[t]);let u=e=>{let l=r.filter(l=>l.id!==e);i(l),x(l),m(l=>l.filter(l=>l!==e))},h=(e,l,t)=>{let s=r.map(s=>s.id===e?{...s,[l]:t}:s);i(s),x(s)},x=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)},p=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)(eb.x,{className:"text-lg font-semibold",children:"Routes Configuration"}),(0,s.jsx)(A.Z,{title:"Configure routing logic to automatically select the best model based on user input patterns",children:(0,s.jsx)(em.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(E.ZP,{type:"primary",icon:(0,s.jsx)(ev.Z,{}),onClick:()=>{let e="route-".concat(Date.now()),l=[...r,{id:e,model:"",utterances:[],description:"",score_threshold:.5}];i(l),x(l),m(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)(eb.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)(ea.Z,{className:"border border-gray-200 shadow-sm w-full",bodyStyle:{padding:0},children:(0,s.jsx)(ef.default,{ghost:!0,expandIcon:e=>{let{isActive:l}=e;return(0,s.jsx)(e_.Z,{rotate:l?180:0})},activeKey:c,onChange:e=>m(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)(eb.x,{className:"font-medium text-base",children:["Route ",l+1,": ",e.model||"Unnamed"]}),(0,s.jsx)(E.ZP,{type:"text",danger:!0,icon:(0,s.jsx)(ey.Z,{}),onClick:l=>{l.stopPropagation(),u(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)(eb.x,{className:"text-sm font-medium mb-2 block",children:"Model"}),(0,s.jsx)(k.default,{value:e.model,onChange:l=>h(e.id,"model",l),placeholder:"Select model",showSearch:!0,style:{width:"100%"},options:p})]}),(0,s.jsxs)("div",{className:"mb-4 w-full",children:[(0,s.jsx)(eb.x,{className:"text-sm font-medium mb-2 block",children:"Description"}),(0,s.jsx)(eN,{value:e.description,onChange:l=>h(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)(eb.x,{className:"text-sm font-medium",children:"Score Threshold"}),(0,s.jsx)(A.Z,{title:"Minimum similarity score to route to this model (0-1)",children:(0,s.jsx)(em.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(ej.Z,{value:e.score_threshold,onChange:l=>h(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)(eb.x,{className:"text-sm font-medium",children:"Example Utterances"}),(0,s.jsx)(A.Z,{title:"Training examples for this route. Type an utterance and press Enter to add it.",children:(0,s.jsx)(em.Z,{className:"text-gray-400"})})]}),(0,s.jsx)(eb.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)(k.default,{mode:"tags",value:e.utterances,onChange:l=>h(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)(eb.x,{className:"text-lg font-semibold",children:"JSON Preview"}),(0,s.jsx)(E.ZP,{type:"link",onClick:()=>d(!n),className:"text-blue-600 p-0",children:n?"Hide":"Show"})]}),n&&(0,s.jsx)(ea.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:eC,Link:eS}=C.default;var ek=e=>{let{form:l,handleOk:t,accessToken:a,userRole:r}=e,[i,n]=(0,o.useState)(!1),[m,u]=(0,o.useState)(!1),[h,x]=(0,o.useState)(""),[p,g]=(0,o.useState)([]),[f,j]=(0,o.useState)([]),[v,_]=(0,o.useState)(!1),[y,b]=(0,o.useState)(!1),[Z,w]=(0,o.useState)(null);(0,o.useEffect)(()=>{(async()=>{g((await (0,c.modelAvailableCall)(a,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[a]),(0,o.useEffect)(()=>{(async()=>{try{let e=await (0,ep.p)(a);console.log("Fetched models for auto router:",e),j(e)}catch(e){console.error("Error fetching model info for auto router:",e)}})()},[a]);let M=et.ZL.includes(r),I=async()=>{u(!0),x("test-".concat(Date.now())),n(!0)},F=()=>{console.log("Auto router submit triggered!"),console.log("Router config:",Z);let e=l.getFieldsValue();if(console.log("Form values:",e),!e.auto_router_name){d.Z.fromBackend("Please enter an Auto Router Name");return}if(!e.auto_router_default_model){d.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"}),!Z||!Z.routes||0===Z.routes.length){d.Z.fromBackend("Please configure at least one route for the auto router");return}if(Z.routes.filter(e=>!e.name||!e.description||0===e.utterances.length).length>0){d.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:Z};console.log("Final submit values:",s),ex(s,a,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});d.Z.fromBackend("Please fill in the following required fields: ".concat(e.join(", ")))}else d.Z.fromBackend("Please fill in all required fields")})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eC,{level:2,children:"Add Auto Router"}),(0,s.jsx)(P.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)(ea.Z,{children:(0,s.jsxs)(N.Z,{form:l,onFinish:F,labelCol:{span:10},wrapperCol:{span:16},labelAlign:"left",children:[(0,s.jsx)(N.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)(P.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full mb-4",children:(0,s.jsx)(ew,{modelInfo:f,value:Z,onChange:e=>{w(e),l.setFieldValue("auto_router_config",e)}})}),(0,s.jsx)(N.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)(k.default,{placeholder:"Select a default model",onChange:e=>{_("custom"===e)},options:[...Array.from(new Set(f.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)(N.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)(k.default,{value:l.getFieldValue("auto_router_embedding_model"),placeholder:"Select an embedding model (optional)",onChange:e=>{b("custom"===e),l.setFieldValue("auto_router_embedding_model",e)},options:[...Array.from(new Set(f.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"})]}),M&&(0,s.jsx)(N.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)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:p.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)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(C.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(E.ZP,{onClick:I,loading:m,children:"Test Connect"}),(0,s.jsx)(E.ZP,{onClick:()=>{console.log("Add Auto Router button clicked!"),console.log("Current router config:",Z),console.log("Current form values:",l.getFieldsValue()),F()},children:"Add Auto Router"})]})]})]})}),(0,s.jsx)(S.Z,{title:"Connection Test Results",open:i,onCancel:()=>{n(!1),u(!1)},footer:[(0,s.jsx)(E.ZP,{onClick:()=>{n(!1),u(!1)},children:"Close"},"close")],width:700,children:i&&(0,s.jsx)(eh,{formValues:l.getFieldsValue(),accessToken:a,testMode:"chat",modelName:l.getFieldValue("auto_router_name"),onClose:()=>{n(!1),u(!1)},onTestComplete:()=>u(!1)},h)})]})};let eA=[{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"}];var eE=t(63709),eM=t(26210),eI=t(34766),eF=t(45246),eP=t(24199);let{Text:eL}=C.default;var eT=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)(N.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)(eE.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)(eL,{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)(N.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)(N.Z.Item,{...t,label:"Type",name:[t.name,"location"],initialValue:"message",className:"mb-0",style:{width:"180px"},children:(0,s.jsx)(k.default,{disabled:!0,options:[{value:"message",label:"Message"}]})}),(0,s.jsx)(N.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)(k.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)(N.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)(eP.Z,{type:"number",placeholder:"Optional",step:1,onChange:()=>{r(l.getFieldValue("cache_control_points"))}})}),e.length>1&&(0,s.jsx)(eF.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)(N.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)(ev.Z,{className:"mr-2"}),"Add Injection Point"]})})]})}})]})]})},eR=t(9309);let{Link:eO}=C.default;var eV=e=>{let{showAdvancedSettings:l,setShowAdvancedSettings:t,teams:a,guardrailsList:r,tagsList:i}=e,[n]=N.Z.useForm(),[d,c]=o.useState(!1),[m,u]=o.useState("per_token"),[h,x]=o.useState(!1),p=(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)(eM.UQ,{className:"mt-2 mb-4",children:[(0,s.jsx)(eM._m,{children:(0,s.jsx)("b",{children:"Advanced Settings"})}),(0,s.jsx)(eM.X1,{children:(0,s.jsxs)("div",{className:"bg-white rounded-lg",children:[(0,s.jsx)(N.Z.Item,{label:"Custom Pricing",name:"custom_pricing",valuePropName:"checked",className:"mb-4",children:(0,s.jsx)(eE.Z,{onChange:e=>{c(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)(N.Z.Item,{label:(0,s.jsxs)("span",{children:["Guardrails"," ",(0,s.jsx)(A.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)(em.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)(k.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter guardrails",options:r.map(e=>({value:e,label:e}))})}),(0,s.jsx)(N.Z.Item,{label:"Tags",name:"tags",className:"mb-4",children:(0,s.jsx)(k.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}))})}),d&&(0,s.jsxs)("div",{className:"ml-6 pl-4 border-l-2 border-gray-200",children:[(0,s.jsx)(N.Z.Item,{label:"Pricing Model",name:"pricing_model",className:"mb-4",children:(0,s.jsx)(k.default,{defaultValue:"per_token",onChange:e=>u(e),options:[{value:"per_token",label:"Per Million Tokens"},{value:"per_second",label:"Per Second"}]})}),"per_token"===m?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(N.Z.Item,{label:"Input Cost (per 1M tokens)",name:"input_cost_per_token",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})}),(0,s.jsx)(N.Z.Item,{label:"Output Cost (per 1M tokens)",name:"output_cost_per_token",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})})]}):(0,s.jsx)(N.Z.Item,{label:"Cost Per Second",name:"input_cost_per_second",rules:[{validator:p}],className:"mb-4",children:(0,s.jsx)(eM.oi,{})})]}),(0,s.jsx)(N.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)(eO,{href:"https://docs.litellm.ai/docs/pass_through/vertex_ai",target:"_blank",children:"Learn more"})]}),children:(0,s.jsx)(eE.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)(eT,{form:n,showCacheControl:h,onCacheControlChange:e=>{if(x(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)(N.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:eR.Ac}],children:(0,s.jsx)(eI.Z,{rows:4,placeholder:'{ "rpm": 100, "timeout": 0, "stream_timeout": 0 }'})}),(0,s.jsxs)(L.Z,{className:"mb-4",children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(eM.xv,{className:"text-gray-600 text-sm",children:["Pass JSON of litellm supported params"," ",(0,s.jsx)(eO,{href:"https://docs.litellm.ai/docs/completion/input",target:"_blank",children:"litellm.completion() call"})]})})]}),(0,s.jsx)(N.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:eR.Ac}],children:(0,s.jsx)(eI.Z,{rows:4,placeholder:'{ "mode": "chat" }'})})]})})]})})},eD=t(56609),ez=t(67187);let eq=e=>{let{content:l,children:t,width:a="auto",className:r=""}=e,[i,n]=(0,o.useState)(!1),[d,c]=(0,o.useState)("top"),m=(0,o.useRef)(null),u=()=>{if(m.current){let e=m.current.getBoundingClientRect(),l=e.top,t=window.innerHeight-e.bottom;l<300&&t>300?c("bottom"):c("top")}};return(0,s.jsxs)("div",{className:"relative inline-block",ref:m,children:[t||(0,s.jsx)(ez.Z,{className:"ml-1 text-gray-500 cursor-help",onMouseEnter:()=>{u(),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"===d?"bottom":"top"]:"100%",width:a,marginBottom:"top"===d?"8px":"0",marginTop:"bottom"===d?"8px":"0"},children:[l,(0,s.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 w-0 h-0",style:{top:"top"===d?"100%":"auto",bottom:"bottom"===d?"100%":"auto",borderTop:"top"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderBottom:"bottom"===d?"6px solid rgba(0, 0, 0, 0.9)":"6px solid transparent",borderLeft:"6px solid transparent",borderRight:"6px solid transparent"}})]})]})};var eB=()=>{let e=N.Z.useFormInstance(),[l,t]=(0,o.useState)(0),a=N.Z.useWatch("model",e)||[],r=Array.isArray(a)?a:[a],i=N.Z.useWatch("custom_model_name",e),n=!r.includes("all-wildcard"),d=N.Z.useWatch("custom_llm_provider",e);if((0,o.useEffect)(()=>{if(i&&r.includes("custom")){let l=(e.getFieldValue("model_mappings")||[]).map(e=>"custom"===e.public_name||"custom"===e.litellm_model?d===m.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,d,e]),(0,o.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:d===m.Cl.Azure?l.litellm_model==="azure/".concat(e):l.litellm_model===e))){let l=r.map(e=>"custom"===e&&i?d===m.Cl.Azure?{public_name:i,litellm_model:"azure/".concat(i)}:{public_name:i,litellm_model:i}:d===m.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,d,e]),!n)return null;let c=(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"]})]}),u=(0,s.jsx)("div",{children:"The model name LiteLLM will send to the LLM API"}),h=[{title:(0,s.jsxs)("span",{className:"flex items-center",children:["Public Model Name",(0,s.jsx)(eq,{content:c,width:"500px"})]}),dataIndex:"public_name",key:"public_name",render:(l,t,a)=>(0,s.jsx)(w.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)(eq,{content:u,width:"360px"})]}),dataIndex:"litellm_model",key:"litellm_model"}];return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.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)(eD.Z,{dataSource:e.getFieldValue("model_mappings"),columns:h,pagination:!1,size:"small"},l)})})},eU=e=>{let{selectedProvider:l,providerModels:t,getPlaceholder:a}=e,r=N.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===m.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)(N.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)(N.Z.Item,{name:"model",rules:[{required:!0,message:"Please enter ".concat(l===m.Cl.Azure?"a deployment name":"at least one model",".")}],noStyle:!0,children:l===m.Cl.Azure||l===m.Cl.OpenAI_Compatible||l===m.Cl.Ollama?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(P.o,{placeholder:a(l),onChange:l===m.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)(k.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===m.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)(P.o,{placeholder:a(l)})}),(0,s.jsx)(N.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)(N.Z.Item,{name:"custom_model_name",rules:[{required:!0,message:"Please enter a custom model name."}],className:"mt-2",children:(0,s.jsx)(P.o,{placeholder:l===m.Cl.Azure?"Enter Azure deployment name":"Enter custom model name",onChange:i})})}})]}),(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:14,children:(0,s.jsx)(P.x,{className:"mb-3 mt-1",children:l===m.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{Title:eG,Link:eH}=C.default;var eK=e=>{let{form:l,handleOk:t,selectedProvider:a,setSelectedProvider:r,providerModels:i,setProviderModelsFn:d,getPlaceholder:u,uploadProps:h,showAdvancedSettings:x,setShowAdvancedSettings:p,teams:g,credentials:f,accessToken:j,userRole:v,premiumUser:_}=e,[y]=N.Z.useForm(),[b,Z]=(0,o.useState)("chat"),[w,M]=(0,o.useState)(!1),[F,P]=(0,o.useState)(!1),[R,O]=(0,o.useState)([]),[V,D]=(0,o.useState)({}),[q,B]=(0,o.useState)(""),{data:U,isLoading:G,error:H}=I();(0,o.useEffect)(()=>{(async()=>{try{let e=(await (0,c.getGuardrailsList)(j)).guardrails.map(e=>e.guardrail_name);O(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[j]),(0,o.useEffect)(()=>{(async()=>{try{let e=await (0,c.tagListCall)(j);D(e)}catch(e){console.error("Failed to fetch tags:",e)}})()},[j]);let K=async()=>{P(!0),B("test-".concat(Date.now())),M(!0)},[J,W]=(0,o.useState)(!1),[Y,ei]=(0,o.useState)([]);(0,o.useEffect)(()=>{(async()=>{ei((await (0,c.modelAvailableCall)(j,"","",!1,null,!0,!0)).data.map(e=>e.id))})()},[j]);let en=(0,o.useMemo)(()=>U?[...U].sort((e,l)=>e.provider_display_name.localeCompare(l.provider_display_name)):[],[U]),eo=H?H instanceof Error?H.message:"Failed to load providers":null,ed=et.ZL.includes(v);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(Q.Z,{className:"w-full",children:[(0,s.jsxs)(X.Z,{className:"mb-4",children:[(0,s.jsx)($.Z,{children:"Add Model"}),(0,s.jsx)($.Z,{children:"Add Auto Router"})]}),(0,s.jsxs)(el.Z,{children:[(0,s.jsxs)(ee.Z,{children:[(0,s.jsx)(eG,{level:2,children:"Add Model"}),(0,s.jsx)(ea.Z,{children:(0,s.jsx)(N.Z,{form:l,onFinish:e=>{console.log("\uD83D\uDD25 Form onFinish triggered with values:",e),t()},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:[(0,s.jsx)(N.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)(k.default,{showSearch:!0,loading:G,placeholder:G?"Loading providers...":"Select a provider",optionFilterProp:"data-label",onChange:e=>{r(e),d(e),l.setFieldsValue({custom_llm_provider:e}),l.setFieldsValue({model:[],model_name:void 0})},children:[eo&&0===en.length&&(0,s.jsx)(k.default.Option,{value:"",children:eo},"__error"),en.map(e=>{var l;let t=e.provider_display_name,a=e.provider,r=null!==(l=m.cd[t])&&void 0!==l?l:"";return(0,s.jsx)(k.default.Option,{value:a,"data-label":t,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r?(0,s.jsx)("img",{src:r,alt:"".concat(t," logo"),className:"w-5 h-5",onError:e=>{let l=e.currentTarget,s=l.parentElement;if(s&&s.contains(l))try{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)}catch(e){console.error("Failed to replace provider logo fallback:",e)}}}):(0,s.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 flex items-center justify-center text-xs",children:t.charAt(0)}),(0,s.jsx)("span",{children:t})]})},a)})]})}),(0,s.jsx)(eU,{selectedProvider:a,providerModels:i,getPlaceholder:u}),(0,s.jsx)(eB,{}),(0,s.jsx)(N.Z.Item,{label:"Mode",name:"mode",className:"mb-1",children:(0,s.jsx)(k.default,{style:{width:"100%"},value:b,onChange:e=>Z(e),options:eA})}),(0,s.jsxs)(L.Z,{children:[(0,s.jsx)(T.Z,{span:10}),(0,s.jsx)(T.Z,{span:10,children:(0,s.jsxs)(n.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)(eH,{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)(C.default.Text,{className:"text-sm text-gray-500 mb-2",children:"Either select existing credentials OR enter new provider credentials below"})}),(0,s.jsx)(N.Z.Item,{label:"Existing Credentials",name:"litellm_credential_name",initialValue:null,children:(0,s.jsx)(k.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"},...f.map(e=>({value:e.credential_name,label:e.credential_name}))],allowClear:!0})}),(0,s.jsx)(N.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)(z,{selectedProvider:a,uploadProps:h})]})}}),(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"})]}),(0,s.jsx)(N.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)(A.Z,{title:_?"":"This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team.",placement:"top",children:(0,s.jsx)(es.Z,{checked:J,onChange:e=>{W(e),e||l.setFieldValue("team_id",void 0)},disabled:!_})})}),J&&(0,s.jsx)(N.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:J&&!ed,message:"Please select a team."}],children:(0,s.jsx)(er.Z,{teams:g,disabled:!_})}),ed&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(N.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)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:Y.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})}),(0,s.jsx)(eV,{showAdvancedSettings:x,setShowAdvancedSettings:p,teams:g,guardrailsList:R,tagsList:V}),(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(C.default.Link,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{className:"space-x-2",children:[(0,s.jsx)(E.ZP,{onClick:K,loading:F,children:"Test Connect"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Add Model"})]})]})]})})})]}),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(ek,{form:y,handleOk:()=>{y.validateFields().then(e=>{ex(e,j,y,t)}).catch(e=>{console.error("Validation failed:",e)})},accessToken:j,userRole:v})})]})]}),(0,s.jsx)(S.Z,{title:"Connection Test Results",open:w,onCancel:()=>{M(!1),P(!1)},footer:[(0,s.jsx)(E.ZP,{onClick:()=>{M(!1),P(!1)},children:"Close"},"close")],width:700,children:w&&(0,s.jsx)(eh,{formValues:l.getFieldsValue(),accessToken:j,testMode:b,modelName:l.getFieldValue("model_name")||l.getFieldValue("model"),onClose:()=>{M(!1),P(!1)},onTestComplete:()=>P(!1)},q)})]})},eJ=t(77331),eW=t(45589),eY=t(78489),e$=t(12514),eQ=t(49566),eX=t(96761),e0=t(30401),e1=t(78867),e2=t(59872),e4=e=>{let{isVisible:l,onCancel:t,onSuccess:a,modelData:r,accessToken:i,userRole:n}=e,[m]=N.Z.useForm(),[u,h]=(0,o.useState)(!1),[x,p]=(0,o.useState)([]),[g,f]=(0,o.useState)([]),[j,v]=(0,o.useState)(!1),[_,y]=(0,o.useState)(!1),[b,Z]=(0,o.useState)(null);(0,o.useEffect)(()=>{l&&r&&w()},[l,r]),(0,o.useEffect)(()=>{let e=async()=>{if(i)try{let e=await (0,c.modelAvailableCall)(i,"","",!1,null,!0,!0);p(e.data.map(e=>e.id))}catch(e){console.error("Error fetching model access groups:",e)}},t=async()=>{if(i)try{let e=await (0,ep.p)(i);f(e)}catch(e){console.error("Error fetching model info:",e)}};l&&(e(),t())},[l,i]);let w=()=>{try{var e,l,t,s,a,i;let n=null;(null===(e=r.litellm_params)||void 0===e?void 0:e.auto_router_config)&&(n="string"==typeof r.litellm_params.auto_router_config?JSON.parse(r.litellm_params.auto_router_config):r.litellm_params.auto_router_config),Z(n),m.setFieldsValue({auto_router_name:r.model_name,auto_router_default_model:(null===(l=r.litellm_params)||void 0===l?void 0:l.auto_router_default_model)||"",auto_router_embedding_model:(null===(t=r.litellm_params)||void 0===t?void 0:t.auto_router_embedding_model)||"",model_access_group:(null===(s=r.model_info)||void 0===s?void 0:s.access_groups)||[]});let o=new Set(g.map(e=>e.model_group));v(!o.has(null===(a=r.litellm_params)||void 0===a?void 0:a.auto_router_default_model)),y(!o.has(null===(i=r.litellm_params)||void 0===i?void 0:i.auto_router_embedding_model))}catch(e){console.error("Error parsing auto router config:",e),d.Z.fromBackend("Error loading auto router configuration")}},C=async()=>{try{h(!0);let e=await m.validateFields(),l={...r.litellm_params,auto_router_config:JSON.stringify(b),auto_router_default_model:e.auto_router_default_model,auto_router_embedding_model:e.auto_router_embedding_model||void 0},s={...r.model_info,access_groups:e.model_access_group||[]},n={model_name:e.auto_router_name,litellm_params:l,model_info:s};await (0,c.modelPatchUpdateCall)(i,n,r.model_info.id);let o={...r,model_name:e.auto_router_name,litellm_params:l,model_info:s};d.Z.success("Auto router configuration updated successfully"),a(o),t()}catch(e){console.error("Error updating auto router:",e),d.Z.fromBackend("Failed to update auto router configuration")}finally{h(!1)}},A=g.map(e=>({value:e.model_group,label:e.model_group}));return(0,s.jsx)(S.Z,{title:"Edit Auto Router Configuration",open:l,onCancel:t,footer:[(0,s.jsx)(E.ZP,{onClick:t,children:"Cancel"},"cancel"),(0,s.jsx)(E.ZP,{loading:u,onClick:C,children:"Save Changes"},"submit")],width:1e3,destroyOnClose:!0,children:(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)(P.x,{className:"text-gray-600",children:"Edit the auto router configuration including routing logic, default models, and access settings."}),(0,s.jsxs)(N.Z,{form:m,layout:"vertical",className:"space-y-4",children:[(0,s.jsx)(N.Z.Item,{label:"Auto Router Name",name:"auto_router_name",rules:[{required:!0,message:"Auto router name is required"}],children:(0,s.jsx)(P.o,{placeholder:"e.g., auto_router_1, smart_routing"})}),(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(ew,{modelInfo:g,value:b,onChange:e=>{Z(e)}})}),(0,s.jsx)(N.Z.Item,{label:"Default Model",name:"auto_router_default_model",rules:[{required:!0,message:"Default model is required"}],children:(0,s.jsx)(k.default,{placeholder:"Select a default model",onChange:e=>{v("custom"===e)},options:[...A,{value:"custom",label:"Enter custom model name"}],showSearch:!0})}),(0,s.jsx)(N.Z.Item,{label:"Embedding Model",name:"auto_router_embedding_model",children:(0,s.jsx)(k.default,{placeholder:"Select an embedding model (optional)",onChange:e=>{y("custom"===e)},options:[...A,{value:"custom",label:"Enter custom model name"}],showSearch:!0,allowClear:!0})}),"Admin"===n&&(0,s.jsx)(N.Z.Item,{label:"Model Access Groups",name:"model_access_group",tooltip:"Control who can access this auto router",children:(0,s.jsx)(k.default,{mode:"tags",showSearch:!0,placeholder:"Select existing groups or type to create new ones",optionFilterProp:"children",tokenSeparators:[","],options:x.map(e=>({value:e,label:e})),maxTagCount:"responsive",allowClear:!0})})]})]})})};let{Title:e5,Link:e6}=C.default;var e3=e=>{let{isVisible:l,onCancel:t,onAddCredential:a,existingCredential:r,setIsCredentialModalOpen:i}=e,[n]=N.Z.useForm();return console.log("existingCredential in add credentials tab: ".concat(JSON.stringify(r))),(0,s.jsx)(S.Z,{title:"Reuse Credentials",visible:l,onCancel:()=>{t(),n.resetFields()},footer:null,width:600,children:(0,s.jsxs)(N.Z,{form:n,onFinish:e=>{a(e),n.resetFields(),i(!1)},layout:"vertical",children:[(0,s.jsx)(N.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)(w.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)(N.Z.Item,{label:l,name:l,initialValue:t,children:(0,s.jsx)(w.o,{placeholder:"Enter ".concat(l),disabled:!0})},l)}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(A.Z,{title:"Get help on our github",children:(0,s.jsx)(e6,{href:"https://github.com/BerriAI/litellm/issues",children:"Need Help?"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)(E.ZP,{onClick:()=>{t(),n.resetFields()},style:{marginRight:10},children:"Cancel"}),(0,s.jsx)(E.ZP,{htmlType:"submit",children:"Reuse Credentials"})]})]})]})})};function e8(e){var l,t,a,r,u,h,x,p,g,f,j,v,_,b,Z,w,C,M,I,F,P,L,T,R,O,V,D,z,q,B,U,G;let{modelId:H,onClose:K,modelData:Y,accessToken:et,userID:es,userRole:ea,editModel:er,setEditModalVisible:ei,setSelectedModel:en,onModelUpdate:eo,modelAccessGroups:ed}=e,[ec]=N.Z.useForm(),[eu,eh]=(0,o.useState)(null),[ex,ep]=(0,o.useState)(!1),[ef,ej]=(0,o.useState)(!1),[ev,e_]=(0,o.useState)(!1),[ey,eb]=(0,o.useState)(!1),[eN,eZ]=(0,o.useState)(!1),[ew,eC]=(0,o.useState)(null),[eS,ek]=(0,o.useState)(!1),[eA,eE]=(0,o.useState)({}),[eM,eI]=(0,o.useState)(!1),[eF,eL]=(0,o.useState)([]),[eO,eV]=(0,o.useState)({}),eD=("Admin"===ea||(null==Y?void 0:null===(l=Y.model_info)||void 0===l?void 0:l.created_by)===es)&&(null==Y?void 0:null===(t=Y.model_info)||void 0===t?void 0:t.db_model),ez="Admin"===ea,eq=(null==Y?void 0:null===(a=Y.litellm_params)||void 0===a?void 0:a.auto_router_config)!=null,eB=(null==Y?void 0:null===(r=Y.litellm_params)||void 0===r?void 0:r.litellm_credential_name)!=null&&(null==Y?void 0:null===(u=Y.litellm_params)||void 0===u?void 0:u.litellm_credential_name)!=void 0;console.log("usingExistingCredential, ",eB),console.log("modelData.litellm_params.litellm_credential_name, ",null==Y?void 0:null===(h=Y.litellm_params)||void 0===h?void 0:h.litellm_credential_name),console.log("tagsList, ",null===(x=Y.litellm_params)||void 0===x?void 0:x.tags),(0,o.useEffect)(()=>{let e=async()=>{var e,l,t,s,a,r,i;if(!et)return;let n=await (0,c.modelInfoV1Call)(et,H);console.log("modelInfoResponse, ",n);let o=n.data[0];o&&!o.litellm_model_name&&(o={...o,litellm_model_name:null!==(i=null!==(r=null!==(a=null==o?void 0:null===(l=o.litellm_params)||void 0===l?void 0:l.litellm_model_name)&&void 0!==a?a:null==o?void 0:null===(t=o.litellm_params)||void 0===t?void 0:t.model)&&void 0!==r?r:null==o?void 0:null===(s=o.model_info)||void 0===s?void 0:s.key)&&void 0!==i?i:null}),eh(o),(null==o?void 0:null===(e=o.litellm_params)||void 0===e?void 0:e.cache_control_injection_points)&&ek(!0)},l=async()=>{if(et)try{let e=(await (0,c.getGuardrailsList)(et)).guardrails.map(e=>e.guardrail_name);eL(e)}catch(e){console.error("Failed to fetch guardrails:",e)}},t=async()=>{if(et)try{let e=await (0,c.tagListCall)(et);eV(e)}catch(e){console.error("Failed to fetch tags:",e)}};(async()=>{if(console.log("accessToken, ",et),!et||eB)return;let e=await (0,c.credentialGetCall)(et,null,H);console.log("existingCredentialResponse, ",e),eC({credential_name:e.credential_name,credential_values:e.credential_values,credential_info:e.credential_info})})(),e(),l(),t()},[et,H]);let eU=async e=>{var l;if(console.log("values, ",e),!et)return;let t={credential_name:e.credential_name,model_id:H,credential_info:{custom_llm_provider:null===(l=eu.litellm_params)||void 0===l?void 0:l.custom_llm_provider}};d.Z.info("Storing credential.."),console.log("credentialResponse, ",await (0,c.credentialCreateCall)(et,t)),d.Z.success("Credential stored successfully")},eG=async e=>{try{var l;let t;if(!et)return;eb(!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){d.Z.fromBackend("Invalid JSON in LiteLLM Params"),eb(!1);return}let a={...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&&(a.guardrails=e.guardrails),e.cache_control&&(null===(l=e.cache_control_injection_points)||void 0===l?void 0:l.length)>0?a.cache_control_injection_points=e.cache_control_injection_points:delete a.cache_control_injection_points;try{t=e.model_info?JSON.parse(e.model_info):Y.model_info,e.model_access_group&&(t={...t,access_groups:e.model_access_group})}catch(e){d.Z.fromBackend("Invalid JSON in Model Info");return}let r={model_name:e.model_name,litellm_params:a,model_info:t};await (0,c.modelPatchUpdateCall)(et,r,H);let i={...eu,model_name:e.model_name,litellm_model_name:e.litellm_model_name,litellm_params:a,model_info:t};eh(i),eo&&eo(i),d.Z.success("Model settings updated successfully"),e_(!1),eZ(!1)}catch(e){console.error("Error updating model:",e),d.Z.fromBackend("Failed to update model settings")}finally{eb(!1)}};if(!Y)return(0,s.jsxs)("div",{className:"p-4",children:[(0,s.jsx)(eY.Z,{icon:eJ.Z,variant:"light",onClick:K,className:"mb-4",children:"Back to Models"}),(0,s.jsx)(n.Z,{children:"Model not found"})]});let eH=async()=>{if(et)try{var e,l,t;d.Z.info("Testing connection...");let s=await (0,c.testConnectionRequest)(et,{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)d.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?d.Z.error("Error testing connection: "+(0,eR.aS)(e.message,100)):d.Z.error("Error testing connection: "+String(e))}},eK=async()=>{try{if(!et)return;await (0,c.modelDeleteCall)(et,H),d.Z.success("Model deleted successfully"),eo&&eo({deleted:!0,model_info:{id:H}}),K()}catch(e){console.error("Error deleting the model:",e),d.Z.fromBackend("Failed to delete model")}},e5=async(e,l)=>{await (0,e2.vQ)(e)&&(eE(e=>({...e,[l]:!0})),setTimeout(()=>{eE(e=>({...e,[l]:!1}))},2e3))};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)(eY.Z,{icon:eJ.Z,variant:"light",onClick:K,className:"mb-4",children:"Back to Models"}),(0,s.jsxs)(eX.Z,{children:["Public Model Name: ",J(Y)]}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsx)(n.Z,{className:"text-gray-500 font-mono",children:Y.model_info.id}),(0,s.jsx)(E.ZP,{type:"text",size:"small",icon:eA["model-id"]?(0,s.jsx)(e0.Z,{size:12}):(0,s.jsx)(e1.Z,{size:12}),onClick:()=>e5(Y.model_info.id,"model-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eA["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)(eY.Z,{variant:"secondary",icon:W.Z,onClick:eH,className:"flex items-center gap-2","data-testid":"test-connection-button",children:"Test Connection"}),(0,s.jsx)(eY.Z,{icon:eW.Z,variant:"secondary",onClick:()=>ej(!0),className:"flex items-center",disabled:!ez,"data-testid":"reuse-credentials-button",children:"Re-use Credentials"}),(0,s.jsx)(eY.Z,{icon:y.Z,variant:"secondary",onClick:()=>ep(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-700",disabled:!eD,"data-testid":"delete-model-button",children:"Delete Model"})]})]}),(0,s.jsxs)(Q.Z,{children:[(0,s.jsxs)(X.Z,{className:"mb-6",children:[(0,s.jsx)($.Z,{children:"Overview"}),(0,s.jsx)($.Z,{children:"Raw JSON"})]}),(0,s.jsxs)(el.Z,{children:[(0,s.jsxs)(ee.Z,{children:[(0,s.jsxs)(i.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6 mb-6",children:[(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"Provider"}),(0,s.jsxs)("div",{className:"mt-2 flex items-center space-x-2",children:[Y.provider&&(0,s.jsx)("img",{src:(0,m.dr)(Y.provider).logo,alt:"".concat(Y.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=Y.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)(eX.Z,{children:Y.provider||"Not Set"})]})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"LiteLLM Model"}),(0,s.jsx)("div",{className:"mt-2 overflow-hidden",children:(0,s.jsx)(A.Z,{title:Y.litellm_model_name||"Not Set",children:(0,s.jsx)("div",{className:"break-all text-sm font-medium leading-relaxed cursor-pointer",children:Y.litellm_model_name||"Not Set"})})})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(n.Z,{children:"Pricing"}),(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsxs)(n.Z,{children:["Input: $",Y.input_cost,"/1M tokens"]}),(0,s.jsxs)(n.Z,{children:["Output: $",Y.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"," ",Y.model_info.created_at?new Date(Y.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 ",Y.model_info.created_by||"Not Set"]})]}),(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(eX.Z,{children:"Model Settings"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[eq&&eD&&!eN&&(0,s.jsx)(eY.Z,{onClick:()=>eI(!0),className:"flex items-center",children:"Edit Auto Router"}),eD?!eN&&(0,s.jsx)(eY.Z,{onClick:()=>eZ(!0),className:"flex items-center",children:"Edit Settings"}):(0,s.jsx)(A.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)(em.Z,{})})]})]}),eu?(0,s.jsx)(N.Z,{form:ec,onFinish:eG,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===(p=eu.model_info)||void 0===p?void 0:p.input_cost_per_token)*1e6||null,output_cost:(null===(g=eu.litellm_params)||void 0===g?void 0:g.output_cost_per_token)?1e6*eu.litellm_params.output_cost_per_token:(null===(f=eu.model_info)||void 0===f?void 0:f.output_cost_per_token)*1e6||null,cache_control:null!==(j=eu.litellm_params)&&void 0!==j&&!!j.cache_control_injection_points,cache_control_injection_points:(null===(v=eu.litellm_params)||void 0===v?void 0:v.cache_control_injection_points)||[],model_access_group:Array.isArray(null===(_=eu.model_info)||void 0===_?void 0:_.access_groups)?eu.model_info.access_groups:[],guardrails:Array.isArray(null===(b=eu.litellm_params)||void 0===b?void 0:b.guardrails)?eu.litellm_params.guardrails:[],tags:Array.isArray(null===(Z=eu.litellm_params)||void 0===Z?void 0:Z.tags)?eu.litellm_params.tags:[],litellm_extra_params:JSON.stringify(eu.litellm_params||{},null,2)},layout:"vertical",onValuesChange:()=>e_(!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)(n.Z,{className:"font-medium",children:"Model Name"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_name",className:"mb-0",children:(0,s.jsx)(eQ.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)(n.Z,{className:"font-medium",children:"LiteLLM Model Name"}),eN?(0,s.jsx)(N.Z.Item,{name:"litellm_model_name",className:"mb-0",children:(0,s.jsx)(eQ.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)(n.Z,{className:"font-medium",children:"Input Cost (per 1M tokens)"}),eN?(0,s.jsx)(N.Z.Item,{name:"input_cost",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter input cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eu?void 0:null===(w=eu.litellm_params)||void 0===w?void 0:w.input_cost_per_token)?((null===(C=eu.litellm_params)||void 0===C?void 0:C.input_cost_per_token)*1e6).toFixed(4):(null==eu?void 0:null===(M=eu.model_info)||void 0===M?void 0:M.input_cost_per_token)?(1e6*eu.model_info.input_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Output Cost (per 1M tokens)"}),eN?(0,s.jsx)(N.Z.Item,{name:"output_cost",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter output cost"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null==eu?void 0:null===(I=eu.litellm_params)||void 0===I?void 0:I.output_cost_per_token)?(1e6*eu.litellm_params.output_cost_per_token).toFixed(4):(null==eu?void 0:null===(F=eu.model_info)||void 0===F?void 0:F.output_cost_per_token)?(1e6*eu.model_info.output_cost_per_token).toFixed(4):null})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"API Base"}),eN?(0,s.jsx)(N.Z.Item,{name:"api_base",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter API base"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(P=eu.litellm_params)||void 0===P?void 0:P.api_base)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Custom LLM Provider"}),eN?(0,s.jsx)(N.Z.Item,{name:"custom_llm_provider",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter custom LLM provider"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(L=eu.litellm_params)||void 0===L?void 0:L.custom_llm_provider)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Organization"}),eN?(0,s.jsx)(N.Z.Item,{name:"organization",className:"mb-0",children:(0,s.jsx)(eQ.Z,{placeholder:"Enter organization"})}):(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.organization)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"TPM (Tokens per Minute)"}),eN?(0,s.jsx)(N.Z.Item,{name:"tpm",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter TPM"})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(R=eu.litellm_params)||void 0===R?void 0:R.tpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"RPM (Requests per Minute)"}),eN?(0,s.jsx)(N.Z.Item,{name:"rpm",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter RPM"})}):(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.rpm)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Max Retries"}),eN?(0,s.jsx)(N.Z.Item,{name:"max_retries",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter max retries"})}):(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.max_retries)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Timeout (seconds)"}),eN?(0,s.jsx)(N.Z.Item,{name:"timeout",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter timeout"})}):(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.timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Stream Timeout (seconds)"}),eN?(0,s.jsx)(N.Z.Item,{name:"stream_timeout",className:"mb-0",children:(0,s.jsx)(eP.Z,{placeholder:"Enter stream timeout"})}):(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.stream_timeout)||"Not Set"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Model Access Groups"}),eN?(0,s.jsx)(N.Z.Item,{name:"model_access_group",className:"mb-0",children:(0,s.jsx)(k.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==ed?void 0:ed.map(e=>({value:e,label:e}))})}):(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:(null===(q=eu.model_info)||void 0===q?void 0:q.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)(n.Z,{className:"font-medium",children:["Guardrails",(0,s.jsx)(A.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)(em.Z,{style:{marginLeft:"4px"}})})})]}),eN?(0,s.jsx)(N.Z.Item,{name:"guardrails",className:"mb-0",children:(0,s.jsx)(k.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:eF.map(e=>({value:e,label:e}))})}):(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.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)(n.Z,{className:"font-medium",children:"Tags"}),eN?(0,s.jsx)(N.Z.Item,{name:"tags",className:"mb-0",children:(0,s.jsx)(k.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(eO).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===(U=eu.litellm_params)||void 0===U?void 0:U.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"})]}),eN?(0,s.jsx)(eT,{form:ec,showCacheControl:eS,onCacheControlChange:e=>ek(e)}):(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"font-medium",children:"Cache Control"}),(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.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)(n.Z,{className:"font-medium",children:"Model Info"}),eN?(0,s.jsx)(N.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(Y.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)(n.Z,{className:"font-medium",children:["LiteLLM Params",(0,s.jsx)(A.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)(em.Z,{style:{marginLeft:"4px"}})})})]}),eN?(0,s.jsx)(N.Z.Item,{name:"litellm_extra_params",rules:[{validator:eR.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)(n.Z,{className:"font-medium",children:"Team ID"}),(0,s.jsx)("div",{className:"mt-1 p-2 bg-gray-50 rounded",children:Y.model_info.team_id||"Not Set"})]})]}),eN&&(0,s.jsxs)("div",{className:"mt-6 flex justify-end gap-2",children:[(0,s.jsx)(eY.Z,{variant:"secondary",onClick:()=>{ec.resetFields(),e_(!1),eZ(!1)},disabled:ey,children:"Cancel"}),(0,s.jsx)(eY.Z,{variant:"primary",onClick:()=>ec.submit(),loading:ey,children:"Save Changes"})]})]})}):(0,s.jsx)(n.Z,{children:"Loading..."})]})]}),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(e$.Z,{children:(0,s.jsx)("pre",{className:"bg-gray-100 p-4 rounded text-xs overflow-auto",children:JSON.stringify(Y,null,2)})})})]})]}),ex&&(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 Model"}),(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 model?"})})]})})}),(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)(E.ZP,{onClick:eK,className:"ml-2",danger:!0,children:"Delete"}),(0,s.jsx)(E.ZP,{onClick:()=>ep(!1),children:"Cancel"})]})]})]})}),ef&&!eB?(0,s.jsx)(e3,{isVisible:ef,onCancel:()=>ej(!1),onAddCredential:eU,existingCredential:ew,setIsCredentialModalOpen:ej}):(0,s.jsx)(S.Z,{open:ef,onCancel:()=>ej(!1),title:"Using Existing Credential",children:(0,s.jsx)(n.Z,{children:Y.litellm_params.litellm_credential_name})}),(0,s.jsx)(e4,{isVisible:eM,onCancel:()=>eI(!1),onSuccess:e=>{eh(e),eo&&eo(e)},modelData:eu||Y,accessToken:et||"",userRole:ea||""})]})}var e7=t(33293),e9=t(11318),le=t(8048),ll=t(41649);let lt=e=>{let{provider:l,className:t="w-4 h-4"}=e,[a,r]=(0,o.useState)(!1),{logo:i}=(0,m.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)})},ls=(e,l,t,a,r,i,n,o,d,c,m)=>[{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)(A.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)(A.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)(lt,{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)(A.Z,{title:"Credential: ".concat(a),children:(0,s.jsxs)("div",{className:"flex items-center space-x-2 max-w-[180px]",children:[(0,s.jsx)(eW.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)(eW.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)(A.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)(A.Z,{title:t.model_info.team_id,children:(0,s.jsxs)(eY.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=c.has(r),n=a.length>1,o=()=>{let e=new Set(c);i?e.delete(r):e.add(r),m(e)};return(0,s.jsxs)("div",{className:"flex items-center gap-1 overflow-hidden",children:[(0,s.jsx)(ll.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)(ll.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,c="Admin"===e||(null===(r=o.model_info)||void 0===r?void 0:r.created_by)===l,m=!(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:m?(0,s.jsx)(A.Z,{title:"Config model cannot be deleted on the dashboard. Please delete it from the config file.",children:(0,s.jsx)(Y.Z,{icon:y.Z,size:"sm",className:"opacity-50 cursor-not-allowed"})}):(0,s.jsx)(A.Z,{title:"Delete model",children:(0,s.jsx)(Y.Z,{icon:y.Z,size:"sm",onClick:()=>{c&&(a(o.model_info.id),d(!1))},className:c?"cursor-pointer hover:text-red-600":"opacity-50 cursor-not-allowed"})})})}}];var la=t(27281),lr=t(43227),li=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,availableModelAccessGroups:r,setSelectedModelId:d,setSelectedTeamId:c,setEditModel:m,modelData:u}=e,{userId:h,userRole:x,premiumUser:p}=(0,H.Z)(),{teams:g}=(0,e9.Z)(),[f,j]=(0,o.useState)(""),[v,_]=(0,o.useState)("current_team"),[y,b]=(0,o.useState)("personal"),[N,Z]=(0,o.useState)(!1),[w,C]=(0,o.useState)(null),[S,k]=(0,o.useState)(new Set),[A,E]=(0,o.useState)({pageIndex:0,pageSize:50}),M=(0,o.useRef)(null),I=(0,o.useMemo)(()=>u&&u.data&&0!==u.data.length?u.data.filter(e=>{var t,s,a,r,i,n;let o=""===f||e.model_name.toLowerCase().includes(f.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"===w||(null===(s=e.model_info.access_groups)||void 0===s?void 0:s.includes(w))||!w,m=!0;if("current_team"===v){if("personal"===y)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(y.team_id))===!0,t=(null===(n=y.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}):[],[u,f,l,w,y,v]),F=(0,o.useMemo)(()=>{let e=A.pageIndex*A.pageSize,l=e+A.pageSize;return I.slice(e,l)},[I,A.pageIndex,A.pageSize]);return(0,o.useEffect)(()=>{E(e=>({...e,pageIndex:0}))},[f,l,w,y,v]),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(i.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)(n.Z,{className:"text-lg font-semibold text-gray-900",children:"Current Team:"}),(0,s.jsxs)(la.Z,{className:"w-80",defaultValue:"personal",value:"personal"===y?"personal":y.team_id,onValueChange:e=>{if("personal"===e)b("personal");else{let l=null==g?void 0:g.find(l=>l.team_id===e);l&&b(l)}},children:[(0,s.jsx)(lr.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==g?void 0:g.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.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)(n.Z,{className:"text-lg font-semibold text-gray-900",children:"View:"}),(0,s.jsxs)(la.Z,{className:"w-64",defaultValue:"current_team",value:v,onValueChange:e=>_(e),children:[(0,s.jsx)(lr.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)(lr.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"===v&&(0,s.jsxs)("div",{className:"flex items-start gap-2 mt-3",children:[(0,s.jsx)(em.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"===y?(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 y?y.team_alias||y.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:f,onChange:e=>j(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(N?"bg-gray-100":""),onClick:()=>Z(!N),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:()=>{j(""),t("all"),C(null),b("personal"),_("current_team"),E({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"]})]}),N&&(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)(la.Z,{value:null!=l?l:"all",onValueChange:e=>t("all"===e?"all":e),placeholder:"Filter by Public Model Name",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Models"}),(0,s.jsx)(lr.Z,{value:"wildcard",children:"Wildcard Models (*)"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})}),(0,s.jsx)("div",{className:"w-64",children:(0,s.jsxs)(la.Z,{value:null!=w?w:"all",onValueChange:e=>C("all"===e?null:e),placeholder:"Filter by Model Access Group",children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Model Access Groups"}),r.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,children:e},l))]})})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700",children:I.length>0?"Showing ".concat(A.pageIndex*A.pageSize+1," - ").concat(Math.min((A.pageIndex+1)*A.pageSize,I.length)," of ").concat(I.length," results"):"Showing 0 results"}),I.length>A.pageSize&&(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("button",{onClick:()=>E(e=>({...e,pageIndex:e.pageIndex-1})),disabled:0===A.pageIndex,className:"px-3 py-1 text-sm border rounded-md ".concat(0===A.pageIndex?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Previous"}),(0,s.jsx)("button",{onClick:()=>E(e=>({...e,pageIndex:e.pageIndex+1})),disabled:A.pageIndex>=Math.ceil(I.length/A.pageSize)-1,className:"px-3 py-1 text-sm border rounded-md ".concat(A.pageIndex>=Math.ceil(I.length/A.pageSize)-1?"bg-gray-100 text-gray-400 cursor-not-allowed":"hover:bg-gray-50"),children:"Next"})]})]})]})}),(0,s.jsx)(le.C,{columns:ls(x,h,p,d,c,J,()=>{},()=>{},m,S,k),data:F,isLoading:!1,table:M})]})})})})},ln=t(75105),lo=t(40278),ld=t(97765),lc=t(21626),lm=t(97214),lu=t(28241),lh=t(58834),lx=t(69552),lp=t(71876),lg=t(39789),lf=t(79326),lj=t(2356),lv=t(59664),l_=e=>{let{modelMetrics:l,modelMetricsCategories:t,customTooltip:a,premiumUser:r}=e;return(0,s.jsx)(lv.Z,{title:"Time to First token (s)",className:"h-72",data:l,index:"date",showLegend:!1,categories:t,colors:["indigo","rose"],connectNulls:!0,customTooltip:a})},ly=e=>{let{setSelectedAPIKey:l,keys:t,teams:a,setSelectedCustomer:r,allEndUsers:i}=e,{premiumUser:d}=(0,H.Z)(),[c,m]=(0,o.useState)(null);return(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"mb-1",children:"Select API Key Name"}),d?(0,s.jsxs)("div",{children:[(0,s.jsxs)(la.Z,{defaultValue:"all-keys",children:[(0,s.jsx)(lr.Z,{value:"all-keys",onClick:()=>{l(null)},children:"All Keys"},"all-keys"),null==t?void 0:t.map((e,t)=>e&&null!==e.key_alias&&e.key_alias.length>0?(0,s.jsx)(lr.Z,{value:String(t),onClick:()=>{l(e)},children:e.key_alias},t):null)]}),(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Customer Name"}),(0,s.jsxs)(la.Z,{defaultValue:"all-customers",children:[(0,s.jsx)(lr.Z,{value:"all-customers",onClick:()=>{r(null)},children:"All Customers"},"all-customers"),null==i?void 0:i.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>{r(e)},children:e},l))]}),(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==a?void 0:a.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)(n.Z,{className:"mt-1",children:"Select Team"}),(0,s.jsxs)(la.Z,{className:"w-64 relative z-50",defaultValue:"all",value:null!=c?c:"all",onValueChange:e=>m("all"===e?null:e),children:[(0,s.jsx)(lr.Z,{value:"all",children:"All Teams"}),null==a?void 0:a.filter(e=>e.team_id).map(e=>(0,s.jsx)(lr.Z,{value:e.team_id,children:e.team_alias?"".concat(e.team_alias," (").concat(e.team_id.slice(0,8),"...)"):"Team ".concat(e.team_id.slice(0,8),"...")},e.team_id))]})]})]})},lb=e=>{let{dateValue:l,setDateValue:t,selectedModelGroup:a,availableModelGroups:d,setShowAdvancedFilters:m,modelMetrics:u,modelMetricsCategories:h,streamingModelMetrics:x,streamingModelMetricsCategories:p,customTooltip:g,slowResponsesData:f,modelExceptions:j,globalExceptionData:v,allExceptions:_,globalExceptionPerDeployment:y,setSelectedAPIKey:b,keys:N,setSelectedCustomer:Z,teams:w,allEndUsers:C,selectedAPIKey:S,selectedCustomer:k,selectedTeam:A,setSelectedModelGroup:E,setModelMetrics:M,setModelMetricsCategories:I,setStreamingModelMetrics:F,setStreamingModelMetricsCategories:P,setSlowResponsesData:L,setModelExceptions:T,setAllExceptions:R,setGlobalExceptionData:O,setGlobalExceptionPerDeployment:V}=e,{accessToken:D,userId:z,userRole:q,premiumUser:B}=(0,H.Z)();(0,o.useEffect)(()=>{U(a,l.from,l.to)},[S,k,A]);let U=async(e,l,t)=>{if(console.log("Updating model metrics for group:",e),!D||!z||!q||!l||!t)return;console.log("inside updateModelMetrics - startTime:",l,"endTime:",t),E(e);let s=null==S?void 0:S.token;void 0===s&&(s=null);let a=k;void 0===a&&(a=null);try{let r=await (0,c.modelMetricsCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);console.log("Model metrics response:",r),M(r.data),I(r.all_api_bases);let i=await (0,c.streamingModelMetricsCall)(D,e,l.toISOString(),t.toISOString());F(i.data),P(i.all_api_bases);let n=await (0,c.modelExceptionsCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);console.log("Model exceptions response:",n),T(n.data),R(n.exception_types);let o=await (0,c.modelMetricsSlowResponsesCall)(D,z,q,e,l.toISOString(),t.toISOString(),s,a);if(console.log("slowResponses:",o),L(o),e){let s=await (0,c.adminGlobalActivityExceptions)(D,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);O(s);let a=await (0,c.adminGlobalActivityExceptionsPerDeployment)(D,null==l?void 0:l.toISOString().split("T")[0],null==t?void 0:t.toISOString().split("T")[0],e);V(a)}}catch(e){console.error("Failed to fetch model metrics",e)}};return(0,s.jsxs)(ee.Z,{children:[(0,s.jsx)("div",{className:"mb-4 rounded-md border border-red-500 bg-red-50 p-4",children:(0,s.jsx)(n.Z,{className:"font-semibold text-red-700",children:"This page is deprecated and will be removed in the future. Some functionality may not work as expected."})}),(0,s.jsxs)(i.Z,{numItems:4,className:"mt-2 mb-2",children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(lg.Z,{value:l,className:"mr-2",onValueChange:e=>{t(e),U(a,e.from,e.to)}})}),(0,s.jsxs)(r.Z,{className:"ml-2",children:[(0,s.jsx)(n.Z,{children:"Select Model Group"}),(0,s.jsx)(la.Z,{defaultValue:a||d[0],value:a||d[0],children:d.map((e,t)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>U(e,l.from,l.to),children:e},t))})]}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(lf.Z,{trigger:"click",content:(0,s.jsx)(ly,{allEndUsers:C,keys:N,setSelectedAPIKey:b,setSelectedCustomer:Z,teams:w}),overlayStyle:{width:"20vw"},children:(0,s.jsx)(eY.Z,{icon:lj.Z,size:"md",variant:"secondary",className:"mt-4 ml-2",style:{border:"none"},onClick:()=>m(!0)})})})]}),(0,s.jsxs)(i.Z,{numItems:2,children:[(0,s.jsx)(r.Z,{children:(0,s.jsx)(e$.Z,{className:"mr-2 max-h-[400px] min-h-[400px]",children:(0,s.jsxs)(Q.Z,{children:[(0,s.jsxs)(X.Z,{variant:"line",defaultValue:"1",children:[(0,s.jsx)($.Z,{value:"1",children:"Avg. Latency per Token"}),(0,s.jsx)($.Z,{value:"2",children:"Time to first token"})]}),(0,s.jsxs)(el.Z,{children:[(0,s.jsxs)(ee.Z,{children:[(0,s.jsx)("p",{className:"text-gray-500 italic",children:" (seconds/token)"}),(0,s.jsx)(n.Z,{className:"text-gray-500 italic mt-1 mb-1",children:"average Latency for successfull requests divided by the total tokens"}),u&&h&&(0,s.jsx)(ln.Z,{title:"Model Latency",className:"h-72",data:u,showLegend:!1,index:"date",categories:h,connectNulls:!0,customTooltip:g})]}),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(l_,{modelMetrics:x,modelMetricsCategories:p,customTooltip:g,premiumUser:B})})]})]})})}),(0,s.jsx)(r.Z,{children:(0,s.jsx)(e$.Z,{className:"ml-2 max-h-[400px] min-h-[400px] overflow-y-auto",children:(0,s.jsxs)(lc.Z,{children:[(0,s.jsx)(lh.Z,{children:(0,s.jsxs)(lp.Z,{children:[(0,s.jsx)(lx.Z,{children:"Deployment"}),(0,s.jsx)(lx.Z,{children:"Success Responses"}),(0,s.jsxs)(lx.Z,{children:["Slow Responses ",(0,s.jsx)("p",{children:"Success Responses taking 600+s"})]})]})}),(0,s.jsx)(lm.Z,{children:f.map((e,l)=>(0,s.jsxs)(lp.Z,{children:[(0,s.jsx)(lu.Z,{children:e.api_base}),(0,s.jsx)(lu.Z,{children:e.total_count}),(0,s.jsx)(lu.Z,{children:e.slow_count})]},l))})]})})})]}),(0,s.jsx)(i.Z,{numItems:1,className:"gap-2 w-full mt-2",children:(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)(eX.Z,{children:["All Exceptions for ",a]}),(0,s.jsx)(lo.Z,{className:"h-60",data:j,index:"model",categories:_,stack:!0,yAxisWidth:30})]})}),(0,s.jsxs)(i.Z,{numItems:1,className:"gap-2 w-full mt-2",children:[(0,s.jsxs)(e$.Z,{children:[(0,s.jsxs)(eX.Z,{children:["All Up Rate Limit Errors (429) for ",a]}),(0,s.jsxs)(i.Z,{numItems:1,children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",v.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:v.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]}),(0,s.jsx)(r.Z,{})]})]}),B?(0,s.jsx)(s.Fragment,{children:y.map((e,l)=>(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:e.api_base?e.api_base:"Unknown API Base"}),(0,s.jsx)(i.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors (429) ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]},l))}):(0,s.jsx)(s.Fragment,{children:y&&y.length>0&&y.slice(0,1).map((e,l)=>(0,s.jsxs)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:"✨ Rate Limit Errors by Deployment"}),(0,s.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to see exceptions for all deployments"}),(0,s.jsx)(eY.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)(e$.Z,{children:[(0,s.jsx)(eX.Z,{children:e.api_base}),(0,s.jsx)(i.Z,{numItems:1,children:(0,s.jsxs)(r.Z,{children:[(0,s.jsxs)(ld.Z,{style:{fontSize:"15px",fontWeight:"normal",color:"#535452"},children:["Num Rate Limit Errors ",e.sum_num_rate_limit_exceptions]}),(0,s.jsx)(lo.Z,{className:"h-40",data:e.daily_data,index:"date",colors:["rose"],categories:["num_rate_limit_exceptions"],onValueChange:e=>console.log(e)})]})})]})]},l))})]})]})};let lN={"BadRequestError (400)":"BadRequestErrorRetries","AuthenticationError (401)":"AuthenticationErrorRetries","TimeoutError (408)":"TimeoutErrorRetries","RateLimitError (429)":"RateLimitErrorRetries","ContentPolicyViolationError (400)":"ContentPolicyViolationErrorRetries","InternalServerError (500)":"InternalServerErrorRetries"};var lZ=e=>{let{selectedModelGroup:l,setSelectedModelGroup:t,availableModelGroups:a,globalRetryPolicy:r,setGlobalRetryPolicy:i,defaultRetry:o,modelGroupRetryPolicy:d,setModelGroupRetryPolicy:c,handleSaveRetrySettings:m}=e;return(0,s.jsxs)(ee.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)(n.Z,{children:"Retry Policy Scope:"}),(0,s.jsxs)(la.Z,{className:"ml-2 w-48",defaultValue:"global",value:"global"===l?"global":l||a[0],onValueChange:e=>t(e),children:[(0,s.jsx)(lr.Z,{value:"global",children:"Global Default"}),a.map((e,l)=>(0,s.jsx)(lr.Z,{value:e,onClick:()=>t(e),children:e},l))]})]})}),"global"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eX.Z,{children:"Global Retry Policy"}),(0,s.jsx)(n.Z,{className:"mb-6",children:"Default retry settings applied to all model groups unless overridden"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(eX.Z,{children:["Retry Policy for ",l]}),(0,s.jsx)(n.Z,{className:"mb-6",children:"Model-specific retry settings. Falls back to global defaults if not set."})]}),lN&&(0,s.jsx)("table",{children:(0,s.jsx)("tbody",{children:Object.entries(lN).map((e,t)=>{var a,m,u,h;let x,[p,g]=e;if("global"===l)x=null!==(a=null==r?void 0:r[g])&&void 0!==a?a:o;else{let e=null==d?void 0:null===(m=d[l])||void 0===m?void 0:m[g];x=null!=e?e:null!==(u=null==r?void 0:r[g])&&void 0!==u?u:o}return(0,s.jsxs)("tr",{className:"flex justify-between items-center mt-2",children:[(0,s.jsxs)("td",{children:[(0,s.jsx)(n.Z,{children:p}),"global"!==l&&(0,s.jsxs)(n.Z,{className:"text-xs text-gray-500 ml-2",children:["(Global: ",null!==(h=null==r?void 0:r[g])&&void 0!==h?h:o,")"]})]}),(0,s.jsx)("td",{children:(0,s.jsx)(ej.Z,{className:"ml-5",value:x,min:0,step:1,onChange:e=>{"global"===l?i(l=>null==e?l:{...null!=l?l:{},[g]:e}):c(t=>{var s;let a=null!==(s=null==t?void 0:t[l])&&void 0!==s?s:{};return{...null!=t?t:{},[l]:{...a,[g]:e}}})}})})]},t)})})}),(0,s.jsx)(eY.Z,{className:"mt-6 mr-8",onClick:m,children:"Save"})]})},lw=t(58760),lC=t(867),lS=t(3810),lk=t(89245),lA=t(5540),lE=t(8881);let{Text:lM}=C.default;var lI=e=>{let{accessToken:l,onReloadSuccess:t,buttonText:a="Reload Price Data",showIcon:r=!0,size:i="middle",type:n="primary",className:m=""}=e,[u,h]=(0,o.useState)(!1),[x,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(!1),[_,y]=(0,o.useState)(6),[b,N]=(0,o.useState)(null),[Z,w]=(0,o.useState)(!1);(0,o.useEffect)(()=>{C();let e=setInterval(()=>{C()},3e4);return()=>clearInterval(e)},[l]);let C=async()=>{if(l){w(!0);try{console.log("Fetching reload status...");let e=await (0,c.getModelCostMapReloadStatus)(l);console.log("Received status:",e),N(e)}catch(e){console.error("Failed to fetch reload status:",e),N({scheduled:!1,interval_hours:null,last_run:null,next_run:null})}finally{w(!1)}}},k=async()=>{if(!l){d.Z.fromBackend("No access token available");return}h(!0);try{let e=await (0,c.reloadModelCostMap)(l);"success"===e.status?(d.Z.success("Price data reloaded successfully! ".concat(e.models_count||0," models updated.")),null==t||t(),await C()):d.Z.fromBackend("Failed to reload price data")}catch(e){console.error("Error reloading price data:",e),d.Z.fromBackend("Failed to reload price data. Please try again.")}finally{h(!1)}},A=async()=>{if(!l){d.Z.fromBackend("No access token available");return}if(_<=0){d.Z.fromBackend("Hours must be greater than 0");return}p(!0);try{let e=await (0,c.scheduleModelCostMapReload)(l,_);"success"===e.status?(d.Z.success("Periodic reload scheduled for every ".concat(_," hours")),v(!1),await C()):d.Z.fromBackend("Failed to schedule periodic reload")}catch(e){console.error("Error scheduling reload:",e),d.Z.fromBackend("Failed to schedule periodic reload. Please try again.")}finally{p(!1)}},M=async()=>{if(!l){d.Z.fromBackend("No access token available");return}f(!0);try{let e=await (0,c.cancelModelCostMapReload)(l);"success"===e.status?(d.Z.success("Periodic reload cancelled successfully"),await C()):d.Z.fromBackend("Failed to cancel periodic reload")}catch(e){console.error("Error cancelling reload:",e),d.Z.fromBackend("Failed to cancel periodic reload. Please try again.")}finally{f(!1)}},I=e=>{if(!e)return"Never";try{return new Date(e).toLocaleString()}catch(l){return e}};return(0,s.jsxs)("div",{className:m,children:[(0,s.jsxs)(lw.Z,{direction:"horizontal",size:"middle",style:{marginBottom:16},children:[(0,s.jsx)(lC.Z,{title:"Hard Refresh Price Data",description:"This will immediately fetch the latest pricing information from the remote source. Continue?",onConfirm:k,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)(E.ZP,{type:n,size:i,loading:u,icon:r?(0,s.jsx)(lk.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:a})}),(null==b?void 0:b.scheduled)?(0,s.jsx)(E.ZP,{type:"default",size:i,danger:!0,icon:(0,s.jsx)(lE.Z,{}),loading:g,onClick:M,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)(E.ZP,{type:"default",size:i,icon:(0,s.jsx)(lA.Z,{}),onClick:()=>v(!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"})]}),b&&(0,s.jsx)(ea.Z,{size:"small",style:{backgroundColor:"#f8f9fa",border:"1px solid #e9ecef",borderRadius:8},children:(0,s.jsxs)(lw.Z,{direction:"vertical",size:"small",style:{width:"100%"},children:[b.scheduled?(0,s.jsx)("div",{children:(0,s.jsxs)(lS.Z,{color:"green",icon:(0,s.jsx)(lA.Z,{}),children:["Scheduled every ",b.interval_hours," hours"]})}):(0,s.jsx)(lM,{type:"secondary",children:"No periodic reload scheduled"}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Last run:"}),(0,s.jsx)(lM,{style:{fontSize:"12px"},children:I(b.last_run)})]}),b.scheduled&&(0,s.jsxs)(s.Fragment,{children:[b.next_run&&(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Next run:"}),(0,s.jsx)(lM,{style:{fontSize:"12px"},children:I(b.next_run)})]}),(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,s.jsx)(lM,{type:"secondary",style:{fontSize:"12px"},children:"Status:"}),(0,s.jsx)(lS.Z,{color:(null==b?void 0:b.scheduled)?b.last_run?"success":"processing":"default",children:(null==b?void 0:b.scheduled)?b.last_run?"Active":"Ready":"Not scheduled"})]})]})]})}),(0,s.jsxs)(S.Z,{title:"Set Up Periodic Reload",open:j,onOk:A,onCancel:()=>v(!1),confirmLoading:x,okText:"Schedule",cancelText:"Cancel",okButtonProps:{style:{backgroundColor:"#6366f1",borderColor:"#6366f1",color:"white"}},children:[(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(lM,{children:"Set up automatic reload of price data every:"})}),(0,s.jsx)("div",{style:{marginBottom:16},children:(0,s.jsx)(ej.Z,{min:1,max:168,value:_,onChange:e=>y(e||6),addonAfter:"hours",style:{width:"100%"}})}),(0,s.jsx)("div",{children:(0,s.jsxs)(lM,{type:"secondary",children:["This will automatically fetch the latest pricing data from the remote source every ",_," hours."]})})]})]})},lF=e=>{let{setModelMap:l}=e,{accessToken:t}=(0,H.Z)();return(0,s.jsx)(ee.Z,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(eX.Z,{children:"Price Data Management"}),(0,s.jsx)(n.Z,{className:"text-tremor-content",children:"Manage model pricing data and configure automatic reload schedules"})]}),(0,s.jsx)(lI,{accessToken:t,onReloadSuccess:()=>{(async()=>{l(await (0,c.modelCostMap)(t))})()},buttonText:"Reload Price Data",size:"middle",type:"primary",className:"w-full"})]})})},lP=t(61994),lL=t(15731),lT=t(91126);let lR=(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)(lP.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)(lP.Z,{checked:n,onChange:e=>a(i,e.target.checked),onClick:e=>e.stopPropagation()}),(0,s.jsx)(A.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)(A.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)(eb.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)(A.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)(lL.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)(eb.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)(A.Z,{title:i,placement:"top",children:(0,s.jsx)(eb.x,{className:"text-red-600 text-sm truncate",children:i})})}),d&&n!==i&&(0,s.jsx)(A.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)(lL.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)(eb.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)(eb.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)(A.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)(W.Z,{className:"h-4 w-4"}):(0,s.jsx)(lT.Z,{className:"h-4 w-4"})})})},enableSorting:!1}],lO=[{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 lV=e=>{let{accessToken:l,modelData:t,all_models_on_proxy:a,getDisplayModelName:r,setSelectedModelId:i}=e,[d,m]=(0,o.useState)({}),[u,h]=(0,o.useState)([]),[x,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[j,v]=(0,o.useState)(null),[_,y]=(0,o.useState)(!1),[b,N]=(0,o.useState)(null),Z=(0,o.useRef)(null);(0,o.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,c.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?w(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)}m(e)})()},[l,t]);let w=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 lO)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},C=async e=>{if(l){m(l=>({...l,[e]:{...l[e],loading:!0,status:"checking"}}));try{var s,a;let r=await (0,c.individualModelHealthCheckCall)(l,e),i=new Date().toLocaleString();if(r.unhealthy_count>0&&r.unhealthy_endpoints&&r.unhealthy_endpoints.length>0){let l=(null===(s=r.unhealthy_endpoints[0])||void 0===s?void 0:s.error)||"Health check failed",t=w(l);m(s=>{var a;return{...s,[e]:{status:"unhealthy",lastCheck:i,lastSuccess:(null===(a=s[e])||void 0===a?void 0:a.lastSuccess)||"None",loading:!1,error:t,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:i,lastSuccess:i,loading:!1,successResponse:r}}));try{let s=await (0,c.latestHealthChecksCall)(l),r=t.data.find(l=>l.model_name===e);if(r){let l=r.model_info.id,t=null===(a=s.latest_health_checks)||void 0===a?void 0:a[l];if(t){let l=t.error_message||void 0;m(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?w(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=w(t);m(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}}})}}},k=async()=>{let e=u.length>0?u:a,s=e.reduce((e,l)=>(e[l]={...d[l],loading:!0,status:"checking"},e),{});m(e=>({...e,...s}));let r={},i=e.map(async e=>{if(l)try{let s=await (0,c.individualModelHealthCheckCall)(l,e);r[e]=s;let a=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",r=w(l);m(t=>{var s;return{...t,[e]:{status:"unhealthy",lastCheck:a,lastSuccess:(null===(s=t[e])||void 0===s?void 0:s.lastSuccess)||"None",loading:!1,error:r,fullError:l}}})}else m(l=>({...l,[e]:{status:"healthy",lastCheck:a,lastSuccess:a,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=w(t);m(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(i);try{if(!l)return;let s=await (0,c.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;m(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?w(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=>{p(e),e?h(a):h([])},M=()=>{f(!1),v(null)},I=()=>{y(!1),N(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)(eX.Z,{children:"Model Health Status"}),(0,s.jsx)(n.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:[u.length>0&&(0,s.jsx)(eY.Z,{size:"sm",variant:"light",onClick:()=>A(!1),className:"px-3 py-1 text-sm",children:"Clear Selection"}),(0,s.jsx)(eY.Z,{size:"sm",variant:"secondary",onClick:k,disabled:Object.values(d).some(e=>e.loading),className:"px-3 py-1 text-sm",children:u.length>0&&u.length{l?h(l=>[...l,e]):(h(l=>l.filter(l=>l!==e)),p(!1))},A,C,e=>{switch(e){case"healthy":return(0,s.jsx)(ll.Z,{color:"emerald",children:"healthy"});case"unhealthy":return(0,s.jsx)(ll.Z,{color:"red",children:"unhealthy"});case"checking":return(0,s.jsx)(ll.Z,{color:"blue",children:"checking"});case"none":return(0,s.jsx)(ll.Z,{color:"gray",children:"none"});default:return(0,s.jsx)(ll.Z,{color:"gray",children:"unknown"})}},r,(e,l,t)=>{v({modelName:e,cleanedError:l,fullError:t}),f(!0)},(e,l)=>{N({modelName:e,response:l}),y(!0)},i),data:t.data.map(e=>{let l=d[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,table:Z})}),(0,s.jsx)(S.Z,{title:j?"Health Check Error - ".concat(j.modelName):"Error Details",open:g,onCancel:M,footer:[(0,s.jsx)(E.ZP,{onClick:M,children:"Close"},"close")],width:800,children:j&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.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)(n.Z,{className:"text-red-800",children:j.cleanedError})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.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:j.fullError})})]})]})}),(0,s.jsx)(S.Z,{title:b?"Health Check Response - ".concat(b.modelName):"Response Details",open:_,onCancel:I,footer:[(0,s.jsx)(E.ZP,{onClick:I,children:"Close"},"close")],width:800,children:b&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(n.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)(n.Z,{className:"text-green-800",children:"Health check passed successfully"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(n.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(b.response,null,2)})})]})]})})]})},lD=t(86462),lz=t(47686),lq=t(77355),lB=t(93416),lU=t(95704),lG=e=>{let{accessToken:l,initialModelGroupAlias:t={},onAliasUpdate:a}=e,[r,i]=(0,o.useState)([]),[n,m]=(0,o.useState)({aliasName:"",targetModelGroup:""}),[u,h]=(0,o.useState)(null),[x,p]=(0,o.useState)(!0);(0,o.useEffect)(()=>{i(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 g=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,c.setCallbacksCall)(l,{router_settings:{model_group_alias:t}}),a&&a(t),!0}catch(e){return console.error("Failed to save model group alias settings:",e),d.Z.fromBackend("Failed to save model group alias settings"),!1}},f=async()=>{if(!n.aliasName||!n.targetModelGroup){d.Z.fromBackend("Please provide both alias name and target model group");return}if(r.some(e=>e.aliasName===n.aliasName)){d.Z.fromBackend("An alias with this name already exists");return}let e=[...r,{id:"".concat(Date.now(),"-").concat(n.aliasName),aliasName:n.aliasName,targetModelGroup:n.targetModelGroup}];await g(e)&&(i(e),m({aliasName:"",targetModelGroup:""}),d.Z.success("Alias added successfully"))},j=e=>{h({...e})},v=async()=>{if(!u)return;if(!u.aliasName||!u.targetModelGroup){d.Z.fromBackend("Please provide both alias name and target model group");return}if(r.some(e=>e.id!==u.id&&e.aliasName===u.aliasName)){d.Z.fromBackend("An alias with this name already exists");return}let e=r.map(e=>e.id===u.id?u:e);await g(e)&&(i(e),h(null),d.Z.success("Alias updated successfully"))},_=()=>{h(null)},b=async e=>{let l=r.filter(l=>l.id!==e);await g(l)&&(i(l),d.Z.success("Alias deleted successfully"))},N=r.reduce((e,l)=>(e[l.aliasName]=l.targetModelGroup,e),{});return(0,s.jsxs)(lU.Zb,{className:"mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>p(!x),children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(lU.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:x?(0,s.jsx)(lD.Z,{className:"w-5 h-5 text-gray-500"}):(0,s.jsx)(lz.Z,{className:"w-5 h-5 text-gray-500"})})]}),x&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"mb-6",children:[(0,s.jsx)(lU.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:n.aliasName,onChange:e=>m({...n,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:n.targetModelGroup,onChange:e=>m({...n,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:f,disabled:!n.aliasName||!n.targetModelGroup,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(n.aliasName&&n.targetModelGroup?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,s.jsx)(lq.Z,{className:"w-4 h-4 mr-1"}),"Add Alias"]})})]})]}),(0,s.jsx)(lU.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)(lU.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(lU.ss,{children:(0,s.jsxs)(lU.SC,{children:[(0,s.jsx)(lU.xs,{className:"py-1 h-8",children:"Alias Name"}),(0,s.jsx)(lU.xs,{className:"py-1 h-8",children:"Target Model Group"}),(0,s.jsx)(lU.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,s.jsxs)(lU.RM,{children:[r.map(e=>(0,s.jsx)(lU.SC,{className:"h-8",children:u&&u.id===e.id?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lU.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.aliasName,onChange:e=>h({...u,aliasName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lU.pj,{className:"py-0.5",children:(0,s.jsx)("input",{type:"text",value:u.targetModelGroup,onChange:e=>h({...u,targetModelGroup:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,s.jsx)(lU.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:v,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:_,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)(lU.pj,{className:"py-0.5 text-sm text-gray-900",children:e.aliasName}),(0,s.jsx)(lU.pj,{className:"py-0.5 text-sm text-gray-500",children:e.targetModelGroup}),(0,s.jsx)(lU.pj,{className:"py-0.5 whitespace-nowrap",children:(0,s.jsxs)("div",{className:"flex space-x-2",children:[(0,s.jsx)("button",{onClick:()=>j(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,s.jsx)(lB.Z,{className:"w-3 h-3"})}),(0,s.jsx)("button",{onClick:()=>b(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,s.jsx)(y.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===r.length&&(0,s.jsx)(lU.SC,{children:(0,s.jsx)(lU.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)(lU.Zb,{children:[(0,s.jsx)(lU.Dx,{className:"mb-4",children:"Configuration Example"}),(0,s.jsx)(lU.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(N).length?(0,s.jsxs)("span",{className:"text-gray-500",children:[(0,s.jsx)("br",{}),"\xa0\xa0\xa0\xa0# No aliases configured yet"]}):Object.entries(N).map(e=>{let[l,t]=e;return(0,s.jsxs)("span",{children:[(0,s.jsx)("br",{}),'\xa0\xa0\xa0\xa0"',l,'": "',t,'"']},l)})]})})]})]})]})},lH=t(27593),lK=e=>{let{accessToken:l,token:t,userRole:u,userID:x,modelData:p={data:[]},keys:g,setModelData:j,premiumUser:_,teams:y}=e,[b]=N.Z.useForm(),[Z,w]=(0,o.useState)(null),[S,k]=(0,o.useState)(""),[A,E]=(0,o.useState)([]),[M,I]=(0,o.useState)([]),[F,P]=(0,o.useState)(m.Cl.Anthropic),[L,T]=(0,o.useState)(!1),[R,O]=(0,o.useState)(null),[V,D]=(0,o.useState)([]),[z,q]=(0,o.useState)([]),[B,U]=(0,o.useState)(null),[G,H]=(0,o.useState)([]),[es,ea]=(0,o.useState)([]),[er,ei]=(0,o.useState)([]),[en,eo]=(0,o.useState)([]),[ed,ec]=(0,o.useState)([]),[em,eu]=(0,o.useState)([]),[eh,ex]=(0,o.useState)([]),[ep,eg]=(0,o.useState)({from:new Date(Date.now()-6048e5),to:new Date}),[ef,ej]=(0,o.useState)(null),[ev,e_]=(0,o.useState)(null),[ey,eb]=(0,o.useState)(0),[eN,eZ]=(0,o.useState)({}),[ew,eC]=(0,o.useState)([]),[eS,ek]=(0,o.useState)(!1),[eA,eE]=(0,o.useState)(null),[eM,eI]=(0,o.useState)(null),[eF,eP]=(0,o.useState)([]),[eL,eT]=(0,o.useState)({}),[eR,eO]=(0,o.useState)(!1),[eV,eD]=(0,o.useState)(null),[ez,eq]=(0,o.useState)(!1),[eB,eU]=(0,o.useState)(null),[eG,eH]=(0,o.useState)(null),[eJ,eW]=(0,o.useState)(!1),eY=(0,o.useRef)(null),[e$,eQ]=(0,o.useState)(0),eX=(0,a.NL)(),{data:e0,isLoading:e1,refetch:e2}=v(l,x,u),{data:e4}=f(l),e5=(null==e4?void 0:e4.credentials)||[];(0,o.useEffect)(()=>{let e=e=>{eY.current&&!eY.current.contains(e.target)&&eW(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let e6={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;b.setFieldsValue({vertex_credentials:l})}},l.readAsText(e)}return!1},onChange(e){"done"===e.file.status?d.Z.success("".concat(e.file.name," file uploaded successfully")):"error"===e.file.status&&d.Z.fromBackend("".concat(e.file.name," file upload failed."))}},e3=()=>{k(new Date().toLocaleString()),eX.invalidateQueries({queryKey:["models","list"]}),e2()},e9=async()=>{if(l)try{let e={router_settings:{}};"global"===B?(ev&&(e.router_settings.retry_policy=ev),d.Z.success("Global retry settings saved successfully")):(ef&&(e.router_settings.model_group_retry_policy=ef),d.Z.success("Retry settings saved successfully for ".concat(B))),await (0,c.setCallbacksCall)(l,e)}catch(e){d.Z.fromBackend("Failed to save retry settings")}};if((0,o.useEffect)(()=>{if(!l||!t||!u||!x||!e0)return;let e=async()=>{try{var e,t,s,a,r,i,n,o,d,m,h,p;j(e0);let g=await (0,c.modelSettingsCall)(l);g&&I(g);let f=new Set;for(let e=0;e0&&(y=v[v.length-1]);let b=await (0,c.modelMetricsCall)(l,x,u,y,null===(e=ep.from)||void 0===e?void 0:e.toISOString(),null===(t=ep.to)||void 0===t?void 0:t.toISOString(),null==eA?void 0:eA.token,eM);H(b.data),ea(b.all_api_bases);let N=await (0,c.streamingModelMetricsCall)(l,y,null===(s=ep.from)||void 0===s?void 0:s.toISOString(),null===(a=ep.to)||void 0===a?void 0:a.toISOString());ei(N.data),eo(N.all_api_bases);let Z=await (0,c.modelExceptionsCall)(l,x,u,y,null===(r=ep.from)||void 0===r?void 0:r.toISOString(),null===(i=ep.to)||void 0===i?void 0:i.toISOString(),null==eA?void 0:eA.token,eM);ec(Z.data),eu(Z.exception_types);let w=await (0,c.modelMetricsSlowResponsesCall)(l,x,u,y,null===(n=ep.from)||void 0===n?void 0:n.toISOString(),null===(o=ep.to)||void 0===o?void 0:o.toISOString(),null==eA?void 0:eA.token,eM),C=await (0,c.adminGlobalActivityExceptions)(l,null===(d=ep.from)||void 0===d?void 0:d.toISOString().split("T")[0],null===(m=ep.to)||void 0===m?void 0:m.toISOString().split("T")[0],y);eZ(C);let S=await (0,c.adminGlobalActivityExceptionsPerDeployment)(l,null===(h=ep.from)||void 0===h?void 0:h.toISOString().split("T")[0],null===(p=ep.to)||void 0===p?void 0:p.toISOString().split("T")[0],y);eC(S),ex(w);let k=await (0,c.allEndUsersCall)(l);eP(null==k?void 0:k.map(e=>e.user_id));let A=(await (0,c.getCallbacksCall)(l,x,u)).router_settings,E=A.model_group_retry_policy,M=A.num_retries;ej(E),e_(A.retry_policy),eb(M);let F=A.model_group_alias||{};eT(F)}catch(e){console.error("Error fetching model data:",e)}};l&&t&&u&&x&&e0&&e();let s=async()=>{w(await (0,c.modelCostMap)(l))};null==Z&&s()},[l,t,u,x,e0]),!p||e1||!l||!t||!u||!x)return(0,s.jsx)("div",{children:"Loading..."});let le=[],ll=[];for(let e=0;enull!=Z&&"object"==typeof Z&&e in Z?Z[e].litellm_provider:"openai";if(t){let e=t.split("/"),l=e[0];(r=s)||(r=1===e.length?m(t):l)}else r="-";a&&(i=null==a?void 0:a.input_cost_per_token,n=null==a?void 0:a.output_cost_per_token,o=null==a?void 0:a.max_tokens,d=null==a?void 0:a.max_input_tokens),(null==l?void 0:l.litellm_params)&&(c=Object.fromEntries(Object.entries(null==l?void 0:l.litellm_params).filter(e=>{let[l]=e;return"model"!==l&&"api_base"!==l}))),p.data[e].provider=r,p.data[e].input_cost=i,p.data[e].output_cost=n,p.data[e].litellm_model_name=t,ll.push(r),p.data[e].input_cost&&(p.data[e].input_cost=(1e6*Number(p.data[e].input_cost)).toFixed(2)),p.data[e].output_cost&&(p.data[e].output_cost=(1e6*Number(p.data[e].output_cost)).toFixed(2)),p.data[e].max_tokens=o,p.data[e].max_input_tokens=d,p.data[e].api_base=null==l?void 0:null===(la=l.litellm_params)||void 0===la?void 0:la.api_base,p.data[e].cleanedLitellmParams=c,le.push(l.model_name)}if(u&&"Admin Viewer"==u){let{Title:e,Paragraph:l}=C.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"})]})}return(Object.keys(m.Cl).find(e=>m.Cl[e]===F),eB)?(0,s.jsx)("div",{className:"w-full h-full",children:(0,s.jsx)(e7.Z,{teamId:eB,onClose:()=>eU(null),accessToken:l,is_team_admin:"Admin"===u,is_proxy_admin:"Proxy Admin"===u,userModels:le,editTeam:!1,onUpdate:e3})}):(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(i.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(r.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"}),et.ZL.includes(u)?(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."})]})}),eV?(0,s.jsx)(e8,{modelId:eV,editModel:!0,onClose:()=>{eD(null),eq(!1)},modelData:p.data.find(e=>e.model_info.id===eV),accessToken:l,userID:x,userRole:u,setEditModalVisible:T,setSelectedModel:O,onModelUpdate:e=>{e.deleted?j({...p,data:p.data.filter(l=>l.model_info.id!==e.model_info.id)}):j({...p,data:p.data.map(l=>l.model_info.id===e.model_info.id?e:l)}),eX.invalidateQueries({queryKey:["models","list"]}),e3()},modelAccessGroups:z}):(0,s.jsxs)(Q.Z,{index:e$,onIndexChange:eQ,className:"gap-2 h-[75vh] w-full ",children:[(0,s.jsxs)(X.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,s.jsxs)("div",{className:"flex",children:[et.ZL.includes(u)?(0,s.jsx)($.Z,{children:"All Models"}):(0,s.jsx)($.Z,{children:"Your Models"}),(0,s.jsx)($.Z,{children:"Add Model"}),et.ZL.includes(u)&&(0,s.jsx)($.Z,{children:"LLM Credentials"}),et.ZL.includes(u)&&(0,s.jsx)($.Z,{children:"Pass-Through Endpoints"}),et.ZL.includes(u)&&(0,s.jsx)($.Z,{children:"Health Status"}),et.ZL.includes(u)&&(0,s.jsx)($.Z,{children:"Model Analytics"}),et.ZL.includes(u)&&(0,s.jsx)($.Z,{children:"Model Retry Settings"}),et.ZL.includes(u)&&(0,s.jsx)($.Z,{children:"Model Group Alias"}),et.ZL.includes(u)&&(0,s.jsx)($.Z,{children:"Price Data Reload"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[S&&(0,s.jsxs)(n.Z,{children:["Last Refreshed: ",S]}),(0,s.jsx)(Y.Z,{icon:W.Z,variant:"shadow",size:"xs",className:"self-center",onClick:e3})]})]}),(0,s.jsxs)(el.Z,{children:[(0,s.jsx)(li,{selectedModelGroup:B,setSelectedModelGroup:U,availableModelGroups:V,availableModelAccessGroups:z,setSelectedModelId:eD,setSelectedTeamId:eU,setEditModel:eq,modelData:p}),(0,s.jsx)(ee.Z,{className:"h-full",children:(0,s.jsx)(eK,{form:b,handleOk:()=>{b.validateFields().then(e=>{h(e,l,b,e3)}).catch(e=>{var l;let t=(null===(l=e.errorFields)||void 0===l?void 0:l.map(e=>"".concat(e.name.join("."),": ").concat(e.errors.join(", "))).join(" | "))||"Unknown validation error";d.Z.fromBackend("Please fill in the following required fields: ".concat(t))})},selectedProvider:F,setSelectedProvider:P,providerModels:A,setProviderModelsFn:e=>{E((0,m.bK)(e,Z))},getPlaceholder:m.ph,uploadProps:e6,showAdvancedSettings:eR,setShowAdvancedSettings:eO,teams:y,credentials:e5,accessToken:l,userRole:u,premiumUser:_})}),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(K,{uploadProps:e6})}),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(lH.Z,{accessToken:l,userRole:u,userID:x,modelData:p,premiumUser:_})}),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(lV,{accessToken:l,modelData:p,all_models_on_proxy:le,getDisplayModelName:J,setSelectedModelId:eD})}),(0,s.jsx)(lb,{dateValue:ep,setDateValue:eg,selectedModelGroup:B,availableModelGroups:V,setShowAdvancedFilters:ek,modelMetrics:G,modelMetricsCategories:es,streamingModelMetrics:er,streamingModelMetricsCategories:en,customTooltip:e=>{var l,t;let{payload:a,active:r}=e;if(!r||!a)return null;let i=null===(t=a[0])||void 0===t?void 0:null===(l=t.payload)||void 0===l?void 0:l.date,n=a.sort((e,l)=>l.value-e.value);if(n.length>5){let e=n.length-5;(n=n.slice(0,5)).push({dataKey:"".concat(e," other deployments"),value:a.slice(5).reduce((e,l)=>e+l.value,0),color:"gray"})}return(0,s.jsxs)("div",{className:"w-150 rounded-tremor-default border border-tremor-border bg-tremor-background p-2 text-tremor-default shadow-tremor-dropdown",children:[i&&(0,s.jsxs)("p",{className:"text-tremor-content-emphasis mb-2",children:["Date: ",i]}),n.map((e,l)=>{let t=parseFloat(e.value.toFixed(5)),a=0===t&&e.value>0?"<0.00001":t.toFixed(5);return(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("div",{className:"w-2 h-2 mt-1 rounded-full bg-".concat(e.color,"-500")}),(0,s.jsx)("p",{className:"text-tremor-content",children:e.dataKey})]}),(0,s.jsx)("p",{className:"font-medium text-tremor-content-emphasis text-righ ml-2",children:a})]},l)})]})},slowResponsesData:eh,modelExceptions:ed,globalExceptionData:eN,allExceptions:em,globalExceptionPerDeployment:ew,allEndUsers:eF,keys:g,setSelectedAPIKey:eE,setSelectedCustomer:eI,teams:y,selectedAPIKey:eA,selectedCustomer:eM,selectedTeam:eG,setAllExceptions:eu,setGlobalExceptionData:eZ,setGlobalExceptionPerDeployment:eC,setModelExceptions:ec,setModelMetrics:H,setModelMetricsCategories:ea,setSelectedModelGroup:U,setSlowResponsesData:ex,setStreamingModelMetrics:ei,setStreamingModelMetricsCategories:eo}),(0,s.jsx)(lZ,{selectedModelGroup:B,setSelectedModelGroup:U,availableModelGroups:V,globalRetryPolicy:ev,setGlobalRetryPolicy:e_,defaultRetry:ey,modelGroupRetryPolicy:ef,setModelGroupRetryPolicy:ej,handleSaveRetrySettings:e9}),(0,s.jsx)(ee.Z,{children:(0,s.jsx)(lG,{accessToken:l,initialModelGroupAlias:eL,onAliasUpdate:eT})}),(0,s.jsx)(lF,{setModelMap:w})]})]})]})})})}},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),Z=t(12660),w=t(15424),C=t(58760),S=t(5545),k=t(45246),A=t(96473),E=t(31283),M=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)(k.Z,{onClick:()=>n(l),style:{cursor:"pointer"}})})]},l)}),(0,s.jsx)(S.ZP,{type:"dashed",onClick:()=>{i([...r,["",""]])},icon:(0,s.jsx)(A.Z,{}),children:"Add Header"})]})},I=t(77565),F=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)(I.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)(I.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)(w.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},P=t(9114),L=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)(L.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)(L.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)(w.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)(w.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)(w.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:V}=v.default;var D=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,S]=(0,a.useState)(""),[k,A]=(0,a.useState)(""),[E,I]=(0,a.useState)(""),[L,R]=(0,a.useState)(!0),[V,D]=(0,a.useState)(!1),[z,q]=(0,a.useState)({}),B=()=>{m.resetFields(),A(""),I(""),R(!0),q({}),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,z&&Object.keys(z).length>0&&(e.guardrails=z),console.log("formValues: ".concat(JSON.stringify(e)));let s=(await (0,d.createPassThroughEndpoint)(l,e)).endpoints[0],a=[...i,s];t(a),P.Z.success("Pass-through endpoint created successfully"),m.resetFields(),A(""),I(""),R(!0),q({}),h(!1)}catch(e){P.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)(Z.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:k,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:k,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=>{I(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:L,onChange:R})})]})]})]}),(0,s.jsx)(F,{pathValue:k,targetValue:E,includeSubpath:L}),(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)(w.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)(M,{})})]}),(0,s.jsx)(T,{premiumUser:n,authEnabled:V,onAuthChange:e=>{D(e),m.setFieldsValue({auth:e})}}),(0,s.jsx)(O,{accessToken:l,value:z,onChange:q}),(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)(w.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"})]})]})]})})]})},z=t(30078),q=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){P.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),P.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),P.Z.success("Pass through endpoint deleted successfully"),t(),o&&o()}catch(e){console.error("Error deleting endpoint:",e),P.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)(S.ZP,{onClick:t,className:"mb-4",children:"← Back"}),(0,s.jsxs)(z.Dx,{children:["Pass Through Endpoint: ",c.path]}),(0,s.jsx)(z.xv,{className:"text-gray-500 font-mono",children:c.id})]})}),(0,s.jsxs)(z.v0,{children:[(0,s.jsxs)(z.td,{className:"mb-4",children:[(0,s.jsx)(z.OK,{children:"Overview"},"overview"),i?(0,s.jsx)(z.OK,{children:"Settings"},"settings"):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsxs)(z.nP,{children:[(0,s.jsxs)(z.x4,{children:[(0,s.jsxs)(z.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Path"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(z.Dx,{className:"font-mono",children:c.path})})]}),(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Target"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(z.Dx,{children:c.target})})]}),(0,s.jsxs)(z.Zb,{children:[(0,s.jsx)(z.xv,{children:"Configuration"}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,s.jsx)("div",{children:(0,s.jsx)(z.Ct,{color:c.include_subpath?"green":"gray",children:c.include_subpath?"Include Subpath":"Exact Path"})}),(0,s.jsx)("div",{children:(0,s.jsx)(z.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)(z.xv,{children:["Cost per request: $",c.cost_per_request]})})]})]})]}),(0,s.jsx)("div",{className:"mt-6",children:(0,s.jsx)(F,{pathValue:c.path,targetValue:c.target,includeSubpath:c.include_subpath||!1})}),c.headers&&Object.keys(c.headers).length>0&&(0,s.jsxs)(z.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Headers"}),(0,s.jsxs)(z.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)(z.Zb,{className:"mt-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Guardrails"}),(0,s.jsxs)(z.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)(z.x4,{children:(0,s.jsxs)(z.Zb,{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)(z.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)(z.zx,{onClick:()=>p(!0),children:"Edit Settings"}),(0,s.jsx)(z.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)(z.oi,{placeholder:"https://api.example.com"})}),(0,s.jsx)(_.Z.Item,{label:"Headers (JSON)",name:"headers",children:(0,s.jsx)(q.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)(L.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)(S.ZP,{onClick:()=>p(!1),children:"Cancel"}),(0,s.jsx)(z.zx,{children:"Save Changes"})]})]}):(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Path"}),(0,s.jsx)("div",{className:"font-mono",children:c.path})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Target URL"}),(0,s.jsx)("div",{children:c.target})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.xv,{className:"font-medium",children:"Include Subpath"}),(0,s.jsx)(z.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)(z.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)(z.xv,{className:"font-medium",children:"Authentication Required"}),(0,s.jsx)(z.Ct,{color:c.auth?"green":"gray",children:c.auth?"Yes":"No"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(z.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),[Z,w]=(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=>{w(e),N(!0)},S=async()=>{if(null!=Z&&l){try{await (0,d.deletePassThroughEndpointsCall)(l,Z);let e=j.filter(e=>e.id!==Z);v(e),P.Z.success("Endpoint deleted successfully.")}catch(e){console.error("Error deleting the endpoint:",e),P.Z.fromBackend("Error deleting the endpoint: "+e)}N(!1),w(null)}},k=(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:()=>k(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)(D,{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:S,color:"red",className:"ml-2",children:"Delete"}),(0,s.jsx)(r.Z,{onClick:()=>{N(!1),w(null)},children:"Cancel"})]})]})]})})]})}},39789:function(e,l,t){t.d(l,{Z:function(){return n}});var s=t(57437),a=t(2265),r=t(88237),i=t(84264),n=e=>{let{value:l,onValueChange:t,label:n="Select Time Range",className:o="",showTimeRange:d=!0}=e,[c,m]=(0,a.useState)(!1),u=(0,a.useRef)(null),h=(0,a.useCallback)(e=>{m(!0),setTimeout(()=>m(!1),1500),t(e),requestIdleCallback(()=>{if(e.from){let l;let s={...e},a=new Date(e.from);l=new Date(e.to?e.to:e.from),a.toDateString(),l.toDateString(),a.setHours(0,0,0,0),l.setHours(23,59,59,999),s.from=a,s.to=l,t(s)}},{timeout:100})},[t]),x=(0,a.useCallback)((e,l)=>{if(!e||!l)return"";let t=e=>e.toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});if(e.toDateString()!==l.toDateString())return"".concat(t(e)," - ").concat(t(l));{let t=e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),s=e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0}),a=l.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"});return"".concat(t,": ").concat(s," - ").concat(a)}},[]);return(0,s.jsxs)("div",{className:o,children:[n&&(0,s.jsx)(i.Z,{className:"mb-2",children:n}),(0,s.jsxs)("div",{className:"relative w-fit",children:[(0,s.jsx)("div",{ref:u,children:(0,s.jsx)(r.Z,{enableSelect:!0,value:l,onValueChange:h,placeholder:"Select date range",enableClear:!1,style:{zIndex:100}})}),c&&(0,s.jsx)("div",{className:"absolute top-1/2 animate-pulse",style:{left:"calc(100% + 8px)",transform:"translateY(-50%)",zIndex:110},children:(0,s.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,s.jsx)("div",{className:"w-3 h-3 bg-green-500 text-white rounded-full flex items-center justify-center text-xs",children:"✓"}),(0,s.jsx)("span",{className:"text-xs",children:"Selected"})]})})]}),d&&l.from&&l.to&&(0,s.jsx)(i.Z,{className:"mt-2 text-xs text-gray-500",children:x(l.from,l.to)})]})}},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/1301-739c2d4a8ce60896.js b/litellm/proxy/_experimental/out/_next/static/chunks/1301-739c2d4a8ce60896.js new file mode 100644 index 0000000000..621fba93f9 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1301-739c2d4a8ce60896.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1301],{69993:function(e,t,r){r.d(t,{Z:function(){return s}});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"},o=r(55015),s=a.forwardRef(function(e,t){return a.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:i}))})},58747:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(5853),a=r(2265);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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){r.d(t,{Z:function(){return i}});var n=r(5853),a=r(2265);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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"}))}},47323:function(e,t,r){r.d(t,{Z:function(){return p}});var n=r(5853),a=r(2265),i=r(47187),o=r(7084),s=r(13241),l=r(1153),u=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"}},c={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=(e,t)=>{switch(e){case"simple":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:"",borderColor:"",ringColor:""};case"light":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-brand-muted dark:bg-dark-tremor-brand-muted",borderColor:"",ringColor:""};case"shadow":return{textColor:t?(0,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.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,l.bM)(t,u.K.text).textColor:"text-tremor-brand-inverted dark:text-dark-tremor-brand-inverted",bgColor:t?(0,s.q)((0,l.bM)(t,u.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,l.bM)(t,u.K.text).textColor:"text-tremor-brand dark:text-dark-tremor-brand",bgColor:t?(0,s.q)((0,l.bM)(t,u.K.background).bgColor,"bg-opacity-20"):"bg-tremor-background dark:bg-dark-tremor-background",borderColor:t?(0,l.bM)(t,u.K.ring).borderColor:"border-tremor-brand-subtle dark:border-dark-tremor-brand-subtle",ringColor:t?(0,s.q)((0,l.bM)(t,u.K.ring).ringColor,"ring-opacity-40"):"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"}}},m=(0,l.fn)("Icon"),p=a.forwardRef((e,t)=>{let{icon:r,variant:u="simple",tooltip:p,size:g=o.u8.SM,color:b,className:v}=e,w=(0,n._T)(e,["icon","variant","tooltip","size","color","className"]),y=f(u,b),{tooltipProps:k,getReferenceProps:C}=(0,i.l)();return a.createElement("span",Object.assign({ref:(0,l.lq)([t,k.refs.setReference]),className:(0,s.q)(m("root"),"inline-flex shrink-0 items-center justify-center",y.bgColor,y.textColor,y.borderColor,y.ringColor,h[u].rounded,h[u].border,h[u].shadow,h[u].ring,d[g].paddingX,d[g].paddingY,v)},C,w),a.createElement(i.Z,Object.assign({text:p},k)),a.createElement(r,{className:(0,s.q)(m("icon"),"shrink-0",c[g].height,c[g].width)}))});p.displayName="Icon"},27281:function(e,t,r){r.d(t,{Z:function(){return m}});var n=r(5853),a=r(58747),i=r(2265),o=r(4537),s=r(13241),l=r(1153),u=r(96398),d=r(51975),c=r(85238),h=r(44140);let f=(0,l.fn)("Select"),m=i.forwardRef((e,t)=>{let{defaultValue:r="",value:l,onValueChange:m,placeholder:p="Select...",disabled:g=!1,icon:b,enableClear:v=!1,required:w,children:y,name:k,error:C=!1,errorMessage:x,className:E,id:M}=e,q=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),O=(0,i.useRef)(null),L=i.Children.toArray(y),[N,P]=(0,h.Z)(r,l),R=(0,i.useMemo)(()=>{let e=i.Children.toArray(y).filter(i.isValidElement);return(0,u.sl)(e)},[y]);return i.createElement("div",{className:(0,s.q)("w-full min-w-[10rem] text-tremor-default",E)},i.createElement("div",{className:"relative"},i.createElement("select",{title:"select-hidden",required:w,className:(0,s.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:N,onChange:e=>{e.preventDefault()},name:k,disabled:g,id:M,onFocus:()=>{let e=O.current;e&&e.focus()}},i.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),L.map(e=>{let t=e.props.value,r=e.props.children;return i.createElement("option",{className:"hidden",key:t,value:t},r)})),i.createElement(d.Ri,Object.assign({as:"div",ref:t,defaultValue:N,value:N,onChange:e=>{null==m||m(e),P(e)},disabled:g,id:M},q),e=>{var t;let{value:r}=e;return i.createElement(i.Fragment,null,i.createElement(d.Y4,{ref:O,className:(0,s.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",b?"pl-10":"pl-3",(0,u.um)((0,u.Uh)(r),g,C))},b&&i.createElement("span",{className:(0,s.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},i.createElement(b,{className:(0,s.q)(f("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),i.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=R.get(r))&&void 0!==t?t:p),i.createElement("span",{className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-3")},i.createElement(a.Z,{className:(0,s.q)(f("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&N?i.createElement("button",{type:"button",className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),P(""),null==m||m("")}},i.createElement(o.Z,{className:(0,s.q)(f("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,i.createElement(c.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"},i.createElement(d.O_,{anchor:"bottom start",className:(0,s.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)))})),C&&x?i.createElement("p",{className:(0,s.q)("errorMessage","text-sm text-rose-500 mt-1")},x):null)});m.displayName="Select"},94789:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(2265),i=r(26898),o=r(13241),s=r(1153);let l=(0,s.fn)("Callout"),u=a.forwardRef((e,t)=>{let{title:r,icon:u,color:d,className:c,children:h}=e,f=(0,n._T)(e,["title","icon","color","className","children"]);return a.createElement("div",Object.assign({ref:t,className:(0,o.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,o.q)((0,s.bM)(d,i.K.background).bgColor,(0,s.bM)(d,i.K.darkBorder).borderColor,(0,s.bM)(d,i.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,o.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"),c)},f),a.createElement("div",{className:(0,o.q)(l("header"),"flex items-start")},u?a.createElement(u,{className:(0,o.q)(l("icon"),"flex-none h-5 w-5 mr-1.5")}):null,a.createElement("h4",{className:(0,o.q)(l("title"),"font-semibold")},r)),a.createElement("p",{className:(0,o.q)(l("body"),"overflow-y-auto",h?"mt-2":"")},h))});u.displayName="Callout"},44140:function(e,t,r){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)}]}},32489:function(e,t,r){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"}]])},77331:function(e,t,r){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){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){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},44633:function(e,t,r){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 15l7-7 7 7"}))});t.Z=a},58710:function(e,t,r){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){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){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){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){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){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){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){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},49084:function(e,t,r){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:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=a},3497:function(e,t,r){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){r.d(t,{R:function(){return s},m:function(){return o}});var n=r(18238),a=r(7989),i=r(11255),o=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||s(),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 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(e,t,r){r.d(t,{S:function(){return p}});var n=r(45345),a=r(21733),i=r(18238),o=r(24112),s=class extends o.l{constructor(e={}){super(),this.config=e,this.#i=new Map}#i;build(e,t,r){let i=t.queryKey,o=t.queryHash??(0,n.Rm)(i,t),s=this.get(o);return s||(s=new a.A({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}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()})})}},l=r(2894),u=class extends o.l{constructor(e={}){super(),this.config=e,this.#o=new Set,this.#s=new Map,this.#l=0}#o;#s;#l;build(e,t,r){let n=new l.m({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#o.add(e);let t=d(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#o.delete(e)){let t=d(e);if("string"==typeof t){let r=this.#s.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=d(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=d(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){i.Vr.batch(()=>{this.#o.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#o.clear(),this.#s.clear()})}getAll(){return Array.from(this.#o)}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 d(e){return e.options.scope?.id}var c=r(87045),h=r(57853);function f(e){return{onFetch:(t,r)=>{let a=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},u=0,d=async()=>{let r=!1,d=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)})},c=(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 o=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:i?"backward":"forward",meta:t.options.meta};return d(e),e})(),s=await c(o),{maxPages:l}=t.options,u=i?n.Ht:n.VX;return{pages:u(e.pages,s,l),pageParams:u(e.pageParams,a,l)}};if(i&&o.length){let e="backward"===i,t={pages:o,pageParams:s},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);l=await h(t,r,e)}else{let t=e??o.length;do{let e=0===u?s[0]??a.initialPageParam:m(a,l);if(u>0&&null==e)break;l=await h(l,e),u++}while(ut.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=d}}}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{#u;#r;#d;#c;#h;#f;#m;#p;constructor(e={}){this.#u=e.queryCache||new s,this.#r=e.mutationCache||new u,this.#d=e.defaultOptions||{},this.#c=new Map,this.#h=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#m=c.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#p=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#m?.(),this.#m=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#u.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.#u.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#u.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.#u.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),i=this.#u.get(a.queryHash),o=i?.state.data,s=(0,n.SE)(t,o);if(void 0!==s)return this.#u.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return i.Vr.batch(()=>this.#u.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#u.get(t.queryHash)?.state}removeQueries(e){let t=this.#u;i.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#u;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.#u.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return i.Vr.batch(()=>(this.#u.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.#u.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.#u.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.#u}getMutationCache(){return this.#r}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#c.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#c.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.#d.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.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#u.clear(),this.#r.clear()}}},85238:function(e,t,r){let n;r.d(t,{u:function(){return L}});var a=r(2265),i=r(59456),o=r(93980),s=r(25289),l=r(73389),u=r(43507),d=r(180),c=r(67561),h=r(98218),f=r(28294),m=r(95504),p=r(72468),g=r(38929);function b(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:x)!==a.Fragment||1===a.Children.count(e.children)}let v=(0,a.createContext)(null);v.displayName="TransitionContext";var w=((n=w||{}).Visible="visible",n.Hidden="hidden",n);let y=(0,a.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 C(e,t){let r=(0,u.E)(e),n=(0,a.useRef)([]),l=(0,s.t)(),d=(0,i.G)(),c=(0,o.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.l4.Hidden,a=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==a&&((0,p.E)(t,{[g.l4.Unmount](){n.current.splice(a,1)},[g.l4.Hidden](){n.current[a].state="hidden"}}),d.microTask(()=>{var e;!k(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),h=(0,o.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"}),()=>c(e,g.l4.Unmount)}),f=(0,a.useRef)([]),m=(0,a.useRef)(Promise.resolve()),b=(0,a.useRef)({enter:[],leave:[]}),v=(0,o.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(b.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?m.current=m.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),w=(0,o.z)((e,t,r)=>{Promise.all(b.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,a.useMemo)(()=>({children:n,register:h,unregister:c,onStart:v,onStop:w,wait:m,chains:b}),[h,c,n,v,w,b,m])}y.displayName="NestingContext";let x=a.Fragment,E=g.VN.RenderStrategy,M=(0,g.yV)(function(e,t){let{show:r,appear:n=!1,unmount:i=!0,...s}=e,u=(0,a.useRef)(null),h=b(e),m=(0,c.T)(...h?[u,t]:null===t?[]:[t]);(0,d.H)();let p=(0,f.oJ)();if(void 0===r&&null!==p&&(r=(p&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,x]=(0,a.useState)(r?"visible":"hidden"),M=C(()=>{r||x("hidden")}),[O,L]=(0,a.useState)(!0),N=(0,a.useRef)([r]);(0,l.e)(()=>{!1!==O&&N.current[N.current.length-1]!==r&&(N.current.push(r),L(!1))},[N,r]);let P=(0,a.useMemo)(()=>({show:r,appear:n,initial:O}),[r,n,O]);(0,l.e)(()=>{r?x("visible"):k(M)||null===u.current||x("hidden")},[r,M]);let R={unmount:i},j=(0,o.z)(()=>{var t;O&&L(!1),null==(t=e.beforeEnter)||t.call(e)}),T=(0,o.z)(()=>{var t;O&&L(!1),null==(t=e.beforeLeave)||t.call(e)}),Z=(0,g.L6)();return a.createElement(y.Provider,{value:M},a.createElement(v.Provider,{value:P},Z({ourProps:{...R,as:a.Fragment,children:a.createElement(q,{ref:m,...R,...s,beforeEnter:j,beforeLeave:T})},theirProps:{},defaultTag:a.Fragment,features:E,visible:"visible"===w,name:"Transition"})))}),q=(0,g.yV)(function(e,t){var r,n;let{transition:i=!0,beforeEnter:s,afterEnter:u,beforeLeave:w,afterLeave:M,enter:q,enterFrom:O,enterTo:L,entered:N,leave:P,leaveFrom:R,leaveTo:j,...T}=e,[Z,D]=(0,a.useState)(null),Q=(0,a.useRef)(null),A=b(e),S=(0,c.T)(...A?[Q,t,D]:null===t?[]:[t]),V=null==(r=T.unmount)||r?g.l4.Unmount:g.l4.Hidden,{show:F,appear:z,initial:K}=function(){let e=(0,a.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[H,B]=(0,a.useState)(F?"visible":"hidden"),I=function(){let e=(0,a.useContext)(y);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:_,unregister:W}=I;(0,l.e)(()=>_(Q),[_,Q]),(0,l.e)(()=>{if(V===g.l4.Hidden&&Q.current){if(F&&"visible"!==H){B("visible");return}return(0,p.E)(H,{hidden:()=>W(Q),visible:()=>_(Q)})}},[H,Q,_,W,F,V]);let Y=(0,d.H)();(0,l.e)(()=>{if(A&&Y&&"visible"===H&&null===Q.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[Q,H,Y,A]);let X=K&&!z,G=z&&F&&K,U=(0,a.useRef)(!1),J=C(()=>{U.current||(B("hidden"),W(Q))},I),$=(0,o.z)(e=>{U.current=!0,J.onStart(Q,e?"enter":"leave",e=>{"enter"===e?null==s||s():"leave"===e&&(null==w||w())})}),ee=(0,o.z)(e=>{let t=e?"enter":"leave";U.current=!1,J.onStop(Q,t,e=>{"enter"===e?null==u||u():"leave"===e&&(null==M||M())}),"leave"!==t||k(J)||(B("hidden"),W(Q))});(0,a.useEffect)(()=>{A&&i||($(F),ee(F))},[F,A,i]);let et=!(!i||!A||!Y||X),[,er]=(0,h.Y)(et,Z,F,{start:$,end:ee}),en=(0,g.oA)({ref:S,className:(null==(n=(0,m.A)(T.className,G&&q,G&&O,er.enter&&q,er.enter&&er.closed&&O,er.enter&&!er.closed&&L,er.leave&&P,er.leave&&!er.closed&&R,er.leave&&er.closed&&j,!er.transition&&F&&N))?void 0:n.trim())||void 0,...(0,h.X)(er)}),ea=0;"visible"===H&&(ea|=f.ZM.Open),"hidden"===H&&(ea|=f.ZM.Closed),er.enter&&(ea|=f.ZM.Opening),er.leave&&(ea|=f.ZM.Closing);let ei=(0,g.L6)();return a.createElement(y.Provider,{value:J},a.createElement(f.up,{value:ea},ei({ourProps:en,theirProps:T,defaultTag:x,features:E,visible:"visible"===H,name:"Transition.Child"})))}),O=(0,g.yV)(function(e,t){let r=null!==(0,a.useContext)(v),n=null!==(0,f.oJ)();return a.createElement(a.Fragment,null,!r&&n?a.createElement(M,{ref:t,...e}):a.createElement(q,{ref:t,...e}))}),L=Object.assign(M,{Child:O,Root:M})},92668:function(e,t,r){r.d(t,{I:function(){return s}});var n=r(59121),a=r(31091),i=r(63497),o=r(99649);function s(e,t){let{years:r=0,months:s=0,weeks:l=0,days:u=0,hours:d=0,minutes:c=0,seconds:h=0}=t,f=(0,o.Q)(e),m=s||r?(0,a.z)(f,s+12*r):f,p=u||l?(0,n.E)(m,u+7*l):m;return(0,i.L)(e,p.getTime()+1e3*(h+60*(c+60*d)))}},59121:function(e,t,r){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){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(),o=(0,a.L)(e,r.getTime());return(o.setMonth(r.getMonth()+t+1,0),i>=o.getDate())?o:(r.setFullYear(o.getFullYear(),o.getMonth(),i),r)}},63497:function(e,t,r){r.d(t,{L:function(){return n}});function n(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}},99649:function(e,t,r){r.d(t,{Q:function(){return n}});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)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1518-4475f8385da5ac78.js b/litellm/proxy/_experimental/out/_next/static/chunks/1518-af5eabc2040f5a96.js similarity index 65% rename from litellm/proxy/_experimental/out/_next/static/chunks/1518-4475f8385da5ac78.js rename to litellm/proxy/_experimental/out/_next/static/chunks/1518-af5eabc2040f5a96.js index 476fabcb02..1a82a757ee 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1518-4475f8385da5ac78.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1518-af5eabc2040f5a96.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1518],{81518:function(e,s,a){a.r(s),a.d(s,{default:function(){return Y}});var t=a(57437),r=a(2265),n=a(85572),l=a(93837),i=a(37592),o=a(4260),d=a(99981),c=a(5545),m=a(26430),u=a(96473),x=a(9114),h=a(10703),p=a(95459),g=a(32489),f=a(98728),v=a(62831),j=a(17906),y=a(94263),b=a(79862),N=a(82222),k=a(51817),w=a(94331),A=a(38398),S=a(33152);function C(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.jsx)("div",{className:"whitespace-pre-wrap break-words",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:(0,t.jsx)(v.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)(j.Z,{style:y.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)(b.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)(N.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)(w.Z,{reasoningContent:n.reasoningContent}),n.searchResults&&(0,t.jsx)(S.J,{searchResults:n.searchResults}),l(n),(n.timeToFirstToken||n.totalLatency||n.usage)&&(0,t.jsx)(A.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)(k.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)(k.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]})]})}var T=a(31283);function P(e){let{value:s,onChange:a,models:n,loading:l,disabled:o}=e,[d,c]=(0,r.useState)(!1),[m,u]=(0,r.useState)(""),x=(0,r.useMemo)(()=>Array.from(new Set(n)).sort(),[n]),h=(0,r.useMemo)(()=>s&&!x.includes(s)?[s,...x]:x,[x,s]),p=d?"__custom__":s||void 0,g=()=>{let e=m.trim();if(!e){c(!1),u("");return}a(e),c(!1),u("")};return(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)(i.default,{value:p,onChange:e=>{if("__custom__"===e){c(!0),s&&!x.includes(s)?u(s):u("");return}c(!1),u(""),a(e)},disabled:o,loading:l,placeholder:l?"Loading models...":"Select a model",className:"w-full rounded-md",showSearch:!0,optionFilterProp:"children",children:[h.map(e=>(0,t.jsx)(i.default.Option,{value:e,children:e},e)),(0,t.jsx)(i.default.Option,{value:"__custom__",children:"+ Add custom model"})]}),d&&(0,t.jsx)(T.o,{className:"mt-2",placeholder:"Custom Model Name (Enter to add)",value:m,onValueChange:u,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),g())},onBlur:g,autoFocus:!0})]})}var Z=a(99020),_=a(97415),L=a(67479),E=a(61994),M=a(23496),I=a(85847),O=a(79326);function R(e){let{comparison:s,onUpdate:a,onRemove:n,canRemove:l,modelOptions:i,isLoadingModels:o,apiKey:d}=e,[c,m]=(0,r.useState)(!1),u=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})},x=e=>{a({useAdvancedParams:e},s.applyAcrossModels?{applyToAll:!0,keysToApply:["useAdvancedParams"]}:void 0)},h=(e,t)=>{a({[e]:t},s.applyAcrossModels?{applyToAll:!0,keysToApply:[e]}:void 0)},p=s.useAdvancedParams?1:.4,v=s.useAdvancedParams?"text-gray-700":"text-gray-400",j=()=>{m(e=>!e)},y=(0,t.jsxs)("div",{className:"w-[300px] max-h-[65vh] overflow-y-auto relative",children:[(0,t.jsx)("button",{onClick:()=>{m(!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)(g.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)(E.Z,{checked:s.applyAcrossModels,onChange:e=>u(e.target.checked),children:(0,t.jsx)("span",{className:"text-xs font-medium",children:"Sync Settings Across Models"})})}),(0,t.jsx)(M.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.Z,{value:s.tags,onChange:e=>h("tags",e),accessToken:d})]}),(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)(_.Z,{value:s.vectorStores,onChange:e=>h("vectorStores",e),accessToken:d})]}),(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)(L.Z,{value:s.guardrails,onChange:e=>h("guardrails",e),accessToken:d})]})]})]}),(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)(E.Z,{checked:s.useAdvancedParams,onChange:e=>x(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:p},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(v),children:"Temperature"}),(0,t.jsx)("span",{className:"text-xs ".concat(v),children:s.temperature.toFixed(2)})]}),(0,t.jsx)(I.Z,{min:0,max:2,step:.01,value:s.temperature,onChange:e=>{h("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(v),children:"Max Tokens"}),(0,t.jsx)("span",{className:"text-xs ".concat(v),children:s.maxTokens})]}),(0,t.jsx)(I.Z,{min:1,max:32768,step:1,value:s.maxTokens,onChange:e=>{h("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)(P,{value:s.model,models:i,loading:o,onChange:e=>a({model:e})}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(O.Z,{content:y,trigger:[],open:c,onOpenChange:()=>{},placement:"bottomRight",destroyTooltipOnHide:!1,children:(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),j()},className:"p-2 rounded-lg transition-colors ".concat(c?"bg-gray-200 text-gray-700":"hover:bg-gray-100 text-gray-600"),children:(0,t.jsx)(f.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)(g.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)(C,{messages:s.messages,isLoading:s.isLoading})})})]})}var z=a(79276);let{TextArea:U}=o.default;function K(e){let{value:s,onChange:a,onSend:r,disabled:n}=e;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:[(0,t.jsx)(U,{value:s,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),!n&&s.trim()&&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)(c.ZP,{onClick:r,disabled:n||!s.trim(),icon:(0,t.jsx)(z.Z,{}),shape:"circle"})]})})}let B=["Can you summarize the key points?","What assumptions did you make?","What are the next steps?"],D=["Write me a poem","Explain quantum computing","Draft a polite email requesting a meeting"],F="/v1/chat/completions";function W(e){let{accessToken:s,disabledPersonalKeyCreation:a}=e,[n,g]=(0,r.useState)([{id:"1",model:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1},{id:"2",model:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1}]),[f,v]=(0,r.useState)([]),[j,y]=(0,r.useState)(!1),[b,N]=(0,r.useState)(""),[k,w]=(0,r.useState)(a?"custom":"session"),[A,S]=(0,r.useState)(""),[C,T]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=setTimeout(()=>{T(A)},300);return()=>clearTimeout(e)},[A]);let P=(0,r.useMemo)(()=>"session"===k?s||"":C.trim(),[k,s,C]),Z=(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(!P){v([]);return}y(!0);try{let s=await (0,h.p)(P);if(!e)return;let a=Array.from(new Set(s.map(e=>e.model_group)));v(a)}catch(s){console.error("CompareUI: failed to fetch models",s),e&&v([])}finally{e&&y(!1)}})(),()=>{e=!1}},[P]),(0,r.useEffect)(()=>{0!==f.length&&g(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=f[s%f.length])&&void 0!==l?l:""}}}))},[f]);let _=e=>{n.length>1&&g(s=>s.filter(s=>s.id!==e))},L=(e,s,a)=>{g(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)})},E=(e,s,a)=>{s&&g(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}}))},M=(e,s)=>{s&&g(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}}))},I=(e,s)=>{g(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}}))},O=(e,s)=>{g(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}}))},z=(e,s,a)=>{g(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}}))},U=(e,s)=>{s&&g(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}}))},W=!!s,G=e=>{let s=e.trim();if(!s)return;if(!P){x.Z.fromBackend("Please provide an API key or select Current UI Session");return}if(0===n.length)return;if(n.some(e=>!e.model)){x.Z.fromBackend("Select a model before sending a message.");return}let a=new Map;n.forEach(e=>{var t;let r=null!==(t=e.traceId)&&void 0!==t?t:(0,l.Z)();a.set(e.id,{id:e.id,model:e.model,traceId:r,tags:e.tags,vectorStores:e.vectorStores,guardrails:e.guardrails,temperature:e.temperature,maxTokens:e.maxTokens,messages:[...e.messages,{role:"user",content:s}]})}),0!==a.size&&(g(e=>e.map(e=>{let s=a.get(e.id);return s?{...e,traceId:s.traceId,messages:s.messages,isLoading:!0}:e})),a.forEach(e=>{var s;let a=e.messages.map(e=>{let{role:s,content:a}=e;return{role:s,content:"string"==typeof a?a:""}}),t=e.tags.length>0?e.tags:void 0,r=e.vectorStores.length>0?e.vectorStores:void 0,l=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;(0,p.n)(a,(s,a)=>E(e.id,s,a),e.model,P,t,void 0,s=>M(e.id,s),s=>I(e.id,s),s=>z(e.id,s),e.traceId,r,l,void 0,void 0,s=>U(e.id,s),o?e.temperature:void 0,o?e.maxTokens:void 0,s=>O(e.id,s)).catch(s=>{let a=s instanceof Error?s.message:String(s);console.error("CompareUI: failed to fetch response",s),x.Z.fromBackend(a),g(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(()=>{g(s=>s.map(s=>s.id===e.id?{...s,isLoading:!1}:s))})}))},V=e=>{N(e)},X=n.some(e=>e.messages.length>0),Y=n.some(e=>e.isLoading);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-140px)] 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:"API Key Source"}),(0,t.jsxs)(i.default,{value:k,onChange:e=>w(e),disabled:a,className:"w-48",children:[(0,t.jsx)(i.default.Option,{value:"session",disabled:!W,children:"Current UI Session"}),(0,t.jsx)(i.default.Option,{value:"custom",children:"Virtual Key"})]}),"custom"===k&&(0,t.jsx)(o.default.Password,{value:A,onChange:e=>S(e.target.value),placeholder:"Enter API 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)(d.Z,{title:"Other endpoints will be available soon",children:(0,t.jsx)(i.default,{value:F,disabled:!0,className:"w-56",children:(0,t.jsx)(i.default.Option,{value:F,children:F})})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(c.ZP,{onClick:()=>{g(e=>e.map(e=>({...e,messages:[],traceId:void 0,isLoading:!1}))),N("")},disabled:!X,icon:(0,t.jsx)(m.Z,{}),children:"Clear All Chats"}),(0,t.jsx)(d.Z,{title:n.length>=3?"Compare up to 3 models at a time":"Add another comparison",children:(0,t.jsx)(c.ZP,{onClick:()=>{var e;if(n.length>=3)return;let s=null!==(e=f[n.length%(f.length||1)])&&void 0!==e?e:"",a={id:Date.now().toString(),model:s,messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1};g(e=>[...e,a])},disabled:n.length>=3,icon:(0,t.jsx)(u.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)(R,{comparison:e,onUpdate:(s,a)=>L(e.id,s,a),onRemove:()=>_(e.id),canRemove:n.length>1,modelOptions:f,isLoadingModels:j,apiKey:P},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:X||Y?Z?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:B.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>V(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))}):Y?(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}),"Gathering responses from all models..."]}):(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Send a prompt to compare models"}):(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:D.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>V(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))})}),(0,t.jsx)(K,{value:b,onChange:e=>{N(e)},onSend:()=>{G(b),N("")},disabled:0===n.length||n.every(e=>e.isLoading)})]})})})]})})}var G=a(58643),V=a(39760),X=a(91624);function Y(){let{accessToken:e,userRole:s,userId:a,disabledPersonalKeyCreation:l,token:i}=(0,V.Z)(),[o,d]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{(async()=>{if(e){let s=await (0,X.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)(G.v0,{className:"h-full w-full",children:[(0,t.jsxs)(G.td,{className:"mb-0",children:[(0,t.jsx)(G.OK,{children:"Chat"}),(0,t.jsx)(G.OK,{children:"Compare"})]}),(0,t.jsxs)(G.nP,{className:"h-full",children:[(0,t.jsx)(G.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)(G.x4,{className:"h-full",children:(0,t.jsx)(W,{accessToken:e,disabledPersonalKeyCreation:l})})]})]})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1518],{81518:function(e,s,a){a.r(s),a.d(s,{default:function(){return Y}});var t=a(57437),r=a(2265),n=a(39566),l=a(93837),i=a(37592),o=a(4260),d=a(99981),c=a(5545),m=a(26430),u=a(96473),x=a(9114),h=a(10703),p=a(95459),g=a(32489),f=a(98728),v=a(62831),j=a(17906),y=a(57365),b=a(79862),N=a(82222),k=a(51817),w=a(94331),A=a(38398),S=a(33152);function C(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.jsx)("div",{className:"whitespace-pre-wrap break-words",style:{wordWrap:"break-word",overflowWrap:"break-word",wordBreak:"break-word",hyphens:"auto"},children:(0,t.jsx)(v.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)(j.Z,{style:y.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)(b.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)(N.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)(w.Z,{reasoningContent:n.reasoningContent}),n.searchResults&&(0,t.jsx)(S.J,{searchResults:n.searchResults}),l(n),(n.timeToFirstToken||n.totalLatency||n.usage)&&(0,t.jsx)(A.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)(k.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)(k.Z,{size:18,className:"animate-spin"}),(0,t.jsx)("span",{children:"Generating response..."})]})]})}var T=a(31283);function Z(e){let{value:s,onChange:a,models:n,loading:l,disabled:o}=e,[d,c]=(0,r.useState)(!1),[m,u]=(0,r.useState)(""),x=(0,r.useMemo)(()=>Array.from(new Set(n)).sort(),[n]),h=(0,r.useMemo)(()=>s&&!x.includes(s)?[s,...x]:x,[x,s]),p=d?"__custom__":s||void 0,g=()=>{let e=m.trim();if(!e){c(!1),u("");return}a(e),c(!1),u("")};return(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)(i.default,{value:p,onChange:e=>{if("__custom__"===e){c(!0),s&&!x.includes(s)?u(s):u("");return}c(!1),u(""),a(e)},disabled:o,loading:l,placeholder:l?"Loading models...":"Select a model",className:"w-full rounded-md",showSearch:!0,optionFilterProp:"children",children:[h.map(e=>(0,t.jsx)(i.default.Option,{value:e,children:e},e)),(0,t.jsx)(i.default.Option,{value:"__custom__",children:"+ Add custom model"})]}),d&&(0,t.jsx)(T.o,{className:"mt-2",placeholder:"Custom Model Name (Enter to add)",value:m,onValueChange:u,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),g())},onBlur:g,autoFocus:!0})]})}var P=a(99020),_=a(97415),L=a(67479),E=a(61994),M=a(23496),I=a(85847),O=a(79326);function R(e){let{comparison:s,onUpdate:a,onRemove:n,canRemove:l,modelOptions:i,isLoadingModels:o,apiKey:d}=e,[c,m]=(0,r.useState)(!1),u=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})},x=e=>{a({useAdvancedParams:e},s.applyAcrossModels?{applyToAll:!0,keysToApply:["useAdvancedParams"]}:void 0)},h=(e,t)=>{a({[e]:t},s.applyAcrossModels?{applyToAll:!0,keysToApply:[e]}:void 0)},p=s.useAdvancedParams?1:.4,v=s.useAdvancedParams?"text-gray-700":"text-gray-400",j=()=>{m(e=>!e)},y=(0,t.jsxs)("div",{className:"w-[300px] max-h-[65vh] overflow-y-auto relative",children:[(0,t.jsx)("button",{onClick:()=>{m(!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)(g.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)(E.Z,{checked:s.applyAcrossModels,onChange:e=>u(e.target.checked),children:(0,t.jsx)("span",{className:"text-xs font-medium",children:"Sync Settings Across Models"})})}),(0,t.jsx)(M.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)(P.Z,{value:s.tags,onChange:e=>h("tags",e),accessToken:d})]}),(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)(_.Z,{value:s.vectorStores,onChange:e=>h("vectorStores",e),accessToken:d})]}),(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)(L.Z,{value:s.guardrails,onChange:e=>h("guardrails",e),accessToken:d})]})]})]}),(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)(E.Z,{checked:s.useAdvancedParams,onChange:e=>x(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:p},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(v),children:"Temperature"}),(0,t.jsx)("span",{className:"text-xs ".concat(v),children:s.temperature.toFixed(2)})]}),(0,t.jsx)(I.Z,{min:0,max:2,step:.01,value:s.temperature,onChange:e=>{h("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(v),children:"Max Tokens"}),(0,t.jsx)("span",{className:"text-xs ".concat(v),children:s.maxTokens})]}),(0,t.jsx)(I.Z,{min:1,max:32768,step:1,value:s.maxTokens,onChange:e=>{h("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)(Z,{value:s.model,models:i,loading:o,onChange:e=>a({model:e})}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)(O.Z,{content:y,trigger:[],open:c,onOpenChange:()=>{},placement:"bottomRight",destroyTooltipOnHide:!1,children:(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),j()},className:"p-2 rounded-lg transition-colors ".concat(c?"bg-gray-200 text-gray-700":"hover:bg-gray-100 text-gray-600"),children:(0,t.jsx)(f.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)(g.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)(C,{messages:s.messages,isLoading:s.isLoading})})})]})}var z=a(79276);let{TextArea:U}=o.default;function K(e){let{value:s,onChange:a,onSend:r,disabled:n}=e;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:[(0,t.jsx)(U,{value:s,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),!n&&s.trim()&&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)(c.ZP,{onClick:r,disabled:n||!s.trim(),icon:(0,t.jsx)(z.Z,{}),shape:"circle"})]})})}let B=["Can you summarize the key points?","What assumptions did you make?","What are the next steps?"],D=["Write me a poem","Explain quantum computing","Draft a polite email requesting a meeting"],F="/v1/chat/completions";function W(e){let{accessToken:s,disabledPersonalKeyCreation:a}=e,[n,g]=(0,r.useState)([{id:"1",model:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1},{id:"2",model:"",messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1}]),[f,v]=(0,r.useState)([]),[j,y]=(0,r.useState)(!1),[b,N]=(0,r.useState)(""),[k,w]=(0,r.useState)(a?"custom":"session"),[A,S]=(0,r.useState)(""),[C,T]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=setTimeout(()=>{T(A)},300);return()=>clearTimeout(e)},[A]);let Z=(0,r.useMemo)(()=>"session"===k?s||"":C.trim(),[k,s,C]),P=(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(!Z){v([]);return}y(!0);try{let s=await (0,h.p)(Z);if(!e)return;let a=Array.from(new Set(s.map(e=>e.model_group)));v(a)}catch(s){console.error("CompareUI: failed to fetch models",s),e&&v([])}finally{e&&y(!1)}})(),()=>{e=!1}},[Z]),(0,r.useEffect)(()=>{0!==f.length&&g(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=f[s%f.length])&&void 0!==l?l:""}}}))},[f]);let _=e=>{n.length>1&&g(s=>s.filter(s=>s.id!==e))},L=(e,s,a)=>{g(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)})},E=(e,s,a)=>{s&&g(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}}))},M=(e,s)=>{s&&g(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}}))},I=(e,s)=>{g(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}}))},O=(e,s)=>{g(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}}))},z=(e,s,a)=>{g(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}}))},U=(e,s)=>{s&&g(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}}))},W=!!s,G=e=>{let s=e.trim();if(!s)return;if(!Z){x.Z.fromBackend("Please provide a Virtual Key or select Current UI Session");return}if(0===n.length)return;if(n.some(e=>!e.model)){x.Z.fromBackend("Select a model before sending a message.");return}let a=new Map;n.forEach(e=>{var t;let r=null!==(t=e.traceId)&&void 0!==t?t:(0,l.Z)();a.set(e.id,{id:e.id,model:e.model,traceId:r,tags:e.tags,vectorStores:e.vectorStores,guardrails:e.guardrails,temperature:e.temperature,maxTokens:e.maxTokens,messages:[...e.messages,{role:"user",content:s}]})}),0!==a.size&&(g(e=>e.map(e=>{let s=a.get(e.id);return s?{...e,traceId:s.traceId,messages:s.messages,isLoading:!0}:e})),a.forEach(e=>{var s;let a=e.messages.map(e=>{let{role:s,content:a}=e;return{role:s,content:"string"==typeof a?a:""}}),t=e.tags.length>0?e.tags:void 0,r=e.vectorStores.length>0?e.vectorStores:void 0,l=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;(0,p.n)(a,(s,a)=>E(e.id,s,a),e.model,Z,t,void 0,s=>M(e.id,s),s=>I(e.id,s),s=>z(e.id,s),e.traceId,r,l,void 0,void 0,s=>U(e.id,s),o?e.temperature:void 0,o?e.maxTokens:void 0,s=>O(e.id,s)).catch(s=>{let a=s instanceof Error?s.message:String(s);console.error("CompareUI: failed to fetch response",s),x.Z.fromBackend(a),g(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(()=>{g(s=>s.map(s=>s.id===e.id?{...s,isLoading:!1}:s))})}))},V=e=>{N(e)},X=n.some(e=>e.messages.length>0),Y=n.some(e=>e.isLoading);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-140px)] 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)(i.default,{value:k,onChange:e=>w(e),disabled:a,className:"w-48",children:[(0,t.jsx)(i.default.Option,{value:"session",disabled:!W,children:"Current UI Session"}),(0,t.jsx)(i.default.Option,{value:"custom",children:"Virtual Key"})]}),"custom"===k&&(0,t.jsx)(o.default.Password,{value:A,onChange:e=>S(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)(d.Z,{title:"Other endpoints will be available soon",children:(0,t.jsx)(i.default,{value:F,disabled:!0,className:"w-56",children:(0,t.jsx)(i.default.Option,{value:F,children:F})})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(c.ZP,{onClick:()=>{g(e=>e.map(e=>({...e,messages:[],traceId:void 0,isLoading:!1}))),N("")},disabled:!X,icon:(0,t.jsx)(m.Z,{}),children:"Clear All Chats"}),(0,t.jsx)(d.Z,{title:n.length>=3?"Compare up to 3 models at a time":"Add another comparison",children:(0,t.jsx)(c.ZP,{onClick:()=>{var e;if(n.length>=3)return;let s=null!==(e=f[n.length%(f.length||1)])&&void 0!==e?e:"",a={id:Date.now().toString(),model:s,messages:[],isLoading:!1,tags:[],mcpTools:[],vectorStores:[],guardrails:[],temperature:1,maxTokens:2048,applyAcrossModels:!1,useAdvancedParams:!1};g(e=>[...e,a])},disabled:n.length>=3,icon:(0,t.jsx)(u.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)(R,{comparison:e,onUpdate:(s,a)=>L(e.id,s,a),onRemove:()=>_(e.id),canRemove:n.length>1,modelOptions:f,isLoadingModels:j,apiKey:Z},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:X||Y?P?(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:B.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>V(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))}):Y?(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}),"Gathering responses from all models..."]}):(0,t.jsx)("span",{className:"text-sm text-gray-500",children:"Send a prompt to compare models"}):(0,t.jsx)("div",{className:"flex items-center gap-2 overflow-x-auto",children:D.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>V(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))})}),(0,t.jsx)(K,{value:b,onChange:e=>{N(e)},onSend:()=>{G(b),N("")},disabled:0===n.length||n.every(e=>e.isLoading)})]})})})]})})}var G=a(58643),V=a(39760),X=a(91624);function Y(){let{accessToken:e,userRole:s,userId:a,disabledPersonalKeyCreation:l,token:i}=(0,V.Z)(),[o,d]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{(async()=>{if(e){let s=await (0,X.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)(G.v0,{className:"h-full w-full",children:[(0,t.jsxs)(G.td,{className:"mb-0",children:[(0,t.jsx)(G.OK,{children:"Chat"}),(0,t.jsx)(G.OK,{children:"Compare"})]}),(0,t.jsxs)(G.nP,{className:"h-full",children:[(0,t.jsx)(G.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)(G.x4,{className:"h-full",children:(0,t.jsx)(W,{accessToken:e,disabledPersonalKeyCreation:l})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1529-59ce29afdf8ccc9b.js b/litellm/proxy/_experimental/out/_next/static/chunks/1529-59ce29afdf8ccc9b.js deleted file mode 100644 index c98ed86dee..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1529-59ce29afdf8ccc9b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1529],{60440:function(e,n,t){t.d(n,{Z:function(){return a}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},l=t(55015),a=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},77565:function(e,n,t){t.d(n,{Z:function(){return a}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},l=t(55015),a=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},71030:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(1119),o=t(11993),i=t(26365),l=t(6989),a=t(97821),u=t(36760),c=t.n(u),s=t(28791),f=t(2265),d=t(95814),p=t(53346),v=d.Z.ESC,m=d.Z.TAB,b=(0,f.forwardRef)(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,i=(0,f.useMemo)(function(){return"function"==typeof t?t():t},[t]),l=(0,s.sQ)(n,(0,s.C4)(i));return f.createElement(f.Fragment,null,r&&f.createElement("div",{className:"".concat(o,"-arrow")}),f.cloneElement(i,{ref:(0,s.Yr)(i)?l:void 0}))}),y={adjustX:1,adjustY:1},h=[0,0],g={topLeft:{points:["bl","tl"],overflow:y,offset:[0,-4],targetOffset:h},top:{points:["bc","tc"],overflow:y,offset:[0,-4],targetOffset:h},topRight:{points:["br","tr"],overflow:y,offset:[0,-4],targetOffset:h},bottomLeft:{points:["tl","bl"],overflow:y,offset:[0,4],targetOffset:h},bottom:{points:["tc","bc"],overflow:y,offset:[0,4],targetOffset:h},bottomRight:{points:["tr","br"],overflow:y,offset:[0,4],targetOffset:h}},Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],C=f.forwardRef(function(e,n){var t,u,d,y,h,C,E,w,k,M,R,x,N,P,S=e.arrow,I=void 0!==S&&S,K=e.prefixCls,A=void 0===K?"rc-dropdown":K,O=e.transitionName,T=e.animation,L=e.align,D=e.placement,_=e.placements,V=e.getPopupContainer,z=e.showAction,F=e.hideAction,j=e.overlayClassName,B=e.overlayStyle,W=e.visible,H=e.trigger,Y=void 0===H?["hover"]:H,q=e.autoFocus,X=e.overlay,G=e.children,Q=e.onVisibleChange,U=(0,l.Z)(e,Z),J=f.useState(),$=(0,i.Z)(J,2),ee=$[0],en=$[1],et="visible"in e?W:ee,er=f.useRef(null),eo=f.useRef(null),ei=f.useRef(null);f.useImperativeHandle(n,function(){return er.current});var el=function(e){en(e),null==Q||Q(e)};u=(t={visible:et,triggerRef:ei,onVisibleChange:el,autoFocus:q,overlayRef:eo}).visible,d=t.triggerRef,y=t.onVisibleChange,h=t.autoFocus,C=t.overlayRef,E=f.useRef(!1),w=function(){if(u){var e,n;null===(e=d.current)||void 0===e||null===(n=e.focus)||void 0===n||n.call(e),null==y||y(!1)}},k=function(){var e;return null!==(e=C.current)&&void 0!==e&&!!e.focus&&(C.current.focus(),E.current=!0,!0)},M=function(e){switch(e.keyCode){case v:w();break;case m:var n=!1;E.current||(n=k()),n?e.preventDefault():w()}},f.useEffect(function(){return u?(window.addEventListener("keydown",M),h&&(0,p.Z)(k,3),function(){window.removeEventListener("keydown",M),E.current=!1}):function(){E.current=!1}},[u]);var ea=function(){return f.createElement(b,{ref:eo,overlay:X,prefixCls:A,arrow:I})},eu=f.cloneElement(G,{className:c()(null===(P=G.props)||void 0===P?void 0:P.className,et&&(void 0!==(R=e.openClassName)?R:"".concat(A,"-open"))),ref:(0,s.Yr)(G)?(0,s.sQ)(ei,(0,s.C4)(G)):void 0}),ec=F;return ec||-1===Y.indexOf("contextMenu")||(ec=["click"]),f.createElement(a.Z,(0,r.Z)({builtinPlacements:void 0===_?g:_},U,{prefixCls:A,ref:er,popupClassName:c()(j,(0,o.Z)({},"".concat(A,"-show-arrow"),I)),popupStyle:B,action:Y,showAction:z,hideAction:ec,popupPlacement:void 0===D?"bottomLeft":D,popupAlign:L,popupTransitionName:O,popupAnimation:T,popupVisible:et,stretch:(x=e.minOverlayWidthMatchTrigger,N=e.alignPoint,"minOverlayWidthMatchTrigger"in e?x:!N)?"minWidth":"",popup:"function"==typeof X?ea:ea(),onPopupVisibleChange:el,onPopupClick:function(n){var t=e.onOverlayClick;en(!1),t&&t(n)},getPopupContainer:V}),eu)})},33082:function(e,n,t){t.d(n,{iz:function(){return eA},ck:function(){return ev},BW:function(){return eL},sN:function(){return ev},Wd:function(){return eI},ZP:function(){return ej},Xl:function(){return x}});var r=t(1119),o=t(11993),i=t(31686),l=t(83145),a=t(26365),u=t(6989),c=t(36760),s=t.n(c),f=t(1699),d=t(50506),p=t(16671),v=t(32559),m=t(2265),b=t(54887),y=m.createContext(null);function h(e,n){return void 0===e?null:"".concat(e,"-").concat(n)}function g(e){return h(m.useContext(y),e)}var Z=t(6397),C=["children","locked"],E=m.createContext(null);function w(e){var n=e.children,t=e.locked,r=(0,u.Z)(e,C),o=m.useContext(E),l=(0,Z.Z)(function(){var e;return e=(0,i.Z)({},o),Object.keys(r).forEach(function(n){var t=r[n];void 0!==t&&(e[n]=t)}),e},[o,r],function(e,n){return!t&&(e[0]!==n[0]||!(0,p.Z)(e[1],n[1],!0))});return m.createElement(E.Provider,{value:l},n)}var k=m.createContext(null);function M(){return m.useContext(k)}var R=m.createContext([]);function x(e){var n=m.useContext(R);return m.useMemo(function(){return void 0!==e?[].concat((0,l.Z)(n),[e]):n},[n,e])}var N=m.createContext(null),P=m.createContext({}),S=t(2857);function I(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,S.Z)(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||"a"===t&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),l=null;return o&&!Number.isNaN(i)?l=i:r&&null===l&&(l=0),r&&e.disabled&&(l=null),null!==l&&(l>=0||n&&l<0)}return!1}var K=t(95814),A=t(53346),O=K.Z.LEFT,T=K.Z.RIGHT,L=K.Z.UP,D=K.Z.DOWN,_=K.Z.ENTER,V=K.Z.ESC,z=K.Z.HOME,F=K.Z.END,j=[L,D,O,T];function B(e,n){return(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,l.Z)(e.querySelectorAll("*")).filter(function(e){return I(e,n)});return I(e,n)&&t.unshift(e),t})(e,!0).filter(function(e){return n.has(e)})}function W(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=B(e,n),i=o.length,l=o.findIndex(function(e){return t===e});return r<0?-1===l?l=i-1:l-=1:r>0&&(l+=1),o[l=(l+i)%i]}var H=function(e,n){var t=new Set,r=new Map,o=new Map;return e.forEach(function(e){var i=document.querySelector("[data-menu-id='".concat(h(n,e),"']"));i&&(t.add(i),o.set(i,e),r.set(e,i))}),{elements:t,key2element:r,element2key:o}},Y="__RC_UTIL_PATH_SPLIT__",q=function(e){return e.join(Y)},X="rc-menu-more";function G(e){var n=m.useRef(e);n.current=e;var t=m.useCallback(function(){for(var e,t=arguments.length,r=Array(t),o=0;o1&&(k.motionAppear=!1);var M=k.onVisibleChanged;return(k.onVisibleChanged=function(e){return b.current||e||Z(!0),null==M?void 0:M(e)},g)?null:m.createElement(w,{mode:u,locked:!b.current},m.createElement(eR.ZP,(0,r.Z)({visible:C},k,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var t=e.className,r=e.style;return m.createElement(eb,{id:n,className:t,style:r},l)}))}var eN=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eP=["active"],eS=m.forwardRef(function(e,n){var t=e.style,l=e.className,c=e.title,d=e.eventKey,p=(e.warnKey,e.disabled),v=e.internalPopupClose,b=e.children,y=e.itemIcon,h=e.expandIcon,Z=e.popupClassName,C=e.popupOffset,k=e.popupStyle,M=e.onClick,R=e.onMouseEnter,S=e.onMouseLeave,I=e.onTitleClick,K=e.onTitleMouseEnter,A=e.onTitleMouseLeave,O=(0,u.Z)(e,eN),T=g(d),L=m.useContext(E),D=L.prefixCls,_=L.mode,V=L.openKeys,z=L.disabled,F=L.overflowDisabled,j=L.activeKey,B=L.selectedKeys,W=L.itemIcon,H=L.expandIcon,Y=L.onItemClick,q=L.onOpenChange,X=L.onActive,Q=m.useContext(P)._internalRenderSubMenuItem,U=m.useContext(N).isSubPathKey,J=x(),$="".concat(D,"-submenu"),ee=z||p,en=m.useRef(),et=m.useRef(),er=null!=h?h:H,ea=V.includes(d),ec=!F&&ea,es=U(B,d),ef=eo(d,ee,K,A),ed=ef.active,ep=(0,u.Z)(ef,eP),ev=m.useState(!1),em=(0,a.Z)(ev,2),ey=em[0],eh=em[1],eg=function(e){ee||eh(e)},eZ=m.useMemo(function(){return ed||"inline"!==_&&(ey||U([j],d))},[_,ed,j,ey,d,U]),eC=ei(J.length),eE=G(function(e){null==M||M(eu(e)),Y(e)}),ew=T&&"".concat(T,"-popup"),ek=m.useMemo(function(){return m.createElement(el,{icon:"horizontal"!==_?er:void 0,props:(0,i.Z)((0,i.Z)({},e),{},{isOpen:ec,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))},[_,er,e,ec,$]),eR=m.createElement("div",(0,r.Z)({role:"menuitem",style:eC,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:en,title:"string"==typeof c?c:null,"data-menu-id":F&&T?null:T,"aria-expanded":ec,"aria-haspopup":!0,"aria-controls":ew,"aria-disabled":ee,onClick:function(e){ee||(null==I||I({key:d,domEvent:e}),"inline"===_&&q(d,!ea))},onFocus:function(){X(d)}},ep),c,ek),eS=m.useRef(_);if("inline"!==_&&J.length>1?eS.current="vertical":eS.current=_,!F){var eI=eS.current;eR=m.createElement(eM,{mode:eI,prefixCls:$,visible:!v&&ec&&"inline"!==_,popupClassName:Z,popupOffset:C,popupStyle:k,popup:m.createElement(w,{mode:"horizontal"===eI?"vertical":eI},m.createElement(eb,{id:ew,ref:et},b)),disabled:ee,onVisibleChange:function(e){"inline"!==_&&q(d,e)}},eR)}var eK=m.createElement(f.Z.Item,(0,r.Z)({ref:n,role:"none"},O,{component:"li",style:t,className:s()($,"".concat($,"-").concat(_),l,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat($,"-open"),ec),"".concat($,"-active"),eZ),"".concat($,"-selected"),es),"".concat($,"-disabled"),ee)),onMouseEnter:function(e){eg(!0),null==R||R({key:d,domEvent:e})},onMouseLeave:function(e){eg(!1),null==S||S({key:d,domEvent:e})}}),eR,!F&&m.createElement(ex,{id:ew,open:ec,keyPath:J},b));return Q&&(eK=Q(eK,e,{selected:es,active:eZ,open:ec,disabled:ee})),m.createElement(w,{onItemClick:eE,mode:"horizontal"===_?"vertical":_,itemIcon:null!=y?y:W,expandIcon:er},eK)}),eI=m.forwardRef(function(e,n){var t,o=e.eventKey,i=e.children,l=x(o),a=eh(i,l),u=M();return m.useEffect(function(){if(u)return u.registerPath(o,l),function(){u.unregisterPath(o,l)}},[l]),t=u?a:m.createElement(eS,(0,r.Z)({ref:n},e),a),m.createElement(R.Provider,{value:l},t)}),eK=t(41154);function eA(e){var n=e.className,t=e.style,r=m.useContext(E).prefixCls;return M()?null:m.createElement("li",{role:"separator",className:s()("".concat(r,"-item-divider"),n),style:t})}var eO=["className","title","eventKey","children"],eT=m.forwardRef(function(e,n){var t=e.className,o=e.title,i=(e.eventKey,e.children),l=(0,u.Z)(e,eO),a=m.useContext(E).prefixCls,c="".concat(a,"-item-group");return m.createElement("li",(0,r.Z)({ref:n,role:"presentation"},l,{onClick:function(e){return e.stopPropagation()},className:s()(c,t)}),m.createElement("div",{role:"presentation",className:"".concat(c,"-title"),title:"string"==typeof o?o:void 0},o),m.createElement("ul",{role:"group",className:"".concat(c,"-list")},i))}),eL=m.forwardRef(function(e,n){var t=e.eventKey,o=eh(e.children,x(t));return M()?o:m.createElement(eT,(0,r.Z)({ref:n},(0,et.Z)(e,["warnKey"])),o)}),eD=["label","children","key","type","extra"];function e_(e,n,t,o,l){var a=e,c=(0,i.Z)({divider:eA,item:ev,group:eL,submenu:eI},o);return n&&(a=function e(n,t,o){var i=t.item,l=t.group,a=t.submenu,c=t.divider;return(n||[]).map(function(n,s){if(n&&"object"===(0,eK.Z)(n)){var f=n.label,d=n.children,p=n.key,v=n.type,b=n.extra,y=(0,u.Z)(n,eD),h=null!=p?p:"tmp-".concat(s);return d||"group"===v?"group"===v?m.createElement(l,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):m.createElement(a,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):"divider"===v?m.createElement(c,(0,r.Z)({key:h},y)):m.createElement(i,(0,r.Z)({key:h},y,{extra:b}),f,(!!b||0===b)&&m.createElement("span",{className:"".concat(o,"-item-extra")},b))}return null}).filter(function(e){return e})}(n,c,l)),eh(a,t)}var eV=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],ez=[],eF=m.forwardRef(function(e,n){var t,c,v,h,g,Z,C,E,M,R,x,S,I,K,J,$,ee,en,et,er,eo,ei,el,ea,ec,es,ef=e.prefixCls,ed=void 0===ef?"rc-menu":ef,ep=e.rootClassName,em=e.style,eb=e.className,ey=e.tabIndex,eh=e.items,eg=e.children,eZ=e.direction,eC=e.id,eE=e.mode,ew=void 0===eE?"vertical":eE,ek=e.inlineCollapsed,eM=e.disabled,eR=e.disabledOverflow,ex=e.subMenuOpenDelay,eN=e.subMenuCloseDelay,eP=e.forceSubMenuRender,eS=e.defaultOpenKeys,eK=e.openKeys,eA=e.activeKey,eO=e.defaultActiveFirst,eT=e.selectable,eL=void 0===eT||eT,eD=e.multiple,eF=void 0!==eD&&eD,ej=e.defaultSelectedKeys,eB=e.selectedKeys,eW=e.onSelect,eH=e.onDeselect,eY=e.inlineIndent,eq=e.motion,eX=e.defaultMotions,eG=e.triggerSubMenuAction,eQ=e.builtinPlacements,eU=e.itemIcon,eJ=e.expandIcon,e$=e.overflowedIndicator,e0=void 0===e$?"...":e$,e1=e.overflowedIndicatorPopupClassName,e6=e.getPopupContainer,e2=e.onClick,e5=e.onOpenChange,e9=e.onKeyDown,e3=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),e4=e._internalRenderSubMenuItem,e7=e._internalComponents,e8=(0,u.Z)(e,eV),ne=m.useMemo(function(){return[e_(eg,eh,ez,e7,ed),e_(eg,eh,ez,{},ed)]},[eg,eh,e7]),nn=(0,a.Z)(ne,2),nt=nn[0],nr=nn[1],no=m.useState(!1),ni=(0,a.Z)(no,2),nl=ni[0],na=ni[1],nu=m.useRef(),nc=(t=(0,d.Z)(eC,{value:eC}),v=(c=(0,a.Z)(t,2))[0],h=c[1],m.useEffect(function(){U+=1;var e="".concat(Q,"-").concat(U);h("rc-menu-uuid-".concat(e))},[]),v),ns="rtl"===eZ,nf=(0,d.Z)(eS,{value:eK,postState:function(e){return e||ez}}),nd=(0,a.Z)(nf,2),np=nd[0],nv=nd[1],nm=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function t(){nv(e),null==e5||e5(e)}n?(0,b.flushSync)(t):t()},nb=m.useState(np),ny=(0,a.Z)(nb,2),nh=ny[0],ng=ny[1],nZ=m.useRef(!1),nC=m.useMemo(function(){return("inline"===ew||"vertical"===ew)&&ek?["vertical",ek]:[ew,!1]},[ew,ek]),nE=(0,a.Z)(nC,2),nw=nE[0],nk=nE[1],nM="inline"===nw,nR=m.useState(nw),nx=(0,a.Z)(nR,2),nN=nx[0],nP=nx[1],nS=m.useState(nk),nI=(0,a.Z)(nS,2),nK=nI[0],nA=nI[1];m.useEffect(function(){nP(nw),nA(nk),nZ.current&&(nM?nv(nh):nm(ez))},[nw,nk]);var nO=m.useState(0),nT=(0,a.Z)(nO,2),nL=nT[0],nD=nT[1],n_=nL>=nt.length-1||"horizontal"!==nN||eR;m.useEffect(function(){nM&&ng(np)},[np]),m.useEffect(function(){return nZ.current=!0,function(){nZ.current=!1}},[]);var nV=(g=m.useState({}),Z=(0,a.Z)(g,2)[1],C=(0,m.useRef)(new Map),E=(0,m.useRef)(new Map),M=m.useState([]),x=(R=(0,a.Z)(M,2))[0],S=R[1],I=(0,m.useRef)(0),K=(0,m.useRef)(!1),J=function(){K.current||Z({})},$=(0,m.useCallback)(function(e,n){var t,r=q(n);E.current.set(r,e),C.current.set(e,r),I.current+=1;var o=I.current;t=function(){o===I.current&&J()},Promise.resolve().then(t)},[]),ee=(0,m.useCallback)(function(e,n){var t=q(n);E.current.delete(t),C.current.delete(e)},[]),en=(0,m.useCallback)(function(e){S(e)},[]),et=(0,m.useCallback)(function(e,n){var t=(C.current.get(e)||"").split(Y);return n&&x.includes(t[0])&&t.unshift(X),t},[x]),er=(0,m.useCallback)(function(e,n){return e.filter(function(e){return void 0!==e}).some(function(e){return et(e,!0).includes(n)})},[et]),eo=(0,m.useCallback)(function(e){var n="".concat(C.current.get(e)).concat(Y),t=new Set;return(0,l.Z)(E.current.keys()).forEach(function(e){e.startsWith(n)&&t.add(E.current.get(e))}),t},[]),m.useEffect(function(){return function(){K.current=!0}},[]),{registerPath:$,unregisterPath:ee,refreshOverflowKeys:en,isSubPathKey:er,getKeyPath:et,getKeys:function(){var e=(0,l.Z)(C.current.keys());return x.length&&e.push(X),e},getSubPathKeys:eo}),nz=nV.registerPath,nF=nV.unregisterPath,nj=nV.refreshOverflowKeys,nB=nV.isSubPathKey,nW=nV.getKeyPath,nH=nV.getKeys,nY=nV.getSubPathKeys,nq=m.useMemo(function(){return{registerPath:nz,unregisterPath:nF}},[nz,nF]),nX=m.useMemo(function(){return{isSubPathKey:nB}},[nB]);m.useEffect(function(){nj(n_?ez:nt.slice(nL+1).map(function(e){return e.key}))},[nL,n_]);var nG=(0,d.Z)(eA||eO&&(null===(es=nt[0])||void 0===es?void 0:es.key),{value:eA}),nQ=(0,a.Z)(nG,2),nU=nQ[0],nJ=nQ[1],n$=G(function(e){nJ(e)}),n0=G(function(){nJ(void 0)});(0,m.useImperativeHandle)(n,function(){return{list:nu.current,focus:function(e){var n,t,r=H(nH(),nc),o=r.elements,i=r.key2element,l=r.element2key,a=B(nu.current,o),u=null!=nU?nU:a[0]?l.get(a[0]):null===(n=nt.find(function(e){return!e.props.disabled}))||void 0===n?void 0:n.key,c=i.get(u);u&&c&&(null==c||null===(t=c.focus)||void 0===t||t.call(c,e))}}});var n1=(0,d.Z)(ej||[],{value:eB,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),n6=(0,a.Z)(n1,2),n2=n6[0],n5=n6[1],n9=function(e){if(eL){var n,t=e.key,r=n2.includes(t);n5(n=eF?r?n2.filter(function(e){return e!==t}):[].concat((0,l.Z)(n2),[t]):[t]);var o=(0,i.Z)((0,i.Z)({},e),{},{selectedKeys:n});r?null==eH||eH(o):null==eW||eW(o)}!eF&&np.length&&"inline"!==nN&&nm(ez)},n3=G(function(e){null==e2||e2(eu(e)),n9(e)}),n4=G(function(e,n){var t=np.filter(function(n){return n!==e});if(n)t.push(e);else if("inline"!==nN){var r=nY(e);t=t.filter(function(e){return!r.has(e)})}(0,p.Z)(np,t,!0)||nm(t,!0)}),n7=(ei=function(e,n){var t=null!=n?n:!np.includes(e);n4(e,t)},el=m.useRef(),(ea=m.useRef()).current=nU,ec=function(){A.Z.cancel(el.current)},m.useEffect(function(){return function(){ec()}},[]),function(e){var n=e.which;if([].concat(j,[_,V,z,F]).includes(n)){var t=nH(),r=H(t,nc),i=r,l=i.elements,a=i.key2element,u=i.element2key,c=function(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}(a.get(nU),l),s=u.get(c),f=function(e,n,t,r){var i,l="prev",a="next",u="children",c="parent";if("inline"===e&&r===_)return{inlineTrigger:!0};var s=(0,o.Z)((0,o.Z)({},L,l),D,a),f=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},O,t?a:l),T,t?l:a),D,u),_,u),d=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},L,l),D,a),_,u),V,c),O,t?u:c),T,t?c:u);switch(null===(i=({inline:s,horizontal:f,vertical:d,inlineSub:s,horizontalSub:d,verticalSub:d})["".concat(e).concat(n?"":"Sub")])||void 0===i?void 0:i[r]){case l:return{offset:-1,sibling:!0};case a:return{offset:1,sibling:!0};case c:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}(nN,1===nW(s,!0).length,ns,n);if(!f&&n!==z&&n!==F)return;(j.includes(n)||[z,F].includes(n))&&e.preventDefault();var d=function(e){if(e){var n=e,t=e.querySelector("a");null!=t&&t.getAttribute("href")&&(n=t);var r=u.get(e);nJ(r),ec(),el.current=(0,A.Z)(function(){ea.current===r&&n.focus()})}};if([z,F].includes(n)||f.sibling||!c){var p,v=B(p=c&&"inline"!==nN?function(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}(c):nu.current,l);d(n===z?v[0]:n===F?v[v.length-1]:W(p,l,c,f.offset))}else if(f.inlineTrigger)ei(s);else if(f.offset>0)ei(s,!0),ec(),el.current=(0,A.Z)(function(){r=H(t,nc);var e=c.getAttribute("aria-controls");d(W(document.getElementById(e),r.elements))},5);else if(f.offset<0){var m=nW(s,!0),b=m[m.length-2],y=a.get(b);ei(b,!1),d(y)}}null==e9||e9(e)});m.useEffect(function(){na(!0)},[]);var n8=m.useMemo(function(){return{_internalRenderMenuItem:e3,_internalRenderSubMenuItem:e4}},[e3,e4]),te="horizontal"!==nN||eR?nt:nt.map(function(e,n){return m.createElement(w,{key:e.key,overflowDisabled:n>nL},e)}),tn=m.createElement(f.Z,(0,r.Z)({id:eC,ref:nu,prefixCls:"".concat(ed,"-overflow"),component:"ul",itemComponent:ev,className:s()(ed,"".concat(ed,"-root"),"".concat(ed,"-").concat(nN),eb,(0,o.Z)((0,o.Z)({},"".concat(ed,"-inline-collapsed"),nK),"".concat(ed,"-rtl"),ns),ep),dir:eZ,style:em,role:"menu",tabIndex:void 0===ey?0:ey,data:te,renderRawItem:function(e){return e},renderRawRest:function(e){var n=e.length,t=n?nt.slice(-n):null;return m.createElement(eI,{eventKey:X,title:e0,disabled:n_,internalPopupClose:0===n,popupClassName:e1},t)},maxCount:"horizontal"!==nN||eR?f.Z.INVALIDATE:f.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){nD(e)},onKeyDown:n7},e8));return m.createElement(P.Provider,{value:n8},m.createElement(y.Provider,{value:nc},m.createElement(w,{prefixCls:ed,rootClassName:ep,mode:nN,openKeys:np,rtl:ns,disabled:eM,motion:nl?eq:null,defaultMotions:nl?eX:null,activeKey:nU,onActive:n$,onInactive:n0,selectedKeys:n2,inlineIndent:void 0===eY?24:eY,subMenuOpenDelay:void 0===ex?.1:ex,subMenuCloseDelay:void 0===eN?.1:eN,forceSubMenuRender:eP,builtinPlacements:eQ,triggerSubMenuAction:void 0===eG?"hover":eG,getPopupContainer:e6,itemIcon:eU,expandIcon:eJ,onItemClick:n3,onOpenChange:n4},m.createElement(N.Provider,{value:nX},tn),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(k.Provider,{value:nq},nr)))))});eF.Item=ev,eF.SubMenu=eI,eF.ItemGroup=eL,eF.Divider=eA;var ej=eF}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1602-dda1d35341543457.js b/litellm/proxy/_experimental/out/_next/static/chunks/1602-158ea5a27f7c5d7c.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/1602-dda1d35341543457.js rename to litellm/proxy/_experimental/out/_next/static/chunks/1602-158ea5a27f7c5d7c.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1623-995fddc2b5647961.js b/litellm/proxy/_experimental/out/_next/static/chunks/1623-995fddc2b5647961.js deleted file mode 100644 index 15400abe79..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1623-995fddc2b5647961.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1623],{2894:function(t,e,s){s.d(e,{R:function(){return u},m:function(){return n}});var i=s(18238),a=s(7989),r=s(11255),n=class extends a.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||u(),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.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#a({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,r.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,a=!this.#i.canStart();try{if(i)e();else{this.#a({type:"pending",variables:t,isPaused:a}),await this.#s.config.onMutate?.(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:a})}let r=await this.#i.start();return await this.#s.config.onSuccess?.(r,t,this.state.context,this,s),await this.options.onSuccess?.(r,t,this.state.context,s),await this.#s.config.onSettled?.(r,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(r,null,t,this.state.context,s),this.#a({type:"success",data:r}),r}catch(e){try{throw await this.#s.config.onError?.(e,t,this.state.context,this,s),await this.options.onError?.(e,t,this.state.context,s),await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,e,t,this.state.context,s),e}finally{this.#a({type:"error",error:e})}}finally{this.#s.runNext(this)}}#a(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),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function u(){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,s){s.d(e,{S:function(){return y}});var i=s(45345),a=s(21733),r=s(18238),n=s(24112),u=class extends n.l{constructor(t={}){super(),this.config=t,this.#r=new Map}#r;build(t,e,s){let r=e.queryKey,n=e.queryHash??(0,i.Rm)(r,e),u=this.get(n);return u||(u=new a.A({client:t,queryKey:r,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(r)}),this.add(u)),u}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,i._x)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,i._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()})})}},o=s(2894),h=class extends n.l{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#u=new Map,this.#o=0}#n;#u;#o;build(t,e,s){let i=new o.m({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);let e=l(t);if("string"==typeof e){let s=this.#u.get(e);s?s.push(t):this.#u.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){let e=l(t);if("string"==typeof e){let s=this.#u.get(e);if(s){if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#u.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=l(t);if("string"!=typeof e)return!0;{let s=this.#u.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=l(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#u.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){r.Vr.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#u.clear()})}getAll(){return Array.from(this.#n)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i.X7)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,i.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(i.ZT))))}};function l(t){return t.options.scope?.id}var c=s(87045),d=s(57853);function f(t){return{onFetch:(e,s)=>{let a=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],u=e.state.data?.pageParams||[],o={pages:[],pageParams:[]},h=0,l=async()=>{let s=!1,l=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)})},c=(0,i.cG)(e.options,e.fetchOptions),d=async(t,a,r)=>{if(s)return Promise.reject();if(null==a&&t.pages.length)return Promise.resolve(t);let n=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:a,direction:r?"backward":"forward",meta:e.options.meta};return l(t),t})(),u=await c(n),{maxPages:o}=e.options,h=r?i.Ht:i.VX;return{pages:h(t.pages,u,o),pageParams:h(t.pageParams,a,o)}};if(r&&n.length){let t="backward"===r,e={pages:n,pageParams:u},s=(t?function(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}:p)(a,e);o=await d(e,s,t)}else{let e=t??n.length;do{let t=0===h?u[0]??a.initialPageParam:p(a,o);if(h>0&&null==t)break;o=await d(o,t),h++}while(he.options.persister?.(l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=l}}}function p(t,{pages:e,pageParams:s}){let i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}var y=class{#h;#s;#l;#c;#d;#f;#p;#y;constructor(t={}){this.#h=t.queryCache||new u,this.#s=t.mutationCache||new h,this.#l=t.defaultOptions||{},this.#c=new Map,this.#d=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#p=c.j.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#y=d.N.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#p?.(),this.#p=void 0,this.#y?.(),this.#y=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#h.build(this,e),a=s.state.data;return void 0===a?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime((0,i.KC)(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(a))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let a=this.defaultQueryOptions({queryKey:t}),r=this.#h.get(a.queryHash),n=r?.state.data,u=(0,i.SE)(e,n);if(void 0!==u)return this.#h.build(this,a).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return r.Vr.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){let e=this.#h;r.Vr.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#h;return r.Vr.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all(r.Vr.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)))).then(i.ZT).catch(i.ZT)}invalidateQueries(t,e={}){return r.Vr.batch(()=>(this.#h.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 s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(r.Vr.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(i.ZT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(i.ZT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#h.build(this,e);return s.isStaleByTime((0,i.KC)(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(i.ZT).catch(i.ZT)}fetchInfiniteQuery(t){return t.behavior=f(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(i.ZT).catch(i.ZT)}ensureInfiniteQueryData(t){return t.behavior=f(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d.N.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#l}setDefaultOptions(t){this.#l=t}setQueryDefaults(t,e){this.#c.set((0,i.Ym)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#c.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#d.set((0,i.Ym)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#d.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}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,i.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===i.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.#h.clear(),this.#s.clear()}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1674-de8248fbd0c554ba.js b/litellm/proxy/_experimental/out/_next/static/chunks/1674-de8248fbd0c554ba.js deleted file mode 100644 index e8fa6e80e4..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1674-de8248fbd0c554ba.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1674],{14042:function(e,t,n){"use strict";n.d(t,{Z:function(){return eM}});var r=n(5853),o=n(7084),i=n(26898),a=n(13241),c=n(1153),l=n(2265),s=n(60474),u=n(47625),p=n(93765),f=n(86757),d=n.n(f),y=n(87602),m=n(9841),v=n(81889),h=n(82944),b=["points","className","baseLinePoints","connectNulls"];function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){k(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),k(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},j=function(e,t){var n=x(e);t&&(n=[n.reduce(function(e,t){return[].concat(A(e),A(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return"".concat(e).concat(0===n?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===n.length?"".concat(r,"Z"):r},w=function(e,t,n){var r=j(e,n);return"".concat("Z"===r.slice(-1)?r.slice(0,-1):r,"L").concat(j(t.reverse(),n).slice(1))},P=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,o=e.connectNulls,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,b);if(!t||!t.length)return null;var a=(0,y.Z)("recharts-polygon",n);if(r&&r.length){var c=i.stroke&&"none"!==i.stroke,s=w(t,r,o);return l.createElement("g",{className:a},l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"Z"===s.slice(-1)?i.fill:"none",stroke:"none",d:s})),c?l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"none",d:j(t,o)})):null,c?l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"none",d:j(r,o)})):null)}var u=j(t,o);return l.createElement("path",g({},(0,h.L6)(i,!0),{fill:"Z"===u.slice(-1)?i.fill:"none",className:a,d:u}))},E=n(58811),S=n(41637),T=n(39206);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(){return(R=Object.assign?Object.assign.bind():function(e){for(var t=1;t1e-5?"outer"===t?"start":"end":n<-.00001?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,o=e.axisLine,i=e.axisLineType,a=I(I({},(0,h.L6)(this.props,!1)),{},{fill:"none"},(0,h.L6)(o,!1));if("circle"===i)return l.createElement(v.o,R({className:"recharts-polar-angle-axis-line"},a,{cx:t,cy:n,r:r}));var c=this.props.ticks.map(function(e){return(0,T.op)(t,n,r,e.coordinate)});return l.createElement(P,R({className:"recharts-polar-angle-axis-line"},a,{points:c}))}},{key:"renderTicks",value:function(){var e=this,t=this.props,n=t.ticks,o=t.tick,i=t.tickLine,a=t.tickFormatter,c=t.stroke,s=(0,h.L6)(this.props,!1),u=(0,h.L6)(o,!1),p=I(I({},s),{},{fill:"none"},(0,h.L6)(i,!1)),f=n.map(function(t,n){var f=e.getTickLineCoord(t),d=I(I(I({textAnchor:e.getTickTextAnchor(t)},s),{},{stroke:"none",fill:c},u),{},{index:n,payload:t,x:f.x2,y:f.y2});return l.createElement(m.m,R({className:(0,y.Z)("recharts-polar-angle-axis-tick",(0,T.$S)(o)),key:"tick-".concat(t.coordinate)},(0,S.bw)(e.props,t,n)),i&&l.createElement("line",R({className:"recharts-polar-angle-axis-tick-line"},p,f)),o&&r.renderTickItem(o,d,a?a(t.value,n):t.value))});return l.createElement(m.m,{className:"recharts-polar-angle-axis-ticks"},f)}},{key:"render",value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return!(n<=0)&&t&&t.length?l.createElement(m.m,{className:(0,y.Z)("recharts-polar-angle-axis",this.props.className)},r&&this.renderAxisLine(),this.renderTicks()):null}}],n=[{key:"renderTickItem",value:function(e,t,n){return l.isValidElement(e)?l.cloneElement(e,t):d()(e)?e(t):l.createElement(E.x,R({},t,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],t&&C(r.prototype,t),n&&C(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(l.PureComponent);Z(M,"displayName","PolarAngleAxis"),Z(M,"axisType","angleAxis"),Z(M,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var V=n(35802),$=n.n(V),q=n(37891),z=n.n(q),G=n(26680),W=["cx","cy","angle","ticks","axisLine"],Y=["ticks","tick","angle","tickFormatter","stroke"];function H(e){return(H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ee(e,t){for(var n=0;n0?es()(e,"paddingAngle",0):0;if(n){var c=(0,eb.k4)(n.endAngle-n.startAngle,e.endAngle-e.startAngle),l=ew(ew({},e),{},{startAngle:i+a,endAngle:i+c(r)+a});o.push(l),i=l.endAngle}else{var s=e.endAngle,p=e.startAngle,f=(0,eb.k4)(0,s-p)(r),d=ew(ew({},e),{},{startAngle:i+a,endAngle:i+f+a});o.push(d),i=d.endAngle}}),l.createElement(m.m,null,e.renderSectorsStatically(o))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case"ArrowRight":var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!ep()(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,o=t.className,i=t.label,a=t.cx,c=t.cy,s=t.innerRadius,u=t.outerRadius,p=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!(0,eb.hj)(a)||!(0,eb.hj)(c)||!(0,eb.hj)(s)||!(0,eb.hj)(u))return null;var d=(0,y.Z)("recharts-pie",o);return l.createElement(m.m,{tabIndex:this.props.rootTabIndex,className:d,ref:function(t){e.pieRef=t}},this.renderSectors(),i&&this.renderLabels(r),G._.renderCallByParent(this.props,null,!1),(!p||f)&&em.e.renderCallByParent(this.props,r,!1))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e=360?A:A-1)*u,k=a.reduce(function(e,t){var n=(0,eg.F$)(t,g,0);return e+((0,eb.hj)(n)?n:0)},0);return k>0&&(t=a.map(function(e,t){var r,o=(0,eg.F$)(e,g,0),i=(0,eg.F$)(e,f,t),a=((0,eb.hj)(o)?o:0)/k,s=(r=t?n.endAngle+(0,eb.uY)(h)*u*(0!==o?1:0):l)+(0,eb.uY)(h)*((0!==o?m:0)+a*O),p=(r+s)/2,d=(v.innerRadius+v.outerRadius)/2,b=[{name:i,value:o,payload:e,dataKey:g,type:y}],A=(0,T.op)(v.cx,v.cy,d,p);return n=ew(ew(ew({percent:a,cornerRadius:c,name:i,tooltipPayload:b,midAngle:p,middleRadius:d,tooltipPosition:A},e),v),{},{value:(0,eg.F$)(e,g),startAngle:r,endAngle:s,payload:e,paddingAngle:(0,eb.uY)(h)*u})})),ew(ew({},v),{},{sectors:t,data:a})});var eI=(0,p.z)({chartName:"PieChart",GraphicalChild:eN,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:M},{axisType:"radiusAxis",AxisComp:ea}],formatAxisMap:T.t9,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),eC=n(8147),eD=n(92666),eF=n(98593);let e_=e=>{let{active:t,payload:n,valueFormatter:r}=e;if(t&&(null==n?void 0:n[0])){let e=null==n?void 0:n[0];return l.createElement(eF.$B,null,l.createElement("div",{className:(0,a.q)("px-4 py-2")},l.createElement(eF.zX,{value:r(e.value),name:e.name,color:e.payload.color})))}return null},eZ=(e,t)=>e.map((e,n)=>{let r=ne||t((0,c.vP)(n.map(e=>e[r]))),eK=e=>{let{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c}=e;return l.createElement("g",null,l.createElement(s.L,{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:a,className:c,fill:"",opacity:.3,style:{outline:"none"}}))},eM=l.forwardRef((e,t)=>{let{data:n=[],category:s="value",index:p="name",colors:f=i.s,variant:d="donut",valueFormatter:y=c.Cj,label:m,showLabel:v=!0,animationDuration:h=900,showAnimation:b=!1,showTooltip:g=!0,noDataText:A,onValueChange:O,customTooltip:k,className:x}=e,j=(0,r._T)(e,["data","category","index","colors","variant","valueFormatter","label","showLabel","animationDuration","showAnimation","showTooltip","noDataText","onValueChange","customTooltip","className"]),w="donut"==d,P=eB(m,y,n,s),[E,S]=l.useState(void 0),T=!!O;return(0,l.useEffect)(()=>{let e=document.querySelectorAll(".recharts-pie-sector");e&&e.forEach(e=>{e.setAttribute("style","outline: none")})},[E]),l.createElement("div",Object.assign({ref:t,className:(0,a.q)("w-full h-40",x)},j),l.createElement(u.h,{className:"h-full w-full"},(null==n?void 0:n.length)?l.createElement(eI,{onClick:T&&E?()=>{S(void 0),null==O||O(null)}:void 0,margin:{top:0,left:0,right:0,bottom:0}},v&&w?l.createElement("text",{className:(0,a.q)("fill-tremor-content-emphasis","dark:fill-dark-tremor-content-emphasis"),x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle"},P):null,l.createElement(eN,{className:(0,a.q)("stroke-tremor-background dark:stroke-dark-tremor-background",O?"cursor-pointer":"cursor-default"),data:eZ(n,f),cx:"50%",cy:"50%",startAngle:90,endAngle:-270,innerRadius:w?"75%":"0%",outerRadius:"100%",stroke:"",strokeLinejoin:"round",dataKey:s,nameKey:p,isAnimationActive:b,animationDuration:h,onClick:function(e,t,n){n.stopPropagation(),T&&(E===t?(S(void 0),null==O||O(null)):(S(t),null==O||O(Object.assign({eventType:"slice"},e.payload.payload))))},activeIndex:E,inactiveShape:eK,style:{outline:"none"}}),l.createElement(eC.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,content:g?e=>{var t;let{active:n,payload:r}=e;return k?l.createElement(k,{payload:null==r?void 0:r.map(e=>{var t,n,i;return Object.assign(Object.assign({},e),{color:null!==(i=null===(n=null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.payload)||void 0===n?void 0:n.color)&&void 0!==i?i:o.fr.Gray})}),active:n,label:null===(t=null==r?void 0:r[0])||void 0===t?void 0:t.name}):l.createElement(e_,{active:n,payload:r,valueFormatter:y})}:l.createElement(l.Fragment,null)})):l.createElement(eD.Z,{noDataText:A})))});eM.displayName="DonutChart"},35802:function(e,t,n){var r=n(67646),o=n(58905),i=n(88157);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},37891:function(e,t,n){var r=n(67646),o=n(88157),i=n(20121);e.exports=function(e,t){return e&&e.length?r(e,o(t,2),i):void 0}},44633:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.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),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});t.Z=o},58710:function(e,t,n){"use strict";var r=n(2265);let o=r.forwardRef(function(e,t){return r.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),r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},92668:function(e,t,n){"use strict";n.d(t,{I:function(){return c}});var r=n(59121),o=n(31091),i=n(63497),a=n(99649);function c(e,t){let{years:n=0,months:c=0,weeks:l=0,days:s=0,hours:u=0,minutes:p=0,seconds:f=0}=t,d=(0,a.Q)(e),y=c||n?(0,o.z)(d,c+12*n):d,m=s||l?(0,r.E)(y,s+7*l):y;return(0,i.L)(e,m.getTime()+1e3*(f+60*(p+60*u)))}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1713-ce16d8a0e658a15d.js b/litellm/proxy/_experimental/out/_next/static/chunks/1713-ce16d8a0e658a15d.js new file mode 100644 index 0000000000..6aae7a1e1e --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1713-ce16d8a0e658a15d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1713],{87045:function(t,e,r){r.d(e,{j:function(){return n}});var s=r(24112),i=r(45345),n=new class extends s.l{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!i.sk&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}}},18238:function(t,e,r){r.d(e,{Vr:function(){return i}});var s=r(84554).Hp,i=function(){let t=[],e=0,r=t=>{t()},i=t=>{t()},n=s,u=s=>{e?t.push(s):n(()=>{r(s)})},o=()=>{let e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{r(t)})})})};return{batch:t=>{let r;e++;try{r=t()}finally{--e||o()}return r},batchCalls:t=>(...e)=>{u(()=>{t(...e)})},schedule:u,setNotifyFunction:t=>{r=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}()},57853:function(t,e,r){r.d(e,{N:function(){return n}});var s=r(24112),i=r(45345),n=new class extends s.l{#s=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!i.sk&&window.addEventListener){let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#s!==t&&(this.#s=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#s}}},21733:function(t,e,r){r.d(e,{A:function(){return o},z:function(){return a}});var s=r(45345),i=r(18238),n=r(11255),u=r(7989),o=class extends u.F{#i;#n;#u;#o;#a;#c;#h;constructor(t){super(),this.#h=!1,this.#c=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#o=t.client,this.#u=this.#o.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#i=h(this.options),this.state=t.state??this.#i,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(t){if(this.options={...this.#c,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=h(this.options);void 0!==t.data&&(this.setState(c(t.data,t.dataUpdatedAt)),this.#i=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(t,e){let r=(0,s.oE)(this.state.data,t,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t,e){this.#l({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#a?.promise;return this.#a?.cancel(t),e?e.then(s.ZT).catch(s.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#i)}isActive(){return this.observers.some(t=>!1!==(0,s.Nc)(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===s.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===(0,s.KC)(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!(0,s.Kp)(this.state.dataUpdatedAt,t))}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#a&&(this.#h?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if("idle"!==this.state.fetchStatus&&this.#a?.status()!=="rejected"){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let r=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#h=!0,r.signal)})},u=()=>{let t=(0,s.cG)(this.options,e),r=(()=>{let t={client:this.#o,queryKey:this.queryKey,meta:this.meta};return i(t),t})();return(this.#h=!1,this.options.persister)?this.options.persister(t,r,this):t(r)},o=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:u};return i(t),t})();this.options.behavior?.onFetch(o,this),this.#n=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#l({type:"fetch",meta:o.fetchOptions?.meta}),this.#a=(0,n.Mz)({initialPromise:e?.initialPromise,fn:o.fetchFn,onCancel:t=>{t instanceof n.p8&&t.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(t,e)=>{this.#l({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let t=await this.#a.start();if(void 0===t)throw Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#u.config.onSuccess?.(t,this),this.#u.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof n.p8){if(t.silent)return this.#a.promise;if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#l({type:"error",error:t}),this.#u.config.onError?.(t,this),this.#u.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#l(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...a(e.data,this.options),fetchMeta:t.meta??null};case"success":let r={...e,...c(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?r:void 0,r;case"error":let s=t.error;return{...e,error:s,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),i.Vr.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:t})})}};function a(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,n.Kw)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function c(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,s=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},7989:function(t,e,r){r.d(e,{F:function(){return n}});var s=r(84554),i=r(45345),n=class{#d;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.PN)(this.gcTime)&&(this.#d=s.mr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(i.sk?1/0:3e5))}clearGcTimeout(){this.#d&&(s.mr.clearTimeout(this.#d),this.#d=void 0)}}},11255:function(t,e,r){r.d(e,{Kw:function(){return a},Mz:function(){return h},p8:function(){return c}});var s=r(87045),i=r(57853),n=r(16803),u=r(45345);function o(t){return Math.min(1e3*2**t,3e4)}function a(t){return(t??"online")!=="online"||i.N.isOnline()}var c=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function h(t){let e,r=!1,h=0,l=(0,n.O)(),d=()=>"pending"!==l.status,f=()=>s.j.isFocused()&&("always"===t.networkMode||i.N.isOnline())&&t.canRun(),p=()=>a(t.networkMode)&&t.canRun(),y=t=>{d()||(e?.(),l.resolve(t))},v=t=>{d()||(e?.(),l.reject(t))},b=()=>new Promise(r=>{e=t=>{(d()||f())&&r(t)},t.onPause?.()}).then(()=>{e=void 0,d()||t.onContinue?.()}),m=()=>{let e;if(d())return;let s=0===h?t.initialPromise:void 0;try{e=s??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(y).catch(e=>{if(d())return;let s=t.retry??(u.sk?0:3),i=t.retryDelay??o,n="function"==typeof i?i(h,e):i,a=!0===s||"number"==typeof s&&hf()?void 0:b()).then(()=>{r?v(e):m()})})};return{promise:l,status:()=>l.status,cancel:e=>{if(!d()){let r=new c(e);v(r),t.onCancel?.(r)}},continue:()=>(e?.(),l),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:p,start:()=>(p()?m():b().then(m),l)}}},24112:function(t,e,r){r.d(e,{l:function(){return s}});var s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},16803:function(t,e,r){r.d(e,{O:function(){return s}});function s(){let t,e;let r=new Promise((r,s)=>{t=r,e=s});function s(t){Object.assign(r,t),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=e=>{s({status:"fulfilled",value:e}),t(e)},r.reject=t=>{s({status:"rejected",reason:t}),e(t)},r}},84554:function(t,e,r){r.d(e,{Hp:function(){return n},mr:function(){return i}});var s={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},i=new class{#f=s;#p=!1;setTimeoutProvider(t){this.#f=t}setTimeout(t,e){return this.#f.setTimeout(t,e)}clearTimeout(t){this.#f.clearTimeout(t)}setInterval(t,e){return this.#f.setInterval(t,e)}clearInterval(t){this.#f.clearInterval(t)}};function n(t){setTimeout(t,0)}},45345:function(t,e,r){r.d(e,{CN:function(){return T},Ht:function(){return w},KC:function(){return c},Kp:function(){return a},L3:function(){return F},Nc:function(){return h},PN:function(){return o},Rm:function(){return f},SE:function(){return u},VS:function(){return b},VX:function(){return C},X7:function(){return d},Ym:function(){return p},ZT:function(){return n},_v:function(){return O},_x:function(){return l},cG:function(){return Q},oE:function(){return S},sk:function(){return i},to:function(){return y}});var s=r(84554),i="undefined"==typeof window||"Deno"in globalThis;function n(){}function u(t,e){return"function"==typeof t?t(e):t}function o(t){return"number"==typeof t&&t>=0&&t!==1/0}function a(t,e){return Math.max(t+(e||0)-Date.now(),0)}function c(t,e){return"function"==typeof t?t(e):t}function h(t,e){return"function"==typeof t?t(e):t}function l(t,e){let{type:r="all",exact:s,fetchStatus:i,predicate:n,queryKey:u,stale:o}=t;if(u){if(s){if(e.queryHash!==f(u,e.options))return!1}else if(!y(e.queryKey,u))return!1}if("all"!==r){let t=e.isActive();if("active"===r&&!t||"inactive"===r&&t)return!1}return("boolean"!=typeof o||e.isStale()===o)&&(!i||i===e.state.fetchStatus)&&(!n||!!n(e))}function d(t,e){let{exact:r,status:s,predicate:i,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(r){if(p(e.options.mutationKey)!==p(n))return!1}else if(!y(e.options.mutationKey,n))return!1}return(!s||e.state.status===s)&&(!i||!!i(e))}function f(t,e){return(e?.queryKeyHashFn||p)(t)}function p(t){return JSON.stringify(t,(t,e)=>g(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function y(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(r=>y(t[r],e[r]))}var v=Object.prototype.hasOwnProperty;function b(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function m(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function g(t){if(!R(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!!(R(r)&&r.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(t)===Object.prototype}function R(t){return"[object Object]"===Object.prototype.toString.call(t)}function O(t){return new Promise(e=>{s.mr.setTimeout(e,t)})}function S(t,e,r){return"function"==typeof r.structuralSharing?r.structuralSharing(t,e):!1!==r.structuralSharing?function t(e,r){if(e===r)return e;let s=m(e)&&m(r);if(!s&&!(g(e)&&g(r)))return r;let i=(s?e:Object.keys(e)).length,n=s?r:Object.keys(r),u=n.length,o=s?Array(u):{},a=0;for(let c=0;cr?s.slice(1):s}function w(t,e,r=0){let s=[e,...t];return r&&s.length>r?s.slice(0,-1):s}var T=Symbol();function Q(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==T?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function F(t,e){return"function"==typeof t?t(...e):!!t}},29827:function(t,e,r){r.d(e,{NL:function(){return u},aH:function(){return o}});var s=r(2265),i=r(57437),n=s.createContext(void 0),u=t=>{let e=s.useContext(n);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},o=t=>{let{client:e,children:r}=t;return s.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,i.jsx)(n.Provider,{value:e,children:r})}},11713:function(t,e,r){let s;r.d(e,{a:function(){return E}});var i=r(87045),n=r(18238),u=r(21733),o=r(24112),a=r(16803),c=r(45345),h=r(84554),l=class extends o.l{constructor(t,e){super(),this.options=e,this.#o=t,this.#y=null,this.#v=(0,a.O)(),this.bindMethods(),this.setOptions(e)}#o;#b=void 0;#m=void 0;#g=void 0;#R;#O;#v;#y;#S;#C;#w;#T;#Q;#F;#I=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),d(this.#b,this.options)?this.#E():this.updateResult(),this.#U())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#k(),this.#P(),this.#b.removeObserver(this)}setOptions(t){let e=this.options,r=this.#b;if(this.options=this.#o.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,c.Nc)(this.options.enabled,this.#b))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#b.setOptions(this.options),e._defaulted&&!(0,c.VS)(this.options,e)&&this.#o.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let s=this.hasListeners();s&&p(this.#b,r,this.options,e)&&this.#E(),this.updateResult(),s&&(this.#b!==r||(0,c.Nc)(this.options.enabled,this.#b)!==(0,c.Nc)(e.enabled,this.#b)||(0,c.KC)(this.options.staleTime,this.#b)!==(0,c.KC)(e.staleTime,this.#b))&&this.#q();let i=this.#D();s&&(this.#b!==r||(0,c.Nc)(this.options.enabled,this.#b)!==(0,c.Nc)(e.enabled,this.#b)||i!==this.#F)&&this.#x(i)}getOptimisticResult(t){let e=this.#o.getQueryCache().build(this.#o,t),r=this.createResult(e,t);return(0,c.VS)(this.getCurrentResult(),r)||(this.#g=r,this.#O=this.options,this.#R=this.#b.state),r}getCurrentResult(){return this.#g}trackResult(t,e){return new Proxy(t,{get:(t,r)=>(this.trackProp(r),e?.(r),"promise"!==r||(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,r))})}trackProp(t){this.#I.add(t)}getCurrentQuery(){return this.#b}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#o.defaultQueryOptions(t),r=this.#o.getQueryCache().build(this.#o,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#E({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#g))}#E(t){this.#j();let e=this.#b.fetch(this.options,t);return t?.throwOnError||(e=e.catch(c.ZT)),e}#q(){this.#k();let t=(0,c.KC)(this.options.staleTime,this.#b);if(c.sk||this.#g.isStale||!(0,c.PN)(t))return;let e=(0,c.Kp)(this.#g.dataUpdatedAt,t);this.#T=h.mr.setTimeout(()=>{this.#g.isStale||this.updateResult()},e+1)}#D(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#x(t){this.#P(),this.#F=t,!c.sk&&!1!==(0,c.Nc)(this.options.enabled,this.#b)&&(0,c.PN)(this.#F)&&0!==this.#F&&(this.#Q=h.mr.setInterval(()=>{(this.options.refetchIntervalInBackground||i.j.isFocused())&&this.#E()},this.#F))}#U(){this.#q(),this.#x(this.#D())}#k(){this.#T&&(h.mr.clearTimeout(this.#T),this.#T=void 0)}#P(){this.#Q&&(h.mr.clearInterval(this.#Q),this.#Q=void 0)}createResult(t,e){let r;let s=this.#b,i=this.options,n=this.#g,o=this.#R,h=this.#O,l=t!==s?t.state:this.#m,{state:f}=t,v={...f},b=!1;if(e._optimisticResults){let r=this.hasListeners(),n=!r&&d(t,e),o=r&&p(t,s,e,i);(n||o)&&(v={...v,...(0,u.z)(f.data,t.options)}),"isRestoring"===e._optimisticResults&&(v.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:R}=v;r=v.data;let O=!1;if(void 0!==e.placeholderData&&void 0===r&&"pending"===R){let t;n?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(t=n.data,O=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#w?.state.data,this.#w):e.placeholderData,void 0!==t&&(R="success",r=(0,c.oE)(n?.data,t,e),b=!0)}if(e.select&&void 0!==r&&!O){if(n&&r===o?.data&&e.select===this.#S)r=this.#C;else try{this.#S=e.select,r=e.select(r),r=(0,c.oE)(n?.data,r,e),this.#C=r,this.#y=null}catch(t){this.#y=t}}this.#y&&(m=this.#y,r=this.#C,g=Date.now(),R="error");let S="fetching"===v.fetchStatus,C="pending"===R,w="error"===R,T=C&&S,Q=void 0!==r,F={status:R,fetchStatus:v.fetchStatus,isPending:C,isSuccess:"success"===R,isError:w,isInitialLoading:T,isLoading:T,data:r,dataUpdatedAt:v.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>l.dataUpdateCount||v.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!C,isLoadingError:w&&!Q,isPaused:"paused"===v.fetchStatus,isPlaceholderData:b,isRefetchError:w&&Q,isStale:y(t,e),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,c.Nc)(e.enabled,t)};if(this.options.experimental_prefetchInRender){let e=t=>{"error"===F.status?t.reject(F.error):void 0!==F.data&&t.resolve(F.data)},r=()=>{e(this.#v=F.promise=(0,a.O)())},i=this.#v;switch(i.status){case"pending":t.queryHash===s.queryHash&&e(i);break;case"fulfilled":("error"===F.status||F.data!==i.value)&&r();break;case"rejected":("error"!==F.status||F.error!==i.reason)&&r()}}return F}updateResult(){let t=this.#g,e=this.createResult(this.#b,this.options);this.#R=this.#b.state,this.#O=this.options,void 0!==this.#R.data&&(this.#w=this.#b),(0,c.VS)(e,t)||(this.#g=e,this.#N({listeners:(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.#I.size)return!0;let s=new Set(r??this.#I);return this.options.throwOnError&&s.add("error"),Object.keys(this.#g).some(e=>this.#g[e]!==t[e]&&s.has(e))})()}))}#j(){let t=this.#o.getQueryCache().build(this.#o,this.options);if(t===this.#b)return;let e=this.#b;this.#b=t,this.#m=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#U()}#N(t){n.Vr.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#g)}),this.#o.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function d(t,e){return!1!==(0,c.Nc)(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)||void 0!==t.state.data&&f(t,e,e.refetchOnMount)}function f(t,e,r){if(!1!==(0,c.Nc)(e.enabled,t)&&"static"!==(0,c.KC)(e.staleTime,t)){let s="function"==typeof r?r(t):r;return"always"===s||!1!==s&&y(t,e)}return!1}function p(t,e,r,s){return(t!==e||!1===(0,c.Nc)(s.enabled,t))&&(!r.suspense||"error"!==t.state.status)&&y(t,r)}function y(t,e){return!1!==(0,c.Nc)(e.enabled,t)&&t.isStaleByTime((0,c.KC)(e.staleTime,t))}var v=r(2265),b=r(29827);r(57437);var m=v.createContext((s=!1,{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s})),g=()=>v.useContext(m),R=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&!e.isReset()&&(t.retryOnMount=!1)},O=t=>{v.useEffect(()=>{t.clearReset()},[t])},S=t=>{let{result:e,errorResetBoundary:r,throwOnError:s,query:i,suspense:n}=t;return e.isError&&!r.isReset()&&!e.isFetching&&i&&(n&&void 0===e.data||(0,c.L3)(s,[e.error,i]))},C=v.createContext(!1),w=()=>v.useContext(C);C.Provider;var T=t=>{if(t.suspense){let e=t=>"static"===t?t:Math.max(t??1e3,1e3),r=t.staleTime;t.staleTime="function"==typeof r?(...t)=>e(r(...t)):e(r),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3))}},Q=(t,e)=>t.isLoading&&t.isFetching&&!e,F=(t,e)=>t?.suspense&&e.isPending,I=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function E(t,e){return function(t,e,r){var s,i,u,o,a;let h=w(),l=g(),d=(0,b.NL)(r),f=d.defaultQueryOptions(t);null===(i=d.getDefaultOptions().queries)||void 0===i||null===(s=i._experimental_beforeQuery)||void 0===s||s.call(i,f),f._optimisticResults=h?"isRestoring":"optimistic",T(f),R(f,l),O(l);let p=!d.getQueryCache().get(f.queryHash),[y]=v.useState(()=>new e(d,f)),m=y.getOptimisticResult(f),C=!h&&!1!==t.subscribed;if(v.useSyncExternalStore(v.useCallback(t=>{let e=C?y.subscribe(n.Vr.batchCalls(t)):c.ZT;return y.updateResult(),e},[y,C]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),v.useEffect(()=>{y.setOptions(f)},[f,y]),F(f,m))throw I(f,y,l);if(S({result:m,errorResetBoundary:l,throwOnError:f.throwOnError,query:d.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw m.error;if(null===(o=d.getDefaultOptions().queries)||void 0===o||null===(u=o._experimental_afterQuery)||void 0===u||u.call(o,f,m),f.experimental_prefetchInRender&&!c.sk&&Q(m,h)){let t=p?I(f,y,l):null===(a=d.getQueryCache().get(f.queryHash))||void 0===a?void 0:a.promise;null==t||t.catch(c.ZT).finally(()=>{y.updateResult()})}return f.notifyOnChangeProps?m:y.trackResult(m)}(t,l,e)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1739-23e7361486c2cc74.js b/litellm/proxy/_experimental/out/_next/static/chunks/1739-1616f1e28b151332.js similarity index 55% rename from litellm/proxy/_experimental/out/_next/static/chunks/1739-23e7361486c2cc74.js rename to litellm/proxy/_experimental/out/_next/static/chunks/1739-1616f1e28b151332.js index c1e1814d04..0a8b97880d 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1739-23e7361486c2cc74.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1739-1616f1e28b151332.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1739],{25512:function(e,t,l){l.d(t,{P:function(){return s.Z},Q:function(){return a.Z}});var s=l(27281),a=l(57365)},12011:function(e,t,l){l.r(t),l.d(t,{default:function(){return w}});var s=l(57437),a=l(2265),r=l(99376),n=l(78489),i=l(94789),o=l(12514),c=l(49804),d=l(67101),u=l(84264),m=l(49566),g=l(96761),x=l(84566),h=l(19250),y=l(14474),f=l(10032),p=l(5545),j=l(3914);function w(){let[e]=f.Z.useForm(),t=(0,r.useSearchParams)();(0,j.e)("token");let l=t.get("invitation_id"),w=t.get("action"),[b,v]=(0,a.useState)(null),[k,S]=(0,a.useState)(""),[_,N]=(0,a.useState)(""),[C,I]=(0,a.useState)(null),[D,Z]=(0,a.useState)(""),[A,K]=(0,a.useState)(""),[E,T]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(0,h.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),T(!1)})},[]),(0,a.useEffect)(()=>{l&&!E&&(0,h.getOnboardingCredentials)(l).then(e=>{let t=e.login_url;console.log("login_url:",t),Z(t);let l=e.token,s=(0,y.o)(l);K(l),console.log("decoded:",s),v(s.key),console.log("decoded user email:",s.user_email),N(s.user_email),I(s.user_id)})},[l,E]),(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"===w?"Reset Password":"Sign up"}),(0,s.jsx)(u.Z,{children:"reset_password"===w?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==w&&(0,s.jsx)(i.Z,{className:"mt-4",title:"SSO",icon:x.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)(n.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)(f.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",b,"token:",A,"formValues:",e),b&&A&&(e.user_email=_,C&&l&&(0,h.claimOnboardingToken)(b,l,C,e.password).then(e=>{document.cookie="token="+A;let t=(0,h.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)(f.Z.Item,{label:"Email Address",name:"user_email",children:(0,s.jsx)(m.Z,{type:"email",disabled:!0,value:_,defaultValue:_,className:"max-w-md"})}),(0,s.jsx)(f.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===w?"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"===w?"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,r)=>{let n;n="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(n)),r(n)}},49924:function(e,t,l){var s=l(2265),a=l(19250);t.Z=e=>{let{selectedTeam:t,currentOrg:l,selectedKeyAlias:r,accessToken:n,createClicked:i}=e,[o,c]=(0,s.useState)({keys:[],total_count:0,current_page:1,total_pages:0}),[d,u]=(0,s.useState)(!0),[m,g]=(0,s.useState)(null),x=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(console.log("calling fetchKeys"),!n){console.log("accessToken",n);return}u(!0);let t="number"==typeof e.page?e.page:1,l="number"==typeof e.pageSize?e.pageSize:100,s=await (0,a.keyListCall)(n,null,null,null,null,null,t,l);console.log("data",s),c(s),g(null)}catch(e){g(e instanceof Error?e:Error("An error occurred"))}finally{u(!1)}};return(0,s.useEffect)(()=>{x(),console.log("selectedTeam",t,"currentOrg",l,"accessToken",n,"selectedKeyAlias",r)},[t,l,n,r,i]),{keys:o.keys,isLoading:d,error:m,pagination:{currentPage:o.current_page,totalPages:o.total_pages,totalCount:o.total_count},refresh:x,setKeys:e=>{c(t=>{let l="function"==typeof e?e(t.keys):e;return{...t,keys:l}})}}}},21739:function(e,t,l){l.d(t,{Z:function(){return B}});var s=l(57437),a=l(2265),r=l(19250),n=l(39210),i=l(49804),o=l(67101),c=l(30874),d=l(92668),u=l(16721),m=l(46468),g=l(10032),x=l(22116),h=l(19015),y=l(29233),f=l(49924);l(25512);var p=l(16312),j=l(94292),w=l(99981),b=l(23048),v=l(11713),k=l(30841),S=l(7310),_=l.n(S),N=l(12363),C=l(59872),I=l(71594),D=l(24525),Z=l(10178),A=l(86462),K=l(47686),E=l(44633),T=l(49084),O=l(40728);function P(e){let{keys:t,setKeys:l,isLoading:n=!1,pagination:i,onPageChange:o,pageSize:c=50,teams:d,selectedTeam:u,setSelectedTeam:g,selectedKeyAlias:x,setSelectedKeyAlias:h,accessToken:y,userID:f,userRole:S,organizations:P,setCurrentOrg:L,refresh:U,onSortChange:z,currentSort:V,premiumUser:R,setAccessToken:F}=e,[M,B]=(0,a.useState)(null),[J,W]=(0,a.useState)([]),[H,q]=a.useState(()=>V?[{id:V.sortBy,desc:"desc"===V.sortOrder}]:[{id:"created_at",desc:!0}]),[G,X]=(0,a.useState)({}),{filters:$,filteredKeys:Q,allKeyAliases:Y,allTeams:ee,allOrganizations:et,handleFilterChange:el,handleFilterReset:es}=function(e){let{keys:t,teams:l,organizations:s,accessToken:n}=e,i={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},[o,c]=(0,a.useState)(i),[d,u]=(0,a.useState)(l||[]),[m,g]=(0,a.useState)(s||[]),[x,h]=(0,a.useState)(t),y=(0,a.useRef)(0),f=(0,a.useCallback)(_()(async e=>{if(!n)return;let t=Date.now();y.current=t;try{let l=await (0,r.keyListCall)(n,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,N.d,e["Sort By"]||null,e["Sort Order"]||null);t===y.current&&l&&(h(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,a.useEffect)(()=>{if(!t){h([]);return}let e=[...t];o["Team ID"]&&(e=e.filter(e=>e.team_id===o["Team ID"])),o["Organization ID"]&&(e=e.filter(e=>e.organization_id===o["Organization ID"])),h(e)},[t,o]),(0,a.useEffect)(()=>{let e=async()=>{let e=await (0,k.IE)(n);e.length>0&&u(e);let t=await (0,k.cT)(n);t.length>0&&g(t)};n&&e()},[n]);let p=(0,v.a)({queryKey:["allKeys"],queryFn:async()=>{if(!n)throw Error("Access token required");return await (0,k.LO)(n)},enabled:!!n}).data||[];return(0,a.useEffect)(()=>{l&&l.length>0&&u(e=>e.length{s&&s.length>0&&g(e=>e.length{c({"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"}),f({...o,...e})},handleFilterReset:()=>{c(i),f(i)}}}({keys:t,teams:d,organizations:P,accessToken:y});(0,a.useEffect)(()=>{if(y){let e=t.map(e=>e.user_id).filter(e=>null!==e);(async()=>{W((await (0,r.userListCall)(y,e,1,100)).users)})()}},[y,t]),(0,a.useEffect)(()=>{if(U){let e=()=>{U()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[U]);let ea=[{id:"expander",header:()=>null,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",cell:e=>(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(w.Z,{title:e.getValue(),children:(0,s.jsx)(p.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:()=>B(e.getValue()),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",cell:e=>{let t=e.getValue();return(0,s.jsx)(w.Z,{title:t,children:t?t.length>20?"".concat(t.slice(0,20),"..."):t:"-"})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",cell:e=>(0,s.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team Alias",cell:e=>{let{row:t,getValue:l}=e,s=l(),a=null==d?void 0:d.find(e=>e.team_id===s);return(null==a?void 0:a.team_alias)||"Unknown"}},{id:"team_id",accessorKey:"team_id",header:"Team ID",cell:e=>(0,s.jsx)(w.Z,{title:e.getValue(),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user_id",header:"User Email",cell:e=>{let t=e.getValue(),l=J.find(e=>e.user_id===t);return(null==l?void 0:l.user_email)?(0,s.jsx)(w.Z,{title:null==l?void 0:l.user_email,children:(0,s.jsxs)("span",{children:[null==l?void 0:l.user_email.slice(0,20),"..."]})}):"-"}},{id:"user_id",accessorKey:"user_id",header:"User ID",cell:e=>{let t=e.getValue();return t&&t.length>15?(0,s.jsx)(w.Z,{title:t,children:(0,s.jsxs)("span",{children:[t.slice(0,7),"..."]})}):t||"-"}},{id:"created_at",accessorKey:"created_at",header:"Created At",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",cell:e=>{let t=e.getValue();return t&&t.length>15?(0,s.jsx)(w.Z,{title:t,children:(0,s.jsxs)("span",{children:[t.slice(0,7),"..."]})}):t}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"expires",accessorKey:"expires",header:"Expires",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",cell:e=>(0,C.pw)(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",cell:e=>{let t=e.getValue();return null===t?"Unlimited":"$".concat((0,C.pw)(t))}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",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)(O.C,{size:"xs",className:"mb-1",color:"red",children:(0,s.jsx)(O.x,{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)(Z.JO,{icon:G[e.row.id]?A.Z:K.Z,className:"cursor-pointer",size:"xs",onClick:()=>{X(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)(O.C,{size:"xs",color:"red",children:(0,s.jsx)(O.x,{children:"All Proxy Models"})},t):(0,s.jsx)(O.C,{size:"xs",color:"blue",children:(0,s.jsx)(O.x,{children:e.length>30?"".concat((0,m.W0)(e).slice(0,30),"..."):(0,m.W0)(e)})},t)),t.length>3&&!G[e.row.id]&&(0,s.jsx)(O.C,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,s.jsxs)(O.x,{children:["+",t.length-3," ",t.length-3==1?"more model":"more models"]})}),G[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)(O.C,{size:"xs",color:"red",children:(0,s.jsx)(O.x,{children:"All Proxy Models"})},t+3):(0,s.jsx)(O.C,{size:"xs",color:"blue",children:(0,s.jsx)(O.x,{children:e.length>30?"".concat((0,m.W0)(e).slice(0,30),"..."):(0,m.W0)(e)})},t+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",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(t)));let er=(0,I.b7)({data:Q,columns:ea.filter(e=>"expander"!==e.id),state:{sorting:H},onSortingChange:e=>{let t="function"==typeof e?e(H):e;if(console.log("newSorting: ".concat(JSON.stringify(t))),q(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)),el({...$,"Sort By":l,"Sort Order":s}),null==z||z(l,s)}},getCoreRowModel:(0,D.sC)(),getSortedRowModel:(0,D.tj)(),enableSorting:!0,manualSorting:!1});return a.useEffect(()=>{V&&q([{id:V.sortBy,desc:"desc"===V.sortOrder}])},[V]),(0,s.jsx)("div",{className:"w-full h-full overflow-hidden",children:M?(0,s.jsx)(j.Z,{keyId:M,onClose:()=>B(null),keyData:Q.find(e=>e.token===M),onKeyDataUpdate:e=>{l(t=>t.map(t=>t.token===e.token?(0,C.nl)(t,e):t)),U&&U()},onDelete:()=>{l(e=>e.filter(e=>e.token!==M)),U&&U()},accessToken:y,userID:f,userRole:S,teams:ee,premiumUser:R,setAccessToken:F}):(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)(b.Z,{options:[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>ee&&0!==ee.length?ee.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=>et&&0!==et.length?et.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=>Y.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:el,initialValues:$,onResetFilters:es})}),(0,s.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[(0,s.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing"," ",n?"...":"".concat((i.currentPage-1)*c+1," - ").concat(Math.min(i.currentPage*c,i.totalCount))," ","of ",n?"...":i.totalCount," results"]}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",n?"...":i.currentPage," of ",n?"...":i.totalPages]}),(0,s.jsx)("button",{onClick:()=>o(i.currentPage-1),disabled:n||1===i.currentPage,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,s.jsx)("button",{onClick:()=>o(i.currentPage+1),disabled:n||i.currentPage===i.totalPages,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)(Z.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(Z.ss,{children:er.getHeaderGroups().map(e=>(0,s.jsx)(Z.SC,{children:e.headers.map(e=>(0,s.jsx)(Z.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,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,I.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)(E.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,s.jsx)(A.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,s.jsx)(T.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,s.jsx)(Z.RM,{children:n?(0,s.jsx)(Z.SC,{children:(0,s.jsx)(Z.pj,{colSpan:ea.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..."})})})}):Q.length>0?er.getRowModel().rows.map(e=>(0,s.jsx)(Z.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(Z.pj,{style:{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,I.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,s.jsx)(Z.SC,{children:(0,s.jsx)(Z.pj,{colSpan:ea.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 L=l(9114),U=e=>{let{userID:t,userRole:l,accessToken:n,selectedTeam:i,setSelectedTeam:o,data:c,setData:p,teams:j,premiumUser:w,currentOrg:b,organizations:v,setCurrentOrg:k,selectedKeyAlias:S,setSelectedKeyAlias:_,createClicked:N,setAccessToken:C}=e,[I,D]=(0,a.useState)(!1),[Z,A]=(0,a.useState)(!1),[K,E]=(0,a.useState)(null),[T,O]=(0,a.useState)(""),[U,z]=(0,a.useState)(null),[V,R]=(0,a.useState)(null),[F,M]=(0,a.useState)((null==i?void 0:i.team_id)||"");(0,a.useEffect)(()=>{M((null==i?void 0:i.team_id)||"")},[i]);let{keys:B,isLoading:J,error:W,pagination:H,refresh:q,setKeys:G}=(0,f.Z)({selectedTeam:i||void 0,currentOrg:b,selectedKeyAlias:S,accessToken:n||"",createClicked:N}),[X,$]=(0,a.useState)(!1),[Q,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(null),[el,es]=(0,a.useState)([]),ea=new Set,[er,en]=(0,a.useState)(!1),[ei,eo]=(0,a.useState)(!1),[ec,ed]=(0,a.useState)(null),[eu,em]=(0,a.useState)(null),[eg]=g.Z.useForm(),[ex,eh]=(0,a.useState)(null),[ey,ef]=(0,a.useState)(ea),[ep,ej]=(0,a.useState)([]);(0,a.useEffect)(()=>{console.log("in calculateNewExpiryTime for selectedToken",ee),(null==eu?void 0:eu.duration)?eh((e=>{if(!e)return null;try{let t;let l=new Date;if(e.endsWith("s"))t=(0,d.I)(l,{seconds:parseInt(e)});else if(e.endsWith("h"))t=(0,d.I)(l,{hours:parseInt(e)});else if(e.endsWith("d"))t=(0,d.I)(l,{days:parseInt(e)});else throw Error("Invalid duration format");return t.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}catch(e){return null}})(eu.duration)):eh(null),console.log("calculateNewExpiryTime:",ex)},[ee,null==eu?void 0:eu.duration]),(0,a.useEffect)(()=>{(async()=>{try{if(null===t||null===l||null===n)return;let e=await (0,m.K2)(t,l,n);e&&es(e)}catch(e){L.Z.error({description:"Error fetching user models"})}})()},[n,t,l]),(0,a.useEffect)(()=>{if(j){let e=new Set;j.forEach((t,l)=>{let s=t.team_id;e.add(s)}),ef(e)}},[j]);let ew=async()=>{if(null!=K&&null!=B){try{if(!n)return;await (0,r.keyDeleteCall)(n,K);let e=B.filter(e=>e.token!==K);G(e)}catch(e){L.Z.error({description:"Error deleting the key"})}A(!1),E(null),O("")}},eb=()=>{A(!1),E(null),O("")},ev=(e,t)=>{em(l=>({...l,[e]:t}))},ek=async()=>{if(!w){L.Z.warning({description:"Regenerate API Key is an Enterprise feature. Please upgrade to use this feature."});return}if(null!=ee)try{let e=await eg.validateFields();if(!n)return;let t=await (0,r.regenerateKeyCall)(n,ee.token||ee.token_id,e);if(ed(t.key),c){let l=c.map(l=>l.token===(null==ee?void 0:ee.token)?{...l,key_name:t.key_name,...e}:l);p(l)}eo(!1),eg.resetFields(),L.Z.success({description:"API Key regenerated successfully"})}catch(e){console.error("Error regenerating key:",e),L.Z.error({description:"Failed to regenerate API Key"})}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(P,{keys:B,setKeys:G,isLoading:J,pagination:H,onPageChange:e=>{q({page:e})},pageSize:100,teams:j,selectedTeam:i,setSelectedTeam:o,accessToken:n,userID:t,userRole:l,organizations:v,setCurrentOrg:k,refresh:q,selectedKeyAlias:S,setSelectedKeyAlias:_,premiumUser:w,setAccessToken:C}),Z&&(()=>{let e=null==B?void 0:B.find(e=>e.token===K),t=(null==e?void 0:e.key_alias)||(null==e?void 0:e.token_id)||K,l=T===t;return(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,s.jsx)("button",{onClick:()=>{eb(),O("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"px-6 py-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,s.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.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.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this API key."}),(0,s.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,s.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this API key?"}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,s.jsx)("span",{className:"underline",children:t})," to confirm deletion:"]}),(0,s.jsx)("input",{type:"text",value:T,onChange:e=>O(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,s.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,s.jsx)("button",{onClick:()=>{eb(),O("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,s.jsx)("button",{onClick:ew,disabled:!l,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(l?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Key"})]})]})})})(),(0,s.jsx)(x.Z,{title:"Regenerate API Key",visible:ei,onCancel:()=>{eo(!1),eg.resetFields()},footer:[(0,s.jsx)(u.zx,{onClick:()=>{eo(!1),eg.resetFields()},className:"mr-2",children:"Cancel"},"cancel"),(0,s.jsx)(u.zx,{onClick:ek,disabled:!w,children:w?"Regenerate":"Upgrade to Regenerate"},"regenerate")],children:w?(0,s.jsxs)(g.Z,{form:eg,layout:"vertical",onValuesChange:(e,t)=>{"duration"in e&&ev("duration",e.duration)},children:[(0,s.jsx)(g.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,s.jsx)(u.oi,{disabled:!0})}),(0,s.jsx)(g.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,s.jsx)(h.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(g.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,s.jsx)(h.Z,{style:{width:"100%"}})}),(0,s.jsx)(g.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,s.jsx)(h.Z,{style:{width:"100%"}})}),(0,s.jsx)(g.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,s.jsx)(u.oi,{placeholder:""})}),(0,s.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry:"," ",(null==ee?void 0:ee.expires)!=null?new Date(ee.expires).toLocaleString():"Never"]}),ex&&(0,s.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",ex]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,s.jsx)(u.zx,{variant:"primary",className:"mb-2",children:(0,s.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",children:"Get Free Trial"})})]})}),ec&&(0,s.jsx)(x.Z,{visible:!!ec,onCancel:()=>ed(null),footer:[(0,s.jsx)(u.zx,{onClick:()=>ed(null),children:"Close"},"close")],children:(0,s.jsxs)(u.rj,{numItems:1,className:"gap-2 w-full",children:[(0,s.jsx)(u.Dx,{children:"Regenerated Key"}),(0,s.jsx)(u.JX,{numColSpan:1,children:(0,s.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,s.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,s.jsxs)(u.JX,{numColSpan:1,children:[(0,s.jsx)(u.xv,{className:"mt-3",children:"Key Alias:"}),(0,s.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,s.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:(null==ee?void 0:ee.key_alias)||"No alias set"})}),(0,s.jsx)(u.xv,{className:"mt-3",children:"New API Key:"}),(0,s.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,s.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:ec})}),(0,s.jsx)(y.CopyToClipboard,{text:ec,onCopy:()=>L.Z.success({description:"API Key copied to clipboard"}),children:(0,s.jsx)(u.zx,{className:"mt-3",children:"Copy API Key"})})]})]})})]})},z=l(12011),V=l(99376),R=l(14474),F=l(57840),M=l(3914),B=e=>{let{userID:t,userRole:l,teams:d,keys:u,setUserRole:m,userEmail:g,setUserEmail:x,setTeams:h,setKeys:y,premiumUser:f,organizations:p,addKey:j,createClicked:w}=e,[b,v]=(0,a.useState)(null),[k,S]=(0,a.useState)(null),_=(0,V.useSearchParams)(),N=function(e){console.log("COOKIES",document.cookie);let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}("token"),C=_.get("invitation_id"),[I,D]=(0,a.useState)(null),[Z,A]=(0,a.useState)(null),[K,E]=(0,a.useState)([]),[T,O]=(0,a.useState)(null),[P,L]=(0,a.useState)(null),[B,J]=(0,a.useState)(null);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,a.useEffect)(()=>{if(N){let e=(0,R.o)(N);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),D(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),m(t)}else console.log("User role not defined");e.user_email?x(e.user_email):console.log("User Email is not set ".concat(e))}}if(t&&I&&l&&!u&&!b){let e=sessionStorage.getItem("userModels"+t);e?E(JSON.parse(e)):(console.log("currentOrg: ".concat(JSON.stringify(k))),(async()=>{try{let e=await (0,r.getProxyUISettings)(I);O(e);let s=await (0,r.userInfoCall)(I,t,l,!1,null,null);v(s.user_info),console.log("userSpendData: ".concat(JSON.stringify(b))),(null==s?void 0:s.teams[0].keys)?y(s.keys.concat(s.teams.filter(e=>"Admin"===l||e.user_id===t).flatMap(e=>e.keys))):y(s.keys),sessionStorage.setItem("userData"+t,JSON.stringify(s.keys)),sessionStorage.setItem("userSpendData"+t,JSON.stringify(s.user_info));let a=(await (0,r.modelAvailableCall)(I,t,l)).data.map(e=>e.id);console.log("available_model_names:",a),E(a),console.log("userModels:",K),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")&&W()}})(),(0,n.Z)(I,t,l,k,h))}},[t,N,I,u,l]),(0,a.useEffect)(()=>{I&&(async()=>{try{let e=await (0,r.keyInfoCall)(I,[I]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&W()}})()},[I]),(0,a.useEffect)(()=>{console.log("currentOrg: ".concat(JSON.stringify(k),", accessToken: ").concat(I,", userID: ").concat(t,", userRole: ").concat(l)),I&&(console.log("fetching teams"),(0,n.Z)(I,t,l,k,h))},[k]),(0,a.useEffect)(()=>{if(null!==u&&null!=P&&null!==P.team_id){let e=0;for(let t of(console.log("keys: ".concat(JSON.stringify(u))),u))P.hasOwnProperty("team_id")&&null!==t.team_id&&t.team_id===P.team_id&&(e+=t.spend);console.log("sum: ".concat(e)),A(e)}else if(null!==u){let e=0;for(let t of u)e+=t.spend;A(e)}},[P]),null!=C)return(0,s.jsx)(z.default,{});function W(){(0,M.b)();let e=(0,r.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==N)return console.log("All cookies before redirect:",document.cookie),W(),null;try{let e=(0,R.o)(N);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"),W(),null}catch(e){return console.error("Error decoding token:",e),(0,M.b)(),W(),null}if(null==I)return null;if(null==t)return(0,s.jsx)("h1",{children:"User ID is not set"});if(null==l&&m("App Owner"),l&&"Admin Viewer"==l){let{Title:e,Paragraph:t}=F.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",P),console.log("All cookies after redirect:",document.cookie),(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(o.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(i.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)(c.ZP,{userID:t,team:P,teams:d,userRole:l,accessToken:I,data:u,addKey:j,premiumUser:f},P?P.team_id:null),(0,s.jsx)(U,{userID:t,userRole:l,accessToken:I,selectedTeam:P||null,setSelectedTeam:L,selectedKeyAlias:B,setSelectedKeyAlias:J,data:u,setData:y,premiumUser:f,teams:d,currentOrg:k,setCurrentOrg:S,organizations:p,createClicked:w,setAccessToken:D})]})})})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1739],{25512:function(e,t,l){l.d(t,{P:function(){return s.Z},Q:function(){return a.Z}});var s=l(27281),a=l(43227)},12011:function(e,t,l){l.r(t),l.d(t,{default:function(){return w}});var s=l(57437),a=l(2265),r=l(99376),n=l(78489),i=l(94789),o=l(12514),c=l(49804),d=l(67101),u=l(84264),m=l(49566),g=l(96761),x=l(84566),h=l(19250),y=l(14474),f=l(10032),p=l(5545),j=l(3914);function w(){let[e]=f.Z.useForm(),t=(0,r.useSearchParams)();(0,j.e)("token");let l=t.get("invitation_id"),w=t.get("action"),[b,v]=(0,a.useState)(null),[k,S]=(0,a.useState)(""),[_,N]=(0,a.useState)(""),[C,D]=(0,a.useState)(null),[I,Z]=(0,a.useState)(""),[K,E]=(0,a.useState)(""),[A,T]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{(0,h.getUiConfig)().then(e=>{console.log("ui config in onboarding.tsx:",e),T(!1)})},[]),(0,a.useEffect)(()=>{l&&!A&&(0,h.getOnboardingCredentials)(l).then(e=>{let t=e.login_url;console.log("login_url:",t),Z(t);let l=e.token,s=(0,y.o)(l);E(l),console.log("decoded:",s),v(s.key),console.log("decoded user email:",s.user_email),N(s.user_email),D(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"===w?"Reset Password":"Sign up"}),(0,s.jsx)(u.Z,{children:"reset_password"===w?"Reset your password to access Admin UI.":"Claim your user account to login to Admin UI."}),"reset_password"!==w&&(0,s.jsx)(i.Z,{className:"mt-4",title:"SSO",icon:x.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)(n.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)(f.Z,{className:"mt-10 mb-5 mx-auto",layout:"vertical",onFinish:e=>{console.log("in handle submit. accessToken:",b,"token:",K,"formValues:",e),b&&K&&(e.user_email=_,C&&l&&(0,h.claimOnboardingToken)(b,l,C,e.password).then(e=>{document.cookie="token="+K;let t=(0,h.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)(f.Z.Item,{label:"Email Address",name:"user_email",children:(0,s.jsx)(m.Z,{type:"email",disabled:!0,value:_,defaultValue:_,className:"max-w-md"})}),(0,s.jsx)(f.Z.Item,{label:"Password",name:"password",rules:[{required:!0,message:"password required to sign up"}],help:"reset_password"===w?"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"===w?"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,r)=>{let n;n="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(n)),r(n)}},49924:function(e,t,l){var s=l(2265),a=l(19250);t.Z=e=>{let{selectedTeam:t,currentOrg:l,selectedKeyAlias:r,accessToken:n,createClicked:i}=e,[o,c]=(0,s.useState)({keys:[],total_count:0,current_page:1,total_pages:0}),[d,u]=(0,s.useState)(!0),[m,g]=(0,s.useState)(null),x=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(console.log("calling fetchKeys"),!n){console.log("accessToken",n);return}u(!0);let t="number"==typeof e.page?e.page:1,l="number"==typeof e.pageSize?e.pageSize:100,s=await (0,a.keyListCall)(n,null,null,null,null,null,t,l);console.log("data",s),c(s),g(null)}catch(e){g(e instanceof Error?e:Error("An error occurred"))}finally{u(!1)}};return(0,s.useEffect)(()=>{x(),console.log("selectedTeam",t,"currentOrg",l,"accessToken",n,"selectedKeyAlias",r)},[t,l,n,r,i]),{keys:o.keys,isLoading:d,error:m,pagination:{currentPage:o.current_page,totalPages:o.total_pages,totalCount:o.total_count},refresh:x,setKeys:e=>{c(t=>{let l="function"==typeof e?e(t.keys):e;return{...t,keys:l}})}}}},21739:function(e,t,l){l.d(t,{Z:function(){return B}});var s=l(57437),a=l(2265),r=l(19250),n=l(39210),i=l(49804),o=l(67101),c=l(30874),d=l(92668),u=l(16721),m=l(46468),g=l(10032),x=l(22116),h=l(19015),y=l(29233),f=l(49924);l(25512);var p=l(16312),j=l(94292),w=l(99981),b=l(23048),v=l(11713),k=l(30841),S=l(7310),_=l.n(S),N=l(12363),C=l(59872),D=l(71594),I=l(24525),Z=l(10178),K=l(86462),E=l(47686),A=l(44633),T=l(49084),O=l(40728);function L(e){let{keys:t,setKeys:l,isLoading:n=!1,pagination:i,onPageChange:o,pageSize:c=50,teams:d,selectedTeam:u,setSelectedTeam:g,selectedKeyAlias:x,setSelectedKeyAlias:h,accessToken:y,userID:f,userRole:S,organizations:L,setCurrentOrg:U,refresh:z,onSortChange:V,currentSort:P,premiumUser:R,setAccessToken:F}=e,[M,B]=(0,a.useState)(null),[J,W]=(0,a.useState)([]),[H,q]=a.useState(()=>P?[{id:P.sortBy,desc:"desc"===P.sortOrder}]:[{id:"created_at",desc:!0}]),[G,X]=(0,a.useState)({}),{filters:$,filteredKeys:Q,allKeyAliases:Y,allTeams:ee,allOrganizations:et,handleFilterChange:el,handleFilterReset:es}=function(e){let{keys:t,teams:l,organizations:s,accessToken:n}=e,i={"Team ID":"","Organization ID":"","Key Alias":"","User ID":"","Sort By":"created_at","Sort Order":"desc"},[o,c]=(0,a.useState)(i),[d,u]=(0,a.useState)(l||[]),[m,g]=(0,a.useState)(s||[]),[x,h]=(0,a.useState)(t),y=(0,a.useRef)(0),f=(0,a.useCallback)(_()(async e=>{if(!n)return;let t=Date.now();y.current=t;try{let l=await (0,r.keyListCall)(n,e["Organization ID"]||null,e["Team ID"]||null,e["Key Alias"]||null,e["User ID"]||null,e["Key Hash"]||null,1,N.d,e["Sort By"]||null,e["Sort Order"]||null);t===y.current&&l&&(h(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,a.useEffect)(()=>{if(!t){h([]);return}let e=[...t];o["Team ID"]&&(e=e.filter(e=>e.team_id===o["Team ID"])),o["Organization ID"]&&(e=e.filter(e=>e.organization_id===o["Organization ID"])),h(e)},[t,o]),(0,a.useEffect)(()=>{let e=async()=>{let e=await (0,k.IE)(n);e.length>0&&u(e);let t=await (0,k.cT)(n);t.length>0&&g(t)};n&&e()},[n]);let p=(0,v.a)({queryKey:["allKeys"],queryFn:async()=>{if(!n)throw Error("Access token required");return await (0,k.LO)(n)},enabled:!!n}).data||[];return(0,a.useEffect)(()=>{l&&l.length>0&&u(e=>e.length{s&&s.length>0&&g(e=>e.length{c({"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"}),f({...o,...e})},handleFilterReset:()=>{c(i),f(i)}}}({keys:t,teams:d,organizations:L,accessToken:y});(0,a.useEffect)(()=>{if(y){let e=t.map(e=>e.user_id).filter(e=>null!==e);(async()=>{W((await (0,r.userListCall)(y,e,1,100)).users)})()}},[y,t]),(0,a.useEffect)(()=>{if(z){let e=()=>{z()};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},[z]);let ea=[{id:"expander",header:()=>null,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",cell:e=>(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(w.Z,{title:e.getValue(),children:(0,s.jsx)(p.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:()=>B(e.getValue()),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})})})},{id:"key_alias",accessorKey:"key_alias",header:"Key Alias",cell:e=>{let t=e.getValue();return(0,s.jsx)(w.Z,{title:t,children:t?t.length>20?"".concat(t.slice(0,20),"..."):t:"-"})}},{id:"key_name",accessorKey:"key_name",header:"Secret Key",cell:e=>(0,s.jsx)("span",{className:"font-mono text-xs",children:e.getValue()})},{id:"team_alias",accessorKey:"team_id",header:"Team Alias",cell:e=>{let{row:t,getValue:l}=e,s=l(),a=null==d?void 0:d.find(e=>e.team_id===s);return(null==a?void 0:a.team_alias)||"Unknown"}},{id:"team_id",accessorKey:"team_id",header:"Team ID",cell:e=>(0,s.jsx)(w.Z,{title:e.getValue(),children:e.getValue()?"".concat(e.getValue().slice(0,7),"..."):"-"})},{id:"organization_id",accessorKey:"organization_id",header:"Organization ID",cell:e=>e.getValue()?e.renderValue():"-"},{id:"user_email",accessorKey:"user_id",header:"User Email",cell:e=>{let t=e.getValue(),l=J.find(e=>e.user_id===t);return(null==l?void 0:l.user_email)?(0,s.jsx)(w.Z,{title:null==l?void 0:l.user_email,children:(0,s.jsxs)("span",{children:[null==l?void 0:l.user_email.slice(0,20),"..."]})}):"-"}},{id:"user_id",accessorKey:"user_id",header:"User ID",cell:e=>{let t=e.getValue();return t&&t.length>15?(0,s.jsx)(w.Z,{title:t,children:(0,s.jsxs)("span",{children:[t.slice(0,7),"..."]})}):t||"-"}},{id:"created_at",accessorKey:"created_at",header:"Created At",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"-"}},{id:"created_by",accessorKey:"created_by",header:"Created By",cell:e=>{let t=e.getValue();return t&&t.length>15?(0,s.jsx)(w.Z,{title:t,children:(0,s.jsxs)("span",{children:[t.slice(0,7),"..."]})}):t}},{id:"updated_at",accessorKey:"updated_at",header:"Updated At",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"expires",accessorKey:"expires",header:"Expires",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleDateString():"Never"}},{id:"spend",accessorKey:"spend",header:"Spend (USD)",cell:e=>(0,C.pw)(e.getValue(),4)},{id:"max_budget",accessorKey:"max_budget",header:"Budget (USD)",cell:e=>{let t=e.getValue();return null===t?"Unlimited":"$".concat((0,C.pw)(t))}},{id:"budget_reset_at",accessorKey:"budget_reset_at",header:"Budget Reset",cell:e=>{let t=e.getValue();return t?new Date(t).toLocaleString():"Never"}},{id:"models",accessorKey:"models",header:"Models",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)(O.C,{size:"xs",className:"mb-1",color:"red",children:(0,s.jsx)(O.x,{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)(Z.JO,{icon:G[e.row.id]?K.Z:E.Z,className:"cursor-pointer",size:"xs",onClick:()=>{X(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)(O.C,{size:"xs",color:"red",children:(0,s.jsx)(O.x,{children:"All Proxy Models"})},t):(0,s.jsx)(O.C,{size:"xs",color:"blue",children:(0,s.jsx)(O.x,{children:e.length>30?"".concat((0,m.W0)(e).slice(0,30),"..."):(0,m.W0)(e)})},t)),t.length>3&&!G[e.row.id]&&(0,s.jsx)(O.C,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,s.jsxs)(O.x,{children:["+",t.length-3," ",t.length-3==1?"more model":"more models"]})}),G[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)(O.C,{size:"xs",color:"red",children:(0,s.jsx)(O.x,{children:"All Proxy Models"})},t+3):(0,s.jsx)(O.C,{size:"xs",color:"blue",children:(0,s.jsx)(O.x,{children:e.length>30?"".concat((0,m.W0)(e).slice(0,30),"..."):(0,m.W0)(e)})},t+3))})]})]})})}):null})}},{id:"rate_limits",header:"Rate Limits",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(t)));let er=(0,D.b7)({data:Q,columns:ea.filter(e=>"expander"!==e.id),state:{sorting:H},onSortingChange:e=>{let t="function"==typeof e?e(H):e;if(console.log("newSorting: ".concat(JSON.stringify(t))),q(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)),el({...$,"Sort By":l,"Sort Order":s}),null==V||V(l,s)}},getCoreRowModel:(0,I.sC)(),getSortedRowModel:(0,I.tj)(),enableSorting:!0,manualSorting:!1});return a.useEffect(()=>{P&&q([{id:P.sortBy,desc:"desc"===P.sortOrder}])},[P]),(0,s.jsx)("div",{className:"w-full h-full overflow-hidden",children:M?(0,s.jsx)(j.Z,{keyId:M,onClose:()=>B(null),keyData:Q.find(e=>e.token===M),onKeyDataUpdate:e=>{l(t=>t.map(t=>t.token===e.token?(0,C.nl)(t,e):t)),z&&z()},onDelete:()=>{l(e=>e.filter(e=>e.token!==M)),z&&z()},accessToken:y,userID:f,userRole:S,teams:ee,premiumUser:R,setAccessToken:F}):(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)(b.Z,{options:[{name:"Team ID",label:"Team ID",isSearchable:!0,searchFn:async e=>ee&&0!==ee.length?ee.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=>et&&0!==et.length?et.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=>Y.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:el,initialValues:$,onResetFilters:es})}),(0,s.jsxs)("div",{className:"flex items-center justify-between w-full mb-4",children:[(0,s.jsxs)("span",{className:"inline-flex text-sm text-gray-700",children:["Showing"," ",n?"...":"".concat((i.currentPage-1)*c+1," - ").concat(Math.min(i.currentPage*c,i.totalCount))," ","of ",n?"...":i.totalCount," results"]}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-sm text-gray-700",children:["Page ",n?"...":i.currentPage," of ",n?"...":i.totalPages]}),(0,s.jsx)("button",{onClick:()=>o(i.currentPage-1),disabled:n||1===i.currentPage,className:"px-3 py-1 text-sm border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,s.jsx)("button",{onClick:()=>o(i.currentPage+1),disabled:n||i.currentPage===i.totalPages,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)(Z.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,s.jsx)(Z.ss,{children:er.getHeaderGroups().map(e=>(0,s.jsx)(Z.SC,{children:e.headers.map(e=>(0,s.jsx)(Z.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,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,D.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)(A.Z,{className:"h-4 w-4 text-blue-500"}),desc:(0,s.jsx)(K.Z,{className:"h-4 w-4 text-blue-500"})})[e.column.getIsSorted()]:(0,s.jsx)(T.Z,{className:"h-4 w-4 text-gray-400"})})]})},e.id))},e.id))}),(0,s.jsx)(Z.RM,{children:n?(0,s.jsx)(Z.SC,{children:(0,s.jsx)(Z.pj,{colSpan:ea.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..."})})})}):Q.length>0?er.getRowModel().rows.map(e=>(0,s.jsx)(Z.SC,{className:"h-8",children:e.getVisibleCells().map(e=>(0,s.jsx)(Z.pj,{style:{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,D.ie)(e.column.columnDef.cell,e.getContext())},e.id))},e.id)):(0,s.jsx)(Z.SC,{children:(0,s.jsx)(Z.pj,{colSpan:ea.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 U=l(9114),z=e=>{let{userID:t,userRole:l,accessToken:n,selectedTeam:i,setSelectedTeam:o,data:c,setData:p,teams:j,premiumUser:w,currentOrg:b,organizations:v,setCurrentOrg:k,selectedKeyAlias:S,setSelectedKeyAlias:_,createClicked:N,setAccessToken:C}=e,[D,I]=(0,a.useState)(!1),[Z,K]=(0,a.useState)(!1),[E,A]=(0,a.useState)(null),[T,O]=(0,a.useState)(""),[z,V]=(0,a.useState)(null),[P,R]=(0,a.useState)(null),[F,M]=(0,a.useState)((null==i?void 0:i.team_id)||"");(0,a.useEffect)(()=>{M((null==i?void 0:i.team_id)||"")},[i]);let{keys:B,isLoading:J,error:W,pagination:H,refresh:q,setKeys:G}=(0,f.Z)({selectedTeam:i||void 0,currentOrg:b,selectedKeyAlias:S,accessToken:n||"",createClicked:N}),[X,$]=(0,a.useState)(!1),[Q,Y]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(null),[el,es]=(0,a.useState)([]),ea=new Set,[er,en]=(0,a.useState)(!1),[ei,eo]=(0,a.useState)(!1),[ec,ed]=(0,a.useState)(null),[eu,em]=(0,a.useState)(null),[eg]=g.Z.useForm(),[ex,eh]=(0,a.useState)(null),[ey,ef]=(0,a.useState)(ea),[ep,ej]=(0,a.useState)([]);(0,a.useEffect)(()=>{console.log("in calculateNewExpiryTime for selectedToken",ee),(null==eu?void 0:eu.duration)?eh((e=>{if(!e)return null;try{let t;let l=new Date;if(e.endsWith("s"))t=(0,d.I)(l,{seconds:parseInt(e)});else if(e.endsWith("h"))t=(0,d.I)(l,{hours:parseInt(e)});else if(e.endsWith("d"))t=(0,d.I)(l,{days:parseInt(e)});else throw Error("Invalid duration format");return t.toLocaleString("en-US",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})}catch(e){return null}})(eu.duration)):eh(null),console.log("calculateNewExpiryTime:",ex)},[ee,null==eu?void 0:eu.duration]),(0,a.useEffect)(()=>{(async()=>{try{if(null===t||null===l||null===n)return;let e=await (0,m.K2)(t,l,n);e&&es(e)}catch(e){U.Z.error({description:"Error fetching user models"})}})()},[n,t,l]),(0,a.useEffect)(()=>{if(j){let e=new Set;j.forEach((t,l)=>{let s=t.team_id;e.add(s)}),ef(e)}},[j]);let ew=async()=>{if(null!=E&&null!=B){try{if(!n)return;await (0,r.keyDeleteCall)(n,E);let e=B.filter(e=>e.token!==E);G(e)}catch(e){U.Z.error({description:"Error deleting the key"})}K(!1),A(null),O("")}},eb=()=>{K(!1),A(null),O("")},ev=(e,t)=>{em(l=>({...l,[e]:t}))},ek=async()=>{if(!w){U.Z.warning({description:"Regenerate Virtual Key is an Enterprise feature. Please upgrade to use this feature."});return}if(null!=ee)try{let e=await eg.validateFields();if(!n)return;let t=await (0,r.regenerateKeyCall)(n,ee.token||ee.token_id,e);if(ed(t.key),c){let l=c.map(l=>l.token===(null==ee?void 0:ee.token)?{...l,key_name:t.key_name,...e}:l);p(l)}eo(!1),eg.resetFields(),U.Z.success({description:"Virtual Key regenerated successfully"})}catch(e){console.error("Error regenerating key:",e),U.Z.error({description:"Failed to regenerate Virtual Key"})}};return(0,s.jsxs)("div",{children:[(0,s.jsx)(L,{keys:B,setKeys:G,isLoading:J,pagination:H,onPageChange:e=>{q({page:e})},pageSize:100,teams:j,selectedTeam:i,setSelectedTeam:o,accessToken:n,userID:t,userRole:l,organizations:v,setCurrentOrg:k,refresh:q,selectedKeyAlias:S,setSelectedKeyAlias:_,premiumUser:w,setAccessToken:C}),Z&&(()=>{let e=null==B?void 0:B.find(e=>e.token===E),t=(null==e?void 0:e.key_alias)||(null==e?void 0:e.token_id)||E,l=T===t;return(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,s.jsx)("button",{onClick:()=>{eb(),O("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"px-6 py-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,s.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.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.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this Virtual Key."}),(0,s.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,s.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this Virtual Key?"}),(0,s.jsxs)("div",{className:"mb-5",children:[(0,s.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,s.jsx)("span",{className:"underline",children:t})," to confirm deletion:"]}),(0,s.jsx)("input",{type:"text",value:T,onChange:e=>O(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,s.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,s.jsx)("button",{onClick:()=>{eb(),O("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,s.jsx)("button",{onClick:ew,disabled:!l,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(l?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Virtual Key"})]})]})})})(),(0,s.jsx)(x.Z,{title:"Regenerate Virtual Key",visible:ei,onCancel:()=>{eo(!1),eg.resetFields()},footer:[(0,s.jsx)(u.zx,{onClick:()=>{eo(!1),eg.resetFields()},className:"mr-2",children:"Cancel"},"cancel"),(0,s.jsx)(u.zx,{onClick:ek,disabled:!w,children:w?"Regenerate":"Upgrade to Regenerate"},"regenerate")],children:w?(0,s.jsxs)(g.Z,{form:eg,layout:"vertical",onValuesChange:(e,t)=>{"duration"in e&&ev("duration",e.duration)},children:[(0,s.jsx)(g.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,s.jsx)(u.oi,{disabled:!0})}),(0,s.jsx)(g.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,s.jsx)(h.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,s.jsx)(g.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,s.jsx)(h.Z,{style:{width:"100%"}})}),(0,s.jsx)(g.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,s.jsx)(h.Z,{style:{width:"100%"}})}),(0,s.jsx)(g.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,s.jsx)(u.oi,{placeholder:""})}),(0,s.jsxs)("div",{className:"mt-2 text-sm text-gray-500",children:["Current expiry:"," ",(null==ee?void 0:ee.expires)!=null?new Date(ee.expires).toLocaleString():"Never"]}),ex&&(0,s.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",ex]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-2 text-gray-500 italic text-[12px]",children:"Upgrade to use this feature"}),(0,s.jsx)(u.zx,{variant:"primary",className:"mb-2",children:(0,s.jsx)("a",{href:"https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat",target:"_blank",children:"Get Free Trial"})})]})}),ec&&(0,s.jsx)(x.Z,{visible:!!ec,onCancel:()=>ed(null),footer:[(0,s.jsx)(u.zx,{onClick:()=>ed(null),children:"Close"},"close")],children:(0,s.jsxs)(u.rj,{numItems:1,className:"gap-2 w-full",children:[(0,s.jsx)(u.Dx,{children:"Regenerated Key"}),(0,s.jsx)(u.JX,{numColSpan:1,children:(0,s.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,s.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,s.jsxs)(u.JX,{numColSpan:1,children:[(0,s.jsx)(u.xv,{className:"mt-3",children:"Key Alias:"}),(0,s.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,s.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:(null==ee?void 0:ee.key_alias)||"No alias set"})}),(0,s.jsx)(u.xv,{className:"mt-3",children:"New Virtual Key:"}),(0,s.jsx)("div",{style:{background:"#f8f8f8",padding:"10px",borderRadius:"5px",marginBottom:"10px"},children:(0,s.jsx)("pre",{style:{wordWrap:"break-word",whiteSpace:"normal"},children:ec})}),(0,s.jsx)(y.CopyToClipboard,{text:ec,onCopy:()=>U.Z.success({description:"Virtual Key copied to clipboard"}),children:(0,s.jsx)(u.zx,{className:"mt-3",children:"Copy Virtual Key"})})]})]})})]})},V=l(12011),P=l(99376),R=l(14474),F=l(57840),M=l(3914),B=e=>{let{userID:t,userRole:l,teams:d,keys:u,setUserRole:m,userEmail:g,setUserEmail:x,setTeams:h,setKeys:y,premiumUser:f,organizations:p,addKey:j,createClicked:w}=e,[b,v]=(0,a.useState)(null),[k,S]=(0,a.useState)(null),_=(0,P.useSearchParams)(),N=function(e){console.log("COOKIES",document.cookie);let t=document.cookie.split("; ").find(t=>t.startsWith(e+"="));return t?t.split("=")[1]:null}("token"),C=_.get("invitation_id"),[D,I]=(0,a.useState)(null),[Z,K]=(0,a.useState)(null),[E,A]=(0,a.useState)([]),[T,O]=(0,a.useState)(null),[L,U]=(0,a.useState)(null),[B,J]=(0,a.useState)(null);if(window.addEventListener("beforeunload",function(){sessionStorage.clear()}),(0,a.useEffect)(()=>{if(N){let e=(0,R.o)(N);if(e){if(console.log("Decoded token:",e),console.log("Decoded key:",e.key),I(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),m(t)}else console.log("User role not defined");e.user_email?x(e.user_email):console.log("User Email is not set ".concat(e))}}if(t&&D&&l&&!u&&!b){let e=sessionStorage.getItem("userModels"+t);e?A(JSON.parse(e)):(console.log("currentOrg: ".concat(JSON.stringify(k))),(async()=>{try{let e=await (0,r.getProxyUISettings)(D);O(e);let s=await (0,r.userInfoCall)(D,t,l,!1,null,null);v(s.user_info),console.log("userSpendData: ".concat(JSON.stringify(b))),(null==s?void 0:s.teams[0].keys)?y(s.keys.concat(s.teams.filter(e=>"Admin"===l||e.user_id===t).flatMap(e=>e.keys))):y(s.keys),sessionStorage.setItem("userData"+t,JSON.stringify(s.keys)),sessionStorage.setItem("userSpendData"+t,JSON.stringify(s.user_info));let a=(await (0,r.modelAvailableCall)(D,t,l)).data.map(e=>e.id);console.log("available_model_names:",a),A(a),console.log("userModels:",E),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")&&W()}})(),(0,n.Z)(D,t,l,k,h))}},[t,N,D,u,l]),(0,a.useEffect)(()=>{D&&(async()=>{try{let e=await (0,r.keyInfoCall)(D,[D]);console.log("keyInfo: ",e)}catch(e){e.message.includes("Invalid proxy server token passed")&&W()}})()},[D]),(0,a.useEffect)(()=>{console.log("currentOrg: ".concat(JSON.stringify(k),", accessToken: ").concat(D,", userID: ").concat(t,", userRole: ").concat(l)),D&&(console.log("fetching teams"),(0,n.Z)(D,t,l,k,h))},[k]),(0,a.useEffect)(()=>{if(null!==u&&null!=L&&null!==L.team_id){let e=0;for(let t of(console.log("keys: ".concat(JSON.stringify(u))),u))L.hasOwnProperty("team_id")&&null!==t.team_id&&t.team_id===L.team_id&&(e+=t.spend);console.log("sum: ".concat(e)),K(e)}else if(null!==u){let e=0;for(let t of u)e+=t.spend;K(e)}},[L]),null!=C)return(0,s.jsx)(V.default,{});function W(){(0,M.b)();let e=(0,r.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==N)return console.log("All cookies before redirect:",document.cookie),W(),null;try{let e=(0,R.o)(N);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"),W(),null}catch(e){return console.error("Error decoding token:",e),(0,M.b)(),W(),null}if(null==D)return null;if(null==t)return(0,s.jsx)("h1",{children:"User ID is not set"});if(null==l&&m("App Owner"),l&&"Admin Viewer"==l){let{Title:e,Paragraph:t}=F.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",L),console.log("All cookies after redirect:",document.cookie),(0,s.jsx)("div",{className:"w-full mx-4 h-[75vh]",children:(0,s.jsx)(o.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,s.jsxs)(i.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[(0,s.jsx)(c.ZP,{userID:t,team:L,teams:d,userRole:l,accessToken:D,data:u,addKey:j,premiumUser:f},L?L.team_id:null),(0,s.jsx)(z,{userID:t,userRole:l,accessToken:D,selectedTeam:L||null,setSelectedTeam:U,selectedKeyAlias:B,setSelectedKeyAlias:J,data:u,setData:y,premiumUser:f,teams:d,currentOrg:k,setCurrentOrg:S,organizations:p,createClicked:w,setAccessToken:I})]})})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1971-00859360d0630018.js b/litellm/proxy/_experimental/out/_next/static/chunks/1971-00859360d0630018.js new file mode 100644 index 0000000000..65bd9b529a --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/1971-00859360d0630018.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1971,5945],{58747:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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){r.d(t,{Z:function(){return o}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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"}))}},30150:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(5853),a=r(2265);let o=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),a.createElement("path",{d:"M20 12H4"}))};var s=r(13241),l=r(1153),c=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",h=a.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:h=!0,disabled:m,onValueChange:f,onChange:p}=e,b=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,a.useRef)(null),[v,y]=a.useState(!1),w=a.useCallback(()=>{y(!0)},[]),x=a.useCallback(()=>{y(!1)},[]),[E,C]=a.useState(!1),O=a.useCallback(()=>{C(!0)},[]),k=a.useCallback(()=>{C(!1)},[]);return a.createElement(c.Z,Object.assign({type:"number",ref:(0,l.lq)([g,t]),disabled:m,makeInputClassName:(0,l.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&&w(),"ArrowUp"===e.key&&O()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&k()},onChange:e=>{m||(null==f||f(parseFloat(e.target.value)),null==p||p(e))},stepper:h?a.createElement("div",{className:(0,s.q)("flex justify-center align-middle")},a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(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,s.q)(!m&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(i,{"data-testid":"step-down",className:(v?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),a.createElement("div",{tabIndex:-1,onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onTouchStart:e=>{e.cancelable&&e.preventDefault()},onMouseUp:()=>{var e,t;m||(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,s.q)(!m&&d,u,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},a.createElement(o,{"data-testid":"step-up",className:(E?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},b))});h.displayName="NumberInput"},27281:function(e,t,r){r.d(t,{Z:function(){return f}});var n=r(5853),a=r(58747),o=r(2265),i=r(4537),s=r(13241),l=r(1153),c=r(96398),u=r(51975),d=r(85238),h=r(44140);let m=(0,l.fn)("Select"),f=o.forwardRef((e,t)=>{let{defaultValue:r="",value:l,onValueChange:f,placeholder:p="Select...",disabled:b=!1,icon:g,enableClear:v=!1,required:y,children:w,name:x,error:E=!1,errorMessage:C,className:O,id:k}=e,S=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","disabled","icon","enableClear","required","children","name","error","errorMessage","className","id"]),P=(0,o.useRef)(null),N=o.Children.toArray(w),[T,q]=(0,h.Z)(r,l),M=(0,o.useMemo)(()=>{let e=o.Children.toArray(w).filter(o.isValidElement);return(0,c.sl)(e)},[w]);return o.createElement("div",{className:(0,s.q)("w-full min-w-[10rem] text-tremor-default",O)},o.createElement("div",{className:"relative"},o.createElement("select",{title:"select-hidden",required:y,className:(0,s.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:T,onChange:e=>{e.preventDefault()},name:x,disabled:b,id:k,onFocus:()=>{let e=P.current;e&&e.focus()}},o.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},p),N.map(e=>{let t=e.props.value,r=e.props.children;return o.createElement("option",{className:"hidden",key:t,value:t},r)})),o.createElement(u.Ri,Object.assign({as:"div",ref:t,defaultValue:T,value:T,onChange:e=>{null==f||f(e),q(e)},disabled:b,id:k},S),e=>{var t;let{value:r}=e;return o.createElement(o.Fragment,null,o.createElement(u.Y4,{ref:P,className:(0,s.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,E))},g&&o.createElement("span",{className:(0,s.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(g,{className:(0,s.q)(m("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("span",{className:"w-[90%] block truncate"},r&&null!==(t=M.get(r))&&void 0!==t?t:p),o.createElement("span",{className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-3")},o.createElement(a.Z,{className:(0,s.q)(m("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),v&&T?o.createElement("button",{type:"button",className:(0,s.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),q(""),null==f||f("")}},o.createElement(i.Z,{className:(0,s.q)(m("clearIcon"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.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"},o.createElement(u.O_,{anchor:"bottom start",className:(0,s.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")},w)))})),E&&C?o.createElement("p",{className:(0,s.q)("errorMessage","text-sm text-rose-500 mt-1")},C):null)});f.displayName="Select"},16853:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(96398),o=r(44140),i=r(2265),s=r(13241),l=r(1153);let c=(0,l.fn)("Textarea"),u=i.forwardRef((e,t)=>{let{value:r,defaultValue:u="",placeholder:d="Type...",error:h=!1,errorMessage:m,disabled:f=!1,className:p,onChange:b,onValueChange:g,autoHeight:v=!1}=e,y=(0,n._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[w,x]=(0,o.Z)(u,r),E=(0,i.useRef)(null),C=(0,a.Uh)(w);return(0,i.useEffect)(()=>{let e=E.current;if(v&&e){e.style.height="60px";let t=e.scrollHeight;e.style.height=t+"px"}},[v,E,w]),i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,l.lq)([E,t]),value:w,placeholder:d,disabled:f,className:(0,s.q)(c("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,a.um)(C,f,h),f?"placeholder:text-tremor-content-subtle dark:placeholder:text-dark-tremor-content-subtle":"placeholder:text-tremor-content dark:placeholder:text-dark-tremor-content",p),"data-testid":"text-area",onChange:e=>{null==b||b(e),x(e.target.value),null==g||g(e.target.value)}},y)),h&&m?i.createElement("p",{className:(0,s.q)(c("errorMessage"),"text-sm text-red-500 mt-1")},m):null)});u.displayName="Textarea"},87452:function(e,t,r){r.d(t,{Z:function(){return d},r:function(){return u}});var n=r(5853),a=r(91054);r(42698),r(64016);var o=r(8710);r(33232);var i=r(13241),s=r(1153),l=r(2265);let c=(0,s.fn)("Accordion"),u=(0,l.createContext)({isOpen:!1}),d=l.forwardRef((e,t)=>{var r;let{defaultOpen:s=!1,children:d,className:h}=e,m=(0,n._T)(e,["defaultOpen","children","className"]),f=null!==(r=(0,l.useContext)(o.Z))&&void 0!==r?r:(0,i.q)("rounded-tremor-default border");return l.createElement(a.pJ,Object.assign({as:"div",ref:t,className:(0,i.q)(c("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",f,h),defaultOpen:s},m),e=>{let{open:t}=e;return l.createElement(u.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(2265),o=r(91054),i=r(13241);let s=(0,r(1153).fn)("AccordionBody"),l=a.forwardRef((e,t)=>{let{children:r,className:l}=e,c=(0,n._T)(e,["children","className"]);return a.createElement(o.pJ.Panel,Object.assign({ref:t,className:(0,i.q)(s("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",l)},c),r)});l.displayName="AccordionBody"},72208:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),a=r(2265),o=r(91054);let i=e=>{var t=(0,n._T)(e,[]);return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),a.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 s=r(87452),l=r(13241);let c=(0,r(1153).fn)("AccordionHeader"),u=a.forwardRef((e,t)=>{let{children:r,className:u}=e,d=(0,n._T)(e,["children","className"]),{isOpen:h}=(0,a.useContext)(s.r);return a.createElement(o.pJ.Button,Object.assign({ref:t,className:(0,l.q)(c("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",u)},d),a.createElement("div",{className:(0,l.q)(c("children"),"flex flex-1 text-inherit mr-4")},r),a.createElement("div",null,a.createElement(i,{className:(0,l.q)(c("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",h?"transition-all":"transition-all -rotate-180")})))});u.displayName="AccordionHeader"},67982:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(5853),a=r(13241),o=r(1153),i=r(2265);let s=(0,o.fn)("Divider"),l=i.forwardRef((e,t)=>{let{className:r,children:o}=e,l=(0,n._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,a.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",r)},l),o?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,a.q)("text-inherit whitespace-nowrap")},o),i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,a.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});l.displayName="Divider"},44140:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(2265);let a=(e,t)=>{let r=void 0!==t,[a,o]=(0,n.useState)(e);return[r?t:a,e=>{r||o(e)}]}},5945:function(e,t,r){r.d(t,{Z:function(){return M}});var n=r(2265),a=r(36760),o=r.n(a),i=r(18694),s=r(71744),l=r(33759),c=r(50337),u=r(65869),d=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 a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r},h=e=>{var{prefixCls:t,className:r,hoverable:a=!0}=e,i=d(e,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=n.useContext(s.E_),c=l("card",t),u=o()("".concat(c,"-grid"),r,{["".concat(c,"-grid-hoverable")]:a});return n.createElement("div",Object.assign({},i,{className:u}))},m=r(93463),f=r(12918),p=r(99320),b=r(71140);let g=e=>{let{antCls:t,componentCls:r,headerHeight:n,headerPadding:a,tabsMarginBottom:o}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:n,marginBottom:-1,padding:"0 ".concat((0,m.bf)(a)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0")},(0,f.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},f.vS),{["\n > ".concat(r,"-typography,\n > ").concat(r,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:o,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},v=e=>{let{cardPaddingBase:t,colorBorderSecondary:r,cardShadow:n,lineWidth:a}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,m.bf)(a)," 0 0 0 ").concat(r,",\n 0 ").concat((0,m.bf)(a)," 0 0 ").concat(r,",\n ").concat((0,m.bf)(a)," ").concat((0,m.bf)(a)," 0 0 ").concat(r,",\n ").concat((0,m.bf)(a)," 0 0 0 ").concat(r," inset,\n 0 ").concat((0,m.bf)(a)," 0 0 ").concat(r," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:n}}},y=e=>{let{componentCls:t,iconCls:r,actionsLiMargin:n,cardActionsIconSize:a,colorBorderSecondary:o,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(o),display:"flex",borderRadius:"0 0 ".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG))},(0,f.dF)()),{"& > li":{margin:n,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:"color ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(r)]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,m.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(r)]:{fontSize:a,lineHeight:(0,m.bf)(e.calc(a).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(o)}}})},w=e=>Object.assign(Object.assign({margin:"".concat((0,m.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,f.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},f.vS),"&-description":{color:e.colorTextDescription}}),x=e=>{let{componentCls:t,colorFillAlter:r,headerPadding:n,bodyPadding:a}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,m.bf)(n)),background:r,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,m.bf)(e.padding)," ").concat((0,m.bf)(a))}}},E=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},C=e=>{let{componentCls:t,cardShadow:r,cardHeadPadding:n,colorBorderSecondary:a,boxShadowTertiary:o,bodyPadding:i,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},(0,f.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(t,"-bordered)")]:{boxShadow:o},["".concat(t,"-head")]:g(e),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:s,fontWeight:"normal",fontSize:e.fontSize},["".concat(t,"-body")]:{padding:i,borderRadius:"0 0 ".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG))},["".concat(t,"-grid")]:v(e),["".concat(t,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0")}},["".concat(t,"-actions")]:y(e),["".concat(t,"-meta")]:w(e)}),["".concat(t,"-bordered")]:{border:"".concat((0,m.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(t,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(t,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:r}},["".concat(t,"-contain-grid")]:{borderRadius:"".concat((0,m.bf)(e.borderRadiusLG)," ").concat((0,m.bf)(e.borderRadiusLG)," 0 0 "),["".concat(t,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(t,"-loading) ").concat(t,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(t,"-contain-tabs")]:{["> div".concat(t,"-head")]:{minHeight:0,["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:n}}},["".concat(t,"-type-inner")]:x(e),["".concat(t,"-loading")]:E(e),["".concat(t,"-rtl")]:{direction:"rtl"}}},O=e=>{let{componentCls:t,bodyPaddingSM:r,headerPaddingSM:n,headerHeightSM:a,headerFontSizeSM:o}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:a,padding:"0 ".concat((0,m.bf)(n)),fontSize:o,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:r}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var k=(0,p.I$)("Card",e=>{let t=(0,b.IX)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[C(t),O(t)]},e=>{var t,r;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(t=e.bodyPadding)&&void 0!==t?t:e.paddingLG,headerPadding:null!==(r=e.headerPadding)&&void 0!==r?r:e.paddingLG}}),S=r(56250),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 a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};let N=e=>{let{actionClasses:t,actions:r=[],actionStyle:a}=e;return n.createElement("ul",{className:t,style:a},r.map((e,t)=>n.createElement("li",{style:{width:"".concat(100/r.length,"%")},key:"action-".concat(t)},n.createElement("span",null,e))))},T=n.forwardRef((e,t)=>{let r;let{prefixCls:a,className:d,rootClassName:m,style:f,extra:p,headStyle:b={},bodyStyle:g={},title:v,loading:y,bordered:w,variant:x,size:E,type:C,cover:O,actions:T,tabList:q,children:M,activeTabKey:j,defaultActiveTabKey:D,tabBarExtraContent:L,hoverable:R,tabProps:I={},classNames:_,styles:Z}=e,F=P(e,["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:z,card:H}=n.useContext(s.E_),[B]=(0,S.Z)("card",x,w),V=e=>{var t;return o()(null===(t=null==H?void 0:H.classNames)||void 0===t?void 0:t[e],null==_?void 0:_[e])},Q=e=>{var t;return Object.assign(Object.assign({},null===(t=null==H?void 0:H.styles)||void 0===t?void 0:t[e]),null==Z?void 0:Z[e])},G=n.useMemo(()=>{let e=!1;return n.Children.forEach(M,t=>{(null==t?void 0:t.type)===h&&(e=!0)}),e},[M]),K=A("card",a),[W,U,X]=k(K),J=n.createElement(c.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},M),Y=void 0!==j,$=Object.assign(Object.assign({},I),{[Y?"activeKey":"defaultActiveKey"]:Y?j:D,tabBarExtraContent:L}),ee=(0,l.Z)(E),et=ee&&"default"!==ee?ee:"large",er=q?n.createElement(u.default,Object.assign({size:et},$,{className:"".concat(K,"-head-tabs"),onChange:t=>{var r;null===(r=e.onTabChange)||void 0===r||r.call(e,t)},items:q.map(e=>{var{tab:t}=e;return Object.assign({label:t},P(e,["tab"]))})})):null;if(v||p||er){let e=o()("".concat(K,"-head"),V("header")),t=o()("".concat(K,"-head-title"),V("title")),a=o()("".concat(K,"-extra"),V("extra")),i=Object.assign(Object.assign({},b),Q("header"));r=n.createElement("div",{className:e,style:i},n.createElement("div",{className:"".concat(K,"-head-wrapper")},v&&n.createElement("div",{className:t,style:Q("title")},v),p&&n.createElement("div",{className:a,style:Q("extra")},p)),er)}let en=o()("".concat(K,"-cover"),V("cover")),ea=O?n.createElement("div",{className:en,style:Q("cover")},O):null,eo=o()("".concat(K,"-body"),V("body")),ei=Object.assign(Object.assign({},g),Q("body")),es=n.createElement("div",{className:eo,style:ei},y?J:M),el=o()("".concat(K,"-actions"),V("actions")),ec=(null==T?void 0:T.length)?n.createElement(N,{actionClasses:el,actionStyle:Q("actions"),actions:T}):null,eu=(0,i.Z)(F,["onTabChange"]),ed=o()(K,null==H?void 0:H.className,{["".concat(K,"-loading")]:y,["".concat(K,"-bordered")]:"borderless"!==B,["".concat(K,"-hoverable")]:R,["".concat(K,"-contain-grid")]:G,["".concat(K,"-contain-tabs")]:null==q?void 0:q.length,["".concat(K,"-").concat(ee)]:ee,["".concat(K,"-type-").concat(C)]:!!C,["".concat(K,"-rtl")]:"rtl"===z},d,m,U,X),eh=Object.assign(Object.assign({},null==H?void 0:H.style),f);return W(n.createElement("div",Object.assign({ref:t},eu,{className:ed,style:eh}),r,ea,es,ec))});var q=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 a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r};T.Grid=h,T.Meta=e=>{let{prefixCls:t,className:r,avatar:a,title:i,description:l}=e,c=q(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:u}=n.useContext(s.E_),d=u("card",t),h=o()("".concat(d,"-meta"),r),m=a?n.createElement("div",{className:"".concat(d,"-meta-avatar")},a):null,f=i?n.createElement("div",{className:"".concat(d,"-meta-title")},i):null,p=l?n.createElement("div",{className:"".concat(d,"-meta-description")},l):null,b=f||p?n.createElement("div",{className:"".concat(d,"-meta-detail")},f,p):null;return n.createElement("div",Object.assign({},c,{className:h}),m,b)};var M=T},77331:function(e,t,r){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},44633:function(e,t,r){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 15l7-7 7 7"}))});t.Z=a},15731:function(e,t,r){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:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},53410:function(e,t,r){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:"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=a},23628:function(e,t,r){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 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=a},49084:function(e,t,r){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:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});t.Z=a},2894:function(e,t,r){r.d(t,{R:function(){return s},m:function(){return i}});var n=r(18238),a=r(7989),o=r(11255),i=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||s(),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,o.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 o=await this.#n.start();return await this.#r.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,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,e,this.state.context,r),this.#a({type:"success",data:o}),o}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 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(e,t,r){r.d(t,{S:function(){return p}});var n=r(45345),a=r(21733),o=r(18238),i=r(24112),s=class extends i.l{constructor(e={}){super(),this.config=e,this.#o=new Map}#o;build(e,t,r){let o=t.queryKey,i=t.queryHash??(0,n.Rm)(o,t),s=this.get(i);return s||(s=new a.A({client:e,queryKey:o,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(s)),s}add(e){this.#o.has(e.queryHash)||(this.#o.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#o.get(e.queryHash);t&&(e.destroy(),t===e&&this.#o.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){o.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#o.get(e)}getAll(){return[...this.#o.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){o.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){o.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){o.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l=r(2894),c=class extends i.l{constructor(e={}){super(),this.config=e,this.#i=new Set,this.#s=new Map,this.#l=0}#i;#s;#l;build(e,t,r){let n=new l.m({client:e,mutationCache:this,mutationId:++this.#l,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#i.add(e);let t=u(e);if("string"==typeof t){let r=this.#s.get(t);r?r.push(e):this.#s.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#i.delete(e)){let t=u(e);if("string"==typeof t){let r=this.#s.get(t);if(r){if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#s.delete(t)}}}this.notify({type:"removed",mutation:e})}canRun(e){let t=u(e);if("string"!=typeof t)return!0;{let r=this.#s.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=u(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#s.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){o.Vr.batch(()=>{this.#i.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#i.clear(),this.#s.clear()})}getAll(){return Array.from(this.#i)}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){o.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return o.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function u(e){return e.options.scope?.id}var d=r(87045),h=r(57853);function m(e){return{onFetch:(t,r)=>{let a=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],s=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},c=0,u=async()=>{let r=!1,u=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,o)=>{if(r)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let i=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:a,direction:o?"backward":"forward",meta:t.options.meta};return u(e),e})(),s=await d(i),{maxPages:l}=t.options,c=o?n.Ht:n.VX;return{pages:c(e.pages,s,l),pageParams:c(e.pageParams,a,l)}};if(o&&i.length){let e="backward"===o,t={pages:i,pageParams:s},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:f)(a,t);l=await h(t,r,e)}else{let t=e??i.length;do{let e=0===c?s[0]??a.initialPageParam:f(a,l);if(c>0&&null==e)break;l=await h(l,e),c++}while(ct.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function f(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{#c;#r;#u;#d;#h;#m;#f;#p;constructor(e={}){this.#c=e.queryCache||new s,this.#r=e.mutationCache||new c,this.#u=e.defaultOptions||{},this.#d=new Map,this.#h=new Map,this.#m=0}mount(){this.#m++,1===this.#m&&(this.#f=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#c.onFocus())}),this.#p=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#c.onOnline())}))}unmount(){this.#m--,0===this.#m&&(this.#f?.(),this.#f=void 0,this.#p?.(),this.#p=void 0)}isFetching(e){return this.#c.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.#c.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#c.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.#c.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let a=this.defaultQueryOptions({queryKey:e}),o=this.#c.get(a.queryHash),i=o?.state.data,s=(0,n.SE)(t,i);if(void 0!==s)return this.#c.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return o.Vr.batch(()=>this.#c.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#c.get(t.queryHash)?.state}removeQueries(e){let t=this.#c;o.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#c;return o.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(o.Vr.batch(()=>this.#c.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return o.Vr.batch(()=>(this.#c.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(o.Vr.batch(()=>this.#c.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.#c.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=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.N.isOnline()?this.#r.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#c}getMutationCache(){return this.#r}getDefaultOptions(){return this.#u}setDefaultOptions(e){this.#u=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.#u.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.#u.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#c.clear(),this.#r.clear()}}},19616:function(e,t,r){r.d(t,{G:function(){return i}});var n=r(2265);let a={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class o{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...a,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),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(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),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 i(e,t){let[r,a]=(0,n.useState)(e),i=function(e,t){let[r]=(0,n.useState)(()=>{var r;return Object.getOwnPropertyNames(Object.getPrototypeOf(r=new o(e,t))).filter(e=>"function"==typeof r[e]).reduce((e,t)=>{let n=r[t];return"function"==typeof n&&(e[t]=n.bind(r)),e},{})});return r.setOptions(t),r}(a,t);return[r,i.maybeExecute,i]}},91054:function(e,t,r){let n,a;r.d(t,{pJ:function(){return j}});var o,i=r(71049),s=r(11323),l=r(2265),c=r(66797),u=r(93980),d=r(65573),h=r(67561),m=r(98218),f=r(33443),p=r(28294),b=r(31370),g=r(72468),v=r(5664),y=r(38929);let w=null!=(o=l.startTransition)?o:function(e){e()};var x=r(52724),E=((n=E||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),C=((a=C||{})[a.ToggleDisclosure=0]="ToggleDisclosure",a[a.CloseDisclosure=1]="CloseDisclosure",a[a.SetButtonId=2]="SetButtonId",a[a.SetPanelId=3]="SetPanelId",a[a.SetButtonElement=4]="SetButtonElement",a[a.SetPanelElement=5]="SetPanelElement",a);let O={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}},k=(0,l.createContext)(null);function S(e){let t=(0,l.useContext)(k);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,S),t}return t}k.displayName="DisclosureContext";let P=(0,l.createContext)(null);P.displayName="DisclosureAPIContext";let N=(0,l.createContext)(null);function T(e,t){return(0,g.E)(t.type,O,e,t)}N.displayName="DisclosurePanelContext";let q=l.Fragment,M=y.VN.RenderStrategy|y.VN.Static,j=Object.assign((0,y.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,a=(0,l.useRef)(null),o=(0,h.T)(t,(0,h.h)(e=>{a.current=e},void 0===e.as||e.as===l.Fragment)),i=(0,l.useReducer)(T,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:s,buttonId:c},d]=i,m=(0,u.z)(e=>{d({type:1});let t=(0,v.r)(a);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,l.useMemo)(()=>({close:m}),[m]),w=(0,l.useMemo)(()=>({open:0===s,close:m}),[s,m]),x=(0,y.L6)();return l.createElement(k.Provider,{value:i},l.createElement(P.Provider,{value:b},l.createElement(f.Z,{value:m},l.createElement(p.up,{value:(0,g.E)(s,{0:p.ZM.Open,1:p.ZM.Closed})},x({ourProps:{ref:o},theirProps:n,slot:w,defaultTag:q,name:"Disclosure"})))))}),{Button:(0,y.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:a=!1,autoFocus:o=!1,...m}=e,[f,p]=S("Disclosure.Button"),g=(0,l.useContext)(N),v=null!==g&&g===f.panelId,w=(0,l.useRef)(null),E=(0,h.T)(w,t,(0,u.z)(e=>{if(!v)return p({type:4,element:e})}));(0,l.useEffect)(()=>{if(!v)return p({type:2,buttonId:n}),()=>{p({type:2,buttonId:null})}},[n,p,v]);let C=(0,u.z)(e=>{var t;if(v){if(1===f.disclosureState)return;switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),p({type:0}),null==(t=f.buttonElement)||t.focus()}}else switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),p({type:0})}}),O=(0,u.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),k=(0,u.z)(e=>{var t;(0,b.P)(e.currentTarget)||a||(v?(p({type:0}),null==(t=f.buttonElement)||t.focus()):p({type:0}))}),{isFocusVisible:P,focusProps:T}=(0,i.F)({autoFocus:o}),{isHovered:q,hoverProps:M}=(0,s.X)({isDisabled:a}),{pressed:j,pressProps:D}=(0,c.x)({disabled:a}),L=(0,l.useMemo)(()=>({open:0===f.disclosureState,hover:q,active:j,disabled:a,focus:P,autofocus:o}),[f,q,j,P,a,o]),R=(0,d.f)(e,f.buttonElement),I=v?(0,y.dG)({ref:E,type:R,disabled:a||void 0,autoFocus:o,onKeyDown:C,onClick:k},T,M,D):(0,y.dG)({ref:E,id:n,type:R,"aria-expanded":0===f.disclosureState,"aria-controls":f.panelElement?f.panelId:void 0,disabled:a||void 0,autoFocus:o,onKeyDown:C,onKeyUp:O,onClick:k},T,M,D);return(0,y.L6)()({ourProps:I,theirProps:m,slot:L,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,y.yV)(function(e,t){let r=(0,l.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:a=!1,...o}=e,[i,s]=S("Disclosure.Panel"),{close:c}=function e(t){let r=(0,l.useContext)(P);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,l.useState)(null),b=(0,h.T)(t,(0,u.z)(e=>{w(()=>s({type:5,element:e}))}),f);(0,l.useEffect)(()=>(s({type:3,panelId:n}),()=>{s({type:3,panelId:null})}),[n,s]);let g=(0,p.oJ)(),[v,x]=(0,m.Y)(a,d,null!==g?(g&p.ZM.Open)===p.ZM.Open:0===i.disclosureState),E=(0,l.useMemo)(()=>({open:0===i.disclosureState,close:c}),[i.disclosureState,c]),C={ref:b,id:n,...(0,m.X)(x)},O=(0,y.L6)();return l.createElement(p.uu,null,l.createElement(N.Provider,{value:i.panelId},O({ourProps:C,theirProps:o,slot:E,defaultTag:"div",features:M,visible:v,name:"Disclosure.Panel"})))})})},85238:function(e,t,r){let n;r.d(t,{u:function(){return N}});var a=r(2265),o=r(59456),i=r(93980),s=r(25289),l=r(73389),c=r(43507),u=r(180),d=r(67561),h=r(98218),m=r(28294),f=r(95504),p=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:C)!==a.Fragment||1===a.Children.count(e.children)}let v=(0,a.createContext)(null);v.displayName="TransitionContext";var y=((n=y||{}).Visible="visible",n.Hidden="hidden",n);let w=(0,a.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 E(e,t){let r=(0,c.E)(e),n=(0,a.useRef)([]),l=(0,s.t)(),u=(0,o.G)(),d=(0,i.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.l4.Hidden,a=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==a&&((0,p.E)(t,{[b.l4.Unmount](){n.current.splice(a,1)},[b.l4.Hidden](){n.current[a].state="hidden"}}),u.microTask(()=>{var e;!x(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),h=(0,i.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,b.l4.Unmount)}),m=(0,a.useRef)([]),f=(0,a.useRef)(Promise.resolve()),g=(0,a.useRef)({enter:[],leave:[]}),v=(0,i.z)((e,r,n)=>{m.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=>{m.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?f.current=f.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),y=(0,i.z)((e,t,r)=>{Promise.all(g.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=m.current.shift())||e()}).then(()=>r(t))});return(0,a.useMemo)(()=>({children:n,register:h,unregister:d,onStart:v,onStop:y,wait:f,chains:g}),[h,d,n,v,y,g,f])}w.displayName="NestingContext";let C=a.Fragment,O=b.VN.RenderStrategy,k=(0,b.yV)(function(e,t){let{show:r,appear:n=!1,unmount:o=!0,...s}=e,c=(0,a.useRef)(null),h=g(e),f=(0,d.T)(...h?[c,t]:null===t?[]:[t]);(0,u.H)();let p=(0,m.oJ)();if(void 0===r&&null!==p&&(r=(p&m.ZM.Open)===m.ZM.Open),void 0===r)throw Error("A is used but it is missing a `show={true | false}` prop.");let[y,C]=(0,a.useState)(r?"visible":"hidden"),k=E(()=>{r||C("hidden")}),[P,N]=(0,a.useState)(!0),T=(0,a.useRef)([r]);(0,l.e)(()=>{!1!==P&&T.current[T.current.length-1]!==r&&(T.current.push(r),N(!1))},[T,r]);let q=(0,a.useMemo)(()=>({show:r,appear:n,initial:P}),[r,n,P]);(0,l.e)(()=>{r?C("visible"):x(k)||null===c.current||C("hidden")},[r,k]);let M={unmount:o},j=(0,i.z)(()=>{var t;P&&N(!1),null==(t=e.beforeEnter)||t.call(e)}),D=(0,i.z)(()=>{var t;P&&N(!1),null==(t=e.beforeLeave)||t.call(e)}),L=(0,b.L6)();return a.createElement(w.Provider,{value:k},a.createElement(v.Provider,{value:q},L({ourProps:{...M,as:a.Fragment,children:a.createElement(S,{ref:f,...M,...s,beforeEnter:j,beforeLeave:D})},theirProps:{},defaultTag:a.Fragment,features:O,visible:"visible"===y,name:"Transition"})))}),S=(0,b.yV)(function(e,t){var r,n;let{transition:o=!0,beforeEnter:s,afterEnter:c,beforeLeave:y,afterLeave:k,enter:S,enterFrom:P,enterTo:N,entered:T,leave:q,leaveFrom:M,leaveTo:j,...D}=e,[L,R]=(0,a.useState)(null),I=(0,a.useRef)(null),_=g(e),Z=(0,d.T)(..._?[I,t,R]:null===t?[]:[t]),F=null==(r=D.unmount)||r?b.l4.Unmount:b.l4.Hidden,{show:A,appear:z,initial:H}=function(){let e=(0,a.useContext)(v);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[B,V]=(0,a.useState)(A?"visible":"hidden"),Q=function(){let e=(0,a.useContext)(w);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:G,unregister:K}=Q;(0,l.e)(()=>G(I),[G,I]),(0,l.e)(()=>{if(F===b.l4.Hidden&&I.current){if(A&&"visible"!==B){V("visible");return}return(0,p.E)(B,{hidden:()=>K(I),visible:()=>G(I)})}},[B,I,G,K,A,F]);let W=(0,u.H)();(0,l.e)(()=>{if(_&&W&&"visible"===B&&null===I.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[I,B,W,_]);let U=H&&!z,X=z&&A&&H,J=(0,a.useRef)(!1),Y=E(()=>{J.current||(V("hidden"),K(I))},Q),$=(0,i.z)(e=>{J.current=!0,Y.onStart(I,e?"enter":"leave",e=>{"enter"===e?null==s||s():"leave"===e&&(null==y||y())})}),ee=(0,i.z)(e=>{let t=e?"enter":"leave";J.current=!1,Y.onStop(I,t,e=>{"enter"===e?null==c||c():"leave"===e&&(null==k||k())}),"leave"!==t||x(Y)||(V("hidden"),K(I))});(0,a.useEffect)(()=>{_&&o||($(A),ee(A))},[A,_,o]);let et=!(!o||!_||!W||U),[,er]=(0,h.Y)(et,L,A,{start:$,end:ee}),en=(0,b.oA)({ref:Z,className:(null==(n=(0,f.A)(D.className,X&&S,X&&P,er.enter&&S,er.enter&&er.closed&&P,er.enter&&!er.closed&&N,er.leave&&q,er.leave&&!er.closed&&M,er.leave&&er.closed&&j,!er.transition&&A&&T))?void 0:n.trim())||void 0,...(0,h.X)(er)}),ea=0;"visible"===B&&(ea|=m.ZM.Open),"hidden"===B&&(ea|=m.ZM.Closed),er.enter&&(ea|=m.ZM.Opening),er.leave&&(ea|=m.ZM.Closing);let eo=(0,b.L6)();return a.createElement(w.Provider,{value:Y},a.createElement(m.up,{value:ea},eo({ourProps:en,theirProps:D,defaultTag:C,features:O,visible:"visible"===B,name:"Transition.Child"})))}),P=(0,b.yV)(function(e,t){let r=null!==(0,a.useContext)(v),n=null!==(0,m.oJ)();return a.createElement(a.Fragment,null,!r&&n?a.createElement(k,{ref:t,...e}):a.createElement(S,{ref:t,...e}))}),N=Object.assign(k,{Child:P,Root:k})},33443:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(2265);let a=(0,n.createContext)(()=>{});function o(e){let{value:t,children:r}=e;return n.createElement(a.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/1973-26a414084f96c69b.js b/litellm/proxy/_experimental/out/_next/static/chunks/1973-26a414084f96c69b.js deleted file mode 100644 index 8ba0b21bc0..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/1973-26a414084f96c69b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1973],{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}))})},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}))})},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:g,onValueChange:p,onChange:f}=e,h=(0,a._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),v=(0,c.useRef)(null),[b,x]=c.useState(!1),y=c.useCallback(()=>{x(!0)},[]),k=c.useCallback(()=>{x(!1)},[]),[S,w]=c.useState(!1),E=c.useCallback(()=>{w(!0)},[]),C=c.useCallback(()=>{w(!1)},[]);return c.createElement(s.Z,Object.assign({type:"number",ref:(0,i.lq)([v,t]),disabled:g,makeInputClassName:(0,i.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==n||n(parseFloat(null!=e?e:""))}"ArrowDown"===e.key&&y(),"ArrowUp"===e.key&&E()},onKeyUp:e=>{"ArrowDown"===e.key&&k(),"ArrowUp"===e.key&&C()},onChange:e=>{g||(null==p||p(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;g||(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,l.q)(!g&&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:(b?"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;g||(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,l.q)(!g&&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:(S?"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:g,disabled:p=!1,className:f,onChange:h,onValueChange:v,autoHeight:b=!1}=e,x=(0,a._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[y,k]=(0,o.Z)(d,n),S=(0,r.useRef)(null),w=(0,c.Uh)(y);return(0,r.useEffect)(()=>{let e=S.current;if(b&&e){e.style.height="60px";let t=e.scrollHeight;e.style.height=t+"px"}},[b,S,y]),r.createElement(r.Fragment,null,r.createElement("textarea",Object.assign({ref:(0,i.lq)([S,t]),value:y,placeholder:m,disabled:p,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)(w,p,u),p?"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==v||v(e.target.value)}},x)),u&&g?r.createElement("p",{className:(0,l.q)(s("errorMessage"),"text-sm text-red-500 mt-1")},g):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:g}=e,p=(0,a._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=s(n,l._m),h=s(o,l.LH),v=s(d,l.l5),b=s(m,l.N4),x=(0,c.q)(f,h,v,b);return r.createElement("div",Object.assign({ref:t,className:(0,c.q)(i("root"),"grid",x,g)},p),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)}]}},35631:function(e,t,n){n.d(t,{Z:function(){return I}});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),g=n(28617),p=n(40049),f=n(10353);let h=c.createContext({});h.Consumer;var v=n(19722),b=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:g}=e,p=x(e,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:f,itemLayout:y}=(0,c.useContext)(h),{getPrefixCls:k,list:S}=(0,c.useContext)(s.E_),w=e=>{var t,n;return r()(null===(n=null===(t=null==S?void 0:S.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==S?void 0:S.item)||void 0===t?void 0:t.styles)||void 0===n?void 0:n[e]),null==d?void 0:d[e])},C=k("list",a),N=l&&l.length>0&&c.createElement("ul",{className:r()("".concat(C,"-item-action"),w("actions")),key:"actions",style:E("actions")},l.map((e,t)=>c.createElement("li",{key:"".concat(C,"-item-action-").concat(t)},e,t!==l.length-1&&c.createElement("em",{className:"".concat(C,"-item-action-split")})))),z=c.createElement(f?"div":"li",Object.assign({},p,f?{}:{ref:t},{className:r()("".concat(C,"-item"),{["".concat(C,"-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(C,"-item-main"),key:"content"},o,N),c.createElement("div",{className:r()("".concat(C,"-item-extra"),w("extra")),key:"extra",style:E("extra")},i)]:[o,N,(0,v.Tm)(i,{key:"extra"})]);return f?c.createElement(b.Z,{ref:t,flex:1,style:g},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),g=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)&&g)};var k=n(93463),S=n(12918),w=n(99320),E=n(71140);let C=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:g,colorText:p,colorTextDescription:f,motionDurationSlow:h,lineWidth:v,headerBg:b,footerBg:x,emptyTextPadding:y,metaMarginBottom:w,avatarMarginRight:E,titleMarginBottom:C,descriptionFontSize:N}=e;return{[t]:Object.assign(Object.assign({},(0,S.Wf)(e)),{position:"relative","--rc-virtual-list-scrollbar-bg":e.colorSplit,"*":{outline:"none"},["".concat(t,"-header")]:{background:b},["".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:p,["".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:p},["".concat(t,"-item-meta-title")]:{margin:"0 0 ".concat((0,k.bf)(e.marginXXS)," 0"),color:p,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:p,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:v,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:g,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:w,["".concat(t,"-item-meta-title")]:{marginBlockStart:0,marginBlockEnd:C,color:p,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 M=(0,w.I$)("List",e=>{let t=(0,E.IX)(e,{listBorderedCls:"".concat(e.componentCls,"-bordered"),minHeight:e.controlHeightLG});return[z(t),C(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})),O=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 Z=c.forwardRef(function(e,t){let{pagination:n=!1,prefixCls:o,bordered:v=!1,split:b=!0,className:x,rootClassName:y,style:k,children:S,itemLayout:w,loadMore:E,grid:C,dataSource:N=[],size:z,header:Z,footer:I,loading:j=!1,rowKey:H,renderItem:B,locale:L}=e,T=O(e,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]),V=n&&"object"==typeof n?n:{},[R,W]=c.useState(V.defaultCurrent||1),[_,P]=c.useState(V.defaultPageSize||10),{getPrefixCls:D,direction:q,className:A,style:G}=(0,s.dj)("list"),{renderEmpty:U}=c.useContext(s.E_),X=e=>(t,a)=>{var c;W(t),P(a),n&&(null===(c=null==n?void 0:n[e])||void 0===c||c.call(n,t,a))},K=X("onChange"),F=X("onShowSizeChange"),J=!!(E||n||I),Y=D("list",o),[$,Q,ee]=M(Y),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()(Y,{["".concat(Y,"-vertical")]:"vertical"===w,["".concat(Y,"-").concat(ec)]:ec,["".concat(Y,"-split")]:b,["".concat(Y,"-bordered")]:v,["".concat(Y,"-loading")]:en,["".concat(Y,"-grid")]:!!C,["".concat(Y,"-something-after-last-item")]:J,["".concat(Y,"-rtl")]:"rtl"===q},A,x,y,Q,ee),er=(0,l.Z)({current:1,total:0,position:"bottom"},{total:N.length,current:R,pageSize:_},n||{}),el=Math.ceil(er.total/er.pageSize);er.current=Math.min(er.current,el);let ei=n&&c.createElement("div",{className:r()("".concat(Y,"-pagination"))},c.createElement(p.Z,Object.assign({align:"end"},er,{onChange:K,onShowSizeChange:F}))),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(C||{}).some(e=>["xs","sm","md","lg","xl","xxl"].includes(e)),em=(0,g.Z)(ed),eu=c.useMemo(()=>{for(let e=0;e{if(!C)return;let e=eu&&C[eu]?C[eu]:C.column;if(e)return{width:"".concat(100/e,"%"),maxWidth:"".concat(100/e,"%")}},[JSON.stringify(C),eu]),ep=en&&c.createElement("div",{style:{minHeight:53}});if(es.length>0){let e=es.map((e,t)=>{let n;return B?((n="function"==typeof H?H(e):H?e[H]:e.key)||(n="list-item-".concat(t)),c.createElement(c.Fragment,{key:n},B(e,t))):null});ep=C?c.createElement(u.Z,{gutter:C.gutter},c.Children.map(e,e=>c.createElement("div",{key:null==e?void 0:e.key,style:eg},e))):c.createElement("ul",{className:"".concat(Y,"-items")},e)}else S||en||(ep=c.createElement("div",{className:"".concat(Y,"-empty-text")},(null==L?void 0:L.emptyText)||(null==U?void 0:U("List"))||c.createElement(d.Z,{componentName:"List"})));let ef=er.position,eh=c.useMemo(()=>({grid:C,itemLayout:w}),[JSON.stringify(C),w]);return $(c.createElement(h.Provider,{value:eh},c.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},G),k),className:eo},T),("top"===ef||"both"===ef)&&ei,Z&&c.createElement("div",{className:"".concat(Y,"-header")},Z),c.createElement(f.Z,Object.assign({},et),ep,S),I&&c.createElement("div",{className:"".concat(Y,"-footer")},I),E||("bottom"===ef||"both"===ef)&&ei)))});Z.Item=y;var I=Z},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"}]])},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}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2004-294ce010a90069b4.js b/litellm/proxy/_experimental/out/_next/static/chunks/2004-1eb16c345c0044ae.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/2004-294ce010a90069b4.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2004-1eb16c345c0044ae.js index 280fafea37..00fba328e8 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2004-294ce010a90069b4.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2004-1eb16c345c0044ae.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2004],{22004:function(e,l,s){s.d(l,{Z:function(){return ee},g:function(){return X}});var i=s(57437),a=s(2265),r=s(41649),t=s(78489),n=s(12514),o=s(49804),d=s(67101),c=s(47323),m=s(12485),u=s(18135),x=s(35242),h=s(29706),_=s(77991),g=s(21626),j=s(97214),p=s(28241),v=s(58834),Z=s(69552),b=s(71876),f=s(84264),w=s(24199),z=s(4260),y=s(10032),N=s(99981),C=s(22116),S=s(37592),O=s(15424),M=s(23628),k=s(86462),I=s(47686),P=s(53410),A=s(74998),T=s(31283),D=s(46468),F=s(59872),L=s(10900),R=s(49566),U=s(96761),E=s(5545),B=s(30401),V=s(78867),q=s(33860),G=s(95920),W=s(9114),$=s(19250),J=s(98015),Q=s(10901),Y=s(97415),H=e=>{var l,s,o,N,C;let{organizationId:O,onClose:M,accessToken:k,is_org_admin:I,is_proxy_admin:T,userModels:H,editOrg:K}=e,[X,ee]=(0,a.useState)(null),[el,es]=(0,a.useState)(!0),[ei]=y.Z.useForm(),[ea,er]=(0,a.useState)(!1),[et,en]=(0,a.useState)(!1),[eo,ed]=(0,a.useState)(!1),[ec,em]=(0,a.useState)(null),[eu,ex]=(0,a.useState)({}),[eh,e_]=(0,a.useState)(!1),eg=I||T,ej=async()=>{try{if(es(!0),!k)return;let e=await (0,$.organizationInfoCall)(k,O);ee(e)}catch(e){W.Z.fromBackend("Failed to load organization information"),console.error("Error fetching organization info:",e)}finally{es(!1)}};(0,a.useEffect)(()=>{ej()},[O,k]);let ep=async e=>{try{if(null==k)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,$.organizationMemberAddCall)(k,O,l),W.Z.success("Organization member added successfully"),en(!1),ei.resetFields(),ej()}catch(e){W.Z.fromBackend("Failed to add organization member"),console.error("Error adding organization member:",e)}},ev=async e=>{try{if(!k)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,$.organizationMemberUpdateCall)(k,O,l),W.Z.success("Organization member updated successfully"),ed(!1),ei.resetFields(),ej()}catch(e){W.Z.fromBackend("Failed to update organization member"),console.error("Error updating organization member:",e)}},eZ=async e=>{try{if(!k)return;await (0,$.organizationMemberDeleteCall)(k,O,e.user_id),W.Z.success("Organization member deleted successfully"),ed(!1),ei.resetFields(),ej()}catch(e){W.Z.fromBackend("Failed to delete organization member"),console.error("Error deleting organization member:",e)}},eb=async e=>{try{if(!k)return;e_(!0);let l={organization_id:O,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==X?void 0:X.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,$.organizationUpdateCall)(k,l),W.Z.success("Organization settings updated successfully"),er(!1),ej()}catch(e){W.Z.fromBackend("Failed to update organization settings"),console.error("Error updating organization:",e)}finally{e_(!1)}};if(el)return(0,i.jsx)("div",{className:"p-4",children:"Loading..."});if(!X)return(0,i.jsx)("div",{className:"p-4",children:"Organization not found"});let ef=async(e,l)=>{await (0,F.vQ)(e)&&(ex(e=>({...e,[l]:!0})),setTimeout(()=>{ex(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)(t.Z,{icon:L.Z,onClick:M,variant:"light",className:"mb-4",children:"Back to Organizations"}),(0,i.jsx)(U.Z,{children:X.organization_alias}),(0,i.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,i.jsx)(f.Z,{className:"text-gray-500 font-mono",children:X.organization_id}),(0,i.jsx)(E.ZP,{type:"text",size:"small",icon:eu["org-id"]?(0,i.jsx)(B.Z,{size:12}):(0,i.jsx)(V.Z,{size:12}),onClick:()=>ef(X.organization_id,"org-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eu["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)(u.Z,{defaultIndex:K?2:0,children:[(0,i.jsxs)(x.Z,{className:"mb-4",children:[(0,i.jsx)(m.Z,{children:"Overview"}),(0,i.jsx)(m.Z,{children:"Members"}),(0,i.jsx)(m.Z,{children:"Settings"})]}),(0,i.jsxs)(_.Z,{children:[(0,i.jsx)(h.Z,{children:(0,i.jsxs)(d.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Organization Details"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(f.Z,{children:["Created: ",new Date(X.created_at).toLocaleDateString()]}),(0,i.jsxs)(f.Z,{children:["Updated: ",new Date(X.updated_at).toLocaleDateString()]}),(0,i.jsxs)(f.Z,{children:["Created By: ",X.created_by]})]})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Budget Status"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(U.Z,{children:["$",(0,F.pw)(X.spend,4)]}),(0,i.jsxs)(f.Z,{children:["of"," ",null===X.litellm_budget_table.max_budget?"Unlimited":"$".concat((0,F.pw)(X.litellm_budget_table.max_budget,4))]}),X.litellm_budget_table.budget_duration&&(0,i.jsxs)(f.Z,{className:"text-gray-500",children:["Reset: ",X.litellm_budget_table.budget_duration]})]})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Rate Limits"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(f.Z,{children:["TPM: ",X.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,i.jsxs)(f.Z,{children:["RPM: ",X.litellm_budget_table.rpm_limit||"Unlimited"]}),X.litellm_budget_table.max_parallel_requests&&(0,i.jsxs)(f.Z,{children:["Max Parallel Requests: ",X.litellm_budget_table.max_parallel_requests]})]})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Models"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===X.models.length?(0,i.jsx)(r.Z,{color:"red",children:"All proxy models"}):X.models.map((e,l)=>(0,i.jsx)(r.Z,{color:"red",children:e},l))})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Teams"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:null===(l=X.teams)||void 0===l?void 0:l.map((e,l)=>(0,i.jsx)(r.Z,{color:"red",children:e.team_id},l))})]}),(0,i.jsx)(J.Z,{objectPermission:X.object_permission,variant:"card",accessToken:k})]})}),(0,i.jsx)(h.Z,{children:(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsx)(n.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[75vh]",children:(0,i.jsxs)(g.Z,{children:[(0,i.jsx)(v.Z,{children:(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(Z.Z,{children:"User ID"}),(0,i.jsx)(Z.Z,{children:"Role"}),(0,i.jsx)(Z.Z,{children:"Spend"}),(0,i.jsx)(Z.Z,{children:"Created At"}),(0,i.jsx)(Z.Z,{})]})}),(0,i.jsx)(j.Z,{children:null===(s=X.members)||void 0===s?void 0:s.map((e,l)=>(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(p.Z,{children:(0,i.jsx)(f.Z,{className:"font-mono",children:e.user_id})}),(0,i.jsx)(p.Z,{children:(0,i.jsx)(f.Z,{className:"font-mono",children:e.user_role})}),(0,i.jsx)(p.Z,{children:(0,i.jsxs)(f.Z,{children:["$",(0,F.pw)(e.spend,4)]})}),(0,i.jsx)(p.Z,{children:(0,i.jsx)(f.Z,{children:new Date(e.created_at).toLocaleString()})}),(0,i.jsx)(p.Z,{children:eg&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Z,{icon:P.Z,size:"sm",onClick:()=>{em({role:e.user_role,user_email:e.user_email,user_id:e.user_id}),ed(!0)}}),(0,i.jsx)(c.Z,{icon:A.Z,size:"sm",onClick:()=>{eZ(e)}})]})})]},l))})]})}),eg&&(0,i.jsx)(t.Z,{onClick:()=>{en(!0)},children:"Add Member"})]})}),(0,i.jsx)(h.Z,{children:(0,i.jsxs)(n.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)(U.Z,{children:"Organization Settings"}),eg&&!ea&&(0,i.jsx)(t.Z,{onClick:()=>er(!0),children:"Edit Settings"})]}),ea?(0,i.jsxs)(y.Z,{form:ei,onFinish:eb,initialValues:{organization_alias:X.organization_alias,models:X.models,tpm_limit:X.litellm_budget_table.tpm_limit,rpm_limit:X.litellm_budget_table.rpm_limit,max_budget:X.litellm_budget_table.max_budget,budget_duration:X.litellm_budget_table.budget_duration,metadata:X.metadata?JSON.stringify(X.metadata,null,2):"",vector_stores:(null===(o=X.object_permission)||void 0===o?void 0:o.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(N=X.object_permission)||void 0===N?void 0:N.mcp_servers)||[],accessGroups:(null===(C=X.object_permission)||void 0===C?void 0:C.mcp_access_groups)||[]}},layout:"vertical",children:[(0,i.jsx)(y.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,i.jsx)(R.Z,{})}),(0,i.jsx)(y.Z.Item,{label:"Models",name:"models",children:(0,i.jsxs)(S.default,{mode:"multiple",placeholder:"Select models",children:[(0,i.jsx)(S.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),H.map(e=>(0,i.jsx)(S.default.Option,{value:e,children:(0,D.W0)(e)},e))]})}),(0,i.jsx)(y.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,i.jsx)(w.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,i.jsx)(y.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,i.jsxs)(S.default,{placeholder:"n/a",children:[(0,i.jsx)(S.default.Option,{value:"24h",children:"daily"}),(0,i.jsx)(S.default.Option,{value:"7d",children:"weekly"}),(0,i.jsx)(S.default.Option,{value:"30d",children:"monthly"})]})}),(0,i.jsx)(y.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,i.jsx)(w.Z,{step:1,style:{width:"100%"}})}),(0,i.jsx)(y.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,i.jsx)(w.Z,{step:1,style:{width:"100%"}})}),(0,i.jsx)(y.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,i.jsx)(Y.Z,{onChange:e=>ei.setFieldValue("vector_stores",e),value:ei.getFieldValue("vector_stores"),accessToken:k||"",placeholder:"Select vector stores"})}),(0,i.jsx)(y.Z.Item,{label:"MCP Servers & Access Groups",name:"mcp_servers_and_groups",children:(0,i.jsx)(G.Z,{onChange:e=>ei.setFieldValue("mcp_servers_and_groups",e),value:ei.getFieldValue("mcp_servers_and_groups"),accessToken:k||"",placeholder:"Select MCP servers and access groups"})}),(0,i.jsx)(y.Z.Item,{label:"Metadata",name:"metadata",children:(0,i.jsx)(z.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)(t.Z,{variant:"secondary",onClick:()=>er(!1),disabled:eh,children:"Cancel"}),(0,i.jsx)(t.Z,{type:"submit",loading:eh,children:"Save Changes"})]})})]}):(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Organization Name"}),(0,i.jsx)("div",{children:X.organization_alias})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Organization ID"}),(0,i.jsx)("div",{className:"font-mono",children:X.organization_id})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Created At"}),(0,i.jsx)("div",{children:new Date(X.created_at).toLocaleString()})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Models"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:X.models.map((e,l)=>(0,i.jsx)(r.Z,{color:"red",children:e},l))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Rate Limits"}),(0,i.jsxs)("div",{children:["TPM: ",X.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,i.jsxs)("div",{children:["RPM: ",X.litellm_budget_table.rpm_limit||"Unlimited"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Budget"}),(0,i.jsxs)("div",{children:["Max:"," ",null!==X.litellm_budget_table.max_budget?"$".concat((0,F.pw)(X.litellm_budget_table.max_budget,4)):"No Limit"]}),(0,i.jsxs)("div",{children:["Reset: ",X.litellm_budget_table.budget_duration||"Never"]})]}),(0,i.jsx)(J.Z,{objectPermission:X.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:k})]})]})})]})]}),(0,i.jsx)(q.Z,{isVisible:et,onCancel:()=>en(!1),onSubmit:ep,accessToken:k,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)(Q.Z,{visible:eo,onCancel:()=>ed(!1),onSubmit:ev,initialData:ec,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"}]}})]})},K=s(21609);let X=async(e,l)=>{l(await (0,$.organizationListCall)(e))};var ee=e=>{let{organizations:l,userRole:s,userModels:L,accessToken:R,lastRefreshed:U,handleRefreshClick:E,currentOrg:B,guardrailsList:V=[],setOrganizations:q,premiumUser:J}=e,[Q,ee]=(0,a.useState)(null),[el,es]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(!1),[er,et]=(0,a.useState)(null),[en,eo]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em]=y.Z.useForm(),[eu,ex]=(0,a.useState)({});(0,a.useEffect)(()=>{R&&X(R,q)},[R]);let eh=e=>{e&&(et(e),ea(!0))},e_=async()=>{if(er&&R)try{eo(!0),await (0,$.organizationDeleteCall)(R,er),W.Z.success("Organization deleted successfully"),ea(!1),et(null),await X(R,q)}catch(e){console.error("Error deleting organization:",e)}finally{eo(!1)}},eg=async e=>{try{var l,s,i,a;if(!R)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,$.organizationCreateCall)(R,e),W.Z.success("Organization created successfully"),ec(!1),em.resetFields(),X(R,q)}catch(e){console.error("Error creating organization:",e)}};return J?(0,i.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[(0,i.jsx)(d.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,i.jsxs)(o.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"===s||"Org Admin"===s)&&(0,i.jsx)(t.Z,{className:"w-fit",onClick:()=>ec(!0),children:"+ Create New Organization"}),Q?(0,i.jsx)(H,{organizationId:Q,onClose:()=>{ee(null),es(!1)},accessToken:R,is_org_admin:!0,is_proxy_admin:"Admin"===s,userModels:L,editOrg:el}):(0,i.jsxs)(u.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,i.jsxs)(x.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,i.jsx)("div",{className:"flex",children:(0,i.jsx)(m.Z,{children:"Your Organizations"})}),(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[U&&(0,i.jsxs)(f.Z,{children:["Last Refreshed: ",U]}),(0,i.jsx)(c.Z,{icon:M.Z,variant:"shadow",size:"xs",className:"self-center",onClick:E})]})]}),(0,i.jsx)(_.Z,{children:(0,i.jsxs)(h.Z,{children:[(0,i.jsx)(f.Z,{children:"Click on “Organization ID” to view organization details."}),(0,i.jsx)(d.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,i.jsx)(o.Z,{numColSpan:1,children:(0,i.jsx)(n.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,i.jsxs)(g.Z,{children:[(0,i.jsx)(v.Z,{children:(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(Z.Z,{children:"Organization ID"}),(0,i.jsx)(Z.Z,{children:"Organization Name"}),(0,i.jsx)(Z.Z,{children:"Created"}),(0,i.jsx)(Z.Z,{children:"Spend (USD)"}),(0,i.jsx)(Z.Z,{children:"Budget (USD)"}),(0,i.jsx)(Z.Z,{children:"Models"}),(0,i.jsx)(Z.Z,{children:"TPM / RPM Limits"}),(0,i.jsx)(Z.Z,{children:"Info"}),(0,i.jsx)(Z.Z,{children:"Actions"})]})}),(0,i.jsx)(j.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,n,o,d,m,u,x,h;return(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(p.Z,{children:(0,i.jsx)("div",{className:"overflow-hidden",children:(0,i.jsx)(N.Z,{title:e.organization_id,children:(0,i.jsxs)(t.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:()=>ee(e.organization_id),children:[null===(l=e.organization_id)||void 0===l?void 0:l.slice(0,7),"..."]})})})}),(0,i.jsx)(p.Z,{children:e.organization_alias}),(0,i.jsx)(p.Z,{children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,i.jsx)(p.Z,{children:(0,F.pw)(e.spend,4)}),(0,i.jsx)(p.Z,{children:(null===(a=e.litellm_budget_table)||void 0===a?void 0:a.max_budget)!==null&&(null===(n=e.litellm_budget_table)||void 0===n?void 0:n.max_budget)!==void 0?null===(o=e.litellm_budget_table)||void 0===o?void 0:o.max_budget:"No limit"}),(0,i.jsx)(p.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)(r.Z,{size:"xs",className:"mb-1",color:"red",children:(0,i.jsx)(f.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)(c.Z,{icon:eu[e.organization_id||""]?k.Z:I.Z,className:"cursor-pointer",size:"xs",onClick:()=>{ex(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)(r.Z,{size:"xs",color:"red",children:(0,i.jsx)(f.Z,{children:"All Proxy Models"})},l):(0,i.jsx)(r.Z,{size:"xs",color:"blue",children:(0,i.jsx)(f.Z,{children:e.length>30?"".concat((0,D.W0)(e).slice(0,30),"..."):(0,D.W0)(e)})},l)),e.models.length>3&&!eu[e.organization_id||""]&&(0,i.jsx)(r.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,i.jsxs)(f.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),eu[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)(r.Z,{size:"xs",color:"red",children:(0,i.jsx)(f.Z,{children:"All Proxy Models"})},l+3):(0,i.jsx)(r.Z,{size:"xs",color:"blue",children:(0,i.jsx)(f.Z,{children:e.length>30?"".concat((0,D.W0)(e).slice(0,30),"..."):(0,D.W0)(e)})},l+3))})]})]})})}):null})}),(0,i.jsx)(p.Z,{children:(0,i.jsxs)(f.Z,{children:["TPM:"," ",(null===(d=e.litellm_budget_table)||void 0===d?void 0:d.tpm_limit)?null===(m=e.litellm_budget_table)||void 0===m?void 0:m.tpm_limit:"Unlimited",(0,i.jsx)("br",{}),"RPM:"," ",(null===(u=e.litellm_budget_table)||void 0===u?void 0:u.rpm_limit)?null===(x=e.litellm_budget_table)||void 0===x?void 0:x.rpm_limit:"Unlimited"]})}),(0,i.jsx)(p.Z,{children:(0,i.jsxs)(f.Z,{children:[(null===(h=e.members)||void 0===h?void 0:h.length)||0," Members"]})}),(0,i.jsx)(p.Z,{children:"Admin"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(N.Z,{title:"Edit organization",children:[" ",(0,i.jsx)(c.Z,{icon:P.Z,size:"sm",className:"cursor-pointer hover:text-blue-600",onClick:()=>{ee(e.organization_id),es(!0)}})]}),(0,i.jsxs)(N.Z,{title:"Delete organization",children:[" ",(0,i.jsx)(c.Z,{onClick:()=>eh(e.organization_id),icon:A.Z,size:"sm",className:"cursor-pointer hover:text-red-600"})]})]})})]},e.organization_id)}):null})]})})})})]})})]})]})}),(0,i.jsx)(C.Z,{title:"Create Organization",visible:ed,width:800,footer:null,onCancel:()=>{ec(!1),em.resetFields()},children:(0,i.jsxs)(y.Z,{form:em,onFinish:eg,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,i.jsx)(y.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,i.jsx)(T.o,{placeholder:""})}),(0,i.jsx)(y.Z.Item,{label:"Models",name:"models",children:(0,i.jsxs)(S.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,i.jsx)(S.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),L&&L.length>0&&L.map(e=>(0,i.jsx)(S.default.Option,{value:e,children:(0,D.W0)(e)},e))]})}),(0,i.jsx)(y.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,i.jsx)(w.Z,{step:.01,precision:2,width:200})}),(0,i.jsx)(y.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,i.jsxs)(S.default,{defaultValue:null,placeholder:"n/a",children:[(0,i.jsx)(S.default.Option,{value:"24h",children:"daily"}),(0,i.jsx)(S.default.Option,{value:"7d",children:"weekly"}),(0,i.jsx)(S.default.Option,{value:"30d",children:"monthly"})]})}),(0,i.jsx)(y.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,i.jsx)(w.Z,{step:1,width:400})}),(0,i.jsx)(y.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,i.jsx)(w.Z,{step:1,width:400})}),(0,i.jsx)(y.Z.Item,{label:(0,i.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,i.jsx)(N.Z,{title:"Select which vector stores this organization can access by default. Leave empty for access to all vector stores",children:(0,i.jsx)(O.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)(Y.Z,{onChange:e=>em.setFieldValue("allowed_vector_store_ids",e),value:em.getFieldValue("allowed_vector_store_ids"),accessToken:R||"",placeholder:"Select vector stores (optional)"})}),(0,i.jsx)(y.Z.Item,{label:(0,i.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,i.jsx)(N.Z,{title:"Select which MCP servers and access groups this organization can access by default.",children:(0,i.jsx)(O.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)(G.Z,{onChange:e=>em.setFieldValue("allowed_mcp_servers_and_groups",e),value:em.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:R||"",placeholder:"Select MCP servers and access groups (optional)"})}),(0,i.jsx)(y.Z.Item,{label:"Metadata",name:"metadata",children:(0,i.jsx)(z.default.TextArea,{rows:4})}),(0,i.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,i.jsx)(t.Z,{type:"submit",children:"Create Organization"})})]})}),(0,i.jsx)(K.Z,{isOpen:ei,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:er,code:!0}],onCancel:()=>{ea(!1),et(null)},onOk:e_,confirmLoading:en})]}):(0,i.jsx)("div",{children:(0,i.jsxs)(f.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"}),"."]})})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2004],{22004:function(e,l,s){s.d(l,{Z:function(){return ee},g:function(){return X}});var i=s(57437),a=s(2265),r=s(41649),t=s(78489),n=s(12514),o=s(49804),d=s(67101),c=s(47323),m=s(12485),u=s(18135),x=s(35242),h=s(29706),_=s(77991),g=s(21626),j=s(97214),p=s(28241),v=s(58834),Z=s(69552),b=s(71876),f=s(84264),w=s(24199),z=s(4260),y=s(10032),N=s(99981),C=s(22116),S=s(37592),O=s(15424),M=s(23628),k=s(86462),I=s(47686),P=s(53410),A=s(74998),T=s(31283),D=s(46468),F=s(59872),L=s(77331),R=s(49566),U=s(96761),E=s(5545),B=s(30401),V=s(78867),q=s(33860),G=s(95920),W=s(9114),$=s(19250),J=s(60131),Q=s(10901),Y=s(97415),H=e=>{var l,s,o,N,C;let{organizationId:O,onClose:M,accessToken:k,is_org_admin:I,is_proxy_admin:T,userModels:H,editOrg:K}=e,[X,ee]=(0,a.useState)(null),[el,es]=(0,a.useState)(!0),[ei]=y.Z.useForm(),[ea,er]=(0,a.useState)(!1),[et,en]=(0,a.useState)(!1),[eo,ed]=(0,a.useState)(!1),[ec,em]=(0,a.useState)(null),[eu,ex]=(0,a.useState)({}),[eh,e_]=(0,a.useState)(!1),eg=I||T,ej=async()=>{try{if(es(!0),!k)return;let e=await (0,$.organizationInfoCall)(k,O);ee(e)}catch(e){W.Z.fromBackend("Failed to load organization information"),console.error("Error fetching organization info:",e)}finally{es(!1)}};(0,a.useEffect)(()=>{ej()},[O,k]);let ep=async e=>{try{if(null==k)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,$.organizationMemberAddCall)(k,O,l),W.Z.success("Organization member added successfully"),en(!1),ei.resetFields(),ej()}catch(e){W.Z.fromBackend("Failed to add organization member"),console.error("Error adding organization member:",e)}},ev=async e=>{try{if(!k)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,$.organizationMemberUpdateCall)(k,O,l),W.Z.success("Organization member updated successfully"),ed(!1),ei.resetFields(),ej()}catch(e){W.Z.fromBackend("Failed to update organization member"),console.error("Error updating organization member:",e)}},eZ=async e=>{try{if(!k)return;await (0,$.organizationMemberDeleteCall)(k,O,e.user_id),W.Z.success("Organization member deleted successfully"),ed(!1),ei.resetFields(),ej()}catch(e){W.Z.fromBackend("Failed to delete organization member"),console.error("Error deleting organization member:",e)}},eb=async e=>{try{if(!k)return;e_(!0);let l={organization_id:O,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==X?void 0:X.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,$.organizationUpdateCall)(k,l),W.Z.success("Organization settings updated successfully"),er(!1),ej()}catch(e){W.Z.fromBackend("Failed to update organization settings"),console.error("Error updating organization:",e)}finally{e_(!1)}};if(el)return(0,i.jsx)("div",{className:"p-4",children:"Loading..."});if(!X)return(0,i.jsx)("div",{className:"p-4",children:"Organization not found"});let ef=async(e,l)=>{await (0,F.vQ)(e)&&(ex(e=>({...e,[l]:!0})),setTimeout(()=>{ex(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)(t.Z,{icon:L.Z,onClick:M,variant:"light",className:"mb-4",children:"Back to Organizations"}),(0,i.jsx)(U.Z,{children:X.organization_alias}),(0,i.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,i.jsx)(f.Z,{className:"text-gray-500 font-mono",children:X.organization_id}),(0,i.jsx)(E.ZP,{type:"text",size:"small",icon:eu["org-id"]?(0,i.jsx)(B.Z,{size:12}):(0,i.jsx)(V.Z,{size:12}),onClick:()=>ef(X.organization_id,"org-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eu["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)(u.Z,{defaultIndex:K?2:0,children:[(0,i.jsxs)(x.Z,{className:"mb-4",children:[(0,i.jsx)(m.Z,{children:"Overview"}),(0,i.jsx)(m.Z,{children:"Members"}),(0,i.jsx)(m.Z,{children:"Settings"})]}),(0,i.jsxs)(_.Z,{children:[(0,i.jsx)(h.Z,{children:(0,i.jsxs)(d.Z,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Organization Details"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(f.Z,{children:["Created: ",new Date(X.created_at).toLocaleDateString()]}),(0,i.jsxs)(f.Z,{children:["Updated: ",new Date(X.updated_at).toLocaleDateString()]}),(0,i.jsxs)(f.Z,{children:["Created By: ",X.created_by]})]})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Budget Status"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(U.Z,{children:["$",(0,F.pw)(X.spend,4)]}),(0,i.jsxs)(f.Z,{children:["of"," ",null===X.litellm_budget_table.max_budget?"Unlimited":"$".concat((0,F.pw)(X.litellm_budget_table.max_budget,4))]}),X.litellm_budget_table.budget_duration&&(0,i.jsxs)(f.Z,{className:"text-gray-500",children:["Reset: ",X.litellm_budget_table.budget_duration]})]})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Rate Limits"}),(0,i.jsxs)("div",{className:"mt-2",children:[(0,i.jsxs)(f.Z,{children:["TPM: ",X.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,i.jsxs)(f.Z,{children:["RPM: ",X.litellm_budget_table.rpm_limit||"Unlimited"]}),X.litellm_budget_table.max_parallel_requests&&(0,i.jsxs)(f.Z,{children:["Max Parallel Requests: ",X.litellm_budget_table.max_parallel_requests]})]})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Models"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===X.models.length?(0,i.jsx)(r.Z,{color:"red",children:"All proxy models"}):X.models.map((e,l)=>(0,i.jsx)(r.Z,{color:"red",children:e},l))})]}),(0,i.jsxs)(n.Z,{children:[(0,i.jsx)(f.Z,{children:"Teams"}),(0,i.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:null===(l=X.teams)||void 0===l?void 0:l.map((e,l)=>(0,i.jsx)(r.Z,{color:"red",children:e.team_id},l))})]}),(0,i.jsx)(J.Z,{objectPermission:X.object_permission,variant:"card",accessToken:k})]})}),(0,i.jsx)(h.Z,{children:(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsx)(n.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[75vh]",children:(0,i.jsxs)(g.Z,{children:[(0,i.jsx)(v.Z,{children:(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(Z.Z,{children:"User ID"}),(0,i.jsx)(Z.Z,{children:"Role"}),(0,i.jsx)(Z.Z,{children:"Spend"}),(0,i.jsx)(Z.Z,{children:"Created At"}),(0,i.jsx)(Z.Z,{})]})}),(0,i.jsx)(j.Z,{children:null===(s=X.members)||void 0===s?void 0:s.map((e,l)=>(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(p.Z,{children:(0,i.jsx)(f.Z,{className:"font-mono",children:e.user_id})}),(0,i.jsx)(p.Z,{children:(0,i.jsx)(f.Z,{className:"font-mono",children:e.user_role})}),(0,i.jsx)(p.Z,{children:(0,i.jsxs)(f.Z,{children:["$",(0,F.pw)(e.spend,4)]})}),(0,i.jsx)(p.Z,{children:(0,i.jsx)(f.Z,{children:new Date(e.created_at).toLocaleString()})}),(0,i.jsx)(p.Z,{children:eg&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Z,{icon:P.Z,size:"sm",onClick:()=>{em({role:e.user_role,user_email:e.user_email,user_id:e.user_id}),ed(!0)}}),(0,i.jsx)(c.Z,{icon:A.Z,size:"sm",onClick:()=>{eZ(e)}})]})})]},l))})]})}),eg&&(0,i.jsx)(t.Z,{onClick:()=>{en(!0)},children:"Add Member"})]})}),(0,i.jsx)(h.Z,{children:(0,i.jsxs)(n.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)(U.Z,{children:"Organization Settings"}),eg&&!ea&&(0,i.jsx)(t.Z,{onClick:()=>er(!0),children:"Edit Settings"})]}),ea?(0,i.jsxs)(y.Z,{form:ei,onFinish:eb,initialValues:{organization_alias:X.organization_alias,models:X.models,tpm_limit:X.litellm_budget_table.tpm_limit,rpm_limit:X.litellm_budget_table.rpm_limit,max_budget:X.litellm_budget_table.max_budget,budget_duration:X.litellm_budget_table.budget_duration,metadata:X.metadata?JSON.stringify(X.metadata,null,2):"",vector_stores:(null===(o=X.object_permission)||void 0===o?void 0:o.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(N=X.object_permission)||void 0===N?void 0:N.mcp_servers)||[],accessGroups:(null===(C=X.object_permission)||void 0===C?void 0:C.mcp_access_groups)||[]}},layout:"vertical",children:[(0,i.jsx)(y.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,i.jsx)(R.Z,{})}),(0,i.jsx)(y.Z.Item,{label:"Models",name:"models",children:(0,i.jsxs)(S.default,{mode:"multiple",placeholder:"Select models",children:[(0,i.jsx)(S.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),H.map(e=>(0,i.jsx)(S.default.Option,{value:e,children:(0,D.W0)(e)},e))]})}),(0,i.jsx)(y.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,i.jsx)(w.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,i.jsx)(y.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,i.jsxs)(S.default,{placeholder:"n/a",children:[(0,i.jsx)(S.default.Option,{value:"24h",children:"daily"}),(0,i.jsx)(S.default.Option,{value:"7d",children:"weekly"}),(0,i.jsx)(S.default.Option,{value:"30d",children:"monthly"})]})}),(0,i.jsx)(y.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,i.jsx)(w.Z,{step:1,style:{width:"100%"}})}),(0,i.jsx)(y.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,i.jsx)(w.Z,{step:1,style:{width:"100%"}})}),(0,i.jsx)(y.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,i.jsx)(Y.Z,{onChange:e=>ei.setFieldValue("vector_stores",e),value:ei.getFieldValue("vector_stores"),accessToken:k||"",placeholder:"Select vector stores"})}),(0,i.jsx)(y.Z.Item,{label:"MCP Servers & Access Groups",name:"mcp_servers_and_groups",children:(0,i.jsx)(G.Z,{onChange:e=>ei.setFieldValue("mcp_servers_and_groups",e),value:ei.getFieldValue("mcp_servers_and_groups"),accessToken:k||"",placeholder:"Select MCP servers and access groups"})}),(0,i.jsx)(y.Z.Item,{label:"Metadata",name:"metadata",children:(0,i.jsx)(z.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)(t.Z,{variant:"secondary",onClick:()=>er(!1),disabled:eh,children:"Cancel"}),(0,i.jsx)(t.Z,{type:"submit",loading:eh,children:"Save Changes"})]})})]}):(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Organization Name"}),(0,i.jsx)("div",{children:X.organization_alias})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Organization ID"}),(0,i.jsx)("div",{className:"font-mono",children:X.organization_id})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Created At"}),(0,i.jsx)("div",{children:new Date(X.created_at).toLocaleString()})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Models"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:X.models.map((e,l)=>(0,i.jsx)(r.Z,{color:"red",children:e},l))})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Rate Limits"}),(0,i.jsxs)("div",{children:["TPM: ",X.litellm_budget_table.tpm_limit||"Unlimited"]}),(0,i.jsxs)("div",{children:["RPM: ",X.litellm_budget_table.rpm_limit||"Unlimited"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)(f.Z,{className:"font-medium",children:"Budget"}),(0,i.jsxs)("div",{children:["Max:"," ",null!==X.litellm_budget_table.max_budget?"$".concat((0,F.pw)(X.litellm_budget_table.max_budget,4)):"No Limit"]}),(0,i.jsxs)("div",{children:["Reset: ",X.litellm_budget_table.budget_duration||"Never"]})]}),(0,i.jsx)(J.Z,{objectPermission:X.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:k})]})]})})]})]}),(0,i.jsx)(q.Z,{isVisible:et,onCancel:()=>en(!1),onSubmit:ep,accessToken:k,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)(Q.Z,{visible:eo,onCancel:()=>ed(!1),onSubmit:ev,initialData:ec,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"}]}})]})},K=s(21609);let X=async(e,l)=>{l(await (0,$.organizationListCall)(e))};var ee=e=>{let{organizations:l,userRole:s,userModels:L,accessToken:R,lastRefreshed:U,handleRefreshClick:E,currentOrg:B,guardrailsList:V=[],setOrganizations:q,premiumUser:J}=e,[Q,ee]=(0,a.useState)(null),[el,es]=(0,a.useState)(!1),[ei,ea]=(0,a.useState)(!1),[er,et]=(0,a.useState)(null),[en,eo]=(0,a.useState)(!1),[ed,ec]=(0,a.useState)(!1),[em]=y.Z.useForm(),[eu,ex]=(0,a.useState)({});(0,a.useEffect)(()=>{R&&X(R,q)},[R]);let eh=e=>{e&&(et(e),ea(!0))},e_=async()=>{if(er&&R)try{eo(!0),await (0,$.organizationDeleteCall)(R,er),W.Z.success("Organization deleted successfully"),ea(!1),et(null),await X(R,q)}catch(e){console.error("Error deleting organization:",e)}finally{eo(!1)}},eg=async e=>{try{var l,s,i,a;if(!R)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,$.organizationCreateCall)(R,e),W.Z.success("Organization created successfully"),ec(!1),em.resetFields(),X(R,q)}catch(e){console.error("Error creating organization:",e)}};return J?(0,i.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[(0,i.jsx)(d.Z,{numItems:1,className:"gap-2 p-8 w-full mt-2",children:(0,i.jsxs)(o.Z,{numColSpan:1,className:"flex flex-col gap-2",children:[("Admin"===s||"Org Admin"===s)&&(0,i.jsx)(t.Z,{className:"w-fit",onClick:()=>ec(!0),children:"+ Create New Organization"}),Q?(0,i.jsx)(H,{organizationId:Q,onClose:()=>{ee(null),es(!1)},accessToken:R,is_org_admin:!0,is_proxy_admin:"Admin"===s,userModels:L,editOrg:el}):(0,i.jsxs)(u.Z,{className:"gap-2 h-[75vh] w-full",children:[(0,i.jsxs)(x.Z,{className:"flex justify-between mt-2 w-full items-center",children:[(0,i.jsx)("div",{className:"flex",children:(0,i.jsx)(m.Z,{children:"Your Organizations"})}),(0,i.jsxs)("div",{className:"flex items-center space-x-2",children:[U&&(0,i.jsxs)(f.Z,{children:["Last Refreshed: ",U]}),(0,i.jsx)(c.Z,{icon:M.Z,variant:"shadow",size:"xs",className:"self-center",onClick:E})]})]}),(0,i.jsx)(_.Z,{children:(0,i.jsxs)(h.Z,{children:[(0,i.jsx)(f.Z,{children:"Click on “Organization ID” to view organization details."}),(0,i.jsx)(d.Z,{numItems:1,className:"gap-2 pt-2 pb-2 h-[75vh] w-full mt-2",children:(0,i.jsx)(o.Z,{numColSpan:1,children:(0,i.jsx)(n.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh]",children:(0,i.jsxs)(g.Z,{children:[(0,i.jsx)(v.Z,{children:(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(Z.Z,{children:"Organization ID"}),(0,i.jsx)(Z.Z,{children:"Organization Name"}),(0,i.jsx)(Z.Z,{children:"Created"}),(0,i.jsx)(Z.Z,{children:"Spend (USD)"}),(0,i.jsx)(Z.Z,{children:"Budget (USD)"}),(0,i.jsx)(Z.Z,{children:"Models"}),(0,i.jsx)(Z.Z,{children:"TPM / RPM Limits"}),(0,i.jsx)(Z.Z,{children:"Info"}),(0,i.jsx)(Z.Z,{children:"Actions"})]})}),(0,i.jsx)(j.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,n,o,d,m,u,x,h;return(0,i.jsxs)(b.Z,{children:[(0,i.jsx)(p.Z,{children:(0,i.jsx)("div",{className:"overflow-hidden",children:(0,i.jsx)(N.Z,{title:e.organization_id,children:(0,i.jsxs)(t.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:()=>ee(e.organization_id),children:[null===(l=e.organization_id)||void 0===l?void 0:l.slice(0,7),"..."]})})})}),(0,i.jsx)(p.Z,{children:e.organization_alias}),(0,i.jsx)(p.Z,{children:e.created_at?new Date(e.created_at).toLocaleDateString():"N/A"}),(0,i.jsx)(p.Z,{children:(0,F.pw)(e.spend,4)}),(0,i.jsx)(p.Z,{children:(null===(a=e.litellm_budget_table)||void 0===a?void 0:a.max_budget)!==null&&(null===(n=e.litellm_budget_table)||void 0===n?void 0:n.max_budget)!==void 0?null===(o=e.litellm_budget_table)||void 0===o?void 0:o.max_budget:"No limit"}),(0,i.jsx)(p.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)(r.Z,{size:"xs",className:"mb-1",color:"red",children:(0,i.jsx)(f.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)(c.Z,{icon:eu[e.organization_id||""]?k.Z:I.Z,className:"cursor-pointer",size:"xs",onClick:()=>{ex(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)(r.Z,{size:"xs",color:"red",children:(0,i.jsx)(f.Z,{children:"All Proxy Models"})},l):(0,i.jsx)(r.Z,{size:"xs",color:"blue",children:(0,i.jsx)(f.Z,{children:e.length>30?"".concat((0,D.W0)(e).slice(0,30),"..."):(0,D.W0)(e)})},l)),e.models.length>3&&!eu[e.organization_id||""]&&(0,i.jsx)(r.Z,{size:"xs",color:"gray",className:"cursor-pointer",children:(0,i.jsxs)(f.Z,{children:["+",e.models.length-3," ",e.models.length-3==1?"more model":"more models"]})}),eu[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)(r.Z,{size:"xs",color:"red",children:(0,i.jsx)(f.Z,{children:"All Proxy Models"})},l+3):(0,i.jsx)(r.Z,{size:"xs",color:"blue",children:(0,i.jsx)(f.Z,{children:e.length>30?"".concat((0,D.W0)(e).slice(0,30),"..."):(0,D.W0)(e)})},l+3))})]})]})})}):null})}),(0,i.jsx)(p.Z,{children:(0,i.jsxs)(f.Z,{children:["TPM:"," ",(null===(d=e.litellm_budget_table)||void 0===d?void 0:d.tpm_limit)?null===(m=e.litellm_budget_table)||void 0===m?void 0:m.tpm_limit:"Unlimited",(0,i.jsx)("br",{}),"RPM:"," ",(null===(u=e.litellm_budget_table)||void 0===u?void 0:u.rpm_limit)?null===(x=e.litellm_budget_table)||void 0===x?void 0:x.rpm_limit:"Unlimited"]})}),(0,i.jsx)(p.Z,{children:(0,i.jsxs)(f.Z,{children:[(null===(h=e.members)||void 0===h?void 0:h.length)||0," Members"]})}),(0,i.jsx)(p.Z,{children:"Admin"===s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(N.Z,{title:"Edit organization",children:[" ",(0,i.jsx)(c.Z,{icon:P.Z,size:"sm",className:"cursor-pointer hover:text-blue-600",onClick:()=>{ee(e.organization_id),es(!0)}})]}),(0,i.jsxs)(N.Z,{title:"Delete organization",children:[" ",(0,i.jsx)(c.Z,{onClick:()=>eh(e.organization_id),icon:A.Z,size:"sm",className:"cursor-pointer hover:text-red-600"})]})]})})]},e.organization_id)}):null})]})})})})]})})]})]})}),(0,i.jsx)(C.Z,{title:"Create Organization",visible:ed,width:800,footer:null,onCancel:()=>{ec(!1),em.resetFields()},children:(0,i.jsxs)(y.Z,{form:em,onFinish:eg,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[(0,i.jsx)(y.Z.Item,{label:"Organization Name",name:"organization_alias",rules:[{required:!0,message:"Please input an organization name"}],children:(0,i.jsx)(T.o,{placeholder:""})}),(0,i.jsx)(y.Z.Item,{label:"Models",name:"models",children:(0,i.jsxs)(S.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},children:[(0,i.jsx)(S.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),L&&L.length>0&&L.map(e=>(0,i.jsx)(S.default.Option,{value:e,children:(0,D.W0)(e)},e))]})}),(0,i.jsx)(y.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,i.jsx)(w.Z,{step:.01,precision:2,width:200})}),(0,i.jsx)(y.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,i.jsxs)(S.default,{defaultValue:null,placeholder:"n/a",children:[(0,i.jsx)(S.default.Option,{value:"24h",children:"daily"}),(0,i.jsx)(S.default.Option,{value:"7d",children:"weekly"}),(0,i.jsx)(S.default.Option,{value:"30d",children:"monthly"})]})}),(0,i.jsx)(y.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,i.jsx)(w.Z,{step:1,width:400})}),(0,i.jsx)(y.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,i.jsx)(w.Z,{step:1,width:400})}),(0,i.jsx)(y.Z.Item,{label:(0,i.jsxs)("span",{children:["Allowed Vector Stores"," ",(0,i.jsx)(N.Z,{title:"Select which vector stores this organization can access by default. Leave empty for access to all vector stores",children:(0,i.jsx)(O.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)(Y.Z,{onChange:e=>em.setFieldValue("allowed_vector_store_ids",e),value:em.getFieldValue("allowed_vector_store_ids"),accessToken:R||"",placeholder:"Select vector stores (optional)"})}),(0,i.jsx)(y.Z.Item,{label:(0,i.jsxs)("span",{children:["Allowed MCP Servers"," ",(0,i.jsx)(N.Z,{title:"Select which MCP servers and access groups this organization can access by default.",children:(0,i.jsx)(O.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)(G.Z,{onChange:e=>em.setFieldValue("allowed_mcp_servers_and_groups",e),value:em.getFieldValue("allowed_mcp_servers_and_groups"),accessToken:R||"",placeholder:"Select MCP servers and access groups (optional)"})}),(0,i.jsx)(y.Z.Item,{label:"Metadata",name:"metadata",children:(0,i.jsx)(z.default.TextArea,{rows:4})}),(0,i.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,i.jsx)(t.Z,{type:"submit",children:"Create Organization"})})]})}),(0,i.jsx)(K.Z,{isOpen:ei,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:er,code:!0}],onCancel:()=>{ea(!1),et(null)},onOk:e_,confirmLoading:en})]}):(0,i.jsx)("div",{children:(0,i.jsxs)(f.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"}),"."]})})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2012-c09fa25a9cbf6028.js b/litellm/proxy/_experimental/out/_next/static/chunks/2012-c09fa25a9cbf6028.js deleted file mode 100644 index fc87e2ebf0..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2012-c09fa25a9cbf6028.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2012],{26210:function(e,l,s){s.d(l,{UQ:function(){return t.Z},X1:function(){return i.Z},_m:function(){return a.Z},oi:function(){return n.Z},xv:function(){return r.Z}});var t=s(87452),i=s(88829),a=s(72208),r=s(84264),n=s(49566)},30078:function(e,l,s){s.d(l,{Ct:function(){return t.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 d.Z},v0:function(){return m.Z},x4:function(){return o.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var t=s(41649),i=s(78489),a=s(12514),r=s(67101),n=s(12485),m=s(18135),d=s(35242),o=s(29706),c=s(77991),u=s(84264),h=s(49566),x=s(96761)},62490:function(e,l,s){s.d(l,{Ct:function(){return t.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 d.Z},xs:function(){return o.Z},xv:function(){return u.Z},zx:function(){return i.Z}});var t=s(41649),i=s(78489),a=s(12514),r=s(21626),n=s(97214),m=s(28241),d=s(58834),o=s(69552),c=s(71876),u=s(84264)},11318:function(e,l,s){s.d(l,{Z:function(){return n}});var t=s(2265),i=s(39760),a=s(19250);let r=async(e,l,s,t)=>"Admin"!=s&&"Admin Viewer"!=s?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,l):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var n=()=>{let[e,l]=(0,t.useState)([]),{accessToken:s,userId:a,userRole:n}=(0,i.Z)();return(0,t.useEffect)(()=>{(async()=>{l(await r(s,a,n,null))})()},[s,a,n]),{teams:e,setTeams:l}}},21609:function(e,l,s){s.d(l,{Z:function(){return o}});var t=s(57437),i=s(57840),a=s(22116),r=s(51653),n=s(76188),m=s(4260),d=s(2265);function o(e){let{isOpen:l,title:s,alertMessage:o,message:c,resourceInformationTitle:u,resourceInformation:h,onCancel:x,onOk:b,confirmLoading:p,requiredConfirmation:g}=e,{Title:_,Text:v}=i.default,[j,f]=(0,d.useState)("");return(0,d.useEffect)(()=>{l&&f("")},[l]),(0,t.jsx)(a.Z,{title:s,open:l,onOk:b,onCancel:x,confirmLoading:p,okText:p?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!g&&j!==g||p},cancelButtonProps:{disabled:p},children:(0,t.jsxs)("div",{className:"space-y-4",children:[o&&(0,t.jsx)(r.Z,{message:o,type:"warning"}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(_,{level:5,className:"mb-3 text-gray-900",children:u}),(0,t.jsx)(n.Z,{column:1,size:"small",children:h&&h.map(e=>{let{label:l,value:s,...i}=e;return(0,t.jsx)(n.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:l}),children:(0,t.jsx)(v,{...i,children:null!=s?s:"-"})},l)})})]}),(0,t.jsx)("div",{children:(0,t.jsx)(v,{children:c})}),g&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200",children:[(0,t.jsxs)(v,{className:"block text-base font-medium text-gray-700 mb-2",children:[(0,t.jsx)(v,{children:"Type "}),(0,t.jsx)(v,{strong:!0,type:"danger",children:g}),(0,t.jsx)(v,{children:" to confirm deletion:"})]}),(0,t.jsx)(m.default,{value:j,onChange:e=>f(e.target.value),placeholder:g,className:"rounded-md text-base border-gray-200",autoFocus:!0})]})]})})}},33860:function(e,l,s){var t=s(57437),i=s(2265),a=s(10032),r=s(22116),n=s(37592),m=s(99981),d=s(5545),o=s(7310),c=s.n(o),u=s(19250);l.Z=e=>{let{isVisible:l,onCancel:s,onSubmit:o,accessToken:h,title:x="Add Team Member",roles:b=[{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:p="user"}=e,[g]=a.Z.useForm(),[_,v]=(0,i.useState)([]),[j,f]=(0,i.useState)(!1),[Z,y]=(0,i.useState)("user_email"),N=async(e,l)=>{if(!e){v([]);return}f(!0);try{let s=new URLSearchParams;if(s.append(l,e),null==h)return;let t=(await (0,u.userFilterUICall)(h,s)).map(e=>({label:"user_email"===l?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===l?e.user_email:e.user_id,user:e}));v(t)}catch(e){console.error("Error fetching users:",e)}finally{f(!1)}},w=(0,i.useCallback)(c()((e,l)=>N(e,l),300),[]),k=(e,l)=>{y(l),w(e,l)},M=(e,l)=>{let s=l.user;g.setFieldsValue({user_email:s.user_email,user_id:s.user_id,role:g.getFieldValue("role")})};return(0,t.jsx)(r.Z,{title:x,open:l,onCancel:()=>{g.resetFields(),v([]),s()},footer:null,width:800,children:(0,t.jsxs)(a.Z,{form:g,onFinish:o,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:p},children:[(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>k(e,"user_email"),onSelect:(e,l)=>M(e,l),options:"user_email"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>k(e,"user_id"),onSelect:(e,l)=>M(e,l),options:"user_id"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,t.jsx)(n.default,{defaultValue:p,children:b.map(e=>(0,t.jsx)(n.default.Option,{value:e.value,children:(0,t.jsxs)(m.Z,{title:e.description,children:[(0,t.jsx)("span",{className:"font-medium",children:e.label}),(0,t.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,t.jsx)("div",{className:"text-right mt-4",children:(0,t.jsx)(d.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},10901:function(e,l,s){s.d(l,{Z:function(){return h}});var t=s(57437),i=s(2265),a=s(10032),r=s(22116),n=s(5545),m=s(27281),d=s(57365),o=s(49566),c=s(92280),u=s(24199),h=e=>{var l,s,h;let{visible:x,onCancel:b,onSubmit:p,initialData:g,mode:_,config:v}=e,[j]=a.Z.useForm();console.log("Initial Data:",g),(0,i.useEffect)(()=>{if(x){if("edit"===_&&g){let e={...g,role:g.role||v.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),j.setFieldsValue(e)}else{var e;j.resetFields(),j.setFieldsValue({role:v.defaultRole||(null===(e=v.roleOptions[0])||void 0===e?void 0:e.value)})}}},[x,g,_,j,v.defaultRole,v.roleOptions]);let f=async e=>{try{let l=Object.entries(e).reduce((e,l)=>{let[s,t]=l;if("string"==typeof t){let l=t.trim();return""===l&&("max_budget_in_team"===s||"tpm_limit"===s||"rpm_limit"===s)?{...e,[s]:null}:{...e,[s]:l}}return{...e,[s]:t}},{});console.log("Submitting form data:",l),p(l),j.resetFields()}catch(e){console.error("Form submission error:",e)}},Z=e=>{switch(e.type){case"input":return(0,t.jsx)(o.Z,{placeholder:e.placeholder});case"numerical":return(0,t.jsx)(u.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var l;return(0,t.jsx)(m.Z,{children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,t.jsx)(d.Z,{value:e.value,children:e.label},e.value))});default:return null}};return(0,t.jsx)(r.Z,{title:v.title||("add"===_?"Add Member":"Edit Member"),open:x,width:1e3,footer:null,onCancel:b,children:(0,t.jsxs)(a.Z,{form:j,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[v.showEmail&&(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,t.jsx)(o.Z,{placeholder:"user@example.com"})}),v.showEmail&&v.showUserId&&(0,t.jsx)("div",{className:"text-center mb-4",children:(0,t.jsx)(c.x,{children:"OR"})}),v.showUserId&&(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(o.Z,{placeholder:"user_123"})}),(0,t.jsx)(a.Z.Item,{label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"Role"}),"edit"===_&&g&&(0,t.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(s=g.role,(null===(h=v.roleOptions.find(e=>e.value===s))||void 0===h?void 0:h.label)||s),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,t.jsx)(m.Z,{children:"edit"===_&&g?[...v.roleOptions.filter(e=>e.value===g.role),...v.roleOptions.filter(e=>e.value!==g.role)].map(e=>(0,t.jsx)(d.Z,{value:e.value,children:e.label},e.value)):v.roleOptions.map(e=>(0,t.jsx)(d.Z,{value:e.value,children:e.label},e.value))})}),null===(l=v.additionalFields)||void 0===l?void 0:l.map(e=>(0,t.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:Z(e)},e.name)),(0,t.jsxs)("div",{className:"text-right mt-6",children:[(0,t.jsx)(n.ZP,{onClick:b,className:"mr-2",children:"Cancel"}),(0,t.jsx)(n.ZP,{type:"default",htmlType:"submit",children:"add"===_?"Add Member":"Save Changes"})]})]})})}},33293:function(e,l,s){s.d(l,{Z:function(){return el}});var t=s(57437),i=s(33860),a=s(19250),r=s(59872),n=s(33304),m=s(15424),d=s(10900),o=s(30078),c=s(10032),u=s(42264),h=s(5545),x=s(4260),b=s(37592),p=s(99981),g=s(63709),_=s(30401),v=s(78867),j=s(2265),f=s(21609),Z=s(95096),y=s(46468),N=s(27799),w=s(95920),k=s(68473),M=s(9114),C=s(98015),S=s(24199),T=s(97415),I=s(10901),P=s(21425),L=s(78489),F=s(12514),E=s(21626),O=s(97214),D=s(28241),A=s(58834),R=s(69552),U=s(71876),z=s(84264),B=s(96761),V=s(61994),q=s(85180),G=s(89245),K=s(78355);let $={"/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"},J=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",Q=e=>{let l=J(e),s=$[e];if(!s){for(let[l,t]of Object.entries($))if(e.includes(l)){s=t;break}}return s||(s="Access ".concat(e)),{method:l,endpoint:e,description:s,route:e}};var W=e=>{let{teamId:l,accessToken:s,canEditTeam:i}=e,[r,n]=(0,j.useState)([]),[m,d]=(0,j.useState)([]),[o,c]=(0,j.useState)(!0),[u,x]=(0,j.useState)(!1),[b,p]=(0,j.useState)(!1),g=async()=>{try{if(c(!0),!s)return;let e=await (0,a.getTeamPermissionsCall)(s,l),t=e.all_available_permissions||[];n(t);let i=e.team_member_permissions||[];d(i),p(!1)}catch(e){M.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{c(!1)}};(0,j.useEffect)(()=>{g()},[l,s]);let _=(e,l)=>{d(l?[...m,e]:m.filter(l=>l!==e)),p(!0)},v=async()=>{try{if(!s)return;x(!0),await (0,a.teamPermissionsUpdateCall)(s,l,m),M.Z.success("Permissions updated successfully"),p(!1)}catch(e){M.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(o)return(0,t.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let f=r.length>0;return(0,t.jsxs)(F.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,t.jsx)(B.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),i&&b&&(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(h.ZP,{icon:(0,t.jsx)(G.Z,{}),onClick:()=>{g()},children:"Reset"}),(0,t.jsxs)(L.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,t.jsx)(K.Z,{})," Save Changes"]})]})]}),(0,t.jsx)(z.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),f?(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(E.Z,{className:" min-w-full",children:[(0,t.jsx)(A.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(R.Z,{children:"Method"}),(0,t.jsx)(R.Z,{children:"Endpoint"}),(0,t.jsx)(R.Z,{children:"Description"}),(0,t.jsx)(R.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,t.jsx)(O.Z,{children:r.map(e=>{let l=Q(e);return(0,t.jsxs)(U.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(D.Z,{children:(0,t.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===l.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:l.method})}),(0,t.jsx)(D.Z,{children:(0,t.jsx)("span",{className:"font-mono text-sm text-gray-800",children:l.endpoint})}),(0,t.jsx)(D.Z,{className:"text-gray-700",children:l.description}),(0,t.jsx)(D.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,t.jsx)(V.Z,{checked:m.includes(e),onChange:l=>_(e,l.target.checked),disabled:!i})})]},e)})})]})}):(0,t.jsx)("div",{className:"py-12",children:(0,t.jsx)(q.Z,{description:"No permissions available"})})]})},X=s(47323),Y=s(53410),H=s(74998),ee=e=>{let{teamData:l,canEditTeam:s,handleMemberDelete:i,setSelectedEditMember:a,setIsEditMemberModalVisible:n,setIsAddMemberModalVisible:d}=e,o=e=>{if(null==e)return"0";if("number"==typeof e){let l=Number(e);return l===Math.floor(l)?l.toString():(0,r.pw)(l,8).replace(/\.?0+$/,"")}return"0"},c=e=>{if(!e)return 0;let s=l.team_memberships.find(l=>l.user_id===e);return(null==s?void 0:s.spend)||0},u=e=>{var s;if(!e)return null;let t=l.team_memberships.find(l=>l.user_id===e);console.log("membership=".concat(t));let i=null==t?void 0:null===(s=t.litellm_budget_table)||void 0===s?void 0:s.max_budget;return null==i?null:o(i)},h=e=>{var s,t;if(!e)return"No Limits";let i=l.team_memberships.find(l=>l.user_id===e),a=null==i?void 0:null===(s=i.litellm_budget_table)||void 0===s?void 0:s.rpm_limit,r=null==i?void 0:null===(t=i.litellm_budget_table)||void 0===t?void 0:t.tpm_limit,n=[a?"".concat(o(a)," RPM"):null,r?"".concat(o(r)," TPM"):null].filter(Boolean);return n.length>0?n.join(" / "):"No Limits"};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(F.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(E.Z,{className:"min-w-full",children:[(0,t.jsx)(A.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(R.Z,{children:"User ID"}),(0,t.jsx)(R.Z,{children:"User Email"}),(0,t.jsx)(R.Z,{children:"Role"}),(0,t.jsxs)(R.Z,{children:["Team Member Spend (USD)"," ",(0,t.jsx)(p.Z,{title:"This is the amount spent by a user in the team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(R.Z,{children:"Team Member Budget (USD)"}),(0,t.jsxs)(R.Z,{children:["Team Member Rate Limits"," ",(0,t.jsx)(p.Z,{title:"Rate limits for this member's usage within this team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(R.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,t.jsx)(O.Z,{children:l.team_info.members_with_roles.map((e,m)=>(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(D.Z,{children:(0,t.jsx)(z.Z,{className:"font-mono",children:e.user_id})}),(0,t.jsx)(D.Z,{children:(0,t.jsx)(z.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,t.jsx)(D.Z,{children:(0,t.jsx)(z.Z,{className:"font-mono",children:e.role})}),(0,t.jsx)(D.Z,{children:(0,t.jsxs)(z.Z,{className:"font-mono",children:["$",(0,r.pw)(c(e.user_id),4)]})}),(0,t.jsx)(D.Z,{children:(0,t.jsx)(z.Z,{className:"font-mono",children:u(e.user_id)?"$".concat((0,r.pw)(Number(u(e.user_id)),4)):"No Limit"})}),(0,t.jsx)(D.Z,{children:(0,t.jsx)(z.Z,{className:"font-mono",children:h(e.user_id)})}),(0,t.jsx)(D.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:s&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(X.Z,{icon:Y.Z,size:"sm",onClick:()=>{var s,t,i;let r=l.team_memberships.find(l=>l.user_id===e.user_id);a({...e,max_budget_in_team:(null==r?void 0:null===(s=r.litellm_budget_table)||void 0===s?void 0:s.max_budget)||null,tpm_limit:(null==r?void 0:null===(t=r.litellm_budget_table)||void 0===t?void 0:t.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,t.jsx)(X.Z,{icon:H.Z,size:"sm",onClick:()=>i(e),className:"cursor-pointer hover:text-red-600"})]})})]},m))})]})})}),(0,t.jsx)(L.Z,{onClick:()=>d(!0),children:"Add Member"})]})},el=e=>{var l,s,L,F,E,O,D,A,R,U,z,B,V,q,G,K,$,J;let{teamId:Q,onClose:X,accessToken:Y,is_team_admin:H,is_proxy_admin:el,userModels:es,editTeam:et,premiumUser:ei=!1,onUpdate:ea}=e,[er,en]=(0,j.useState)(null),[em,ed]=(0,j.useState)(!0),[eo,ec]=(0,j.useState)(!1),[eu]=c.Z.useForm(),[eh,ex]=(0,j.useState)(!1),[eb,ep]=(0,j.useState)(null),[eg,e_]=(0,j.useState)(!1),[ev,ej]=(0,j.useState)([]),[ef,eZ]=(0,j.useState)(!1),[ey,eN]=(0,j.useState)({}),[ew,ek]=(0,j.useState)([]),[eM,eC]=(0,j.useState)(null),[eS,eT]=(0,j.useState)(!1),[eI,eP]=(0,j.useState)(!1),[eL,eF]=(0,j.useState)(!1);console.log("userModels in team info",es);let eE=H||el,eO=async()=>{try{if(ed(!0),!Y)return;let e=await (0,a.teamInfoCall)(Y,Q);en(e)}catch(e){M.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{ed(!1)}};(0,j.useEffect)(()=>{eO()},[Q,Y]),(0,j.useEffect)(()=>{(async()=>{try{if(!Y)return;let e=(await (0,a.getGuardrailsList)(Y)).guardrails.map(e=>e.guardrail_name);ek(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[Y]);let eD=async e=>{try{if(null==Y)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,a.teamMemberAddCall)(Y,Q,l),M.Z.success("Team member added successfully"),ec(!1),eu.resetFields();let s=await (0,a.teamInfoCall)(Y,Q);en(s),ea(s)}catch(i){var l,s,t;let e="Failed to add team member";(null==i?void 0:null===(t=i.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:null===(l=s.error)||void 0===l?void 0:l.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)}},eA=async e=>{try{if(null==Y)return;let l={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:",l),u.ZP.destroy(),await (0,a.teamMemberUpdateCall)(Y,Q,l),M.Z.success("Team member updated successfully"),ex(!1);let s=await (0,a.teamInfoCall)(Y,Q);en(s),ea(s)}catch(t){var l,s;let e="Failed to update team member";(null==t?void 0:null===(s=t.raw)||void 0===s?void 0:null===(l=s.detail)||void 0===l?void 0:l.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==t?void 0:t.message)&&(e=t.message),ex(!1),u.ZP.destroy(),M.Z.fromBackend(e),console.error("Error updating team member:",t)}},eR=async()=>{if(eM&&Y){eP(!0);try{await (0,a.teamMemberDeleteCall)(Y,Q,eM),M.Z.success("Team member removed successfully");let e=await (0,a.teamInfoCall)(Y,Q);en(e),ea(e)}catch(e){M.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}finally{eP(!1),eT(!1),eC(null)}}},eU=async e=>{try{if(!Y)return;eF(!0);let l={};try{l=e.metadata?JSON.parse(e.metadata):{}}catch(e){M.Z.fromBackend("Invalid JSON in metadata field");return}let s=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,t={team_id:Q,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||[]},organization_id:e.organization_id};t.max_budget=(0,n.C)(t.max_budget),void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(t.team_member_tpm_limit=s(e.team_member_tpm_limit),t.team_member_rpm_limit=s(e.team_member_rpm_limit));let{servers:i,accessGroups:r}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},m=new Set(i||[]),d=Object.fromEntries(Object.entries(e.mcp_tool_permissions||{}).filter(e=>{let[l]=e;return m.has(l)}));t.object_permission={},i&&(t.object_permission.mcp_servers=i),r&&(t.object_permission.mcp_access_groups=r),d&&(t.object_permission.mcp_tool_permissions=d),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions,await (0,a.teamUpdateCall)(Y,t),M.Z.success("Team settings updated successfully"),e_(!1),eO()}catch(e){console.error("Error updating team:",e)}finally{eF(!1)}};if(em)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==er?void 0:er.team_info))return(0,t.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:ez}=er,eB=async(e,l)=>{await (0,r.vQ)(e)&&(eN(e=>({...e,[l]:!0})),setTimeout(()=>{eN(e=>({...e,[l]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(o.zx,{icon:d.Z,variant:"light",onClick:X,className:"mb-4",children:"Back to Teams"}),(0,t.jsx)(o.Dx,{children:ez.team_alias}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(o.xv,{className:"text-gray-500 font-mono",children:ez.team_id}),(0,t.jsx)(h.ZP,{type:"text",size:"small",icon:ey["team-id"]?(0,t.jsx)(_.Z,{size:12}):(0,t.jsx)(v.Z,{size:12}),onClick:()=>eB(ez.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(ey["team-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.v0,{defaultIndex:et?3:0,children:[(0,t.jsx)(o.td,{className:"mb-4",children:[(0,t.jsx)(o.OK,{children:"Overview"},"overview"),...eE?[(0,t.jsx)(o.OK,{children:"Members"},"members"),(0,t.jsx)(o.OK,{children:"Member Permissions"},"member-permissions"),(0,t.jsx)(o.OK,{children:"Settings"},"settings")]:[]]}),(0,t.jsxs)(o.nP,{children:[(0,t.jsx)(o.x4,{children:(0,t.jsxs)(o.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.xv,{children:"Budget Status"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(o.Dx,{children:["$",(0,r.pw)(ez.spend,4)]}),(0,t.jsxs)(o.xv,{children:["of ",null===ez.max_budget?"Unlimited":"$".concat((0,r.pw)(ez.max_budget,4))]}),ez.budget_duration&&(0,t.jsxs)(o.xv,{className:"text-gray-500",children:["Reset: ",ez.budget_duration]}),(0,t.jsx)("br",{}),ez.team_member_budget_table&&(0,t.jsxs)(o.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,r.pw)(ez.team_member_budget_table.max_budget,4)]})]})]}),(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.xv,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(o.xv,{children:["TPM: ",ez.tpm_limit||"Unlimited"]}),(0,t.jsxs)(o.xv,{children:["RPM: ",ez.rpm_limit||"Unlimited"]}),ez.max_parallel_requests&&(0,t.jsxs)(o.xv,{children:["Max Parallel Requests: ",ez.max_parallel_requests]})]})]}),(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.xv,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===ez.models.length?(0,t.jsx)(o.Ct,{color:"red",children:"All proxy models"}):ez.models.map((e,l)=>(0,t.jsx)(o.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(o.xv,{children:["User Keys: ",er.keys.filter(e=>e.user_id).length]}),(0,t.jsxs)(o.xv,{children:["Service Account Keys: ",er.keys.filter(e=>!e.user_id).length]}),(0,t.jsxs)(o.xv,{className:"text-gray-500",children:["Total: ",er.keys.length]})]})]}),(0,t.jsx)(C.Z,{objectPermission:ez.object_permission,variant:"card",accessToken:Y}),(0,t.jsx)(N.Z,{loggingConfigs:(null===(l=ez.metadata)||void 0===l?void 0:l.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,t.jsx)(o.x4,{children:(0,t.jsx)(ee,{teamData:er,canEditTeam:eE,handleMemberDelete:e=>{eC(e),eT(!0)},setSelectedEditMember:ep,setIsEditMemberModalVisible:ex,setIsAddMemberModalVisible:ec})}),eE&&(0,t.jsx)(o.x4,{children:(0,t.jsx)(W,{teamId:Q,accessToken:Y,canEditTeam:eE})}),(0,t.jsx)(o.x4,{children:(0,t.jsxs)(o.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)(o.Dx,{children:"Team Settings"}),eE&&!eg&&(0,t.jsx)(o.zx,{onClick:()=>e_(!0),children:"Edit Settings"})]}),eg?(0,t.jsxs)(c.Z,{form:eu,onFinish:eU,initialValues:{...ez,team_alias:ez.team_alias,models:ez.models,tpm_limit:ez.tpm_limit,rpm_limit:ez.rpm_limit,max_budget:ez.max_budget,budget_duration:ez.budget_duration,team_member_tpm_limit:null===(s=ez.team_member_budget_table)||void 0===s?void 0:s.tpm_limit,team_member_rpm_limit:null===(L=ez.team_member_budget_table)||void 0===L?void 0:L.rpm_limit,guardrails:(null===(F=ez.metadata)||void 0===F?void 0:F.guardrails)||[],disable_global_guardrails:(null===(E=ez.metadata)||void 0===E?void 0:E.disable_global_guardrails)||!1,metadata:ez.metadata?JSON.stringify((e=>{let{logging:l,...s}=e;return s})(ez.metadata),null,2):"",logging_settings:(null===(O=ez.metadata)||void 0===O?void 0:O.logging)||[],organization_id:ez.organization_id,vector_stores:(null===(D=ez.object_permission)||void 0===D?void 0:D.vector_stores)||[],mcp_servers:(null===(A=ez.object_permission)||void 0===A?void 0:A.mcp_servers)||[],mcp_access_groups:(null===(R=ez.object_permission)||void 0===R?void 0:R.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(U=ez.object_permission)||void 0===U?void 0:U.mcp_servers)||[],accessGroups:(null===(z=ez.object_permission)||void 0===z?void 0:z.mcp_access_groups)||[]},mcp_tool_permissions:(null===(B=ez.object_permission)||void 0===B?void 0:B.mcp_tool_permissions)||{}},layout:"vertical",children:[(0,t.jsx)(c.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,t.jsx)(x.default,{type:""})}),(0,t.jsx)(c.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select at least one model"}],children:(0,t.jsxs)(b.default,{mode:"multiple",placeholder:"Select models",children:[(el||es.includes("all-proxy-models"))&&(0,t.jsx)(b.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"),(0,t.jsx)(b.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"),Array.from(new Set(es)).map((e,l)=>(0,t.jsx)(b.default.Option,{value:e,children:(0,y.W0)(e)},l))]})}),(0,t.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(S.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.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,t.jsx)(S.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.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,t.jsx)(o.oi,{placeholder:"e.g., 30d"})}),(0,t.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,t.jsx)(S.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,t.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,t.jsx)(S.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,t.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(b.default,{placeholder:"n/a",children:[(0,t.jsx)(b.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(b.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(b.default.Option,{value:"30d",children:"monthly"})]})}),(0,t.jsx)(c.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,t.jsx)(S.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,t.jsx)(S.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(p.Z,{title:"Setup your first guardrail",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,t.jsx)(b.default,{mode:"tags",placeholder:"Select or enter guardrails",options:ew.map(e=>({value:e,label:e}))})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(p.Z,{title:"When enabled, this team will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",help:"Bypass global guardrails for this team",children:(0,t.jsx)(g.Z,{checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,t.jsx)(T.Z,{onChange:e=>eu.setFieldValue("vector_stores",e),value:eu.getFieldValue("vector_stores"),accessToken:Y||"",placeholder:"Select vector stores"})}),(0,t.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(Z.Z,{onChange:e=>eu.setFieldValue("allowed_passthrough_routes",e),value:eu.getFieldValue("allowed_passthrough_routes"),accessToken:Y||"",placeholder:"Select pass through routes"})}),(0,t.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(w.Z,{onChange:e=>eu.setFieldValue("mcp_servers_and_groups",e),value:eu.getFieldValue("mcp_servers_and_groups"),accessToken:Y||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(x.default,{type:"hidden"})}),(0,t.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.mcp_servers_and_groups!==l.mcp_servers_and_groups||e.mcp_tool_permissions!==l.mcp_tool_permissions,children:()=>{var e;return(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(k.Z,{accessToken:Y||"",selectedServers:(null===(e=eu.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:eu.getFieldValue("mcp_tool_permissions")||{},onChange:e=>eu.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,t.jsx)(c.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,t.jsx)(x.default,{type:""})}),(0,t.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(P.Z,{value:eu.getFieldValue("logging_settings"),onChange:e=>eu.setFieldValue("logging_settings",e)})}),(0,t.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(x.default.TextArea,{rows:10})}),(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)(o.zx,{variant:"secondary",onClick:()=>e_(!1),disabled:eL,children:"Cancel"}),(0,t.jsx)(o.zx,{type:"submit",loading:eL,children:"Save Changes"})]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Team Name"}),(0,t.jsx)("div",{children:ez.team_alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Team ID"}),(0,t.jsx)("div",{className:"font-mono",children:ez.team_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:new Date(ez.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:ez.models.map((e,l)=>(0,t.jsx)(o.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)("div",{children:["TPM: ",ez.tpm_limit||"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",ez.rpm_limit||"Unlimited"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Team Budget"}),(0,t.jsxs)("div",{children:["Max Budget:"," ",null!==ez.max_budget?"$".concat((0,r.pw)(ez.max_budget,4)):"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Reset: ",ez.budget_duration||"Never"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(o.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,t.jsx)(p.Z,{title:"These are limits on individual team members",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),(0,t.jsxs)("div",{children:["Max Budget: ",(null===(V=ez.team_member_budget_table)||void 0===V?void 0:V.max_budget)||"No Limit"]}),(0,t.jsxs)("div",{children:["Key Duration: ",(null===(q=ez.metadata)||void 0===q?void 0:q.team_member_key_duration)||"No Limit"]}),(0,t.jsxs)("div",{children:["TPM Limit: ",(null===(G=ez.team_member_budget_table)||void 0===G?void 0:G.tpm_limit)||"No Limit"]}),(0,t.jsxs)("div",{children:["RPM Limit: ",(null===(K=ez.team_member_budget_table)||void 0===K?void 0:K.rpm_limit)||"No Limit"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Organization ID"}),(0,t.jsx)("div",{children:ez.organization_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Status"}),(0,t.jsx)(o.Ct,{color:ez.blocked?"red":"green",children:ez.blocked?"Blocked":"Active"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,t.jsx)("div",{children:(null===($=ez.metadata)||void 0===$?void 0:$.disable_global_guardrails)===!0?(0,t.jsx)(o.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,t.jsx)(o.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,t.jsx)(C.Z,{objectPermission:ez.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:Y}),(0,t.jsx)(N.Z,{loggingConfigs:(null===(J=ez.metadata)||void 0===J?void 0:J.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,t.jsx)(I.Z,{visible:eh,onCancel:()=>ex(!1),onSubmit:eA,initialData:eb,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,t.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,t.jsx)(p.Z,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,t.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,t.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,t.jsx)(p.Z,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,t.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,t.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,t.jsx)(p.Z,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,t.jsx)(i.Z,{isVisible:eo,onCancel:()=>ec(!1),onSubmit:eD,accessToken:Y}),(0,t.jsx)(f.Z,{isOpen:eS,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==eM?void 0:eM.user_id,code:!0},{label:"Email",value:null==eM?void 0:eM.user_email},{label:"Role",value:null==eM?void 0:eM.role}],onCancel:()=>{eT(!1),eC(null)},onOk:eR,confirmLoading:eI})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2012-dcbd62e829c6106f.js b/litellm/proxy/_experimental/out/_next/static/chunks/2012-dcbd62e829c6106f.js new file mode 100644 index 0000000000..c7545f87f9 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2012-dcbd62e829c6106f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2012],{26210:function(e,l,s){s.d(l,{UQ:function(){return t.Z},X1:function(){return i.Z},_m:function(){return a.Z},oi:function(){return n.Z},xv:function(){return r.Z}});var t=s(87452),i=s(88829),a=s(72208),r=s(84264),n=s(49566)},30078:function(e,l,s){s.d(l,{Ct:function(){return t.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 t=s(41649),i=s(78489),a=s(12514),r=s(67101),n=s(12485),m=s(18135),o=s(35242),d=s(29706),c=s(77991),u=s(84264),h=s(49566),x=s(96761)},62490:function(e,l,s){s.d(l,{Ct:function(){return t.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 t=s(41649),i=s(78489),a=s(12514),r=s(21626),n=s(97214),m=s(28241),o=s(58834),d=s(69552),c=s(71876),u=s(84264)},11318:function(e,l,s){s.d(l,{Z:function(){return n}});var t=s(2265),i=s(39760),a=s(19250);let r=async(e,l,s,t)=>"Admin"!=s&&"Admin Viewer"!=s?await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null,l):await (0,a.teamListCall)(e,(null==t?void 0:t.organization_id)||null);var n=()=>{let[e,l]=(0,t.useState)([]),{accessToken:s,userId:a,userRole:n}=(0,i.Z)();return(0,t.useEffect)(()=>{(async()=>{l(await r(s,a,n,null))})()},[s,a,n]),{teams:e,setTeams:l}}},21609:function(e,l,s){s.d(l,{Z:function(){return d}});var t=s(57437),i=s(57840),a=s(22116),r=s(51653),n=s(76188),m=s(4260),o=s(2265);function d(e){let{isOpen:l,title:s,alertMessage:d,message:c,resourceInformationTitle:u,resourceInformation:h,onCancel:x,onOk:p,confirmLoading:g,requiredConfirmation:b}=e,{Title:_,Text:v}=i.default,[j,f]=(0,o.useState)("");return(0,o.useEffect)(()=>{l&&f("")},[l]),(0,t.jsx)(a.Z,{title:s,open:l,onOk:p,onCancel:x,confirmLoading:g,okText:g?"Deleting...":"Delete",cancelText:"Cancel",okButtonProps:{danger:!0,disabled:!!b&&j!==b||g},cancelButtonProps:{disabled:g},children:(0,t.jsxs)("div",{className:"space-y-4",children:[d&&(0,t.jsx)(r.Z,{message:d,type:"warning"}),(0,t.jsxs)("div",{className:"mt-4 p-4 bg-red-50 rounded-lg border border-red-200",children:[(0,t.jsx)(_,{level:5,className:"mb-3 text-gray-900",children:u}),(0,t.jsx)(n.Z,{column:1,size:"small",children:h&&h.map(e=>{let{label:l,value:s,...i}=e;return(0,t.jsx)(n.Z.Item,{label:(0,t.jsx)("span",{className:"font-semibold text-gray-700",children:l}),children:(0,t.jsx)(v,{...i,children:null!=s?s:"-"})},l)})})]}),(0,t.jsx)("div",{children:(0,t.jsx)(v,{children:c})}),b&&(0,t.jsxs)("div",{className:"mb-6 mt-4 pt-4 border-t border-gray-200",children:[(0,t.jsxs)(v,{className:"block text-base font-medium text-gray-700 mb-2",children:[(0,t.jsx)(v,{children:"Type "}),(0,t.jsx)(v,{strong:!0,type:"danger",children:b}),(0,t.jsx)(v,{children:" to confirm deletion:"})]}),(0,t.jsx)(m.default,{value:j,onChange:e=>f(e.target.value),placeholder:b,className:"rounded-md text-base border-gray-200",autoFocus:!0})]})]})})}},33860:function(e,l,s){var t=s(57437),i=s(2265),a=s(10032),r=s(22116),n=s(37592),m=s(99981),o=s(5545),d=s(7310),c=s.n(d),u=s(19250);l.Z=e=>{let{isVisible:l,onCancel:s,onSubmit:d,accessToken:h,title:x="Add Team Member",roles:p=[{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:g="user"}=e,[b]=a.Z.useForm(),[_,v]=(0,i.useState)([]),[j,f]=(0,i.useState)(!1),[Z,y]=(0,i.useState)("user_email"),N=async(e,l)=>{if(!e){v([]);return}f(!0);try{let s=new URLSearchParams;if(s.append(l,e),null==h)return;let t=(await (0,u.userFilterUICall)(h,s)).map(e=>({label:"user_email"===l?"".concat(e.user_email):"".concat(e.user_id),value:"user_email"===l?e.user_email:e.user_id,user:e}));v(t)}catch(e){console.error("Error fetching users:",e)}finally{f(!1)}},w=(0,i.useCallback)(c()((e,l)=>N(e,l),300),[]),k=(e,l)=>{y(l),w(e,l)},M=(e,l)=>{let s=l.user;b.setFieldsValue({user_email:s.user_email,user_id:s.user_id,role:b.getFieldValue("role")})};return(0,t.jsx)(r.Z,{title:x,open:l,onCancel:()=>{b.resetFields(),v([]),s()},footer:null,width:800,children:(0,t.jsxs)(a.Z,{form:b,onFinish:d,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",initialValues:{role:g},children:[(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by email",filterOption:!1,onSearch:e=>k(e,"user_email"),onSelect:(e,l)=>M(e,l),options:"user_email"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)("div",{className:"text-center mb-4",children:"OR"}),(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(n.default,{showSearch:!0,className:"w-full",placeholder:"Search by user ID",filterOption:!1,onSearch:e=>k(e,"user_id"),onSelect:(e,l)=>M(e,l),options:"user_id"===Z?_:[],loading:j,allowClear:!0})}),(0,t.jsx)(a.Z.Item,{label:"Member Role",name:"role",className:"mb-4",children:(0,t.jsx)(n.default,{defaultValue:g,children:p.map(e=>(0,t.jsx)(n.default.Option,{value:e.value,children:(0,t.jsxs)(m.Z,{title:e.description,children:[(0,t.jsx)("span",{className:"font-medium",children:e.label}),(0,t.jsxs)("span",{className:"ml-2 text-gray-500 text-sm",children:["- ",e.description]})]})},e.value))})}),(0,t.jsx)("div",{className:"text-right mt-4",children:(0,t.jsx)(o.ZP,{type:"default",htmlType:"submit",children:"Add Member"})})]})})}},10901:function(e,l,s){s.d(l,{Z:function(){return h}});var t=s(57437),i=s(2265),a=s(10032),r=s(22116),n=s(5545),m=s(27281),o=s(43227),d=s(49566),c=s(92280),u=s(24199),h=e=>{var l,s,h;let{visible:x,onCancel:p,onSubmit:g,initialData:b,mode:_,config:v}=e,[j]=a.Z.useForm();console.log("Initial Data:",b),(0,i.useEffect)(()=>{if(x){if("edit"===_&&b){let e={...b,role:b.role||v.defaultRole,max_budget_in_team:b.max_budget_in_team||null,tpm_limit:b.tpm_limit||null,rpm_limit:b.rpm_limit||null};console.log("Setting form values:",e),j.setFieldsValue(e)}else{var e;j.resetFields(),j.setFieldsValue({role:v.defaultRole||(null===(e=v.roleOptions[0])||void 0===e?void 0:e.value)})}}},[x,b,_,j,v.defaultRole,v.roleOptions]);let f=async e=>{try{let l=Object.entries(e).reduce((e,l)=>{let[s,t]=l;if("string"==typeof t){let l=t.trim();return""===l&&("max_budget_in_team"===s||"tpm_limit"===s||"rpm_limit"===s)?{...e,[s]:null}:{...e,[s]:l}}return{...e,[s]:t}},{});console.log("Submitting form data:",l),g(l),j.resetFields()}catch(e){console.error("Form submission error:",e)}},Z=e=>{switch(e.type){case"input":return(0,t.jsx)(d.Z,{placeholder:e.placeholder});case"numerical":return(0,t.jsx)(u.Z,{step:e.step||1,min:e.min||0,style:{width:"100%"},placeholder:e.placeholder||"Enter a numerical value"});case"select":var l;return(0,t.jsx)(m.Z,{children:null===(l=e.options)||void 0===l?void 0:l.map(e=>(0,t.jsx)(o.Z,{value:e.value,children:e.label},e.value))});default:return null}};return(0,t.jsx)(r.Z,{title:v.title||("add"===_?"Add Member":"Edit Member"),open:x,width:1e3,footer:null,onCancel:p,children:(0,t.jsxs)(a.Z,{form:j,onFinish:f,labelCol:{span:8},wrapperCol:{span:16},labelAlign:"left",children:[v.showEmail&&(0,t.jsx)(a.Z.Item,{label:"Email",name:"user_email",className:"mb-4",rules:[{type:"email",message:"Please enter a valid email!"}],children:(0,t.jsx)(d.Z,{placeholder:"user@example.com"})}),v.showEmail&&v.showUserId&&(0,t.jsx)("div",{className:"text-center mb-4",children:(0,t.jsx)(c.x,{children:"OR"})}),v.showUserId&&(0,t.jsx)(a.Z.Item,{label:"User ID",name:"user_id",className:"mb-4",children:(0,t.jsx)(d.Z,{placeholder:"user_123"})}),(0,t.jsx)(a.Z.Item,{label:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{children:"Role"}),"edit"===_&&b&&(0,t.jsxs)("span",{className:"text-gray-500 text-sm",children:["(Current: ",(s=b.role,(null===(h=v.roleOptions.find(e=>e.value===s))||void 0===h?void 0:h.label)||s),")"]})]}),name:"role",className:"mb-4",rules:[{required:!0,message:"Please select a role!"}],children:(0,t.jsx)(m.Z,{children:"edit"===_&&b?[...v.roleOptions.filter(e=>e.value===b.role),...v.roleOptions.filter(e=>e.value!==b.role)].map(e=>(0,t.jsx)(o.Z,{value:e.value,children:e.label},e.value)):v.roleOptions.map(e=>(0,t.jsx)(o.Z,{value:e.value,children:e.label},e.value))})}),null===(l=v.additionalFields)||void 0===l?void 0:l.map(e=>(0,t.jsx)(a.Z.Item,{label:e.label,name:e.name,className:"mb-4",rules:e.rules,children:Z(e)},e.name)),(0,t.jsxs)("div",{className:"text-right mt-6",children:[(0,t.jsx)(n.ZP,{onClick:p,className:"mr-2",children:"Cancel"}),(0,t.jsx)(n.ZP,{type:"default",htmlType:"submit",children:"add"===_?"Add Member":"Save Changes"})]})]})})}},33293:function(e,l,s){s.d(l,{Z:function(){return et}});var t=s(57437),i=s(33860),a=s(19250),r=s(59872),n=s(33304),m=s(15424),o=s(77331),d=s(30078),c=s(10032),u=s(42264),h=s(5545),x=s(4260),p=s(37592),g=s(99981),b=s(63709),_=s(30401),v=s(78867),j=s(2265),f=s(21609),Z=s(95096),y=s(46468),N=s(27799),w=s(95920),k=s(68473),M=s(82586),C=s(9114),S=s(60131),T=s(24199),I=s(97415),P=s(10901),L=s(21425),F=s(78489),E=s(12514),O=s(21626),D=s(97214),A=s(28241),R=s(58834),z=s(69552),U=s(71876),V=s(84264),B=s(96761),G=s(61994),q=s(85180),K=s(89245),$=s(78355);let J={"/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"},Q=e=>e.includes("/info")||e.includes("/list")?"GET":"POST",W=e=>{let l=Q(e),s=J[e];if(!s){for(let[l,t]of Object.entries(J))if(e.includes(l)){s=t;break}}return s||(s="Access ".concat(e)),{method:l,endpoint:e,description:s,route:e}};var X=e=>{let{teamId:l,accessToken:s,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),[p,g]=(0,j.useState)(!1),b=async()=>{try{if(c(!0),!s)return;let e=await (0,a.getTeamPermissionsCall)(s,l),t=e.all_available_permissions||[];n(t);let i=e.team_member_permissions||[];o(i),g(!1)}catch(e){C.Z.fromBackend("Failed to load permissions"),console.error("Error fetching permissions:",e)}finally{c(!1)}};(0,j.useEffect)(()=>{b()},[l,s]);let _=(e,l)=>{o(l?[...m,e]:m.filter(l=>l!==e)),g(!0)},v=async()=>{try{if(!s)return;x(!0),await (0,a.teamPermissionsUpdateCall)(s,l,m),C.Z.success("Permissions updated successfully"),g(!1)}catch(e){C.Z.fromBackend("Failed to update permissions"),console.error("Error updating permissions:",e)}finally{x(!1)}};if(d)return(0,t.jsx)("div",{className:"p-6 text-center",children:"Loading permissions..."});let f=r.length>0;return(0,t.jsxs)(E.Z,{className:"bg-white shadow-md rounded-md p-6",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center border-b pb-4 mb-6",children:[(0,t.jsx)(B.Z,{className:"mb-2 sm:mb-0",children:"Member Permissions"}),i&&p&&(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)(h.ZP,{icon:(0,t.jsx)(K.Z,{}),onClick:()=>{b()},children:"Reset"}),(0,t.jsxs)(F.Z,{onClick:v,loading:u,className:"flex items-center gap-2",children:[(0,t.jsx)($.Z,{})," Save Changes"]})]})]}),(0,t.jsx)(V.Z,{className:"mb-6 text-gray-600",children:"Control what team members can do when they are not team admins."}),f?(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(O.Z,{className:" min-w-full",children:[(0,t.jsx)(R.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(z.Z,{children:"Method"}),(0,t.jsx)(z.Z,{children:"Endpoint"}),(0,t.jsx)(z.Z,{children:"Description"}),(0,t.jsx)(z.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:"Allow Access"})]})}),(0,t.jsx)(D.Z,{children:r.map(e=>{let l=W(e);return(0,t.jsxs)(U.Z,{className:"hover:bg-gray-50 transition-colors",children:[(0,t.jsx)(A.Z,{children:(0,t.jsx)("span",{className:"px-2 py-1 rounded text-xs font-medium ".concat("GET"===l.method?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"),children:l.method})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)("span",{className:"font-mono text-sm text-gray-800",children:l.endpoint})}),(0,t.jsx)(A.Z,{className:"text-gray-700",children:l.description}),(0,t.jsx)(A.Z,{className:"sticky right-0 bg-white shadow-[-4px_0_4px_-4px_rgba(0,0,0,0.1)] text-center",children:(0,t.jsx)(G.Z,{checked:m.includes(e),onChange:l=>_(e,l.target.checked),disabled:!i})})]},e)})})]})}):(0,t.jsx)("div",{className:"py-12",children:(0,t.jsx)(q.Z,{description:"No permissions available"})})]})},Y=s(47323),H=s(53410),ee=s(74998),el=e=>{let{teamData:l,canEditTeam:s,handleMemberDelete:i,setSelectedEditMember:a,setIsEditMemberModalVisible:n,setIsAddMemberModalVisible:o}=e,d=e=>{if(null==e)return"0";if("number"==typeof e){let l=Number(e);return l===Math.floor(l)?l.toString():(0,r.pw)(l,8).replace(/\.?0+$/,"")}return"0"},c=e=>{if(!e)return 0;let s=l.team_memberships.find(l=>l.user_id===e);return(null==s?void 0:s.spend)||0},u=e=>{var s;if(!e)return null;let t=l.team_memberships.find(l=>l.user_id===e);console.log("membership=".concat(t));let i=null==t?void 0:null===(s=t.litellm_budget_table)||void 0===s?void 0:s.max_budget;return null==i?null:d(i)},h=e=>{var s,t;if(!e)return"No Limits";let i=l.team_memberships.find(l=>l.user_id===e),a=null==i?void 0:null===(s=i.litellm_budget_table)||void 0===s?void 0:s.rpm_limit,r=null==i?void 0:null===(t=i.litellm_budget_table)||void 0===t?void 0:t.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,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(E.Z,{className:"w-full mx-auto flex-auto overflow-auto max-h-[50vh]",children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)(O.Z,{className:"min-w-full",children:[(0,t.jsx)(R.Z,{children:(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(z.Z,{children:"User ID"}),(0,t.jsx)(z.Z,{children:"User Email"}),(0,t.jsx)(z.Z,{children:"Role"}),(0,t.jsxs)(z.Z,{children:["Team Member Spend (USD)"," ",(0,t.jsx)(g.Z,{title:"This is the amount spent by a user in the team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(z.Z,{children:"Team Member Budget (USD)"}),(0,t.jsxs)(z.Z,{children:["Team Member Rate Limits"," ",(0,t.jsx)(g.Z,{title:"Rate limits for this member's usage within this team.",children:(0,t.jsx)(m.Z,{})})]}),(0,t.jsx)(z.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:"Actions"})]})}),(0,t.jsx)(D.Z,{children:l.team_info.members_with_roles.map((e,m)=>(0,t.jsxs)(U.Z,{children:[(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.user_id})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.user_email?e.user_email:"No Email"})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:e.role})}),(0,t.jsx)(A.Z,{children:(0,t.jsxs)(V.Z,{className:"font-mono",children:["$",(0,r.pw)(c(e.user_id),4)]})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:u(e.user_id)?"$".concat((0,r.pw)(Number(u(e.user_id)),4)):"No Limit"})}),(0,t.jsx)(A.Z,{children:(0,t.jsx)(V.Z,{className:"font-mono",children:h(e.user_id)})}),(0,t.jsx)(A.Z,{className:"sticky right-0 bg-white z-10 border-l border-gray-200",children:s&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(Y.Z,{icon:H.Z,size:"sm",onClick:()=>{var s,t,i;let r=l.team_memberships.find(l=>l.user_id===e.user_id);a({...e,max_budget_in_team:(null==r?void 0:null===(s=r.litellm_budget_table)||void 0===s?void 0:s.max_budget)||null,tpm_limit:(null==r?void 0:null===(t=r.litellm_budget_table)||void 0===t?void 0:t.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,t.jsx)(Y.Z,{icon:ee.Z,size:"sm",onClick:()=>i(e),className:"cursor-pointer hover:text-red-600"})]})})]},m))})]})})}),(0,t.jsx)(F.Z,{onClick:()=>o(!0),children:"Add Member"})]})};let es=(e,l)=>{let s=[];return s=e?e.models.includes("all-proxy-models")?l:e.models.length>0?e.models:l:l,(0,y.Ob)(s,l)};var et=e=>{var l,s,F,E,O,D,A,R,z,U,V,B,G,q,K,$,J,Q,W,Y,H;let ee;let{teamId:et,onClose:ei,accessToken:ea,is_team_admin:er,is_proxy_admin:en,userModels:em,editTeam:eo,premiumUser:ed=!1,onUpdate:ec}=e,[eu,eh]=(0,j.useState)(null),[ex,ep]=(0,j.useState)(!0),[eg,eb]=(0,j.useState)(!1),[e_]=c.Z.useForm(),[ev,ej]=(0,j.useState)(!1),[ef,eZ]=(0,j.useState)(null),[ey,eN]=(0,j.useState)(!1),[ew,ek]=(0,j.useState)([]),[eM,eC]=(0,j.useState)(!1),[eS,eT]=(0,j.useState)({}),[eI,eP]=(0,j.useState)([]),[eL,eF]=(0,j.useState)(null),[eE,eO]=(0,j.useState)(!1),[eD,eA]=(0,j.useState)(!1),[eR,ez]=(0,j.useState)(!1),[eU,eV]=(0,j.useState)(null);console.log("userModels in team info",em);let eB=er||en,eG=async()=>{try{if(ep(!0),!ea)return;let e=await (0,a.teamInfoCall)(ea,et);eh(e)}catch(e){C.Z.fromBackend("Failed to load team information"),console.error("Error fetching team info:",e)}finally{ep(!1)}};(0,j.useEffect)(()=>{eG()},[et,ea]),(0,j.useEffect)(()=>{(async()=>{var e;if(!ea||!(null==eu?void 0:null===(e=eu.team_info)||void 0===e?void 0:e.organization_id)){eV(null);return}try{let e=await (0,a.organizationInfoCall)(ea,eu.team_info.organization_id);eV(e)}catch(e){console.error("Error fetching organization info:",e),eV(null)}})()},[ea,null==eu?void 0:null===(l=eu.team_info)||void 0===l?void 0:l.organization_id]);let eq=(0,j.useMemo)(()=>es(eU,em),[eU,em]);(0,j.useEffect)(()=>{(async()=>{try{if(!ea)return;let e=(await (0,a.getGuardrailsList)(ea)).guardrails.map(e=>e.guardrail_name);eP(e)}catch(e){console.error("Failed to fetch guardrails:",e)}})()},[ea]);let eK=async e=>{try{if(null==ea)return;let l={user_email:e.user_email,user_id:e.user_id,role:e.role};await (0,a.teamMemberAddCall)(ea,et,l),C.Z.success("Team member added successfully"),eb(!1),e_.resetFields();let s=await (0,a.teamInfoCall)(ea,et);eh(s),ec(s)}catch(i){var l,s,t;let e="Failed to add team member";(null==i?void 0:null===(t=i.raw)||void 0===t?void 0:null===(s=t.detail)||void 0===s?void 0:null===(l=s.error)||void 0===l?void 0:l.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),C.Z.fromBackend(e),console.error("Error adding team member:",i)}},e$=async e=>{try{if(null==ea)return;let l={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:",l),u.ZP.destroy(),await (0,a.teamMemberUpdateCall)(ea,et,l),C.Z.success("Team member updated successfully"),ej(!1);let s=await (0,a.teamInfoCall)(ea,et);eh(s),ec(s)}catch(t){var l,s;let e="Failed to update team member";(null==t?void 0:null===(s=t.raw)||void 0===s?void 0:null===(l=s.detail)||void 0===l?void 0:l.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==t?void 0:t.message)&&(e=t.message),ej(!1),u.ZP.destroy(),C.Z.fromBackend(e),console.error("Error updating team member:",t)}},eJ=async()=>{if(eL&&ea){eA(!0);try{await (0,a.teamMemberDeleteCall)(ea,et,eL),C.Z.success("Team member removed successfully");let e=await (0,a.teamInfoCall)(ea,et);eh(e),ec(e)}catch(e){C.Z.fromBackend("Failed to remove team member"),console.error("Error removing team member:",e)}finally{eA(!1),eO(!1),eF(null)}}},eQ=async e=>{try{if(!ea)return;ez(!0);let l={};try{l=e.metadata?JSON.parse(e.metadata):{}}catch(e){C.Z.fromBackend("Invalid JSON in metadata field");return}let s=e=>null==e||"string"==typeof e&&""===e.trim()||"number"==typeof e&&Number.isNaN(e)?null:e,t={team_id:et,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||[]},organization_id:e.organization_id};t.max_budget=(0,n.C)(t.max_budget),void 0!==e.team_member_budget&&(t.team_member_budget=Number(e.team_member_budget)),void 0!==e.team_member_key_duration&&(t.team_member_key_duration=e.team_member_key_duration),(void 0!==e.team_member_tpm_limit||void 0!==e.team_member_rpm_limit)&&(t.team_member_tpm_limit=s(e.team_member_tpm_limit),t.team_member_rpm_limit=s(e.team_member_rpm_limit));let{servers:i,accessGroups:r}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]},m=new Set(i||[]),o=Object.fromEntries(Object.entries(e.mcp_tool_permissions||{}).filter(e=>{let[l]=e;return m.has(l)}));t.object_permission={},i&&(t.object_permission.mcp_servers=i),r&&(t.object_permission.mcp_access_groups=r),o&&(t.object_permission.mcp_tool_permissions=o),delete e.mcp_servers_and_groups,delete e.mcp_tool_permissions;let{agents:d,accessGroups:c}=e.agents_and_groups||{agents:[],accessGroups:[]};d&&d.length>0&&(t.object_permission.agents=d),c&&c.length>0&&(t.object_permission.agent_access_groups=c),delete e.agents_and_groups,await (0,a.teamUpdateCall)(ea,t),C.Z.success("Team settings updated successfully"),eN(!1),eG()}catch(e){console.error("Error updating team:",e)}finally{ez(!1)}};if(ex)return(0,t.jsx)("div",{className:"p-4",children:"Loading..."});if(!(null==eu?void 0:eu.team_info))return(0,t.jsx)("div",{className:"p-4",children:"Team not found"});let{team_info:eW}=eu,eX=async(e,l)=>{await (0,r.vQ)(e)&&(eT(e=>({...e,[l]:!0})),setTimeout(()=>{eT(e=>({...e,[l]:!1}))},2e3))};return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(d.zx,{icon:o.Z,variant:"light",onClick:ei,className:"mb-4",children:"Back to Teams"}),(0,t.jsx)(d.Dx,{children:eW.team_alias}),(0,t.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,t.jsx)(d.xv,{className:"text-gray-500 font-mono",children:eW.team_id}),(0,t.jsx)(h.ZP,{type:"text",size:"small",icon:eS["team-id"]?(0,t.jsx)(_.Z,{size:12}):(0,t.jsx)(v.Z,{size:12}),onClick:()=>eX(eW.team_id,"team-id"),className:"left-2 z-10 transition-all duration-200 ".concat(eS["team-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]})]})}),(0,t.jsxs)(d.v0,{defaultIndex:eo?3:0,children:[(0,t.jsx)(d.td,{className:"mb-4",children:[(0,t.jsx)(d.OK,{children:"Overview"},"overview"),...eB?[(0,t.jsx)(d.OK,{children:"Members"},"members"),(0,t.jsx)(d.OK,{children:"Member Permissions"},"member-permissions"),(0,t.jsx)(d.OK,{children:"Settings"},"settings")]:[]]}),(0,t.jsxs)(d.nP,{children:[(0,t.jsx)(d.x4,{children:(0,t.jsxs)(d.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Budget Status"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.Dx,{children:["$",(0,r.pw)(eW.spend,4)]}),(0,t.jsxs)(d.xv,{children:["of ",null===eW.max_budget?"Unlimited":"$".concat((0,r.pw)(eW.max_budget,4))]}),eW.budget_duration&&(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Reset: ",eW.budget_duration]}),(0,t.jsx)("br",{}),eW.team_member_budget_table&&(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Team Member Budget: $",(0,r.pw)(eW.team_member_budget_table.max_budget,4)]})]})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.xv,{children:["TPM: ",eW.tpm_limit||"Unlimited"]}),(0,t.jsxs)(d.xv,{children:["RPM: ",eW.rpm_limit||"Unlimited"]}),eW.max_parallel_requests&&(0,t.jsxs)(d.xv,{children:["Max Parallel Requests: ",eW.max_parallel_requests]})]})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:0===eW.models.length?(0,t.jsx)(d.Ct,{color:"red",children:"All proxy models"}):eW.models.map((e,l)=>(0,t.jsx)(d.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)(d.Zb,{children:[(0,t.jsx)(d.xv,{className:"font-semibold text-gray-900",children:"Virtual Keys"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(d.xv,{children:["User Keys: ",eu.keys.filter(e=>e.user_id).length]}),(0,t.jsxs)(d.xv,{children:["Service Account Keys: ",eu.keys.filter(e=>!e.user_id).length]}),(0,t.jsxs)(d.xv,{className:"text-gray-500",children:["Total: ",eu.keys.length]})]})]}),(0,t.jsx)(S.Z,{objectPermission:eW.object_permission,variant:"card",accessToken:ea}),(0,t.jsx)(N.Z,{loggingConfigs:(null===(s=eW.metadata)||void 0===s?void 0:s.logging)||[],disabledCallbacks:[],variant:"card"})]})}),(0,t.jsx)(d.x4,{children:(0,t.jsx)(el,{teamData:eu,canEditTeam:eB,handleMemberDelete:e=>{eF(e),eO(!0)},setSelectedEditMember:eZ,setIsEditMemberModalVisible:ej,setIsAddMemberModalVisible:eb})}),eB&&(0,t.jsx)(d.x4,{children:(0,t.jsx)(X,{teamId:et,accessToken:ea,canEditTeam:eB})}),(0,t.jsx)(d.x4,{children:(0,t.jsxs)(d.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)(d.Dx,{children:"Team Settings"}),eB&&!ey&&(0,t.jsx)(d.zx,{onClick:()=>eN(!0),children:"Edit Settings"})]}),ey?(0,t.jsxs)(c.Z,{form:e_,onFinish:eQ,initialValues:{...eW,team_alias:eW.team_alias,models:eW.models,tpm_limit:eW.tpm_limit,rpm_limit:eW.rpm_limit,max_budget:eW.max_budget,budget_duration:eW.budget_duration,team_member_tpm_limit:null===(F=eW.team_member_budget_table)||void 0===F?void 0:F.tpm_limit,team_member_rpm_limit:null===(E=eW.team_member_budget_table)||void 0===E?void 0:E.rpm_limit,guardrails:(null===(O=eW.metadata)||void 0===O?void 0:O.guardrails)||[],disable_global_guardrails:(null===(D=eW.metadata)||void 0===D?void 0:D.disable_global_guardrails)||!1,metadata:eW.metadata?JSON.stringify((e=>{let{logging:l,...s}=e;return s})(eW.metadata),null,2):"",logging_settings:(null===(A=eW.metadata)||void 0===A?void 0:A.logging)||[],organization_id:eW.organization_id,vector_stores:(null===(R=eW.object_permission)||void 0===R?void 0:R.vector_stores)||[],mcp_servers:(null===(z=eW.object_permission)||void 0===z?void 0:z.mcp_servers)||[],mcp_access_groups:(null===(U=eW.object_permission)||void 0===U?void 0:U.mcp_access_groups)||[],mcp_servers_and_groups:{servers:(null===(V=eW.object_permission)||void 0===V?void 0:V.mcp_servers)||[],accessGroups:(null===(B=eW.object_permission)||void 0===B?void 0:B.mcp_access_groups)||[]},mcp_tool_permissions:(null===(G=eW.object_permission)||void 0===G?void 0:G.mcp_tool_permissions)||{},agents_and_groups:{agents:(null===(q=eW.object_permission)||void 0===q?void 0:q.agents)||[],accessGroups:(null===(K=eW.object_permission)||void 0===K?void 0:K.agent_access_groups)||[]}},layout:"vertical",children:[(0,t.jsx)(c.Z.Item,{label:"Team Name",name:"team_alias",rules:[{required:!0,message:"Please input a team name"}],children:(0,t.jsx)(x.default,{type:""})}),(0,t.jsx)(c.Z.Item,{label:"Models",name:"models",rules:[{required:!0,message:"Please select at least one model"}],children:(0,t.jsxs)(p.default,{mode:"multiple",placeholder:"Select models",children:[(ee=!1,eU?(0===eU.models.length||eU.models.includes("all-proxy-models"))&&(ee=!0):ee=en||em.includes("all-proxy-models"),ee?(0,t.jsx)(p.default.Option,{value:"all-proxy-models",children:"All Proxy Models"},"all-proxy-models"):null),!eU||eU.models.includes("no-default-models")?(0,t.jsx)(p.default.Option,{value:"no-default-models",children:"No Default Models"},"no-default-models"):null,Array.from(new Set(eq)).map((e,l)=>(0,t.jsx)(p.default.Option,{value:e,children:(0,y.W0)(e)},l))]})}),(0,t.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.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,t.jsx)(T.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.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,t.jsx)(d.oi,{placeholder:"e.g., 30d"})}),(0,t.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,t.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 1000"})}),(0,t.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,t.jsx)(T.Z,{step:1,style:{width:"100%"},placeholder:"e.g., 100"})}),(0,t.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(p.default,{placeholder:"n/a",children:[(0,t.jsx)(p.default.Option,{value:"24h",children:"daily"}),(0,t.jsx)(p.default.Option,{value:"7d",children:"weekly"}),(0,t.jsx)(p.default.Option,{value:"30d",children:"monthly"})]})}),(0,t.jsx)(c.Z.Item,{label:"Tokens per minute Limit (TPM)",name:"tpm_limit",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:"Requests per minute Limit (RPM)",name:"rpm_limit",children:(0,t.jsx)(T.Z,{step:1,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Guardrails"," ",(0,t.jsx)(g.Z,{title:"Setup your first guardrail",children:(0,t.jsx)("a",{href:"https://docs.litellm.ai/docs/proxy/guardrails/quick_start",target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})})]}),name:"guardrails",help:"Select existing guardrails or enter new ones",children:(0,t.jsx)(p.default,{mode:"tags",placeholder:"Select or enter guardrails",options:eI.map(e=>({value:e,label:e}))})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(g.Z,{title:"When enabled, this team will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",help:"Bypass global guardrails for this team",children:(0,t.jsx)(b.Z,{checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,t.jsx)(I.Z,{onChange:e=>e_.setFieldValue("vector_stores",e),value:e_.getFieldValue("vector_stores"),accessToken:ea||"",placeholder:"Select vector stores"})}),(0,t.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(Z.Z,{onChange:e=>e_.setFieldValue("allowed_passthrough_routes",e),value:e_.getFieldValue("allowed_passthrough_routes"),accessToken:ea||"",placeholder:"Select pass through routes"})}),(0,t.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(w.Z,{onChange:e=>e_.setFieldValue("mcp_servers_and_groups",e),value:e_.getFieldValue("mcp_servers_and_groups"),accessToken:ea||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(x.default,{type:"hidden"})}),(0,t.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,l)=>e.mcp_servers_and_groups!==l.mcp_servers_and_groups||e.mcp_tool_permissions!==l.mcp_tool_permissions,children:()=>{var e;return(0,t.jsx)("div",{className:"mb-6",children:(0,t.jsx)(k.Z,{accessToken:ea||"",selectedServers:(null===(e=e_.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:e_.getFieldValue("mcp_tool_permissions")||{},onChange:e=>e_.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,t.jsx)(c.Z.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,t.jsx)(M.Z,{onChange:e=>e_.setFieldValue("agents_and_groups",e),value:e_.getFieldValue("agents_and_groups"),accessToken:ea||"",placeholder:"Select agents or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{label:"Organization ID",name:"organization_id",children:(0,t.jsx)(x.default,{type:"",disabled:!0})}),(0,t.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(L.Z,{value:e_.getFieldValue("logging_settings"),onChange:e=>e_.setFieldValue("logging_settings",e)})}),(0,t.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(x.default.TextArea,{rows:10})}),(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)(d.zx,{variant:"secondary",onClick:()=>eN(!1),disabled:eR,children:"Cancel"}),(0,t.jsx)(d.zx,{type:"submit",loading:eR,children:"Save Changes"})]})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team Name"}),(0,t.jsx)("div",{children:eW.team_alias})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team ID"}),(0,t.jsx)("div",{className:"font-mono",children:eW.team_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Created At"}),(0,t.jsx)("div",{children:new Date(eW.created_at).toLocaleString()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:eW.models.map((e,l)=>(0,t.jsx)(d.Ct,{color:"red",children:e},l))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)("div",{children:["TPM: ",eW.tpm_limit||"Unlimited"]}),(0,t.jsxs)("div",{children:["RPM: ",eW.rpm_limit||"Unlimited"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Team Budget"}),(0,t.jsxs)("div",{children:["Max Budget:"," ",null!==eW.max_budget?"$".concat((0,r.pw)(eW.max_budget,4)):"No Limit"]}),(0,t.jsxs)("div",{children:["Budget Reset: ",eW.budget_duration||"Never"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)(d.xv,{className:"font-medium",children:["Team Member Settings"," ",(0,t.jsx)(g.Z,{title:"These are limits on individual team members",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),(0,t.jsxs)("div",{children:["Max Budget: ",(null===($=eW.team_member_budget_table)||void 0===$?void 0:$.max_budget)||"No Limit"]}),(0,t.jsxs)("div",{children:["Key Duration: ",(null===(J=eW.metadata)||void 0===J?void 0:J.team_member_key_duration)||"No Limit"]}),(0,t.jsxs)("div",{children:["TPM Limit: ",(null===(Q=eW.team_member_budget_table)||void 0===Q?void 0:Q.tpm_limit)||"No Limit"]}),(0,t.jsxs)("div",{children:["RPM Limit: ",(null===(W=eW.team_member_budget_table)||void 0===W?void 0:W.rpm_limit)||"No Limit"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Organization ID"}),(0,t.jsx)("div",{children:eW.organization_id})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Status"}),(0,t.jsx)(d.Ct,{color:eW.blocked?"red":"green",children:eW.blocked?"Blocked":"Active"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(d.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,t.jsx)("div",{children:(null===(Y=eW.metadata)||void 0===Y?void 0:Y.disable_global_guardrails)===!0?(0,t.jsx)(d.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,t.jsx)(d.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,t.jsx)(S.Z,{objectPermission:eW.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:ea}),(0,t.jsx)(N.Z,{loggingConfigs:(null===(H=eW.metadata)||void 0===H?void 0:H.logging)||[],disabledCallbacks:[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]}),(0,t.jsx)(P.Z,{visible:ev,onCancel:()=>ej(!1),onSubmit:e$,initialData:ef,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,t.jsxs)("span",{children:["Team Member Budget (USD)"," ",(0,t.jsx)(g.Z,{title:"Maximum amount in USD this member can spend within this team. This is separate from any global user budget limits",children:(0,t.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,t.jsxs)("span",{children:["Team Member TPM Limit"," ",(0,t.jsx)(g.Z,{title:"Maximum tokens per minute this member can use within this team. This is separate from any global user TPM limit",children:(0,t.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,t.jsxs)("span",{children:["Team Member RPM Limit"," ",(0,t.jsx)(g.Z,{title:"Maximum requests per minute this member can make within this team. This is separate from any global user RPM limit",children:(0,t.jsx)(m.Z,{style:{marginLeft:"4px"}})})]}),type:"numerical",step:1,min:0,placeholder:"Requests per minute limit for this member in this team"}]}}),(0,t.jsx)(i.Z,{isVisible:eg,onCancel:()=>eb(!1),onSubmit:eK,accessToken:ea}),(0,t.jsx)(f.Z,{isOpen:eE,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==eL?void 0:eL.user_id,code:!0},{label:"Email",value:null==eL?void 0:eL.user_email},{label:"Role",value:null==eL?void 0:eL.role}],onCancel:()=>{eO(!1),eF(null)},onOk:eJ,confirmLoading:eD})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2106-df512fb0bae97b5c.js b/litellm/proxy/_experimental/out/_next/static/chunks/2106-df512fb0bae97b5c.js deleted file mode 100644 index 1d1be368cc..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2106-df512fb0bae97b5c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2106],{10900:function(t,e,r){var s=r(2265);let i=s.forwardRef(function(t,e){return s.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),s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});e.Z=i},87045:function(t,e,r){r.d(e,{j:function(){return n}});var s=r(24112),i=r(45345),n=new class extends s.l{#t;#e;#r;constructor(){super(),this.#r=t=>{if(!i.sk&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#t!==t&&(this.#t=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}}},18238:function(t,e,r){r.d(e,{Vr:function(){return i}});var s=r(84554).Hp,i=function(){let t=[],e=0,r=t=>{t()},i=t=>{t()},n=s,o=s=>{e?t.push(s):n(()=>{r(s)})},u=()=>{let e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{r(t)})})})};return{batch:t=>{let r;e++;try{r=t()}finally{--e||u()}return r},batchCalls:t=>(...e)=>{o(()=>{t(...e)})},schedule:o,setNotifyFunction:t=>{r=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}()},57853:function(t,e,r){r.d(e,{N:function(){return n}});var s=r(24112),i=r(45345),n=new class extends s.l{#s=!0;#e;#r;constructor(){super(),this.#r=t=>{if(!i.sk&&window.addEventListener){let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(t){this.#r=t,this.#e?.(),this.#e=t(this.setOnline.bind(this))}setOnline(t){this.#s!==t&&(this.#s=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#s}}},21733:function(t,e,r){r.d(e,{A:function(){return u},z:function(){return a}});var s=r(45345),i=r(18238),n=r(11255),o=r(7989),u=class extends o.F{#i;#n;#o;#u;#a;#c;#h;constructor(t){super(),this.#h=!1,this.#c=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#u=t.client,this.#o=this.#u.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#i=h(this.options),this.state=t.state??this.#i,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(t){if(this.options={...this.#c,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=h(this.options);void 0!==t.data&&(this.setState(c(t.data,t.dataUpdatedAt)),this.#i=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#o.remove(this)}setData(t,e){let r=(0,s.oE)(this.state.data,t,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),r}setState(t,e){this.#l({type:"setState",state:t,setStateOptions:e})}cancel(t){let e=this.#a?.promise;return this.#a?.cancel(t),e?e.then(s.ZT).catch(s.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#i)}isActive(){return this.observers.some(t=>!1!==(0,s.Nc)(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===s.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===(0,s.KC)(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!(0,s.Kp)(this.state.dataUpdatedAt,t))}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#a&&(this.#h?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#o.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(t,e){if("idle"!==this.state.fetchStatus&&this.#a?.status()!=="rejected"){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let r=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#h=!0,r.signal)})},o=()=>{let t=(0,s.cG)(this.options,e),r=(()=>{let t={client:this.#u,queryKey:this.queryKey,meta:this.meta};return i(t),t})();return(this.#h=!1,this.options.persister)?this.options.persister(t,r,this):t(r)},u=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:o};return i(t),t})();this.options.behavior?.onFetch(u,this),this.#n=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#a=(0,n.Mz)({initialPromise:e?.initialPromise,fn:u.fetchFn,onCancel:t=>{t instanceof n.p8&&t.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(t,e)=>{this.#l({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{let t=await this.#a.start();if(void 0===t)throw Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#o.config.onSuccess?.(t,this),this.#o.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof n.p8){if(t.silent)return this.#a.promise;if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#l({type:"error",error:t}),this.#o.config.onError?.(t,this),this.#o.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#l(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...a(e.data,this.options),fetchMeta:t.meta??null};case"success":let r={...e,...c(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=t.manual?r:void 0,r;case"error":let s=t.error;return{...e,error:s,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),i.Vr.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#o.notify({query:this,type:"updated",action:t})})}};function a(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,n.Kw)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function c(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function h(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,r=void 0!==e,s=r?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},7989:function(t,e,r){r.d(e,{F:function(){return n}});var s=r(84554),i=r(45345),n=class{#d;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.PN)(this.gcTime)&&(this.#d=s.mr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(i.sk?1/0:3e5))}clearGcTimeout(){this.#d&&(s.mr.clearTimeout(this.#d),this.#d=void 0)}}},11255:function(t,e,r){r.d(e,{Kw:function(){return a},Mz:function(){return h},p8:function(){return c}});var s=r(87045),i=r(57853),n=r(16803),o=r(45345);function u(t){return Math.min(1e3*2**t,3e4)}function a(t){return(t??"online")!=="online"||i.N.isOnline()}var c=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function h(t){let e,r=!1,h=0,l=(0,n.O)(),d=()=>"pending"!==l.status,f=()=>s.j.isFocused()&&("always"===t.networkMode||i.N.isOnline())&&t.canRun(),p=()=>a(t.networkMode)&&t.canRun(),y=t=>{d()||(e?.(),l.resolve(t))},v=t=>{d()||(e?.(),l.reject(t))},b=()=>new Promise(r=>{e=t=>{(d()||f())&&r(t)},t.onPause?.()}).then(()=>{e=void 0,d()||t.onContinue?.()}),m=()=>{let e;if(d())return;let s=0===h?t.initialPromise:void 0;try{e=s??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(y).catch(e=>{if(d())return;let s=t.retry??(o.sk?0:3),i=t.retryDelay??u,n="function"==typeof i?i(h,e):i,a=!0===s||"number"==typeof s&&hf()?void 0:b()).then(()=>{r?v(e):m()})})};return{promise:l,status:()=>l.status,cancel:e=>{if(!d()){let r=new c(e);v(r),t.onCancel?.(r)}},continue:()=>(e?.(),l),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:p,start:()=>(p()?m():b().then(m),l)}}},24112:function(t,e,r){r.d(e,{l:function(){return s}});var s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},16803:function(t,e,r){r.d(e,{O:function(){return s}});function s(){let t,e;let r=new Promise((r,s)=>{t=r,e=s});function s(t){Object.assign(r,t),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=e=>{s({status:"fulfilled",value:e}),t(e)},r.reject=t=>{s({status:"rejected",reason:t}),e(t)},r}},84554:function(t,e,r){r.d(e,{Hp:function(){return n},mr:function(){return i}});var s={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},i=new class{#f=s;#p=!1;setTimeoutProvider(t){this.#f=t}setTimeout(t,e){return this.#f.setTimeout(t,e)}clearTimeout(t){this.#f.clearTimeout(t)}setInterval(t,e){return this.#f.setInterval(t,e)}clearInterval(t){this.#f.clearInterval(t)}};function n(t){setTimeout(t,0)}},45345:function(t,e,r){r.d(e,{CN:function(){return T},Ht:function(){return w},KC:function(){return c},Kp:function(){return a},L3:function(){return Q},Nc:function(){return h},PN:function(){return u},Rm:function(){return f},SE:function(){return o},VS:function(){return b},VX:function(){return C},X7:function(){return d},Ym:function(){return p},ZT:function(){return n},_v:function(){return O},_x:function(){return l},cG:function(){return F},oE:function(){return S},sk:function(){return i},to:function(){return y}});var s=r(84554),i="undefined"==typeof window||"Deno"in globalThis;function n(){}function o(t,e){return"function"==typeof t?t(e):t}function u(t){return"number"==typeof t&&t>=0&&t!==1/0}function a(t,e){return Math.max(t+(e||0)-Date.now(),0)}function c(t,e){return"function"==typeof t?t(e):t}function h(t,e){return"function"==typeof t?t(e):t}function l(t,e){let{type:r="all",exact:s,fetchStatus:i,predicate:n,queryKey:o,stale:u}=t;if(o){if(s){if(e.queryHash!==f(o,e.options))return!1}else if(!y(e.queryKey,o))return!1}if("all"!==r){let t=e.isActive();if("active"===r&&!t||"inactive"===r&&t)return!1}return("boolean"!=typeof u||e.isStale()===u)&&(!i||i===e.state.fetchStatus)&&(!n||!!n(e))}function d(t,e){let{exact:r,status:s,predicate:i,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(r){if(p(e.options.mutationKey)!==p(n))return!1}else if(!y(e.options.mutationKey,n))return!1}return(!s||e.state.status===s)&&(!i||!!i(e))}function f(t,e){return(e?.queryKeyHashFn||p)(t)}function p(t){return JSON.stringify(t,(t,e)=>g(e)?Object.keys(e).sort().reduce((t,r)=>(t[r]=e[r],t),{}):e)}function y(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(r=>y(t[r],e[r]))}var v=Object.prototype.hasOwnProperty;function b(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function m(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function g(t){if(!R(t))return!1;let e=t.constructor;if(void 0===e)return!0;let r=e.prototype;return!!(R(r)&&r.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(t)===Object.prototype}function R(t){return"[object Object]"===Object.prototype.toString.call(t)}function O(t){return new Promise(e=>{s.mr.setTimeout(e,t)})}function S(t,e,r){return"function"==typeof r.structuralSharing?r.structuralSharing(t,e):!1!==r.structuralSharing?function t(e,r){if(e===r)return e;let s=m(e)&&m(r);if(!s&&!(g(e)&&g(r)))return r;let i=(s?e:Object.keys(e)).length,n=s?r:Object.keys(r),o=n.length,u=s?Array(o):{},a=0;for(let c=0;cr?s.slice(1):s}function w(t,e,r=0){let s=[e,...t];return r&&s.length>r?s.slice(0,-1):s}var T=Symbol();function F(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==T?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function Q(t,e){return"function"==typeof t?t(...e):!!t}},11713:function(t,e,r){let s;r.d(e,{a:function(){return E}});var i=r(87045),n=r(18238),o=r(21733),u=r(24112),a=r(16803),c=r(45345),h=r(84554),l=class extends u.l{constructor(t,e){super(),this.options=e,this.#u=t,this.#y=null,this.#v=(0,a.O)(),this.bindMethods(),this.setOptions(e)}#u;#b=void 0;#m=void 0;#g=void 0;#R;#O;#v;#y;#S;#C;#w;#T;#F;#Q;#I=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),d(this.#b,this.options)?this.#E():this.updateResult(),this.#k())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return f(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return f(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#U(),this.#P(),this.#b.removeObserver(this)}setOptions(t){let e=this.options,r=this.#b;if(this.options=this.#u.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,c.Nc)(this.options.enabled,this.#b))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#b.setOptions(this.options),e._defaulted&&!(0,c.VS)(this.options,e)&&this.#u.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let s=this.hasListeners();s&&p(this.#b,r,this.options,e)&&this.#E(),this.updateResult(),s&&(this.#b!==r||(0,c.Nc)(this.options.enabled,this.#b)!==(0,c.Nc)(e.enabled,this.#b)||(0,c.KC)(this.options.staleTime,this.#b)!==(0,c.KC)(e.staleTime,this.#b))&&this.#q();let i=this.#D();s&&(this.#b!==r||(0,c.Nc)(this.options.enabled,this.#b)!==(0,c.Nc)(e.enabled,this.#b)||i!==this.#Q)&&this.#x(i)}getOptimisticResult(t){let e=this.#u.getQueryCache().build(this.#u,t),r=this.createResult(e,t);return(0,c.VS)(this.getCurrentResult(),r)||(this.#g=r,this.#O=this.options,this.#R=this.#b.state),r}getCurrentResult(){return this.#g}trackResult(t,e){return new Proxy(t,{get:(t,r)=>(this.trackProp(r),e?.(r),"promise"!==r||(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,r))})}trackProp(t){this.#I.add(t)}getCurrentQuery(){return this.#b}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){let e=this.#u.defaultQueryOptions(t),r=this.#u.getQueryCache().build(this.#u,e);return r.fetch().then(()=>this.createResult(r,e))}fetch(t){return this.#E({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#g))}#E(t){this.#j();let e=this.#b.fetch(this.options,t);return t?.throwOnError||(e=e.catch(c.ZT)),e}#q(){this.#U();let t=(0,c.KC)(this.options.staleTime,this.#b);if(c.sk||this.#g.isStale||!(0,c.PN)(t))return;let e=(0,c.Kp)(this.#g.dataUpdatedAt,t);this.#T=h.mr.setTimeout(()=>{this.#g.isStale||this.updateResult()},e+1)}#D(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#x(t){this.#P(),this.#Q=t,!c.sk&&!1!==(0,c.Nc)(this.options.enabled,this.#b)&&(0,c.PN)(this.#Q)&&0!==this.#Q&&(this.#F=h.mr.setInterval(()=>{(this.options.refetchIntervalInBackground||i.j.isFocused())&&this.#E()},this.#Q))}#k(){this.#q(),this.#x(this.#D())}#U(){this.#T&&(h.mr.clearTimeout(this.#T),this.#T=void 0)}#P(){this.#F&&(h.mr.clearInterval(this.#F),this.#F=void 0)}createResult(t,e){let r;let s=this.#b,i=this.options,n=this.#g,u=this.#R,h=this.#O,l=t!==s?t.state:this.#m,{state:f}=t,v={...f},b=!1;if(e._optimisticResults){let r=this.hasListeners(),n=!r&&d(t,e),u=r&&p(t,s,e,i);(n||u)&&(v={...v,...(0,o.z)(f.data,t.options)}),"isRestoring"===e._optimisticResults&&(v.fetchStatus="idle")}let{error:m,errorUpdatedAt:g,status:R}=v;r=v.data;let O=!1;if(void 0!==e.placeholderData&&void 0===r&&"pending"===R){let t;n?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(t=n.data,O=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#w?.state.data,this.#w):e.placeholderData,void 0!==t&&(R="success",r=(0,c.oE)(n?.data,t,e),b=!0)}if(e.select&&void 0!==r&&!O){if(n&&r===u?.data&&e.select===this.#S)r=this.#C;else try{this.#S=e.select,r=e.select(r),r=(0,c.oE)(n?.data,r,e),this.#C=r,this.#y=null}catch(t){this.#y=t}}this.#y&&(m=this.#y,r=this.#C,g=Date.now(),R="error");let S="fetching"===v.fetchStatus,C="pending"===R,w="error"===R,T=C&&S,F=void 0!==r,Q={status:R,fetchStatus:v.fetchStatus,isPending:C,isSuccess:"success"===R,isError:w,isInitialLoading:T,isLoading:T,data:r,dataUpdatedAt:v.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>l.dataUpdateCount||v.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!C,isLoadingError:w&&!F,isPaused:"paused"===v.fetchStatus,isPlaceholderData:b,isRefetchError:w&&F,isStale:y(t,e),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,c.Nc)(e.enabled,t)};if(this.options.experimental_prefetchInRender){let e=t=>{"error"===Q.status?t.reject(Q.error):void 0!==Q.data&&t.resolve(Q.data)},r=()=>{e(this.#v=Q.promise=(0,a.O)())},i=this.#v;switch(i.status){case"pending":t.queryHash===s.queryHash&&e(i);break;case"fulfilled":("error"===Q.status||Q.data!==i.value)&&r();break;case"rejected":("error"!==Q.status||Q.error!==i.reason)&&r()}}return Q}updateResult(){let t=this.#g,e=this.createResult(this.#b,this.options);this.#R=this.#b.state,this.#O=this.options,void 0!==this.#R.data&&(this.#w=this.#b),(0,c.VS)(e,t)||(this.#g=e,this.#L({listeners:(()=>{if(!t)return!0;let{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.#I.size)return!0;let s=new Set(r??this.#I);return this.options.throwOnError&&s.add("error"),Object.keys(this.#g).some(e=>this.#g[e]!==t[e]&&s.has(e))})()}))}#j(){let t=this.#u.getQueryCache().build(this.#u,this.options);if(t===this.#b)return;let e=this.#b;this.#b=t,this.#m=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#k()}#L(t){n.Vr.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#g)}),this.#u.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function d(t,e){return!1!==(0,c.Nc)(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)||void 0!==t.state.data&&f(t,e,e.refetchOnMount)}function f(t,e,r){if(!1!==(0,c.Nc)(e.enabled,t)&&"static"!==(0,c.KC)(e.staleTime,t)){let s="function"==typeof r?r(t):r;return"always"===s||!1!==s&&y(t,e)}return!1}function p(t,e,r,s){return(t!==e||!1===(0,c.Nc)(s.enabled,t))&&(!r.suspense||"error"!==t.state.status)&&y(t,r)}function y(t,e){return!1!==(0,c.Nc)(e.enabled,t)&&t.isStaleByTime((0,c.KC)(e.staleTime,t))}var v=r(2265),b=r(29827);r(57437);var m=v.createContext((s=!1,{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s})),g=()=>v.useContext(m),R=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&!e.isReset()&&(t.retryOnMount=!1)},O=t=>{v.useEffect(()=>{t.clearReset()},[t])},S=t=>{let{result:e,errorResetBoundary:r,throwOnError:s,query:i,suspense:n}=t;return e.isError&&!r.isReset()&&!e.isFetching&&i&&(n&&void 0===e.data||(0,c.L3)(s,[e.error,i]))},C=v.createContext(!1),w=()=>v.useContext(C);C.Provider;var T=t=>{if(t.suspense){let e=t=>"static"===t?t:Math.max(t??1e3,1e3),r=t.staleTime;t.staleTime="function"==typeof r?(...t)=>e(r(...t)):e(r),"number"==typeof t.gcTime&&(t.gcTime=Math.max(t.gcTime,1e3))}},F=(t,e)=>t.isLoading&&t.isFetching&&!e,Q=(t,e)=>t?.suspense&&e.isPending,I=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function E(t,e){return function(t,e,r){var s,i,o,u,a;let h=w(),l=g(),d=(0,b.NL)(r),f=d.defaultQueryOptions(t);null===(i=d.getDefaultOptions().queries)||void 0===i||null===(s=i._experimental_beforeQuery)||void 0===s||s.call(i,f),f._optimisticResults=h?"isRestoring":"optimistic",T(f),R(f,l),O(l);let p=!d.getQueryCache().get(f.queryHash),[y]=v.useState(()=>new e(d,f)),m=y.getOptimisticResult(f),C=!h&&!1!==t.subscribed;if(v.useSyncExternalStore(v.useCallback(t=>{let e=C?y.subscribe(n.Vr.batchCalls(t)):c.ZT;return y.updateResult(),e},[y,C]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),v.useEffect(()=>{y.setOptions(f)},[f,y]),Q(f,m))throw I(f,y,l);if(S({result:m,errorResetBoundary:l,throwOnError:f.throwOnError,query:d.getQueryCache().get(f.queryHash),suspense:f.suspense}))throw m.error;if(null===(u=d.getDefaultOptions().queries)||void 0===u||null===(o=u._experimental_afterQuery)||void 0===o||o.call(u,f,m),f.experimental_prefetchInRender&&!c.sk&&F(m,h)){let t=p?I(f,y,l):null===(a=d.getQueryCache().get(f.queryHash))||void 0===a?void 0:a.promise;null==t||t.catch(c.ZT).finally(()=>{y.updateResult()})}return f.notifyOnChangeProps?m:y.trackResult(m)}(t,l,e)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2202-75f4ebfcb55c7701.js b/litellm/proxy/_experimental/out/_next/static/chunks/2202-75f4ebfcb55c7701.js deleted file mode 100644 index dcfa3582f8..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2202-75f4ebfcb55c7701.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2202],{19431:function(e,s,t){t.d(s,{x:function(){return a.Z},z:function(){return l.Z}});var l=t(78489),a=t(84264)},65925:function(e,s,t){t.d(s,{m:function(){return i}});var l=t(57437);t(2265);var a=t(37592);let{Option:r}=a.default,i=e=>e?({"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",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,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 J}});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 API 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 API keys and invitation links. Users will need these API 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 J=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,J]=(0,a.useState)(null),[K,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};J(e),E(!0)}else(0,v.invitationCreateCall)(t,r).then(e=>{e.has_user_setup_sso=!1,J(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:K||"",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/2202-859c1cb8c2214ee1.js b/litellm/proxy/_experimental/out/_next/static/chunks/2202-859c1cb8c2214ee1.js new file mode 100644 index 0000000000..2e8353debb --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2202-859c1cb8c2214ee1.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2202],{19431:function(e,s,t){t.d(s,{x:function(){return a.Z},z:function(){return l.Z}});var l=t(78489),a=t(84264)},65925:function(e,s,t){t.d(s,{m:function(){return i}});var l=t(57437);t(2265);var a=t(37592);let{Option:r}=a.default,i=e=>e?({"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",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,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(43227),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/2249-01a36f26b1cecba3.js b/litellm/proxy/_experimental/out/_next/static/chunks/2249-01a36f26b1cecba3.js deleted file mode 100644 index b21241beec..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/2249-01a36f26b1cecba3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2249],{64748:function(e,s,l){l.d(s,{Ct:function(){return a.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 t.Z}});var a=l(41649),t=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 a.Z},x:function(){return t.Z}});var a=l(12514),t=l(84264)},92249:function(e,s,l){l.d(s,{Z:function(){return W}});var a=l(57437),t=l(23639),r=l(64748),n=l(22116),i=l(78867),c=l(99376),d=l(2265),o=l(17906),x=l(20347),m=l(41649),h=l(78489),u=l(84264),p=l(99981),g=l(3810),j=l(15424),v=l(15690),b=l(10032),N=l(61994),f=l(5545),y=l(96761),_=l(19250),k=l(9114);let{Step:w}=v.default;var Z=e=>{let{visible:s,onClose:l,accessToken:t,agentHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),Z=()=>{o(0),h(new Set),j.resetFields(),l()},C=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},S=e=>{e?h(new Set(r.map(e=>e.agent_id||e.name))):h(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&h(new Set(r.filter(e=>!0===e.is_public).map(e=>e.agent_id||e.name)))},[s,r]);let P=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeAgentsPublicCall)(t,e),k.Z.success("Successfully made ".concat(e.length," agent(s) public!")),Z(),i()}catch(e){console.error("Error making agents public:",e),k.Z.fromBackend("Failed to make agents public. Please try again.")}finally{g(!1)}},M=()=>{let e=r.length>0&&r.every(e=>x.has(e.agent_id||e.name)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select Agents to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,a.jsx)(u.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 API key to use these agents."}),(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===r.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No agents available."})}):r.map(e=>{let s=e.agent_id||e.name;return(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(s),onChange:e=>C(s,e.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.name}),(0,a.jsxs)(m.Z,{color:"blue",size:"sm",children:["v",e.version]})]}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:e.description}),e.skills&&e.skills.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.skills.slice(0,3).map(e=>(0,a.jsx)(m.Z,{color:"purple",size:"xs",children:e.name},e.id)),e.skills.length>3&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",e.skills.length-3," more"]})]})]})]},s)})})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making Agents Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these agents public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"Agents to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>(s.agent_id||s.name)===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:(null==s?void 0:s.name)||e}),s&&(0,a.jsxs)(m.Z,{color:"blue",size:"xs",children:["v",s.version]})]}),(null==s?void 0:s.description)&&(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:s.description})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make Agents Public",open:s,onCancel:Z,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(w,{title:"Select Agents"}),(0,a.jsx)(w,{title:"Confirm"})]}),(()=>{switch(c){case 0:return M();case 1:return z();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?Z:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:P,loading:p,children:"Make Public"})]})]})]})})};let{Step:C}=v.default;var S=e=>{let{visible:s,onClose:l,accessToken:t,mcpHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),w=()=>{o(0),h(new Set),j.resetFields(),l()},Z=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},S=e=>{e?h(new Set(r.map(e=>e.server_id))):h(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&h(new Set(r.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 P=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeMCPPublicCall)(t,e),k.Z.success("Successfully made ".concat(e.length," MCP server(s) public!")),w(),i()}catch(e){console.error("Error making MCP servers public:",e),k.Z.fromBackend("Failed to make MCP servers public. Please try again.")}finally{g(!1)}},M=()=>{let e=r.length>0&&r.every(e=>x.has(e.server_id)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select MCP Servers to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,a.jsx)(u.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 API key to use these servers."}),(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===r.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No MCP servers available."})}):r.map(e=>{var s;let l=(null===(s=e.mcp_info)||void 0===s?void 0:s.is_public)===!0;return(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(e.server_id),onChange:s=>Z(e.server_id,s.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.server_name}),l&&(0,a.jsx)(m.Z,{color:"emerald",size:"sm",children:"Public"}),(0,a.jsx)(m.Z,{color:"blue",size:"sm",children:e.transport}),(0,a.jsx)(m.Z,{color:"active"===e.status||"healthy"===e.status?"green":"inactive"===e.status||"unhealthy"===e.status?"red":"gray",size:"sm",children:e.status||"unknown"})]}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:e.description||e.url}),e.allowed_tools&&e.allowed_tools.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowed_tools.slice(0,3).map((e,s)=>(0,a.jsx)(m.Z,{color:"purple",size:"xs",children:e},s)),e.allowed_tools.length>3&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",e.allowed_tools.length-3," more"]})]})]})]},e.server_id)})})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making MCP Servers Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these MCP servers public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"MCP Servers to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>s.server_id===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:(null==s?void 0:s.server_name)||e}),s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:s.transport}),(0,a.jsx)(m.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,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:s.description}),(null==s?void 0:s.url)&&(0,a.jsx)(u.Z,{className:"text-xs text-gray-500 mt-1",children:s.url})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make MCP Servers Public",open:s,onCancel:w,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(C,{title:"Select Servers"}),(0,a.jsx)(C,{title:"Confirm"})]}),(()=>{switch(c){case 0:return M();case 1:return z();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?w:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:P,loading:p,children:"Make Public"})]})]})]})})},P=l(78801),M=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:t=!0,className:r=""}=e,[n,i]=(0,d.useState)(""),[c,o]=(0,d.useState)(""),[x,m]=(0,d.useState)(""),[h,u]=(0,d.useState)(""),p=(0,d.useRef)([]),g=(0,d.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(n.toLowerCase()),l=""===c||e.providers.includes(c),a=""===x||e.mode===x,t=""===h||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(" ")===h});return s&&l&&a&&t}))||[],[s,n,c,x,h]);(0,d.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,a.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,a.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,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,a.jsxs)("select",{value:c,onChange:e=>o(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,a.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,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,a.jsxs)("select",{value:x,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,a.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,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,a.jsxs)("select",{value:h,onChange:e=>u(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,a.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,a=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(a)})}),Array.from(s).sort()})(s).map(e=>(0,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(n||c||x||h)&&(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsx)("button",{onClick:()=>{i(""),o(""),m(""),u("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return t?(0,a.jsx)(P.Z,{className:"mb-6 ".concat(r),children:j}):(0,a.jsx)("div",{className:r,children:j})};let{Step:z}=v.default;var A=e=>{let{visible:s,onClose:l,accessToken:t,modelHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)([]),[j,w]=(0,d.useState)(!1),[Z]=b.Z.useForm(),C=()=>{o(0),h(new Set),g([]),Z.resetFields(),l()},S=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},P=e=>{e?h(new Set(p.map(e=>e.model_group))):h(new Set)},A=(0,d.useCallback)(e=>{g(e)},[]);(0,d.useEffect)(()=>{s&&r.length>0&&(g(r),h(new Set(r.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,r]);let F=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}w(!0);try{let e=Array.from(x);await (0,_.makeModelGroupPublic)(t,e),k.Z.success("Successfully made ".concat(e.length," model group(s) public!")),C(),i()}catch(e){console.error("Error making model groups public:",e),k.Z.fromBackend("Failed to make model groups public. Please try again.")}finally{w(!1)}},L=()=>{let e=p.length>0&&p.every(e=>x.has(e.model_group)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select Models to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>P(e.target.checked),disabled:0===p.length,children:["Select All ",p.length>0&&"(".concat(p.length,")")]})})]}),(0,a.jsx)(u.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 API key to use these models."}),(0,a.jsx)(M,{modelHubData:r,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===p.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No models match the current filters."})}):p.map(e=>(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(e.model_group),onChange:s=>S(e.model_group,s.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,a.jsx)(m.Z,{color:"green",size:"sm",children:e.mode})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," selected"]})})]})},D=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making Models Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"Models to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>s.model_group===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e}),s&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make Models Public",open:s,onCancel:C,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:Z,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(z,{title:"Select Models"}),(0,a.jsx)(z,{title:"Confirm"})]}),(()=>{switch(c){case 0:return L();case 1:return D();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?C:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},F=l(8048);let L=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),D=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),O=e=>"$".concat((1e6*e).toFixed(2)),U=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),E=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.model_group}),(0,a.jsx)(p.Z,{title:"Copy model name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),a=s.original.providers.join(", ");return l.localeCompare(a)},cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,a.jsx)(g.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,a.jsxs)(u.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,a.jsx)(m.Z,{color:"green",size:"sm",children:l.mode}):(0,a.jsx)(u.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,a.jsx)("div",{className:"space-y-1",children:(0,a.jsxs)(u.Z,{className:"text-xs",children:[l.max_input_tokens?U(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?U(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,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(u.Z,{className:"text-xs",children:l.input_cost_per_token?O(l.input_cost_per_token):"-"}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?O(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=D(s.original),t=["green","blue","purple","orange","red","yellow"];return(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,a.jsx)(u.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,a.jsx)(m.Z,{color:t[s%t.length],size:"xs",children:L(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,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.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,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?r.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):r};var K=l(87526),T=l(86462),H=l(47686),I=l(77355),R=l(93416),B=l(74998),Y=l(95704),V=e=>{let{accessToken:s,userRole:l}=e,[t,r]=(0,d.useState)([]),[i,c]=(0,d.useState)({url:"",displayName:""}),[o,m]=(0,d.useState)(null),[h,u]=(0,d.useState)(!1),[p,g]=(0,d.useState)(!0),j=async()=>{if(s)try{u(!0);let e=await (0,_.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),displayName:l,url:a}});r(l)}else r([])}catch(e){console.error("Error fetching useful links:",e),r([])}finally{u(!1)}};if((0,d.useEffect)(()=>{j()},[s]),!(0,x.tY)(l||""))return null;let v=async e=>{if(!s)return!1;try{let l={};return e.forEach(e=>{l[e.displayName]=e.url}),await (0,_.updateUsefulLinksCall)(s,l),n.Z.success({title:"Links Saved Successfully",content:(0,a.jsxs)("div",{className:"py-4",children:[(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,a.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,a.jsx)("a",{href:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),k.Z.fromBackend("Failed to save links - ".concat(e)),!1}},b=async()=>{if(!i.url||!i.displayName)return;try{new URL(i.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(t.some(e=>e.displayName===i.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=[...t,{id:"".concat(Date.now(),"-").concat(i.displayName),displayName:i.displayName,url:i.url}];await v(e)&&(r(e),c({url:"",displayName:""}),k.Z.success("Link added successfully"))},N=e=>{m({...e})},f=async()=>{if(!o)return;try{new URL(o.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(t.some(e=>e.id!==o.id&&e.displayName===o.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=t.map(e=>e.id===o.id?o:e);await v(e)&&(r(e),m(null),k.Z.success("Link updated successfully"))},y=()=>{m(null)},w=async e=>{let s=t.filter(s=>s.id!==e);await v(s)&&(r(s),k.Z.success("Link deleted successfully"))},Z=e=>{window.open(e,"_blank")};return(0,a.jsxs)(Y.Zb,{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>g(!p),children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(Y.Dx,{className:"mb-0",children:"Link Management"}),(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,a.jsx)("div",{className:"flex items-center",children:p?(0,a.jsx)(T.Z,{className:"w-5 h-5 text-gray-500"}):(0,a.jsx)(H.Z,{className:"w-5 h-5 text-gray-500"})})]}),p&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(Y.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,a.jsx)("input",{type:"text",value:i.url,onChange:e=>c({...i,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,a.jsx)("input",{type:"text",value:i.displayName,onChange:e=>c({...i,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:b,disabled:!i.url||!i.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(i.url&&i.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(I.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,a.jsx)(Y.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Links"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(Y.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(Y.ss,{children:(0,a.jsxs)(Y.SC,{children:[(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"Display Name"}),(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"URL"}),(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(Y.RM,{children:[t.map(e=>(0,a.jsx)(Y.SC,{className:"h-8",children:o&&o.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:o.displayName,onChange:e=>m({...o,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(Y.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:o.url,onChange:e=>m({...o,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(Y.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.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,a.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,a.jsx)(Y.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,a.jsx)(Y.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>Z(e.url),className:"text-xs bg-green-50 text-green-600 px-2 py-1 rounded hover:bg-green-100",children:"Use"}),(0,a.jsx)("button",{onClick:()=>N(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(R.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>w(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(B.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===t.length&&(0,a.jsx)(Y.SC,{children:(0,a.jsx)(Y.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})},W=e=>{var s,l,v,b;let{accessToken:N,publicPage:f,premiumUser:y,userRole:w}=e,[C,P]=(0,d.useState)(!1),[z,L]=(0,d.useState)(null),[D,O]=(0,d.useState)(!0),[U,T]=(0,d.useState)(!1),[H,I]=(0,d.useState)(!1),[R,B]=(0,d.useState)(null),[Y,W]=(0,d.useState)([]),[q,G]=(0,d.useState)(!1),[J,$]=(0,d.useState)(null),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(!0),[el,ea]=(0,d.useState)(null),[et,er]=(0,d.useState)(!1),[en,ei]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(!0),[eo,ex]=(0,d.useState)(null),[em,eh]=(0,d.useState)(!1),[eu,ep]=(0,d.useState)(!1),eg=(0,c.useRouter)(),ej=(0,d.useRef)(null),ev=(0,d.useRef)(null),eb=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=async e=>{try{O(!0);let s=await (0,_.modelHubCall)(e);console.log("ModelHubData:",s),L(s.data),(0,_.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&P(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{O(!1)}},s=async()=>{try{var e,s;O(!0),await (0,_.getUiConfig)();let l=await (0,_.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),L(l),P(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{O(!1)}};N?e(N):f&&s()},[N,f]),(0,d.useEffect)(()=>{let e=async()=>{if(N)try{es(!0);let e=await (0,_.getAgentsList)(N);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)}};f||e()},[f,N]),(0,d.useEffect)(()=>{let e=async()=>{if(N)try{ed(!0);let e=await (0,_.fetchMCPServers)(N);console.log("MCPHubData:",e),ei(e)}catch(e){console.error("There was an error fetching the MCP server data",e)}finally{ed(!1)}};f||e()},[f,N]);let eN=()=>{N&&G(!0)},ef=()=>{N&&X(!0)},ey=()=>{N&&ep(!0)},e_=()=>{T(!1),I(!1),B(null),er(!1),ea(null),eh(!1),ex(null)},ek=()=>{T(!1),I(!1),B(null),er(!1),ea(null),eh(!1),ex(null)},ew=e=>{navigator.clipboard.writeText(e),k.Z.success("Copied to clipboard!")},eZ=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eC=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),eS=e=>"$".concat((1e6*e).toFixed(2)),eP=(0,d.useCallback)(e=>{W(e)},[]);return(console.log("publicPage: ",f),console.log("publicPageAllowed: ",C),f&&C)?(0,a.jsx)(K.Z,{accessToken:N}):(0,a.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==f?(0,a.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start",children:[(0,a.jsx)(r.Dx,{className:"text-center",children:"AI Hub"}),(0,x.tY)(w||"")?(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Make models, agents, and MCP servers public for developers to know what's available."}):(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(r.xv,{children:"Model Hub URL:"}),(0,a.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,a.jsx)(r.xv,{className:"mr-2",children:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,a.jsx)("button",{onClick:()=>ew("".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,a.jsx)(i.Z,{size:16,className:"text-gray-600"})})]})]})]}),(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"mt-8 mb-2",children:(0,a.jsx)(V,{accessToken:N,userRole:w})}),(0,a.jsxs)(r.v0,{children:[(0,a.jsxs)(r.td,{className:"mb-4",children:[(0,a.jsx)(r.OK,{children:"Model Hub"}),(0,a.jsx)(r.OK,{children:"Agent Hub"}),(0,a.jsx)(r.OK,{children:"MCP Hub"})]}),(0,a.jsxs)(r.nP,{children:[(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>eN(),children:"Select Models to Make Public"})}),(0,a.jsx)(M,{modelHubData:z||[],onFilteredDataChange:eP}),(0,a.jsx)(F.C,{columns:E(e=>{B(e),T(!0)},ew,f),data:Y,isLoading:D,table:ej,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",Y.length," of ",(null==z?void 0:z.length)||0," models"]})})]}),(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>ef(),children:"Select Agents to Make Public"})}),(0,a.jsx)(F.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,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.name}),(0,a.jsx)(p.Z,{title:"Copy agent name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.description})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.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,a.jsxs)(m.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,a.jsx)(u.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,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)(u.Z,{className:"text-xs font-medium",children:[l.length," skill",1!==l.length?"s":""]}),l.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map(e=>(0,a.jsx)(g.Z,{color:"purple",className:"text-xs",children:e.name},e.id)),l.length>2&&(0,a.jsxs)(u.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,a.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,a.jsx)(u.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map(e=>(0,a.jsx)(m.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,t=l.defaultInputModes||[],r=l.defaultOutputModes||[];return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)(u.Z,{className:"text-xs",children:[(0,a.jsx)("span",{className:"font-medium",children:"In:"})," ",t.join(", ")||"-"]}),(0,a.jsxs)(u.Z,{className:"text-xs",children:[(0,a.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,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.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,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ea(e),er(!0)},ew,f),data:J||[],isLoading:ee,table:ev,defaultSorting:[{id:"name",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==J?void 0:J.length)||0," agent",(null==J?void 0:J.length)!==1?"s":""]})})]}),(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>ey(),children:"Select MCP Servers to Make Public"})}),(0,a.jsx)(F.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,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.server_name}),(0,a.jsx)(p.Z,{title:"Copy server name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.description||"-"})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.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,r=l.original;return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"text-xs truncate max-w-xs",children:r.url}),(0,a.jsx)(p.Z,{title:"Copy URL",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.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,a.jsx)(m.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,t="none"===l.auth_type?"gray":"green";return(0,a.jsx)(m.Z,{color:t,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,t={active:"green",inactive:"red",unknown:"gray",healthy:"green",unhealthy:"red"}[l.status]||"gray";return(0,a.jsx)(m.Z,{color:t,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,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(u.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,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map((e,s)=>(0,a.jsx)(g.Z,{color:"purple",className:"text-xs",children:e},s)),l.length>2&&(0,a.jsxs)(u.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,a.jsx)(u.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,a;return((null===(l=e.original.mcp_info)||void 0===l?void 0:l.is_public)===!0?1:0)-((null===(a=s.original.mcp_info)||void 0===a?void 0:a.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,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.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,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ex(e),eh(!0)},ew,f),data:en||[],isLoading:ec,table:eb,defaultSorting:[{id:"server_name",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.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,a.jsxs)(r.Zb,{className:"mx-auto max-w-xl mt-10",children:[(0,a.jsx)(r.xv,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,a.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,a.jsx)(n.Z,{title:"Public Model Hub",width:600,visible:H,footer:null,onOk:e_,onCancel:ek,children:(0,a.jsxs)("div",{className:"pt-5 pb-5",children:[(0,a.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,a.jsx)(r.xv,{className:"text-base mr-2",children:"Shareable Link:"}),(0,a.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,_.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(r.zx,{onClick:()=>{eg.replace("/model_hub_table?key=".concat(N))},children:"See Page"})})]})}),(0,a.jsx)(n.Z,{title:(null==R?void 0:R.model_group)||"Model Details",width:1e3,visible:U,footer:null,onOk:e_,onCancel:ek,children:R&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Model Group:"}),(0,a.jsx)(r.xv,{children:R.model_group})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Mode:"}),(0,a.jsx)(r.xv,{children:R.mode||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Providers:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:R.providers.map(e=>(0,a.jsx)(r.Ct,{color:"blue",children:e},e))})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,a.jsx)(r.xv,{children:(null===(s=R.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,a.jsx)(r.xv,{children:(null===(l=R.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,a.jsx)(r.xv,{children:R.input_cost_per_token?eS(R.input_cost_per_token):"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,a.jsx)(r.xv,{children:R.output_cost_per_token?eS(R.output_cost_per_token):"Not specified"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=eC(R),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,a.jsx)(r.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,a.jsx)(r.Ct,{color:s[l%s.length],children:eZ(e)},e))})()})]}),(R.tpm||R.rpm)&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[R.tpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,a.jsx)(r.xv,{children:R.tpm.toLocaleString()})]}),R.rpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,a.jsx)(r.xv,{children:R.rpm.toLocaleString()})]})]})]}),R.supported_openai_params&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:R.supported_openai_params.map(e=>(0,a.jsx)(r.Ct,{color:"green",children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)(o.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(R.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,a.jsx)(n.Z,{title:(null==el?void 0:el.name)||"Agent Details",width:1e3,visible:et,footer:null,onOk:e_,onCancel:ek,children:el&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Name:"}),(0,a.jsx)(r.xv,{children:el.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Version:"}),(0,a.jsxs)(r.Ct,{color:"blue",children:["v",el.version]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Protocol Version:"}),(0,a.jsx)(r.xv,{children:el.protocolVersion})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(r.xv,{className:"truncate",children:el.url}),(0,a.jsx)(t.Z,{onClick:()=>ew(el.url),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,a.jsx)(r.xv,{className:"mt-1",children:el.description})]})]}),el.capabilities&&Object.keys(el.capabilities).length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.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,a.jsx)(r.Ct,{color:"green",children:s},s)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Input Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(v=el.defaultInputModes)||void 0===v?void 0:v.map(e=>(0,a.jsx)(r.Ct,{color:"blue",children:e},e)))||(0,a.jsx)(r.xv,{children:"Not specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Output Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(b=el.defaultOutputModes)||void 0===b?void 0:b.map(e=>(0,a.jsx)(r.Ct,{color:"purple",children:e},e)))||(0,a.jsx)(r.xv,{children:"Not specified"})})]})]})]}),el.skills&&el.skills.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,a.jsx)("div",{className:"space-y-4",children:el.skills.map(e=>(0,a.jsxs)("div",{className:"border border-gray-200 rounded p-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium text-base",children:e.name}),(0,a.jsxs)(r.xv,{className:"text-xs text-gray-500",children:["ID: ",e.id]})]}),e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map(e=>(0,a.jsx)(r.Ct,{color:"purple",size:"xs",children:e},e))})]}),(0,a.jsx)(r.xv,{className:"text-sm mb-2",children:e.description}),e.examples&&e.examples.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-xs font-medium text-gray-700",children:"Examples:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.examples.map((e,s)=>(0,a.jsx)(r.Ct,{color:"gray",size:"xs",children:e},s))})]})]},e.id))})]}),el.supportsAuthenticatedExtendedCard&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Additional Features"}),(0,a.jsx)(r.Ct,{color:"green",children:"Supports Authenticated Extended Card"})]})]})}),(0,a.jsx)(n.Z,{title:(null==eo?void 0:eo.server_name)||"MCP Server Details",width:1e3,visible:em,footer:null,onOk:e_,onCancel:ek,children:eo&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Server Name:"}),(0,a.jsx)(r.xv,{children:eo.server_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Server ID:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(r.xv,{className:"text-xs truncate",children:eo.server_id}),(0,a.jsx)(t.Z,{onClick:()=>ew(eo.server_id),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]}),eo.alias&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Alias:"}),(0,a.jsx)(r.xv,{children:eo.alias})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Transport:"}),(0,a.jsx)(r.Ct,{color:"blue",children:eo.transport})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Auth Type:"}),(0,a.jsx)(r.Ct,{color:"none"===eo.auth_type?"gray":"green",children:eo.auth_type})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Status:"}),(0,a.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,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,a.jsx)(r.xv,{className:"mt-1",children:eo.description})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Connection Details"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,a.jsx)(r.xv,{className:"text-sm break-all bg-gray-100 p-2 rounded flex-1",children:eo.url}),(0,a.jsx)(t.Z,{onClick:()=>ew(eo.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 flex-shrink-0"})]})]}),eo.command&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Command:"}),(0,a.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,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Allowed Tools"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.allowed_tools.map((e,s)=>(0,a.jsx)(r.Ct,{color:"purple",children:e},s))})]}),eo.teams&&eo.teams.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Teams"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.teams.map((e,s)=>(0,a.jsx)(r.Ct,{color:"blue",children:e},s))})]}),eo.mcp_access_groups&&eo.mcp_access_groups.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Access Groups"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.mcp_access_groups.map((e,s)=>(0,a.jsx)(r.Ct,{color:"green",children:e},s))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Metadata"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created By:"}),(0,a.jsx)(r.xv,{children:eo.created_by})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Updated By:"}),(0,a.jsx)(r.xv,{children:eo.updated_by})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created At:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.created_at).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Updated At:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.updated_at).toLocaleString()})]}),eo.last_health_check&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Last Health Check:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.last_health_check).toLocaleString()})]})]}),eo.health_check_error&&(0,a.jsxs)("div",{className:"mt-2 p-2 bg-red-50 rounded",children:[(0,a.jsx)(r.xv,{className:"font-medium text-red-700",children:"Health Check Error:"}),(0,a.jsx)(r.xv,{className:"text-sm text-red-600 mt-1",children:eo.health_check_error})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)(o.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,a.jsx)(A,{visible:q,onClose:()=>G(!1),accessToken:N||"",modelHubData:z||[],onSuccess:()=>{N&&(async()=>{try{let e=await (0,_.modelHubCall)(N);L(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}}),(0,a.jsx)(Z,{visible:Q,onClose:()=>X(!1),accessToken:N||"",agentHubData:J||[],onSuccess:()=>{N&&(async()=>{try{let e=(await (0,_.getAgentsList)(N)).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,a.jsx)(S,{visible:eu,onClose:()=>ep(!1),accessToken:N||"",mcpHubData:en||[],onSuccess:()=>{N&&(async()=>{try{let e=await (0,_.fetchMCPServers)(N);ei(e)}catch(e){console.error("Error refreshing MCP server data:",e)}})()}})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2249-3be1a049d707c166.js b/litellm/proxy/_experimental/out/_next/static/chunks/2249-3be1a049d707c166.js new file mode 100644 index 0000000000..e255730d8c --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2249-3be1a049d707c166.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2249],{64748:function(e,s,l){l.d(s,{Ct:function(){return a.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 t.Z}});var a=l(41649),t=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 a.Z},x:function(){return t.Z}});var a=l(12514),t=l(84264)},92249:function(e,s,l){l.d(s,{Z:function(){return W}});var a=l(57437),t=l(23639),r=l(64748),n=l(22116),i=l(78867),c=l(99376),d=l(2265),o=l(17906),x=l(20347),m=l(41649),h=l(78489),u=l(84264),p=l(99981),g=l(3810),j=l(15424),v=l(15690),b=l(10032),N=l(61994),f=l(5545),y=l(96761),_=l(19250),k=l(9114);let{Step:w}=v.default;var Z=e=>{let{visible:s,onClose:l,accessToken:t,agentHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),Z=()=>{o(0),h(new Set),j.resetFields(),l()},C=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},S=e=>{e?h(new Set(r.map(e=>e.agent_id||e.name))):h(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&h(new Set(r.filter(e=>!0===e.is_public).map(e=>e.agent_id||e.name)))},[s,r]);let P=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeAgentsPublicCall)(t,e),k.Z.success("Successfully made ".concat(e.length," agent(s) public!")),Z(),i()}catch(e){console.error("Error making agents public:",e),k.Z.fromBackend("Failed to make agents public. Please try again.")}finally{g(!1)}},M=()=>{let e=r.length>0&&r.every(e=>x.has(e.agent_id||e.name)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select Agents to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,a.jsx)(u.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,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===r.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No agents available."})}):r.map(e=>{let s=e.agent_id||e.name;return(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(s),onChange:e=>C(s,e.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.name}),(0,a.jsxs)(m.Z,{color:"blue",size:"sm",children:["v",e.version]})]}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:e.description}),e.skills&&e.skills.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.skills.slice(0,3).map(e=>(0,a.jsx)(m.Z,{color:"purple",size:"xs",children:e.name},e.id)),e.skills.length>3&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",e.skills.length-3," more"]})]})]})]},s)})})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making Agents Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these agents public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"Agents to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>(s.agent_id||s.name)===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:(null==s?void 0:s.name)||e}),s&&(0,a.jsxs)(m.Z,{color:"blue",size:"xs",children:["v",s.version]})]}),(null==s?void 0:s.description)&&(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:s.description})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," agent",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make Agents Public",open:s,onCancel:Z,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(w,{title:"Select Agents"}),(0,a.jsx)(w,{title:"Confirm"})]}),(()=>{switch(c){case 0:return M();case 1:return z();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?Z:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one agent to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:P,loading:p,children:"Make Public"})]})]})]})})};let{Step:C}=v.default;var S=e=>{let{visible:s,onClose:l,accessToken:t,mcpHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)(!1),[j]=b.Z.useForm(),w=()=>{o(0),h(new Set),j.resetFields(),l()},Z=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},S=e=>{e?h(new Set(r.map(e=>e.server_id))):h(new Set)};(0,d.useEffect)(()=>{s&&r.length>0&&h(new Set(r.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 P=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}g(!0);try{let e=Array.from(x);await (0,_.makeMCPPublicCall)(t,e),k.Z.success("Successfully made ".concat(e.length," MCP server(s) public!")),w(),i()}catch(e){console.error("Error making MCP servers public:",e),k.Z.fromBackend("Failed to make MCP servers public. Please try again.")}finally{g(!1)}},M=()=>{let e=r.length>0&&r.every(e=>x.has(e.server_id)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select MCP Servers to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>S(e.target.checked),disabled:0===r.length,children:["Select All ",r.length>0&&"(".concat(r.length,")")]})})]}),(0,a.jsx)(u.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,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===r.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No MCP servers available."})}):r.map(e=>{var s;let l=(null===(s=e.mcp_info)||void 0===s?void 0:s.is_public)===!0;return(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(e.server_id),onChange:s=>Z(e.server_id,s.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.server_name}),l&&(0,a.jsx)(m.Z,{color:"emerald",size:"sm",children:"Public"}),(0,a.jsx)(m.Z,{color:"blue",size:"sm",children:e.transport}),(0,a.jsx)(m.Z,{color:"active"===e.status||"healthy"===e.status?"green":"inactive"===e.status||"unhealthy"===e.status?"red":"gray",size:"sm",children:e.status||"unknown"})]}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:e.description||e.url}),e.allowed_tools&&e.allowed_tools.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-1",children:[e.allowed_tools.slice(0,3).map((e,s)=>(0,a.jsx)(m.Z,{color:"purple",size:"xs",children:e},s)),e.allowed_tools.length>3&&(0,a.jsxs)(u.Z,{className:"text-xs text-gray-500",children:["+",e.allowed_tools.length-3," more"]})]})]})]},e.server_id)})})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," selected"]})})]})},z=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making MCP Servers Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these MCP servers public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"MCP Servers to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>s.server_id===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:(null==s?void 0:s.server_name)||e}),s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:s.transport}),(0,a.jsx)(m.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,a.jsx)(u.Z,{className:"text-xs text-gray-600 mt-1",children:s.description}),(null==s?void 0:s.url)&&(0,a.jsx)(u.Z,{className:"text-xs text-gray-500 mt-1",children:s.url})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," MCP server",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make MCP Servers Public",open:s,onCancel:w,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:j,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(C,{title:"Select Servers"}),(0,a.jsx)(C,{title:"Confirm"})]}),(()=>{switch(c){case 0:return M();case 1:return z();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?w:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one MCP server to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:P,loading:p,children:"Make Public"})]})]})]})})},P=l(78801),M=e=>{let{modelHubData:s,onFilteredDataChange:l,showFiltersCard:t=!0,className:r=""}=e,[n,i]=(0,d.useState)(""),[c,o]=(0,d.useState)(""),[x,m]=(0,d.useState)(""),[h,u]=(0,d.useState)(""),p=(0,d.useRef)([]),g=(0,d.useMemo)(()=>(null==s?void 0:s.filter(e=>{let s=e.model_group.toLowerCase().includes(n.toLowerCase()),l=""===c||e.providers.includes(c),a=""===x||e.mode===x,t=""===h||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(" ")===h});return s&&l&&a&&t}))||[],[s,n,c,x,h]);(0,d.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,a.jsxs)("div",{className:"flex flex-wrap gap-4 items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Search Models:"}),(0,a.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,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Provider:"}),(0,a.jsxs)("select",{value:c,onChange:e=>o(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-40 h-10",children:[(0,a.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,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Mode:"}),(0,a.jsxs)("select",{value:x,onChange:e=>m(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-32 h-10",children:[(0,a.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,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(P.x,{className:"text-sm font-medium mb-2",children:"Features:"}),(0,a.jsxs)("select",{value:h,onChange:e=>u(e.target.value),className:"border rounded px-3 py-2 text-sm text-gray-600 w-48 h-10",children:[(0,a.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,a=l.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");s.add(a)})}),Array.from(s).sort()})(s).map(e=>(0,a.jsx)("option",{value:e,className:"text-sm text-gray-800",children:e},e))]})]}),(n||c||x||h)&&(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsx)("button",{onClick:()=>{i(""),o(""),m(""),u("")},className:"text-blue-600 hover:text-blue-800 text-sm underline h-10 flex items-center",children:"Clear Filters"})})]});return t?(0,a.jsx)(P.Z,{className:"mb-6 ".concat(r),children:j}):(0,a.jsx)("div",{className:r,children:j})};let{Step:z}=v.default;var A=e=>{let{visible:s,onClose:l,accessToken:t,modelHubData:r,onSuccess:i}=e,[c,o]=(0,d.useState)(0),[x,h]=(0,d.useState)(new Set),[p,g]=(0,d.useState)([]),[j,w]=(0,d.useState)(!1),[Z]=b.Z.useForm(),C=()=>{o(0),h(new Set),g([]),Z.resetFields(),l()},S=(e,s)=>{let l=new Set(x);s?l.add(e):l.delete(e),h(l)},P=e=>{e?h(new Set(p.map(e=>e.model_group))):h(new Set)},A=(0,d.useCallback)(e=>{g(e)},[]);(0,d.useEffect)(()=>{s&&r.length>0&&(g(r),h(new Set(r.filter(e=>!0===e.is_public_model_group).map(e=>e.model_group))))},[s,r]);let F=async()=>{if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}w(!0);try{let e=Array.from(x);await (0,_.makeModelGroupPublic)(t,e),k.Z.success("Successfully made ".concat(e.length," model group(s) public!")),C(),i()}catch(e){console.error("Error making model groups public:",e),k.Z.fromBackend("Failed to make model groups public. Please try again.")}finally{w(!1)}},L=()=>{let e=p.length>0&&p.every(e=>x.has(e.model_group)),s=x.size>0&&!e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(y.Z,{children:"Select Models to Make Public"}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsxs)(N.Z,{checked:e,indeterminate:s,onChange:e=>P(e.target.checked),disabled:0===p.length,children:["Select All ",p.length>0&&"(".concat(p.length,")")]})})]}),(0,a.jsx)(u.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,a.jsx)(M,{modelHubData:r,onFilteredDataChange:A,showFiltersCard:!1,className:"border rounded-lg p-4 bg-gray-50"}),(0,a.jsx)("div",{className:"max-h-96 overflow-y-auto border rounded-lg p-4",children:(0,a.jsx)("div",{className:"space-y-3",children:0===p.length?(0,a.jsx)("div",{className:"text-center py-8 text-gray-500",children:(0,a.jsx)(u.Z,{children:"No models match the current filters."})}):p.map(e=>(0,a.jsxs)("div",{className:"flex items-center space-x-3 p-3 border rounded-lg hover:bg-gray-50",children:[(0,a.jsx)(N.Z,{checked:x.has(e.model_group),onChange:s=>S(e.model_group,s.target.checked)}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e.model_group}),e.mode&&(0,a.jsx)(m.Z,{color:"green",size:"sm",children:e.mode})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.providers.map(e=>(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})]},e.model_group))})}),x.size>0&&(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:[(0,a.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," selected"]})})]})},D=()=>(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(y.Z,{children:"Confirm Making Models Public"}),(0,a.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,a.jsxs)(u.Z,{className:"text-sm text-yellow-800",children:[(0,a.jsx)("strong",{children:"Warning:"})," Once you make these models public, anyone who can go to the"," ",(0,a.jsx)("code",{children:"/ui/model_hub_table"})," will be able to know they exist on the proxy."]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(u.Z,{className:"font-medium",children:"Models to be made public:"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border rounded-lg p-3",children:(0,a.jsx)("div",{className:"space-y-2",children:Array.from(x).map(e=>{let s=r.find(s=>s.model_group===e);return(0,a.jsx)("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(u.Z,{className:"font-medium",children:e}),s&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:s.providers.map(e=>(0,a.jsx)(m.Z,{color:"blue",size:"xs",children:e},e))})]})},e)})})})]}),(0,a.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:(0,a.jsxs)(u.Z,{className:"text-sm text-blue-800",children:["Total: ",(0,a.jsx)("strong",{children:x.size})," model",1!==x.size?"s":""," will be made public"]})})]});return(0,a.jsx)(n.Z,{title:"Make Models Public",open:s,onCancel:C,footer:null,width:1200,maskClosable:!1,children:(0,a.jsxs)(b.Z,{form:Z,layout:"vertical",children:[(0,a.jsxs)(v.default,{current:c,className:"mb-6",children:[(0,a.jsx)(z,{title:"Select Models"}),(0,a.jsx)(z,{title:"Confirm"})]}),(()=>{switch(c){case 0:return L();case 1:return D();default:return null}})(),(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsx)(f.ZP,{onClick:0===c?C:()=>{1===c&&o(0)},children:0===c?"Cancel":"Previous"}),(0,a.jsxs)("div",{className:"flex space-x-2",children:[0===c&&(0,a.jsx)(f.ZP,{onClick:()=>{if(0===c){if(0===x.size){k.Z.fromBackend("Please select at least one model to make public");return}o(1)}},disabled:0===x.size,children:"Next"}),1===c&&(0,a.jsx)(f.ZP,{onClick:F,loading:j,children:"Make Public"})]})]})]})})},F=l(8048);let L=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),D=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),O=e=>"$".concat((1e6*e).toFixed(2)),K=e=>e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString(),U=function(e,s){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[{header:"Public Model Name",accessorKey:"model_group",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:l}=e,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.model_group}),(0,a.jsx)(p.Z,{title:"Copy model name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.model_group),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.providers.join(", ")})})]})}},{header:"Provider",accessorKey:"providers",enableSorting:!0,sortingFn:(e,s)=>{let l=e.original.providers.join(", "),a=s.original.providers.join(", ");return l.localeCompare(a)},cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.providers.slice(0,2).map(e=>(0,a.jsx)(g.Z,{color:"blue",className:"text-xs",children:e},e)),l.providers.length>2&&(0,a.jsxs)(u.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,a.jsx)(m.Z,{color:"green",size:"sm",children:l.mode}):(0,a.jsx)(u.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,a.jsx)("div",{className:"space-y-1",children:(0,a.jsxs)(u.Z,{className:"text-xs",children:[l.max_input_tokens?K(l.max_input_tokens):"-"," /"," ",l.max_output_tokens?K(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,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(u.Z,{className:"text-xs",children:l.input_cost_per_token?O(l.input_cost_per_token):"-"}),(0,a.jsx)(u.Z,{className:"text-xs text-gray-500",children:l.output_cost_per_token?O(l.output_cost_per_token):"-"})]})}},{header:"Features",accessorKey:"capabilities",enableSorting:!1,cell:e=>{let{row:s}=e,l=D(s.original),t=["green","blue","purple","orange","red","yellow"];return(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,a.jsx)(u.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map((e,s)=>(0,a.jsx)(m.Z,{color:t[s%t.length],size:"xs",children:L(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,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.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,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}];return l?r.filter(e=>!("accessorKey"in e)||"is_public_model_group"!==e.accessorKey):r};var E=l(87526),T=l(86462),H=l(47686),R=l(77355),B=l(93416),I=l(74998),Y=l(95704),V=e=>{let{accessToken:s,userRole:l}=e,[t,r]=(0,d.useState)([]),[i,c]=(0,d.useState)({url:"",displayName:""}),[o,m]=(0,d.useState)(null),[h,u]=(0,d.useState)(!1),[p,g]=(0,d.useState)(!0),j=async()=>{if(s)try{u(!0);let e=await (0,_.getPublicModelHubInfo)();if(e&&e.useful_links){let s=e.useful_links||{},l=Object.entries(s).map((e,s)=>{let[l,a]=e;return{id:"".concat(s,"-").concat(l),displayName:l,url:a}});r(l)}else r([])}catch(e){console.error("Error fetching useful links:",e),r([])}finally{u(!1)}};if((0,d.useEffect)(()=>{j()},[s]),!(0,x.tY)(l||""))return null;let v=async e=>{if(!s)return!1;try{let l={};return e.forEach(e=>{l[e.displayName]=e.url}),await (0,_.updateUsefulLinksCall)(s,l),n.Z.success({title:"Links Saved Successfully",content:(0,a.jsxs)("div",{className:"py-4",children:[(0,a.jsx)("p",{className:"text-gray-600 mb-4",children:"Your useful links have been saved and are now visible on the public model hub."}),(0,a.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-blue-800 mb-2 font-medium",children:"View your updated model hub:"}),(0,a.jsx)("a",{href:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table"),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-blue-600 hover:text-blue-800 underline text-sm font-medium",children:"Open Public Model Hub →"})]})]}),width:500,okText:"Close",maskClosable:!0,keyboard:!0}),!0}catch(e){return console.error("Error saving links:",e),k.Z.fromBackend("Failed to save links - ".concat(e)),!1}},b=async()=>{if(!i.url||!i.displayName)return;try{new URL(i.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(t.some(e=>e.displayName===i.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=[...t,{id:"".concat(Date.now(),"-").concat(i.displayName),displayName:i.displayName,url:i.url}];await v(e)&&(r(e),c({url:"",displayName:""}),k.Z.success("Link added successfully"))},N=e=>{m({...e})},f=async()=>{if(!o)return;try{new URL(o.url)}catch(e){k.Z.fromBackend("Please enter a valid URL");return}if(t.some(e=>e.id!==o.id&&e.displayName===o.displayName)){k.Z.fromBackend("A link with this display name already exists");return}let e=t.map(e=>e.id===o.id?o:e);await v(e)&&(r(e),m(null),k.Z.success("Link updated successfully"))},y=()=>{m(null)},w=async e=>{let s=t.filter(s=>s.id!==e);await v(s)&&(r(s),k.Z.success("Link deleted successfully"))},Z=e=>{window.open(e,"_blank")};return(0,a.jsxs)(Y.Zb,{className:"mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>g(!p),children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)(Y.Dx,{className:"mb-0",children:"Link Management"}),(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Manage the links that are displayed under 'Useful Links' on the public model hub."})]}),(0,a.jsx)("div",{className:"flex items-center",children:p?(0,a.jsx)(T.Z,{className:"w-5 h-5 text-gray-500"}):(0,a.jsx)(H.Z,{className:"w-5 h-5 text-gray-500"})})]}),p&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("div",{className:"mb-6",children:[(0,a.jsx)(Y.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Add New Link"}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"URL"}),(0,a.jsx)("input",{type:"text",value:i.url,onChange:e=>c({...i,url:e.target.value}),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs text-gray-500 mb-1",children:"Display Name"}),(0,a.jsx)("input",{type:"text",value:i.displayName,onChange:e=>c({...i,displayName:e.target.value}),placeholder:"Friendly name",className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm"})]}),(0,a.jsx)("div",{className:"flex items-end",children:(0,a.jsxs)("button",{onClick:b,disabled:!i.url||!i.displayName,className:"flex items-center px-4 py-2 rounded-md text-sm ".concat(i.url&&i.displayName?"bg-green-600 text-white hover:bg-green-700":"bg-gray-300 text-gray-500 cursor-not-allowed"),children:[(0,a.jsx)(R.Z,{className:"w-4 h-4 mr-1"}),"Add Link"]})})]})]}),(0,a.jsx)(Y.xv,{className:"text-sm font-medium text-gray-700 mb-2",children:"Manage Existing Links"}),(0,a.jsx)("div",{className:"rounded-lg custom-border relative",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)(Y.iA,{className:"[&_td]:py-0.5 [&_th]:py-1",children:[(0,a.jsx)(Y.ss,{children:(0,a.jsxs)(Y.SC,{children:[(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"Display Name"}),(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"URL"}),(0,a.jsx)(Y.xs,{className:"py-1 h-8",children:"Actions"})]})}),(0,a.jsxs)(Y.RM,{children:[t.map(e=>(0,a.jsx)(Y.SC,{className:"h-8",children:o&&o.id===e.id?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:o.displayName,onChange:e=>m({...o,displayName:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(Y.pj,{className:"py-0.5",children:(0,a.jsx)("input",{type:"text",value:o.url,onChange:e=>m({...o,url:e.target.value}),className:"w-full px-2 py-1 border border-gray-300 rounded-md text-sm"})}),(0,a.jsx)(Y.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.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,a.jsx)("button",{onClick:y,className:"text-xs bg-gray-50 text-gray-600 px-2 py-1 rounded hover:bg-gray-100",children:"Cancel"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y.pj,{className:"py-0.5 text-sm text-gray-900",children:e.displayName}),(0,a.jsx)(Y.pj,{className:"py-0.5 text-sm text-gray-500",children:e.url}),(0,a.jsx)(Y.pj,{className:"py-0.5 whitespace-nowrap",children:(0,a.jsxs)("div",{className:"flex space-x-2",children:[(0,a.jsx)("button",{onClick:()=>Z(e.url),className:"text-xs bg-green-50 text-green-600 px-2 py-1 rounded hover:bg-green-100",children:"Use"}),(0,a.jsx)("button",{onClick:()=>N(e),className:"text-xs bg-blue-50 text-blue-600 px-2 py-1 rounded hover:bg-blue-100",children:(0,a.jsx)(B.Z,{className:"w-3 h-3"})}),(0,a.jsx)("button",{onClick:()=>w(e.id),className:"text-xs bg-red-50 text-red-600 px-2 py-1 rounded hover:bg-red-100",children:(0,a.jsx)(I.Z,{className:"w-3 h-3"})})]})})]})},e.id)),0===t.length&&(0,a.jsx)(Y.SC,{children:(0,a.jsx)(Y.pj,{colSpan:3,className:"py-0.5 text-sm text-gray-500 text-center",children:"No links added yet. Add a new link above."})})]})]})})})]})]})},W=e=>{var s,l,v,b;let{accessToken:N,publicPage:f,premiumUser:y,userRole:w}=e,[C,P]=(0,d.useState)(!1),[z,L]=(0,d.useState)(null),[D,O]=(0,d.useState)(!0),[K,T]=(0,d.useState)(!1),[H,R]=(0,d.useState)(!1),[B,I]=(0,d.useState)(null),[Y,W]=(0,d.useState)([]),[q,G]=(0,d.useState)(!1),[J,$]=(0,d.useState)(null),[Q,X]=(0,d.useState)(!1),[ee,es]=(0,d.useState)(!0),[el,ea]=(0,d.useState)(null),[et,er]=(0,d.useState)(!1),[en,ei]=(0,d.useState)(null),[ec,ed]=(0,d.useState)(!0),[eo,ex]=(0,d.useState)(null),[em,eh]=(0,d.useState)(!1),[eu,ep]=(0,d.useState)(!1),eg=(0,c.useRouter)(),ej=(0,d.useRef)(null),ev=(0,d.useRef)(null),eb=(0,d.useRef)(null);(0,d.useEffect)(()=>{let e=async e=>{try{O(!0);let s=await (0,_.modelHubCall)(e);console.log("ModelHubData:",s),L(s.data),(0,_.getConfigFieldSetting)(e,"enable_public_model_hub").then(e=>{console.log("data: ".concat(JSON.stringify(e))),!0==e.field_value&&P(!0)}).catch(e=>{})}catch(e){console.error("There was an error fetching the model data",e)}finally{O(!1)}},s=async()=>{try{var e,s;O(!0),await (0,_.getUiConfig)();let l=await (0,_.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),L(l),P(!0)}catch(e){console.error("There was an error fetching the public model data",e)}finally{O(!1)}};N?e(N):f&&s()},[N,f]),(0,d.useEffect)(()=>{let e=async()=>{if(N)try{es(!0);let e=await (0,_.getAgentsList)(N);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)}};f||e()},[f,N]),(0,d.useEffect)(()=>{let e=async()=>{if(N)try{ed(!0);let e=await (0,_.fetchMCPServers)(N);console.log("MCPHubData:",e),ei(e)}catch(e){console.error("There was an error fetching the MCP server data",e)}finally{ed(!1)}};f||e()},[f,N]);let eN=()=>{N&&G(!0)},ef=()=>{N&&X(!0)},ey=()=>{N&&ep(!0)},e_=()=>{T(!1),R(!1),I(null),er(!1),ea(null),eh(!1),ex(null)},ek=()=>{T(!1),R(!1),I(null),er(!1),ea(null),eh(!1),ex(null)},ew=e=>{navigator.clipboard.writeText(e),k.Z.success("Copied to clipboard!")},eZ=e=>e.replace(/^supports_/,"").split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),eC=e=>Object.entries(e).filter(e=>{let[s,l]=e;return s.startsWith("supports_")&&!0===l}).map(e=>{let[s]=e;return s}),eS=e=>"$".concat((1e6*e).toFixed(2)),eP=(0,d.useCallback)(e=>{W(e)},[]);return(console.log("publicPage: ",f),console.log("publicPageAllowed: ",C),f&&C)?(0,a.jsx)(E.Z,{accessToken:N}):(0,a.jsxs)("div",{className:"w-full mx-4 h-[75vh]",children:[!1==f?(0,a.jsxs)("div",{className:"w-full m-2 mt-2 p-8",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,a.jsxs)("div",{className:"flex flex-col items-start",children:[(0,a.jsx)(r.Dx,{className:"text-center",children:"AI Hub"}),(0,x.tY)(w||"")?(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Make models, agents, and MCP servers public for developers to know what's available."}):(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"A list of all public model names personally available to you."})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(r.xv,{children:"Model Hub URL:"}),(0,a.jsxs)("div",{className:"flex items-center bg-gray-200 px-2 py-1 rounded",children:[(0,a.jsx)(r.xv,{className:"mr-2",children:"".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")}),(0,a.jsx)("button",{onClick:()=>ew("".concat((0,_.getProxyBaseUrl)(),"/ui/model_hub_table")),className:"p-1 hover:bg-gray-300 rounded transition-colors",title:"Copy URL",children:(0,a.jsx)(i.Z,{size:16,className:"text-gray-600"})})]})]})]}),(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"mt-8 mb-2",children:(0,a.jsx)(V,{accessToken:N,userRole:w})}),(0,a.jsxs)(r.v0,{children:[(0,a.jsxs)(r.td,{className:"mb-4",children:[(0,a.jsx)(r.OK,{children:"Model Hub"}),(0,a.jsx)(r.OK,{children:"Agent Hub"}),(0,a.jsx)(r.OK,{children:"MCP Hub"})]}),(0,a.jsxs)(r.nP,{children:[(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>eN(),children:"Select Models to Make Public"})}),(0,a.jsx)(M,{modelHubData:z||[],onFilteredDataChange:eP}),(0,a.jsx)(F.C,{columns:U(e=>{I(e),T(!0)},ew,f),data:Y,isLoading:D,table:ej,defaultSorting:[{id:"model_group",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",Y.length," of ",(null==z?void 0:z.length)||0," models"]})})]}),(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>ef(),children:"Select Agents to Make Public"})}),(0,a.jsx)(F.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,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.name}),(0,a.jsx)(p.Z,{title:"Copy agent name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.description})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.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,a.jsxs)(m.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,a.jsx)(u.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,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)(u.Z,{className:"text-xs font-medium",children:[l.length," skill",1!==l.length?"s":""]}),l.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map(e=>(0,a.jsx)(g.Z,{color:"purple",className:"text-xs",children:e.name},e.id)),l.length>2&&(0,a.jsxs)(u.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,a.jsx)("div",{className:"flex flex-wrap gap-1",children:0===l.length?(0,a.jsx)(u.Z,{className:"text-gray-500 text-xs",children:"-"}):l.map(e=>(0,a.jsx)(m.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,t=l.defaultInputModes||[],r=l.defaultOutputModes||[];return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)(u.Z,{className:"text-xs",children:[(0,a.jsx)("span",{className:"font-medium",children:"In:"})," ",t.join(", ")||"-"]}),(0,a.jsxs)(u.Z,{className:"text-xs",children:[(0,a.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,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.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,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ea(e),er(!0)},ew,f),data:J||[],isLoading:ee,table:ev,defaultSorting:[{id:"name",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.jsxs)(r.xv,{className:"text-sm text-gray-600",children:["Showing ",(null==J?void 0:J.length)||0," agent",(null==J?void 0:J.length)!==1?"s":""]})})]}),(0,a.jsxs)(r.x4,{children:[(0,a.jsxs)(r.Zb,{children:[!1==f&&(0,x.tY)(w||"")&&(0,a.jsx)("div",{className:"flex justify-end mb-4",children:(0,a.jsx)(r.zx,{onClick:()=>ey(),children:"Select MCP Servers to Make Public"})}),(0,a.jsx)(F.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,r=l.original;return(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"font-medium text-sm",children:r.server_name}),(0,a.jsx)(p.Z,{title:"Copy server name",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.server_name),className:"cursor-pointer text-gray-500 hover:text-blue-500 text-xs"})})]}),(0,a.jsx)("div",{className:"md:hidden",children:(0,a.jsx)(u.Z,{className:"text-xs text-gray-600",children:r.description||"-"})})]})}},{header:"Description",accessorKey:"description",enableSorting:!0,sortingFn:"alphanumeric",cell:e=>{let{row:s}=e,l=s.original;return(0,a.jsx)(u.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,r=l.original;return(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(u.Z,{className:"text-xs truncate max-w-xs",children:r.url}),(0,a.jsx)(p.Z,{title:"Copy URL",children:(0,a.jsx)(t.Z,{onClick:()=>s(r.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,a.jsx)(m.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,t="none"===l.auth_type?"gray":"green";return(0,a.jsx)(m.Z,{color:t,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,t={active:"green",inactive:"red",unknown:"gray",healthy:"green",unhealthy:"red"}[l.status]||"gray";return(0,a.jsx)(m.Z,{color:t,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,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)(u.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,a.jsxs)("div",{className:"flex flex-wrap gap-1",children:[l.slice(0,2).map((e,s)=>(0,a.jsx)(g.Z,{color:"purple",className:"text-xs",children:e},s)),l.length>2&&(0,a.jsxs)(u.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,a.jsx)(u.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,a;return((null===(l=e.original.mcp_info)||void 0===l?void 0:l.is_public)===!0?1:0)-((null===(a=s.original.mcp_info)||void 0===a?void 0:a.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,a.jsx)(m.Z,{color:"green",size:"xs",children:"Yes"}):(0,a.jsx)(m.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,t=l.original;return(0,a.jsxs)(h.Z,{size:"xs",variant:"secondary",onClick:()=>e(t),icon:j.Z,children:[(0,a.jsx)("span",{className:"hidden lg:inline",children:"Details"}),(0,a.jsx)("span",{className:"lg:hidden",children:"Info"})]})}}]}(e=>{ex(e),eh(!0)},ew,f),data:en||[],isLoading:ec,table:eb,defaultSorting:[{id:"server_name",desc:!1}]})]}),(0,a.jsx)("div",{className:"mt-4 text-center space-y-2",children:(0,a.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,a.jsxs)(r.Zb,{className:"mx-auto max-w-xl mt-10",children:[(0,a.jsx)(r.xv,{className:"text-xl text-center mb-2 text-black",children:"Public Model Hub not enabled."}),(0,a.jsx)("p",{className:"text-base text-center text-slate-800",children:"Ask your proxy admin to enable this on their Admin UI."})]}),(0,a.jsx)(n.Z,{title:"Public Model Hub",width:600,visible:H,footer:null,onOk:e_,onCancel:ek,children:(0,a.jsxs)("div",{className:"pt-5 pb-5",children:[(0,a.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,a.jsx)(r.xv,{className:"text-base mr-2",children:"Shareable Link:"}),(0,a.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,_.getProxyBaseUrl)(),"/ui/model_hub_table")})]}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(r.zx,{onClick:()=>{eg.replace("/model_hub_table?key=".concat(N))},children:"See Page"})})]})}),(0,a.jsx)(n.Z,{title:(null==B?void 0:B.model_group)||"Model Details",width:1e3,visible:K,footer:null,onOk:e_,onCancel:ek,children:B&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Model Group:"}),(0,a.jsx)(r.xv,{children:B.model_group})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Mode:"}),(0,a.jsx)(r.xv,{children:B.mode||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Providers:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:B.providers.map(e=>(0,a.jsx)(r.Ct,{color:"blue",children:e},e))})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Max Input Tokens:"}),(0,a.jsx)(r.xv,{children:(null===(s=B.max_input_tokens)||void 0===s?void 0:s.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Max Output Tokens:"}),(0,a.jsx)(r.xv,{children:(null===(l=B.max_output_tokens)||void 0===l?void 0:l.toLocaleString())||"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Input Cost per 1M Tokens:"}),(0,a.jsx)(r.xv,{children:B.input_cost_per_token?eS(B.input_cost_per_token):"Not specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Output Cost per 1M Tokens:"}),(0,a.jsx)(r.xv,{children:B.output_cost_per_token?eS(B.output_cost_per_token):"Not specified"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:(()=>{let e=eC(B),s=["green","blue","purple","orange","red","yellow"];return 0===e.length?(0,a.jsx)(r.xv,{className:"text-gray-500",children:"No special capabilities listed"}):e.map((e,l)=>(0,a.jsx)(r.Ct,{color:s[l%s.length],children:eZ(e)},e))})()})]}),(B.tpm||B.rpm)&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Rate Limits"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[B.tpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Tokens per Minute:"}),(0,a.jsx)(r.xv,{children:B.tpm.toLocaleString()})]}),B.rpm&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Requests per Minute:"}),(0,a.jsx)(r.xv,{children:B.rpm.toLocaleString()})]})]})]}),B.supported_openai_params&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Supported OpenAI Parameters"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:B.supported_openai_params.map(e=>(0,a.jsx)(r.Ct,{color:"green",children:e},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)(o.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(B.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,a.jsx)(n.Z,{title:(null==el?void 0:el.name)||"Agent Details",width:1e3,visible:et,footer:null,onOk:e_,onCancel:ek,children:el&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Name:"}),(0,a.jsx)(r.xv,{children:el.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Version:"}),(0,a.jsxs)(r.Ct,{color:"blue",children:["v",el.version]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Protocol Version:"}),(0,a.jsx)(r.xv,{children:el.protocolVersion})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(r.xv,{className:"truncate",children:el.url}),(0,a.jsx)(t.Z,{onClick:()=>ew(el.url),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,a.jsx)(r.xv,{className:"mt-1",children:el.description})]})]}),el.capabilities&&Object.keys(el.capabilities).length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Capabilities"}),(0,a.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,a.jsx)(r.Ct,{color:"green",children:s},s)})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Input Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(v=el.defaultInputModes)||void 0===v?void 0:v.map(e=>(0,a.jsx)(r.Ct,{color:"blue",children:e},e)))||(0,a.jsx)(r.xv,{children:"Not specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Output Modes:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:(null===(b=el.defaultOutputModes)||void 0===b?void 0:b.map(e=>(0,a.jsx)(r.Ct,{color:"purple",children:e},e)))||(0,a.jsx)(r.xv,{children:"Not specified"})})]})]})]}),el.skills&&el.skills.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Skills"}),(0,a.jsx)("div",{className:"space-y-4",children:el.skills.map(e=>(0,a.jsxs)("div",{className:"border border-gray-200 rounded p-4",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium text-base",children:e.name}),(0,a.jsxs)(r.xv,{className:"text-xs text-gray-500",children:["ID: ",e.id]})]}),e.tags&&e.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.map(e=>(0,a.jsx)(r.Ct,{color:"purple",size:"xs",children:e},e))})]}),(0,a.jsx)(r.xv,{className:"text-sm mb-2",children:e.description}),e.examples&&e.examples.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-xs font-medium text-gray-700",children:"Examples:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.examples.map((e,s)=>(0,a.jsx)(r.Ct,{color:"gray",size:"xs",children:e},s))})]})]},e.id))})]}),el.supportsAuthenticatedExtendedCard&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Additional Features"}),(0,a.jsx)(r.Ct,{color:"green",children:"Supports Authenticated Extended Card"})]})]})}),(0,a.jsx)(n.Z,{title:(null==eo?void 0:eo.server_name)||"MCP Server Details",width:1e3,visible:em,footer:null,onOk:e_,onCancel:ek,children:eo&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{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)(r.xv,{className:"font-medium",children:"Server Name:"}),(0,a.jsx)(r.xv,{children:eo.server_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Server ID:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)(r.xv,{className:"text-xs truncate",children:eo.server_id}),(0,a.jsx)(t.Z,{onClick:()=>ew(eo.server_id),className:"cursor-pointer text-gray-500 hover:text-blue-500"})]})]}),eo.alias&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Alias:"}),(0,a.jsx)(r.xv,{children:eo.alias})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Transport:"}),(0,a.jsx)(r.Ct,{color:"blue",children:eo.transport})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Auth Type:"}),(0,a.jsx)(r.Ct,{color:"none"===eo.auth_type?"gray":"green",children:eo.auth_type})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Status:"}),(0,a.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,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Description:"}),(0,a.jsx)(r.xv,{className:"mt-1",children:eo.description})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Connection Details"}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"URL:"}),(0,a.jsxs)("div",{className:"flex items-center space-x-2 mt-1",children:[(0,a.jsx)(r.xv,{className:"text-sm break-all bg-gray-100 p-2 rounded flex-1",children:eo.url}),(0,a.jsx)(t.Z,{onClick:()=>ew(eo.url),className:"cursor-pointer text-gray-500 hover:text-blue-500 flex-shrink-0"})]})]}),eo.command&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Command:"}),(0,a.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,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Allowed Tools"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.allowed_tools.map((e,s)=>(0,a.jsx)(r.Ct,{color:"purple",children:e},s))})]}),eo.teams&&eo.teams.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Teams"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.teams.map((e,s)=>(0,a.jsx)(r.Ct,{color:"blue",children:e},s))})]}),eo.mcp_access_groups&&eo.mcp_access_groups.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Access Groups"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:eo.mcp_access_groups.map((e,s)=>(0,a.jsx)(r.Ct,{color:"green",children:e},s))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Metadata"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created By:"}),(0,a.jsx)(r.xv,{children:eo.created_by})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Updated By:"}),(0,a.jsx)(r.xv,{children:eo.updated_by})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Created At:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.created_at).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Updated At:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.updated_at).toLocaleString()})]}),eo.last_health_check&&(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"font-medium",children:"Last Health Check:"}),(0,a.jsx)(r.xv,{className:"text-sm",children:new Date(eo.last_health_check).toLocaleString()})]})]}),eo.health_check_error&&(0,a.jsxs)("div",{className:"mt-2 p-2 bg-red-50 rounded",children:[(0,a.jsx)(r.xv,{className:"font-medium text-red-700",children:"Health Check Error:"}),(0,a.jsx)(r.xv,{className:"text-sm text-red-600 mt-1",children:eo.health_check_error})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(r.xv,{className:"text-lg font-semibold mb-4",children:"Usage Example"}),(0,a.jsx)(o.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,a.jsx)(A,{visible:q,onClose:()=>G(!1),accessToken:N||"",modelHubData:z||[],onSuccess:()=>{N&&(async()=>{try{let e=await (0,_.modelHubCall)(N);L(e.data)}catch(e){console.error("Error refreshing model data:",e)}})()}}),(0,a.jsx)(Z,{visible:Q,onClose:()=>X(!1),accessToken:N||"",agentHubData:J||[],onSuccess:()=>{N&&(async()=>{try{let e=(await (0,_.getAgentsList)(N)).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,a.jsx)(S,{visible:eu,onClose:()=>ep(!1),accessToken:N||"",mcpHubData:en||[],onSuccess:()=>{N&&(async()=>{try{let e=await (0,_.fetchMCPServers)(N);ei(e)}catch(e){console.error("Error refreshing MCP server data:",e)}})()}})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2273-d8bd63b2792d0fd2.js b/litellm/proxy/_experimental/out/_next/static/chunks/2273-c902438b7579c117.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/2273-d8bd63b2792d0fd2.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2273-c902438b7579c117.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2377-674bd40044d10e16.js b/litellm/proxy/_experimental/out/_next/static/chunks/2377-7121736141e67af2.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/2377-674bd40044d10e16.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2377-7121736141e67af2.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2409-e94c05c6f11bb939.js b/litellm/proxy/_experimental/out/_next/static/chunks/2409-79fdc0573d81b0e4.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/2409-e94c05c6f11bb939.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2409-79fdc0573d81b0e4.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2831-780a653f6bb335ce.js b/litellm/proxy/_experimental/out/_next/static/chunks/2831-780a653f6bb335ce.js new file mode 100644 index 0000000000..2d00ff62ec --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/2831-780a653f6bb335ce.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2831],{34310:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(1119),i=r(2265),s={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"},a=r(55015),o=i.forwardRef(function(e,t){return i.createElement(a.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},35829:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853),i=r(26898),s=r(13241),a=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,s.q)("font-semibold text-tremor-metric",r?(0,a.bM)(r,i.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",l)},c),u)});u.displayName="Metric"},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,s={},a=0,o={};function u(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=_(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new d(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:s,workerId:o.WORKER_ID,finished:n});else if(k(this._config.chunk)&&!t){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=s=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!n||!k(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||s&&s.meta.paused||this._nextChunk(),s}this._halted=!0},this._sendError=function(e){k(this._config.error)?this._config.error(e):i&&this._config.error&&r.postMessage({workerId:o.WORKER_ID,error:e,finished:!1})}}function l(e){var t;(e=e||{}).chunkSize||(e.chunkSize=o.RemoteChunkSize),u.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=v(this._chunkLoaded,this),t.onerror=v(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=o.LocalChunkSize),u.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=v(this._chunkLoaded,this),t.onerror=v(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 h(e){var t;u.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){u.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.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=v(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=v(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=v(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=v(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function d(e){var t,r,n,i,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,a=/^((\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)))$/,u=this,l=0,c=0,h=!1,f=!1,d=[],y={data:[],errors:[],meta:{}};function g(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function b(){if(y&&n&&(C("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(y.data=y.data.filter(function(e){return!g(e)})),v()){if(y){if(Array.isArray(y.data[0])){for(var t,r=0;v()&&r=d.length?"__parsed_extra":d[i]:o,l=u=e.transform?e.transform(u,o):u,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===l||"TRUE"===l||"false"!==l&&"FALSE"!==l&&((e=>{if(s.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(l)?parseFloat(l):a.test(l)?new Date(l):""===l?null:l):l);"__parsed_extra"===o?(n[o]=n[o]||[],n[o].push(u)):n[o]=u}return e.header&&(i>d.length?C("FieldMismatch","TooManyFields","Too many fields: expected "+d.length+" fields but parsed "+i,c+r):ie.preview?r.abort():(y.data=y.data[0],i(y,u))))}),this.parse=function(i,s,a){var u=e.quoteChar||'"',u=(e.newline||(e.newline=this.guessLineEndings(i,u)),n=!1,e.delimiter?k(e.delimiter)&&(e.delimiter=e.delimiter(i),y.meta.delimiter=e.delimiter):((u=((t,r,n,i,s)=>{var a,u,l,c;s=s||[","," ","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var h=0;h=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,s=e.preview,a=e.fastMode,u=null,l=!1,c=null==e.quoteChar?'"':e.quoteChar,h=c;if(void 0!==e.escapeChar&&(h=e.escapeChar),("string"!=typeof t||-1=s)return N(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:w.length,index:f}),q++}}else if(n&&0===O.length&&o.substring(f,f+v)===n){if(-1===A)return N();f=A+_,A=o.indexOf(r,f),P=o.indexOf(t,f)}else if(-1!==P&&(P=s)return N(!0)}return I();function j(e){w.push(e),x=f}function F(e){return -1!==e&&(e=o.substring(q+1,e))&&""===e.trim()?e.length:0}function I(e){return y||(void 0===e&&(e=o.substring(f)),O.push(e),f=g,j(O),C&&L()),N()}function M(e){f=e,j(O),O=[],A=o.indexOf(r,f)}function N(n){if(e.header&&!m&&w.length&&!l){var i=w[0],s=Object.create(null),a=new Set(i);let t=!1;for(let r=0;r{if("object"==typeof t){if("string"!=typeof t.delimiter||o.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||(l=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(a=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&&(u=t.escapeChar+a),t.escapeFormulae instanceof RegExp?h=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(h=/^[=+\-@\t\r].*$/)}})(),RegExp(p(a),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return d(null,e,l);if("object"==typeof e[0])return d(c||Object.keys(e[0]),e,l)}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])),d(e.fields||[],e.data||[],l);throw Error("Unable to serialize unrecognized input");function d(e,t,r){var a="",o=("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 s=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,a),n=i.default.Children.only(t);return i.default.cloneElement(n,l(l({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r"boolean"==typeof e||e instanceof Boolean,s=e=>"number"==typeof e||e instanceof Number,a=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,h=e=>!!e&&e instanceof Object&&"function"==typeof e;function f(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function d(e){let{field:t,value:r,data:i,lastElement:s,openBracket:a,closeBracket:o,level:u,style:l,shouldExpandNode:c,clickToExpandNode:h,outerRef:d,beforeExpandChange:p}=e,m=(0,n.useRef)(!1),[y,b]=(0,n.useState)(()=>c(u,r,t)),_=(0,n.useRef)(null);(0,n.useEffect)(()=>{m.current?b(c(u,r,t)):m.current=!0},[c]);let v=(0,n.useId)();if(0===i.length)return function(e){let{field:t,openBracket:r,closeBracket:i,lastElement:s,style:a}=e;return(0,n.createElement)("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,n.createElement)("span",{className:a.label},f(t,a.quotesForFieldNames),":"),(0,n.createElement)("span",{className:a.punctuation},r),(0,n.createElement)("span",{className:a.punctuation},i),!s&&(0,n.createElement)("span",{className:a.punctuation},","))}({field:t,openBracket:a,closeBracket:o,lastElement:s,style:l});let k=y?l.collapseIcon:l.expandIcon,C=y?l.ariaLables.collapseJson:l.ariaLables.expandJson,w=u+1,E=i.length-1,O=e=>{y!==e&&(!p||p({level:u,value:r,field:t,newExpandValue:e}))&&b(e)},x=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(!d.current)return;let r=d.current.querySelectorAll("[role=button]"),n=-1;for(let e=0;e{var e;O(!y);let t=_.current;if(!t)return;let r=null===(e=d.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":y,"aria-selected":void 0},(0,n.createElement)("span",{className:k,onClick:R,onKeyDown:x,role:"button","aria-label":C,"aria-expanded":y,"aria-controls":y?v:void 0,ref:_,tabIndex:0===u?0:-1}),(t||""===t)&&(h?(0,n.createElement)("span",{className:l.clickableLabel,onClick:R,onKeyDown:x},f(t,l.quotesForFieldNames),":"):(0,n.createElement)("span",{className:l.label},f(t,l.quotesForFieldNames),":")),(0,n.createElement)("span",{className:l.punctuation},a),y?(0,n.createElement)("ul",{id:v,role:"group",className:l.childFieldsContainer},i.map((e,t)=>(0,n.createElement)(g,{key:e[0]||t,field:e[0],value:e[1],style:l,lastElement:t===E,level:w,shouldExpandNode:c,clickToExpandNode:h,beforeExpandChange:p,outerRef:d}))):(0,n.createElement)("span",{className:l.collapsedContent,onClick:R,onKeyDown:x}),(0,n.createElement)("span",{className:l.punctuation},o),!s&&(0,n.createElement)("span",{className:l.punctuation},","))}function p(e){let{field:t,value:r,style:n,lastElement:i,shouldExpandNode:s,clickToExpandNode:a,level:o,outerRef:u,beforeExpandChange:l}=e;return d({field:t,value:r,lastElement:i||!1,level:o,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:s,clickToExpandNode:a,data:Object.keys(r).map(e=>[e,r[e]]),outerRef:u,beforeExpandChange:l})}function m(e){let{field:t,value:r,style:n,lastElement:i,level:s,shouldExpandNode:a,clickToExpandNode:o,outerRef:u,beforeExpandChange:l}=e;return d({field:t,value:r,lastElement:i||!1,level:s,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:a,clickToExpandNode:o,data:r.map(e=>[void 0,e]),outerRef:u,beforeExpandChange:l})}function y(e){let t,{field:r,value:l,style:c,lastElement:d}=e,p=c.otherValue;if(null===l)t="null",p=c.nullValue;else if(void 0===l)t="undefined",p=c.undefinedValue;else if(u(l)){var m;m=!c.noQuotesForStringValues,t=c.stringifyStringValues?JSON.stringify(l):m?`"${l}"`:l,p=c.stringValue}else i(l)?(t=l?"true":"false",p=c.booleanValue):s(l)?(t=l.toString(),p=c.numberValue):a(l)?(t=`${l.toString()}n`,p=c.numberValue):t=o(l)?l.toISOString():h(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},f(r,c.quotesForFieldNames),":"),(0,n.createElement)("span",{className:p},t),!d&&(0,n.createElement)("span",{className:c.punctuation},","))}function g(e){let t=e.value;return l(t)?(0,n.createElement)(m,Object.assign({},e)):!c(t)||o(t)||h(t)?(0,n.createElement)(y,Object.assign({},e)):(0,n.createElement)(p,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},_=()=>!0,v=e=>{let{data:t,style:r=b,shouldExpandNode:i=_,clickToExpandNode:s=!1,beforeExpandChange:a,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)(g,{key:t,field:t,value:o,style:{...b,...r},lastElement:!0,level:1,shouldExpandNode:i,clickToExpandNode:s,beforeExpandChange:a,outerRef:l})}):(0,n.createElement)(g,{value:t,style:{...b,...r},lastElement:!0,level:0,shouldExpandNode:i,clickToExpandNode:s,outerRef:l,beforeExpandChange:a}))}},52621:function(){},44643:function(e,t,r){"use strict";var n=r(2265);let i=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 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},88532:function(e,t,r){"use strict";var n=r(2265);let i=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 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"}))});t.Z=i},71157:function(e,t,r){"use strict";var n=r(2265);let i=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 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=i},2894:function(e,t,r){"use strict";r.d(t,{R:function(){return o},m:function(){return a}});var n=r(18238),i=r(7989),s=r(11255),a=class extends i.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.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,s.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#i({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#i({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,i=!this.#n.canStart();try{if(n)t();else{this.#i({type:"pending",variables:e,isPaused:i}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#i({type:"pending",context:t,variables:e,isPaused:i})}let s=await this.#n.start();return await this.#r.config.onSuccess?.(s,e,this.state.context,this,r),await this.options.onSuccess?.(s,e,this.state.context,r),await this.#r.config.onSettled?.(s,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(s,null,e,this.state.context,r),this.#i({type:"success",data:s}),s}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.#i({type:"error",error:t})}}finally{this.#r.runNext(this)}}#i(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 m}});var n=r(45345),i=r(21733),s=r(18238),a=r(24112),o=class extends a.l{constructor(e={}){super(),this.config=e,this.#s=new Map}#s;build(e,t,r){let s=t.queryKey,a=t.queryHash??(0,n.Rm)(s,t),o=this.get(a);return o||(o=new i.A({client:e,queryKey:s,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#s.has(e.queryHash)||(this.#s.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#s.get(e.queryHash);t&&(e.destroy(),t===e&&this.#s.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){s.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#s.get(e)}getAll(){return[...this.#s.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){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){s.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},u=r(2894),l=class extends a.l{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#o=new Map,this.#u=0}#a;#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.#a.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.#a.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(){s.Vr.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#o.clear()})}getAll(){return Array.from(this.#a)}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){s.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return s.Vr.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function c(e){return e.options.scope?.id}var h=r(87045),f=r(57853);function d(e){return{onFetch:(t,r)=>{let i=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,a=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)})},h=(0,n.cG)(t.options,t.fetchOptions),f=async(e,i,s)=>{if(r)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:s?"backward":"forward",meta:t.options.meta};return c(e),e})(),o=await h(a),{maxPages:u}=t.options,l=s?n.Ht:n.VX;return{pages:l(e.pages,o,u),pageParams:l(e.pageParams,i,u)}};if(s&&a.length){let e="backward"===s,t={pages:a,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:p)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===l?o[0]??i.initialPageParam:p(i,u);if(l>0&&null==e)break;u=await f(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 p(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 m=class{#l;#r;#c;#h;#f;#d;#p;#m;constructor(e={}){this.#l=e.queryCache||new o,this.#r=e.mutationCache||new l,this.#c=e.defaultOptions||{},this.#h=new Map,this.#f=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#p=h.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onFocus())}),this.#m=f.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#p?.(),this.#p=void 0,this.#m?.(),this.#m=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),i=r.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#l.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let i=this.defaultQueryOptions({queryKey:e}),s=this.#l.get(i.queryHash),a=s?.state.data,o=(0,n.SE)(t,a);if(void 0!==o)return this.#l.build(this,i).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return s.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;s.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#l;return s.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(s.Vr.batch(()=>this.#l.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return s.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(s.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=d(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=d(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return f.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.#h.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#h.values()],r={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#f.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#f.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()}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/2901-964a2f81e9258ad6.js b/litellm/proxy/_experimental/out/_next/static/chunks/2901-0cdd0656eb7463d6.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/2901-964a2f81e9258ad6.js rename to litellm/proxy/_experimental/out/_next/static/chunks/2901-0cdd0656eb7463d6.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3163-8b2c3b9e10ac4f04.js b/litellm/proxy/_experimental/out/_next/static/chunks/3163-8b2c3b9e10ac4f04.js new file mode 100644 index 0000000000..9bfb311285 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3163-8b2c3b9e10ac4f04.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3163],{15327:function(e,o,r){r.d(o,{Z:function(){return a}});var n=r(1119),t=r(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},l=r(55015),a=t.forwardRef(function(e,o){return t.createElement(l.Z,(0,n.Z)({},e,{ref:o,icon:c}))})},3632:function(e,o,r){r.d(o,{Z:function(){return a}});var n=r(1119),t=r(2265),c={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),a=t.forwardRef(function(e,o){return t.createElement(l.Z,(0,n.Z)({},e,{ref:o,icon:c}))})},15883:function(e,o,r){r.d(o,{Z:function(){return a}});var n=r(1119),t=r(2265),c={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"},l=r(55015),a=t.forwardRef(function(e,o){return t.createElement(l.Z,(0,n.Z)({},e,{ref:o,icon:c}))})},67101:function(e,o,r){r.d(o,{Z:function(){return d}});var n=r(5853),t=r(13241),c=r(1153),l=r(2265),a=r(9496);let s=(0,c.fn)("Grid"),i=(e,o)=>e&&Object.keys(o).includes(String(e))?o[e]:"",d=l.forwardRef((e,o)=>{let{numItems:r=1,numItemsSm:c,numItemsMd:d,numItemsLg:u,children:g,className:m}=e,p=(0,n._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),f=i(r,a._m),h=i(c,a.LH),b=i(d,a.l5),v=i(u,a.N4),k=(0,t.q)(f,h,b,v);return l.createElement("div",Object.assign({ref:o,className:(0,t.q)(s("root"),"grid",k,m)},p),g)});d.displayName="Grid"},9496:function(e,o,r){r.d(o,{LH:function(){return t},N4:function(){return l},PT:function(){return a},SP:function(){return s},VS:function(){return i},_m:function(){return n},_w:function(){return d},l5:function(){return c}});let n={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"},t={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"},c={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"},l={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"},a={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"},s={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"},i={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"}},3810:function(e,o,r){r.d(o,{Z:function(){return N}});var n=r(2265),t=r(36760),c=r.n(t),l=r(18694),a=r(93350),s=r(53445),i=r(19722),d=r(6694),u=r(71744),g=r(93463),m=r(54558),p=r(12918),f=r(71140),h=r(99320);let b=e=>{let{paddingXXS:o,lineWidth:r,tagPaddingHorizontal:n,componentCls:t,calc:c}=e,l=c(n).sub(r).equal(),a=c(o).sub(r).equal();return{[t]:Object.assign(Object.assign({},(0,p.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,g.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorder),borderRadius:e.borderRadiusSM,opacity:1,transition:"all ".concat(e.motionDurationMid),textAlign:"start",position:"relative",["&".concat(t,"-rtl")]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},["".concat(t,"-close-icon")]:{marginInlineStart:a,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:"all ".concat(e.motionDurationMid),"&:hover":{color:e.colorTextHeading}},["&".concat(t,"-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(t,"-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(t,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},v=e=>{let{lineWidth:o,fontSizeIcon:r,calc:n}=e,t=e.fontSizeSM;return(0,f.IX)(e,{tagFontSize:t,tagLineHeight:(0,g.bf)(n(e.lineHeightSM).mul(t).equal()),tagIconSize:n(r).sub(n(o).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},k=e=>({defaultBg:new m.t(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var w=(0,h.I$)("Tag",e=>b(v(e)),k),C=function(e,o){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>o.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,n=Object.getOwnPropertySymbols(e);to.indexOf(n[t])&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(r[n[t]]=e[n[t]]);return r};let y=n.forwardRef((e,o)=>{let{prefixCls:r,style:t,className:l,checked:a,children:s,icon:i,onChange:d,onClick:g}=e,m=C(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:p,tag:f}=n.useContext(u.E_),h=p("tag",r),[b,v,k]=w(h),y=c()(h,"".concat(h,"-checkable"),{["".concat(h,"-checkable-checked")]:a},null==f?void 0:f.className,l,v,k);return b(n.createElement("span",Object.assign({},m,{ref:o,style:Object.assign(Object.assign({},t),null==f?void 0:f.style),className:y,onClick:e=>{null==d||d(!a),null==g||g(e)}}),i,n.createElement("span",null,s)))});var x=r(18536);let E=e=>(0,x.Z)(e,(o,r)=>{let{textColor:n,lightBorderColor:t,lightColor:c,darkColor:l}=r;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(o)]:{color:n,background:c,borderColor:t,"&-inverse":{color:e.colorTextLightSolid,background:l,borderColor:l},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var O=(0,h.bk)(["Tag","preset"],e=>E(v(e)),k);let S=(e,o,r)=>{let n="string"!=typeof r?r:r.charAt(0).toUpperCase()+r.slice(1);return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(o)]:{color:e["color".concat(r)],background:e["color".concat(n,"Bg")],borderColor:e["color".concat(n,"Border")],["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}};var j=(0,h.bk)(["Tag","status"],e=>{let o=v(e);return[S(o,"success","Success"),S(o,"processing","Info"),S(o,"error","Error"),S(o,"warning","Warning")]},k),L=function(e,o){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>o.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var t=0,n=Object.getOwnPropertySymbols(e);to.indexOf(n[t])&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(r[n[t]]=e[n[t]]);return r};let Z=n.forwardRef((e,o)=>{let{prefixCls:r,className:t,rootClassName:g,style:m,children:p,icon:f,color:h,onClose:b,bordered:v=!0,visible:k}=e,C=L(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:y,direction:x,tag:E}=n.useContext(u.E_),[S,Z]=n.useState(!0),N=(0,l.Z)(C,["closeIcon","closable"]);n.useEffect(()=>{void 0!==k&&Z(k)},[k]);let B=(0,a.o2)(h),I=(0,a.yT)(h),M=B||I,R=Object.assign(Object.assign({backgroundColor:h&&!M?h:void 0},null==E?void 0:E.style),m),z=y("tag",r),[P,T,H]=w(z),W=c()(z,null==E?void 0:E.className,{["".concat(z,"-").concat(h)]:M,["".concat(z,"-has-color")]:h&&!M,["".concat(z,"-hidden")]:!S,["".concat(z,"-rtl")]:"rtl"===x,["".concat(z,"-borderless")]:!v},t,g,T,H),_=e=>{e.stopPropagation(),null==b||b(e),e.defaultPrevented||Z(!1)},[,A]=(0,s.b)((0,s.w)(e),(0,s.w)(E),{closable:!1,closeIconRender:e=>{let o=n.createElement("span",{className:"".concat(z,"-close-icon"),onClick:_},e);return(0,i.wm)(e,o,e=>({onClick:o=>{var r;null===(r=null==e?void 0:e.onClick)||void 0===r||r.call(e,o),_(o)},className:c()(null==e?void 0:e.className,"".concat(z,"-close-icon"))}))}}),V="function"==typeof C.onClick||p&&"a"===p.type,q=f||null,F=q?n.createElement(n.Fragment,null,q,p&&n.createElement("span",null,p)):p,U=n.createElement("span",Object.assign({},N,{ref:o,className:W,style:R}),F,A,B&&n.createElement(O,{key:"preset",prefixCls:z}),I&&n.createElement(j,{key:"status",prefixCls:z}));return P(V?n.createElement(d.Z,{component:"Tag"},U):U)});Z.CheckableTag=y;var N=Z},79205:function(e,o,r){r.d(o,{Z:function(){return u}});var n=r(2265);let t=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,o,r)=>r?r.toUpperCase():o.toLowerCase()),l=e=>{let o=c(e);return o.charAt(0).toUpperCase()+o.slice(1)},a=function(){for(var e=arguments.length,o=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===o).join(" ").trim()},s=e=>{for(let o in e)if(o.startsWith("aria-")||"role"===o||"title"===o)return!0};var i={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,o)=>{let{color:r="currentColor",size:t=24,strokeWidth:c=2,absoluteStrokeWidth:l,className:d="",children:u,iconNode:g,...m}=e;return(0,n.createElement)("svg",{ref:o,...i,width:t,height:t,stroke:r,strokeWidth:l?24*Number(c)/Number(t):c,className:a("lucide",d),...!u&&!s(m)&&{"aria-hidden":"true"},...m},[...g.map(e=>{let[o,r]=e;return(0,n.createElement)(o,r)}),...Array.isArray(u)?u:[u]])}),u=(e,o)=>{let r=(0,n.forwardRef)((r,c)=>{let{className:s,...i}=r;return(0,n.createElement)(d,{ref:c,iconNode:o,className:a("lucide-".concat(t(l(e))),"lucide-".concat(e),s),...i})});return r.displayName=l(e),r}},30401:function(e,o,r){r.d(o,{Z:function(){return n}});let n=(0,r(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},78867:function(e,o,r){r.d(o,{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"}]])},77331:function(e,o,r){var n=r(2265);let t=n.forwardRef(function(e,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},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 19l-7-7m0 0l7-7m-7 7h18"}))});o.Z=t},86462:function(e,o,r){var n=r(2265);let t=n.forwardRef(function(e,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},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"}))});o.Z=t},44633:function(e,o,r){var n=r(2265);let t=n.forwardRef(function(e,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},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"}))});o.Z=t},93416:function(e,o,r){var n=r(2265);let t=n.forwardRef(function(e,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},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"}))});o.Z=t},49084:function(e,o,r){var n=r(2265);let t=n.forwardRef(function(e,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},e),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"}))});o.Z=t}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3250-6c57da6c11f342fa.js b/litellm/proxy/_experimental/out/_next/static/chunks/3250-6c57da6c11f342fa.js deleted file mode 100644 index c8c793ed69..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3250-6c57da6c11f342fa.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3250],{49634:function(e,r,o){o.d(r,{Z:function(){return s}});var t=o(1119),l=o(2265),a={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"},n=o(55015),s=l.forwardRef(function(e,r){return l.createElement(n.Z,(0,t.Z)({},e,{ref:r,icon:a}))})},94789:function(e,r,o){o.d(r,{Z:function(){return d}});var t=o(5853),l=o(2265),a=o(26898),n=o(13241),s=o(1153);let i=(0,s.fn)("Callout"),d=l.forwardRef((e,r)=>{let{title:o,icon:d,color:c,className:m,children:p}=e,u=(0,t._T)(e,["title","icon","color","className","children"]);return l.createElement("div",Object.assign({ref:r,className:(0,n.q)(i("root"),"flex flex-col overflow-hidden rounded-tremor-default text-tremor-default border-l-4 py-3 pr-3 pl-4",c?(0,n.q)((0,s.bM)(c,a.K.background).bgColor,(0,s.bM)(c,a.K.darkBorder).borderColor,(0,s.bM)(c,a.K.darkText).textColor,"dark:bg-opacity-10 bg-opacity-10"):(0,n.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"),m)},u),l.createElement("div",{className:(0,n.q)(i("header"),"flex items-start")},d?l.createElement(d,{className:(0,n.q)(i("icon"),"flex-none h-5 w-5 mr-1.5")}):null,l.createElement("h4",{className:(0,n.q)(i("title"),"font-semibold")},o)),l.createElement("p",{className:(0,n.q)(i("body"),"overflow-y-auto",p?"mt-2":"")},p))});d.displayName="Callout"},35829:function(e,r,o){o.d(r,{Z:function(){return i}});var t=o(5853),l=o(26898),a=o(13241),n=o(1153),s=o(2265);let i=s.forwardRef((e,r)=>{let{color:o,children:i,className:d}=e,c=(0,t._T)(e,["color","children","className"]);return s.createElement("p",Object.assign({ref:r,className:(0,a.q)("font-semibold text-tremor-metric",o?(0,n.bM)(o,l.K.darkText).textColor:"text-tremor-content-strong dark:text-dark-tremor-content-strong",d)},c),i)});i.displayName="Metric"},49096:function(e,r,o){o.d(r,{ZD:function(){return a}});var t=o(87602);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=e=>{let r=function(){for(var r,o,l=arguments.length,a=Array(l),n=0;n{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:a,defaultVariants:n}=e,s=Object.keys(a).map(e=>{let r=null==o?void 0:o[e],t=null==n?void 0:n[e],s=l(r)||l(t);return a[e][s]}),i={...n,...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:n,cva:s,cx:i}=a()},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}),a=(e=new Map,r=null,o)=>({nextPart:e,validators:r,classGroupId:o}),n=[],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],a=o[e];return r?a?t(a,r):r:a||n}return o[e]||n}}},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 a=o.validators;if(null===a)return;let n=0===r?e.join("-"):e.slice(r).join("-"),s=a.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=a();for(let t in e)p(e[t],o,t,r);return o},p=(e,r,o,t)=>{let l=e.length;for(let a=0;a{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),a=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,a)=>{o[l]=a,++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,a=0,n=e.length;for(let s=0;sa?r-a: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(a)):t.push(a)}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+/,C=(e,r)=>{let{parseClassName:o,getClassGroupId:t,getConflictingClassGroupIds:l,sortModifiers:a}=r,n=[],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]:a(c).join(":"),h=m?g+"!":g,k=h+f;if(n.indexOf(k)>-1)continue;n.push(k);let v=l(f,b);for(let e=0;e0?" "+i:i)}return i},O=(...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]||E;return r.isThemeGetter=!0,r},q=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,W=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$=/^\d+\/\d+$/,_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T=/\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$/,I=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,A=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=e=>$.test(e),K=e=>!!e&&!Number.isNaN(Number(e)),S=e=>!!e&&Number.isInteger(Number(e)),V=e=>e.endsWith("%")&&K(e.slice(0,-1)),P=e=>_.test(e),R=()=>!0,B=e=>T.test(e)&&!I.test(e),D=()=>!1,F=e=>Z.test(e),J=e=>A.test(e),L=e=>!U(e)&&!et(e),Q=e=>ec(e,eb,D),U=e=>q.test(e),X=e=>ec(e,ef,B),Y=e=>ec(e,eg,K),ee=e=>ec(e,ep,D),er=e=>ec(e,eu,J),eo=e=>ec(e,ek,F),et=e=>W.test(e),el=e=>em(e,ef),ea=e=>em(e,eh),en=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=q.exec(e);return!!t&&(t[1]?r(t[1]):o(t[2]))},em=(e,r,o=!1)=>{let t=W.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,a;let n=e=>{let r=t(e);if(r)return r;let a=C(e,o);return l(e,a),a};return a=s=>(t=(o=j(r.reduce((e,r)=>r(e),e()))).cache.get,l=o.cache.set,a=n,n(s)),(...e)=>a(O(...e))})(()=>{let e=G("color"),r=G("font"),o=G("text"),t=G("font-weight"),l=G("tracking"),a=G("leading"),n=G("breakpoint"),s=G("container"),i=G("spacing"),d=G("radius"),c=G("shadow"),m=G("inset-shadow"),p=G("text-shadow"),u=G("drop-shadow"),b=G("blur"),f=G("perspective"),g=G("aspect"),h=G("ease"),k=G("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=()=>[H,"full","auto",...j()],C=()=>[S,"none","subgrid",et,U],O=()=>["auto",{span:["full",S,et,U]},S,et,U],M=()=>[S,"auto",et,U],E=()=>["auto","min","max","fr",et,U],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...j()],_=()=>[H,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],T=()=>[e,et,U],I=()=>[...x(),en,ee,{position:[et,U]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",es,Q,{size:[et,U]}],B=()=>[V,el,X],D=()=>["","none","full",d,et,U],F=()=>["",K,el,X],J=()=>["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=()=>[K,V,en,ee],ep=()=>["","none",b,et,U],eu=()=>["none",K,et,U],eb=()=>["none",K,et,U],ef=()=>[K,et,U],eg=()=>[H,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[P],breakpoint:[P],color:[R],container:[P],"drop-shadow":[P],ease:["in","out","in-out"],font:[L],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[P],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[P],shadow:[P],spacing:["px",K],text:[P],"text-shadow":[P],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",H,U,et,g]}],container:["container"],columns:[{columns:[K,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:[S,"auto",et,U]}],basis:[{basis:[H,"full","auto",s,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[K,H,"auto","initial","none",U]}],grow:[{grow:["",K,et,U]}],shrink:[{shrink:["",K,et,U]}],order:[{order:[S,"first","last","none",et,U]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],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:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"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:[n]},..._()]}],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:[ea,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":[K,"none",et,Y]}],leading:[{leading:[a,...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:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[K,"from-font","auto",et,X]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[K,"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:I()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},S,et,U],radial:["",et,U],conic:[S,et,U]},ei,er]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[K,et,U]}],"outline-w":[{outline:["",K,el,X]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",c,ed,eo]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",m,ed,eo]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[K,X]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",p,ed,eo]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[K,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":[K]}],"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":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"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":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"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":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"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":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"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":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"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":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"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":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"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":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":[K]}],"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":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",et,U]}],filter:[{filter:["","none",et,U]}],blur:[{blur:ep()}],brightness:[{brightness:[K,et,U]}],contrast:[{contrast:[K,et,U]}],"drop-shadow":[{"drop-shadow":["","none",u,ed,eo]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",K,et,U]}],"hue-rotate":[{"hue-rotate":[K,et,U]}],invert:[{invert:["",K,et,U]}],saturate:[{saturate:[K,et,U]}],sepia:[{sepia:["",K,et,U]}],"backdrop-filter":[{"backdrop-filter":["","none",et,U]}],"backdrop-blur":[{"backdrop-blur":ep()}],"backdrop-brightness":[{"backdrop-brightness":[K,et,U]}],"backdrop-contrast":[{"backdrop-contrast":[K,et,U]}],"backdrop-grayscale":[{"backdrop-grayscale":["",K,et,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[K,et,U]}],"backdrop-invert":[{"backdrop-invert":["",K,et,U]}],"backdrop-opacity":[{"backdrop-opacity":[K,et,U]}],"backdrop-saturate":[{"backdrop-saturate":[K,et,U]}],"backdrop-sepia":[{"backdrop-sepia":["",K,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:[K,"initial",et,U]}],ease:[{ease:["linear","initial",h,et,U]}],delay:[{delay:[K,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:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",...T()]}],"stroke-w":[{stroke:[K,el,X,Y]}],stroke:[{stroke:["none",...T()]}],"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/3341-852c4599adcc0f2b.js b/litellm/proxy/_experimental/out/_next/static/chunks/3341-852c4599adcc0f2b.js deleted file mode 100644 index 6647f10868..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3341-852c4599adcc0f2b.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3341],{88009:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},37527:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),a={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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},9775:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),a={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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},11429:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},68208:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},83669:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),a={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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},99458:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},29271:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},41169:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},34310:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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 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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},10798:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},48231:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),a={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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},62272:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},28595:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},34419:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},23907:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},41361:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(1119),o=r(2265),a={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"},i=r(55015),s=o.forwardRef(function(e,t){return o.createElement(i.Z,(0,n.Z)({},e,{ref:t,icon:a}))})},92414:function(e,t,r){"use strict";r.d(t,{Z:function(){return b}});var n=r(5853),o=r(2265);r(42698),r(64016),r(8710);var a=r(33232),i=r(44140),s=r(58747);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:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"}))};var c=r(4537);let u=e=>{var t=(0,n._T)(e,[]);return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},t),o.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),o.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))};var d=r(13241),h=r(1153),f=r(96398),p=r(51975),m=r(85238);let g=(0,h.fn)("MultiSelect"),b=o.forwardRef((e,t)=>{let{defaultValue:r=[],value:h,onValueChange:b,placeholder:k="Select...",placeholderSearch:v="Search",disabled:y=!1,icon:w,children:x,className:C,required:E,name:_,error:O=!1,errorMessage:S,id:M}=e,R=(0,n._T)(e,["defaultValue","value","onValueChange","placeholder","placeholderSearch","disabled","icon","children","className","required","name","error","errorMessage","id"]),j=(0,o.useRef)(null),[N,z]=(0,i.Z)(r,h),{reactElementChildren:Z,optionsAvailable:L}=(0,o.useMemo)(()=>{let e=o.Children.toArray(x).filter(o.isValidElement);return{reactElementChildren:e,optionsAvailable:(0,f.n0)("",e)}},[x]),[T,I]=(0,o.useState)(""),A=(null!=N?N:[]).length>0,V=(0,o.useMemo)(()=>T?(0,f.n0)(T,Z):L,[T,Z,L]),q=()=>{I("")};return o.createElement("div",{className:(0,d.q)("w-full min-w-[10rem] text-tremor-default",C)},o.createElement("div",{className:"relative"},o.createElement("select",{title:"multi-select-hidden",required:E,className:(0,d.q)("h-full w-full absolute left-0 top-0 -z-10 opacity-0"),value:N,onChange:e=>{e.preventDefault()},name:_,disabled:y,multiple:!0,id:M,onFocus:()=>{let e=j.current;e&&e.focus()}},o.createElement("option",{className:"hidden",value:"",disabled:!0,hidden:!0},k),V.map(e=>{let t=e.props.value,r=e.props.children;return o.createElement("option",{className:"hidden",key:t,value:t},r)})),o.createElement(p.Ri,Object.assign({as:"div",ref:t,defaultValue:N,value:N,onChange:e=>{null==b||b(e),z(e)},disabled:y,id:M,multiple:!0},R),e=>{let{value:t}=e;return o.createElement(o.Fragment,null,o.createElement(p.Y4,{className:(0,d.q)("w-full outline-none text-left whitespace-nowrap truncate rounded-tremor-default focus:ring-2 transition duration-100 border pr-8 py-1.5","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",w?"pl-11 -ml-0.5":"pl-3",(0,f.um)(t.length>0,y,O)),ref:j},w&&o.createElement("span",{className:(0,d.q)("absolute inset-y-0 left-0 flex items-center ml-px pl-2.5")},o.createElement(w,{className:(0,d.q)(g("Icon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("div",{className:"h-6 flex items-center"},t.length>0?o.createElement("div",{className:"flex flex-nowrap overflow-x-scroll [&::-webkit-scrollbar]:hidden [scrollbar-width:none] gap-x-1 mr-5 -ml-1.5 relative"},L.filter(e=>t.includes(e.props.value)).map((e,r)=>{var n;return o.createElement("div",{key:r,className:(0,d.q)("max-w-[100px] lg:max-w-[200px] flex justify-center items-center pl-2 pr-1.5 py-1 font-medium","rounded-tremor-small","bg-tremor-background-muted dark:bg-dark-tremor-background-muted","bg-tremor-background-subtle dark:bg-dark-tremor-background-subtle","text-tremor-content-default dark:text-dark-tremor-content-default","text-tremor-content-emphasis dark:text-dark-tremor-content-emphasis")},o.createElement("div",{className:"text-xs truncate "},null!==(n=e.props.children)&&void 0!==n?n:e.props.value),o.createElement("div",{onClick:r=>{r.preventDefault();let n=t.filter(t=>t!==e.props.value);null==b||b(n),z(n)}},o.createElement(u,{className:(0,d.q)(g("clearIconItem"),"cursor-pointer rounded-tremor-full w-3.5 h-3.5 ml-2","text-tremor-content-subtle hover:text-tremor-content","dark:text-dark-tremor-content-subtle dark:hover:text-tremor-content")})))})):o.createElement("span",null,k)),o.createElement("span",{className:(0,d.q)("absolute inset-y-0 right-0 flex items-center mr-2.5")},o.createElement(s.Z,{className:(0,d.q)(g("arrowDownIcon"),"flex-none h-5 w-5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}))),A&&!y?o.createElement("button",{type:"button",className:(0,d.q)("absolute inset-y-0 right-0 flex items-center mr-8"),onClick:e=>{e.preventDefault(),z([]),null==b||b([])}},o.createElement(c.Z,{className:(0,d.q)(g("clearIconAllItems"),"flex-none h-4 w-4","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})):null,o.createElement(m.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"},o.createElement(p.O_,{anchor:"bottom start",className:(0,d.q)("z-10 divide-y w-[var(--button-width)] 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")},o.createElement("div",{className:(0,d.q)("flex items-center w-full px-2.5","bg-tremor-background-muted","dark:bg-dark-tremor-background-muted")},o.createElement("span",null,o.createElement(l,{className:(0,d.q)("flex-none w-4 h-4 mr-2","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")})),o.createElement("input",{name:"search",type:"input",autoComplete:"off",placeholder:v,className:(0,d.q)("w-full focus:outline-none focus:ring-none bg-transparent text-tremor-default py-2","text-tremor-content-emphasis","dark:text-dark-tremor-content-subtle"),onKeyDown:e=>{"Space"===e.code&&""!==e.target.value&&e.stopPropagation()},onChange:e=>I(e.target.value),value:T})),o.createElement(a.Z.Provider,Object.assign({},{onBlur:{handleResetSearch:q}},{value:{selectedValue:t}}),V))))})),O&&S?o.createElement("p",{className:(0,d.q)("errorMessage","text-sm text-rose-500 mt-1")},S):null)});b.displayName="MultiSelect"},46030:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853);r(42698),r(64016),r(8710);var o=r(33232),a=r(2265),i=r(13241),s=r(1153),l=r(51975);let c=(0,s.fn)("MultiSelectItem"),u=a.forwardRef((e,t)=>{let{value:r,className:u,children:d}=e,h=(0,n._T)(e,["value","className","children"]),{selectedValue:f}=(0,a.useContext)(o.Z),p=(0,s.NZ)(r,f);return a.createElement(l.wt,Object.assign({className:(0,i.q)(c("root"),"flex justify-start items-center cursor-default text-tremor-default p-2.5","data-[focus]:bg-tremor-background-muted data-[focus]:text-tremor-content-strong data-[select]ed:text-tremor-content-strong text-tremor-content-emphasis","dark:data-[focus]:bg-dark-tremor-background-muted dark:data-[focus]:text-dark-tremor-content-strong dark:data-[select]ed:text-dark-tremor-content-strong dark:data-[select]ed:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",u),ref:t,key:r,value:r},h),a.createElement("input",{type:"checkbox",className:(0,i.q)(c("checkbox"),"flex-none focus:ring-none focus:outline-none cursor-pointer mr-2.5","accent-tremor-brand","dark:accent-dark-tremor-brand"),checked:p,readOnly:!0}),a.createElement("span",{className:"whitespace-nowrap truncate"},null!=d?d:r))});u.displayName="MultiSelectItem"},49804:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n=r(5853),o=r(13241),a=r(1153),i=r(2265),s=r(9496);let l=(0,a.fn)("Col"),c=i.forwardRef((e,t)=>{let{numColSpan:r=1,numColSpanSm:a,numColSpanMd:c,numColSpanLg:u,children:d,className:h}=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 i.createElement("div",Object.assign({ref:t,className:(0,o.q)(l("root"),(()=>{let e=p(r,s.PT),t=p(a,s.SP),n=p(c,s.VS),i=p(u,s._w);return(0,o.q)(e,t,n,i)})(),h)},f),d)});c.displayName="Col"},96889:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var n=r(5853),o=r(2265),a=r(26898),i=r(13241),s=r(1153);let l=(0,s.fn)("BarList");function c(e,t){let{data:r=[],color:c,valueFormatter:u=s.Cj,showAnimation:d=!1,onValueChange:h,sortOrder:f="descending",className:p}=e,m=(0,n._T)(e,["data","color","valueFormatter","showAnimation","onValueChange","sortOrder","className"]),g=h?"button":"div",b=o.useMemo(()=>"none"===f?r:[...r].sort((e,t)=>"ascending"===f?e.value-t.value:t.value-e.value),[r,f]),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,i.q)(l("root"),"flex justify-between space-x-6",p),"aria-sort":f},m),o.createElement("div",{className:(0,i.q)(l("bars"),"relative w-full space-y-1.5")},b.map((e,t)=>{var r,n,u;let f=e.icon;return o.createElement(g,{key:null!==(r=e.key)&&void 0!==r?r:t,onClick:()=>{null==h||h(e)},className:(0,i.q)(l("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,i.q)("flex items-center rounded transition-all bg-opacity-40","h-8",e.color||c?[(0,s.bM)(null!==(n=e.color)&&void 0!==n?n:c,a.K.background).bgColor,h?"group-hover:bg-opacity-30":""]:"bg-tremor-brand-subtle dark:bg-dark-tremor-brand-subtle/60",!h||e.color||c?"":"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,i.q)("absolute left-2 pr-4 flex max-w-full")},f?o.createElement(f,{className:(0,i.q)(l("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,i.q)(l("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,i.q)(l("barText"),"whitespace-nowrap truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},e.name))))})),o.createElement("div",{className:l("labels")},b.map((e,t)=>{var r;return o.createElement("div",{key:null!==(r=e.key)&&void 0!==r?r:t,className:(0,i.q)(l("labelWrapper"),"flex justify-end items-center","h-8",t===b.length-1?"mb-0":"mb-1.5")},o.createElement("p",{className:(0,i.q)(l("labelText"),"whitespace-nowrap leading-none truncate text-tremor-default","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis")},u(e.value)))})))}c.displayName="BarList";let u=o.forwardRef(c)},13817:function(e,t,r){"use strict";r.d(t,{default:function(){return w}});var n=r(83145),o=r(2265),a=r(36760),i=r.n(a),s=r(18694),l=r(71744),c=r(80856),u=r(45287),d=r(32186),h=r(25437),f=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 m=o.forwardRef((e,t)=>{let{prefixCls:r,suffixCls:n,className:a,tagName:s}=e,c=f(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:u}=o.useContext(l.E_),d=u("layout",r),[p,m,g]=(0,h.ZP)(d),b=n?"".concat(d,"-").concat(n):d;return p(o.createElement(s,Object.assign({className:i()(r||b,a,m,g),ref:t},c)))}),g=o.forwardRef((e,t)=>{let{direction:r}=o.useContext(l.E_),[a,p]=o.useState([]),{prefixCls:m,className:g,rootClassName:b,children:k,hasSider:v,tagName:y,style:w}=e,x=f(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),C=(0,s.Z)(x,["suffixCls"]),{getPrefixCls:E,className:_,style:O}=(0,l.dj)("layout"),S=E("layout",m),M="boolean"==typeof v?v:!!a.length||(0,u.Z)(k).some(e=>e.type===d.Z),[R,j,N]=(0,h.ZP)(S),z=i()(S,{["".concat(S,"-has-sider")]:M,["".concat(S,"-rtl")]:"rtl"===r},_,g,b,j,N),Z=o.useMemo(()=>({siderHook:{addSider:e=>{p(t=>[].concat((0,n.Z)(t),[e]))},removeSider:e=>{p(t=>t.filter(t=>t!==e))}}}),[]);return R(o.createElement(c.V.Provider,{value:Z},o.createElement(y,Object.assign({ref:t,className:z,style:Object.assign(Object.assign({},O),w)},C),k)))}),b=p({tagName:"div",displayName:"Layout"})(g),k=p({suffixCls:"header",tagName:"header",displayName:"Header"})(m),v=p({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(m),y=p({suffixCls:"content",tagName:"main",displayName:"Content"})(m);b.Header=k,b.Footer=v,b.Content=y,b.Sider=d.Z,b._InternalSiderContext=d.D;var w=b},3810:function(e,t,r){"use strict";r.d(t,{Z:function(){return j}});var n=r(2265),o=r(36760),a=r.n(o),i=r(18694),s=r(93350),l=r(53445),c=r(19722),u=r(6694),d=r(71744),h=r(93463),f=r(54558),p=r(12918),m=r(71140),g=r(99320);let b=e=>{let{paddingXXS:t,lineWidth:r,tagPaddingHorizontal:n,componentCls:o,calc:a}=e,i=a(n).sub(r).equal(),s=a(t).sub(r).equal();return{[o]:Object.assign(Object.assign({},(0,p.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:i,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:"".concat((0,h.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:s,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:i}}),["".concat(o,"-borderless")]:{borderColor:"transparent",background:e.tagBorderlessBg}}},k=e=>{let{lineWidth:t,fontSizeIcon:r,calc:n}=e,o=e.fontSizeSM;return(0,m.IX)(e,{tagFontSize:o,tagLineHeight:(0,h.bf)(n(e.lineHeightSM).mul(o).equal()),tagIconSize:n(r).sub(n(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},v=e=>({defaultBg:new f.t(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var y=(0,g.I$)("Tag",e=>b(k(e)),v),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=n.forwardRef((e,t)=>{let{prefixCls:r,style:o,className:i,checked:s,children:l,icon:c,onChange:u,onClick:h}=e,f=w(e,["prefixCls","style","className","checked","children","icon","onChange","onClick"]),{getPrefixCls:p,tag:m}=n.useContext(d.E_),g=p("tag",r),[b,k,v]=y(g),x=a()(g,"".concat(g,"-checkable"),{["".concat(g,"-checkable-checked")]:s},null==m?void 0:m.className,i,k,v);return b(n.createElement("span",Object.assign({},f,{ref:t,style:Object.assign(Object.assign({},o),null==m?void 0:m.style),className:x,onClick:e=>{null==u||u(!s),null==h||h(e)}}),c,n.createElement("span",null,l)))});var C=r(18536);let E=e=>(0,C.Z)(e,(t,r)=>{let{textColor:n,lightBorderColor:o,lightColor:a,darkColor:i}=r;return{["".concat(e.componentCls).concat(e.componentCls,"-").concat(t)]:{color:n,background:a,borderColor:o,"&-inverse":{color:e.colorTextLightSolid,background:i,borderColor:i},["&".concat(e.componentCls,"-borderless")]:{borderColor:"transparent"}}}});var _=(0,g.bk)(["Tag","preset"],e=>E(k(e)),v);let O=(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=k(e);return[O(t,"success","Success"),O(t,"processing","Info"),O(t,"error","Error"),O(t,"warning","Warning")]},v),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};let R=n.forwardRef((e,t)=>{let{prefixCls:r,className:o,rootClassName:h,style:f,children:p,icon:m,color:g,onClose:b,bordered:k=!0,visible:v}=e,w=M(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:x,direction:C,tag:E}=n.useContext(d.E_),[O,R]=n.useState(!0),j=(0,i.Z)(w,["closeIcon","closable"]);n.useEffect(()=>{void 0!==v&&R(v)},[v]);let N=(0,s.o2)(g),z=(0,s.yT)(g),Z=N||z,L=Object.assign(Object.assign({backgroundColor:g&&!Z?g:void 0},null==E?void 0:E.style),f),T=x("tag",r),[I,A,V]=y(T),q=a()(T,null==E?void 0:E.className,{["".concat(T,"-").concat(g)]:Z,["".concat(T,"-has-color")]:g&&!Z,["".concat(T,"-hidden")]:!O,["".concat(T,"-rtl")]:"rtl"===C,["".concat(T,"-borderless")]:!k},o,h,A,V),F=e=>{e.stopPropagation(),null==b||b(e),e.defaultPrevented||R(!1)},[,H]=(0,l.b)((0,l.w)(e),(0,l.w)(E),{closable:!1,closeIconRender:e=>{let t=n.createElement("span",{className:"".concat(T,"-close-icon"),onClick:F},e);return(0,c.wm)(e,t,e=>({onClick:t=>{var r;null===(r=null==e?void 0:e.onClick)||void 0===r||r.call(e,t),F(t)},className:a()(null==e?void 0:e.className,"".concat(T,"-close-icon"))}))}}),B="function"==typeof w.onClick||p&&"a"===p.type,P=m||null,D=P?n.createElement(n.Fragment,null,P,p&&n.createElement("span",null,p)):p,W=n.createElement("span",Object.assign({},j,{ref:t,className:q,style:L}),D,H,N&&n.createElement(_,{key:"preset",prefixCls:T}),z&&n.createElement(S,{key:"status",prefixCls:T}));return I(B?n.createElement(u.Z,{component:"Tag"},W):W)});R.CheckableTag=x;var j=R},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),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,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,i=o.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[s]=r:delete e[s]),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),i=Math.max,s=Math.min;e.exports=function(e,t,r){var l,c,u,d,h,f,p=0,m=!1,g=!1,b=!0;if("function"!=typeof e)throw TypeError("Expected a function");function k(t){var r=l,n=c;return l=c=void 0,p=t,d=e.apply(n,r)}function v(e){var r=e-f,n=e-p;return void 0===f||r>=t||r<0||g&&n>=u}function y(){var e,r,n,a=o();if(v(a))return w(a);h=setTimeout(y,(e=a-f,r=a-p,n=t-e,g?s(n,u-r):n))}function w(e){return(h=void 0,b&&l)?k(e):(l=c=void 0,d)}function x(){var e,r=o(),n=v(r);if(l=arguments,c=this,f=r,n){if(void 0===h)return p=e=f,h=setTimeout(y,t),m?k(e):d;if(g)return clearTimeout(h),h=setTimeout(y,t),k(f)}return void 0===h&&(h=setTimeout(y,t)),d}return t=a(t)||0,n(r)&&(m=!!r.leading,u=(g="maxWait"in r)?i(a(r.maxWait)||0,t):u,b="trailing"in r?!!r.trailing:b),x.cancel=function(){void 0!==h&&clearTimeout(h),p=0,l=f=c=h=void 0},x.flush=function(){return void 0===h?d:w(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),i=0/0,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return i;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=l.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):s.test(e)?i:+e}},79205:function(e,t,r){"use strict";r.d(t,{Z:function(){return d}});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()),i=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=function(){for(var e=arguments.length,t=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},l=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 u=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:u="",children:d,iconNode:h,...f}=e;return(0,n.createElement)("svg",{ref:t,...c,width:o,height:o,stroke:r,strokeWidth:i?24*Number(a)/Number(o):a,className:s("lucide",u),...!d&&!l(f)&&{"aria-hidden":"true"},...f},[...h.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(d)?d:[d]])}),d=(e,t)=>{let r=(0,n.forwardRef)((r,a)=>{let{className:l,...c}=r;return(0,n.createElement)(u,{ref:a,iconNode:t,className:s("lucide-".concat(o(i(e))),"lucide-".concat(e),l),...c})});return r.displayName=i(e),r}},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"}]])},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"}]])},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"}]])},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"}]])},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"}]])},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"}]])},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"}]])},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"}]])},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"}]])},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"}]])},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"}]])},15452:function(e,t){var r,n,o;n=[],void 0!==(o="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,o=r.IS_PAPA_WORKER||!1,a={},i=0,s={};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=v(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new f(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,o)r.postMessage({results:a,workerId:s.WORKER_ID,finished:n});else if(w(this._config.chunk)&&!t){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!n||!w(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){w(this._config.error)?this._config.error(e):o&&this._config.error&&r.postMessage({workerId:s.WORKER_ID,error:e,finished:!1})}}function c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=s.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=y(this._chunkLoaded,this),t.onerror=y(this._chunkError,this)),t.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e,r,o=this._config.downloadRequestHeaders;for(r in o)t.setRequestHeader(r,o[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 u(e){(e=e||{}).chunkSize||(e.chunkSize=s.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=y(this._chunkLoaded,this),t.onerror=y(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 h(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=y(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=y(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=y(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function f(e){var t,r,n,o,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\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,c=0,u=0,d=!1,h=!1,f=[],g={data:[],errors:[],meta:{}};function b(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function k(){if(g&&n&&(x("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(g.data=g.data.filter(function(e){return!b(e)})),y()){if(g){if(Array.isArray(g.data[0])){for(var t,r=0;y()&&r=f.length?"__parsed_extra":f[o]:s,c=l=e.transform?e.transform(l,s):l,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===c||"TRUE"===c||"false"!==c&&"FALSE"!==c&&((e=>{if(a.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(c)?parseFloat(c):i.test(c)?new Date(c):""===c?null:c):c);"__parsed_extra"===s?(n[s]=n[s]||[],n[s].push(l)):n[s]=l}return e.header&&(o>f.length?x("FieldMismatch","TooManyFields","Too many fields: expected "+f.length+" fields but parsed "+o,u+r):oe.preview?r.abort():(g.data=g.data[0],o(g,l))))}),this.parse=function(o,a,i){var l=e.quoteChar||'"',l=(e.newline||(e.newline=this.guessLineEndings(o,l)),n=!1,e.delimiter?w(e.delimiter)&&(e.delimiter=e.delimiter(o),g.meta.delimiter=e.delimiter):((l=((t,r,n,o,a)=>{var i,l,c,u;a=a||[","," ","|",";",s.RECORD_SEP,s.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,o=e.step,a=e.preview,i=e.fastMode,l=null,c=!1,u=null==e.quoteChar?'"':e.quoteChar,d=u;if(void 0!==e.escapeChar&&(d=e.escapeChar),("string"!=typeof t||-1=a)return V(!0);break}E.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:C.length,index:h}),z++}}else if(n&&0===_.length&&s.substring(h,h+y)===n){if(-1===j)return V();h=j+v,j=s.indexOf(r,h),R=s.indexOf(t,h)}else if(-1!==R&&(R=a)return V(!0)}return I();function L(e){C.push(e),O=h}function T(e){return -1!==e&&(e=s.substring(z+1,e))&&""===e.trim()?e.length:0}function I(e){return g||(void 0===e&&(e=s.substring(h)),_.push(e),h=b,L(_),x&&q()),V()}function A(e){h=e,L(_),_=[],j=s.indexOf(r,h)}function V(n){if(e.header&&!m&&C.length&&!c){var o=C[0],a=Object.create(null),i=new Set(o);let t=!1;for(let r=0;r{if("object"==typeof t){if("string"!=typeof t.delimiter||s.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(o=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||(c=t.skipEmptyLines),"string"==typeof t.newline&&(a=t.newline),"string"==typeof t.quoteChar&&(i=t.quoteChar),"boolean"==typeof t.header&&(n=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");u=t.columns}void 0!==t.escapeChar&&(l=t.escapeChar+i),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),RegExp(p(i),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,c);if("object"==typeof e[0])return f(u||Object.keys(e[0]),e,c)}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||u),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])),f(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function f(e,t,r){var i="",s=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0{for(var r=0;r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,i),n=o.default.Children.only(t);return o.default.cloneElement(n,c(c({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r"boolean"==typeof e||e instanceof Boolean,a=e=>"number"==typeof e||e instanceof Number,i=e=>"bigint"==typeof e||e instanceof BigInt,s=e=>!!e&&e instanceof Date,l=e=>"string"==typeof e||e instanceof String,c=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 f(e){let{field:t,value:r,data:o,lastElement:a,openBracket:i,closeBracket:s,level:l,style:c,shouldExpandNode:u,clickToExpandNode:d,outerRef:f,beforeExpandChange:p}=e,m=(0,n.useRef)(!1),[g,k]=(0,n.useState)(()=>u(l,r,t)),v=(0,n.useRef)(null);(0,n.useEffect)(()=>{m.current?k(u(l,r,t)):m.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:i}=e;return(0,n.createElement)("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(t||""===t)&&(0,n.createElement)("span",{className:i.label},h(t,i.quotesForFieldNames),":"),(0,n.createElement)("span",{className:i.punctuation},r),(0,n.createElement)("span",{className:i.punctuation},o),!a&&(0,n.createElement)("span",{className:i.punctuation},","))}({field:t,openBracket:i,closeBracket:s,lastElement:a,style:c});let w=g?c.collapseIcon:c.expandIcon,x=g?c.ariaLables.collapseJson:c.ariaLables.expandJson,C=l+1,E=o.length-1,_=e=>{g!==e&&(!p||p({level:l,value:r,field:t,newExpandValue:e}))&&k(e)},O=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),_("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;_(!g);let t=v.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:c.basicChildStyle,role:"treeitem","aria-expanded":g,"aria-selected":void 0},(0,n.createElement)("span",{className:w,onClick:S,onKeyDown:O,role:"button","aria-label":x,"aria-expanded":g,"aria-controls":g?y:void 0,ref:v,tabIndex:0===l?0:-1}),(t||""===t)&&(d?(0,n.createElement)("span",{className:c.clickableLabel,onClick:S,onKeyDown:O},h(t,c.quotesForFieldNames),":"):(0,n.createElement)("span",{className:c.label},h(t,c.quotesForFieldNames),":")),(0,n.createElement)("span",{className:c.punctuation},i),g?(0,n.createElement)("ul",{id:y,role:"group",className:c.childFieldsContainer},o.map((e,t)=>(0,n.createElement)(b,{key:e[0]||t,field:e[0],value:e[1],style:c,lastElement:t===E,level:C,shouldExpandNode:u,clickToExpandNode:d,beforeExpandChange:p,outerRef:f}))):(0,n.createElement)("span",{className:c.collapsedContent,onClick:S,onKeyDown:O}),(0,n.createElement)("span",{className:c.punctuation},s),!a&&(0,n.createElement)("span",{className:c.punctuation},","))}function p(e){let{field:t,value:r,style:n,lastElement:o,shouldExpandNode:a,clickToExpandNode:i,level:s,outerRef:l,beforeExpandChange:c}=e;return f({field:t,value:r,lastElement:o||!1,level:s,openBracket:"{",closeBracket:"}",style:n,shouldExpandNode:a,clickToExpandNode:i,data:Object.keys(r).map(e=>[e,r[e]]),outerRef:l,beforeExpandChange:c})}function m(e){let{field:t,value:r,style:n,lastElement:o,level:a,shouldExpandNode:i,clickToExpandNode:s,outerRef:l,beforeExpandChange:c}=e;return f({field:t,value:r,lastElement:o||!1,level:a,openBracket:"[",closeBracket:"]",style:n,shouldExpandNode:i,clickToExpandNode:s,data:r.map(e=>[void 0,e]),outerRef:l,beforeExpandChange:c})}function g(e){let t,{field:r,value:c,style:u,lastElement:f}=e,p=u.otherValue;if(null===c)t="null",p=u.nullValue;else if(void 0===c)t="undefined",p=u.undefinedValue;else if(l(c)){var m;m=!u.noQuotesForStringValues,t=u.stringifyStringValues?JSON.stringify(c):m?`"${c}"`:c,p=u.stringValue}else o(c)?(t=c?"true":"false",p=u.booleanValue):a(c)?(t=c.toString(),p=u.numberValue):i(c)?(t=`${c.toString()}n`,p=u.numberValue):t=s(c)?c.toISOString():d(c)?"function() { }":c.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),!f&&(0,n.createElement)("span",{className:u.punctuation},","))}function b(e){let t=e.value;return c(t)?(0,n.createElement)(m,Object.assign({},e)):!u(t)||s(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:i,compactTopLevel:s,...l}=e,c=(0,n.useRef)(null);return(0,n.createElement)("div",Object.assign({"aria-label":"JSON view"},l,{className:r.container,ref:c,role:"tree"}),s&&u(t)?Object.entries(t).map(e=>{let[t,s]=e;return(0,n.createElement)(b,{key:t,field:t,value:s,style:{...k,...r},lastElement:!0,level:1,shouldExpandNode:o,clickToExpandNode:a,beforeExpandChange:i,outerRef:c})}):(0,n.createElement)(b,{value:t,style:{...k,...r},lastElement:!0,level:0,shouldExpandNode:o,clickToExpandNode:a,outerRef:c,beforeExpandChange:i}))}},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(){},44643: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 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=o},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},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},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},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},71157: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 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 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),i=r(24112),s=r(45345),l=class extends i.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,s.VS)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#r,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.Ym)(t.mutationKey)!==(0,s.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)})})}},c=r(29827);function u(e,t){let r=(0,c.NL)(t),[o]=n.useState(()=>new l(r,e));n.useEffect(()=>{o.setOptions(e)},[o,e]);let i=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(s.ZT)},[o]);if(i.error&&(0,s.L3)(o.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:u,mutateAsync:i.mutate}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3367-33bb84b3d3d247b2.js b/litellm/proxy/_experimental/out/_next/static/chunks/3367-33bb84b3d3d247b2.js new file mode 100644 index 0000000000..23daac359d --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3367-33bb84b3d3d247b2.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3367],{60440:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1119),o=t(2265),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},l=t(55015),u=o.forwardRef(function(e,n){return o.createElement(l.Z,(0,r.Z)({},e,{ref:n,icon:i}))})},71030:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(1119),o=t(11993),i=t(26365),l=t(6989),u=t(97821),a=t(36760),c=t.n(a),s=t(28791),f=t(2265),d=t(95814),p=t(53346),v=d.Z.ESC,m=d.Z.TAB,b=(0,f.forwardRef)(function(e,n){var t=e.overlay,r=e.arrow,o=e.prefixCls,i=(0,f.useMemo)(function(){return"function"==typeof t?t():t},[t]),l=(0,s.sQ)(n,(0,s.C4)(i));return f.createElement(f.Fragment,null,r&&f.createElement("div",{className:"".concat(o,"-arrow")}),f.cloneElement(i,{ref:(0,s.Yr)(i)?l:void 0}))}),y={adjustX:1,adjustY:1},h=[0,0],g={topLeft:{points:["bl","tl"],overflow:y,offset:[0,-4],targetOffset:h},top:{points:["bc","tc"],overflow:y,offset:[0,-4],targetOffset:h},topRight:{points:["br","tr"],overflow:y,offset:[0,-4],targetOffset:h},bottomLeft:{points:["tl","bl"],overflow:y,offset:[0,4],targetOffset:h},bottom:{points:["tc","bc"],overflow:y,offset:[0,4],targetOffset:h},bottomRight:{points:["tr","br"],overflow:y,offset:[0,4],targetOffset:h}},Z=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"],C=f.forwardRef(function(e,n){var t,a,d,y,h,C,E,w,k,M,R,x,N,P,S=e.arrow,I=void 0!==S&&S,K=e.prefixCls,O=void 0===K?"rc-dropdown":K,A=e.transitionName,T=e.animation,L=e.align,D=e.placement,_=e.placements,V=e.getPopupContainer,z=e.showAction,F=e.hideAction,j=e.overlayClassName,B=e.overlayStyle,W=e.visible,H=e.trigger,Y=void 0===H?["hover"]:H,q=e.autoFocus,X=e.overlay,G=e.children,Q=e.onVisibleChange,U=(0,l.Z)(e,Z),J=f.useState(),$=(0,i.Z)(J,2),ee=$[0],en=$[1],et="visible"in e?W:ee,er=f.useRef(null),eo=f.useRef(null),ei=f.useRef(null);f.useImperativeHandle(n,function(){return er.current});var el=function(e){en(e),null==Q||Q(e)};a=(t={visible:et,triggerRef:ei,onVisibleChange:el,autoFocus:q,overlayRef:eo}).visible,d=t.triggerRef,y=t.onVisibleChange,h=t.autoFocus,C=t.overlayRef,E=f.useRef(!1),w=function(){if(a){var e,n;null===(e=d.current)||void 0===e||null===(n=e.focus)||void 0===n||n.call(e),null==y||y(!1)}},k=function(){var e;return null!==(e=C.current)&&void 0!==e&&!!e.focus&&(C.current.focus(),E.current=!0,!0)},M=function(e){switch(e.keyCode){case v:w();break;case m:var n=!1;E.current||(n=k()),n?e.preventDefault():w()}},f.useEffect(function(){return a?(window.addEventListener("keydown",M),h&&(0,p.Z)(k,3),function(){window.removeEventListener("keydown",M),E.current=!1}):function(){E.current=!1}},[a]);var eu=function(){return f.createElement(b,{ref:eo,overlay:X,prefixCls:O,arrow:I})},ea=f.cloneElement(G,{className:c()(null===(P=G.props)||void 0===P?void 0:P.className,et&&(void 0!==(R=e.openClassName)?R:"".concat(O,"-open"))),ref:(0,s.Yr)(G)?(0,s.sQ)(ei,(0,s.C4)(G)):void 0}),ec=F;return ec||-1===Y.indexOf("contextMenu")||(ec=["click"]),f.createElement(u.Z,(0,r.Z)({builtinPlacements:void 0===_?g:_},U,{prefixCls:O,ref:er,popupClassName:c()(j,(0,o.Z)({},"".concat(O,"-show-arrow"),I)),popupStyle:B,action:Y,showAction:z,hideAction:ec,popupPlacement:void 0===D?"bottomLeft":D,popupAlign:L,popupTransitionName:A,popupAnimation:T,popupVisible:et,stretch:(x=e.minOverlayWidthMatchTrigger,N=e.alignPoint,"minOverlayWidthMatchTrigger"in e?x:!N)?"minWidth":"",popup:"function"==typeof X?eu:eu(),onPopupVisibleChange:el,onPopupClick:function(n){var t=e.onOverlayClick;en(!1),t&&t(n)},getPopupContainer:V}),ea)})},33082:function(e,n,t){t.d(n,{iz:function(){return eO},ck:function(){return ev},BW:function(){return eL},sN:function(){return ev},Wd:function(){return eI},ZP:function(){return ej},Xl:function(){return x}});var r=t(1119),o=t(11993),i=t(31686),l=t(83145),u=t(26365),a=t(6989),c=t(36760),s=t.n(c),f=t(1699),d=t(50506),p=t(16671),v=t(32559),m=t(2265),b=t(54887),y=m.createContext(null);function h(e,n){return void 0===e?null:"".concat(e,"-").concat(n)}function g(e){return h(m.useContext(y),e)}var Z=t(6397),C=["children","locked"],E=m.createContext(null);function w(e){var n=e.children,t=e.locked,r=(0,a.Z)(e,C),o=m.useContext(E),l=(0,Z.Z)(function(){var e;return e=(0,i.Z)({},o),Object.keys(r).forEach(function(n){var t=r[n];void 0!==t&&(e[n]=t)}),e},[o,r],function(e,n){return!t&&(e[0]!==n[0]||!(0,p.Z)(e[1],n[1],!0))});return m.createElement(E.Provider,{value:l},n)}var k=m.createContext(null);function M(){return m.useContext(k)}var R=m.createContext([]);function x(e){var n=m.useContext(R);return m.useMemo(function(){return void 0!==e?[].concat((0,l.Z)(n),[e]):n},[n,e])}var N=m.createContext(null),P=m.createContext({}),S=t(2857);function I(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,S.Z)(e)){var t=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(t)||e.isContentEditable||"a"===t&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),l=null;return o&&!Number.isNaN(i)?l=i:r&&null===l&&(l=0),r&&e.disabled&&(l=null),null!==l&&(l>=0||n&&l<0)}return!1}var K=t(95814),O=t(53346),A=K.Z.LEFT,T=K.Z.RIGHT,L=K.Z.UP,D=K.Z.DOWN,_=K.Z.ENTER,V=K.Z.ESC,z=K.Z.HOME,F=K.Z.END,j=[L,D,A,T];function B(e,n){return(function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=(0,l.Z)(e.querySelectorAll("*")).filter(function(e){return I(e,n)});return I(e,n)&&t.unshift(e),t})(e,!0).filter(function(e){return n.has(e)})}function W(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=B(e,n),i=o.length,l=o.findIndex(function(e){return t===e});return r<0?-1===l?l=i-1:l-=1:r>0&&(l+=1),o[l=(l+i)%i]}var H=function(e,n){var t=new Set,r=new Map,o=new Map;return e.forEach(function(e){var i=document.querySelector("[data-menu-id='".concat(h(n,e),"']"));i&&(t.add(i),o.set(i,e),r.set(e,i))}),{elements:t,key2element:r,element2key:o}},Y="__RC_UTIL_PATH_SPLIT__",q=function(e){return e.join(Y)},X="rc-menu-more";function G(e){var n=m.useRef(e);n.current=e;var t=m.useCallback(function(){for(var e,t=arguments.length,r=Array(t),o=0;o1&&(k.motionAppear=!1);var M=k.onVisibleChanged;return(k.onVisibleChanged=function(e){return b.current||e||Z(!0),null==M?void 0:M(e)},g)?null:m.createElement(w,{mode:a,locked:!b.current},m.createElement(eR.ZP,(0,r.Z)({visible:C},k,{forceRender:f,removeOnLeave:!1,leavedClassName:"".concat(s,"-hidden")}),function(e){var t=e.className,r=e.style;return m.createElement(eb,{id:n,className:t,style:r},l)}))}var eN=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],eP=["active"],eS=m.forwardRef(function(e,n){var t=e.style,l=e.className,c=e.title,d=e.eventKey,p=(e.warnKey,e.disabled),v=e.internalPopupClose,b=e.children,y=e.itemIcon,h=e.expandIcon,Z=e.popupClassName,C=e.popupOffset,k=e.popupStyle,M=e.onClick,R=e.onMouseEnter,S=e.onMouseLeave,I=e.onTitleClick,K=e.onTitleMouseEnter,O=e.onTitleMouseLeave,A=(0,a.Z)(e,eN),T=g(d),L=m.useContext(E),D=L.prefixCls,_=L.mode,V=L.openKeys,z=L.disabled,F=L.overflowDisabled,j=L.activeKey,B=L.selectedKeys,W=L.itemIcon,H=L.expandIcon,Y=L.onItemClick,q=L.onOpenChange,X=L.onActive,Q=m.useContext(P)._internalRenderSubMenuItem,U=m.useContext(N).isSubPathKey,J=x(),$="".concat(D,"-submenu"),ee=z||p,en=m.useRef(),et=m.useRef(),er=null!=h?h:H,eu=V.includes(d),ec=!F&&eu,es=U(B,d),ef=eo(d,ee,K,O),ed=ef.active,ep=(0,a.Z)(ef,eP),ev=m.useState(!1),em=(0,u.Z)(ev,2),ey=em[0],eh=em[1],eg=function(e){ee||eh(e)},eZ=m.useMemo(function(){return ed||"inline"!==_&&(ey||U([j],d))},[_,ed,j,ey,d,U]),eC=ei(J.length),eE=G(function(e){null==M||M(ea(e)),Y(e)}),ew=T&&"".concat(T,"-popup"),ek=m.useMemo(function(){return m.createElement(el,{icon:"horizontal"!==_?er:void 0,props:(0,i.Z)((0,i.Z)({},e),{},{isOpen:ec,isSubMenu:!0})},m.createElement("i",{className:"".concat($,"-arrow")}))},[_,er,e,ec,$]),eR=m.createElement("div",(0,r.Z)({role:"menuitem",style:eC,className:"".concat($,"-title"),tabIndex:ee?null:-1,ref:en,title:"string"==typeof c?c:null,"data-menu-id":F&&T?null:T,"aria-expanded":ec,"aria-haspopup":!0,"aria-controls":ew,"aria-disabled":ee,onClick:function(e){ee||(null==I||I({key:d,domEvent:e}),"inline"===_&&q(d,!eu))},onFocus:function(){X(d)}},ep),c,ek),eS=m.useRef(_);if("inline"!==_&&J.length>1?eS.current="vertical":eS.current=_,!F){var eI=eS.current;eR=m.createElement(eM,{mode:eI,prefixCls:$,visible:!v&&ec&&"inline"!==_,popupClassName:Z,popupOffset:C,popupStyle:k,popup:m.createElement(w,{mode:"horizontal"===eI?"vertical":eI},m.createElement(eb,{id:ew,ref:et},b)),disabled:ee,onVisibleChange:function(e){"inline"!==_&&q(d,e)}},eR)}var eK=m.createElement(f.Z.Item,(0,r.Z)({ref:n,role:"none"},A,{component:"li",style:t,className:s()($,"".concat($,"-").concat(_),l,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat($,"-open"),ec),"".concat($,"-active"),eZ),"".concat($,"-selected"),es),"".concat($,"-disabled"),ee)),onMouseEnter:function(e){eg(!0),null==R||R({key:d,domEvent:e})},onMouseLeave:function(e){eg(!1),null==S||S({key:d,domEvent:e})}}),eR,!F&&m.createElement(ex,{id:ew,open:ec,keyPath:J},b));return Q&&(eK=Q(eK,e,{selected:es,active:eZ,open:ec,disabled:ee})),m.createElement(w,{onItemClick:eE,mode:"horizontal"===_?"vertical":_,itemIcon:null!=y?y:W,expandIcon:er},eK)}),eI=m.forwardRef(function(e,n){var t,o=e.eventKey,i=e.children,l=x(o),u=eh(i,l),a=M();return m.useEffect(function(){if(a)return a.registerPath(o,l),function(){a.unregisterPath(o,l)}},[l]),t=a?u:m.createElement(eS,(0,r.Z)({ref:n},e),u),m.createElement(R.Provider,{value:l},t)}),eK=t(41154);function eO(e){var n=e.className,t=e.style,r=m.useContext(E).prefixCls;return M()?null:m.createElement("li",{role:"separator",className:s()("".concat(r,"-item-divider"),n),style:t})}var eA=["className","title","eventKey","children"],eT=m.forwardRef(function(e,n){var t=e.className,o=e.title,i=(e.eventKey,e.children),l=(0,a.Z)(e,eA),u=m.useContext(E).prefixCls,c="".concat(u,"-item-group");return m.createElement("li",(0,r.Z)({ref:n,role:"presentation"},l,{onClick:function(e){return e.stopPropagation()},className:s()(c,t)}),m.createElement("div",{role:"presentation",className:"".concat(c,"-title"),title:"string"==typeof o?o:void 0},o),m.createElement("ul",{role:"group",className:"".concat(c,"-list")},i))}),eL=m.forwardRef(function(e,n){var t=e.eventKey,o=eh(e.children,x(t));return M()?o:m.createElement(eT,(0,r.Z)({ref:n},(0,et.Z)(e,["warnKey"])),o)}),eD=["label","children","key","type","extra"];function e_(e,n,t,o,l){var u=e,c=(0,i.Z)({divider:eO,item:ev,group:eL,submenu:eI},o);return n&&(u=function e(n,t,o){var i=t.item,l=t.group,u=t.submenu,c=t.divider;return(n||[]).map(function(n,s){if(n&&"object"===(0,eK.Z)(n)){var f=n.label,d=n.children,p=n.key,v=n.type,b=n.extra,y=(0,a.Z)(n,eD),h=null!=p?p:"tmp-".concat(s);return d||"group"===v?"group"===v?m.createElement(l,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):m.createElement(u,(0,r.Z)({key:h},y,{title:f}),e(d,t,o)):"divider"===v?m.createElement(c,(0,r.Z)({key:h},y)):m.createElement(i,(0,r.Z)({key:h},y,{extra:b}),f,(!!b||0===b)&&m.createElement("span",{className:"".concat(o,"-item-extra")},b))}return null}).filter(function(e){return e})}(n,c,l)),eh(u,t)}var eV=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","_internalComponents"],ez=[],eF=m.forwardRef(function(e,n){var t,c,v,h,g,Z,C,E,M,R,x,S,I,K,J,$,ee,en,et,er,eo,ei,el,eu,ec,es,ef=e.prefixCls,ed=void 0===ef?"rc-menu":ef,ep=e.rootClassName,em=e.style,eb=e.className,ey=e.tabIndex,eh=e.items,eg=e.children,eZ=e.direction,eC=e.id,eE=e.mode,ew=void 0===eE?"vertical":eE,ek=e.inlineCollapsed,eM=e.disabled,eR=e.disabledOverflow,ex=e.subMenuOpenDelay,eN=e.subMenuCloseDelay,eP=e.forceSubMenuRender,eS=e.defaultOpenKeys,eK=e.openKeys,eO=e.activeKey,eA=e.defaultActiveFirst,eT=e.selectable,eL=void 0===eT||eT,eD=e.multiple,eF=void 0!==eD&&eD,ej=e.defaultSelectedKeys,eB=e.selectedKeys,eW=e.onSelect,eH=e.onDeselect,eY=e.inlineIndent,eq=e.motion,eX=e.defaultMotions,eG=e.triggerSubMenuAction,eQ=e.builtinPlacements,eU=e.itemIcon,eJ=e.expandIcon,e$=e.overflowedIndicator,e0=void 0===e$?"...":e$,e1=e.overflowedIndicatorPopupClassName,e2=e.getPopupContainer,e6=e.onClick,e5=e.onOpenChange,e9=e.onKeyDown,e4=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),e3=e._internalRenderSubMenuItem,e8=e._internalComponents,e7=(0,a.Z)(e,eV),ne=m.useMemo(function(){return[e_(eg,eh,ez,e8,ed),e_(eg,eh,ez,{},ed)]},[eg,eh,e8]),nn=(0,u.Z)(ne,2),nt=nn[0],nr=nn[1],no=m.useState(!1),ni=(0,u.Z)(no,2),nl=ni[0],nu=ni[1],na=m.useRef(),nc=(t=(0,d.Z)(eC,{value:eC}),v=(c=(0,u.Z)(t,2))[0],h=c[1],m.useEffect(function(){U+=1;var e="".concat(Q,"-").concat(U);h("rc-menu-uuid-".concat(e))},[]),v),ns="rtl"===eZ,nf=(0,d.Z)(eS,{value:eK,postState:function(e){return e||ez}}),nd=(0,u.Z)(nf,2),np=nd[0],nv=nd[1],nm=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function t(){nv(e),null==e5||e5(e)}n?(0,b.flushSync)(t):t()},nb=m.useState(np),ny=(0,u.Z)(nb,2),nh=ny[0],ng=ny[1],nZ=m.useRef(!1),nC=m.useMemo(function(){return("inline"===ew||"vertical"===ew)&&ek?["vertical",ek]:[ew,!1]},[ew,ek]),nE=(0,u.Z)(nC,2),nw=nE[0],nk=nE[1],nM="inline"===nw,nR=m.useState(nw),nx=(0,u.Z)(nR,2),nN=nx[0],nP=nx[1],nS=m.useState(nk),nI=(0,u.Z)(nS,2),nK=nI[0],nO=nI[1];m.useEffect(function(){nP(nw),nO(nk),nZ.current&&(nM?nv(nh):nm(ez))},[nw,nk]);var nA=m.useState(0),nT=(0,u.Z)(nA,2),nL=nT[0],nD=nT[1],n_=nL>=nt.length-1||"horizontal"!==nN||eR;m.useEffect(function(){nM&&ng(np)},[np]),m.useEffect(function(){return nZ.current=!0,function(){nZ.current=!1}},[]);var nV=(g=m.useState({}),Z=(0,u.Z)(g,2)[1],C=(0,m.useRef)(new Map),E=(0,m.useRef)(new Map),M=m.useState([]),x=(R=(0,u.Z)(M,2))[0],S=R[1],I=(0,m.useRef)(0),K=(0,m.useRef)(!1),J=function(){K.current||Z({})},$=(0,m.useCallback)(function(e,n){var t,r=q(n);E.current.set(r,e),C.current.set(e,r),I.current+=1;var o=I.current;t=function(){o===I.current&&J()},Promise.resolve().then(t)},[]),ee=(0,m.useCallback)(function(e,n){var t=q(n);E.current.delete(t),C.current.delete(e)},[]),en=(0,m.useCallback)(function(e){S(e)},[]),et=(0,m.useCallback)(function(e,n){var t=(C.current.get(e)||"").split(Y);return n&&x.includes(t[0])&&t.unshift(X),t},[x]),er=(0,m.useCallback)(function(e,n){return e.filter(function(e){return void 0!==e}).some(function(e){return et(e,!0).includes(n)})},[et]),eo=(0,m.useCallback)(function(e){var n="".concat(C.current.get(e)).concat(Y),t=new Set;return(0,l.Z)(E.current.keys()).forEach(function(e){e.startsWith(n)&&t.add(E.current.get(e))}),t},[]),m.useEffect(function(){return function(){K.current=!0}},[]),{registerPath:$,unregisterPath:ee,refreshOverflowKeys:en,isSubPathKey:er,getKeyPath:et,getKeys:function(){var e=(0,l.Z)(C.current.keys());return x.length&&e.push(X),e},getSubPathKeys:eo}),nz=nV.registerPath,nF=nV.unregisterPath,nj=nV.refreshOverflowKeys,nB=nV.isSubPathKey,nW=nV.getKeyPath,nH=nV.getKeys,nY=nV.getSubPathKeys,nq=m.useMemo(function(){return{registerPath:nz,unregisterPath:nF}},[nz,nF]),nX=m.useMemo(function(){return{isSubPathKey:nB}},[nB]);m.useEffect(function(){nj(n_?ez:nt.slice(nL+1).map(function(e){return e.key}))},[nL,n_]);var nG=(0,d.Z)(eO||eA&&(null===(es=nt[0])||void 0===es?void 0:es.key),{value:eO}),nQ=(0,u.Z)(nG,2),nU=nQ[0],nJ=nQ[1],n$=G(function(e){nJ(e)}),n0=G(function(){nJ(void 0)});(0,m.useImperativeHandle)(n,function(){return{list:na.current,focus:function(e){var n,t,r=H(nH(),nc),o=r.elements,i=r.key2element,l=r.element2key,u=B(na.current,o),a=null!=nU?nU:u[0]?l.get(u[0]):null===(n=nt.find(function(e){return!e.props.disabled}))||void 0===n?void 0:n.key,c=i.get(a);a&&c&&(null==c||null===(t=c.focus)||void 0===t||t.call(c,e))}}});var n1=(0,d.Z)(ej||[],{value:eB,postState:function(e){return Array.isArray(e)?e:null==e?ez:[e]}}),n2=(0,u.Z)(n1,2),n6=n2[0],n5=n2[1],n9=function(e){if(eL){var n,t=e.key,r=n6.includes(t);n5(n=eF?r?n6.filter(function(e){return e!==t}):[].concat((0,l.Z)(n6),[t]):[t]);var o=(0,i.Z)((0,i.Z)({},e),{},{selectedKeys:n});r?null==eH||eH(o):null==eW||eW(o)}!eF&&np.length&&"inline"!==nN&&nm(ez)},n4=G(function(e){null==e6||e6(ea(e)),n9(e)}),n3=G(function(e,n){var t=np.filter(function(n){return n!==e});if(n)t.push(e);else if("inline"!==nN){var r=nY(e);t=t.filter(function(e){return!r.has(e)})}(0,p.Z)(np,t,!0)||nm(t,!0)}),n8=(ei=function(e,n){var t=null!=n?n:!np.includes(e);n3(e,t)},el=m.useRef(),(eu=m.useRef()).current=nU,ec=function(){O.Z.cancel(el.current)},m.useEffect(function(){return function(){ec()}},[]),function(e){var n=e.which;if([].concat(j,[_,V,z,F]).includes(n)){var t=nH(),r=H(t,nc),i=r,l=i.elements,u=i.key2element,a=i.element2key,c=function(e,n){for(var t=e||document.activeElement;t;){if(n.has(t))return t;t=t.parentElement}return null}(u.get(nU),l),s=a.get(c),f=function(e,n,t,r){var i,l="prev",u="next",a="children",c="parent";if("inline"===e&&r===_)return{inlineTrigger:!0};var s=(0,o.Z)((0,o.Z)({},L,l),D,u),f=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},A,t?u:l),T,t?l:u),D,a),_,a),d=(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},L,l),D,u),_,a),V,c),A,t?a:c),T,t?c:a);switch(null===(i=({inline:s,horizontal:f,vertical:d,inlineSub:s,horizontalSub:d,verticalSub:d})["".concat(e).concat(n?"":"Sub")])||void 0===i?void 0:i[r]){case l:return{offset:-1,sibling:!0};case u:return{offset:1,sibling:!0};case c:return{offset:-1,sibling:!1};case a:return{offset:1,sibling:!1};default:return null}}(nN,1===nW(s,!0).length,ns,n);if(!f&&n!==z&&n!==F)return;(j.includes(n)||[z,F].includes(n))&&e.preventDefault();var d=function(e){if(e){var n=e,t=e.querySelector("a");null!=t&&t.getAttribute("href")&&(n=t);var r=a.get(e);nJ(r),ec(),el.current=(0,O.Z)(function(){eu.current===r&&n.focus()})}};if([z,F].includes(n)||f.sibling||!c){var p,v=B(p=c&&"inline"!==nN?function(e){for(var n=e;n;){if(n.getAttribute("data-menu-list"))return n;n=n.parentElement}return null}(c):na.current,l);d(n===z?v[0]:n===F?v[v.length-1]:W(p,l,c,f.offset))}else if(f.inlineTrigger)ei(s);else if(f.offset>0)ei(s,!0),ec(),el.current=(0,O.Z)(function(){r=H(t,nc);var e=c.getAttribute("aria-controls");d(W(document.getElementById(e),r.elements))},5);else if(f.offset<0){var m=nW(s,!0),b=m[m.length-2],y=u.get(b);ei(b,!1),d(y)}}null==e9||e9(e)});m.useEffect(function(){nu(!0)},[]);var n7=m.useMemo(function(){return{_internalRenderMenuItem:e4,_internalRenderSubMenuItem:e3}},[e4,e3]),te="horizontal"!==nN||eR?nt:nt.map(function(e,n){return m.createElement(w,{key:e.key,overflowDisabled:n>nL},e)}),tn=m.createElement(f.Z,(0,r.Z)({id:eC,ref:na,prefixCls:"".concat(ed,"-overflow"),component:"ul",itemComponent:ev,className:s()(ed,"".concat(ed,"-root"),"".concat(ed,"-").concat(nN),eb,(0,o.Z)((0,o.Z)({},"".concat(ed,"-inline-collapsed"),nK),"".concat(ed,"-rtl"),ns),ep),dir:eZ,style:em,role:"menu",tabIndex:void 0===ey?0:ey,data:te,renderRawItem:function(e){return e},renderRawRest:function(e){var n=e.length,t=n?nt.slice(-n):null;return m.createElement(eI,{eventKey:X,title:e0,disabled:n_,internalPopupClose:0===n,popupClassName:e1},t)},maxCount:"horizontal"!==nN||eR?f.Z.INVALIDATE:f.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){nD(e)},onKeyDown:n8},e7));return m.createElement(P.Provider,{value:n7},m.createElement(y.Provider,{value:nc},m.createElement(w,{prefixCls:ed,rootClassName:ep,mode:nN,openKeys:np,rtl:ns,disabled:eM,motion:nl?eq:null,defaultMotions:nl?eX:null,activeKey:nU,onActive:n$,onInactive:n0,selectedKeys:n6,inlineIndent:void 0===eY?24:eY,subMenuOpenDelay:void 0===ex?.1:ex,subMenuCloseDelay:void 0===eN?.1:eN,forceSubMenuRender:eP,builtinPlacements:eQ,triggerSubMenuAction:void 0===eG?"hover":eG,getPopupContainer:e2,itemIcon:eU,expandIcon:eJ,onItemClick:n4,onOpenChange:n3},m.createElement(N.Provider,{value:nX},tn),m.createElement("div",{style:{display:"none"},"aria-hidden":!0},m.createElement(k.Provider,{value:nq},nr)))))});eF.Item=ev,eF.SubMenu=eI,eF.ItemGroup=eL,eF.Divider=eO;var ej=eF}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/337-bb33d149e9f461b3.js b/litellm/proxy/_experimental/out/_next/static/chunks/337-bb33d149e9f461b3.js new file mode 100644 index 0000000000..d0085b0c41 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/337-bb33d149e9f461b3.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[337],{50337:function(e,t,a){a.d(t,{Z:function(){return z}});var n=a(2265),c=a(36760),i=a.n(c),l=a(71744),o=a(18694),s=e=>{let{prefixCls:t,className:a,style:c,size:l,shape:o}=e,s=i()({["".concat(t,"-lg")]:"large"===l,["".concat(t,"-sm")]:"small"===l}),r=i()({["".concat(t,"-circle")]:"circle"===o,["".concat(t,"-square")]:"square"===o,["".concat(t,"-round")]:"round"===o}),g=n.useMemo(()=>"number"==typeof l?{width:l,height:l,lineHeight:"".concat(l,"px")}:{},[l]);return n.createElement("span",{className:i()(t,s,r,a),style:Object.assign(Object.assign({},g),c)})},r=a(93463),g=a(99320),d=a(71140);let u=new r.E4("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),m=e=>({height:e,lineHeight:(0,r.bf)(e)}),b=e=>Object.assign({width:e},m(e)),h=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:u,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),p=(e,t)=>Object.assign({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal()},m(e)),k=e=>{let{skeletonAvatarCls:t,gradientFromColor:a,controlHeight:n,controlHeightLG:c,controlHeightSM:i}=e;return{[t]:Object.assign({display:"inline-block",verticalAlign:"top",background:a},b(n)),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"},["".concat(t).concat(t,"-lg")]:Object.assign({},b(c)),["".concat(t).concat(t,"-sm")]:Object.assign({},b(i))}},j=e=>{let{controlHeight:t,borderRadiusSM:a,skeletonInputCls:n,controlHeightLG:c,controlHeightSM:i,gradientFromColor:l,calc:o}=e;return{[n]:Object.assign({display:"inline-block",verticalAlign:"top",background:l,borderRadius:a},p(t,o)),["".concat(n,"-lg")]:Object.assign({},p(c,o)),["".concat(n,"-sm")]:Object.assign({},p(i,o))}},O=e=>Object.assign({width:e},m(e)),v=e=>{let{skeletonImageCls:t,imageSizeBase:a,gradientFromColor:n,borderRadiusSM:c,calc:i}=e;return{[t]:Object.assign(Object.assign({display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:n,borderRadius:c},O(i(a).mul(2).equal())),{["".concat(t,"-path")]:{fill:"#bfbfbf"},["".concat(t,"-svg")]:Object.assign(Object.assign({},O(a)),{maxWidth:i(a).mul(4).equal(),maxHeight:i(a).mul(4).equal()}),["".concat(t,"-svg").concat(t,"-svg-circle")]:{borderRadius:"50%"}}),["".concat(t).concat(t,"-circle")]:{borderRadius:"50%"}}},f=(e,t,a)=>{let{skeletonButtonCls:n}=e;return{["".concat(a).concat(n,"-circle")]:{width:t,minWidth:t,borderRadius:"50%"},["".concat(a).concat(n,"-round")]:{borderRadius:t}}},C=(e,t)=>Object.assign({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal()},m(e)),E=e=>{let{borderRadiusSM:t,skeletonButtonCls:a,controlHeight:n,controlHeightLG:c,controlHeightSM:i,gradientFromColor:l,calc:o}=e;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[a]:Object.assign({display:"inline-block",verticalAlign:"top",background:l,borderRadius:t,width:o(n).mul(2).equal(),minWidth:o(n).mul(2).equal()},C(n,o))},f(e,n,a)),{["".concat(a,"-lg")]:Object.assign({},C(c,o))}),f(e,c,"".concat(a,"-lg"))),{["".concat(a,"-sm")]:Object.assign({},C(i,o))}),f(e,i,"".concat(a,"-sm")))},w=e=>{let{componentCls:t,skeletonAvatarCls:a,skeletonTitleCls:n,skeletonParagraphCls:c,skeletonButtonCls:i,skeletonInputCls:l,skeletonImageCls:o,controlHeight:s,controlHeightLG:r,controlHeightSM:g,gradientFromColor:d,padding:u,marginSM:m,borderRadius:p,titleHeight:O,blockRadius:f,paragraphLiHeight:C,controlHeightXS:w,paragraphMarginTop:x}=e;return{[t]:{display:"table",width:"100%",["".concat(t,"-header")]:{display:"table-cell",paddingInlineEnd:u,verticalAlign:"top",[a]:Object.assign({display:"inline-block",verticalAlign:"top",background:d},b(s)),["".concat(a,"-circle")]:{borderRadius:"50%"},["".concat(a,"-lg")]:Object.assign({},b(r)),["".concat(a,"-sm")]:Object.assign({},b(g))},["".concat(t,"-content")]:{display:"table-cell",width:"100%",verticalAlign:"top",[n]:{width:"100%",height:O,background:d,borderRadius:f,["+ ".concat(c)]:{marginBlockStart:g}},[c]:{padding:0,"> li":{width:"100%",height:C,listStyle:"none",background:d,borderRadius:f,"+ li":{marginBlockStart:w}}},["".concat(c,"> li:last-child:not(:first-child):not(:nth-child(2))")]:{width:"61%"}},["&-round ".concat(t,"-content")]:{["".concat(n,", ").concat(c," > li")]:{borderRadius:p}}},["".concat(t,"-with-avatar ").concat(t,"-content")]:{[n]:{marginBlockStart:m,["+ ".concat(c)]:{marginBlockStart:x}}},["".concat(t).concat(t,"-element")]:Object.assign(Object.assign(Object.assign(Object.assign({display:"inline-block",width:"auto"},E(e)),k(e)),j(e)),v(e)),["".concat(t).concat(t,"-block")]:{width:"100%",[i]:{width:"100%"},[l]:{width:"100%"}},["".concat(t).concat(t,"-active")]:{["\n ".concat(n,",\n ").concat(c," > li,\n ").concat(a,",\n ").concat(i,",\n ").concat(l,",\n ").concat(o,"\n ")]:Object.assign({},h(e))}}};var x=(0,g.I$)("Skeleton",e=>{let{componentCls:t,calc:a}=e;return w((0,d.IX)(e,{skeletonAvatarCls:"".concat(t,"-avatar"),skeletonTitleCls:"".concat(t,"-title"),skeletonParagraphCls:"".concat(t,"-paragraph"),skeletonButtonCls:"".concat(t,"-button"),skeletonInputCls:"".concat(t,"-input"),skeletonImageCls:"".concat(t,"-image"),imageSizeBase:a(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:"linear-gradient(90deg, ".concat(e.gradientFromColor," 25%, ").concat(e.gradientToColor," 37%, ").concat(e.gradientFromColor," 63%)"),skeletonLoadingMotionDuration:"1.4s"}))},e=>{let{colorFillContent:t,colorFill:a}=e;return{color:t,colorGradientEnd:a,gradientFromColor:t,gradientToColor:a,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]});let y=(e,t)=>{let{width:a,rows:n=2}=t;return Array.isArray(a)?a[e]:n-1===e?a:void 0};var q=e=>{let{prefixCls:t,className:a,style:c,rows:l=0}=e,o=Array.from({length:l}).map((t,a)=>n.createElement("li",{key:a,style:{width:y(a,e)}}));return n.createElement("ul",{className:i()(t,a),style:c},o)},N=e=>{let{prefixCls:t,className:a,width:c,style:l}=e;return n.createElement("h3",{className:i()(t,a),style:Object.assign({width:c},l)})};function R(e){return e&&"object"==typeof e?e:{}}let A=e=>{let{prefixCls:t,loading:a,className:c,rootClassName:o,style:r,children:g,avatar:d=!1,title:u=!0,paragraph:m=!0,active:b,round:h}=e,{getPrefixCls:p,direction:k,className:j,style:O}=(0,l.dj)("skeleton"),v=p("skeleton",t),[f,C,E]=x(v);if(a||!("loading"in e)){let e,t;let a=!!d,l=!!u,g=!!m;if(a){let t=Object.assign(Object.assign({prefixCls:"".concat(v,"-avatar")},l&&!g?{size:"large",shape:"square"}:{size:"large",shape:"circle"}),R(d));e=n.createElement("div",{className:"".concat(v,"-header")},n.createElement(s,Object.assign({},t)))}if(l||g){let e,c;if(l){let t=Object.assign(Object.assign({prefixCls:"".concat(v,"-title")},!a&&g?{width:"38%"}:a&&g?{width:"50%"}:{}),R(u));e=n.createElement(N,Object.assign({},t))}if(g){let e=Object.assign(Object.assign({prefixCls:"".concat(v,"-paragraph")},function(e,t){let a={};return e&&t||(a.width="61%"),!e&&t?a.rows=3:a.rows=2,a}(a,l)),R(m));c=n.createElement(q,Object.assign({},e))}t=n.createElement("div",{className:"".concat(v,"-content")},e,c)}let p=i()(v,{["".concat(v,"-with-avatar")]:a,["".concat(v,"-active")]:b,["".concat(v,"-rtl")]:"rtl"===k,["".concat(v,"-round")]:h},j,c,o,C,E);return f(n.createElement("div",{className:p,style:Object.assign(Object.assign({},O),r)},e,t))}return null!=g?g:null};A.Button=e=>{let{prefixCls:t,className:a,rootClassName:c,active:r,block:g=!1,size:d="default"}=e,{getPrefixCls:u}=n.useContext(l.E_),m=u("skeleton",t),[b,h,p]=x(m),k=(0,o.Z)(e,["prefixCls"]),j=i()(m,"".concat(m,"-element"),{["".concat(m,"-active")]:r,["".concat(m,"-block")]:g},a,c,h,p);return b(n.createElement("div",{className:j},n.createElement(s,Object.assign({prefixCls:"".concat(m,"-button"),size:d},k))))},A.Avatar=e=>{let{prefixCls:t,className:a,rootClassName:c,active:r,shape:g="circle",size:d="default"}=e,{getPrefixCls:u}=n.useContext(l.E_),m=u("skeleton",t),[b,h,p]=x(m),k=(0,o.Z)(e,["prefixCls","className"]),j=i()(m,"".concat(m,"-element"),{["".concat(m,"-active")]:r},a,c,h,p);return b(n.createElement("div",{className:j},n.createElement(s,Object.assign({prefixCls:"".concat(m,"-avatar"),shape:g,size:d},k))))},A.Input=e=>{let{prefixCls:t,className:a,rootClassName:c,active:r,block:g,size:d="default"}=e,{getPrefixCls:u}=n.useContext(l.E_),m=u("skeleton",t),[b,h,p]=x(m),k=(0,o.Z)(e,["prefixCls"]),j=i()(m,"".concat(m,"-element"),{["".concat(m,"-active")]:r,["".concat(m,"-block")]:g},a,c,h,p);return b(n.createElement("div",{className:j},n.createElement(s,Object.assign({prefixCls:"".concat(m,"-input"),size:d},k))))},A.Image=e=>{let{prefixCls:t,className:a,rootClassName:c,style:o,active:s}=e,{getPrefixCls:r}=n.useContext(l.E_),g=r("skeleton",t),[d,u,m]=x(g),b=i()(g,"".concat(g,"-element"),{["".concat(g,"-active")]:s},a,c,u,m);return d(n.createElement("div",{className:b},n.createElement("div",{className:i()("".concat(g,"-image"),a),style:o},n.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(g,"-image-svg")},n.createElement("title",null,"Image placeholder"),n.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(g,"-image-path")})))))},A.Node=e=>{let{prefixCls:t,className:a,rootClassName:c,style:o,active:s,children:r}=e,{getPrefixCls:g}=n.useContext(l.E_),d=g("skeleton",t),[u,m,b]=x(d),h=i()(d,"".concat(d,"-element"),{["".concat(d,"-active")]:s},m,a,c,b);return u(n.createElement("div",{className:h},n.createElement("div",{className:i()("".concat(d,"-image"),a),style:o},r)))};var z=A}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3705-124a560b74decaa8.js b/litellm/proxy/_experimental/out/_next/static/chunks/3705-1dcdbda1985a6786.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/chunks/3705-124a560b74decaa8.js rename to litellm/proxy/_experimental/out/_next/static/chunks/3705-1dcdbda1985a6786.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3801-ff2404f6d0c38247.js b/litellm/proxy/_experimental/out/_next/static/chunks/3801-5abad9290d1ac527.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/3801-ff2404f6d0c38247.js rename to litellm/proxy/_experimental/out/_next/static/chunks/3801-5abad9290d1ac527.js index 5e4ad1a6f8..bd7c4e9e15 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/3801-ff2404f6d0c38247.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3801-5abad9290d1ac527.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3801],{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:d,initialValues:m={},buttonLabel:u="Filters"}=e,[x,h]=(0,l.useState)(!1),[g,p]=(0,l.useState)(m),[f,j]=(0,l.useState)({}),[v,b]=(0,l.useState)({}),[y,N]=(0,l.useState)({}),[w,k]=(0,l.useState)({}),_=(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);j(e=>({...e,[s.name]:a}))}catch(e){console.error("Error searching:",e),j(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})),k(s=>({...s,[e.name]:!0}));try{let s=await e.searchFn("");j(a=>({...a,[e.name]:s}))}catch(s){console.error("Error loading initial options:",s),j(s=>({...s,[e.name]:[]}))}finally{b(s=>({...s,[e.name]:!1}))}}},[w]);(0,l.useEffect)(()=>{x&&s.forEach(e=>{e.isSearchable&&!w[e.name]&&S(e)})},[x,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)(o.Z,{className:"h-4 w-4"}),onClick:()=>h(!x),className:"flex items-center gap-2",children:u}),(0,t.jsx)(r.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),p(e),d()},children:"Reset Filters"})]}),x&&(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","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&&_(e,a)},filterOption:!1,loading:v[a.name],options:f[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})})]})}},33801:function(e,s,a){a.d(s,{I:function(){return eg},Z:function(){return eh}});var t=a(57437),l=a(77398),r=a.n(l),n=a(11713),i=a(2265),o=a(29827),d=a(19250),c=a(12322),m=a(42673),u=a(99981);let x=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"}},h=e=>{let{utcTime:s}=e;return(0,t.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:x(s)})};var g=a(41649),p=a(78489),f=a(59872);let j=(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,m.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)(h,{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)(u.Z,{title:String(e.getValue()||""),children:(0,t.jsx)(p.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)(u.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.jsxs)("span",{children:["$",(0,f.pw)(e.getValue()||0,6)]})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,t.jsx)(u.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)(u.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)(u.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)(u.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:j(s,a),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(u.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)(u.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)(u.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)(u.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)(g.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)(h,{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)(u.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)(u.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,d.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),k=a(86669);function _(e){let{row:s,hasMessages:a,hasResponse:l,hasError:r,errorInfo:n,getRawRequest:i,formattedResponse:o}=e,d=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 d(JSON.stringify(i(),null,2))?w.Z.success("Request copied to clipboard"):w.Z.fromBackend("Failed to copy request")},m=async()=>{await d(JSON.stringify(o(),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)(k.gc,{data:i(),style:k.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)(k.gc,{data:o(),style:k.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,o]=i.useState(!1),d=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(),o=i.split("\n"),d="";return o.length>1&&(d=o[o.length-1].trim()),{filePath:a,fileName:l,lineNumber:t,code:d,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(o(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:()=>d(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 M=a(94292),T=a(12514),E=a(35829),D=a(84264),A=a(96761),I=a(10900),R=a(5545),O=a(30401),H=a(78867);let q=e=>{let{sessionId:s,logs:a,onBack:l}=e,[r,n]=(0,i.useState)(null),[o,d]=(0,i.useState)({}),m=a.reduce((e,s)=>e+(s.spend||0),0),x=a.reduce((e,s)=>e+(s.total_tokens||0),0),h=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),g=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),j=x+h+g,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,f.vQ)(e)&&(d(e=>({...e,[s]:!0})),setTimeout(()=>{d(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)(p.Z,{icon:I.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:o["session-id"]?(0,t.jsx)(O.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(o["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)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Requests"}),(0,t.jsx)(E.Z,{children:a.length})]}),(0,t.jsxs)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Cost"}),(0,t.jsxs)(E.Z,{children:["$",(0,f.pw)(m,6)]})]}),(0,t.jsx)(u.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,f.pw)(a.reduce((e,s)=>e+(s.prompt_tokens||0),0))})]}),h>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,f.pw)(h)})]}),g>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,f.pw)(g)})]})]})]}),(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,f.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,f.pw)(j)})]})})]})]}),placement:"top",overlayStyle:{minWidth:"300px"},children:(0,t.jsxs)(T.Z,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(D.Z,{children:"Total Tokens"}),(0,t.jsx)("span",{className:"text-gray-400 text-sm",children:"ⓘ"})]}),(0,t.jsx)(E.Z,{children:(0,f.pw)(j)})]})})]}),(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:eg,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 o=e=>new Date(1e3*e).toLocaleString(),d=(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,m.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:o(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:o(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:d(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 Y=e=>e>=.8?"text-green-600":"text-yellow-600";var K=e=>{let{entities:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({}),o=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:()=>o(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(Y(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:Y(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"),U=e=>{let{title:s,count:a,defaultOpen:l=!0,right:r,children:n}=e,[o,d]=(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:()=>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(o?"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})]}),o&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:n})]})},V=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})]})},B=()=>(0,t.jsx)("div",{className:"my-3 border-t"});var W=e=>{var s,a,l,r,n,i,o,d,c,m;let{response:u}=e;if(!u)return null;let x=null!==(n=null!==(r=u.outputs)&&void 0!==r?r:u.output)&&void 0!==n?n:[],h="GUARDRAIL_INTERVENED"===u.action?"red":"green",g=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(s=u.guardrailCoverage)||void 0===s?void 0:s.textCharacters)&&P("text guarded ".concat(null!==(i=u.guardrailCoverage.textCharacters.guarded)&&void 0!==i?i:0,"/").concat(null!==(o=u.guardrailCoverage.textCharacters.total)&&void 0!==o?o:0),"blue"),(null===(a=u.guardrailCoverage)||void 0===a?void 0:a.images)&&P("images guarded ".concat(null!==(d=u.guardrailCoverage.images.guarded)&&void 0!==d?d:0,"/").concat(null!==(c=u.guardrailCoverage.images.total)&&void 0!==c?c:0),"blue")]}),p=u.usage&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(u.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)(V,{label:"Action:",children:P(null!==(m=u.action)&&void 0!==m?m:"N/A",h)}),u.actionReason&&(0,t.jsx)(V,{label:"Action Reason:",children:u.actionReason}),u.blockedResponse&&(0,t.jsx)(V,{label:"Blocked Response:",children:(0,t.jsx)("span",{className:"italic",children:u.blockedResponse})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{label:"Coverage:",children:g}),(0,t.jsx)(V,{label:"Usage:",children:p})]})]}),x.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Outputs"}),(0,t.jsx)("div",{className:"space-y-2",children:x.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=u.assessments)||void 0===l?void 0:l.length)?(0,t.jsx)("div",{className:"space-y-3",children:u.assessments.map((e,s)=>{var a,l,r,n,i,o,d,c,m,u,x,h,g,p,f,j,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)(U,{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!==(j=null===(l=e.wordPolicy.customWords)||void 0===l?void 0:l.length)&&void 0!==j?j:0)>0&&(0,t.jsx)(U,{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)(U,{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===(d=e.contextualGroundingPolicy)||void 0===d?void 0:null===(o=d.filters)||void 0===o?void 0:o.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)(U,{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)(U,{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===(x=e.topicPolicy)||void 0===x?void 0:null===(u=x.topics)||void 0===u?void 0:u.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)(U,{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)(V,{label:"Latency (ms)",children:null!==(N=e.invocationMetrics.guardrailProcessingLatency)&&void 0!==N?N:"—"}),(0,t.jsx)(V,{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!==(k=e.invocationMetrics.guardrailCoverage.textCharacters.total)&&void 0!==k?k:0),"blue"),(null===(g=e.invocationMetrics.guardrailCoverage)||void 0===g?void 0:g.images)&&P("images ".concat(null!==(_=e.invocationMetrics.guardrailCoverage.images.guarded)&&void 0!==_?_: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)(V,{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===(f=e.automatedReasoningPolicy)||void 0===f?void 0:null===(p=f.findings)||void 0===p?void 0:p.length)?(0,t.jsx)(U,{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)(U,{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(u,null,2)})})]})};let z=e=>new Date(1e3*e).toLocaleString(),J=e=>{var s,a;let{entry:l,index:r,total:n}=e,i=null!==(s=l.guardrail_provider)&&void 0!==s?s:"presidio",o=null!==(a=l.guardrail_status)&&void 0!==a?a:"unknown",d="success"===o.toLowerCase(),c=l.masked_entity_count||{},m=Object.values(c).reduce((e,s)=>e+("number"==typeof s?s:0),0),x=l.guardrail_response,h=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)(u.Z,{title:d?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(d?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o})})]})]}),(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:z(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:z(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&&h.length>0&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(K,{entities:h})}),"bedrock"===i&&g&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(W,{response:g})})]})};var G=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"),o=Array.from(new Set(a.map(e=>e.guardrail_status))).every(e=>"success"===(null!=e?e:"").toLowerCase()),d=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)(u.Z,{title:o?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(o?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o?"success":"failure"})}),(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:n}),d>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:[d," masked ",1===d?"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)(J,{entry:e,index:s,total:a.length},"".concat(null!==(l=e.guardrail_name)&&void 0!==l?l:"guardrail","-").concat(s))})})]})},Q=a(23048),$=a(30841),X=a(7310),ee=a.n(X),es=a(12363);let ea={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"};var et=a(59341),el=a(12485),er=a(18135),en=a(35242),ei=a(29706),eo=a(77991),ed=a(92280);let ec="".concat("../ui/assets/","audit-logs-preview.png");function em(e){let{userID:s,userRole:a,token:l,accessToken:o,isActive:m,premiumUser:u,allTeams:x}=e,[h,g]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),p=(0,i.useRef)(null),j=(0,i.useRef)(null),[v,b]=(0,i.useState)(1),[N]=(0,i.useState)(50),[w,k]=(0,i.useState)({}),[_,S]=(0,i.useState)(""),[C,L]=(0,i.useState)(""),[M,T]=(0,i.useState)(""),[E,D]=(0,i.useState)("all"),[A,I]=(0,i.useState)("all"),[R,O]=(0,i.useState)(!1),[H,q]=(0,i.useState)(!1),F=(0,n.a)({queryKey:["all_audit_logs",o,l,a,s,h],queryFn:async()=>{if(!o||!l||!a||!s)return[];let e=r()(h).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,d.uiAuditLogsCall)(o,e,t,i,50);n=n.concat(s.audit_logs),c=s.total_pages,i++}while(i<=c);return n},enabled:!!o&&!!l&&!!a&&!!s&&m,refetchInterval:5e3,refetchIntervalInBackground:!0}),Y=(0,i.useCallback)(async e=>{if(o)try{let s=(await (0,d.keyListCall)(o,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("")}},[o]);(0,i.useEffect)(()=>{if(!o)return;let e=!1,s=!1;w["Team ID"]?_!==w["Team ID"]&&(S(w["Team ID"]),e=!0):""!==_&&(S(""),e=!0),w["Key Hash"]?C!==w["Key Hash"]&&(L(w["Key Hash"]),s=!0):w["Key Alias"]?Y(w["Key Alias"]):""!==C&&(L(""),s=!0),(e||s)&&b(1)},[w,o,Y,_,C]),(0,i.useEffect)(()=>{b(1)},[_,C,h,M,E,A]),(0,i.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&O(!1),j.current&&!j.current.contains(e.target)&&q(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let K=(0,i.useMemo)(()=>F.data?F.data.filter(e=>{var s,a,t,l,r,n,i;let o=!0,d=!0,c=!0,m=!0,u=!0;if(_){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;o=r===_||n===_}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;d="string"==typeof t&&t.includes(C)||"string"==typeof l&&l.includes(C)}catch(e){d=!1}if(M&&(c=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(M.toLowerCase())),"all"!==E&&(m=(null===(n=e.action)||void 0===n?void 0:n.toLowerCase())===E.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}u=(null===(i=e.table_name)||void 0===i?void 0:i.toLowerCase())===s}return o&&d&&c&&m&&u}):[],[F.data,_,C,M,E,A]),P=K.length,Z=Math.ceil(P/N)||1,U=(0,i.useMemo)(()=>{let e=(v-1)*N,s=e+N;return K.slice(e,s)},[K,v,N]),V=!F.data||0===F.data.length,B=(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)(ed.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,f.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,f.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)(ed.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)})},o=a,d=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)}),o=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},d=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&&(o={"No fields changed":"N/A"},d={"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(o,"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(d,"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)(ed.x,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,t.jsx)(ed.x,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,t.jsx)("img",{src:ec,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:V}),(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:M,onChange:e=>T(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:p,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:()=>O(!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"===E&&"All Actions","created"===E&&"Created","updated"===E&&"Updated","deleted"===E&&"Deleted","rotated"===E&&"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(E===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{D(e.value),O(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("div",{className:"relative",ref:j,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:()=>q(!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:()=>{I(e.value),q(!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:U,renderSubComponent:B,getRowCanExpand:()=>!0})]})]})}let eu=(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 ex=a(9309);function eh(e){var s,a,l;let{accessToken:m,token:u,userRole:x,userID:h,allTeams:g,premiumUser:p}=e,[f,j]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[_,S]=(0,i.useState)(1),[L]=(0,i.useState)(50),T=(0,i.useRef)(null),E=(0,i.useRef)(null),D=(0,i.useRef)(null),[A,I]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[R,O]=(0,i.useState)(r()().format("YYYY-MM-DDTHH:mm")),[H,F]=(0,i.useState)(!1),[Y,K]=(0,i.useState)(!1),[P,Z]=(0,i.useState)(""),[U,V]=(0,i.useState)(""),[B,W]=(0,i.useState)(""),[z,J]=(0,i.useState)(""),[G,X]=(0,i.useState)(""),[ed,ec]=(0,i.useState)(null),[ex,eh]=(0,i.useState)(null),[ep,ef]=(0,i.useState)(""),[ej,ev]=(0,i.useState)(""),[eb,ey]=(0,i.useState)(x&&C.lo.includes(x)),[eN,ew]=(0,i.useState)("request logs"),[ek,e_]=(0,i.useState)(null),[eS,eC]=(0,i.useState)(null),eL=(0,o.NL)(),[eM,eT]=(0,i.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,i.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(eM))},[eM]);let[eE,eD]=(0,i.useState)({value:24,unit:"hours"});(0,i.useEffect)(()=>{(async()=>{ex&&m&&ec({...(await (0,d.keyInfoV1Call)(m,ex)).info,token:ex,api_key:ex})})()},[ex,m]),(0,i.useEffect)(()=>{function e(e){T.current&&!T.current.contains(e.target)&&k(!1),E.current&&!E.current.contains(e.target)&&y(!1),D.current&&!D.current.contains(e.target)&&K(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,i.useEffect)(()=>{x&&C.lo.includes(x)&&ey(!0)},[x]);let eA=(0,n.a)({queryKey:["logs","table",_,L,A,R,B,z,eb?h:null,ep,G],queryFn:async()=>{if(!m||!u||!x||!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,d.uiSpendLogsCall)(m,z||void 0,B||void 0,void 0,e,s,_,L,eb?h:void 0,ej,ep,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&&!!u&&!!x&&!!h&&"request logs"===eN,refetchInterval:!!eM&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:eI,filteredLogs:eR,allTeams:eO,allKeyAliases:eH,handleFilterChange:eq,handleFilterReset:eF}=function(e){let{logs:s,accessToken:a,startTime:t,endTime:l,pageSize:o=es.d,isCustomDate:c,setCurrentPage:m,userID:u,userRole:x}=e,h=(0,i.useMemo)(()=>({[ea.TEAM_ID]:"",[ea.KEY_HASH]:"",[ea.REQUEST_ID]:"",[ea.MODEL]:"",[ea.USER_ID]:"",[ea.END_USER]:"",[ea.STATUS]:"",[ea.KEY_ALIAS]:""}),[]),[g,p]=(0,i.useState)(h),[f,j]=(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,d.uiSpendLogsCall)(a,e[ea.KEY_HASH]||void 0,e[ea.TEAM_ID]||void 0,e[ea.REQUEST_ID]||void 0,i,m,s,o,e[ea.USER_ID]||void 0,e[ea.END_USER]||void 0,e[ea.STATUS]||void 0,e[ea.MODEL]||void 0,e[ea.KEY_ALIAS]||void 0);n===v.current&&t.data&&j(t)}catch(e){console.error("Error searching users:",e)}},[a,t,l,c,o]),y=(0,i.useMemo)(()=>ee()((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,$.LO)(a)},enabled:!!a}).data||[],w=(0,i.useMemo)(()=>!!(g[ea.KEY_ALIAS]||g[ea.KEY_HASH]||g[ea.REQUEST_ID]||g[ea.USER_ID]||g[ea.END_USER]),[g]),k=(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[ea.TEAM_ID]&&(e=e.filter(e=>e.team_id===g[ea.TEAM_ID])),g[ea.STATUS]&&(e=e.filter(e=>"success"===g[ea.STATUS]?!e.status||"success"===e.status:e.status===g[ea.STATUS])),g[ea.MODEL]&&(e=e.filter(e=>e.model===g[ea.MODEL])),g[ea.KEY_HASH]&&(e=e.filter(e=>e.api_key===g[ea.KEY_HASH])),g[ea.END_USER]&&(e=e.filter(e=>e.end_user===g[ea.END_USER])),{data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages}},[s,g,w]),_=(0,i.useMemo)(()=>w?f&&f.data&&f.data.length>0?f:s||{data:[],total:0,page:1,page_size:50,total_pages:0}:k,[w,f,k,s]),{data:S}=(0,n.a)({queryKey:["allTeamsForLogFilters",a],queryFn:async()=>a&&await (0,$.IE)(a)||[],enabled:!!a});return{filters:g,filteredLogs:_,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),j({data:[],total:0,page:1,page_size:50,total_pages:0}),y(h,1)}}}({logs:eA.data||{data:[],total:0,page:1,page_size:L||10,total_pages:1},accessToken:m,startTime:A,endTime:R,pageSize:L,isCustomDate:H,setCurrentPage:S,userID:h,userRole:x}),eY=(0,i.useCallback)(async e=>{if(m)try{let s=(await (0,d.keyListCall)(m,null,null,e,null,null,_,L)).keys.find(s=>s.key_alias===e);s&&J(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[m,_,L]);(0,i.useEffect)(()=>{m&&(eI["Team ID"]?W(eI["Team ID"]):W(""),ef(eI.Status||""),X(eI.Model||""),ev(eI["End User"]||""),eI["Key Hash"]?J(eI["Key Hash"]):eI["Key Alias"]?eY(eI["Key Alias"]):J(""))},[eI,m,eY]);let eK=(0,n.a)({queryKey:["sessionLogs",eS],queryFn:async()=>{if(!m||!eS)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,d.sessionSpendLogsCall)(m,eS);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!m&&!!eS});if((0,i.useEffect)(()=>{var e;(null===(e=eA.data)||void 0===e?void 0:e.data)&&ek&&!eA.data.data.some(e=>e.request_id===ek)&&e_(null)},[null===(s=eA.data)||void 0===s?void 0:s.data,ek]),!m||!u||!x||!h)return null;let eP=eR.data.filter(e=>!f||e.request_id.includes(f)||e.model.includes(f)||e.user&&e.user.includes(f)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>eh(e),onSessionClick:e=>{e&&eC(e)}}))||[],eZ=(null===(l=eK.data)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:a.map(e=>({...e,onKeyHashClick:e=>eh(e),onSessionClick:e=>{}})))||[],eU=[{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,$.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,d.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:"Key Hash",label:"Key Hash",isSearchable:!1}];if(eS&&eK.data)return(0,t.jsx)("div",{className:"w-full p-6",children:(0,t.jsx)(q,{sessionId:eS,logs:eK.data.data,onBack:()=>eC(null)})});let eV=[{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"}],eB=eV.find(e=>e.value===eE.value&&e.unit===eE.unit),eW=H?eu(H,A,R):null==eB?void 0:eB.label;return(0,t.jsx)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:(0,t.jsxs)(er.Z,{defaultIndex:0,onIndexChange:e=>ew(0===e?"request logs":"audit logs"),children:[(0,t.jsxs)(en.Z,{children:[(0,t.jsx)(el.Z,{children:"Request Logs"}),(0,t.jsx)(el.Z,{children:"Audit Logs"})]}),(0,t.jsxs)(eo.Z,{children:[(0,t.jsxs)(ei.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:eS?(0,t.jsxs)(t.Fragment,{children:["Session: ",(0,t.jsx)("span",{className:"font-mono",children:eS}),(0,t.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>eC(null),children:"← Back to All Logs"})]}):"Request Logs"})}),ed&&ex&&ed.api_key===ex?(0,t.jsx)(M.Z,{keyId:ex,keyData:ed,accessToken:m,userID:h,userRole:x,teams:g,onClose:()=>eh(null),premiumUser:p,backButtonText:"Back to Logs"}):eS?(0,t.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,t.jsx)(c.w,{columns:v,data:eZ,renderSubComponent:eg,getRowCanExpand:()=>!0})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Q.Z,{options:eU,onApplyFilters:eq,onResetFilters:eF}),(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:f,onChange:e=>j(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:D,children:[(0,t.jsxs)("button",{onClick:()=>K(!Y),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"})}),eW]}),Y&&(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:[eV.map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eW===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{O(r()().format("YYYY-MM-DDTHH:mm")),I(r()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eD({value:e.value,unit:e.unit}),F(!1),K(!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)(et.Z,{color:"green",checked:eM,defaultChecked:!0,onChange:eT})]}),{}),(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=>{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.jsx)("span",{className:"text-gray-500",children:"to"}),(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:R,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.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?"...":eR?(_-1)*L+1:0," -"," ",eA.isLoading?"...":eR?Math.min(_*L,eR.total):0," ","of ",eA.isLoading?"...":eR?eR.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?"...":_," of"," ",eA.isLoading?"...":eR?eR.total_pages:1]}),(0,t.jsx)("button",{onClick:()=>S(e=>Math.max(1,e-1)),disabled:eA.isLoading||1===_,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(eR.total_pages||1,e+1)),disabled:eA.isLoading||_===(eR.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"})]})]})]})}),eM&&1===_&&(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:()=>eT(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,t.jsx)(c.w,{columns:v,data:eP,renderSubComponent:eg,getRowCanExpand:()=>!0})]})]})]}),(0,t.jsx)(ei.Z,{children:(0,t.jsx)(em,{userID:h,userRole:x,token:u,accessToken:m,isActive:"audit logs"===eN,premiumUser:p,allTeams:g})})]})]})})}function eg(e){var s,a,l,r,n,i,o,d,c,m;let{row:x}=e,h=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},g=x.original.metadata||{},p="failure"===g.status,j=p?g.error_information:null,v=x.original.messages&&(Array.isArray(x.original.messages)?x.original.messages.length>0:Object.keys(x.original.messages).length>0),b=x.original.response&&Object.keys(h(x.original.response)).length>0,y=g.vector_store_request_metadata&&Array.isArray(g.vector_store_request_metadata)&&g.vector_store_request_metadata.length>0,N=null===(s=x.original.metadata)||void 0===s?void 0:s.guardrail_information,w=Array.isArray(N)?N:N?[N]:[],k=w.length>0,C=w.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),M=1===w.length?null!==(m=null===(a=w[0])||void 0===a?void 0:a.guardrail_name)&&void 0!==m?m:"-":w.length>1?"".concat(w.length," guardrails"):"-",T=(0,ex.aS)(x.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:"}),x.original.request_id.length>64?(0,t.jsx)(u.Z,{title:x.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:x.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:x.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:x.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:x.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:x.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)(u.Z,{title:x.original.api_base||"-",children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:x.original.api_base||"-"})})]}),(null==x?void 0:null===(l=x.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==x?void 0:null===(r=x.original)||void 0===r?void 0:r.requester_ip_address})]}),k&&(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:M}),C>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:[C," 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:[x.original.total_tokens," (",x.original.prompt_tokens," prompt tokens +"," ",x.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,f.pw)((null===(i=x.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,f.pw)(null===(o=x.original.metadata)||void 0===o?void 0:o.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,f.pw)(x.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:x.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===(d=x.original.metadata)||void 0===d?void 0:d.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(c=x.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:x.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:x.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:[x.original.duration," s."]})]})]})]})]}),(0,t.jsx)(L,{show:!v&&!b}),(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden",children:(0,t.jsx)(_,{row:x,hasMessages:v,hasResponse:b,hasError:p,errorInfo:j,getRawRequest:()=>{var e;return(null===(e=x.original)||void 0===e?void 0:e.proxy_server_request)?h(x.original.proxy_server_request):h(x.original.messages)},formattedResponse:()=>p&&j?{error:{message:j.error_message||"An error occurred",type:j.error_class||"error",code:j.error_code||"unknown",param:null}}:h(x.original.response)})}),k&&(0,t.jsx)(G,{data:N}),y&&(0,t.jsx)(F,{data:g.vector_store_request_metadata}),p&&j&&(0,t.jsx)(S,{errorInfo:j}),x.original.request_tags&&Object.keys(x.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(x.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)})})})]}),x.original.metadata&&Object.keys(x.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(x.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(x.original.metadata,null,2)})})]})]})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3801],{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:d,initialValues:m={},buttonLabel:u="Filters"}=e,[x,h]=(0,l.useState)(!1),[g,p]=(0,l.useState)(m),[f,j]=(0,l.useState)({}),[v,b]=(0,l.useState)({}),[y,N]=(0,l.useState)({}),[w,k]=(0,l.useState)({}),_=(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);j(e=>({...e,[s.name]:a}))}catch(e){console.error("Error searching:",e),j(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})),k(s=>({...s,[e.name]:!0}));try{let s=await e.searchFn("");j(a=>({...a,[e.name]:s}))}catch(s){console.error("Error loading initial options:",s),j(s=>({...s,[e.name]:[]}))}finally{b(s=>({...s,[e.name]:!1}))}}},[w]);(0,l.useEffect)(()=>{x&&s.forEach(e=>{e.isSearchable&&!w[e.name]&&S(e)})},[x,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)(o.Z,{className:"h-4 w-4"}),onClick:()=>h(!x),className:"flex items-center gap-2",children:u}),(0,t.jsx)(r.ZP,{onClick:()=>{let e={};s.forEach(s=>{e[s.name]=""}),p(e),d()},children:"Reset Filters"})]}),x&&(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","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&&_(e,a)},filterOption:!1,loading:v[a.name],options:f[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})})]})}},33801:function(e,s,a){a.d(s,{I:function(){return eg},Z:function(){return eh}});var t=a(57437),l=a(77398),r=a.n(l),n=a(11713),i=a(2265),o=a(29827),d=a(19250),c=a(12322),m=a(42673),u=a(99981);let x=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"}},h=e=>{let{utcTime:s}=e;return(0,t.jsx)("span",{style:{fontFamily:"monospace",width:"180px",display:"inline-block"},children:x(s)})};var g=a(41649),p=a(78489),f=a(59872);let j=(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,m.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)(h,{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)(u.Z,{title:String(e.getValue()||""),children:(0,t.jsx)(p.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)(u.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.jsxs)("span",{children:["$",(0,f.pw)(e.getValue()||0,6)]})},{header:"Duration (s)",accessorKey:"duration",cell:e=>(0,t.jsx)(u.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)(u.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)(u.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)(u.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:j(s,a),alt:"",className:"w-4 h-4",onError:e=>{e.target.style.display="none"}}),(0,t.jsx)(u.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)(u.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)(u.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)(u.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)(g.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)(h,{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)(u.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)(u.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,d.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),k=a(86669);function _(e){let{row:s,hasMessages:a,hasResponse:l,hasError:r,errorInfo:n,getRawRequest:i,formattedResponse:o}=e,d=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 d(JSON.stringify(i(),null,2))?w.Z.success("Request copied to clipboard"):w.Z.fromBackend("Failed to copy request")},m=async()=>{await d(JSON.stringify(o(),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)(k.gc,{data:i(),style:k.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)(k.gc,{data:o(),style:k.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,o]=i.useState(!1),d=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(),o=i.split("\n"),d="";return o.length>1&&(d=o[o.length-1].trim()),{filePath:a,fileName:l,lineNumber:t,code:d,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(o(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:()=>d(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 M=a(94292),T=a(12514),E=a(35829),D=a(84264),A=a(96761),I=a(77331),R=a(5545),O=a(30401),H=a(78867);let q=e=>{let{sessionId:s,logs:a,onBack:l}=e,[r,n]=(0,i.useState)(null),[o,d]=(0,i.useState)({}),m=a.reduce((e,s)=>e+(s.spend||0),0),x=a.reduce((e,s)=>e+(s.total_tokens||0),0),h=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),g=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),j=x+h+g,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,f.vQ)(e)&&(d(e=>({...e,[s]:!0})),setTimeout(()=>{d(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)(p.Z,{icon:I.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:o["session-id"]?(0,t.jsx)(O.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(o["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)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Requests"}),(0,t.jsx)(E.Z,{children:a.length})]}),(0,t.jsxs)(T.Z,{children:[(0,t.jsx)(D.Z,{children:"Total Cost"}),(0,t.jsxs)(E.Z,{children:["$",(0,f.pw)(m,6)]})]}),(0,t.jsx)(u.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,f.pw)(a.reduce((e,s)=>e+(s.prompt_tokens||0),0))})]}),h>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,f.pw)(h)})]}),g>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,f.pw)(g)})]})]})]}),(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,f.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,f.pw)(j)})]})})]})]}),placement:"top",overlayStyle:{minWidth:"300px"},children:(0,t.jsxs)(T.Z,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(D.Z,{children:"Total Tokens"}),(0,t.jsx)("span",{className:"text-gray-400 text-sm",children:"ⓘ"})]}),(0,t.jsx)(E.Z,{children:(0,f.pw)(j)})]})})]}),(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:eg,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 o=e=>new Date(1e3*e).toLocaleString(),d=(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,m.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:o(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:o(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:d(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 Y=e=>e>=.8?"text-green-600":"text-yellow-600";var K=e=>{let{entities:s}=e,[a,l]=(0,i.useState)(!0),[r,n]=(0,i.useState)({}),o=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:()=>o(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(Y(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:Y(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"),U=e=>{let{title:s,count:a,defaultOpen:l=!0,right:r,children:n}=e,[o,d]=(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:()=>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(o?"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})]}),o&&(0,t.jsx)("div",{className:"p-3 border-t bg-white",children:n})]})},V=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})]})},B=()=>(0,t.jsx)("div",{className:"my-3 border-t"});var W=e=>{var s,a,l,r,n,i,o,d,c,m;let{response:u}=e;if(!u)return null;let x=null!==(n=null!==(r=u.outputs)&&void 0!==r?r:u.output)&&void 0!==n?n:[],h="GUARDRAIL_INTERVENED"===u.action?"red":"green",g=(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(null===(s=u.guardrailCoverage)||void 0===s?void 0:s.textCharacters)&&P("text guarded ".concat(null!==(i=u.guardrailCoverage.textCharacters.guarded)&&void 0!==i?i:0,"/").concat(null!==(o=u.guardrailCoverage.textCharacters.total)&&void 0!==o?o:0),"blue"),(null===(a=u.guardrailCoverage)||void 0===a?void 0:a.images)&&P("images guarded ".concat(null!==(d=u.guardrailCoverage.images.guarded)&&void 0!==d?d:0,"/").concat(null!==(c=u.guardrailCoverage.images.total)&&void 0!==c?c:0),"blue")]}),p=u.usage&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(u.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)(V,{label:"Action:",children:P(null!==(m=u.action)&&void 0!==m?m:"N/A",h)}),u.actionReason&&(0,t.jsx)(V,{label:"Action Reason:",children:u.actionReason}),u.blockedResponse&&(0,t.jsx)(V,{label:"Blocked Response:",children:(0,t.jsx)("span",{className:"italic",children:u.blockedResponse})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{label:"Coverage:",children:g}),(0,t.jsx)(V,{label:"Usage:",children:p})]})]}),x.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{}),(0,t.jsx)("h4",{className:"font-medium mb-2",children:"Outputs"}),(0,t.jsx)("div",{className:"space-y-2",children:x.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=u.assessments)||void 0===l?void 0:l.length)?(0,t.jsx)("div",{className:"space-y-3",children:u.assessments.map((e,s)=>{var a,l,r,n,i,o,d,c,m,u,x,h,g,p,f,j,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)(U,{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!==(j=null===(l=e.wordPolicy.customWords)||void 0===l?void 0:l.length)&&void 0!==j?j:0)>0&&(0,t.jsx)(U,{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)(U,{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===(d=e.contextualGroundingPolicy)||void 0===d?void 0:null===(o=d.filters)||void 0===o?void 0:o.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)(U,{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)(U,{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===(x=e.topicPolicy)||void 0===x?void 0:null===(u=x.topics)||void 0===u?void 0:u.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)(U,{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)(V,{label:"Latency (ms)",children:null!==(N=e.invocationMetrics.guardrailProcessingLatency)&&void 0!==N?N:"—"}),(0,t.jsx)(V,{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!==(k=e.invocationMetrics.guardrailCoverage.textCharacters.total)&&void 0!==k?k:0),"blue"),(null===(g=e.invocationMetrics.guardrailCoverage)||void 0===g?void 0:g.images)&&P("images ".concat(null!==(_=e.invocationMetrics.guardrailCoverage.images.guarded)&&void 0!==_?_: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)(V,{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===(f=e.automatedReasoningPolicy)||void 0===f?void 0:null===(p=f.findings)||void 0===p?void 0:p.length)?(0,t.jsx)(U,{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)(U,{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(u,null,2)})})]})};let z=e=>new Date(1e3*e).toLocaleString(),J=e=>{var s,a;let{entry:l,index:r,total:n}=e,i=null!==(s=l.guardrail_provider)&&void 0!==s?s:"presidio",o=null!==(a=l.guardrail_status)&&void 0!==a?a:"unknown",d="success"===o.toLowerCase(),c=l.masked_entity_count||{},m=Object.values(c).reduce((e,s)=>e+("number"==typeof s?s:0),0),x=l.guardrail_response,h=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)(u.Z,{title:d?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(d?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o})})]})]}),(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:z(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:z(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&&h.length>0&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(K,{entities:h})}),"bedrock"===i&&g&&(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(W,{response:g})})]})};var G=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"),o=Array.from(new Set(a.map(e=>e.guardrail_status))).every(e=>"success"===(null!=e?e:"").toLowerCase()),d=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)(u.Z,{title:o?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(o?"bg-green-100 text-green-800":"bg-red-100 text-red-800 cursor-help"),children:o?"success":"failure"})}),(0,t.jsx)("span",{className:"ml-2 font-mono text-sm text-gray-600",children:n}),d>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:[d," masked ",1===d?"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)(J,{entry:e,index:s,total:a.length},"".concat(null!==(l=e.guardrail_name)&&void 0!==l?l:"guardrail","-").concat(s))})})]})},Q=a(23048),$=a(30841),X=a(7310),ee=a.n(X),es=a(12363);let ea={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"};var et=a(59341),el=a(12485),er=a(18135),en=a(35242),ei=a(29706),eo=a(77991),ed=a(92280);let ec="".concat("../ui/assets/","audit-logs-preview.png");function em(e){let{userID:s,userRole:a,token:l,accessToken:o,isActive:m,premiumUser:u,allTeams:x}=e,[h,g]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),p=(0,i.useRef)(null),j=(0,i.useRef)(null),[v,b]=(0,i.useState)(1),[N]=(0,i.useState)(50),[w,k]=(0,i.useState)({}),[_,S]=(0,i.useState)(""),[C,L]=(0,i.useState)(""),[M,T]=(0,i.useState)(""),[E,D]=(0,i.useState)("all"),[A,I]=(0,i.useState)("all"),[R,O]=(0,i.useState)(!1),[H,q]=(0,i.useState)(!1),F=(0,n.a)({queryKey:["all_audit_logs",o,l,a,s,h],queryFn:async()=>{if(!o||!l||!a||!s)return[];let e=r()(h).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,d.uiAuditLogsCall)(o,e,t,i,50);n=n.concat(s.audit_logs),c=s.total_pages,i++}while(i<=c);return n},enabled:!!o&&!!l&&!!a&&!!s&&m,refetchInterval:5e3,refetchIntervalInBackground:!0}),Y=(0,i.useCallback)(async e=>{if(o)try{let s=(await (0,d.keyListCall)(o,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("")}},[o]);(0,i.useEffect)(()=>{if(!o)return;let e=!1,s=!1;w["Team ID"]?_!==w["Team ID"]&&(S(w["Team ID"]),e=!0):""!==_&&(S(""),e=!0),w["Key Hash"]?C!==w["Key Hash"]&&(L(w["Key Hash"]),s=!0):w["Key Alias"]?Y(w["Key Alias"]):""!==C&&(L(""),s=!0),(e||s)&&b(1)},[w,o,Y,_,C]),(0,i.useEffect)(()=>{b(1)},[_,C,h,M,E,A]),(0,i.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&O(!1),j.current&&!j.current.contains(e.target)&&q(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let K=(0,i.useMemo)(()=>F.data?F.data.filter(e=>{var s,a,t,l,r,n,i;let o=!0,d=!0,c=!0,m=!0,u=!0;if(_){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;o=r===_||n===_}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;d="string"==typeof t&&t.includes(C)||"string"==typeof l&&l.includes(C)}catch(e){d=!1}if(M&&(c=null===(r=e.object_id)||void 0===r?void 0:r.toLowerCase().includes(M.toLowerCase())),"all"!==E&&(m=(null===(n=e.action)||void 0===n?void 0:n.toLowerCase())===E.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}u=(null===(i=e.table_name)||void 0===i?void 0:i.toLowerCase())===s}return o&&d&&c&&m&&u}):[],[F.data,_,C,M,E,A]),P=K.length,Z=Math.ceil(P/N)||1,U=(0,i.useMemo)(()=>{let e=(v-1)*N,s=e+N;return K.slice(e,s)},[K,v,N]),V=!F.data||0===F.data.length,B=(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)(ed.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,f.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,f.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)(ed.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)})},o=a,d=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)}),o=Object.keys(e).length>0?e:{"No differing fields detected in 'before' state":"N/A"},d=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&&(o={"No fields changed":"N/A"},d={"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(o,"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(d,"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)(ed.x,{style:{display:"block",marginBottom:"10px"},children:"This is a LiteLLM Enterprise feature, and requires a valid key to use."}),(0,t.jsx)(ed.x,{style:{display:"block",marginBottom:"20px",fontStyle:"italic"},children:"Here's a preview of what Audit Logs offer:"}),(0,t.jsx)("img",{src:ec,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:V}),(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:M,onChange:e=>T(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:p,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:()=>O(!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"===E&&"All Actions","created"===E&&"Created","updated"===E&&"Updated","deleted"===E&&"Deleted","rotated"===E&&"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(E===e.value?"bg-blue-50 text-blue-600 font-medium":"font-normal"),onClick:()=>{D(e.value),O(!1)},children:e.label},e.value))})})]}),(0,t.jsxs)("div",{className:"relative",ref:j,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:()=>q(!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:()=>{I(e.value),q(!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:U,renderSubComponent:B,getRowCanExpand:()=>!0})]})]})}let eu=(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 ex=a(9309);function eh(e){var s,a,l;let{accessToken:m,token:u,userRole:x,userID:h,allTeams:g,premiumUser:p}=e,[f,j]=(0,i.useState)(""),[b,y]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[_,S]=(0,i.useState)(1),[L]=(0,i.useState)(50),T=(0,i.useRef)(null),E=(0,i.useRef)(null),D=(0,i.useRef)(null),[A,I]=(0,i.useState)(r()().subtract(24,"hours").format("YYYY-MM-DDTHH:mm")),[R,O]=(0,i.useState)(r()().format("YYYY-MM-DDTHH:mm")),[H,F]=(0,i.useState)(!1),[Y,K]=(0,i.useState)(!1),[P,Z]=(0,i.useState)(""),[U,V]=(0,i.useState)(""),[B,W]=(0,i.useState)(""),[z,J]=(0,i.useState)(""),[G,X]=(0,i.useState)(""),[ed,ec]=(0,i.useState)(null),[ex,eh]=(0,i.useState)(null),[ep,ef]=(0,i.useState)(""),[ej,ev]=(0,i.useState)(""),[eb,ey]=(0,i.useState)(x&&C.lo.includes(x)),[eN,ew]=(0,i.useState)("request logs"),[ek,e_]=(0,i.useState)(null),[eS,eC]=(0,i.useState)(null),eL=(0,o.NL)(),[eM,eT]=(0,i.useState)(()=>{let e=sessionStorage.getItem("isLiveTail");return null===e||JSON.parse(e)});(0,i.useEffect)(()=>{sessionStorage.setItem("isLiveTail",JSON.stringify(eM))},[eM]);let[eE,eD]=(0,i.useState)({value:24,unit:"hours"});(0,i.useEffect)(()=>{(async()=>{ex&&m&&ec({...(await (0,d.keyInfoV1Call)(m,ex)).info,token:ex,api_key:ex})})()},[ex,m]),(0,i.useEffect)(()=>{function e(e){T.current&&!T.current.contains(e.target)&&k(!1),E.current&&!E.current.contains(e.target)&&y(!1),D.current&&!D.current.contains(e.target)&&K(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,i.useEffect)(()=>{x&&C.lo.includes(x)&&ey(!0)},[x]);let eA=(0,n.a)({queryKey:["logs","table",_,L,A,R,B,z,eb?h:null,ep,G],queryFn:async()=>{if(!m||!u||!x||!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,d.uiSpendLogsCall)(m,z||void 0,B||void 0,void 0,e,s,_,L,eb?h:void 0,ej,ep,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&&!!u&&!!x&&!!h&&"request logs"===eN,refetchInterval:!!eM&&1===_&&15e3,refetchIntervalInBackground:!0}),{filters:eI,filteredLogs:eR,allTeams:eO,allKeyAliases:eH,handleFilterChange:eq,handleFilterReset:eF}=function(e){let{logs:s,accessToken:a,startTime:t,endTime:l,pageSize:o=es.d,isCustomDate:c,setCurrentPage:m,userID:u,userRole:x}=e,h=(0,i.useMemo)(()=>({[ea.TEAM_ID]:"",[ea.KEY_HASH]:"",[ea.REQUEST_ID]:"",[ea.MODEL]:"",[ea.USER_ID]:"",[ea.END_USER]:"",[ea.STATUS]:"",[ea.KEY_ALIAS]:""}),[]),[g,p]=(0,i.useState)(h),[f,j]=(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,d.uiSpendLogsCall)(a,e[ea.KEY_HASH]||void 0,e[ea.TEAM_ID]||void 0,e[ea.REQUEST_ID]||void 0,i,m,s,o,e[ea.USER_ID]||void 0,e[ea.END_USER]||void 0,e[ea.STATUS]||void 0,e[ea.MODEL]||void 0,e[ea.KEY_ALIAS]||void 0);n===v.current&&t.data&&j(t)}catch(e){console.error("Error searching users:",e)}},[a,t,l,c,o]),y=(0,i.useMemo)(()=>ee()((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,$.LO)(a)},enabled:!!a}).data||[],w=(0,i.useMemo)(()=>!!(g[ea.KEY_ALIAS]||g[ea.KEY_HASH]||g[ea.REQUEST_ID]||g[ea.USER_ID]||g[ea.END_USER]),[g]),k=(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[ea.TEAM_ID]&&(e=e.filter(e=>e.team_id===g[ea.TEAM_ID])),g[ea.STATUS]&&(e=e.filter(e=>"success"===g[ea.STATUS]?!e.status||"success"===e.status:e.status===g[ea.STATUS])),g[ea.MODEL]&&(e=e.filter(e=>e.model===g[ea.MODEL])),g[ea.KEY_HASH]&&(e=e.filter(e=>e.api_key===g[ea.KEY_HASH])),g[ea.END_USER]&&(e=e.filter(e=>e.end_user===g[ea.END_USER])),{data:e,total:s.total,page:s.page,page_size:s.page_size,total_pages:s.total_pages}},[s,g,w]),_=(0,i.useMemo)(()=>w?f&&f.data&&f.data.length>0?f:s||{data:[],total:0,page:1,page_size:50,total_pages:0}:k,[w,f,k,s]),{data:S}=(0,n.a)({queryKey:["allTeamsForLogFilters",a],queryFn:async()=>a&&await (0,$.IE)(a)||[],enabled:!!a});return{filters:g,filteredLogs:_,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),j({data:[],total:0,page:1,page_size:50,total_pages:0}),y(h,1)}}}({logs:eA.data||{data:[],total:0,page:1,page_size:L||10,total_pages:1},accessToken:m,startTime:A,endTime:R,pageSize:L,isCustomDate:H,setCurrentPage:S,userID:h,userRole:x}),eY=(0,i.useCallback)(async e=>{if(m)try{let s=(await (0,d.keyListCall)(m,null,null,e,null,null,_,L)).keys.find(s=>s.key_alias===e);s&&J(s.token)}catch(e){console.error("Error fetching key hash for alias:",e)}},[m,_,L]);(0,i.useEffect)(()=>{m&&(eI["Team ID"]?W(eI["Team ID"]):W(""),ef(eI.Status||""),X(eI.Model||""),ev(eI["End User"]||""),eI["Key Hash"]?J(eI["Key Hash"]):eI["Key Alias"]?eY(eI["Key Alias"]):J(""))},[eI,m,eY]);let eK=(0,n.a)({queryKey:["sessionLogs",eS],queryFn:async()=>{if(!m||!eS)return{data:[],total:0,page:1,page_size:50,total_pages:1};let e=await (0,d.sessionSpendLogsCall)(m,eS);return{data:e.data||e||[],total:(e.data||e||[]).length,page:1,page_size:1e3,total_pages:1}},enabled:!!m&&!!eS});if((0,i.useEffect)(()=>{var e;(null===(e=eA.data)||void 0===e?void 0:e.data)&&ek&&!eA.data.data.some(e=>e.request_id===ek)&&e_(null)},[null===(s=eA.data)||void 0===s?void 0:s.data,ek]),!m||!u||!x||!h)return null;let eP=eR.data.filter(e=>!f||e.request_id.includes(f)||e.model.includes(f)||e.user&&e.user.includes(f)).map(e=>({...e,duration:(Date.parse(e.endTime)-Date.parse(e.startTime))/1e3,onKeyHashClick:e=>eh(e),onSessionClick:e=>{e&&eC(e)}}))||[],eZ=(null===(l=eK.data)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:a.map(e=>({...e,onKeyHashClick:e=>eh(e),onSessionClick:e=>{}})))||[],eU=[{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,$.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,d.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:"Key Hash",label:"Key Hash",isSearchable:!1}];if(eS&&eK.data)return(0,t.jsx)("div",{className:"w-full p-6",children:(0,t.jsx)(q,{sessionId:eS,logs:eK.data.data,onBack:()=>eC(null)})});let eV=[{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"}],eB=eV.find(e=>e.value===eE.value&&e.unit===eE.unit),eW=H?eu(H,A,R):null==eB?void 0:eB.label;return(0,t.jsx)("div",{className:"w-full max-w-screen p-6 overflow-x-hidden box-border",children:(0,t.jsxs)(er.Z,{defaultIndex:0,onIndexChange:e=>ew(0===e?"request logs":"audit logs"),children:[(0,t.jsxs)(en.Z,{children:[(0,t.jsx)(el.Z,{children:"Request Logs"}),(0,t.jsx)(el.Z,{children:"Audit Logs"})]}),(0,t.jsxs)(eo.Z,{children:[(0,t.jsxs)(ei.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:eS?(0,t.jsxs)(t.Fragment,{children:["Session: ",(0,t.jsx)("span",{className:"font-mono",children:eS}),(0,t.jsx)("button",{className:"ml-4 px-3 py-1 text-sm border rounded hover:bg-gray-50",onClick:()=>eC(null),children:"← Back to All Logs"})]}):"Request Logs"})}),ed&&ex&&ed.api_key===ex?(0,t.jsx)(M.Z,{keyId:ex,keyData:ed,accessToken:m,userID:h,userRole:x,teams:g,onClose:()=>eh(null),premiumUser:p,backButtonText:"Back to Logs"}):eS?(0,t.jsx)("div",{className:"bg-white rounded-lg shadow",children:(0,t.jsx)(c.w,{columns:v,data:eZ,renderSubComponent:eg,getRowCanExpand:()=>!0})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Q.Z,{options:eU,onApplyFilters:eq,onResetFilters:eF}),(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:f,onChange:e=>j(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:D,children:[(0,t.jsxs)("button",{onClick:()=>K(!Y),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"})}),eW]}),Y&&(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:[eV.map(e=>(0,t.jsx)("button",{className:"w-full px-3 py-2 text-left text-sm hover:bg-gray-50 rounded-md ".concat(eW===e.label?"bg-blue-50 text-blue-600":""),onClick:()=>{O(r()().format("YYYY-MM-DDTHH:mm")),I(r()().subtract(e.value,e.unit).format("YYYY-MM-DDTHH:mm")),eD({value:e.value,unit:e.unit}),F(!1),K(!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)(et.Z,{color:"green",checked:eM,defaultChecked:!0,onChange:eT})]}),{}),(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=>{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.jsx)("span",{className:"text-gray-500",children:"to"}),(0,t.jsx)("div",{children:(0,t.jsx)("input",{type:"datetime-local",value:R,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.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?"...":eR?(_-1)*L+1:0," -"," ",eA.isLoading?"...":eR?Math.min(_*L,eR.total):0," ","of ",eA.isLoading?"...":eR?eR.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?"...":_," of"," ",eA.isLoading?"...":eR?eR.total_pages:1]}),(0,t.jsx)("button",{onClick:()=>S(e=>Math.max(1,e-1)),disabled:eA.isLoading||1===_,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(eR.total_pages||1,e+1)),disabled:eA.isLoading||_===(eR.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"})]})]})]})}),eM&&1===_&&(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:()=>eT(!1),className:"text-sm text-green-600 hover:text-green-800",children:"Stop"})]}),(0,t.jsx)(c.w,{columns:v,data:eP,renderSubComponent:eg,getRowCanExpand:()=>!0})]})]})]}),(0,t.jsx)(ei.Z,{children:(0,t.jsx)(em,{userID:h,userRole:x,token:u,accessToken:m,isActive:"audit logs"===eN,premiumUser:p,allTeams:g})})]})]})})}function eg(e){var s,a,l,r,n,i,o,d,c,m;let{row:x}=e,h=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){}return e},g=x.original.metadata||{},p="failure"===g.status,j=p?g.error_information:null,v=x.original.messages&&(Array.isArray(x.original.messages)?x.original.messages.length>0:Object.keys(x.original.messages).length>0),b=x.original.response&&Object.keys(h(x.original.response)).length>0,y=g.vector_store_request_metadata&&Array.isArray(g.vector_store_request_metadata)&&g.vector_store_request_metadata.length>0,N=null===(s=x.original.metadata)||void 0===s?void 0:s.guardrail_information,w=Array.isArray(N)?N:N?[N]:[],k=w.length>0,C=w.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),M=1===w.length?null!==(m=null===(a=w[0])||void 0===a?void 0:a.guardrail_name)&&void 0!==m?m:"-":w.length>1?"".concat(w.length," guardrails"):"-",T=(0,ex.aS)(x.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:"}),x.original.request_id.length>64?(0,t.jsx)(u.Z,{title:x.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:x.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:x.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:x.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:x.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:x.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)(u.Z,{title:x.original.api_base||"-",children:(0,t.jsx)("span",{className:"max-w-[15ch] truncate block",children:x.original.api_base||"-"})})]}),(null==x?void 0:null===(l=x.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==x?void 0:null===(r=x.original)||void 0===r?void 0:r.requester_ip_address})]}),k&&(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:M}),C>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:[C," 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:[x.original.total_tokens," (",x.original.prompt_tokens," prompt tokens +"," ",x.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,f.pw)((null===(i=x.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,f.pw)(null===(o=x.original.metadata)||void 0===o?void 0:o.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,f.pw)(x.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:x.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===(d=x.original.metadata)||void 0===d?void 0:d.status)||"Success").toLowerCase()?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:"failure"!==((null===(c=x.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:x.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:x.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:[x.original.duration," s."]})]})]})]})]}),(0,t.jsx)(L,{show:!v&&!b}),(0,t.jsx)("div",{className:"w-full max-w-full overflow-hidden",children:(0,t.jsx)(_,{row:x,hasMessages:v,hasResponse:b,hasError:p,errorInfo:j,getRawRequest:()=>{var e;return(null===(e=x.original)||void 0===e?void 0:e.proxy_server_request)?h(x.original.proxy_server_request):h(x.original.messages)},formattedResponse:()=>p&&j?{error:{message:j.error_message||"An error occurred",type:j.error_class||"error",code:j.error_code||"unknown",param:null}}:h(x.original.response)})}),k&&(0,t.jsx)(G,{data:N}),y&&(0,t.jsx)(F,{data:g.vector_store_request_metadata}),p&&j&&(0,t.jsx)(S,{errorInfo:j}),x.original.request_tags&&Object.keys(x.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(x.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)})})})]}),x.original.metadata&&Object.keys(x.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(x.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(x.original.metadata,null,2)})})]})]})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/3881-fb9362275df4cfb8.js b/litellm/proxy/_experimental/out/_next/static/chunks/3881-fb9362275df4cfb8.js new file mode 100644 index 0000000000..dc34278e2a --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/3881-fb9362275df4cfb8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3881],{2894:function(t,e,s){s.d(e,{R:function(){return u},m:function(){return n}});var i=s(18238),r=s(7989),a=s(11255),n=class extends r.F{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||u(),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.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,a.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#r({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#r({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)e();else{this.#r({type:"pending",variables:t,isPaused:r}),await this.#s.config.onMutate?.(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#r({type:"pending",context:e,variables:t,isPaused:r})}let a=await this.#i.start();return await this.#s.config.onSuccess?.(a,t,this.state.context,this,s),await this.options.onSuccess?.(a,t,this.state.context,s),await this.#s.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,t,this.state.context,s),this.#r({type:"success",data:a}),a}catch(e){try{throw await this.#s.config.onError?.(e,t,this.state.context,this,s),await this.options.onError?.(e,t,this.state.context,s),await this.#s.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(void 0,e,t,this.state.context,s),e}finally{this.#r({type:"error",error:e})}}finally{this.#s.runNext(this)}}#r(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),i.Vr.batch(()=>{this.#e.forEach(e=>{e.onMutationUpdate(t)}),this.#s.notify({mutation:this,type:"updated",action:t})})}};function u(){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,s){s.d(e,{S:function(){return y}});var i=s(45345),r=s(21733),a=s(18238),n=s(24112),u=class extends n.l{constructor(t={}){super(),this.config=t,this.#a=new Map}#a;build(t,e,s){let a=e.queryKey,n=e.queryHash??(0,i.Rm)(a,e),u=this.get(n);return u||(u=new r.A({client:t,queryKey:a,queryHash:n,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}add(t){this.#a.has(t.queryHash)||(this.#a.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#a.get(t.queryHash);e&&(t.destroy(),e===t&&this.#a.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){a.Vr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#a.get(t)}getAll(){return[...this.#a.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i._x)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,i._x)(t,e)):e}notify(t){a.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){a.Vr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){a.Vr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},o=s(2894),h=class extends n.l{constructor(t={}){super(),this.config=t,this.#n=new Set,this.#u=new Map,this.#o=0}#n;#u;#o;build(t,e,s){let i=new o.m({client:t,mutationCache:this,mutationId:++this.#o,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#n.add(t);let e=c(t);if("string"==typeof e){let s=this.#u.get(e);s?s.push(t):this.#u.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#n.delete(t)){let e=c(t);if("string"==typeof e){let s=this.#u.get(e);if(s){if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#u.delete(e)}}}this.notify({type:"removed",mutation:t})}canRun(t){let e=c(t);if("string"!=typeof e)return!0;{let s=this.#u.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=c(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#u.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){a.Vr.batch(()=>{this.#n.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#n.clear(),this.#u.clear()})}getAll(){return Array.from(this.#n)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i.X7)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,i.X7)(t,e))}notify(t){a.Vr.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return a.Vr.batch(()=>Promise.all(t.map(t=>t.continue().catch(i.ZT))))}};function c(t){return t.options.scope?.id}var l=s(87045),d=s(57853);function f(t){return{onFetch:(e,s)=>{let r=e.options,a=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],u=e.state.data?.pageParams||[],o={pages:[],pageParams:[]},h=0,c=async()=>{let s=!1,c=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)})},l=(0,i.cG)(e.options,e.fetchOptions),d=async(t,r,a)=>{if(s)return Promise.reject();if(null==r&&t.pages.length)return Promise.resolve(t);let n=(()=>{let t={client:e.client,queryKey:e.queryKey,pageParam:r,direction:a?"backward":"forward",meta:e.options.meta};return c(t),t})(),u=await l(n),{maxPages:o}=e.options,h=a?i.Ht:i.VX;return{pages:h(t.pages,u,o),pageParams:h(t.pageParams,r,o)}};if(a&&n.length){let t="backward"===a,e={pages:n,pageParams:u},s=(t?function(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}:p)(r,e);o=await d(e,s,t)}else{let e=t??n.length;do{let t=0===h?u[0]??r.initialPageParam:p(r,o);if(h>0&&null==t)break;o=await d(o,t),h++}while(he.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=c}}}function p(t,{pages:e,pageParams:s}){let i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}var y=class{#h;#s;#c;#l;#d;#f;#p;#y;constructor(t={}){this.#h=t.queryCache||new u,this.#s=t.mutationCache||new h,this.#c=t.defaultOptions||{},this.#l=new Map,this.#d=new Map,this.#f=0}mount(){this.#f++,1===this.#f&&(this.#p=l.j.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onFocus())}),this.#y=d.N.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#h.onOnline())}))}unmount(){this.#f--,0===this.#f&&(this.#p?.(),this.#p=void 0,this.#y?.(),this.#y=void 0)}isFetching(t){return this.#h.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#s.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#h.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime((0,i.KC)(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#h.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.defaultQueryOptions({queryKey:t}),a=this.#h.get(r.queryHash),n=a?.state.data,u=(0,i.SE)(e,n);if(void 0!==u)return this.#h.build(this,r).setData(u,{...s,manual:!0})}setQueriesData(t,e,s){return a.Vr.batch(()=>this.#h.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#h.get(e.queryHash)?.state}removeQueries(t){let e=this.#h;a.Vr.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#h;return a.Vr.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all(a.Vr.batch(()=>this.#h.findAll(t).map(t=>t.cancel(s)))).then(i.ZT).catch(i.ZT)}invalidateQueries(t,e={}){return a.Vr.batch(()=>(this.#h.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 s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(a.Vr.batch(()=>this.#h.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(i.ZT)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(i.ZT)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#h.build(this,e);return s.isStaleByTime((0,i.KC)(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(i.ZT).catch(i.ZT)}fetchInfiniteQuery(t){return t.behavior=f(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(i.ZT).catch(i.ZT)}ensureInfiniteQueryData(t){return t.behavior=f(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return d.N.isOnline()?this.#s.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#h}getMutationCache(){return this.#s}getDefaultOptions(){return this.#c}setDefaultOptions(t){this.#c=t}setQueryDefaults(t,e){this.#l.set((0,i.Ym)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#l.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#d.set((0,i.Ym)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#d.values()],s={};return e.forEach(e=>{(0,i.to)(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#c.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,i.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===i.CN&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#c.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#h.clear(),this.#s.clear()}}},21770:function(t,e,s){s.d(e,{D:function(){return c}});var i=s(2265),r=s(2894),a=s(18238),n=s(24112),u=s(45345),o=class extends n.l{#t;#m=void 0;#g;#b;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#v()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,u.VS)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#g,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,u.Ym)(e.mutationKey)!==(0,u.Ym)(this.options.mutationKey)?this.reset():this.#g?.state.status==="pending"&&this.#g.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#g?.removeObserver(this)}onMutationUpdate(t){this.#v(),this.#C(t)}getCurrentResult(){return this.#m}reset(){this.#g?.removeObserver(this),this.#g=void 0,this.#v(),this.#C()}mutate(t,e){return this.#b=e,this.#g?.removeObserver(this),this.#g=this.#t.getMutationCache().build(this.#t,this.options),this.#g.addObserver(this),this.#g.execute(t)}#v(){let t=this.#g?.state??(0,r.R)();this.#m={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#C(t){a.Vr.batch(()=>{if(this.#b&&this.hasListeners()){let e=this.#m.variables,s=this.#m.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#b.onSuccess?.(t.data,e,s,i),this.#b.onSettled?.(t.data,null,e,s,i)):t?.type==="error"&&(this.#b.onError?.(t.error,e,s,i),this.#b.onSettled?.(void 0,t.error,e,s,i))}this.listeners.forEach(t=>{t(this.#m)})})}},h=s(29827);function c(t,e){let s=(0,h.NL)(e),[r]=i.useState(()=>new o(s,t));i.useEffect(()=>{r.setOptions(t)},[r,t]);let n=i.useSyncExternalStore(i.useCallback(t=>r.subscribe(a.Vr.batchCalls(t)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),c=i.useCallback((t,e)=>{r.mutate(t,e).catch(u.ZT)},[r]);if(n.error&&(0,u.L3)(r.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:c,mutateAsync:n.mutate}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/395-053deae1a24be648.js b/litellm/proxy/_experimental/out/_next/static/chunks/395-053deae1a24be648.js deleted file mode 100644 index e539be305f..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/395-053deae1a24be648.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[395],{34310:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},38434:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},3632:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},35291:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},79205:function(e,t,r){"use strict";r.d(t,{Z:function(){return f}});var n=r(2265);let i=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),o=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},a=function(){for(var e=arguments.length,t=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},u=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 l=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:l="",children:f,iconNode:h,...d}=e;return(0,n.createElement)("svg",{ref:t,...c,width:i,height:i,stroke:r,strokeWidth:o?24*Number(s)/Number(i):s,className:a("lucide",l),...!f&&!u(d)&&{"aria-hidden":"true"},...d},[...h.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(f)?f:[f]])}),f=(e,t)=>{let r=(0,n.forwardRef)((r,s)=>{let{className:u,...c}=r;return(0,n.createElement)(l,{ref:s,iconNode:t,className:a("lucide-".concat(i(o(e))),"lucide-".concat(e),u),...c})});return r.displayName=o(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"}]])},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,s={},o=0,a={};function u(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=v(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new d(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:s,workerId:a.WORKER_ID,finished:n});else if(k(this._config.chunk)&&!t){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=s=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!n||!k(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||s&&s.meta.paused||this._nextChunk(),s}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 c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=a.RemoteChunkSize),u.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=b(this._chunkLoaded,this),t.onerror=b(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 l(e){(e=e||{}).chunkSize||(e.chunkSize=a.LocalChunkSize),u.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=b(this._chunkLoaded,this),t.onerror=b(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 f(e){var t;u.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 h(e){u.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.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=b(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=b(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=b(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=b(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function d(e){var t,r,n,i,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,o=/^((\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)))$/,u=this,c=0,l=0,f=!1,h=!1,d=[],m={data:[],errors:[],meta:{}};function _(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(m&&n&&(w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(m.data=m.data.filter(function(e){return!_(e)})),b()){if(m){if(Array.isArray(m.data[0])){for(var t,r=0;b()&&r=d.length?"__parsed_extra":d[i]:a,c=u=e.transform?e.transform(u,a):u,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===c||"TRUE"===c||"false"!==c&&"FALSE"!==c&&((e=>{if(s.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(c)?parseFloat(c):o.test(c)?new Date(c):""===c?null:c):c);"__parsed_extra"===a?(n[a]=n[a]||[],n[a].push(u)):n[a]=u}return e.header&&(i>d.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+d.length+" fields but parsed "+i,l+r):ie.preview?r.abort():(m.data=m.data[0],i(m,u))))}),this.parse=function(i,s,o){var u=e.quoteChar||'"',u=(e.newline||(e.newline=this.guessLineEndings(i,u)),n=!1,e.delimiter?k(e.delimiter)&&(e.delimiter=e.delimiter(i),m.meta.delimiter=e.delimiter):((u=((t,r,n,i,s)=>{var o,u,c,l;s=s||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var f=0;f=r.length/2?"\r\n":"\r"}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){var t=(e=e||{}).delimiter,r=e.newline,n=e.comments,i=e.step,s=e.preview,o=e.fastMode,u=null,c=!1,l=null==e.quoteChar?'"':e.quoteChar,f=l;if(void 0!==e.escapeChar&&(f=e.escapeChar),("string"!=typeof t||-1=s)return F(!0);break}C.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:E.length,index:h}),T++}}else if(n&&0===O.length&&a.substring(h,h+b)===n){if(-1===L)return F();h=L+v,L=a.indexOf(r,h),j=a.indexOf(t,h)}else if(-1!==j&&(j=s)return F(!0)}return P();function D(e){E.push(e),R=h}function z(e){return -1!==e&&(e=a.substring(T+1,e))&&""===e.trim()?e.length:0}function P(e){return m||(void 0===e&&(e=a.substring(h)),O.push(e),h=_,D(O),w&&Z()),F()}function M(e){h=e,D(O),O=[],L=a.indexOf(r,h)}function F(n){if(e.header&&!g&&E.length&&!c){var i=E[0],s=Object.create(null),o=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||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(o=t.quoteChar),"boolean"==typeof t.header&&(n=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");l=t.columns}void 0!==t.escapeChar&&(u=t.escapeChar+o),t.escapeFormulae instanceof RegExp?f=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(f=/^[=+\-@\t\r].*$/)}})(),RegExp(p(o),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return d(null,e,c);if("object"==typeof e[0])return d(l||Object.keys(e[0]),e,c)}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||l),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])),d(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function d(e,t,r){var o="",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 s=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,o),n=i.default.Children.only(t);return i.default.cloneElement(n,c(c({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r{let t=n.useContext(s);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},a=e=>{let{client:t,children:r}=e;return n.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,i.jsx)(s.Provider,{value:t,children:r})}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/8541-04c822145b2301f8.js b/litellm/proxy/_experimental/out/_next/static/chunks/4073-c83ea30de699cedc.js similarity index 80% rename from litellm/proxy/_experimental/out/_next/static/chunks/8541-04c822145b2301f8.js rename to litellm/proxy/_experimental/out/_next/static/chunks/4073-c83ea30de699cedc.js index 42d2abebd5..df0ede750e 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/8541-04c822145b2301f8.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/4073-c83ea30de699cedc.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8541,5945],{45246:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},89245:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},78355:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},8881:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},3632:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},35291:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},59664:function(e,t,n){n.d(t,{Z:function(){return C}});var o=n(5853),a=n(2265),r=n(47625),i=n(93765),c=n(54061),l=n(97059),s=n(62994),d=n(25311),u=(0,i.z)({chartName:"LineChart",GraphicalChild:c.x,axisComponents:[{axisType:"xAxis",AxisComp:l.K},{axisType:"yAxis",AxisComp:s.B}],formatAxisMap:d.t9}),m=n(56940),b=n(26680),f=n(8147),p=n(22190),g=n(81889),h=n(65278),v=n(98593),y=n(92666),x=n(32644),k=n(7084),w=n(26898),O=n(13241),E=n(1153);let C=a.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:d,colors:C=w.s,valueFormatter:S=E.Cj,startEndOnly:j=!1,showXAxis:N=!0,showYAxis:z=!0,yAxisWidth:L=56,intervalType:T="equidistantPreserveStart",animationDuration:Z=900,showAnimation:P=!1,showTooltip:M=!0,showLegend:R=!0,showGridLines:I=!0,autoMinValue:B=!1,curveType:W="linear",minValue:D,maxValue:H,connectNulls:A=!1,allowDecimals:F=!0,noDataText:q,className:G,onValueChange:K,enableLegendSlider:V=!1,customTooltip:_,rotateLabelX:X,padding:Y=N||z?{left:20,right:20}:{left:0,right:0},tickGap:$=5,xAxisLabel:Q,yAxisLabel:U}=e,J=(0,o._T)(e,["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"]),[ee,et]=(0,a.useState)(60),[en,eo]=(0,a.useState)(void 0),[ea,er]=(0,a.useState)(void 0),ei=(0,x.me)(i,C),ec=(0,x.i4)(B,D,H),el=!!K;function es(e){el&&(e===ea&&!en||(0,x.FB)(n,e)&&en&&en.dataKey===e?(er(void 0),null==K||K(null)):(er(e),null==K||K({eventType:"category",categoryClicked:e})),eo(void 0))}return a.createElement("div",Object.assign({ref:t,className:(0,O.q)("w-full h-80",G)},J),a.createElement(r.h,{className:"h-full w-full"},(null==n?void 0:n.length)?a.createElement(u,{data:n,onClick:el&&(ea||en)?()=>{eo(void 0),er(void 0),null==K||K(null)}:void 0,margin:{bottom:Q?30:void 0,left:U?20:void 0,right:U?5:void 0,top:5}},I?a.createElement(m.q,{className:(0,O.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(l.K,{padding:Y,hide:!N,dataKey:d,interval:j?"preserveStartEnd":T,tick:{transform:"translate(0, 6)"},ticks:j?[n[0][d],n[n.length-1][d]]:void 0,fill:"",stroke:"",className:(0,O.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},Q&&a.createElement(b._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},Q)),a.createElement(s.B,{width:L,hide:!z,axisLine:!1,tickLine:!1,type:"number",domain:ec,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,O.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:S,allowDecimals:F},U&&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"},U)),a.createElement(f.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:o}=e;return _?a.createElement(_,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:k.fr.Gray})}),active:t,label:o}):a.createElement(v.ZP,{active:t,payload:n,label:o,valueFormatter:S,categoryColors:ei})}:a.createElement(a.Fragment,null),position:{y:0}}),R?a.createElement(p.D,{verticalAlign:"top",height:ee,content:e=>{let{payload:t}=e;return(0,h.Z)({payload:t},ei,et,ea,el?e=>es(e):void 0,V)}}):null,i.map(e=>{var t;return a.createElement(c.x,{className:(0,O.q)((0,E.bM)(null!==(t=ei.get(e))&&void 0!==t?t:k.fr.Gray,w.K.text).strokeColor),strokeOpacity:en||ea&&ea!==e?.3:1,activeDot:e=>{var t;let{cx:o,cy:r,stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,dataKey:d}=e;return a.createElement(g.o,{className:(0,O.q)("stroke-tremor-background dark:stroke-dark-tremor-background",K?"cursor-pointer":"",(0,E.bM)(null!==(t=ei.get(d))&&void 0!==t?t:k.fr.Gray,w.K.text).fillColor),cx:o,cy:r,r:5,fill:"",stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,onClick:(t,o)=>{o.stopPropagation(),el&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,x.FB)(n,e.dataKey)&&ea&&ea===e.dataKey?(er(void 0),eo(void 0),null==K||K(null)):(er(e.dataKey),eo({index:e.index,dataKey:e.dataKey}),null==K||K(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var o;let{stroke:r,strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,cx:s,cy:d,dataKey:u,index:m}=t;return(0,x.FB)(n,e)&&!(en||ea&&ea!==e)||(null==en?void 0:en.index)===m&&(null==en?void 0:en.dataKey)===e?a.createElement(g.o,{key:m,cx:s,cy:d,r:5,stroke:r,fill:"",strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,className:(0,O.q)("stroke-tremor-background dark:stroke-dark-tremor-background",K?"cursor-pointer":"",(0,E.bM)(null!==(o=ei.get(u))&&void 0!==o?o:k.fr.Gray,w.K.text).fillColor)}):a.createElement(a.Fragment,{key:m})},key:e,name:e,type:W,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:P,animationDuration:Z,connectNulls:A})}),K?i.map(e=>a.createElement(c.x,{className:(0,O.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:W,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:A,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;es(n)}})):null):a.createElement(y.Z,{noDataText:q})))});C.displayName="LineChart"},59341:function(e,t,n){n.d(t,{Z:function(){return Z}});var o=n(5853),a=n(71049),r=n(11323),i=n(2265),c=n(66797),l=n(40099),s=n(74275),d=n(59456),u=n(93980),m=n(65573),b=n(67561),f=n(87550),p=n(628),g=n(80281),h=n(31370),v=n(20131),y=n(38929),x=n(52307),k=n(52724),w=n(7935);let O=(0,i.createContext)(null);O.displayName="GroupContext";let E=i.Fragment,C=Object.assign((0,y.yV)(function(e,t){var n;let o=(0,i.useId)(),E=(0,g.Q)(),C=(0,f.B)(),{id:S=E||"headlessui-switch-".concat(o),disabled:j=C||!1,checked:N,defaultChecked:z,onChange:L,name:T,value:Z,form:P,autoFocus:M=!1,...R}=e,I=(0,i.useContext)(O),[B,W]=(0,i.useState)(null),D=(0,i.useRef)(null),H=(0,b.T)(D,t,null===I?null:I.setSwitch,W),A=(0,s.L)(z),[F,q]=(0,l.q)(N,L,null!=A&&A),G=(0,d.G)(),[K,V]=(0,i.useState)(!1),_=(0,u.z)(()=>{V(!0),null==q||q(!F),G.nextFrame(()=>{V(!1)})}),X=(0,u.z)(e=>{if((0,h.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),_()}),Y=(0,u.z)(e=>{e.key===k.R.Space?(e.preventDefault(),_()):e.key===k.R.Enter&&(0,v.g)(e.currentTarget)}),$=(0,u.z)(e=>e.preventDefault()),Q=(0,w.wp)(),U=(0,x.zH)(),{isFocusVisible:J,focusProps:ee}=(0,a.F)({autoFocus:M}),{isHovered:et,hoverProps:en}=(0,r.X)({isDisabled:j}),{pressed:eo,pressProps:ea}=(0,c.x)({disabled:j}),er=(0,i.useMemo)(()=>({checked:F,disabled:j,hover:et,focus:J,active:eo,autofocus:M,changing:K}),[F,et,J,eo,j,K,M]),ei=(0,y.dG)({id:S,ref:H,role:"switch",type:(0,m.f)(e,B),tabIndex:-1===e.tabIndex?0:null!=(n=e.tabIndex)?n:0,"aria-checked":F,"aria-labelledby":Q,"aria-describedby":U,disabled:j||void 0,autoFocus:M,onClick:X,onKeyUp:Y,onKeyPress:$},ee,en,ea),ec=(0,i.useCallback)(()=>{if(void 0!==A)return null==q?void 0:q(A)},[q,A]),el=(0,y.L6)();return i.createElement(i.Fragment,null,null!=T&&i.createElement(p.Mt,{disabled:j,data:{[T]:Z||"on"},overrides:{type:"checkbox",checked:F},form:P,onReset:ec}),el({ourProps:ei,theirProps:R,slot:er,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[n,o]=(0,i.useState)(null),[a,r]=(0,w.bE)(),[c,l]=(0,x.fw)(),s=(0,i.useMemo)(()=>({switch:n,setSwitch:o}),[n,o]),d=(0,y.L6)();return i.createElement(l,{name:"Switch.Description",value:c},i.createElement(r,{name:"Switch.Label",value:a,props:{htmlFor:null==(t=s.switch)?void 0:t.id,onClick(e){n&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},i.createElement(O.Provider,{value:s},d({ourProps:{},theirProps:e,slot:{},defaultTag:E,name:"Switch.Group"}))))},Label:w.__,Description:x.dk});var S=n(44140),j=n(26898),N=n(13241),z=n(1153),L=n(47187);let T=(0,z.fn)("Switch"),Z=i.forwardRef((e,t)=>{let{checked:n,defaultChecked:a=!1,onChange:r,color:c,name:l,error:s,errorMessage:d,disabled:u,required:m,tooltip:b,id:f}=e,p=(0,o._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:c?(0,z.bM)(c,j.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:c?(0,z.bM)(c,j.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[h,v]=(0,S.Z)(a,n),[y,x]=(0,i.useState)(!1),{tooltipProps:k,getReferenceProps:w}=(0,L.l)(300);return i.createElement("div",{className:"flex flex-row items-center justify-start"},i.createElement(L.Z,Object.assign({text:b},k)),i.createElement("div",Object.assign({ref:(0,z.lq)([t,k.refs.setReference]),className:(0,N.q)(T("root"),"flex flex-row relative h-5")},p,w),i.createElement("input",{type:"checkbox",className:(0,N.q)(T("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:l,required:m,checked:h,onChange:e=>{e.preventDefault()}}),i.createElement(C,{checked:h,onChange:e=>{v(e),null==r||r(e)},disabled:u,className:(0,N.q)(T("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",u?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:f},i.createElement("span",{className:(0,N.q)(T("sr-only"),"sr-only")},"Switch ",h?"on":"off"),i.createElement("span",{"aria-hidden":"true",className:(0,N.q)(T("background"),h?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")}),i.createElement("span",{"aria-hidden":"true",className:(0,N.q)(T("round"),h?(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",y?(0,N.q)("ring-2",g.ringColor):"")}))),s&&d?i.createElement("p",{className:(0,N.q)(T("errorMessage"),"text-sm text-red-500 mt-1 ")},d):null)});Z.displayName="Switch"},33866:function(e,t,n){n.d(t,{Z:function(){return P}});var o=n(2265),a=n(36760),r=n.n(a),i=n(66632),c=n(93350),l=n(19722),s=n(71744),d=n(93463),u=n(12918),m=n(18536),b=n(71140),f=n(99320);let p=new d.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=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}}),x=new d.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),k=e=>{let{componentCls:t,iconCls:n,antCls:o,badgeShadowSize:a,textFontSize:r,textFontSizeSM:i,statusSize:c,dotSize:l,textFontWeight:s,indicatorHeight:b,indicatorHeightSM:f,marginXS:k,calc:w}=e,O="".concat(o,"-scroll-number"),E=(0,m.Z)(e,(e,n)=>{let{darkColor:o}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:o,["&:not(".concat(t,"-count)")]:{color:o},"a:hover &":{background:o}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:b,height:b,color:e.badgeTextColor,fontWeight:s,fontSize:r,lineHeight:(0,d.bf)(b),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:w(b).div(2).equal(),boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").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:i,lineHeight:(0,d.bf)(f),borderRadius:w(f).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,d.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:l,minWidth:l,height:l,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(O,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,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:c,height:c,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:a,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:p,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:h,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(O,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(O,"-custom-component, ").concat(O)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[O]:{overflow:"hidden",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack),["".concat(O,"-only")]:{position:"relative",display:"inline-block",height:b,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(O,"-only-unit")]:{height:b,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(O,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(O,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},w=e=>{let{fontHeight:t,lineWidth:n,marginXS:o,colorBorderBg:a}=e,r=e.colorTextLightSolid,i=e.colorError,c=e.colorErrorHover;return(0,b.IX)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:r,badgeColor:i,badgeColorHover:c,badgeShadowColor:a,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},O=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:o,lineWidth:a}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*a,indicatorHeightSM:t,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}};var E=(0,f.I$)("Badge",e=>k(w(e)),O);let C=e=>{let{antCls:t,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:a,calc:r}=e,i="".concat(t,"-ribbon"),c=(0,m.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(i,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat(t,"-ribbon-wrapper")]:{position:"relative"},[i]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",top:o,padding:"0 ".concat((0,d.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,d.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(i,"-text")]:{color:e.badgeTextColor},["".concat(i,"-corner")]:{position:"absolute",top:"100%",width:a,height:a,color:"currentcolor",border:"".concat((0,d.bf)(r(a).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),c),{["&".concat(i,"-placement-end")]:{insetInlineEnd:r(a).mul(-1).equal(),borderEndEndRadius:0,["".concat(i,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(i,"-placement-start")]:{insetInlineStart:r(a).mul(-1).equal(),borderEndStartRadius:0,["".concat(i,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var S=(0,f.I$)(["Badge","Ribbon"],e=>C(w(e)),O);let j=e=>{let t;let{prefixCls:n,value:a,current:i,offset:c=0}=e;return c&&(t={position:"absolute",top:"".concat(c,"00%"),left:0}),o.createElement("span",{style:t,className:r()("".concat(n,"-only-unit"),{current:i})},a)};var N=e=>{let t,n;let{prefixCls:a,count:r,value:i}=e,c=Number(i),l=Math.abs(r),[s,d]=o.useState(c),[u,m]=o.useState(l),b=()=>{d(c),m(l)};if(o.useEffect(()=>{let e=setTimeout(b,1e3);return()=>clearTimeout(e)},[c]),s===c||Number.isNaN(c)||Number.isNaN(s))t=[o.createElement(j,Object.assign({},e,{key:c,current:!0}))],n={transition:"none"};else{t=[];let a=c+10,r=[];for(let e=c;e<=a;e+=1)r.push(e);let i=ue%10===s);t=(i<0?r.slice(0,d+1):r.slice(d)).map((t,n)=>o.createElement(j,Object.assign({},e,{key:t,value:t%10,offset:i<0?n-d:n,current:n===d}))),n={transform:"translateY(".concat(-function(e,t,n){let o=e,a=0;for(;(o+10)%10!==t;)o+=n,a+=n;return a}(s,c,i),"00%)")}}return o.createElement("span",{className:"".concat(a,"-only"),style:n,onTransitionEnd:b},t)},z=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let L=o.forwardRef((e,t)=>{let{prefixCls:n,count:a,className:i,motionClassName:c,style:d,title:u,show:m,component:b="sup",children:f}=e,p=z(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=o.useContext(s.E_),h=g("scroll-number",n),v=Object.assign(Object.assign({},p),{"data-show":m,style:d,className:r()(h,i,c),title:u}),y=a;if(a&&Number(a)%1==0){let e=String(a).split("");y=o.createElement("bdi",null,e.map((t,n)=>o.createElement(N,{prefixCls:h,count:Number(a),value:t,key:e.length-n})))}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,e=>({className:r()("".concat(h,"-custom-component"),null==e?void 0:e.className,c)})):o.createElement(b,Object.assign({},v,{ref:t}),y)});var T=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let Z=o.forwardRef((e,t)=>{var n,a,d,u,m;let{prefixCls:b,scrollNumberPrefixCls:f,children:p,status:g,text:h,color:v,count:y=null,overflowCount:x=99,dot:k=!1,size:w="default",title:O,offset:C,style:S,className:j,rootClassName:N,classNames:z,styles:Z,showZero:P=!1}=e,M=T(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}=o.useContext(s.E_),W=R("badge",b),[D,H,A]=E(W),F=y>x?"".concat(x,"+"):y,q="0"===F||0===F||"0"===h||0===h,G=null===y||q&&!P,K=(null!=g||null!=v)&&G,V=null!=g||!q,_=k&&!q,X=_?"":F,Y=(0,o.useMemo)(()=>((null==X||""===X)&&(null==h||""===h)||q&&!P)&&!_,[X,q,P,_,h]),$=(0,o.useRef)(y);Y||($.current=y);let Q=$.current,U=(0,o.useRef)(X);Y||(U.current=X);let J=U.current,ee=(0,o.useRef)(_);Y||(ee.current=_);let et=(0,o.useMemo)(()=>{if(!C)return Object.assign(Object.assign({},null==B?void 0:B.style),S);let e={marginTop:C[1]};return"rtl"===I?e.left=Number.parseInt(C[0],10):e.right=-Number.parseInt(C[0],10),Object.assign(Object.assign(Object.assign({},e),null==B?void 0:B.style),S)},[I,C,S,null==B?void 0:B.style]),en=null!=O?O:"string"==typeof Q||"number"==typeof Q?Q:void 0,eo=!Y&&(0===h?P:!!h&&!0!==h),ea=eo?o.createElement("span",{className:"".concat(W,"-status-text")},h):null,er=Q&&"object"==typeof Q?(0,l.Tm)(Q,e=>({style:Object.assign(Object.assign({},et),e.style)})):void 0,ei=(0,c.o2)(v,!1),ec=r()(null==z?void 0:z.indicator,null===(n=null==B?void 0:B.classNames)||void 0===n?void 0:n.indicator,{["".concat(W,"-status-dot")]:K,["".concat(W,"-status-").concat(g)]:!!g,["".concat(W,"-color-").concat(v)]:ei}),el={};v&&!ei&&(el.color=v,el.background=v);let es=r()(W,{["".concat(W,"-status")]:K,["".concat(W,"-not-a-wrapper")]:!p,["".concat(W,"-rtl")]:"rtl"===I},j,N,null==B?void 0:B.className,null===(a=null==B?void 0:B.classNames)||void 0===a?void 0:a.root,null==z?void 0:z.root,H,A);if(!p&&K&&(h||V||!G)){let e=et.color;return D(o.createElement("span",Object.assign({},M,{className:es,style:Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.root),null===(d=null==B?void 0:B.styles)||void 0===d?void 0:d.root),et)}),o.createElement("span",{className:ec,style:Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.indicator),null===(u=null==B?void 0:B.styles)||void 0===u?void 0:u.indicator),el)}),eo&&o.createElement("span",{style:{color:e},className:"".concat(W,"-status-text")},h)))}return D(o.createElement("span",Object.assign({ref:t},M,{className:es,style:Object.assign(Object.assign({},null===(m=null==B?void 0:B.styles)||void 0===m?void 0:m.root),null==Z?void 0:Z.root)}),p,o.createElement(i.ZP,{visible:!Y,motionName:"".concat(W,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:a}=e,i=R("scroll-number",f),c=ee.current,l=r()(null==z?void 0:z.indicator,null===(t=null==B?void 0:B.classNames)||void 0===t?void 0:t.indicator,{["".concat(W,"-dot")]:c,["".concat(W,"-count")]:!c,["".concat(W,"-count-sm")]:"small"===w,["".concat(W,"-multiple-words")]:!c&&J&&J.toString().length>1,["".concat(W,"-status-").concat(g)]:!!g,["".concat(W,"-color-").concat(v)]:ei}),s=Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.indicator),null===(n=null==B?void 0:B.styles)||void 0===n?void 0:n.indicator),et);return v&&!ei&&((s=s||{}).background=v),o.createElement(L,{prefixCls:i,show:!Y,motionClassName:a,className:l,count:J,title:en,style:s,key:"scrollNumber"},er)}),ea))});Z.Ribbon=e=>{let{className:t,prefixCls:n,style:a,color:i,children:l,text:d,placement:u="end",rootClassName:m}=e,{getPrefixCls:b,direction:f}=o.useContext(s.E_),p=b("ribbon",n),g="".concat(p,"-wrapper"),[h,v,y]=S(p,g),x=(0,c.o2)(i,!1),k=r()(p,"".concat(p,"-placement-").concat(u),{["".concat(p,"-rtl")]:"rtl"===f,["".concat(p,"-color-").concat(i)]:x},t),w={},O={};return i&&!x&&(w.background=i,O.color=i),h(o.createElement("div",{className:r()(g,m,v,y)},l,o.createElement("div",{className:r()(k,v),style:Object.assign(Object.assign({},w),a)},o.createElement("span",{className:"".concat(p,"-text")},d),o.createElement("div",{className:"".concat(p,"-corner"),style:O}))))};var P=Z},5945:function(e,t,n){n.d(t,{Z:function(){return T}});var o=n(2265),a=n(36760),r=n.n(a),i=n(18694),c=n(71744),l=n(33759),s=n(50337),d=n(65869),u=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n},m=e=>{var{prefixCls:t,className:n,hoverable:a=!0}=e,i=u(e,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=o.useContext(c.E_),s=l("card",t),d=r()("".concat(s,"-grid"),n,{["".concat(s,"-grid-hoverable")]:a});return o.createElement("div",Object.assign({},i,{className:d}))},b=n(93463),f=n(12918),p=n(99320),g=n(71140);let h=e=>{let{antCls:t,componentCls:n,headerHeight:o,headerPadding:a,tabsMarginBottom:r}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:o,marginBottom:-1,padding:"0 ".concat((0,b.bf)(a)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0")},(0,f.dF)()),{"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":Object.assign(Object.assign({display:"inline-block",flex:1},f.vS),{["\n > ".concat(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:r,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},v=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:o,lineWidth:a}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,b.bf)(a)," 0 0 0 ").concat(n,",\n 0 ").concat((0,b.bf)(a)," 0 0 ").concat(n,",\n ").concat((0,b.bf)(a)," ").concat((0,b.bf)(a)," 0 0 ").concat(n,",\n ").concat((0,b.bf)(a)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,b.bf)(a)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:o}}},y=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:o,cardActionsIconSize:a,colorBorderSecondary:r,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),display:"flex",borderRadius:"0 0 ".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG))},(0,f.dF)()),{"& > li":{margin:o,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:"color ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,b.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:a,lineHeight:(0,b.bf)(e.calc(a).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r)}}})},x=e=>Object.assign(Object.assign({margin:"".concat((0,b.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,f.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},f.vS),"&-description":{color:e.colorTextDescription}}),k=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:o,bodyPadding:a}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,b.bf)(o)),background:n,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,b.bf)(e.padding)," ").concat((0,b.bf)(a))}}},w=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},O=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:r,bodyPadding:i,extraColor:c}=e;return{[t]:Object.assign(Object.assign({},(0,f.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(t,"-bordered)")]:{boxShadow:r},["".concat(t,"-head")]:h(e),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:c,fontWeight:"normal",fontSize:e.fontSize},["".concat(t,"-body")]:{padding:i,borderRadius:"0 0 ".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG))},["".concat(t,"-grid")]:v(e),["".concat(t,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0")}},["".concat(t,"-actions")]:y(e),["".concat(t,"-meta")]:x(e)}),["".concat(t,"-bordered")]:{border:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(t,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(t,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:n}},["".concat(t,"-contain-grid")]:{borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0 "),["".concat(t,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(t,"-loading) ").concat(t,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(t,"-contain-tabs")]:{["> div".concat(t,"-head")]:{minHeight:0,["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:o}}},["".concat(t,"-type-inner")]:k(e),["".concat(t,"-loading")]:w(e),["".concat(t,"-rtl")]:{direction:"rtl"}}},E=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:o,headerHeightSM:a,headerFontSizeSM:r}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:a,padding:"0 ".concat((0,b.bf)(o)),fontSize:r,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var C=(0,p.I$)("Card",e=>{let t=(0,g.IX)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[O(t),E(t)]},e=>{var t,n;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(t=e.bodyPadding)&&void 0!==t?t:e.paddingLG,headerPadding:null!==(n=e.headerPadding)&&void 0!==n?n:e.paddingLG}}),S=n(56250),j=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let N=e=>{let{actionClasses:t,actions:n=[],actionStyle:a}=e;return o.createElement("ul",{className:t,style:a},n.map((e,t)=>o.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},o.createElement("span",null,e))))},z=o.forwardRef((e,t)=>{let n;let{prefixCls:a,className:u,rootClassName:b,style:f,extra:p,headStyle:g={},bodyStyle:h={},title:v,loading:y,bordered:x,variant:k,size:w,type:O,cover:E,actions:z,tabList:L,children:T,activeTabKey:Z,defaultActiveTabKey:P,tabBarExtraContent:M,hoverable:R,tabProps:I={},classNames:B,styles:W}=e,D=j(e,["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:H,direction:A,card:F}=o.useContext(c.E_),[q]=(0,S.Z)("card",k,x),G=e=>{var t;return r()(null===(t=null==F?void 0:F.classNames)||void 0===t?void 0:t[e],null==B?void 0:B[e])},K=e=>{var t;return Object.assign(Object.assign({},null===(t=null==F?void 0:F.styles)||void 0===t?void 0:t[e]),null==W?void 0:W[e])},V=o.useMemo(()=>{let e=!1;return o.Children.forEach(T,t=>{(null==t?void 0:t.type)===m&&(e=!0)}),e},[T]),_=H("card",a),[X,Y,$]=C(_),Q=o.createElement(s.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},T),U=void 0!==Z,J=Object.assign(Object.assign({},I),{[U?"activeKey":"defaultActiveKey"]:U?Z:P,tabBarExtraContent:M}),ee=(0,l.Z)(w),et=ee&&"default"!==ee?ee:"large",en=L?o.createElement(d.default,Object.assign({size:et},J,{className:"".concat(_,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:L.map(e=>{var{tab:t}=e;return Object.assign({label:t},j(e,["tab"]))})})):null;if(v||p||en){let e=r()("".concat(_,"-head"),G("header")),t=r()("".concat(_,"-head-title"),G("title")),a=r()("".concat(_,"-extra"),G("extra")),i=Object.assign(Object.assign({},g),K("header"));n=o.createElement("div",{className:e,style:i},o.createElement("div",{className:"".concat(_,"-head-wrapper")},v&&o.createElement("div",{className:t,style:K("title")},v),p&&o.createElement("div",{className:a,style:K("extra")},p)),en)}let eo=r()("".concat(_,"-cover"),G("cover")),ea=E?o.createElement("div",{className:eo,style:K("cover")},E):null,er=r()("".concat(_,"-body"),G("body")),ei=Object.assign(Object.assign({},h),K("body")),ec=o.createElement("div",{className:er,style:ei},y?Q:T),el=r()("".concat(_,"-actions"),G("actions")),es=(null==z?void 0:z.length)?o.createElement(N,{actionClasses:el,actionStyle:K("actions"),actions:z}):null,ed=(0,i.Z)(D,["onTabChange"]),eu=r()(_,null==F?void 0:F.className,{["".concat(_,"-loading")]:y,["".concat(_,"-bordered")]:"borderless"!==q,["".concat(_,"-hoverable")]:R,["".concat(_,"-contain-grid")]:V,["".concat(_,"-contain-tabs")]:null==L?void 0:L.length,["".concat(_,"-").concat(ee)]:ee,["".concat(_,"-type-").concat(O)]:!!O,["".concat(_,"-rtl")]:"rtl"===A},u,b,Y,$),em=Object.assign(Object.assign({},null==F?void 0:F.style),f);return X(o.createElement("div",Object.assign({ref:t},ed,{className:eu,style:em}),n,ea,ec,es))});var 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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};z.Grid=m,z.Meta=e=>{let{prefixCls:t,className:n,avatar:a,title:i,description:l}=e,s=L(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:d}=o.useContext(c.E_),u=d("card",t),m=r()("".concat(u,"-meta"),n),b=a?o.createElement("div",{className:"".concat(u,"-meta-avatar")},a):null,f=i?o.createElement("div",{className:"".concat(u,"-meta-title")},i):null,p=l?o.createElement("div",{className:"".concat(u,"-meta-description")},l):null,g=f||p?o.createElement("div",{className:"".concat(u,"-meta-detail")},f,p):null;return o.createElement("div",Object.assign({},s,{className:m}),b,g)};var T=z},69410:function(e,t,n){var o=n(54998);t.Z=o.Z},867:function(e,t,n){n.d(t,{Z:function(){return C}});var o=n(2265),a=n(54537),r=n(36760),i=n.n(r),c=n(50506),l=n(18694),s=n(71744),d=n(79326),u=n(59367),m=n(92570),b=n(5545),f=n(51248),p=n(55274),g=n(37381),h=n(20435),v=n(99320);let y=e=>{let{componentCls:t,iconCls:n,antCls:o,zIndexPopup:a,colorText:r,colorWarning:i,marginXXS:c,marginXS:l,fontSize:s,fontWeightStrong:d,colorTextHeading:u}=e;return{[t]:{zIndex:a,["&".concat(o,"-popover")]:{fontSize:s},["".concat(t,"-message")]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(t,"-message-icon ").concat(n)]:{color:i,fontSize:s,lineHeight:1,marginInlineEnd:l},["".concat(t,"-title")]:{fontWeight:d,color:u,"&:only-child":{fontWeight:"normal"}},["".concat(t,"-description")]:{marginTop:c,color:r}},["".concat(t,"-buttons")]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}};var x=(0,v.I$)("Popconfirm",e=>y(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),k=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let w=e=>{let{prefixCls:t,okButtonProps:n,cancelButtonProps:r,title:i,description:c,cancelText:l,okText:d,okType:h="primary",icon:v=o.createElement(a.Z,null),showCancel:y=!0,close:x,onConfirm:k,onCancel:w,onPopupClick:O}=e,{getPrefixCls:E}=o.useContext(s.E_),[C]=(0,p.Z)("Popconfirm",g.Z.Popconfirm),S=(0,m.Z)(i),j=(0,m.Z)(c);return o.createElement("div",{className:"".concat(t,"-inner-content"),onClick:O},o.createElement("div",{className:"".concat(t,"-message")},v&&o.createElement("span",{className:"".concat(t,"-message-icon")},v),o.createElement("div",{className:"".concat(t,"-message-text")},S&&o.createElement("div",{className:"".concat(t,"-title")},S),j&&o.createElement("div",{className:"".concat(t,"-description")},j))),o.createElement("div",{className:"".concat(t,"-buttons")},y&&o.createElement(b.ZP,Object.assign({onClick:w,size:"small"},r),l||(null==C?void 0:C.cancelText)),o.createElement(u.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,f.nx)(h)),n),actionFn:k,close:x,prefixCls:E("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},d||(null==C?void 0:C.okText))))};var O=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let E=o.forwardRef((e,t)=>{var n,r;let{prefixCls:u,placement:m="top",trigger:b="click",okType:f="primary",icon:p=o.createElement(a.Z,null),children:g,overlayClassName:h,onOpenChange:v,onVisibleChange:y,overlayStyle:k,styles:E,classNames:C}=e,S=O(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:j,className:N,style:z,classNames:L,styles:T}=(0,s.dj)("popconfirm"),[Z,P]=(0,c.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(r=e.defaultOpen)&&void 0!==r?r:e.defaultVisible}),M=(e,t)=>{P(e,!0),null==y||y(e),null==v||v(e,t)},R=j("popconfirm",u),I=i()(R,N,h,L.root,null==C?void 0:C.root),B=i()(L.body,null==C?void 0:C.body),[W]=x(R);return W(o.createElement(d.Z,Object.assign({},(0,l.Z)(S,["title"]),{trigger:b,placement:m,onOpenChange:(t,n)=>{let{disabled:o=!1}=e;o||M(t,n)},open:Z,ref:t,classNames:{root:I,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},T.root),z),k),null==E?void 0:E.root),body:Object.assign(Object.assign({},T.body),null==E?void 0:E.body)},content:o.createElement(w,Object.assign({okType:f,icon:p},e,{prefixCls:R,close:e=>{M(!1,e)},onConfirm:t=>{var n;return null===(n=e.onConfirm)||void 0===n?void 0:n.call(void 0,t)},onCancel:t=>{var n;M(!1,t),null===(n=e.onCancel)||void 0===n||n.call(void 0,t)}})),"data-popover-inject":!0}),g))});E._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:n,className:a,style:r}=e,c=k(e,["prefixCls","placement","className","style"]),{getPrefixCls:l}=o.useContext(s.E_),d=l("popconfirm",t),[u]=x(d);return u(o.createElement(h.ZP,{placement:n,className:i()(d,a),style:r,content:o.createElement(w,Object.assign({prefixCls:d},c))}))};var C=E},47451:function(e,t,n){var o=n(77774);t.Z=o.Z},30401:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},87769:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(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,n){n.d(t,{Z:function(){return o}});let o=(0,n(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"}]])},88532:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",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"}))});t.Z=a},2356:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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},15731:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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=a},45589:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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=a},53410:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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=a},91126:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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"}),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a},29827:function(e,t,n){n.d(t,{NL:function(){return i},aH:function(){return c}});var o=n(2265),a=n(57437),r=o.createContext(void 0),i=e=>{let t=o.useContext(r);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},c=e=>{let{client:t,children:n}=e;return o.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,a.jsx)(r.Provider,{value:t,children:n})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4073,5945],{45246:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},89245:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},78355:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},8881:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},3632:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},35291:function(e,t,n){n.d(t,{Z:function(){return c}});var o=n(1119),a=n(2265),r={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"},i=n(55015),c=a.forwardRef(function(e,t){return a.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:r}))})},59664:function(e,t,n){n.d(t,{Z:function(){return S}});var o=n(5853),a=n(2265),r=n(47625),i=n(93765),c=n(54061),l=n(97059),s=n(62994),d=n(25311),u=(0,i.z)({chartName:"LineChart",GraphicalChild:c.x,axisComponents:[{axisType:"xAxis",AxisComp:l.K},{axisType:"yAxis",AxisComp:s.B}],formatAxisMap:d.t9}),m=n(56940),b=n(26680),p=n(8147),f=n(22190),g=n(81889),h=n(65278),v=n(98593),y=n(92666),x=n(32644),k=n(7084),w=n(26898),O=n(13241),E=n(1153);let S=a.forwardRef((e,t)=>{let{data:n=[],categories:i=[],index:d,colors:S=w.s,valueFormatter:C=E.Cj,startEndOnly:j=!1,showXAxis:N=!0,showYAxis:z=!0,yAxisWidth:L=56,intervalType:T="equidistantPreserveStart",animationDuration:Z=900,showAnimation:P=!1,showTooltip:M=!0,showLegend:R=!0,showGridLines:I=!0,autoMinValue:B=!1,curveType:W="linear",minValue:D,maxValue:H,connectNulls:A=!1,allowDecimals:F=!0,noDataText:q,className:G,onValueChange:K,enableLegendSlider:V=!1,customTooltip:_,rotateLabelX:X,padding:Y=N||z?{left:20,right:20}:{left:0,right:0},tickGap:$=5,xAxisLabel:U,yAxisLabel:Q}=e,J=(0,o._T)(e,["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"]),[ee,et]=(0,a.useState)(60),[en,eo]=(0,a.useState)(void 0),[ea,er]=(0,a.useState)(void 0),ei=(0,x.me)(i,S),ec=(0,x.i4)(B,D,H),el=!!K;function es(e){el&&(e===ea&&!en||(0,x.FB)(n,e)&&en&&en.dataKey===e?(er(void 0),null==K||K(null)):(er(e),null==K||K({eventType:"category",categoryClicked:e})),eo(void 0))}return a.createElement("div",Object.assign({ref:t,className:(0,O.q)("w-full h-80",G)},J),a.createElement(r.h,{className:"h-full w-full"},(null==n?void 0:n.length)?a.createElement(u,{data:n,onClick:el&&(ea||en)?()=>{eo(void 0),er(void 0),null==K||K(null)}:void 0,margin:{bottom:U?30:void 0,left:Q?20:void 0,right:Q?5:void 0,top:5}},I?a.createElement(m.q,{className:(0,O.q)("stroke-1","stroke-tremor-border","dark:stroke-dark-tremor-border"),horizontal:!0,vertical:!1}):null,a.createElement(l.K,{padding:Y,hide:!N,dataKey:d,interval:j?"preserveStartEnd":T,tick:{transform:"translate(0, 6)"},ticks:j?[n[0][d],n[n.length-1][d]]:void 0,fill:"",stroke:"",className:(0,O.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},U&&a.createElement(b._,{position:"insideBottom",offset:-20,className:"fill-tremor-content-emphasis text-tremor-default font-medium dark:fill-dark-tremor-content-emphasis"},U)),a.createElement(s.B,{width:L,hide:!z,axisLine:!1,tickLine:!1,type:"number",domain:ec,tick:{transform:"translate(-3, 0)"},fill:"",stroke:"",className:(0,O.q)("text-tremor-label","fill-tremor-content","dark:fill-dark-tremor-content"),tickFormatter:C,allowDecimals:F},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(p.u,{wrapperStyle:{outline:"none"},isAnimationActive:!1,cursor:{stroke:"#d1d5db",strokeWidth:1},content:M?e=>{let{active:t,payload:n,label:o}=e;return _?a.createElement(_,{payload:null==n?void 0:n.map(e=>{var t;return Object.assign(Object.assign({},e),{color:null!==(t=ei.get(e.dataKey))&&void 0!==t?t:k.fr.Gray})}),active:t,label:o}):a.createElement(v.ZP,{active:t,payload:n,label:o,valueFormatter:C,categoryColors:ei})}:a.createElement(a.Fragment,null),position:{y:0}}),R?a.createElement(f.D,{verticalAlign:"top",height:ee,content:e=>{let{payload:t}=e;return(0,h.Z)({payload:t},ei,et,ea,el?e=>es(e):void 0,V)}}):null,i.map(e=>{var t;return a.createElement(c.x,{className:(0,O.q)((0,E.bM)(null!==(t=ei.get(e))&&void 0!==t?t:k.fr.Gray,w.K.text).strokeColor),strokeOpacity:en||ea&&ea!==e?.3:1,activeDot:e=>{var t;let{cx:o,cy:r,stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,dataKey:d}=e;return a.createElement(g.o,{className:(0,O.q)("stroke-tremor-background dark:stroke-dark-tremor-background",K?"cursor-pointer":"",(0,E.bM)(null!==(t=ei.get(d))&&void 0!==t?t:k.fr.Gray,w.K.text).fillColor),cx:o,cy:r,r:5,fill:"",stroke:i,strokeLinecap:c,strokeLinejoin:l,strokeWidth:s,onClick:(t,o)=>{o.stopPropagation(),el&&(e.index===(null==en?void 0:en.index)&&e.dataKey===(null==en?void 0:en.dataKey)||(0,x.FB)(n,e.dataKey)&&ea&&ea===e.dataKey?(er(void 0),eo(void 0),null==K||K(null)):(er(e.dataKey),eo({index:e.index,dataKey:e.dataKey}),null==K||K(Object.assign({eventType:"dot",categoryClicked:e.dataKey},e.payload))))}})},dot:t=>{var o;let{stroke:r,strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,cx:s,cy:d,dataKey:u,index:m}=t;return(0,x.FB)(n,e)&&!(en||ea&&ea!==e)||(null==en?void 0:en.index)===m&&(null==en?void 0:en.dataKey)===e?a.createElement(g.o,{key:m,cx:s,cy:d,r:5,stroke:r,fill:"",strokeLinecap:i,strokeLinejoin:c,strokeWidth:l,className:(0,O.q)("stroke-tremor-background dark:stroke-dark-tremor-background",K?"cursor-pointer":"",(0,E.bM)(null!==(o=ei.get(u))&&void 0!==o?o:k.fr.Gray,w.K.text).fillColor)}):a.createElement(a.Fragment,{key:m})},key:e,name:e,type:W,dataKey:e,stroke:"",strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",isAnimationActive:P,animationDuration:Z,connectNulls:A})}),K?i.map(e=>a.createElement(c.x,{className:(0,O.q)("cursor-pointer"),strokeOpacity:0,key:e,name:e,type:W,dataKey:e,stroke:"transparent",fill:"transparent",legendType:"none",tooltipType:"none",strokeWidth:12,connectNulls:A,onClick:(e,t)=>{t.stopPropagation();let{name:n}=e;es(n)}})):null):a.createElement(y.Z,{noDataText:q})))});S.displayName="LineChart"},59341:function(e,t,n){n.d(t,{Z:function(){return Z}});var o=n(5853),a=n(71049),r=n(11323),i=n(2265),c=n(66797),l=n(40099),s=n(74275),d=n(59456),u=n(93980),m=n(65573),b=n(67561),p=n(87550),f=n(628),g=n(80281),h=n(31370),v=n(20131),y=n(38929),x=n(52307),k=n(52724),w=n(7935);let O=(0,i.createContext)(null);O.displayName="GroupContext";let E=i.Fragment,S=Object.assign((0,y.yV)(function(e,t){var n;let o=(0,i.useId)(),E=(0,g.Q)(),S=(0,p.B)(),{id:C=E||"headlessui-switch-".concat(o),disabled:j=S||!1,checked:N,defaultChecked:z,onChange:L,name:T,value:Z,form:P,autoFocus:M=!1,...R}=e,I=(0,i.useContext)(O),[B,W]=(0,i.useState)(null),D=(0,i.useRef)(null),H=(0,b.T)(D,t,null===I?null:I.setSwitch,W),A=(0,s.L)(z),[F,q]=(0,l.q)(N,L,null!=A&&A),G=(0,d.G)(),[K,V]=(0,i.useState)(!1),_=(0,u.z)(()=>{V(!0),null==q||q(!F),G.nextFrame(()=>{V(!1)})}),X=(0,u.z)(e=>{if((0,h.P)(e.currentTarget))return e.preventDefault();e.preventDefault(),_()}),Y=(0,u.z)(e=>{e.key===k.R.Space?(e.preventDefault(),_()):e.key===k.R.Enter&&(0,v.g)(e.currentTarget)}),$=(0,u.z)(e=>e.preventDefault()),U=(0,w.wp)(),Q=(0,x.zH)(),{isFocusVisible:J,focusProps:ee}=(0,a.F)({autoFocus:M}),{isHovered:et,hoverProps:en}=(0,r.X)({isDisabled:j}),{pressed:eo,pressProps:ea}=(0,c.x)({disabled:j}),er=(0,i.useMemo)(()=>({checked:F,disabled:j,hover:et,focus:J,active:eo,autofocus:M,changing:K}),[F,et,J,eo,j,K,M]),ei=(0,y.dG)({id:C,ref:H,role:"switch",type:(0,m.f)(e,B),tabIndex:-1===e.tabIndex?0:null!=(n=e.tabIndex)?n:0,"aria-checked":F,"aria-labelledby":U,"aria-describedby":Q,disabled:j||void 0,autoFocus:M,onClick:X,onKeyUp:Y,onKeyPress:$},ee,en,ea),ec=(0,i.useCallback)(()=>{if(void 0!==A)return null==q?void 0:q(A)},[q,A]),el=(0,y.L6)();return i.createElement(i.Fragment,null,null!=T&&i.createElement(f.Mt,{disabled:j,data:{[T]:Z||"on"},overrides:{type:"checkbox",checked:F},form:P,onReset:ec}),el({ourProps:ei,theirProps:R,slot:er,defaultTag:"button",name:"Switch"}))}),{Group:function(e){var t;let[n,o]=(0,i.useState)(null),[a,r]=(0,w.bE)(),[c,l]=(0,x.fw)(),s=(0,i.useMemo)(()=>({switch:n,setSwitch:o}),[n,o]),d=(0,y.L6)();return i.createElement(l,{name:"Switch.Description",value:c},i.createElement(r,{name:"Switch.Label",value:a,props:{htmlFor:null==(t=s.switch)?void 0:t.id,onClick(e){n&&(e.currentTarget instanceof HTMLLabelElement&&e.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},i.createElement(O.Provider,{value:s},d({ourProps:{},theirProps:e,slot:{},defaultTag:E,name:"Switch.Group"}))))},Label:w.__,Description:x.dk});var C=n(44140),j=n(26898),N=n(13241),z=n(1153),L=n(47187);let T=(0,z.fn)("Switch"),Z=i.forwardRef((e,t)=>{let{checked:n,defaultChecked:a=!1,onChange:r,color:c,name:l,error:s,errorMessage:d,disabled:u,required:m,tooltip:b,id:p}=e,f=(0,o._T)(e,["checked","defaultChecked","onChange","color","name","error","errorMessage","disabled","required","tooltip","id"]),g={bgColor:c?(0,z.bM)(c,j.K.background).bgColor:"bg-tremor-brand dark:bg-dark-tremor-brand",ringColor:c?(0,z.bM)(c,j.K.ring).ringColor:"ring-tremor-brand-muted dark:ring-dark-tremor-brand-muted"},[h,v]=(0,C.Z)(a,n),[y,x]=(0,i.useState)(!1),{tooltipProps:k,getReferenceProps:w}=(0,L.l)(300);return i.createElement("div",{className:"flex flex-row items-center justify-start"},i.createElement(L.Z,Object.assign({text:b},k)),i.createElement("div",Object.assign({ref:(0,z.lq)([t,k.refs.setReference]),className:(0,N.q)(T("root"),"flex flex-row relative h-5")},f,w),i.createElement("input",{type:"checkbox",className:(0,N.q)(T("input"),"absolute w-5 h-5 cursor-pointer left-0 top-0 opacity-0"),name:l,required:m,checked:h,onChange:e=>{e.preventDefault()}}),i.createElement(S,{checked:h,onChange:e=>{v(e),null==r||r(e)},disabled:u,className:(0,N.q)(T("switch"),"w-10 h-5 group relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-tremor-full","focus:outline-none",u?"cursor-not-allowed":""),onFocus:()=>x(!0),onBlur:()=>x(!1),id:p},i.createElement("span",{className:(0,N.q)(T("sr-only"),"sr-only")},"Switch ",h?"on":"off"),i.createElement("span",{"aria-hidden":"true",className:(0,N.q)(T("background"),h?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")}),i.createElement("span",{"aria-hidden":"true",className:(0,N.q)(T("round"),h?(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",y?(0,N.q)("ring-2",g.ringColor):"")}))),s&&d?i.createElement("p",{className:(0,N.q)(T("errorMessage"),"text-sm text-red-500 mt-1 ")},d):null)});Z.displayName="Switch"},33866:function(e,t,n){n.d(t,{Z:function(){return P}});var o=n(2265),a=n(36760),r=n.n(a),i=n(66632),c=n(93350),l=n(19722),s=n(71744),d=n(93463),u=n(12918),m=n(18536),b=n(71140),p=n(99320);let f=new d.E4("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),g=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}}),x=new d.E4("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),k=e=>{let{componentCls:t,iconCls:n,antCls:o,badgeShadowSize:a,textFontSize:r,textFontSizeSM:i,statusSize:c,dotSize:l,textFontWeight:s,indicatorHeight:b,indicatorHeightSM:p,marginXS:k,calc:w}=e,O="".concat(o,"-scroll-number"),E=(0,m.Z)(e,(e,n)=>{let{darkColor:o}=n;return{["&".concat(t," ").concat(t,"-color-").concat(e)]:{background:o,["&:not(".concat(t,"-count)")]:{color:o},"a:hover &":{background:o}}}});return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,["".concat(t,"-count")]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:b,height:b,color:e.badgeTextColor,fontWeight:s,fontSize:r,lineHeight:(0,d.bf)(b),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:w(b).div(2).equal(),boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").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:p,height:p,fontSize:i,lineHeight:(0,d.bf)(p),borderRadius:w(p).div(2).equal()},["".concat(t,"-multiple-words")]:{padding:"0 ".concat((0,d.bf)(e.paddingXS)),bdi:{unicodeBidi:"plaintext"}},["".concat(t,"-dot")]:{zIndex:e.indicatorZIndex,width:l,minWidth:l,height:l,background:e.badgeColor,borderRadius:"100%",boxShadow:"0 0 0 ".concat((0,d.bf)(a)," ").concat(e.badgeShadowColor)},["".concat(t,"-count, ").concat(t,"-dot, ").concat(O,"-custom-component")]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",["&".concat(n,"-spin")]:{animationName:x,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:c,height:c,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:a,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:f,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:h,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},["&".concat(t,"-not-a-wrapper")]:{["".concat(t,"-zoom-appear, ").concat(t,"-zoom-enter")]:{animationName:v,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["".concat(t,"-zoom-leave")]:{animationName:y,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},["&:not(".concat(t,"-status)")]:{verticalAlign:"middle"},["".concat(O,"-custom-component, ").concat(t,"-count")]:{transform:"none"},["".concat(O,"-custom-component, ").concat(O)]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[O]:{overflow:"hidden",transition:"all ".concat(e.motionDurationMid," ").concat(e.motionEaseOutBack),["".concat(O,"-only")]:{position:"relative",display:"inline-block",height:b,transition:"all ".concat(e.motionDurationSlow," ").concat(e.motionEaseOutBack),WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",["> p".concat(O,"-only-unit")]:{height:b,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},["".concat(O,"-symbol")]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",["".concat(t,"-count, ").concat(t,"-dot, ").concat(O,"-custom-component")]:{transform:"translate(-50%, -50%)"}}})}},w=e=>{let{fontHeight:t,lineWidth:n,marginXS:o,colorBorderBg:a}=e,r=e.colorTextLightSolid,i=e.colorError,c=e.colorErrorHover;return(0,b.IX)(e,{badgeFontHeight:t,badgeShadowSize:n,badgeTextColor:r,badgeColor:i,badgeColorHover:c,badgeShadowColor:a,badgeProcessingDuration:"1.2s",badgeRibbonOffset:o,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},O=e=>{let{fontSize:t,lineHeight:n,fontSizeSM:o,lineWidth:a}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*a,indicatorHeightSM:t,dotSize:o/2,textFontSize:o,textFontSizeSM:o,textFontWeight:"normal",statusSize:o/2}};var E=(0,p.I$)("Badge",e=>k(w(e)),O);let S=e=>{let{antCls:t,badgeFontHeight:n,marginXS:o,badgeRibbonOffset:a,calc:r}=e,i="".concat(t,"-ribbon"),c=(0,m.Z)(e,(e,t)=>{let{darkColor:n}=t;return{["&".concat(i,"-color-").concat(e)]:{background:n,color:n}}});return{["".concat(t,"-ribbon-wrapper")]:{position:"relative"},[i]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,u.Wf)(e)),{position:"absolute",top:o,padding:"0 ".concat((0,d.bf)(e.paddingXS)),color:e.colorPrimary,lineHeight:(0,d.bf)(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,["".concat(i,"-text")]:{color:e.badgeTextColor},["".concat(i,"-corner")]:{position:"absolute",top:"100%",width:a,height:a,color:"currentcolor",border:"".concat((0,d.bf)(r(a).div(2).equal())," solid"),transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter}}),c),{["&".concat(i,"-placement-end")]:{insetInlineEnd:r(a).mul(-1).equal(),borderEndEndRadius:0,["".concat(i,"-corner")]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},["&".concat(i,"-placement-start")]:{insetInlineStart:r(a).mul(-1).equal(),borderEndStartRadius:0,["".concat(i,"-corner")]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}})}};var C=(0,p.I$)(["Badge","Ribbon"],e=>S(w(e)),O);let j=e=>{let t;let{prefixCls:n,value:a,current:i,offset:c=0}=e;return c&&(t={position:"absolute",top:"".concat(c,"00%"),left:0}),o.createElement("span",{style:t,className:r()("".concat(n,"-only-unit"),{current:i})},a)};var N=e=>{let t,n;let{prefixCls:a,count:r,value:i}=e,c=Number(i),l=Math.abs(r),[s,d]=o.useState(c),[u,m]=o.useState(l),b=()=>{d(c),m(l)};if(o.useEffect(()=>{let e=setTimeout(b,1e3);return()=>clearTimeout(e)},[c]),s===c||Number.isNaN(c)||Number.isNaN(s))t=[o.createElement(j,Object.assign({},e,{key:c,current:!0}))],n={transition:"none"};else{t=[];let a=c+10,r=[];for(let e=c;e<=a;e+=1)r.push(e);let i=ue%10===s);t=(i<0?r.slice(0,d+1):r.slice(d)).map((t,n)=>o.createElement(j,Object.assign({},e,{key:t,value:t%10,offset:i<0?n-d:n,current:n===d}))),n={transform:"translateY(".concat(-function(e,t,n){let o=e,a=0;for(;(o+10)%10!==t;)o+=n,a+=n;return a}(s,c,i),"00%)")}}return o.createElement("span",{className:"".concat(a,"-only"),style:n,onTransitionEnd:b},t)},z=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let L=o.forwardRef((e,t)=>{let{prefixCls:n,count:a,className:i,motionClassName:c,style:d,title:u,show:m,component:b="sup",children:p}=e,f=z(e,["prefixCls","count","className","motionClassName","style","title","show","component","children"]),{getPrefixCls:g}=o.useContext(s.E_),h=g("scroll-number",n),v=Object.assign(Object.assign({},f),{"data-show":m,style:d,className:r()(h,i,c),title:u}),y=a;if(a&&Number(a)%1==0){let e=String(a).split("");y=o.createElement("bdi",null,e.map((t,n)=>o.createElement(N,{prefixCls:h,count:Number(a),value:t,key:e.length-n})))}return((null==d?void 0:d.borderColor)&&(v.style=Object.assign(Object.assign({},d),{boxShadow:"0 0 0 1px ".concat(d.borderColor," inset")})),p)?(0,l.Tm)(p,e=>({className:r()("".concat(h,"-custom-component"),null==e?void 0:e.className,c)})):o.createElement(b,Object.assign({},v,{ref:t}),y)});var T=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let Z=o.forwardRef((e,t)=>{var n,a,d,u,m;let{prefixCls:b,scrollNumberPrefixCls:p,children:f,status:g,text:h,color:v,count:y=null,overflowCount:x=99,dot:k=!1,size:w="default",title:O,offset:S,style:C,className:j,rootClassName:N,classNames:z,styles:Z,showZero:P=!1}=e,M=T(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}=o.useContext(s.E_),W=R("badge",b),[D,H,A]=E(W),F=y>x?"".concat(x,"+"):y,q="0"===F||0===F||"0"===h||0===h,G=null===y||q&&!P,K=(null!=g||null!=v)&&G,V=null!=g||!q,_=k&&!q,X=_?"":F,Y=(0,o.useMemo)(()=>((null==X||""===X)&&(null==h||""===h)||q&&!P)&&!_,[X,q,P,_,h]),$=(0,o.useRef)(y);Y||($.current=y);let U=$.current,Q=(0,o.useRef)(X);Y||(Q.current=X);let J=Q.current,ee=(0,o.useRef)(_);Y||(ee.current=_);let et=(0,o.useMemo)(()=>{if(!S)return Object.assign(Object.assign({},null==B?void 0:B.style),C);let e={marginTop:S[1]};return"rtl"===I?e.left=Number.parseInt(S[0],10):e.right=-Number.parseInt(S[0],10),Object.assign(Object.assign(Object.assign({},e),null==B?void 0:B.style),C)},[I,S,C,null==B?void 0:B.style]),en=null!=O?O:"string"==typeof U||"number"==typeof U?U:void 0,eo=!Y&&(0===h?P:!!h&&!0!==h),ea=eo?o.createElement("span",{className:"".concat(W,"-status-text")},h):null,er=U&&"object"==typeof U?(0,l.Tm)(U,e=>({style:Object.assign(Object.assign({},et),e.style)})):void 0,ei=(0,c.o2)(v,!1),ec=r()(null==z?void 0:z.indicator,null===(n=null==B?void 0:B.classNames)||void 0===n?void 0:n.indicator,{["".concat(W,"-status-dot")]:K,["".concat(W,"-status-").concat(g)]:!!g,["".concat(W,"-color-").concat(v)]:ei}),el={};v&&!ei&&(el.color=v,el.background=v);let es=r()(W,{["".concat(W,"-status")]:K,["".concat(W,"-not-a-wrapper")]:!f,["".concat(W,"-rtl")]:"rtl"===I},j,N,null==B?void 0:B.className,null===(a=null==B?void 0:B.classNames)||void 0===a?void 0:a.root,null==z?void 0:z.root,H,A);if(!f&&K&&(h||V||!G)){let e=et.color;return D(o.createElement("span",Object.assign({},M,{className:es,style:Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.root),null===(d=null==B?void 0:B.styles)||void 0===d?void 0:d.root),et)}),o.createElement("span",{className:ec,style:Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.indicator),null===(u=null==B?void 0:B.styles)||void 0===u?void 0:u.indicator),el)}),eo&&o.createElement("span",{style:{color:e},className:"".concat(W,"-status-text")},h)))}return D(o.createElement("span",Object.assign({ref:t},M,{className:es,style:Object.assign(Object.assign({},null===(m=null==B?void 0:B.styles)||void 0===m?void 0:m.root),null==Z?void 0:Z.root)}),f,o.createElement(i.ZP,{visible:!Y,motionName:"".concat(W,"-zoom"),motionAppear:!1,motionDeadline:1e3},e=>{var t,n;let{className:a}=e,i=R("scroll-number",p),c=ee.current,l=r()(null==z?void 0:z.indicator,null===(t=null==B?void 0:B.classNames)||void 0===t?void 0:t.indicator,{["".concat(W,"-dot")]:c,["".concat(W,"-count")]:!c,["".concat(W,"-count-sm")]:"small"===w,["".concat(W,"-multiple-words")]:!c&&J&&J.toString().length>1,["".concat(W,"-status-").concat(g)]:!!g,["".concat(W,"-color-").concat(v)]:ei}),s=Object.assign(Object.assign(Object.assign({},null==Z?void 0:Z.indicator),null===(n=null==B?void 0:B.styles)||void 0===n?void 0:n.indicator),et);return v&&!ei&&((s=s||{}).background=v),o.createElement(L,{prefixCls:i,show:!Y,motionClassName:a,className:l,count:J,title:en,style:s,key:"scrollNumber"},er)}),ea))});Z.Ribbon=e=>{let{className:t,prefixCls:n,style:a,color:i,children:l,text:d,placement:u="end",rootClassName:m}=e,{getPrefixCls:b,direction:p}=o.useContext(s.E_),f=b("ribbon",n),g="".concat(f,"-wrapper"),[h,v,y]=C(f,g),x=(0,c.o2)(i,!1),k=r()(f,"".concat(f,"-placement-").concat(u),{["".concat(f,"-rtl")]:"rtl"===p,["".concat(f,"-color-").concat(i)]:x},t),w={},O={};return i&&!x&&(w.background=i,O.color=i),h(o.createElement("div",{className:r()(g,m,v,y)},l,o.createElement("div",{className:r()(k,v),style:Object.assign(Object.assign({},w),a)},o.createElement("span",{className:"".concat(f,"-text")},d),o.createElement("div",{className:"".concat(f,"-corner"),style:O}))))};var P=Z},5945:function(e,t,n){n.d(t,{Z:function(){return T}});var o=n(2265),a=n(36760),r=n.n(a),i=n(18694),c=n(71744),l=n(33759),s=n(50337),d=n(65869),u=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n},m=e=>{var{prefixCls:t,className:n,hoverable:a=!0}=e,i=u(e,["prefixCls","className","hoverable"]);let{getPrefixCls:l}=o.useContext(c.E_),s=l("card",t),d=r()("".concat(s,"-grid"),n,{["".concat(s,"-grid-hoverable")]:a});return o.createElement("div",Object.assign({},i,{className:d}))},b=n(93463),p=n(12918),f=n(99320),g=n(71140);let h=e=>{let{antCls:t,componentCls:n,headerHeight:o,headerPadding:a,tabsMarginBottom:r}=e;return Object.assign(Object.assign({display:"flex",justifyContent:"center",flexDirection:"column",minHeight:o,marginBottom:-1,padding:"0 ".concat((0,b.bf)(a)),color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary),borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.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(n,"-typography,\n > ").concat(n,"-typography-edit-content\n ")]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),["".concat(t,"-tabs-top")]:{clear:"both",marginBottom:r,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(e.colorBorderSecondary)}}})},v=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:o,lineWidth:a}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:"\n ".concat((0,b.bf)(a)," 0 0 0 ").concat(n,",\n 0 ").concat((0,b.bf)(a)," 0 0 ").concat(n,",\n ").concat((0,b.bf)(a)," ").concat((0,b.bf)(a)," 0 0 ").concat(n,",\n ").concat((0,b.bf)(a)," 0 0 0 ").concat(n," inset,\n 0 ").concat((0,b.bf)(a)," 0 0 ").concat(n," inset;\n "),transition:"all ".concat(e.motionDurationMid),"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:o}}},y=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:o,cardActionsIconSize:a,colorBorderSecondary:r,actionsBg:i}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:"none",background:i,borderTop:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r),display:"flex",borderRadius:"0 0 ".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG))},(0,p.dF)()),{"& > li":{margin:o,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:"color ".concat(e.motionDurationMid)},["a:not(".concat(t,"-btn), > ").concat(n)]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:(0,b.bf)(e.fontHeight),transition:"color ".concat(e.motionDurationMid),"&:hover":{color:e.colorPrimary}},["> ".concat(n)]:{fontSize:a,lineHeight:(0,b.bf)(e.calc(a).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(r)}}})},x=e=>Object.assign(Object.assign({margin:"".concat((0,b.bf)(e.calc(e.marginXXS).mul(-1).equal())," 0"),display:"flex"},(0,p.dF)()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},p.vS),"&-description":{color:e.colorTextDescription}}),k=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:o,bodyPadding:a}=e;return{["".concat(t,"-head")]:{padding:"0 ".concat((0,b.bf)(o)),background:n,"&-title":{fontSize:e.fontSize}},["".concat(t,"-body")]:{padding:"".concat((0,b.bf)(e.padding)," ").concat((0,b.bf)(a))}}},w=e=>{let{componentCls:t}=e;return{overflow:"hidden",["".concat(t,"-body")]:{userSelect:"none"}}},O=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:o,colorBorderSecondary:a,boxShadowTertiary:r,bodyPadding:i,extraColor:c}=e;return{[t]:Object.assign(Object.assign({},(0,p.Wf)(e)),{position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,["&:not(".concat(t,"-bordered)")]:{boxShadow:r},["".concat(t,"-head")]:h(e),["".concat(t,"-extra")]:{marginInlineStart:"auto",color:c,fontWeight:"normal",fontSize:e.fontSize},["".concat(t,"-body")]:{padding:i,borderRadius:"0 0 ".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG))},["".concat(t,"-grid")]:v(e),["".concat(t,"-cover")]:{"> *":{display:"block",width:"100%",borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0")}},["".concat(t,"-actions")]:y(e),["".concat(t,"-meta")]:x(e)}),["".concat(t,"-bordered")]:{border:"".concat((0,b.bf)(e.lineWidth)," ").concat(e.lineType," ").concat(a),["".concat(t,"-cover")]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},["".concat(t,"-hoverable")]:{cursor:"pointer",transition:"box-shadow ".concat(e.motionDurationMid,", border-color ").concat(e.motionDurationMid),"&:hover":{borderColor:"transparent",boxShadow:n}},["".concat(t,"-contain-grid")]:{borderRadius:"".concat((0,b.bf)(e.borderRadiusLG)," ").concat((0,b.bf)(e.borderRadiusLG)," 0 0 "),["".concat(t,"-body")]:{display:"flex",flexWrap:"wrap"},["&:not(".concat(t,"-loading) ").concat(t,"-body")]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},["".concat(t,"-contain-tabs")]:{["> div".concat(t,"-head")]:{minHeight:0,["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:o}}},["".concat(t,"-type-inner")]:k(e),["".concat(t,"-loading")]:w(e),["".concat(t,"-rtl")]:{direction:"rtl"}}},E=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:o,headerHeightSM:a,headerFontSizeSM:r}=e;return{["".concat(t,"-small")]:{["> ".concat(t,"-head")]:{minHeight:a,padding:"0 ".concat((0,b.bf)(o)),fontSize:r,["> ".concat(t,"-head-wrapper")]:{["> ".concat(t,"-extra")]:{fontSize:e.fontSize}}},["> ".concat(t,"-body")]:{padding:n}},["".concat(t,"-small").concat(t,"-contain-tabs")]:{["> ".concat(t,"-head")]:{["".concat(t,"-head-title, ").concat(t,"-extra")]:{paddingTop:0,display:"flex",alignItems:"center"}}}}};var S=(0,f.I$)("Card",e=>{let t=(0,g.IX)(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[O(t),E(t)]},e=>{var t,n;return{headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+2*e.padding,headerHeightSM:e.fontSize*e.lineHeight+2*e.paddingXS,actionsBg:e.colorBgContainer,actionsLiMargin:"".concat(e.paddingSM,"px 0"),tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:null!==(t=e.bodyPadding)&&void 0!==t?t:e.paddingLG,headerPadding:null!==(n=e.headerPadding)&&void 0!==n?n:e.paddingLG}}),C=n(56250),j=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let N=e=>{let{actionClasses:t,actions:n=[],actionStyle:a}=e;return o.createElement("ul",{className:t,style:a},n.map((e,t)=>o.createElement("li",{style:{width:"".concat(100/n.length,"%")},key:"action-".concat(t)},o.createElement("span",null,e))))},z=o.forwardRef((e,t)=>{let n;let{prefixCls:a,className:u,rootClassName:b,style:p,extra:f,headStyle:g={},bodyStyle:h={},title:v,loading:y,bordered:x,variant:k,size:w,type:O,cover:E,actions:z,tabList:L,children:T,activeTabKey:Z,defaultActiveTabKey:P,tabBarExtraContent:M,hoverable:R,tabProps:I={},classNames:B,styles:W}=e,D=j(e,["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:H,direction:A,card:F}=o.useContext(c.E_),[q]=(0,C.Z)("card",k,x),G=e=>{var t;return r()(null===(t=null==F?void 0:F.classNames)||void 0===t?void 0:t[e],null==B?void 0:B[e])},K=e=>{var t;return Object.assign(Object.assign({},null===(t=null==F?void 0:F.styles)||void 0===t?void 0:t[e]),null==W?void 0:W[e])},V=o.useMemo(()=>{let e=!1;return o.Children.forEach(T,t=>{(null==t?void 0:t.type)===m&&(e=!0)}),e},[T]),_=H("card",a),[X,Y,$]=S(_),U=o.createElement(s.Z,{loading:!0,active:!0,paragraph:{rows:4},title:!1},T),Q=void 0!==Z,J=Object.assign(Object.assign({},I),{[Q?"activeKey":"defaultActiveKey"]:Q?Z:P,tabBarExtraContent:M}),ee=(0,l.Z)(w),et=ee&&"default"!==ee?ee:"large",en=L?o.createElement(d.default,Object.assign({size:et},J,{className:"".concat(_,"-head-tabs"),onChange:t=>{var n;null===(n=e.onTabChange)||void 0===n||n.call(e,t)},items:L.map(e=>{var{tab:t}=e;return Object.assign({label:t},j(e,["tab"]))})})):null;if(v||f||en){let e=r()("".concat(_,"-head"),G("header")),t=r()("".concat(_,"-head-title"),G("title")),a=r()("".concat(_,"-extra"),G("extra")),i=Object.assign(Object.assign({},g),K("header"));n=o.createElement("div",{className:e,style:i},o.createElement("div",{className:"".concat(_,"-head-wrapper")},v&&o.createElement("div",{className:t,style:K("title")},v),f&&o.createElement("div",{className:a,style:K("extra")},f)),en)}let eo=r()("".concat(_,"-cover"),G("cover")),ea=E?o.createElement("div",{className:eo,style:K("cover")},E):null,er=r()("".concat(_,"-body"),G("body")),ei=Object.assign(Object.assign({},h),K("body")),ec=o.createElement("div",{className:er,style:ei},y?U:T),el=r()("".concat(_,"-actions"),G("actions")),es=(null==z?void 0:z.length)?o.createElement(N,{actionClasses:el,actionStyle:K("actions"),actions:z}):null,ed=(0,i.Z)(D,["onTabChange"]),eu=r()(_,null==F?void 0:F.className,{["".concat(_,"-loading")]:y,["".concat(_,"-bordered")]:"borderless"!==q,["".concat(_,"-hoverable")]:R,["".concat(_,"-contain-grid")]:V,["".concat(_,"-contain-tabs")]:null==L?void 0:L.length,["".concat(_,"-").concat(ee)]:ee,["".concat(_,"-type-").concat(O)]:!!O,["".concat(_,"-rtl")]:"rtl"===A},u,b,Y,$),em=Object.assign(Object.assign({},null==F?void 0:F.style),p);return X(o.createElement("div",Object.assign({ref:t},ed,{className:eu,style:em}),n,ea,ec,es))});var 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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};z.Grid=m,z.Meta=e=>{let{prefixCls:t,className:n,avatar:a,title:i,description:l}=e,s=L(e,["prefixCls","className","avatar","title","description"]),{getPrefixCls:d}=o.useContext(c.E_),u=d("card",t),m=r()("".concat(u,"-meta"),n),b=a?o.createElement("div",{className:"".concat(u,"-meta-avatar")},a):null,p=i?o.createElement("div",{className:"".concat(u,"-meta-title")},i):null,f=l?o.createElement("div",{className:"".concat(u,"-meta-description")},l):null,g=p||f?o.createElement("div",{className:"".concat(u,"-meta-detail")},p,f):null;return o.createElement("div",Object.assign({},s,{className:m}),b,g)};var T=z},69410:function(e,t,n){var o=n(54998);t.Z=o.Z},867:function(e,t,n){n.d(t,{Z:function(){return S}});var o=n(2265),a=n(54537),r=n(36760),i=n.n(r),c=n(50506),l=n(18694),s=n(71744),d=n(79326),u=n(59367),m=n(92570),b=n(5545),p=n(51248),f=n(55274),g=n(37381),h=n(20435),v=n(99320);let y=e=>{let{componentCls:t,iconCls:n,antCls:o,zIndexPopup:a,colorText:r,colorWarning:i,marginXXS:c,marginXS:l,fontSize:s,fontWeightStrong:d,colorTextHeading:u}=e;return{[t]:{zIndex:a,["&".concat(o,"-popover")]:{fontSize:s},["".concat(t,"-message")]:{marginBottom:l,display:"flex",flexWrap:"nowrap",alignItems:"start",["> ".concat(t,"-message-icon ").concat(n)]:{color:i,fontSize:s,lineHeight:1,marginInlineEnd:l},["".concat(t,"-title")]:{fontWeight:d,color:u,"&:only-child":{fontWeight:"normal"}},["".concat(t,"-description")]:{marginTop:c,color:r}},["".concat(t,"-buttons")]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:l}}}}};var x=(0,v.I$)("Popconfirm",e=>y(e),e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),k=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let w=e=>{let{prefixCls:t,okButtonProps:n,cancelButtonProps:r,title:i,description:c,cancelText:l,okText:d,okType:h="primary",icon:v=o.createElement(a.Z,null),showCancel:y=!0,close:x,onConfirm:k,onCancel:w,onPopupClick:O}=e,{getPrefixCls:E}=o.useContext(s.E_),[S]=(0,f.Z)("Popconfirm",g.Z.Popconfirm),C=(0,m.Z)(i),j=(0,m.Z)(c);return o.createElement("div",{className:"".concat(t,"-inner-content"),onClick:O},o.createElement("div",{className:"".concat(t,"-message")},v&&o.createElement("span",{className:"".concat(t,"-message-icon")},v),o.createElement("div",{className:"".concat(t,"-message-text")},C&&o.createElement("div",{className:"".concat(t,"-title")},C),j&&o.createElement("div",{className:"".concat(t,"-description")},j))),o.createElement("div",{className:"".concat(t,"-buttons")},y&&o.createElement(b.ZP,Object.assign({onClick:w,size:"small"},r),l||(null==S?void 0:S.cancelText)),o.createElement(u.Z,{buttonProps:Object.assign(Object.assign({size:"small"},(0,p.nx)(h)),n),actionFn:k,close:x,prefixCls:E("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},d||(null==S?void 0:S.okText))))};var O=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 a=0,o=Object.getOwnPropertySymbols(e);at.indexOf(o[a])&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]]);return n};let E=o.forwardRef((e,t)=>{var n,r;let{prefixCls:u,placement:m="top",trigger:b="click",okType:p="primary",icon:f=o.createElement(a.Z,null),children:g,overlayClassName:h,onOpenChange:v,onVisibleChange:y,overlayStyle:k,styles:E,classNames:S}=e,C=O(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:j,className:N,style:z,classNames:L,styles:T}=(0,s.dj)("popconfirm"),[Z,P]=(0,c.Z)(!1,{value:null!==(n=e.open)&&void 0!==n?n:e.visible,defaultValue:null!==(r=e.defaultOpen)&&void 0!==r?r:e.defaultVisible}),M=(e,t)=>{P(e,!0),null==y||y(e),null==v||v(e,t)},R=j("popconfirm",u),I=i()(R,N,h,L.root,null==S?void 0:S.root),B=i()(L.body,null==S?void 0:S.body),[W]=x(R);return W(o.createElement(d.Z,Object.assign({},(0,l.Z)(C,["title"]),{trigger:b,placement:m,onOpenChange:(t,n)=>{let{disabled:o=!1}=e;o||M(t,n)},open:Z,ref:t,classNames:{root:I,body:B},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},T.root),z),k),null==E?void 0:E.root),body:Object.assign(Object.assign({},T.body),null==E?void 0:E.body)},content:o.createElement(w,Object.assign({okType:p,icon:f},e,{prefixCls:R,close:e=>{M(!1,e)},onConfirm:t=>{var n;return null===(n=e.onConfirm)||void 0===n?void 0:n.call(void 0,t)},onCancel:t=>{var n;M(!1,t),null===(n=e.onCancel)||void 0===n||n.call(void 0,t)}})),"data-popover-inject":!0}),g))});E._InternalPanelDoNotUseOrYouWillBeFired=e=>{let{prefixCls:t,placement:n,className:a,style:r}=e,c=k(e,["prefixCls","placement","className","style"]),{getPrefixCls:l}=o.useContext(s.E_),d=l("popconfirm",t),[u]=x(d);return u(o.createElement(h.ZP,{placement:n,className:i()(d,a),style:r,content:o.createElement(w,Object.assign({prefixCls:d},c))}))};var S=E},47451:function(e,t,n){var o=n(77774);t.Z=o.Z},30401:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},87769:function(e,t,n){n.d(t,{Z:function(){return o}});let o=(0,n(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,n){n.d(t,{Z:function(){return o}});let o=(0,n(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"}]])},2356:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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},15731:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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=a},45589:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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=a},53410:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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=a},91126:function(e,t,n){var o=n(2265);let a=o.forwardRef(function(e,t){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:t},e),o.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"}),o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))});t.Z=a}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4292-28669d6dfecbbf62.js b/litellm/proxy/_experimental/out/_next/static/chunks/4292-28669d6dfecbbf62.js deleted file mode 100644 index db96efde94..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/4292-28669d6dfecbbf62.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4292],{84717:function(e,s,t){t.d(s,{Ct:function(){return a.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 a=t(41649),l=t(78489),r=t(12514),i=t(67101),n=t(12485),d=t(18135),o=t(35242),c=t(29706),m=t(77991),u=t(84264),x=t(96761)},40728:function(e,s,t){t.d(s,{C:function(){return a.Z},x:function(){return l.Z}});var a=t(41649),l=t(84264)},16721:function(e,s,t){t.d(s,{Dx:function(){return d.Z},JX:function(){return l.Z},oi:function(){return n.Z},rj:function(){return r.Z},xv:function(){return i.Z},zx:function(){return a.Z}});var a=t(78489),l=t(49804),r=t(67101),i=t(84264),n=t(49566),d=t(96761)},64504:function(e,s,t){t.d(s,{o:function(){return l.Z},z:function(){return a.Z}});var a=t(78489),l=t(49566)},67479:function(e,s,t){var a=t(57437),l=t(2265),r=t(37592),i=t(19250);s.Z=e=>{let{onChange:s,value:t,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,a.jsx)("div",{children:(0,a.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:t,loading:u,className:n,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,t){var a=t(57437);t(2265);var l=t(40728),r=t(82182),i=t(91777),n=t(97434);s.Z=function(e){let{loggingConfigs:s=[],disabledCallbacks:t=[],variant:d="card",className:o=""}=e,c=e=>{var s;return(null===(s=Object.entries(n.Lo).find(s=>{let[t,a]=s;return a===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,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Integrations"}),(0,a.jsx)(l.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"space-y-3",children:s.map((e,s)=>{var t;let i=c(e.callback_name),d=null===(t=n.Dg[i])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-blue-50 border border-blue-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:i,className:"w-5 h-5 object-contain"}):(0,a.jsx)(r.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-blue-800",children:i}),(0,a.jsxs)(l.x,{className:"text-xs text-blue-600",children:[Object.keys(e.callback_vars).length," parameters configured"]})]})]}),(0,a.jsx)(l.C,{color:m(e.callback_type),size:"sm",children:u(e.callback_type)})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(r.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No logging integrations configured"})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Disabled Callbacks"}),(0,a.jsx)(l.C,{color:"red",size:"xs",children:t.length})]}),t.length>0?(0,a.jsx)("div",{className:"space-y-3",children:t.map((e,s)=>{var t;let r=n.RD[e]||e,d=null===(t=n.Dg[r])||void 0===t?void 0:t.logo;return(0,a.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg bg-red-50 border border-red-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[d?(0,a.jsx)("img",{src:d,alt:r,className:"w-5 h-5 object-contain"}):(0,a.jsx)(i.Z,{className:"h-5 w-5 text-gray-400"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-medium text-red-800",children:r}),(0,a.jsx)(l.x,{className:"text-xs text-red-600",children:"Disabled for this key"})]})]}),(0,a.jsx)(l.C,{color:"red",size:"sm",children:"Disabled"})]},s)})}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(i.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(l.x,{className:"text-gray-500 text-sm",children:"No callbacks disabled"})]})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.x,{className:"font-semibold text-gray-900",children:"Logging Settings"}),(0,a.jsx)(l.x,{className:"text-xs text-gray-500",children:"Active logging integrations and disabled callbacks for this key"})]})}),x]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(l.x,{className:"font-medium text-gray-900 mb-3",children:"Logging Settings"}),x]})}},98015:function(e,s,t){t.d(s,{Z:function(){return g}});var a=t(57437),l=t(2265),r=t(92280),i=t(40728),n=t(79814),d=t(19250),o=function(e){let{vectorStores:s,accessToken:t}=e,[r,o]=(0,l.useState)([]);(0,l.useEffect)(()=>{(async()=>{if(t&&0!==s.length)try{let e=await (0,d.vectorStoreListCall)(t);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)}})()},[t,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,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"Vector Stores"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:s.length})]}),s.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map((e,s)=>(0,a.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,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No vector stores configured"})]})]})},c=t(25327),m=t(86462),u=t(47686),x=t(99981),h=function(e){let{mcpServers:s,mcpAccessGroups:r=[],mcpToolPermissions:n={},accessToken:o}=e,[h,g]=(0,l.useState)([]),[p,j]=(0,l.useState)([]),[v,b]=(0,l.useState)(new Set),y=e=>{b(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})};(0,l.useEffect)(()=>{(async()=>{if(o&&s.length>0)try{let e=await (0,d.fetchMCPServers)(o);e&&Array.isArray(e)?g(e):e.data&&Array.isArray(e.data)&&g(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(t.bind(t,19250)).then(e=>e.fetchMCPAccessGroups(o));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let _=e=>{let s=h.find(s=>s.server_id===e);if(s){let t=e.length>7?"".concat(e.slice(0,3),"...").concat(e.slice(-4)):e;return"".concat(s.alias," (").concat(t,")")}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,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(i.x,{className:"font-semibold text-gray-900",children:"MCP Servers"}),(0,a.jsx)(i.C,{color:"blue",size:"xs",children:k})]}),k>0?(0,a.jsx)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:N.map((e,s)=>{let t="server"===e.type?n[e.value]:void 0,l=t&&t.length>0,r=v.has(e.value);return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{onClick:()=>l&&y(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,a.jsx)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:"server"===e.type?(0,a.jsx)(x.Z,{title:"Full ID: ".concat(e.value),placement:"top",children:(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-blue-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:_(e.value)})]})}):(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-green-500 rounded-full flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm font-medium text-gray-900 truncate",children:f(e.value)}),(0,a.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,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-gray-600",children:t.length}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:1===t.length?"tool":"tools"}),r?(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"}):(0,a.jsx)(u.Z,{className:"h-3.5 w-3.5 text-gray-400 ml-0.5"})]})]}),l&&r&&(0,a.jsx)("div",{className:"ml-4 pl-4 border-l-2 border-blue-200 pb-1",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.map((e,s)=>(0,a.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,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-50 border border-gray-200",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4 text-gray-400"}),(0,a.jsx)(i.x,{className:"text-gray-500 text-sm",children:"No MCP servers or access groups configured"})]})]})},g=function(e){let{objectPermission:s,variant:t="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=(0,a.jsxs)("div",{className:"card"===t?"grid grid-cols-1 md:grid-cols-2 gap-6":"space-y-4",children:[(0,a.jsx)(o,{vectorStores:n,accessToken:i}),(0,a.jsx)(h,{mcpServers:d,mcpAccessGroups:c,mcpToolPermissions:m,accessToken:i})]});return"card"===t?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(l),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(r.x,{className:"font-semibold text-gray-900",children:"Object Permissions"}),(0,a.jsx)(r.x,{className:"text-xs text-gray-500",children:"Access control for Vector Stores and MCP Servers"})]})}),u]}):(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsx)(r.x,{className:"font-medium text-gray-900 mb-3",children:"Object Permissions"}),u]})}},21425:function(e,s,t){var a=t(57437);t(2265);var l=t(54507);s.Z=e=>{let{value:s,onChange:t,disabledCallbacks:r=[],onDisabledCallbacksChange:i}=e;return(0,a.jsx)(l.Z,{value:s,onChange:t,disabledCallbacks:r,onDisabledCallbacksChange:i})}},94292:function(e,s,t){t.d(s,{Z:function(){return ee}});var a=t(57437),l=t(59872),r=t(33304),i=t(10900),n=t(23628),d=t(74998),o=t(84717),c=t(10032),m=t(5545),u=t(99981),x=t(30401),h=t(78867),g=t(2265),p=t(20347),j=t(97434),v=t(40728),b=t(58710),y=e=>{let{autoRotate:s=!1,rotationInterval:t,lastRotationAt:l,keyRotationAt:r,nextRotationAt:i,variant:d="card",className:o=""}=e,c=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)},m=(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,a.jsx)(v.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(v.C,{color:s?"green":"gray",size:"xs",children:s?"Enabled":"Disabled"}),s&&t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.x,{className:"text-gray-400",children:"•"}),(0,a.jsxs)(v.x,{className:"text-sm text-gray-600",children:["Every ",t]})]})]})}),(s||l||r||i)&&(0,a.jsxs)("div",{className:"space-y-3",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(v.x,{className:"font-medium text-gray-700",children:"Last Rotation"}),(0,a.jsx)(v.x,{className:"text-sm text-gray-600",children:c(l)})]})]}),(r||i)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-200 rounded-md",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)(v.x,{className:"font-medium text-gray-700",children:"Next Scheduled Rotation"}),(0,a.jsx)(v.x,{className:"text-sm text-gray-600",children:c(i||r||"")})]})]}),s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4 text-gray-500"}),(0,a.jsx)(v.x,{className:"text-gray-600",children:"No rotation history available"})]})]}),!s&&!l&&!r&&!i&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-gray-50 border border-gray-100 rounded-md",children:[(0,a.jsx)(n.Z,{className:"w-4 h-4 text-gray-400"}),(0,a.jsx)(v.x,{className:"text-gray-600",children:"Auto-rotation is not enabled for this key"})]})]});return"card"===d?(0,a.jsxs)("div",{className:"bg-white border border-gray-200 rounded-lg p-6 ".concat(o),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-6",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(v.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,a.jsx)(v.x,{className:"text-xs text-gray-500",children:"Automatic key rotation settings and status for this key"})]})}),m]}):(0,a.jsxs)("div",{className:"".concat(o),children:[(0,a.jsx)(v.x,{className:"font-medium text-gray-900 mb-3",children:"Auto-Rotation"}),m]})};let _=["logging"],f=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!_.includes(s)})):{},N=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],k=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(f(e),null,s)},w=e=>{if(!e||"object"!=typeof e)return e;let{tags:s,...t}=e;return t};var Z=t(27799),S=t(9114),C=t(19250),A=t(98015),I=t(16721),P=t(22116),L=t(19015),M=t(92668),D=t(29233);function T(e){let{selectedToken:s,visible:t,onClose:l,accessToken:r,premiumUser:i,setAccessToken:n,onKeyUpdate:d}=e,[o]=c.Z.useForm(),[m,u]=(0,g.useState)(null),[x,h]=(0,g.useState)(null),[p,j]=(0,g.useState)(null),[v,b]=(0,g.useState)(!1),[y,_]=(0,g.useState)(!1),[f,N]=(0,g.useState)(null);(0,g.useEffect)(()=>{t&&s&&r&&(o.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),N(r),_(s.key_name===r))},[t,s,o,r]),(0,g.useEffect)(()=>{t||(u(null),b(!1),_(!1),N(null),o.resetFields())},[t,o]);let k=e=>{if(!e)return null;try{let s;let t=new Date;if(e.endsWith("s"))s=(0,M.I)(t,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,M.I)(t,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,M.I)(t,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,g.useEffect)(()=>{(null==x?void 0:x.duration)?j(k(x.duration)):j(null)},[null==x?void 0:x.duration]);let w=async()=>{if(s&&f){b(!0);try{let e=await o.validateFields(),t=await (0,C.regenerateKeyCall)(f,s.token||s.token_id,e);u(t.key),S.Z.success("API Key regenerated successfully"),console.log("Full regenerate response:",t);let a={token:t.token||t.key_id||s.token,key_name:t.key,max_budget:e.max_budget,tpm_limit:e.tpm_limit,rpm_limit:e.rpm_limit,expires:e.duration?k(e.duration):s.expires,...t};console.log("Updated key data with new token:",a),y&&(N(t.key),n&&n(t.key)),d&&d(a),b(!1)}catch(e){console.error("Error regenerating key:",e),S.Z.fromBackend(e),b(!1)}}},Z=()=>{u(null),b(!1),_(!1),N(null),o.resetFields(),l()};return(0,a.jsx)(P.Z,{title:"Regenerate API Key",open:t,onCancel:Z,footer:m?[(0,a.jsx)(I.zx,{onClick:Z,children:"Close"},"close")]:[(0,a.jsx)(I.zx,{onClick:Z,className:"mr-2",children:"Cancel"},"cancel"),(0,a.jsx)(I.zx,{onClick:w,disabled:v,children:v?"Regenerating...":"Regenerate"},"regenerate")],children:m?(0,a.jsxs)(I.rj,{numItems:1,className:"gap-2 w-full",children:[(0,a.jsx)(I.Dx,{children:"Regenerated Key"}),(0,a.jsx)(I.JX,{numColSpan:1,children:(0,a.jsxs)("p",{children:["Please replace your old key with the new key generated. For security reasons,"," ",(0,a.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,a.jsxs)(I.JX,{numColSpan:1,children:[(0,a.jsx)(I.xv,{className:"mt-3",children:"Key Alias:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:(null==s?void 0:s.key_alias)||"No alias set"})}),(0,a.jsx)(I.xv,{className:"mt-3",children:"New API Key:"}),(0,a.jsx)("div",{className:"bg-gray-100 p-2 rounded mb-2",children:(0,a.jsx)("pre",{className:"break-words whitespace-normal",children:m})}),(0,a.jsx)(D.CopyToClipboard,{text:m,onCopy:()=>S.Z.success("API Key copied to clipboard"),children:(0,a.jsx)(I.zx,{className:"mt-3",children:"Copy API Key"})})]})]}):(0,a.jsxs)(c.Z,{form:o,layout:"vertical",onValuesChange:e=>{"duration"in e&&h(s=>({...s,duration:e.duration}))},children:[(0,a.jsx)(c.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,a.jsx)(I.oi,{disabled:!0})}),(0,a.jsx)(c.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,a.jsx)(L.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,a.jsx)(L.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,a.jsx)(L.Z,{style:{width:"100%"}})}),(0,a.jsx)(c.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,a.jsx)(I.oi,{placeholder:""})}),(0,a.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"]}),p&&(0,a.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",p]})]})})}var R=t(85968),E=t(67479),z=t(64504),F=t(37592),K=t(4260),O=t(63709),U=t(62099),V=t(95096),G=t(65895),B=t(95920),W=t(68473),q=t(30874),J=t(24199),$=t(21425),Q=t(97415),X=t(15424);let Y=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 H(e){var s,t,l,r,i,n,d,o,m,x,h,p;let{keyData:v,onCancel:b,onSubmit:y,teams:_,accessToken:f,userID:Z,userRole:A,premiumUser:I=!1}=e,[P]=c.Z.useForm(),[L,M]=(0,g.useState)([]),[D,T]=(0,g.useState)([]),[R,H]=(0,g.useState)({}),ee=null==_?void 0:_.find(e=>e.team_id===v.team_id),[es,et]=(0,g.useState)([]),[ea,el]=(0,g.useState)([]),[er,ei]=(0,g.useState)(!1),[en,ed]=(0,g.useState)(Array.isArray(null===(s=v.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,j.PA)(v.metadata.litellm_disabled_callbacks):[]),[eo,ec]=(0,g.useState)(v.auto_rotate||!1),[em,eu]=(0,g.useState)(v.rotation_interval||""),[ex,eh]=(0,g.useState)(!1);(0,g.useEffect)(()=>{let e=async()=>{if(Z&&A&&f)try{if(null===v.team_id){let e=(await (0,C.modelAvailableCall)(f,Z,A)).data.map(e=>e.id);et(e)}else if(null==ee?void 0:ee.team_id){let e=await (0,q.wk)(Z,A,f,ee.team_id);et(Array.from(new Set([...ee.models,...e])))}}catch(e){console.error("Error fetching models:",e)}};(async()=>{if(f)try{let e=await (0,C.getPromptsList)(f);T(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}})(),e()},[Z,A,f,ee,v.team_id]),(0,g.useEffect)(()=>{P.setFieldValue("disabled_callbacks",en)},[P,en]);let eg=e=>e&&({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||null,ep={...v,token:v.token||v.token_id,budget_duration:eg(v.budget_duration),metadata:k(w(v.metadata)),guardrails:null===(t=v.metadata)||void 0===t?void 0:t.guardrails,disable_global_guardrails:(null===(l=v.metadata)||void 0===l?void 0:l.disable_global_guardrails)||!1,prompts:null===(r=v.metadata)||void 0===r?void 0:r.prompts,tags:null===(i=v.metadata)||void 0===i?void 0:i.tags,vector_stores:(null===(n=v.object_permission)||void 0===n?void 0:n.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(d=v.object_permission)||void 0===d?void 0:d.mcp_servers)||[],accessGroups:(null===(o=v.object_permission)||void 0===o?void 0:o.mcp_access_groups)||[]},mcp_tool_permissions:(null===(m=v.object_permission)||void 0===m?void 0:m.mcp_tool_permissions)||{},logging_settings:N(v.metadata),disabled_callbacks:Array.isArray(null===(x=v.metadata)||void 0===x?void 0:x.litellm_disabled_callbacks)?(0,j.PA)(v.metadata.litellm_disabled_callbacks):[],auto_rotate:v.auto_rotate||!1,...v.rotation_interval&&{rotation_interval:v.rotation_interval},allowed_routes:v.allowed_routes};(0,g.useEffect)(()=>{var e,s,t,a,l,r,i,n,d;P.setFieldsValue({...v,token:v.token||v.token_id,budget_duration:eg(v.budget_duration),metadata:k(w(v.metadata)),guardrails:null===(e=v.metadata)||void 0===e?void 0:e.guardrails,disable_global_guardrails:(null===(s=v.metadata)||void 0===s?void 0:s.disable_global_guardrails)||!1,prompts:null===(t=v.metadata)||void 0===t?void 0:t.prompts,tags:null===(a=v.metadata)||void 0===a?void 0:a.tags,vector_stores:(null===(l=v.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(r=v.object_permission)||void 0===r?void 0:r.mcp_servers)||[],accessGroups:(null===(i=v.object_permission)||void 0===i?void 0:i.mcp_access_groups)||[]},mcp_tool_permissions:(null===(n=v.object_permission)||void 0===n?void 0:n.mcp_tool_permissions)||{},logging_settings:N(v.metadata),disabled_callbacks:Array.isArray(null===(d=v.metadata)||void 0===d?void 0:d.litellm_disabled_callbacks)?(0,j.PA)(v.metadata.litellm_disabled_callbacks):[],auto_rotate:v.auto_rotate||!1,...v.rotation_interval&&{rotation_interval:v.rotation_interval},allowed_routes:v.allowed_routes})},[v,P]),(0,g.useEffect)(()=>{P.setFieldValue("auto_rotate",eo)},[eo,P]),(0,g.useEffect)(()=>{em&&P.setFieldValue("rotation_interval",em)},[em,P]),(0,g.useEffect)(()=>{(async()=>{if(f)try{let e=await (0,C.tagListCall)(f);H(e)}catch(e){S.Z.fromBackend("Error fetching tags: "+e)}})()},[f]),console.log("premiumUser:",I);let ej=async e=>{try{eh(!0),await y(e)}finally{eh(!1)}};return(0,a.jsxs)(c.Z,{form:P,onFinish:ej,initialValues:ep,layout:"vertical",children:[(0,a.jsx)(c.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,a.jsx)(z.o,{})}),(0,a.jsx)(c.Z.Item,{label:"Models",name:"models",children:(0,a.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_routes!==s.allowed_routes||e.models!==s.models,children:e=>{let{getFieldValue:s,setFieldValue:t}=e,l=s("allowed_routes")||[],r=l.includes("management_routes")||l.includes("info_routes"),i=s("models")||[];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(F.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:r,value:r?[]:i,onChange:e=>t("models",e),children:[es.length>0&&(0,a.jsx)(F.default.Option,{value:"all-team-models",children:"All Team Models"}),es.map(e=>(0,a.jsx)(F.default.Option,{value:e,children:e},e))]}),r&&(0,a.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Models field is disabled for this key type"})]})}})}),(0,a.jsx)(c.Z.Item,{label:"Key Type",children:(0,a.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_routes!==s.allowed_routes,children:e=>{let{getFieldValue:s,setFieldValue:t}=e,l=Y(s("allowed_routes"));return(0,a.jsxs)(F.default,{placeholder:"Select key type",style:{width:"100%"},optionLabelProp:"label",value:l,onChange:e=>{switch(e){case"default":t("allowed_routes",[]);break;case"llm_api":t("allowed_routes",["llm_api_routes"]);break;case"management":t("allowed_routes",["management_routes"]),t("models",[])}},children:[(0,a.jsx)(F.default.Option,{value:"default",label:"Default",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"Default"}),(0,a.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call LLM API + Management routes"})]})}),(0,a.jsx)(F.default.Option,{value:"llm_api",label:"LLM API",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"LLM API"}),(0,a.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only LLM API routes (chat/completions, embeddings, etc.)"})]})}),(0,a.jsx)(F.default.Option,{value:"management",label:"Management",children:(0,a.jsxs)("div",{style:{padding:"4px 0"},children:[(0,a.jsx)("div",{style:{fontWeight:500},children:"Management"}),(0,a.jsx)("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"2px"},children:"Can call only management routes (user/team/key management)"})]})})]})}})}),(0,a.jsx)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,a.jsx)(J.Z,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,a.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,a.jsxs)(F.default,{placeholder:"n/a",children:[(0,a.jsx)(F.default.Option,{value:"daily",children:"Daily"}),(0,a.jsx)(F.default.Option,{value:"weekly",children:"Weekly"}),(0,a.jsx)(F.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,a.jsx)(c.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,a.jsx)(J.Z,{min:0})}),(0,a.jsx)(G.Z,{type:"tpm",name:"tpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,a.jsx)(J.Z,{min:0})}),(0,a.jsx)(G.Z,{type:"rpm",name:"rpm_limit_type",showDetailedDescriptions:!1}),(0,a.jsx)(c.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,a.jsx)(J.Z,{min:0})}),(0,a.jsx)(c.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,a.jsx)(K.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,a.jsx)(K.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,a.jsx)(c.Z.Item,{label:"Guardrails",name:"guardrails",children:f&&(0,a.jsx)(E.Z,{onChange:e=>{P.setFieldValue("guardrails",e)},accessToken:f,disabled:!I})}),(0,a.jsx)(c.Z.Item,{label:(0,a.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,a.jsx)(u.Z,{title:"When enabled, this key will bypass any guardrails configured to run on every request (global guardrails)",children:(0,a.jsx)(X.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",children:(0,a.jsx)(O.Z,{disabled:!I,checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,a.jsx)(c.Z.Item,{label:"Tags",name:"tags",children:(0,a.jsx)(F.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",options:Object.values(R).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}),(0,a.jsx)(c.Z.Item,{label:"Prompts",name:"prompts",children:(0,a.jsx)(u.Z,{title:I?"":"Setting prompts by key is a premium feature",placement:"top",children:(0,a.jsx)(F.default,{mode:"tags",style:{width:"100%"},disabled:!I,placeholder:I?Array.isArray(null===(h=v.metadata)||void 0===h?void 0:h.prompts)&&v.metadata.prompts.length>0?"Current: ".concat(v.metadata.prompts.join(", ")):"Select or enter prompts":"Premium feature - Upgrade to set prompts by key",options:D.map(e=>({value:e,label:e}))})})}),(0,a.jsx)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,a.jsx)(u.Z,{title:I?"":"Setting allowed pass through routes by key is a premium feature",placement:"top",children:(0,a.jsx)(V.Z,{onChange:e=>P.setFieldValue("allowed_passthrough_routes",e),value:P.getFieldValue("allowed_passthrough_routes"),accessToken:f||"",placeholder:I?Array.isArray(null===(p=v.metadata)||void 0===p?void 0:p.allowed_passthrough_routes)&&v.metadata.allowed_passthrough_routes.length>0?"Current: ".concat(v.metadata.allowed_passthrough_routes.join(", ")):"Select or enter allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes by key",disabled:!I})})}),(0,a.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,a.jsx)(Q.Z,{onChange:e=>P.setFieldValue("vector_stores",e),value:P.getFieldValue("vector_stores"),accessToken:f||"",placeholder:"Select vector stores"})}),(0,a.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,a.jsx)(B.Z,{onChange:e=>P.setFieldValue("mcp_servers_and_groups",e),value:P.getFieldValue("mcp_servers_and_groups"),accessToken:f||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,a.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,a.jsx)(K.default,{type:"hidden"})}),(0,a.jsx)(c.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,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)(W.Z,{accessToken:f||"",selectedServers:(null===(e=P.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:P.getFieldValue("mcp_tool_permissions")||{},onChange:e=>P.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,a.jsx)(c.Z.Item,{label:"Team ID",name:"team_id",children:(0,a.jsx)(F.default,{placeholder:"Select team",style:{width:"100%"},children:null==_?void 0:_.map(e=>(0,a.jsx)(F.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,a.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,a.jsx)($.Z,{value:P.getFieldValue("logging_settings"),onChange:e=>P.setFieldValue("logging_settings",e),disabledCallbacks:en,onDisabledCallbacksChange:e=>{ed((0,j.PA)(e)),P.setFieldValue("disabled_callbacks",e)}})}),(0,a.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,a.jsx)(K.default.TextArea,{rows:10})}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(U.Z,{form:P,autoRotationEnabled:eo,onAutoRotationChange:ec,rotationInterval:em,onRotationIntervalChange:eu}),(0,a.jsx)(c.Z.Item,{name:"duration",hidden:!0,initialValue:"",children:(0,a.jsx)(K.default,{})})]}),(0,a.jsx)(c.Z.Item,{name:"token",hidden:!0,children:(0,a.jsx)(K.default,{})}),(0,a.jsx)(c.Z.Item,{name:"allowed_routes",hidden:!0,children:(0,a.jsx)(K.default,{})}),(0,a.jsx)(c.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,a.jsx)(K.default,{})}),(0,a.jsx)(c.Z.Item,{name:"auto_rotate",hidden:!0,children:(0,a.jsx)(K.default,{})}),(0,a.jsx)(c.Z.Item,{name:"rotation_interval",hidden:!0,children:(0,a.jsx)(K.default,{})}),(0,a.jsx)("div",{className:"sticky z-10 bg-white p-4 border-t border-gray-200 bottom-[-1.5rem] inset-x-[-1.5rem]",children:(0,a.jsxs)("div",{className:"flex justify-end items-center gap-2",children:[(0,a.jsx)(z.z,{variant:"secondary",onClick:b,disabled:ex,children:"Cancel"}),(0,a.jsx)(z.z,{type:"submit",loading:ex,children:"Save Changes"})]})})]})}function ee(e){var s,t,v,b,_,f,I,P;let{keyId:L,onClose:M,keyData:D,accessToken:E,userID:z,userRole:F,teams:K,onKeyDataUpdate:O,onDelete:U,premiumUser:V,setAccessToken:G,backButtonText:B="Back to Keys"}=e,[W,q]=(0,g.useState)(!1),[J]=c.Z.useForm(),[$,Q]=(0,g.useState)(!1),[X,Y]=(0,g.useState)(""),[ee,es]=(0,g.useState)(!1),[et,ea]=(0,g.useState)({}),[el,er]=(0,g.useState)(D),[ei,en]=(0,g.useState)(null),[ed,eo]=(0,g.useState)(!1);if((0,g.useEffect)(()=>{D&&er(D)},[D]),(0,g.useEffect)(()=>{if(ed){let e=setTimeout(()=>{eo(!1)},5e3);return()=>clearTimeout(e)}},[ed]),!el)return(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)(o.zx,{icon:i.Z,variant:"light",onClick:M,className:"mb-4",children:B}),(0,a.jsx)(o.xv,{children:"Key not found"})]});let ec=async e=>{try{var s,t,a,l;if(!E)return;let i=e.token;if(e.key=i,V||(delete e.guardrails,delete e.prompts),e.max_budget=(0,r.C)(e.max_budget),void 0!==e.vector_stores&&(e.object_permission={...el.object_permission,vector_stores:e.vector_stores||[]},delete e.vector_stores),void 0!==e.mcp_servers_and_groups){let{servers:s,accessGroups:t}=e.mcp_servers_and_groups||{servers:[],accessGroups:[]};e.object_permission={...el.object_permission,mcp_servers:s||[],mcp_access_groups:t||[]},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(e.max_budget=(0,r.C)(e.max_budget),e.tpm_limit=(0,r.C)(e.tpm_limit),e.rpm_limit=(0,r.C)(e.rpm_limit),e.max_parallel_requests=(0,r.C)(e.max_parallel_requests),e.metadata&&"string"==typeof e.metadata)try{let a=JSON.parse(e.metadata);"tags"in a&&delete a.tags,e.metadata={...a,...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===(t=e.disabled_callbacks)||void 0===t?void 0:t.length)>0?{litellm_disabled_callbacks:(0,j.Z3)(e.disabled_callbacks)}:{}}}catch(e){console.error("Error parsing metadata JSON:",e),S.Z.error("Invalid metadata JSON");return}else{let{tags:s,...t}=e.metadata||{};e.metadata={...t,...Array.isArray(e.tags)&&e.tags.length>0?{tags:e.tags}:{},...(null===(a=e.guardrails)||void 0===a?void 0:a.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,C.keyUpdateCall)(E,e);er(e=>e?{...e,...n}:void 0),O&&O(n),S.Z.success("Key updated successfully"),q(!1)}catch(e){S.Z.fromBackend((0,R.O)(e)),console.error("Error updating key:",e)}},em=async()=>{try{if(!E)return;await (0,C.keyDeleteCall)(E,el.token||el.token_id),S.Z.success("Key deleted successfully"),U&&U(),M()}catch(e){console.error("Error deleting the key:",e),S.Z.fromBackend(e)}Y("")},eu=async(e,s)=>{await (0,l.vQ)(e)&&(ea(e=>({...e,[s]:!0})),setTimeout(()=>{ea(e=>({...e,[s]:!1}))},2e3))},ex=e=>{let s=new Date(e),t=s.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=s.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return"".concat(t," at ").concat(a)};return(0,a.jsxs)("div",{className:"w-full h-screen p-4",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:i.Z,variant:"light",onClick:M,className:"mb-4",children:B}),(0,a.jsx)(o.Dx,{children:el.key_alias||"API Key"}),(0,a.jsxs)("div",{className:"flex items-center cursor-pointer mb-2 space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,a.jsx)(o.xv,{className:"text-gray-500 font-mono text-sm",children:el.token_id||el.token})]}),(0,a.jsx)(m.ZP,{type:"text",size:"small",icon:et["key-id"]?(0,a.jsx)(x.Z,{size:12}):(0,a.jsx)(h.Z,{size:12}),onClick:()=>eu(el.token_id||el.token,"key-id"),className:"ml-2 transition-all duration-200".concat(et["key-id"]?"text-green-600 bg-green-50 border-green-200":"text-gray-500 hover:text-gray-700 hover:bg-gray-100")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(o.xv,{className:"text-sm text-gray-500",children:el.updated_at&&el.updated_at!==el.created_at?"Updated: ".concat(ex(el.updated_at)):"Created: ".concat(ex(el.created_at))}),ed&&(0,a.jsx)(o.Ct,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),ei&&(0,a.jsx)(o.Ct,{color:"blue",size:"xs",children:"Regenerated"})]})]}),F&&p.LQ.includes(F)&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(u.Z,{title:V?"":"This is a LiteLLM Enterprise feature, and requires a valid key to use.",children:(0,a.jsx)("span",{className:"inline-block",children:(0,a.jsx)(o.zx,{icon:n.Z,variant:"secondary",onClick:()=>es(!0),className:"flex items-center",disabled:!V,children:"Regenerate Key"})})}),(0,a.jsx)(o.zx,{icon:d.Z,variant:"secondary",onClick:()=>Q(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-700",children:"Delete Key"})]})]}),(0,a.jsx)(T,{selectedToken:el,visible:ee,onClose:()=>es(!1),accessToken:E,premiumUser:V,setAccessToken:G,onKeyUpdate:e=>{er(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),en(new Date),eo(!0),O&&O({...e,created_at:new Date().toLocaleString()})}}),$&&(()=>{let e=(null==el?void 0:el.key_alias)||(null==el?void 0:el.token_id)||"API Key",s=X===e;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,a.jsx)("button",{onClick:()=>{Q(!1),Y("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",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:"M6 18L18 6M6 6l12 12"})})})]}),(0,a.jsxs)("div",{className:"px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,a.jsx)("div",{className:"text-red-500 mt-0.5",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:"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.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this API key."}),(0,a.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,a.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this API key?"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,a.jsx)("span",{className:"underline",children:e})," to confirm deletion:"]}),(0,a.jsx)("input",{type:"text",value:X,onChange:e=>Y(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,a.jsx)("button",{onClick:()=>{Q(!1),Y("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,a.jsx)("button",{onClick:em,disabled:!s,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(s?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Key"})]})]})})})(),(0,a.jsxs)(o.v0,{children:[(0,a.jsxs)(o.td,{className:"mb-4",children:[(0,a.jsx)(o.OK,{children:"Overview"}),(0,a.jsx)(o.OK,{children:"Settings"})]}),(0,a.jsxs)(o.nP,{children:[(0,a.jsx)(o.x4,{children:(0,a.jsxs)(o.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,a.jsxs)(o.Zb,{children:[(0,a.jsx)(o.xv,{children:"Spend"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(o.Dx,{children:["$",(0,l.pw)(el.spend,4)]}),(0,a.jsxs)(o.xv,{children:["of"," ",null!==el.max_budget?"$".concat((0,l.pw)(el.max_budget)):"Unlimited"]})]})]}),(0,a.jsxs)(o.Zb,{children:[(0,a.jsx)(o.xv,{children:"Rate Limits"}),(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)(o.xv,{children:["TPM: ",null!==el.tpm_limit?el.tpm_limit:"Unlimited"]}),(0,a.jsxs)(o.xv,{children:["RPM: ",null!==el.rpm_limit?el.rpm_limit:"Unlimited"]})]})]}),(0,a.jsxs)(o.Zb,{children:[(0,a.jsx)(o.xv,{children:"Models"}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:el.models&&el.models.length>0?el.models.map((e,s)=>(0,a.jsx)(o.Ct,{color:"red",children:e},s)):(0,a.jsx)(o.xv,{children:"No models specified"})})]}),(0,a.jsx)(o.Zb,{children:(0,a.jsx)(A.Z,{objectPermission:el.object_permission,variant:"inline",accessToken:E})}),(0,a.jsx)(Z.Z,{loggingConfigs:N(el.metadata),disabledCallbacks:Array.isArray(null===(s=el.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,j.PA)(el.metadata.litellm_disabled_callbacks):[],variant:"card"}),(0,a.jsx)(y,{autoRotate:el.auto_rotate,rotationInterval:el.rotation_interval,lastRotationAt:el.last_rotation_at,keyRotationAt:el.key_rotation_at,nextRotationAt:el.next_rotation_at,variant:"card"})]})}),(0,a.jsx)(o.x4,{children:(0,a.jsxs)(o.Zb,{className:"overflow-y-auto max-h-[65vh]",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,a.jsx)(o.Dx,{children:"Key Settings"}),!W&&F&&p.LQ.includes(F)&&(0,a.jsx)(o.zx,{onClick:()=>q(!0),children:"Edit Settings"})]}),W?(0,a.jsx)(H,{keyData:el,onCancel:()=>q(!1),onSubmit:ec,teams:K,accessToken:E,userID:z,userRole:F,premiumUser:V}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Key ID"}),(0,a.jsx)(o.xv,{className:"font-mono",children:el.token_id||el.token})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Key Alias"}),(0,a.jsx)(o.xv,{children:el.key_alias||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Secret Key"}),(0,a.jsx)(o.xv,{className:"font-mono",children:el.key_name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Team ID"}),(0,a.jsx)(o.xv,{children:el.team_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Organization"}),(0,a.jsx)(o.xv,{children:el.organization_id||"Not Set"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Created"}),(0,a.jsx)(o.xv,{children:ex(el.created_at)})]}),ei&&(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Last Regenerated"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(o.xv,{children:ex(ei)}),(0,a.jsx)(o.Ct,{color:"green",size:"xs",children:"Recent"})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Expires"}),(0,a.jsx)(o.xv,{children:el.expires?ex(el.expires):"Never"})]}),(0,a.jsx)(y,{autoRotate:el.auto_rotate,rotationInterval:el.rotation_interval,lastRotationAt:el.last_rotation_at,keyRotationAt:el.key_rotation_at,nextRotationAt:el.next_rotation_at,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Spend"}),(0,a.jsxs)(o.xv,{children:["$",(0,l.pw)(el.spend,4)," USD"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Budget"}),(0,a.jsx)(o.xv,{children:null!==el.max_budget?"$".concat((0,l.pw)(el.max_budget,2)):"Unlimited"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Tags"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:Array.isArray(null===(t=el.metadata)||void 0===t?void 0:t.tags)&&el.metadata.tags.length>0?el.metadata.tags.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No tags specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Prompts"}),(0,a.jsx)(o.xv,{children:Array.isArray(null===(v=el.metadata)||void 0===v?void 0:v.prompts)&&el.metadata.prompts.length>0?el.metadata.prompts.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No prompts specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Allowed Pass Through Routes"}),(0,a.jsx)(o.xv,{children:Array.isArray(null===(b=el.metadata)||void 0===b?void 0:b.allowed_passthrough_routes)&&el.metadata.allowed_passthrough_routes.length>0?el.metadata.allowed_passthrough_routes.map((e,s)=>(0,a.jsx)("span",{className:"px-2 mr-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):"No pass through routes specified"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,a.jsx)(o.xv,{children:(null===(_=el.metadata)||void 0===_?void 0:_.disable_global_guardrails)===!0?(0,a.jsx)(o.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,a.jsx)(o.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Models"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:el.models&&el.models.length>0?el.models.map((e,s)=>(0,a.jsx)("span",{className:"px-2 py-1 bg-blue-100 rounded text-xs",children:e},s)):(0,a.jsx)(o.xv,{children:"No models specified"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Rate Limits"}),(0,a.jsxs)(o.xv,{children:["TPM: ",null!==el.tpm_limit?el.tpm_limit:"Unlimited"]}),(0,a.jsxs)(o.xv,{children:["RPM: ",null!==el.rpm_limit?el.rpm_limit:"Unlimited"]}),(0,a.jsxs)(o.xv,{children:["Max Parallel Requests:"," ",null!==el.max_parallel_requests?el.max_parallel_requests:"Unlimited"]}),(0,a.jsxs)(o.xv,{children:["Model TPM Limits:"," ",(null===(f=el.metadata)||void 0===f?void 0:f.model_tpm_limit)?JSON.stringify(el.metadata.model_tpm_limit):"Unlimited"]}),(0,a.jsxs)(o.xv,{children:["Model RPM Limits:"," ",(null===(I=el.metadata)||void 0===I?void 0:I.model_rpm_limit)?JSON.stringify(el.metadata.model_rpm_limit):"Unlimited"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(o.xv,{className:"font-medium",children:"Metadata"}),(0,a.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:k(w(el.metadata))})]}),(0,a.jsx)(A.Z,{objectPermission:el.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:E}),(0,a.jsx)(Z.Z,{loggingConfigs:N(el.metadata),disabledCallbacks:Array.isArray(null===(P=el.metadata)||void 0===P?void 0:P.litellm_disabled_callbacks)?(0,j.PA)(el.metadata.litellm_disabled_callbacks):[],variant:"inline",className:"pt-4 border-t border-gray-200"})]})]})})]})]})]})}},33304:function(e,s,t){t.d(s,{C:function(){return a}});function a(e){return""===e?null:e}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4292-c551871b8fc9bf85.js b/litellm/proxy/_experimental/out/_next/static/chunks/4292-c551871b8fc9bf85.js new file mode 100644 index 0000000000..2bd58db412 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/4292-c551871b8fc9bf85.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4292],{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)},16721:function(e,s,a){a.d(s,{Dx:function(){return d.Z},JX:function(){return l.Z},oi:function(){return n.Z},rj:function(){return r.Z},xv:function(){return i.Z},zx:function(){return t.Z}});var t=a(78489),l=a(49804),r=a(67101),i=a(84264),n=a(49566),d=a(96761)},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)},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,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 j}});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,j]=(0,l.useState)([]),[v,b]=(0,l.useState)(new Set),y=e=>{b(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));j(Array.isArray(e)?e:e.data||[])}catch(e){console.error("Error fetching MCP access groups:",e)}})()},[o,r.length]);let _=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=v.has(e.value);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{onClick:()=>l&&y(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:_(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"})]})]})},j=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})}},94292:function(e,s,a){a.d(s,{Z:function(){return es}});var t=a(57437),l=a(59872),r=a(33304),i=a(77331),n=a(23628),d=a(74998),o=a(84717),c=a(10032),m=a(5545),u=a(99981),x=a(30401),g=a(78867),h=a(2265),p=a(20347),j=a(97434),v=a(40728),b=a(58710),y=e=>{let{autoRotate:s=!1,rotationInterval:a,lastRotationAt:l,keyRotationAt:r,nextRotationAt:i,variant:d="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)(n.Z,{className:"h-4 w-4 text-blue-600"}),(0,t.jsx)(v.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,t.jsx)(v.C,{color:s?"green":"gray",size:"xs",children:s?"Enabled":"Disabled"}),s&&a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.x,{className:"text-gray-400",children:"•"}),(0,t.jsxs)(v.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)(v.x,{className:"font-medium text-gray-700",children:"Last Rotation"}),(0,t.jsx)(v.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)(v.x,{className:"font-medium text-gray-700",children:"Next Scheduled Rotation"}),(0,t.jsx)(v.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)(v.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)(n.Z,{className:"w-4 h-4 text-gray-400"}),(0,t.jsx)(v.x,{className:"text-gray-600",children:"Auto-rotation is not enabled for this key"})]})]});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)(v.x,{className:"font-semibold text-gray-900",children:"Auto-Rotation"}),(0,t.jsx)(v.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)(v.x,{className:"font-medium text-gray-900 mb-3",children:"Auto-Rotation"}),m]})};let _=["logging"],f=e=>e&&"object"==typeof e?Object.fromEntries(Object.entries(e).filter(e=>{let[s]=e;return!_.includes(s)})):{},N=e=>e&&"object"==typeof e&&Array.isArray(e.logging)?e.logging:[],k=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return JSON.stringify(f(e),null,s)},w=e=>{if(!e||"object"!=typeof e)return e;let{tags:s,...a}=e;return a};var Z=a(27799),S=a(9114),C=a(19250),A=a(60131),I=a(16721),L=a(22116),P=a(19015),M=a(92668),D=a(29233);function T(e){let{selectedToken:s,visible:a,onClose:l,accessToken:r,premiumUser:i,setAccessToken:n,onKeyUpdate:d}=e,[o]=c.Z.useForm(),[m,u]=(0,h.useState)(null),[x,g]=(0,h.useState)(null),[p,j]=(0,h.useState)(null),[v,b]=(0,h.useState)(!1),[y,_]=(0,h.useState)(!1),[f,N]=(0,h.useState)(null);(0,h.useEffect)(()=>{a&&s&&r&&(o.setFieldsValue({key_alias:s.key_alias,max_budget:s.max_budget,tpm_limit:s.tpm_limit,rpm_limit:s.rpm_limit,duration:s.duration||""}),N(r),_(s.key_name===r))},[a,s,o,r]),(0,h.useEffect)(()=>{a||(u(null),b(!1),_(!1),N(null),o.resetFields())},[a,o]);let k=e=>{if(!e)return null;try{let s;let a=new Date;if(e.endsWith("s"))s=(0,M.I)(a,{seconds:parseInt(e)});else if(e.endsWith("h"))s=(0,M.I)(a,{hours:parseInt(e)});else if(e.endsWith("d"))s=(0,M.I)(a,{days:parseInt(e)});else throw Error("Invalid duration format");return s.toLocaleString()}catch(e){return null}};(0,h.useEffect)(()=>{(null==x?void 0:x.duration)?j(k(x.duration)):j(null)},[null==x?void 0:x.duration]);let w=async()=>{if(s&&f){b(!0);try{let e=await o.validateFields(),a=await (0,C.regenerateKeyCall)(f,s.token||s.token_id,e);u(a.key),S.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?k(e.duration):s.expires,...a};console.log("Updated key data with new token:",t),y&&(N(a.key),n&&n(a.key)),d&&d(t),b(!1)}catch(e){console.error("Error regenerating key:",e),S.Z.fromBackend(e),b(!1)}}},Z=()=>{u(null),b(!1),_(!1),N(null),o.resetFields(),l()};return(0,t.jsx)(L.Z,{title:"Regenerate Virtual Key",open:a,onCancel:Z,footer:m?[(0,t.jsx)(I.zx,{onClick:Z,children:"Close"},"close")]:[(0,t.jsx)(I.zx,{onClick:Z,className:"mr-2",children:"Cancel"},"cancel"),(0,t.jsx)(I.zx,{onClick:w,disabled:v,children:v?"Regenerating...":"Regenerate"},"regenerate")],children:m?(0,t.jsxs)(I.rj,{numItems:1,className:"gap-2 w-full",children:[(0,t.jsx)(I.Dx,{children:"Regenerated Key"}),(0,t.jsx)(I.JX,{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)(I.JX,{numColSpan:1,children:[(0,t.jsx)(I.xv,{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)(I.xv,{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:m})}),(0,t.jsx)(D.CopyToClipboard,{text:m,onCopy:()=>S.Z.success("Virtual Key copied to clipboard"),children:(0,t.jsx)(I.zx,{className:"mt-3",children:"Copy Virtual Key"})})]})]}):(0,t.jsxs)(c.Z,{form:o,layout:"vertical",onValuesChange:e=>{"duration"in e&&g(s=>({...s,duration:e.duration}))},children:[(0,t.jsx)(c.Z.Item,{name:"key_alias",label:"Key Alias",children:(0,t.jsx)(I.oi,{disabled:!0})}),(0,t.jsx)(c.Z.Item,{name:"max_budget",label:"Max Budget (USD)",children:(0,t.jsx)(P.Z,{step:.01,precision:2,style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{name:"tpm_limit",label:"TPM Limit",children:(0,t.jsx)(P.Z,{style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{name:"rpm_limit",label:"RPM Limit",children:(0,t.jsx)(P.Z,{style:{width:"100%"}})}),(0,t.jsx)(c.Z.Item,{name:"duration",label:"Expire Key (eg: 30s, 30h, 30d)",className:"mt-8",children:(0,t.jsx)(I.oi,{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"]}),p&&(0,t.jsxs)("div",{className:"mt-2 text-sm text-green-600",children:["New expiry: ",p]})]})})}var E=a(85968),R=a(67479),F=a(64504),z=a(37592),V=a(4260),K=a(63709),O=a(62099),U=a(95096),G=a(65895),B=a(95920),W=a(68473),q=a(82586),J=a(30874),$=a(24199),Q=a(21425),X=a(97415),Y=a(15424);let H=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 ee(e){var s,a,l,r,i,n,d,o,m,x,g,p,v,b;let{keyData:y,onCancel:_,onSubmit:f,teams:Z,accessToken:A,userID:I,userRole:L,premiumUser:P=!1}=e,[M]=c.Z.useForm(),[D,T]=(0,h.useState)([]),[E,ee]=(0,h.useState)([]),[es,ea]=(0,h.useState)({}),et=null==Z?void 0:Z.find(e=>e.team_id===y.team_id),[el,er]=(0,h.useState)([]),[ei,en]=(0,h.useState)([]),[ed,eo]=(0,h.useState)(!1),[ec,em]=(0,h.useState)(Array.isArray(null===(s=y.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,j.PA)(y.metadata.litellm_disabled_callbacks):[]),[eu,ex]=(0,h.useState)(y.auto_rotate||!1),[eg,eh]=(0,h.useState)(y.rotation_interval||""),[ep,ej]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let e=async()=>{if(I&&L&&A)try{if(null===y.team_id){let e=(await (0,C.modelAvailableCall)(A,I,L)).data.map(e=>e.id);er(e)}else if(null==et?void 0:et.team_id){let e=await (0,J.wk)(I,L,A,et.team_id);er(Array.from(new Set([...et.models,...e])))}}catch(e){console.error("Error fetching models:",e)}};(async()=>{if(A)try{let e=await (0,C.getPromptsList)(A);ee(e.prompts.map(e=>e.prompt_id))}catch(e){console.error("Failed to fetch prompts:",e)}})(),e()},[I,L,A,et,y.team_id]),(0,h.useEffect)(()=>{M.setFieldValue("disabled_callbacks",ec)},[M,ec]);let ev=e=>e&&({"24h":"daily","7d":"weekly","30d":"monthly"})[e]||null,eb={...y,token:y.token||y.token_id,budget_duration:ev(y.budget_duration),metadata:k(w(y.metadata)),guardrails:null===(a=y.metadata)||void 0===a?void 0:a.guardrails,disable_global_guardrails:(null===(l=y.metadata)||void 0===l?void 0:l.disable_global_guardrails)||!1,prompts:null===(r=y.metadata)||void 0===r?void 0:r.prompts,tags:null===(i=y.metadata)||void 0===i?void 0:i.tags,vector_stores:(null===(n=y.object_permission)||void 0===n?void 0:n.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(d=y.object_permission)||void 0===d?void 0:d.mcp_servers)||[],accessGroups:(null===(o=y.object_permission)||void 0===o?void 0:o.mcp_access_groups)||[]},mcp_tool_permissions:(null===(m=y.object_permission)||void 0===m?void 0:m.mcp_tool_permissions)||{},agents_and_groups:{agents:(null===(x=y.object_permission)||void 0===x?void 0:x.agents)||[],accessGroups:(null===(g=y.object_permission)||void 0===g?void 0:g.agent_access_groups)||[]},logging_settings:N(y.metadata),disabled_callbacks:Array.isArray(null===(p=y.metadata)||void 0===p?void 0:p.litellm_disabled_callbacks)?(0,j.PA)(y.metadata.litellm_disabled_callbacks):[],auto_rotate:y.auto_rotate||!1,...y.rotation_interval&&{rotation_interval:y.rotation_interval},allowed_routes:y.allowed_routes};(0,h.useEffect)(()=>{var e,s,a,t,l,r,i,n,d;M.setFieldsValue({...y,token:y.token||y.token_id,budget_duration:ev(y.budget_duration),metadata:k(w(y.metadata)),guardrails:null===(e=y.metadata)||void 0===e?void 0:e.guardrails,disable_global_guardrails:(null===(s=y.metadata)||void 0===s?void 0:s.disable_global_guardrails)||!1,prompts:null===(a=y.metadata)||void 0===a?void 0:a.prompts,tags:null===(t=y.metadata)||void 0===t?void 0:t.tags,vector_stores:(null===(l=y.object_permission)||void 0===l?void 0:l.vector_stores)||[],mcp_servers_and_groups:{servers:(null===(r=y.object_permission)||void 0===r?void 0:r.mcp_servers)||[],accessGroups:(null===(i=y.object_permission)||void 0===i?void 0:i.mcp_access_groups)||[]},mcp_tool_permissions:(null===(n=y.object_permission)||void 0===n?void 0:n.mcp_tool_permissions)||{},logging_settings:N(y.metadata),disabled_callbacks:Array.isArray(null===(d=y.metadata)||void 0===d?void 0:d.litellm_disabled_callbacks)?(0,j.PA)(y.metadata.litellm_disabled_callbacks):[],auto_rotate:y.auto_rotate||!1,...y.rotation_interval&&{rotation_interval:y.rotation_interval},allowed_routes:y.allowed_routes})},[y,M]),(0,h.useEffect)(()=>{M.setFieldValue("auto_rotate",eu)},[eu,M]),(0,h.useEffect)(()=>{eg&&M.setFieldValue("rotation_interval",eg)},[eg,M]),(0,h.useEffect)(()=>{(async()=>{if(A)try{let e=await (0,C.tagListCall)(A);ea(e)}catch(e){S.Z.fromBackend("Error fetching tags: "+e)}})()},[A]),console.log("premiumUser:",P);let ey=async e=>{try{ej(!0),await f(e)}finally{ej(!1)}};return(0,t.jsxs)(c.Z,{form:M,onFinish:ey,initialValues:eb,layout:"vertical",children:[(0,t.jsx)(c.Z.Item,{label:"Key Alias",name:"key_alias",children:(0,t.jsx)(F.o,{})}),(0,t.jsx)(c.Z.Item,{label:"Models",name:"models",children:(0,t.jsx)(c.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)(z.default,{mode:"multiple",placeholder:"Select models",style:{width:"100%"},disabled:r,value:r?[]:i,onChange:e=>a("models",e),children:[el.length>0&&(0,t.jsx)(z.default.Option,{value:"all-team-models",children:"All Team Models"}),el.map(e=>(0,t.jsx)(z.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)(c.Z.Item,{label:"Key Type",children:(0,t.jsx)(c.Z.Item,{noStyle:!0,shouldUpdate:(e,s)=>e.allowed_routes!==s.allowed_routes,children:e=>{let{getFieldValue:s,setFieldValue:a}=e,l=H(s("allowed_routes"));return(0,t.jsxs)(z.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)(z.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)(z.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)(z.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)(c.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,t.jsx)($.Z,{step:.01,style:{width:"100%"},placeholder:"Enter a numerical value"})}),(0,t.jsx)(c.Z.Item,{label:"Reset Budget",name:"budget_duration",children:(0,t.jsxs)(z.default,{placeholder:"n/a",children:[(0,t.jsx)(z.default.Option,{value:"daily",children:"Daily"}),(0,t.jsx)(z.default.Option,{value:"weekly",children:"Weekly"}),(0,t.jsx)(z.default.Option,{value:"monthly",children:"Monthly"})]})}),(0,t.jsx)(c.Z.Item,{label:"TPM Limit",name:"tpm_limit",children:(0,t.jsx)($.Z,{min:0})}),(0,t.jsx)(G.Z,{type:"tpm",name:"tpm_limit_type",showDetailedDescriptions:!1}),(0,t.jsx)(c.Z.Item,{label:"RPM Limit",name:"rpm_limit",children:(0,t.jsx)($.Z,{min:0})}),(0,t.jsx)(G.Z,{type:"rpm",name:"rpm_limit_type",showDetailedDescriptions:!1}),(0,t.jsx)(c.Z.Item,{label:"Max Parallel Requests",name:"max_parallel_requests",children:(0,t.jsx)($.Z,{min:0})}),(0,t.jsx)(c.Z.Item,{label:"Model TPM Limit",name:"model_tpm_limit",children:(0,t.jsx)(V.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,t.jsx)(c.Z.Item,{label:"Model RPM Limit",name:"model_rpm_limit",children:(0,t.jsx)(V.default.TextArea,{rows:4,placeholder:'{"gpt-4": 100, "claude-v1": 200}'})}),(0,t.jsx)(c.Z.Item,{label:"Guardrails",name:"guardrails",children:A&&(0,t.jsx)(R.Z,{onChange:e=>{M.setFieldValue("guardrails",e)},accessToken:A,disabled:!P})}),(0,t.jsx)(c.Z.Item,{label:(0,t.jsxs)("span",{children:["Disable Global Guardrails"," ",(0,t.jsx)(u.Z,{title:"When enabled, this key will bypass any guardrails configured to run on every request (global guardrails)",children:(0,t.jsx)(Y.Z,{style:{marginLeft:"4px"}})})]}),name:"disable_global_guardrails",valuePropName:"checked",children:(0,t.jsx)(K.Z,{disabled:!P,checkedChildren:"Yes",unCheckedChildren:"No"})}),(0,t.jsx)(c.Z.Item,{label:"Tags",name:"tags",children:(0,t.jsx)(z.default,{mode:"tags",style:{width:"100%"},placeholder:"Select or enter tags",options:Object.values(es).map(e=>({value:e.name,label:e.name,title:e.description||e.name}))})}),(0,t.jsx)(c.Z.Item,{label:"Prompts",name:"prompts",children:(0,t.jsx)(u.Z,{title:P?"":"Setting prompts by key is a premium feature",placement:"top",children:(0,t.jsx)(z.default,{mode:"tags",style:{width:"100%"},disabled:!P,placeholder:P?Array.isArray(null===(v=y.metadata)||void 0===v?void 0:v.prompts)&&y.metadata.prompts.length>0?"Current: ".concat(y.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)(c.Z.Item,{label:"Allowed Pass Through Routes",name:"allowed_passthrough_routes",children:(0,t.jsx)(u.Z,{title:P?"":"Setting allowed pass through routes by key is a premium feature",placement:"top",children:(0,t.jsx)(U.Z,{onChange:e=>M.setFieldValue("allowed_passthrough_routes",e),value:M.getFieldValue("allowed_passthrough_routes"),accessToken:A||"",placeholder:P?Array.isArray(null===(b=y.metadata)||void 0===b?void 0:b.allowed_passthrough_routes)&&y.metadata.allowed_passthrough_routes.length>0?"Current: ".concat(y.metadata.allowed_passthrough_routes.join(", ")):"Select or enter allowed pass through routes":"Premium feature - Upgrade to set allowed pass through routes by key",disabled:!P})})}),(0,t.jsx)(c.Z.Item,{label:"Vector Stores",name:"vector_stores",children:(0,t.jsx)(X.Z,{onChange:e=>M.setFieldValue("vector_stores",e),value:M.getFieldValue("vector_stores"),accessToken:A||"",placeholder:"Select vector stores"})}),(0,t.jsx)(c.Z.Item,{label:"MCP Servers / Access Groups",name:"mcp_servers_and_groups",children:(0,t.jsx)(B.Z,{onChange:e=>M.setFieldValue("mcp_servers_and_groups",e),value:M.getFieldValue("mcp_servers_and_groups"),accessToken:A||"",placeholder:"Select MCP servers or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{name:"mcp_tool_permissions",initialValue:{},hidden:!0,children:(0,t.jsx)(V.default,{type:"hidden"})}),(0,t.jsx)(c.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)(W.Z,{accessToken:A||"",selectedServers:(null===(e=M.getFieldValue("mcp_servers_and_groups"))||void 0===e?void 0:e.servers)||[],toolPermissions:M.getFieldValue("mcp_tool_permissions")||{},onChange:e=>M.setFieldsValue({mcp_tool_permissions:e})})})}}),(0,t.jsx)(c.Z.Item,{label:"Agents / Access Groups",name:"agents_and_groups",children:(0,t.jsx)(q.Z,{onChange:e=>M.setFieldValue("agents_and_groups",e),value:M.getFieldValue("agents_and_groups"),accessToken:A||"",placeholder:"Select agents or access groups (optional)"})}),(0,t.jsx)(c.Z.Item,{label:"Team ID",name:"team_id",children:(0,t.jsx)(z.default,{placeholder:"Select team",style:{width:"100%"},children:null==Z?void 0:Z.map(e=>(0,t.jsx)(z.default.Option,{value:e.team_id,children:"".concat(e.team_alias," (").concat(e.team_id,")")},e.team_id))})}),(0,t.jsx)(c.Z.Item,{label:"Logging Settings",name:"logging_settings",children:(0,t.jsx)(Q.Z,{value:M.getFieldValue("logging_settings"),onChange:e=>M.setFieldValue("logging_settings",e),disabledCallbacks:ec,onDisabledCallbacksChange:e=>{em((0,j.PA)(e)),M.setFieldValue("disabled_callbacks",e)}})}),(0,t.jsx)(c.Z.Item,{label:"Metadata",name:"metadata",children:(0,t.jsx)(V.default.TextArea,{rows:10})}),(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(O.Z,{form:M,autoRotationEnabled:eu,onAutoRotationChange:ex,rotationInterval:eg,onRotationIntervalChange:eh}),(0,t.jsx)(c.Z.Item,{name:"duration",hidden:!0,initialValue:"",children:(0,t.jsx)(V.default,{})})]}),(0,t.jsx)(c.Z.Item,{name:"token",hidden:!0,children:(0,t.jsx)(V.default,{})}),(0,t.jsx)(c.Z.Item,{name:"allowed_routes",hidden:!0,children:(0,t.jsx)(V.default,{})}),(0,t.jsx)(c.Z.Item,{name:"disabled_callbacks",hidden:!0,children:(0,t.jsx)(V.default,{})}),(0,t.jsx)(c.Z.Item,{name:"auto_rotate",hidden:!0,children:(0,t.jsx)(V.default,{})}),(0,t.jsx)(c.Z.Item,{name:"rotation_interval",hidden:!0,children:(0,t.jsx)(V.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)(F.z,{variant:"secondary",onClick:_,disabled:ep,children:"Cancel"}),(0,t.jsx)(F.z,{type:"submit",loading:ep,children:"Save Changes"})]})})]})}function es(e){var s,a,v,b,_,f,I,L;let{keyId:P,onClose:M,keyData:D,accessToken:R,userID:F,userRole:z,teams:V,onKeyDataUpdate:K,onDelete:O,premiumUser:U,setAccessToken:G,backButtonText:B="Back to Keys"}=e,[W,q]=(0,h.useState)(!1),[J]=c.Z.useForm(),[$,Q]=(0,h.useState)(!1),[X,Y]=(0,h.useState)(""),[H,es]=(0,h.useState)(!1),[ea,et]=(0,h.useState)({}),[el,er]=(0,h.useState)(D),[ei,en]=(0,h.useState)(null),[ed,eo]=(0,h.useState)(!1);if((0,h.useEffect)(()=>{D&&er(D)},[D]),(0,h.useEffect)(()=>{if(ed){let e=setTimeout(()=>{eo(!1)},5e3);return()=>clearTimeout(e)}},[ed]),!el)return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsx)(o.zx,{icon:i.Z,variant:"light",onClick:M,className:"mb-4",children:B}),(0,t.jsx)(o.xv,{children:"Key not found"})]});let ec=async e=>{try{var s,a,t,l;if(!R)return;let i=e.token;if(e.key=i,U||(delete e.guardrails,delete e.prompts),e.max_budget=(0,r.C)(e.max_budget),void 0!==e.vector_stores&&(e.object_permission={...el.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={...el.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,r.C)(e.max_budget),e.tpm_limit=(0,r.C)(e.tpm_limit),e.rpm_limit=(0,r.C)(e.rpm_limit),e.max_parallel_requests=(0,r.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),S.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,C.keyUpdateCall)(R,e);er(e=>e?{...e,...n}:void 0),K&&K(n),S.Z.success("Key updated successfully"),q(!1)}catch(e){S.Z.fromBackend((0,E.O)(e)),console.error("Error updating key:",e)}},em=async()=>{try{if(!R)return;await (0,C.keyDeleteCall)(R,el.token||el.token_id),S.Z.success("Key deleted successfully"),O&&O(),M()}catch(e){console.error("Error deleting the key:",e),S.Z.fromBackend(e)}Y("")},eu=async(e,s)=>{await (0,l.vQ)(e)&&(et(e=>({...e,[s]:!0})),setTimeout(()=>{et(e=>({...e,[s]:!1}))},2e3))},ex=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)};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)(o.zx,{icon:i.Z,variant:"light",onClick:M,className:"mb-4",children:B}),(0,t.jsx)(o.Dx,{children:el.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)(o.xv,{className:"text-xs text-gray-400 uppercase tracking-wide mt-2",children:"Key ID"}),(0,t.jsx)(o.xv,{className:"text-gray-500 font-mono text-sm",children:el.token_id||el.token})]}),(0,t.jsx)(m.ZP,{type:"text",size:"small",icon:ea["key-id"]?(0,t.jsx)(x.Z,{size:12}):(0,t.jsx)(g.Z,{size:12}),onClick:()=>eu(el.token_id||el.token,"key-id"),className:"ml-2 transition-all duration-200".concat(ea["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)(o.xv,{className:"text-sm text-gray-500",children:el.updated_at&&el.updated_at!==el.created_at?"Updated: ".concat(ex(el.updated_at)):"Created: ".concat(ex(el.created_at))}),ed&&(0,t.jsx)(o.Ct,{color:"green",size:"xs",className:"animate-pulse",children:"Recently Regenerated"}),ei&&(0,t.jsx)(o.Ct,{color:"blue",size:"xs",children:"Regenerated"})]})]}),z&&p.LQ.includes(z)&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(u.Z,{title:U?"":"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)(o.zx,{icon:n.Z,variant:"secondary",onClick:()=>es(!0),className:"flex items-center",disabled:!U,children:"Regenerate Key"})})}),(0,t.jsx)(o.zx,{icon:d.Z,variant:"secondary",onClick:()=>Q(!0),className:"flex items-center text-red-500 border-red-500 hover:text-red-700",children:"Delete Key"})]})]}),(0,t.jsx)(T,{selectedToken:el,visible:H,onClose:()=>es(!1),accessToken:R,premiumUser:U,setAccessToken:G,onKeyUpdate:e=>{er(s=>{if(s)return{...s,...e,created_at:new Date().toLocaleString()}}),en(new Date),eo(!0),K&&K({...e,created_at:new Date().toLocaleString()})}}),$&&(()=>{let e=(null==el?void 0:el.key_alias)||(null==el?void 0:el.token_id)||"Virtual Key",s=X===e;return(0,t.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-2xl min-h-[380px] py-6 overflow-hidden transform transition-all flex flex-col justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Delete Key"}),(0,t.jsx)("button",{onClick:()=>{Q(!1),Y("")},className:"text-gray-400 hover:text-gray-500 focus:outline-none",children:(0,t.jsx)("svg",{className:"w-5 h-5",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:"px-6 py-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-red-50 border border-red-100 rounded-md mb-5",children:[(0,t.jsx)("div",{className:"text-red-500 mt-0.5",children:(0,t.jsx)("svg",{className:"w-5 h-5",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-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-base font-medium text-red-600",children:"Warning: You are about to delete this Virtual Key."}),(0,t.jsx)("p",{className:"text-base text-red-600 mt-2",children:"This action is irreversible and will immediately revoke access for any applications using this key."})]})]}),(0,t.jsx)("p",{className:"text-base text-gray-600 mb-5",children:"Are you sure you want to delete this Virtual Key?"}),(0,t.jsxs)("div",{className:"mb-5",children:[(0,t.jsxs)("label",{className:"block text-base font-medium text-gray-700 mb-2",children:["Type ",(0,t.jsx)("span",{className:"underline",children:e})," to confirm deletion:"]}),(0,t.jsx)("input",{type:"text",value:X,onChange:e=>Y(e.target.value),placeholder:"Enter key name exactly",className:"w-full px-4 py-3 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 text-base",autoFocus:!0})]})]})]}),(0,t.jsxs)("div",{className:"px-6 py-4 bg-gray-50 flex justify-end gap-4",children:[(0,t.jsx)("button",{onClick:()=>{Q(!1),Y("")},className:"px-5 py-3 bg-white border border-gray-300 rounded-md text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:"Cancel"}),(0,t.jsx)("button",{onClick:em,disabled:!s,className:"px-5 py-3 rounded-md text-base font-medium text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 ".concat(s?"bg-red-600 hover:bg-red-700":"bg-red-300 cursor-not-allowed"),children:"Delete Key"})]})]})})})(),(0,t.jsxs)(o.v0,{children:[(0,t.jsxs)(o.td,{className:"mb-4",children:[(0,t.jsx)(o.OK,{children:"Overview"}),(0,t.jsx)(o.OK,{children:"Settings"})]}),(0,t.jsxs)(o.nP,{children:[(0,t.jsx)(o.x4,{children:(0,t.jsxs)(o.rj,{numItems:1,numItemsSm:2,numItemsLg:3,className:"gap-6",children:[(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.xv,{children:"Spend"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(o.Dx,{children:["$",(0,l.pw)(el.spend,4)]}),(0,t.jsxs)(o.xv,{children:["of"," ",null!==el.max_budget?"$".concat((0,l.pw)(el.max_budget)):"Unlimited"]})]})]}),(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.xv,{children:"Rate Limits"}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)(o.xv,{children:["TPM: ",null!==el.tpm_limit?el.tpm_limit:"Unlimited"]}),(0,t.jsxs)(o.xv,{children:["RPM: ",null!==el.rpm_limit?el.rpm_limit:"Unlimited"]})]})]}),(0,t.jsxs)(o.Zb,{children:[(0,t.jsx)(o.xv,{children:"Models"}),(0,t.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:el.models&&el.models.length>0?el.models.map((e,s)=>(0,t.jsx)(o.Ct,{color:"red",children:e},s)):(0,t.jsx)(o.xv,{children:"No models specified"})})]}),(0,t.jsx)(o.Zb,{children:(0,t.jsx)(A.Z,{objectPermission:el.object_permission,variant:"inline",accessToken:R})}),(0,t.jsx)(Z.Z,{loggingConfigs:N(el.metadata),disabledCallbacks:Array.isArray(null===(s=el.metadata)||void 0===s?void 0:s.litellm_disabled_callbacks)?(0,j.PA)(el.metadata.litellm_disabled_callbacks):[],variant:"card"}),(0,t.jsx)(y,{autoRotate:el.auto_rotate,rotationInterval:el.rotation_interval,lastRotationAt:el.last_rotation_at,keyRotationAt:el.key_rotation_at,nextRotationAt:el.next_rotation_at,variant:"card"})]})}),(0,t.jsx)(o.x4,{children:(0,t.jsxs)(o.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)(o.Dx,{children:"Key Settings"}),!W&&z&&p.LQ.includes(z)&&(0,t.jsx)(o.zx,{onClick:()=>q(!0),children:"Edit Settings"})]}),W?(0,t.jsx)(ee,{keyData:el,onCancel:()=>q(!1),onSubmit:ec,teams:V,accessToken:R,userID:F,userRole:z,premiumUser:U}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Key ID"}),(0,t.jsx)(o.xv,{className:"font-mono",children:el.token_id||el.token})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Key Alias"}),(0,t.jsx)(o.xv,{children:el.key_alias||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Secret Key"}),(0,t.jsx)(o.xv,{className:"font-mono",children:el.key_name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Team ID"}),(0,t.jsx)(o.xv,{children:el.team_id||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Organization"}),(0,t.jsx)(o.xv,{children:el.organization_id||"Not Set"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Created"}),(0,t.jsx)(o.xv,{children:ex(el.created_at)})]}),ei&&(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Last Regenerated"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.xv,{children:ex(ei)}),(0,t.jsx)(o.Ct,{color:"green",size:"xs",children:"Recent"})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Expires"}),(0,t.jsx)(o.xv,{children:el.expires?ex(el.expires):"Never"})]}),(0,t.jsx)(y,{autoRotate:el.auto_rotate,rotationInterval:el.rotation_interval,lastRotationAt:el.last_rotation_at,keyRotationAt:el.key_rotation_at,nextRotationAt:el.next_rotation_at,variant:"inline",className:"pt-4 border-t border-gray-200"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Spend"}),(0,t.jsxs)(o.xv,{children:["$",(0,l.pw)(el.spend,4)," USD"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Budget"}),(0,t.jsx)(o.xv,{children:null!==el.max_budget?"$".concat((0,l.pw)(el.max_budget,2)):"Unlimited"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Tags"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:Array.isArray(null===(a=el.metadata)||void 0===a?void 0:a.tags)&&el.metadata.tags.length>0?el.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)(o.xv,{className:"font-medium",children:"Prompts"}),(0,t.jsx)(o.xv,{children:Array.isArray(null===(v=el.metadata)||void 0===v?void 0:v.prompts)&&el.metadata.prompts.length>0?el.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)(o.xv,{className:"font-medium",children:"Allowed Pass Through Routes"}),(0,t.jsx)(o.xv,{children:Array.isArray(null===(b=el.metadata)||void 0===b?void 0:b.allowed_passthrough_routes)&&el.metadata.allowed_passthrough_routes.length>0?el.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)(o.xv,{className:"font-medium",children:"Disable Global Guardrails"}),(0,t.jsx)(o.xv,{children:(null===(_=el.metadata)||void 0===_?void 0:_.disable_global_guardrails)===!0?(0,t.jsx)(o.Ct,{color:"yellow",children:"Enabled - Global guardrails bypassed"}):(0,t.jsx)(o.Ct,{color:"green",children:"Disabled - Global guardrails active"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Models"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:el.models&&el.models.length>0?el.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)(o.xv,{children:"No models specified"})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Rate Limits"}),(0,t.jsxs)(o.xv,{children:["TPM: ",null!==el.tpm_limit?el.tpm_limit:"Unlimited"]}),(0,t.jsxs)(o.xv,{children:["RPM: ",null!==el.rpm_limit?el.rpm_limit:"Unlimited"]}),(0,t.jsxs)(o.xv,{children:["Max Parallel Requests:"," ",null!==el.max_parallel_requests?el.max_parallel_requests:"Unlimited"]}),(0,t.jsxs)(o.xv,{children:["Model TPM Limits:"," ",(null===(f=el.metadata)||void 0===f?void 0:f.model_tpm_limit)?JSON.stringify(el.metadata.model_tpm_limit):"Unlimited"]}),(0,t.jsxs)(o.xv,{children:["Model RPM Limits:"," ",(null===(I=el.metadata)||void 0===I?void 0:I.model_rpm_limit)?JSON.stringify(el.metadata.model_rpm_limit):"Unlimited"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(o.xv,{className:"font-medium",children:"Metadata"}),(0,t.jsx)("pre",{className:"bg-gray-100 p-2 rounded text-xs overflow-auto mt-1",children:k(w(el.metadata))})]}),(0,t.jsx)(A.Z,{objectPermission:el.object_permission,variant:"inline",className:"pt-4 border-t border-gray-200",accessToken:R}),(0,t.jsx)(Z.Z,{loggingConfigs:N(el.metadata),disabledCallbacks:Array.isArray(null===(L=el.metadata)||void 0===L?void 0:L.litellm_disabled_callbacks)?(0,j.PA)(el.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/4388-eb8fa49a76501802.js b/litellm/proxy/_experimental/out/_next/static/chunks/4388-eb8fa49a76501802.js deleted file mode 100644 index b22c5b5633..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/4388-eb8fa49a76501802.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4388],{12660:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},88009:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},37527:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},9775:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},68208:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},44625:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},41169:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},38434:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},92403:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M608 112c-167.9 0-304 136.1-304 304 0 70.3 23.9 135 63.9 186.5l-41.1 41.1-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-44.9 44.9-62.3-62.3a8.15 8.15 0 00-11.4 0l-39.8 39.8a8.15 8.15 0 000 11.4l62.3 62.3-65.3 65.3a8.03 8.03 0 000 11.3l42.3 42.3c3.1 3.1 8.2 3.1 11.3 0l253.6-253.6A304.06 304.06 0 00608 720c167.9 0 304-136.1 304-304S775.9 112 608 112zm161.2 465.2C726.2 620.3 668.9 644 608 644c-60.9 0-118.2-23.7-161.2-66.8-43.1-43-66.8-100.3-66.8-161.2 0-60.9 23.7-118.2 66.8-161.2 43-43.1 100.3-66.8 161.2-66.8 60.9 0 118.2 23.7 161.2 66.8 43.1 43 66.8 100.3 66.8 161.2 0 60.9-23.7 118.2-66.8 161.2z"}}]},name:"key",theme:"outlined"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},48231:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},28595:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},55322:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},71891:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M483.2 790.3L861.4 412c1.7-1.7 2.5-4 2.3-6.3l-25.5-301.4c-.7-7.8-6.8-13.9-14.6-14.6L522.2 64.3c-2.3-.2-4.7.6-6.3 2.3L137.7 444.8a8.03 8.03 0 000 11.3l334.2 334.2c3.1 3.2 8.2 3.2 11.3 0zm62.6-651.7l224.6 19 19 224.6L477.5 694 233.9 450.5l311.9-311.9zm60.16 186.23a48 48 0 1067.88-67.89 48 48 0 10-67.88 67.89zM889.7 539.8l-39.6-39.5a8.03 8.03 0 00-11.3 0l-362 361.3-237.6-237a8.03 8.03 0 00-11.3 0l-39.6 39.5a8.03 8.03 0 000 11.3l243.2 242.8 39.6 39.5c3.1 3.1 8.2 3.1 11.3 0l407.3-406.6c3.1-3.1 3.1-8.2 0-11.3z"}}]},name:"tags",theme:"outlined"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},41361:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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"},o=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},58630:function(e,t,a){a.d(t,{Z:function(){return l}});var r=a(1119),n=a(2265),c={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=a(55015),l=n.forwardRef(function(e,t){return n.createElement(o.Z,(0,r.Z)({},e,{ref:t,icon:c}))})},41649:function(e,t,a){a.d(t,{Z:function(){return h}});var r=a(5853),n=a(2265),c=a(47187),o=a(7084),l=a(26898),i=a(13241),s=a(1153);let f={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"}},u=(0,s.fn)("Badge"),h=n.forwardRef((e,t)=>{let{color:a,icon:h,size:m=o.u8.SM,tooltip:g,className:p,children:v}=e,w=(0,r._T)(e,["color","icon","size","tooltip","className","children"]),z=h||null,{tooltipProps:Z,getReferenceProps:y}=(0,c.l)();return n.createElement("span",Object.assign({ref:(0,s.lq)([t,Z.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",a?(0,i.q)((0,s.bM)(a,l.K.background).bgColor,(0,s.bM)(a,l.K.iconText).textColor,(0,s.bM)(a,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"),f[m].paddingX,f[m].paddingY,f[m].fontSize,p)},y,w),n.createElement(c.Z,Object.assign({text:g},Z)),z?n.createElement(z,{className:(0,i.q)(u("icon"),"shrink-0 -ml-1 mr-1.5",d[m].height,d[m].width)}):null,n.createElement("span",{className:(0,i.q)(u("text"),"whitespace-nowrap")},v))});h.displayName="Badge"},13817:function(e,t,a){a.d(t,{default:function(){return y}});var r=a(83145),n=a(2265),c=a(36760),o=a.n(c),l=a(18694),i=a(71744),s=a(80856),f=a(45287),d=a(32186),u=a(25437),h=function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(a[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,r=Object.getOwnPropertySymbols(e);nt.indexOf(r[n])&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]]);return a};function m(e){let{suffixCls:t,tagName:a,displayName:r}=e;return e=>n.forwardRef((r,c)=>n.createElement(e,Object.assign({ref:c,suffixCls:t,tagName:a},r)))}let g=n.forwardRef((e,t)=>{let{prefixCls:a,suffixCls:r,className:c,tagName:l}=e,s=h(e,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:f}=n.useContext(i.E_),d=f("layout",a),[m,g,p]=(0,u.ZP)(d),v=r?"".concat(d,"-").concat(r):d;return m(n.createElement(l,Object.assign({className:o()(a||v,c,g,p),ref:t},s)))}),p=n.forwardRef((e,t)=>{let{direction:a}=n.useContext(i.E_),[c,m]=n.useState([]),{prefixCls:g,className:p,rootClassName:v,children:w,hasSider:z,tagName:Z,style:y}=e,b=h(e,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),x=(0,l.Z)(b,["suffixCls"]),{getPrefixCls:k,className:M,style:H}=(0,i.dj)("layout"),C=k("layout",g),L="boolean"==typeof z?z:!!c.length||(0,f.Z)(w).some(e=>e.type===d.Z),[V,E,N]=(0,u.ZP)(C),R=o()(C,{["".concat(C,"-has-sider")]:L,["".concat(C,"-rtl")]:"rtl"===a},M,p,v,E,N),S=n.useMemo(()=>({siderHook:{addSider:e=>{m(t=>[].concat((0,r.Z)(t),[e]))},removeSider:e=>{m(t=>t.filter(t=>t!==e))}}}),[]);return V(n.createElement(s.V.Provider,{value:S},n.createElement(Z,Object.assign({ref:t,className:R,style:Object.assign(Object.assign({},H),y)},x),w)))}),v=m({tagName:"div",displayName:"Layout"})(p),w=m({suffixCls:"header",tagName:"header",displayName:"Header"})(g),z=m({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(g),Z=m({suffixCls:"content",tagName:"main",displayName:"Content"})(g);v.Header=w,v.Footer=z,v.Content=Z,v.Sider=d.Z,v._InternalSiderContext=d.D;var y=v},79205:function(e,t,a){a.d(t,{Z:function(){return d}});var r=a(2265);let n=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase()),o=e=>{let t=c(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=function(){for(var e=arguments.length,t=Array(e),a=0;a!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim()},i=e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var s={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 f=(0,r.forwardRef)((e,t)=>{let{color:a="currentColor",size:n=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:f="",children:d,iconNode:u,...h}=e;return(0,r.createElement)("svg",{ref:t,...s,width:n,height:n,stroke:a,strokeWidth:o?24*Number(c)/Number(n):c,className:l("lucide",f),...!d&&!i(h)&&{"aria-hidden":"true"},...h},[...u.map(e=>{let[t,a]=e;return(0,r.createElement)(t,a)}),...Array.isArray(d)?d:[d]])}),d=(e,t)=>{let a=(0,r.forwardRef)((a,c)=>{let{className:i,...s}=a;return(0,r.createElement)(f,{ref:c,iconNode:t,className:l("lucide-".concat(n(o(e))),"lucide-".concat(e),i),...s})});return a.displayName=o(e),a}},40875:function(e,t,a){a.d(t,{Z:function(){return r}});let r=(0,a(79205).Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,a){a.d(t,{Z:function(){return r}});let r=(0,a(79205).Z)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},51817:function(e,t,a){a.d(t,{Z:function(){return r}});let r=(0,a(79205).Z)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},21047:function(e,t,a){a.d(t,{Z:function(){return r}});let r=(0,a(79205).Z)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},70525:function(e,t,a){a.d(t,{Z:function(){return r}});let r=(0,a(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,a){a.d(t,{Z:function(){return r}});let r=(0,a(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"}]])},49663:function(e,t,a){a.d(t,{Z:function(){return r}});let r=(0,a(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"}]])},95805:function(e,t,a){a.d(t,{Z:function(){return r}});let r=(0,a(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"}]])},14474:function(e,t,a){a.d(t,{o:function(){return n}});class r extends Error{}function n(e,t){let a;if("string"!=typeof e)throw new r("Invalid token specified: must be a string");t||(t={});let n=!0===t.header?0:1,c=e.split(".")[n];if("string"!=typeof c)throw new r(`Invalid token specified: missing part #${n+1}`);try{a=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Error("base64 string is not of the correct length")}try{var a;return a=t,decodeURIComponent(atob(a).replace(/(.)/g,(e,t)=>{let a=t.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a}))}catch(e){return atob(t)}}(c)}catch(e){throw new r(`Invalid token specified: invalid base64 for part #${n+1} (${e.message})`)}try{return JSON.parse(a)}catch(e){throw new r(`Invalid token specified: invalid json for part #${n+1} (${e.message})`)}}r.prototype.name="InvalidTokenError"}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4623-3d995c58e378474f.js b/litellm/proxy/_experimental/out/_next/static/chunks/4623-3d995c58e378474f.js new file mode 100644 index 0000000000..c350f3e10e --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/4623-3d995c58e378474f.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4623],{34310:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},38434:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},3632:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},35291:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(1119),i=r(2265),s={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"},o=r(55015),a=i.forwardRef(function(e,t){return i.createElement(o.Z,(0,n.Z)({},e,{ref:t,icon:s}))})},79205:function(e,t,r){"use strict";r.d(t,{Z:function(){return h}});var n=r(2265);let i=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),o=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},a=function(){for(var e=arguments.length,t=Array(e),r=0;r!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},u=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 l=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:l="",children:h,iconNode:f,...d}=e;return(0,n.createElement)("svg",{ref:t,...c,width:i,height:i,stroke:r,strokeWidth:o?24*Number(s)/Number(i):s,className:a("lucide",l),...!h&&!u(d)&&{"aria-hidden":"true"},...d},[...f.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(h)?h:[h]])}),h=(e,t)=>{let r=(0,n.forwardRef)((r,s)=>{let{className:u,...c}=r;return(0,n.createElement)(l,{ref:s,iconNode:t,className:a("lucide-".concat(i(o(e))),"lucide-".concat(e),u),...c})});return r.displayName=o(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"}]])},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,s={},o=0,a={};function u(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=v(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new d(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:s,workerId:a.WORKER_ID,finished:n});else if(k(this._config.chunk)&&!t){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=s=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),this._completed||!n||!k(this._config.complete)||s&&s.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),n||s&&s.meta.paused||this._nextChunk(),s}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 c(e){var t;(e=e||{}).chunkSize||(e.chunkSize=a.RemoteChunkSize),u.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=b(this._chunkLoaded,this),t.onerror=b(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 l(e){(e=e||{}).chunkSize||(e.chunkSize=a.LocalChunkSize),u.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=b(this._chunkLoaded,this),t.onerror=b(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 h(e){var t;u.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){u.call(this,e=e||{});var t=[],r=!0,n=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.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=b(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=b(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=b(function(){this._streamCleanUp(),n=!0,this._streamData("")},this),this._streamCleanUp=b(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function d(e){var t,r,n,i,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,o=/^((\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)))$/,u=this,c=0,l=0,h=!1,f=!1,d=[],m={data:[],errors:[],meta:{}};function _(t){return"greedy"===e.skipEmptyLines?""===t.join("").trim():1===t.length&&0===t[0].length}function y(){if(m&&n&&(w("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),n=!1),e.skipEmptyLines&&(m.data=m.data.filter(function(e){return!_(e)})),b()){if(m){if(Array.isArray(m.data[0])){for(var t,r=0;b()&&r=d.length?"__parsed_extra":d[i]:a,c=u=e.transform?e.transform(u,a):u,(e.dynamicTypingFunction&&void 0===e.dynamicTyping[r]&&(e.dynamicTyping[r]=e.dynamicTypingFunction(r)),!0===(e.dynamicTyping[r]||e.dynamicTyping))?"true"===c||"TRUE"===c||"false"!==c&&"FALSE"!==c&&((e=>{if(s.test(e)&&-9007199254740992<(e=parseFloat(e))&&e<9007199254740992)return 1})(c)?parseFloat(c):o.test(c)?new Date(c):""===c?null:c):c);"__parsed_extra"===a?(n[a]=n[a]||[],n[a].push(u)):n[a]=u}return e.header&&(i>d.length?w("FieldMismatch","TooManyFields","Too many fields: expected "+d.length+" fields but parsed "+i,l+r):ie.preview?r.abort():(m.data=m.data[0],i(m,u))))}),this.parse=function(i,s,o){var u=e.quoteChar||'"',u=(e.newline||(e.newline=this.guessLineEndings(i,u)),n=!1,e.delimiter?k(e.delimiter)&&(e.delimiter=e.delimiter(i),m.meta.delimiter=e.delimiter):((u=((t,r,n,i,s)=>{var o,u,c,l;s=s||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var h=0;h=r.length/2?"\r\n":"\r"}}function p(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e){var t=(e=e||{}).delimiter,r=e.newline,n=e.comments,i=e.step,s=e.preview,o=e.fastMode,u=null,c=!1,l=null==e.quoteChar?'"':e.quoteChar,h=l;if(void 0!==e.escapeChar&&(h=e.escapeChar),("string"!=typeof t||-1=s)return F(!0);break}O.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+b)===n){if(-1===L)return F();f=L+v,L=a.indexOf(r,f),j=a.indexOf(t,f)}else if(-1!==j&&(j=s)return F(!0)}return M();function D(e){E.push(e),R=f}function z(e){return -1!==e&&(e=a.substring(T+1,e))&&""===e.trim()?e.length:0}function M(e){return m||(void 0===e&&(e=a.substring(f)),C.push(e),f=_,D(C),w&&Z()),F()}function P(e){f=e,D(C),C=[],L=a.indexOf(r,f)}function F(n){if(e.header&&!g&&E.length&&!c){var i=E[0],s=Object.create(null),o=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||(c=t.skipEmptyLines),"string"==typeof t.newline&&(s=t.newline),"string"==typeof t.quoteChar&&(o=t.quoteChar),"boolean"==typeof t.header&&(n=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw Error("Option columns is empty");l=t.columns}void 0!==t.escapeChar&&(u=t.escapeChar+o),t.escapeFormulae instanceof RegExp?h=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(h=/^[=+\-@\t\r].*$/)}})(),RegExp(p(o),"g"));if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return d(null,e,c);if("object"==typeof e[0])return d(l||Object.keys(e[0]),e,c)}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||l),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])),d(e.fields||[],e.data||[],c);throw Error("Unable to serialize unrecognized input");function d(e,t,r){var o="",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 s=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(e,o),n=i.default.Children.only(t);return i.default.cloneElement(n,c(c({},r),{},{onClick:this.onClick}))}}],function(e,t){for(var r=0;r{var e,t,a,i,c,o;let d=(0,r.useRouter)(),u="undefined"!=typeof document?(0,n.e)("token"):null;(0,s.useEffect)(()=>{u||d.replace("/sso/key/generate")},[u,d]);let m=(0,s.useMemo)(()=>{if(!u)return null;try{return(0,l.o)(u)}catch(e){return(0,n.b)(),d.replace("/sso/key/generate"),null}},[u,d]);return{token:u,accessToken:null!==(e=null==m?void 0:m.key)&&void 0!==e?e:null,userId:null!==(t=null==m?void 0:m.user_id)&&void 0!==t?t:null,userEmail:null!==(a=null==m?void 0:m.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!==(i=null==m?void 0:m.user_role)&&void 0!==i?i:null),premiumUser:null!==(c=null==m?void 0:m.premium_user)&&void 0!==c?c:null,disabledPersonalKeyCreation:null!==(o=null==m?void 0:m.disabled_non_admin_personal_key_creation)&&void 0!==o?o:null,showSSOBanner:(null==m?void 0:m.login_method)==="username_password"}}},82586:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select agents",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[p,g]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if(c){h(!0);try{let e=await (0,n.getAgentsList)(c),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)}}})()},[c]);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)(l.default,{mode:"multiple",placeholder:o,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,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)(l.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 l},Lo:function(){return n},PA:function(){return o},RD:function(){return i},Z3:function(){return c}});let s="../ui/assets/logos/",r=[{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"}],l=r.reduce((e,t)=>(e[t.displayName]=t,e),{}),n=r.reduce((e,t)=>(e[t.displayName]=t.id,e),{}),i=r.reduce((e,t)=>(e[t.id]=t.displayName,e),{}),c=e=>e.map(e=>n[e]||e),o=e=>e.map(e=>i[e]||e)},95096:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select pass through routes",disabled:d=!1,teamId:u}=e,[m,p]=(0,r.useState)([]),[g,x]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(c){x(!0);try{let e=await (0,n.getPassThroughEndpointsCall)(c,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)}}})()},[c,u]),(0,s.jsx)(l.default,{mode:"tags",placeholder:o,onChange:t,value:a,loading:g,className:i,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 r},Ob:function(){return n},W0:function(){return l}});var s=a(19250);let r=async(e,t,a)=>{try{if(null===e||null===t)return;if(null!==a){let r=(await (0,s.modelAvailableCall)(a,e,t,!0,null,!0)).data.map(e=>e.id),l=[],n=[];return r.forEach(e=>{e.endsWith("/*")?l.push(e):n.push(e)}),[...l,...n]}}catch(e){console.error("Error fetching user models:",e)}},l=e=>{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 r=e.replace("/*",""),l=t.filter(e=>e.startsWith(r+"/"));s.push(...l),a.push(e)}else s.push(e)}),[...a,...s].filter((e,t,a)=>a.indexOf(e)===t)}},95920:function(e,t,a){var s=a(57437),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select MCP servers",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[p,g]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{if(c){h(!0);try{let[e,t]=await Promise.all([(0,n.fetchMCPServers)(c),(0,n.fetchMCPAccessGroups)(c)]),a=Array.isArray(e)?e:e.data||[],s=Array.isArray(t)?t:t.data||[];m(a),g(s)}catch(e){console.error("Error fetching MCP servers or access groups:",e)}finally{h(!1)}}})()},[c]);let f=[...p.map(e=>({label:e,value:e,isAccessGroup:!0,searchText:"".concat(e," Access Group")})),...u.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")}))],v=[...(null==a?void 0:a.servers)||[],...(null==a?void 0:a.accessGroups)||[]];return(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:o,onChange:e=>{t({servers:e.filter(e=>!p.includes(e)),accessGroups:e.filter(e=>p.includes(e))})},value:v,loading:x,className:i,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)(l.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),r=a(2265),l=a(19250),n=a(92280),i=a(10353),c=a(61994),o=a(32489);t.Z=e=>{let{accessToken:t,selectedServers:a,toolPermissions:d,onChange:u,disabled:m=!1}=e,[p,g]=(0,r.useState)([]),[x,h]=(0,r.useState)({}),[f,v]=(0,r.useState)({}),[_,y]=(0,r.useState)({});(0,r.useEffect)(()=>{(async()=>{if(0===a.length){g([]);return}try{let e=await (0,l.fetchMCPServers)(t),s=(Array.isArray(e)?e:e.data||[]).filter(e=>a.includes(e.server_id));g(s)}catch(e){console.error("Error fetching MCP servers:",e),g([])}})()},[a,t]);let b=async e=>{v(t=>({...t,[e]:!0})),y(t=>({...t,[e]:""}));try{let a=await (0,l.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,r.useEffect)(()=>{p.forEach(e=>{x[e.server_id]||f[e.server_id]||b(e.server_id)})},[p]);let j=(e,t)=>{let a=d[e]||[],s=a.includes(t)?a.filter(e=>e!==t):[...a,t];u({...d,[e]:s})},N=e=>{let t=x[e]||[];u({...d,[e]:t.map(e=>e.name)})},w=e=>{u({...d,[e]:[]})};return 0===a.length?null:(0,s.jsx)("div",{className:"space-y-4",children:p.map(e=>{let t=e.server_name||e.alias||e.server_id,a=x[e.server_id]||[],r=d[e.server_id]||[],l=f[e.server_id],u=_[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",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>N(e.server_id),disabled:m||l,children:"Select All"}),(0,s.jsx)("button",{className:"text-sm text-blue-600 hover:text-blue-700 font-medium",onClick:()=>w(e.server_id),disabled:m||l,children:"Deselect All"}),(0,s.jsx)("button",{className:"text-gray-400 hover:text-gray-600",onClick:()=>{},children:(0,s.jsx)(o.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"}),l&&(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..."})]}),u&&!l&&(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:u})]}),!l&&!u&&a.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:a.map(t=>{let a=r.includes(t.name);return(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(c.Z,{checked:a,onChange:()=>j(e.server_id,t.name),disabled:m}),(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)})}),!l&&!u&&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 r}});var s=a(19250);let r=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 l}});var s=a(57437);a(2265);var r=a(30150),l=e=>{let{step:t=.01,style:a={width:"100%"},placeholder:l="Enter a numerical value",min:n,max:i,onChange:c,...o}=e;return(0,s.jsx)(r.Z,{onWheel:e=>e.currentTarget.blur(),step:t,style:a,placeholder:l,min:n,max:i,onChange:c,...o})}},54507:function(e,t,a){a.d(t,{Z:function(){return v}});var s=a(57437);a(2265);var r=a(37592),l=a(99981),n=a(23496),i=a(15424),c=a(78489),o=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}=r.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)},N=e=>{j(t.filter((t,a)=>a!==e))},w=(e,a,s)=>{let r=[...t];if("callback_name"===a){let t=x.Lo[s]||s;r[e]={...r[e],[a]:t,callback_vars:{}}}else r[e]={...r[e],[a]:s};j(r)},k=(e,a,s)=>{let r=[...t];r[e]={...r[e],callback_vars:{...r[e].callback_vars,[a]:s}},j(r)},C=(e,t)=>{var a,r;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 c=(null===(r=x.Dg[n])||void 0===r?void 0:r.dynamic_params)||{};return 0===Object.keys(c).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(c).map(a=>{let[r,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:r.replace(/_/g," ")}),(0,s.jsx)(l.Z,{title:"Environment variable reference recommended: os.environ/".concat(r.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(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)}):(0,s.jsx)(d.Z,{type:"password"===n?"password":"text",placeholder:"os.environ/".concat(r.toUpperCase()),value:e.callback_vars[r]||"",onChange:e=>k(t,r,e.target.value)})]},r)})})]})};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)(l.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)(r.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 r=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)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,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)(l.Z,{title:"Configure callback logging integrations for this team.",children:(0,s.jsx)(i.Z,{className:"text-gray-400 cursor-help"})})]}),(0,s.jsx)(c.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)(o.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)(c.Z,{variant:"light",onClick:()=>N(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)(r.default,{value:i,placeholder:"Select integration",onChange:e=>w(t,"callback_name",e),className:"w-full",optionLabelProp:"label",children:y.map(e=>{var t,a;let r=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)(l.Z,{title:n,placement:"right",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[r&&(0,s.jsx)("img",{src:r,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)(r.default,{value:e.callback_type,onChange:e=>w(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),r=a(2265),l=a(37592),n=a(19250);t.Z=e=>{let{onChange:t,value:a,className:i,accessToken:c,placeholder:o="Select vector stores",disabled:d=!1}=e,[u,m]=(0,r.useState)([]),[p,g]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{(async()=>{if(c){g(!0);try{let e=await (0,n.vectorStoreListCall)(c);e.data&&m(e.data)}catch(e){console.error("Error fetching vector stores:",e)}finally{g(!1)}}})()},[c]),(0,s.jsx)("div",{children:(0,s.jsx)(l.default,{mode:"multiple",placeholder:o,onChange:t,value:a,loading:p,className:i,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,{nl:function(){return r},pw:function(){return l},vQ:function(){return n}});var s=a(9114);function r(e,t){let a=structuredClone(e);for(let[e,s]of Object.entries(t))e in a&&(a[e]=s);return a}let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e||!Number.isFinite(e))return"-";let s={minimumFractionDigits:t,maximumFractionDigits:t};if(!a)return e.toLocaleString("en-US",s);let r=Math.abs(e),l=r,n="";return r>=1e6?(l=r/1e6,n="M"):r>=1e3&&(l=r/1e3,n="K"),"".concat(e<0?"-":"").concat(l.toLocaleString("en-US",s)).concat(n)},n=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 i(e,t);try{return await navigator.clipboard.writeText(e),s.Z.success(t),!0}catch(a){return console.error("Clipboard API failed: ",a),i(e,t)}},i=(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 r=document.execCommand("copy");if(document.body.removeChild(a),r)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 l},P4:function(){return i},ZL:function(){return s},lo:function(){return r},tY:function(){return n}});let s=["Admin","Admin Viewer","proxy_admin","proxy_admin_viewer","org_admin"],r=["Internal User","Internal Viewer"],l=["Internal User","Admin","proxy_admin"],n=e=>s.includes(e),i=e=>"proxy_admin"===e||"Admin"===e}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/475-3985fee235e827f8.js b/litellm/proxy/_experimental/out/_next/static/chunks/475-3985fee235e827f8.js deleted file mode 100644 index 7eb58ce2ed..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/475-3985fee235e827f8.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[475],{7084:function(e,r,t){t.d(r,{fr:function(){return n},m:function(){return i},u8:function(){return l},wu:function(){return o},zS:function(){return a}});let o={Increase:"increase",ModerateIncrease:"moderateIncrease",Decrease:"decrease",ModerateDecrease:"moderateDecrease",Unchanged:"unchanged"},n={Slate:"slate",Gray:"gray",Zinc:"zinc",Neutral:"neutral",Stone:"stone",Red:"red",Orange:"orange",Amber:"amber",Yellow:"yellow",Lime:"lime",Green:"green",Emerald:"emerald",Teal:"teal",Cyan:"cyan",Sky:"sky",Blue:"blue",Indigo:"indigo",Violet:"violet",Purple:"purple",Fuchsia:"fuchsia",Pink:"pink",Rose:"rose"},l={XS:"xs",SM:"sm",MD:"md",LG:"lg",XL:"xl"},a={Left:"left",Right:"right"},i={Top:"top",Bottom:"bottom"}},26898:function(e,r,t){t.d(r,{K:function(){return n},s:function(){return l}});var o=t(7084);let n={canvasBackground:50,lightBackground:100,background:500,darkBackground:600,darkestBackground:800,lightBorder:200,border:500,darkBorder:700,lightRing:200,ring:300,iconRing:500,lightText:400,text:500,iconText:600,darkText:700,darkestText:900,icon:500},l=[o.fr.Blue,o.fr.Cyan,o.fr.Sky,o.fr.Indigo,o.fr.Violet,o.fr.Purple,o.fr.Fuchsia,o.fr.Slate,o.fr.Gray,o.fr.Zinc,o.fr.Neutral,o.fr.Stone,o.fr.Red,o.fr.Orange,o.fr.Amber,o.fr.Yellow,o.fr.Lime,o.fr.Green,o.fr.Emerald,o.fr.Teal,o.fr.Pink,o.fr.Rose]},13241:function(e,r,t){t.d(r,{q:function(){return er}});let o=e=>{let r=i(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{let t=e.split("-");return""===t[0]&&1!==t.length&&t.shift(),n(t,r)||a(e)},getConflictingClassGroupIds:(e,r)=>{let n=t[e]||[];return r&&o[e]?[...n,...o[e]]:n}}},n=(e,r)=>{var t;if(0===e.length)return r.classGroupId;let o=e[0],l=r.nextPart.get(o),a=l?n(e.slice(1),l):void 0;if(a)return a;if(0===r.validators.length)return;let i=e.join("-");return null===(t=r.validators.find(e=>{let{validator:r}=e;return r(i)}))||void 0===t?void 0:t.classGroupId},l=/^\[(.+)\]$/,a=e=>{if(l.test(e)){let r=l.exec(e)[1],t=null==r?void 0:r.substring(0,r.indexOf(":"));if(t)return"arbitrary.."+t}},i=e=>{let{theme:r,prefix:t}=e,o={nextPart:new Map,validators:[]};return u(Object.entries(e.classGroups),t).forEach(e=>{let[t,n]=e;c(n,o,t,r)}),o},c=(e,r,t,o)=>{e.forEach(e=>{if("string"==typeof e){(""===e?r:s(r,e)).classGroupId=t;return}if("function"==typeof e){if(d(e)){c(e(o),r,t,o);return}r.validators.push({validator:e,classGroupId:t});return}Object.entries(e).forEach(e=>{let[n,l]=e;c(l,s(r,n),t,o)})})},s=(e,r)=>{let t=e;return r.split("-").forEach(e=>{t.nextPart.has(e)||t.nextPart.set(e,{nextPart:new Map,validators:[]}),t=t.nextPart.get(e)}),t},d=e=>e.isThemeGetter,u=(e,r)=>r?e.map(e=>{let[t,o]=e;return[t,o.map(e=>"string"==typeof e?r+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(e=>{let[t,o]=e;return[r+t,o]})):e)]}):e,p=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let r=0,t=new Map,o=new Map,n=(n,l)=>{t.set(n,l),++r>e&&(r=0,o=t,t=new Map)};return{get(e){let r=t.get(e);return void 0!==r?r:void 0!==(r=o.get(e))?(n(e,r),r):void 0},set(e,r){t.has(e)?t.set(e,r):n(e,r)}}},f=e=>{let{separator:r,experimentalParseClassName:t}=e,o=1===r.length,n=r[0],l=r.length,a=e=>{let t;let a=[],i=0,c=0;for(let s=0;sc?t-c:void 0}};return t?e=>t({className:e,parseClassName:a}):a},b=e=>{if(e.length<=1)return e;let r=[],t=[];return e.forEach(e=>{"["===e[0]?(r.push(...t.sort(),e),t=[]):t.push(e)}),r.push(...t.sort()),r},g=e=>({cache:p(e.cacheSize),parseClassName:f(e),...o(e)}),m=/\s+/,h=(e,r)=>{let{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:n}=r,l=[],a=e.trim().split(m),i="";for(let e=a.length-1;e>=0;e-=1){let r=a[e],{modifiers:c,hasImportantModifier:s,baseClassName:d,maybePostfixModifierPosition:u}=t(r),p=!!u,f=o(p?d.substring(0,u):d);if(!f){if(!p||!(f=o(d))){i=r+(i.length>0?" "+i:i);continue}p=!1}let g=b(c).join(":"),m=s?g+"!":g,h=m+f;if(l.includes(h))continue;l.push(h);let y=n(f,p);for(let e=0;e0?" "+i:i)}return i};function y(){let e,r,t=0,o="";for(;t{let r;if("string"==typeof e)return e;let t="";for(let o=0;o1?n-1:0),a=1;ar(e),e()))).cache.get,o=r.cache.set,i=c,c(n)};function c(e){let n=t(e);if(n)return n;let l=h(e,r);return o(e,l),l}return function(){return i(y.apply(null,arguments))}}let w=e=>{let r=r=>r[e]||[];return r.isThemeGetter=!0,r},k=/^\[(?:([a-z-]+):)?(.+)\]$/i,z=/^\d+\/\d+$/,C=new Set(["px","full","screen"]),S=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j=/\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$/,O=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,P=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Z=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,I=e=>E(e)||C.has(e)||z.test(e),B=e=>F(e,"length",U),E=e=>!!e&&!Number.isNaN(Number(e)),G=e=>F(e,"number",E),M=e=>!!e&&Number.isInteger(Number(e)),T=e=>e.endsWith("%")&&E(e.slice(0,-1)),N=e=>k.test(e),A=e=>S.test(e),R=new Set(["length","size","percentage"]),D=e=>F(e,R,V),$=e=>F(e,"position",V),_=new Set(["image","url"]),L=e=>F(e,_,Y),q=e=>F(e,"",X),W=()=>!0,F=(e,r,t)=>{let o=k.exec(e);return!!o&&(o[1]?"string"==typeof r?o[1]===r:r.has(o[1]):t(o[2]))},U=e=>j.test(e)&&!O.test(e),V=()=>!1,X=e=>P.test(e),Y=e=>Z.test(e),K=()=>{let e=w("colors"),r=w("spacing"),t=w("blur"),o=w("brightness"),n=w("borderColor"),l=w("borderRadius"),a=w("borderSpacing"),i=w("borderWidth"),c=w("contrast"),s=w("grayscale"),d=w("hueRotate"),u=w("invert"),p=w("gap"),f=w("gradientColorStops"),b=w("gradientColorStopPositions"),g=w("inset"),m=w("margin"),h=w("opacity"),y=w("padding"),v=w("saturate"),x=w("scale"),k=w("sepia"),z=w("skew"),C=w("space"),S=w("translate"),j=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",N,r],Z=()=>[N,r],R=()=>["",I,B],_=()=>["auto",E,N],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["start","end","center","between","around","evenly","stretch"],Y=()=>["","0",N],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[E,N];return{cacheSize:500,separator:":",theme:{colors:[W],spacing:[I,B],blur:["none","",A,N],brightness:H(),borderColor:[e],borderRadius:["none","","full",A,N],borderSpacing:Z(),borderWidth:R(),contrast:H(),grayscale:Y(),hueRotate:H(),invert:Y(),gap:Z(),gradientColorStops:[e],gradientColorStopPositions:[T,B],inset:P(),margin:P(),opacity:H(),padding:Z(),saturate:H(),scale:H(),sepia:Y(),skew:H(),space:Z(),translate:Z()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[A]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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"],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:[...F(),N]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",M,N]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:Y()}],shrink:[{shrink:Y()}],order:[{order:["first","last","none",M,N]}],"grid-cols":[{"grid-cols":[W]}],"col-start-end":[{col:["auto",{span:["full",M,N]},N]}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":[W]}],"row-start-end":[{row:["auto",{span:[M,N]},N]}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],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":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",N,r]}],"min-w":[{"min-w":[N,r,"min","max","fit"]}],"max-w":[{"max-w":[N,r,"none","full","min","max","fit","prose",{screen:[A]},A]}],h:[{h:[N,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,r,"auto","min","max","fit"]}],"font-size":[{text:["base",A,B]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",G]}],"font-family":[{font:[W]}],"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:["tighter","tight","normal","wide","wider","widest",N]}],"line-clamp":[{"line-clamp":["none",E,G]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",I,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",I,B]}],"underline-offset":[{"underline-offset":["auto",I,N]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",N]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",N]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",D]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},L]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[i]}],"border-w-x":[{"border-x":[i]}],"border-w-y":[{"border-y":[i]}],"border-w-s":[{"border-s":[i]}],"border-w-e":[{"border-e":[i]}],"border-w-t":[{"border-t":[i]}],"border-w-r":[{"border-r":[i]}],"border-w-b":[{"border-b":[i]}],"border-w-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[i]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:U()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[I,N]}],"outline-w":[{outline:[I,B]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[I,B]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",A,q]}],"shadow-color":[{shadow:[W]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",A,N]}],grayscale:[{grayscale:[s]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[M,N]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"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",N]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[I,B,G]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},H=(e,r)=>{let{cacheSize:t,prefix:o,separator:n,experimentalParseClassName:l,extend:a={},override:i={}}=r;for(let r in J(e,"cacheSize",t),J(e,"prefix",o),J(e,"separator",n),J(e,"experimentalParseClassName",l),i)Q(e[r],i[r]);for(let r in a)ee(e[r],a[r]);return e},J=(e,r,t)=>{void 0!==t&&(e[r]=t)},Q=(e,r)=>{if(r)for(let t in r)J(e,t,r[t])},ee=(e,r)=>{if(r)for(let t in r){let o=r[t];void 0!==o&&(e[t]=(e[t]||[]).concat(o))}},er=function(e){for(var r=arguments.length,t=Array(r>1?r-1:0),o=1;oH(K(),e),...t)}({extend:{classGroups:{shadow:[{shadow:[{tremor:["input","card","dropdown"],"dark-tremor":["input","card","dropdown"]}]}],rounded:[{rounded:[{tremor:["small","default","full"],"dark-tremor":["small","default","full"]}]}],"font-size":[{text:[{tremor:["default","title","metric"],"dark-tremor":["default","title","metric"]}]}]}}})},1153:function(e,r,t){t.d(r,{Cj:function(){return i},bM:function(){return p},NZ:function(){return s},fn:function(){return u},Fo:function(){return a},lq:function(){return d},vP:function(){return c}});var o=t(7084);let n=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],l=e=>n.includes(e),a=(e,r)=>{if(r||e===o.wu.Unchanged)return e;switch(e){case o.wu.Increase:return o.wu.Decrease;case o.wu.ModerateIncrease:return o.wu.ModerateDecrease;case o.wu.Decrease:return o.wu.Increase;case o.wu.ModerateDecrease:return o.wu.ModerateIncrease}return""},i=e=>e.toString(),c=e=>e.reduce((e,r)=>e+r,0),s=(e,r)=>{for(let t=0;t{e.forEach(e=>{"function"==typeof e?e(r):null!=e&&(e.current=r)})}}function u(e){return r=>"tremor-".concat(e,"-").concat(r)}function p(e,r){let t=l(e);if("white"===e||"black"===e||"transparent"===e||!r||!t){let r=e.includes("#")||e.includes("--")||e.includes("rgb")?"[".concat(e,"]"):e;return{bgColor:"bg-".concat(r," dark:bg-").concat(r),hoverBgColor:"hover:bg-".concat(r," dark:hover:bg-").concat(r),selectBgColor:"data-[selected]:bg-".concat(r," dark:data-[selected]:bg-").concat(r),textColor:"text-".concat(r," dark:text-").concat(r),selectTextColor:"data-[selected]:text-".concat(r," dark:data-[selected]:text-").concat(r),hoverTextColor:"hover:text-".concat(r," dark:hover:text-").concat(r),borderColor:"border-".concat(r," dark:border-").concat(r),selectBorderColor:"data-[selected]:border-".concat(r," dark:data-[selected]:border-").concat(r),hoverBorderColor:"hover:border-".concat(r," dark:hover:border-").concat(r),ringColor:"ring-".concat(r," dark:ring-").concat(r),strokeColor:"stroke-".concat(r," dark:stroke-").concat(r),fillColor:"fill-".concat(r," dark:fill-").concat(r)}}return{bgColor:"bg-".concat(e,"-").concat(r," dark:bg-").concat(e,"-").concat(r),selectBgColor:"data-[selected]:bg-".concat(e,"-").concat(r," dark:data-[selected]:bg-").concat(e,"-").concat(r),hoverBgColor:"hover:bg-".concat(e,"-").concat(r," dark:hover:bg-").concat(e,"-").concat(r),textColor:"text-".concat(e,"-").concat(r," dark:text-").concat(e,"-").concat(r),selectTextColor:"data-[selected]:text-".concat(e,"-").concat(r," dark:data-[selected]:text-").concat(e,"-").concat(r),hoverTextColor:"hover:text-".concat(e,"-").concat(r," dark:hover:text-").concat(e,"-").concat(r),borderColor:"border-".concat(e,"-").concat(r," dark:border-").concat(e,"-").concat(r),selectBorderColor:"data-[selected]:border-".concat(e,"-").concat(r," dark:data-[selected]:border-").concat(e,"-").concat(r),hoverBorderColor:"hover:border-".concat(e,"-").concat(r," dark:hover:border-").concat(e,"-").concat(r),ringColor:"ring-".concat(e,"-").concat(r," dark:ring-").concat(e,"-").concat(r),strokeColor:"stroke-".concat(e,"-").concat(r," dark:stroke-").concat(e,"-").concat(r),fillColor:"fill-".concat(e,"-").concat(r," dark:fill-").concat(e,"-").concat(r)}}},96240:function(e,r,t){t.d(r,{Z:function(){return o}});function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,o=Array(r);tr.indexOf(o)&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);nr.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]]);return t}t.d(r,{_T:function(){return o}}),"function"==typeof SuppressedError&&SuppressedError}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/4865-c1c0885a93c327fa.js b/litellm/proxy/_experimental/out/_next/static/chunks/4865-c1c0885a93c327fa.js new file mode 100644 index 0000000000..e44ccb50a7 --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/4865-c1c0885a93c327fa.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4865],{47187:function(e,t,n){n.d(t,{Z:function(){return J},l:function(){return H}});var r=n(2265),o=n.t(r,2),i=n(54887),u=n(94046),l=n(51050),c="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function f(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!f(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!f(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function s(e){let t=r.useRef(e);return c(()=>{t.current=e}),t}var a="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;let d=!1,p=0,m=()=>"floating-ui-"+p++,h=o["useId".toString()]||function(){let[e,t]=r.useState(()=>d?m():void 0);return a(()=>{null==e&&t(m())},[]),r.useEffect(()=>{d||(d=!0)},[]),e},g=r.createContext(null),v=r.createContext(null),y=()=>{var e;return(null==(e=r.useContext(g))?void 0:e.id)||null},w=()=>r.useContext(v);function x(e){return(null==e?void 0:e.ownerDocument)||document}function b(e){return x(e).defaultView||window}function R(e){return!!e&&e instanceof b(e).Element}function E(e){return!!e&&e instanceof b(e).HTMLElement}function k(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function L(e){let t=(0,r.useRef)(e);return a(()=>{t.current=e}),t}let T="data-floating-ui-safe-polygon";function C(e,t,n){return n&&!k(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let P=function(e,t){let{enabled:n=!0,delay:o=0,handleClose:i=null,mouseOnly:u=!1,restMs:l=0,move:c=!0}=void 0===t?{}:t,{open:f,onOpenChange:s,dataRef:d,events:p,elements:{domReference:m,floating:h},refs:g}=e,v=w(),b=y(),E=L(i),P=L(o),F=r.useRef(),S=r.useRef(),D=r.useRef(),M=r.useRef(),A=r.useRef(!0),O=r.useRef(!1),K=r.useRef(()=>{}),B=r.useCallback(()=>{var e;let t=null==(e=d.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[d]);r.useEffect(()=>{if(n)return p.on("dismiss",e),()=>{p.off("dismiss",e)};function e(){clearTimeout(S.current),clearTimeout(M.current),A.current=!0}},[n,p]),r.useEffect(()=>{if(!n||!E.current||!f)return;function e(){B()&&s(!1)}let t=x(h).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[h,f,s,n,E,d,B]);let V=r.useCallback(function(e){void 0===e&&(e=!0);let t=C(P.current,"close",F.current);t&&!D.current?(clearTimeout(S.current),S.current=setTimeout(()=>s(!1),t)):e&&(clearTimeout(S.current),s(!1))},[P,s]),W=r.useCallback(()=>{K.current(),D.current=void 0},[]),N=r.useCallback(()=>{if(O.current){let e=x(g.floating.current).body;e.style.pointerEvents="",e.removeAttribute(T),O.current=!1}},[g]);return r.useEffect(()=>{if(n&&R(m))return f&&m.addEventListener("mouseleave",i),null==h||h.addEventListener("mouseleave",i),c&&m.addEventListener("mousemove",r,{once:!0}),m.addEventListener("mouseenter",r),m.addEventListener("mouseleave",o),()=>{f&&m.removeEventListener("mouseleave",i),null==h||h.removeEventListener("mouseleave",i),c&&m.removeEventListener("mousemove",r),m.removeEventListener("mouseenter",r),m.removeEventListener("mouseleave",o)};function t(){return!!d.current.openEvent&&["click","mousedown"].includes(d.current.openEvent.type)}function r(e){if(clearTimeout(S.current),A.current=!1,u&&!k(F.current)||l>0&&0===C(P.current,"open"))return;d.current.openEvent=e;let t=C(P.current,"open",F.current);t?S.current=setTimeout(()=>{s(!0)},t):s(!0)}function o(n){if(t())return;K.current();let r=x(h);if(clearTimeout(M.current),E.current){f||clearTimeout(S.current),D.current=E.current({...e,tree:v,x:n.clientX,y:n.clientY,onClose(){N(),W(),V()}});let t=D.current;r.addEventListener("mousemove",t),K.current=()=>{r.removeEventListener("mousemove",t)};return}V()}function i(n){t()||null==E.current||E.current({...e,tree:v,x:n.clientX,y:n.clientY,onClose(){N(),W(),V()}})(n)}},[m,h,n,e,u,l,c,V,W,N,s,f,v,P,E,d]),a(()=>{var e,t,r;if(n&&f&&null!=(e=E.current)&&e.__options.blockPointerEvents&&B()){let e=x(h).body;if(e.setAttribute(T,""),e.style.pointerEvents="none",O.current=!0,R(m)&&h){let e=null==v?void 0:null==(t=v.nodesRef.current.find(e=>e.id===b))?void 0:null==(r=t.context)?void 0:r.elements.floating;return e&&(e.style.pointerEvents=""),m.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{m.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,f,b,h,m,v,E,d,B]),a(()=>{f||(F.current=void 0,W(),N())},[f,W,N]),r.useEffect(()=>()=>{W(),clearTimeout(S.current),clearTimeout(M.current),N()},[n,W,N]),r.useMemo(()=>{if(!n)return{};function e(e){F.current=e.pointerType}return{reference:{onPointerDown:e,onPointerEnter:e,onMouseMove(){f||0===l||(clearTimeout(M.current),M.current=setTimeout(()=>{A.current||s(!0)},l))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),V(!1)}}}},[p,n,l,f,s,V])};function F(e,t){if(!e||!t)return!1;let n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&function(e){if("undefined"==typeof ShadowRoot)return!1;let t=b(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function S(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})||[],r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})})||[],n=n.concat(r);return n}let D=o["useInsertionEffect".toString()]||(e=>e());function M(e){let t=r.useRef(()=>{});return D(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r!1),P="function"==typeof m?C:m,F=r.useRef(!1),{escapeKeyBubbles:D,outsidePressBubbles:V}=B(k);return r.useEffect(()=>{if(!n||!d)return;function e(e){if("Escape"===e.key){let e=L?S(L.nodesRef.current,l):[];if(e.length>0){let t=!0;if(e.forEach(e=>{var n;if(null!=(n=e.context)&&n.open&&!e.context.dataRef.current.__escapeKeyBubbles){t=!1;return}}),!t)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),o(!1)}}function t(e){var t;let n=F.current;if(F.current=!1,n||"function"==typeof P&&!P(e))return;let r="composedPath"in e?e.composedPath()[0]:e.target;if(E(r)&&s){let t=s.ownerDocument.defaultView||window,n=r.scrollWidth>r.clientWidth,o=r.scrollHeight>r.clientHeight,i=o&&e.offsetX>r.clientWidth;if(o&&"rtl"===t.getComputedStyle(r).direction&&(i=e.offsetX<=r.offsetWidth-r.clientWidth),i||n&&e.offsetY>r.clientHeight)return}let u=L&&S(L.nodesRef.current,l).some(t=>{var n;return A(e,null==(n=t.context)?void 0:n.elements.floating)});if(A(e,s)||A(e,f)||u)return;let c=L?S(L.nodesRef.current,l):[];if(c.length>0){let e=!0;if(c.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:T?{preventScroll:!0}:function(e){if(0===e.mozInputSource&&e.isTrusted)return!0;let t=/Android/i;return(t.test(function(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}())||t.test(function(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}(e)||0===(t=e).width&&0===t.height||1===t.width&&1===t.height&&0===t.pressure&&0===t.detail&&"mouse"!==t.pointerType||t.width<1&&t.height<1&&0===t.pressure&&0===t.detail}}),o(!1)}function r(){o(!1)}a.current.__escapeKeyBubbles=D,a.current.__outsidePressBubbles=V;let m=x(s);p&&m.addEventListener("keydown",e),P&&m.addEventListener(h,t);let g=[];return b&&(R(f)&&(g=(0,u.Kx)(f)),R(s)&&(g=g.concat((0,u.Kx)(s))),!R(c)&&c&&c.contextElement&&(g=g.concat((0,u.Kx)(c.contextElement)))),(g=g.filter(e=>{var t;return e!==(null==(t=m.defaultView)?void 0:t.visualViewport)})).forEach(e=>{e.addEventListener("scroll",r,{passive:!0})}),()=>{p&&m.removeEventListener("keydown",e),P&&m.removeEventListener(h,t),g.forEach(e=>{e.removeEventListener("scroll",r)})}},[a,s,f,c,p,P,h,i,L,l,n,o,b,d,D,V,T]),r.useEffect(()=>{F.current=!1},[P,h]),r.useMemo(()=>d?{reference:{[O[v]]:()=>{g&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),o(!1))}},floating:{[K[h]]:()=>{F.current=!0}}}:{},[d,i,g,h,v,o])},W=function(e,t){let{open:n,onOpenChange:o,dataRef:i,events:u,refs:l,elements:{floating:c,domReference:f}}=e,{enabled:s=!0,keyboardOnly:a=!0}=void 0===t?{}:t,d=r.useRef(""),p=r.useRef(!1),m=r.useRef();return r.useEffect(()=>{if(!s)return;let e=x(c).defaultView||window;function t(){!n&&E(f)&&f===function(e){let t=e.activeElement;for(;(null==(n=t)?void 0:null==(r=n.shadowRoot)?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}(x(f))&&(p.current=!0)}return e.addEventListener("blur",t),()=>{e.removeEventListener("blur",t)}},[c,f,n,s]),r.useEffect(()=>{if(s)return u.on("dismiss",e),()=>{u.off("dismiss",e)};function e(e){("referencePress"===e.type||"escapeKey"===e.type)&&(p.current=!0)}},[u,s]),r.useEffect(()=>()=>{clearTimeout(m.current)},[]),r.useMemo(()=>s?{reference:{onPointerDown(e){let{pointerType:t}=e;d.current=t,p.current=!!(t&&a)},onMouseLeave(){p.current=!1},onFocus(e){var t;p.current||"focus"===e.type&&(null==(t=i.current.openEvent)?void 0:t.type)==="mousedown"&&i.current.openEvent&&A(i.current.openEvent,f)||(i.current.openEvent=e.nativeEvent,o(!0))},onBlur(e){p.current=!1;let t=e.relatedTarget,n=R(t)&&t.hasAttribute("data-floating-ui-focus-guard")&&"outside"===t.getAttribute("data-type");m.current=setTimeout(()=>{F(l.floating.current,t)||F(f,t)||n||o(!1)})}}}:{},[s,a,f,l,i,o])},N=function(e,t){let{open:n}=e,{enabled:o=!0,role:i="dialog"}=void 0===t?{}:t,u=h(),l=h();return r.useMemo(()=>{let e={id:u,role:i};return o?"tooltip"===i?{reference:{"aria-describedby":n?u:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===i?"dialog":i,"aria-controls":n?u:void 0,..."listbox"===i&&{role:"combobox"},..."menu"===i&&{id:l}},floating:{...e,..."menu"===i&&{"aria-labelledby":l}}}:{}},[o,i,n,u,l])};function z(e,t,n){let r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map(e=>e?e[n]:null).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,o]=t;if(0===n.indexOf("on")){if(r.has(n)||r.set(n,[]),"function"==typeof o){var i;null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,o=Array(t),i=0;ie(...o))}}}else e[n]=o}),e),{})}}let j=function(e){void 0===e&&(e=[]);let t=e,n=r.useCallback(t=>z(t,e,"reference"),t),o=r.useCallback(t=>z(t,e,"floating"),t),i=r.useCallback(t=>z(t,e,"item"),e.map(e=>null==e?void 0:e.item));return r.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i}),[n,o,i])};var _=n(13241);let H=e=>{let[t,n]=(0,r.useState)(!1),[o,u]=(0,r.useState)(),{x:d,y:p,refs:m,strategy:h,context:g}=function(e){void 0===e&&(e={});let{open:t=!1,onOpenChange:n,nodeId:o}=e,u=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:u,whileElementsMounted:a,open:d}=e,[p,m]=r.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=r.useState(o);f(h,o)||g(o);let v=r.useRef(null),y=r.useRef(null),w=r.useRef(p),x=s(a),b=s(u),[R,E]=r.useState(null),[k,L]=r.useState(null),T=r.useCallback(e=>{v.current!==e&&(v.current=e,E(e))},[]),C=r.useCallback(e=>{y.current!==e&&(y.current=e,L(e))},[]),P=r.useCallback(()=>{if(!v.current||!y.current)return;let e={placement:t,strategy:n,middleware:h};b.current&&(e.platform=b.current),(0,l.oo)(v.current,y.current,e).then(e=>{let t={...e,isPositioned:!0};F.current&&!f(w.current,t)&&(w.current=t,i.flushSync(()=>{m(t)}))})},[h,t,n,b]);c(()=>{!1===d&&w.current.isPositioned&&(w.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);let F=r.useRef(!1);c(()=>(F.current=!0,()=>{F.current=!1}),[]),c(()=>{if(R&&k){if(x.current)return x.current(R,k,P);P()}},[R,k,P,x]);let S=r.useMemo(()=>({reference:v,floating:y,setReference:T,setFloating:C}),[T,C]),D=r.useMemo(()=>({reference:R,floating:k}),[R,k]);return r.useMemo(()=>({...p,update:P,refs:S,elements:D,reference:T,floating:C}),[p,P,S,D,T,C])}(e),d=w(),p=r.useRef(null),m=r.useRef({}),h=r.useState(()=>(function(){let e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(e=>e!==n))}}})())[0],[g,v]=r.useState(null),y=r.useCallback(e=>{let t=R(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;u.refs.setReference(t)},[u.refs]),x=r.useCallback(e=>{(R(e)||null===e)&&(p.current=e,v(e)),(R(u.refs.reference.current)||null===u.refs.reference.current||null!==e&&!R(e))&&u.refs.setReference(e)},[u.refs]),b=r.useMemo(()=>({...u.refs,setReference:x,setPositionReference:y,domReference:p}),[u.refs,x,y]),E=r.useMemo(()=>({...u.elements,domReference:g}),[u.elements,g]),k=M(n),L=r.useMemo(()=>({...u,refs:b,elements:E,dataRef:m,nodeId:o,events:h,open:t,onOpenChange:k}),[u,o,h,t,k,b,E]);return a(()=>{let e=null==d?void 0:d.nodesRef.current.find(e=>e.id===o);e&&(e.context=L)}),r.useMemo(()=>({...u,context:L,refs:b,reference:x,positionReference:y}),[u,b,L,x,y])}({open:t,onOpenChange:t=>{t&&e?u(setTimeout(()=>{n(t)},e)):(clearTimeout(o),n(t))},placement:"top",whileElementsMounted:l.Me,middleware:[(0,l.cv)(5),(0,l.RR)({fallbackAxisSideDirection:"start"}),(0,l.uY)()]}),v=P(g,{move:!1}),{getReferenceProps:y,getFloatingProps:x}=j([v,W(g),V(g),N(g,{role:"tooltip"})]);return{tooltipProps:{open:t,x:d,y:p,refs:m,strategy:h,getFloatingProps:x},getReferenceProps:y}},J=e=>{let{text:t,open:n,x:o,y:i,refs:u,strategy:l,getFloatingProps:c}=e;return n&&t?r.createElement("div",Object.assign({className:(0,_.q)("max-w-xs text-sm z-20 rounded-tremor-default opacity-100 px-2.5 py-1","text-white bg-tremor-background-emphasis","dark:text-tremor-content-emphasis dark:bg-white"),ref:u.setFloating,style:{position:l,top:null!=i?i:0,left:null!=o?o:0}},c()),t):null};J.displayName="Tooltip"},26898:function(e,t,n){n.d(t,{K:function(){return o},s:function(){return i}});var r=n(7084);let o={canvasBackground:50,lightBackground:100,background:500,darkBackground:600,darkestBackground:800,lightBorder:200,border:500,darkBorder:700,lightRing:200,ring:300,iconRing:500,lightText:400,text:500,iconText:600,darkText:700,darkestText:900,icon:500},i=[r.fr.Blue,r.fr.Cyan,r.fr.Sky,r.fr.Indigo,r.fr.Violet,r.fr.Purple,r.fr.Fuchsia,r.fr.Slate,r.fr.Gray,r.fr.Zinc,r.fr.Neutral,r.fr.Stone,r.fr.Red,r.fr.Orange,r.fr.Amber,r.fr.Yellow,r.fr.Lime,r.fr.Green,r.fr.Emerald,r.fr.Teal,r.fr.Pink,r.fr.Rose]},51050:function(e,t,n){n.d(t,{Me:function(){return T},oo:function(){return M},US:function(){return C},RR:function(){return S},cv:function(){return P},uY:function(){return F},dp:function(){return D}});var r=n(72695);function o(e,t,n){let o,{reference:i,floating:u}=e,l=(0,r.Qq)(t),c=(0,r.Wh)(t),f=(0,r.I4)(c),s=(0,r.k3)(t),a="y"===l,d=i.x+i.width/2-u.width/2,p=i.y+i.height/2-u.height/2,m=i[f]/2-u[f]/2;switch(s){case"top":o={x:d,y:i.y-u.height};break;case"bottom":o={x:d,y:i.y+i.height};break;case"right":o={x:i.x+i.width,y:p};break;case"left":o={x:i.x-u.width,y:p};break;default:o={x:i.x,y:i.y}}switch((0,r.hp)(t)){case"start":o[c]-=m*(n&&a?-1:1);break;case"end":o[c]+=m*(n&&a?-1:1)}return o}let i=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:u=[],platform:l}=n,c=u.filter(Boolean),f=await (null==l.isRTL?void 0:l.isRTL(t)),s=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:d}=o(s,r,f),p=r,m={},h=0;for(let n=0;n(0,f.kK)(e)&&"body"!==(0,f.wk)(e)),o=null,i="fixed"===(0,f.Dx)(e).position,u=i?(0,f.Ow)(e):e;for(;(0,f.kK)(u)&&!(0,f.Py)(u);){let t=(0,f.Dx)(u),n=(0,f.hT)(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&!!o&&y.has(o.position)||(0,f.ao)(u)&&!n&&function e(t,n){let r=(0,f.Ow)(t);return!(r===n||!(0,f.kK)(r)||(0,f.Py)(r))&&("fixed"===(0,f.Dx)(r).position||e(r,n))}(e,u))?r=r.filter(e=>e!==u):o=t,u=(0,f.Ow)(u)}return t.set(e,r),r}(t,this._c):[].concat(n),o],l=u[0],c=u.reduce((e,n)=>{let o=w(t,n,i);return e.top=(0,r.Fp)(o.top,e.top),e.right=(0,r.VV)(o.right,e.right),e.bottom=(0,r.VV)(o.bottom,e.bottom),e.left=(0,r.Fp)(o.left,e.left),e},w(t,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:R,getElementRects:E,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=s(e);return{width:t,height:n}},getScale:d,isElement:f.kK,isRTL:function(e){return"rtl"===(0,f.Dx)(e).direction}};function L(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function T(e,t,n,o){let i;void 0===o&&(o={});let{ancestorScroll:u=!0,ancestorResize:l=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:d=!1}=o,p=a(e),m=u||l?[...p?(0,f.Kx)(p):[],...(0,f.Kx)(t)]:[];m.forEach(e=>{u&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});let g=p&&s?function(e,t){let n,o=null,i=(0,f.tF)(e);function u(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return!function l(c,f){void 0===c&&(c=!1),void 0===f&&(f=1),u();let s=e.getBoundingClientRect(),{left:a,top:d,width:p,height:m}=s;if(c||t(),!p||!m)return;let h=(0,r.GW)(d),g=(0,r.GW)(i.clientWidth-(a+p)),v={rootMargin:-h+"px "+-g+"px "+-(0,r.GW)(i.clientHeight-(d+m))+"px "+-(0,r.GW)(a)+"px",threshold:(0,r.Fp)(0,(0,r.VV)(1,f))||1},y=!0;function w(t){let r=t[0].intersectionRatio;if(r!==f){if(!y)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||L(s,e.getBoundingClientRect())||l(),y=!1}try{o=new IntersectionObserver(w,{...v,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(w,v)}o.observe(e)}(!0),u}(p,n):null,v=-1,y=null;c&&(y=new ResizeObserver(e=>{let[r]=e;r&&r.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=y)||e.observe(t)})),n()}),p&&!d&&y.observe(p),y.observe(t));let w=d?h(e):null;return d&&function t(){let r=h(e);w&&!L(w,r)&&n(),w=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;m.forEach(e=>{u&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==g||g(),null==(e=y)||e.disconnect(),y=null,d&&cancelAnimationFrame(i)}}let C=u,P=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:i,placement:u,middlewareData:l}=t,f=await c(t,e);return u===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+f.x,y:i+f.y,data:{...f,placement:u}}}}},F=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:i}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=(0,r.ku)(e,t),a={x:n,y:o},d=await u(t,s),p=(0,r.Qq)((0,r.k3)(i)),m=(0,r.Rn)(p),h=a[m],g=a[p];if(l){let e="y"===m?"top":"left",t="y"===m?"bottom":"right",n=h+d[e],o=h-d[t];h=(0,r.uZ)(n,h,o)}if(c){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=g+d[e],o=g-d[t];g=(0,r.uZ)(n,g,o)}let v=f.fn({...t,[m]:h,[p]:g});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[m]:l,[p]:c}}}}}},S=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o,i,l,c;let{placement:f,middlewareData:s,rects:a,initialPlacement:d,platform:p,elements:m}=t,{mainAxis:h=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...b}=(0,r.ku)(e,t);if(null!=(n=s.arrow)&&n.alignmentOffset)return{};let R=(0,r.k3)(f),E=(0,r.Qq)(d),k=(0,r.k3)(d)===d,L=await (null==p.isRTL?void 0:p.isRTL(m.floating)),T=v||(k||!x?[(0,r.pw)(d)]:(0,r.gy)(d)),C="none"!==w;!v&&C&&T.push(...(0,r.KX)(d,x,w,L));let P=[d,...T],F=await u(t,b),S=[],D=(null==(o=s.flip)?void 0:o.overflows)||[];if(h&&S.push(F[R]),g){let e=(0,r.i8)(f,a,L);S.push(F[e[0]],F[e[1]])}if(D=[...D,{placement:f,overflows:S}],!S.every(e=>e<=0)){let e=((null==(i=s.flip)?void 0:i.index)||0)+1,t=P[e];if(t&&(!("alignment"===g&&E!==(0,r.Qq)(t))||D.every(e=>(0,r.Qq)(e.placement)!==E||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let n=null==(l=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:l.placement;if(!n)switch(y){case"bestFit":{let e=null==(c=D.filter(e=>{if(C){let t=(0,r.Qq)(e.placement);return t===E||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:c[0];e&&(n=e);break}case"initialPlacement":n=d}if(f!==n)return{reset:{placement:n}}}return{}}}},D=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;let i,l;let{placement:c,rects:f,platform:s,elements:a}=t,{apply:d=()=>{},...p}=(0,r.ku)(e,t),m=await u(t,p),h=(0,r.k3)(c),g=(0,r.hp)(c),v="y"===(0,r.Qq)(c),{width:y,height:w}=f.floating;"top"===h||"bottom"===h?(i=h,l=g===(await (null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(l=h,i="end"===g?"top":"bottom");let x=w-m.top-m.bottom,b=y-m.left-m.right,R=(0,r.VV)(w-m[i],x),E=(0,r.VV)(y-m[l],b),k=!t.middlewareData.shift,L=R,T=E;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(T=b),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(L=x),k&&!g){let e=(0,r.Fp)(m.left,0),t=(0,r.Fp)(m.right,0),n=(0,r.Fp)(m.top,0),o=(0,r.Fp)(m.bottom,0);v?T=y-2*(0!==e||0!==t?e+t:(0,r.Fp)(m.left,m.right)):L=w-2*(0!==n||0!==o?n+o:(0,r.Fp)(m.top,m.bottom))}await d({...t,availableWidth:T,availableHeight:L});let C=await s.getDimensions(a.floating);return y!==C.width||w!==C.height?{reset:{rects:!0}}:{}}}},M=(e,t,n)=>{let r=new Map,o={platform:k,...n},u={...o.platform,_c:r};return i(e,t,{...o,platform:u})}},94046:function(e,t,n){function r(){return"undefined"!=typeof window}function o(e){return l(e)?(e.nodeName||"").toLowerCase():"#document"}function i(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function u(e){var t;return null==(t=(l(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function l(e){return!!r()&&(e instanceof Node||e instanceof i(e).Node)}function c(e){return!!r()&&(e instanceof Element||e instanceof i(e).Element)}function f(e){return!!r()&&(e instanceof HTMLElement||e instanceof i(e).HTMLElement)}function s(e){return!!r()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof i(e).ShadowRoot)}n.d(t,{Dx:function(){return L},Jj:function(){return i},Kx:function(){return function e(t,n,r){var o;void 0===n&&(n=[]),void 0===r&&(r=!0);let u=function e(t){let n=C(t);return k(n)?t.ownerDocument?t.ownerDocument.body:t.body:f(n)&&d(n)?n:e(n)}(t),l=u===(null==(o=t.ownerDocument)?void 0:o.body),c=i(u);if(l){let t=P(c);return n.concat(c,c.visualViewport||[],d(u)?u:[],t&&r?e(t):[])}return n.concat(u,e(u,[],r))}},Lw:function(){return T},Ow:function(){return C},Pf:function(){return R},Py:function(){return k},Re:function(){return f},Ze:function(){return m},ao:function(){return d},gQ:function(){return b},hT:function(){return x},kK:function(){return c},tF:function(){return u},tR:function(){return g},wK:function(){return P},wk:function(){return o}});let a=new Set(["inline","contents"]);function d(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=L(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!a.has(o)}let p=new Set(["table","td","th"]);function m(e){return p.has(o(e))}let h=[":popover-open",":modal"];function g(e){return h.some(t=>{try{return e.matches(t)}catch(e){return!1}})}let v=["transform","translate","scale","rotate","perspective"],y=["transform","translate","scale","rotate","perspective","filter"],w=["paint","layout","strict","content"];function x(e){let t=R(),n=c(e)?L(e):e;return v.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||y.some(e=>(n.willChange||"").includes(e))||w.some(e=>(n.contain||"").includes(e))}function b(e){let t=C(e);for(;f(t)&&!k(t);){if(x(t))return t;if(g(t))break;t=C(t)}return null}function R(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let E=new Set(["html","body","#document"]);function k(e){return E.has(o(e))}function L(e){return i(e).getComputedStyle(e)}function T(e){return c(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function C(e){if("html"===o(e))return e;let t=e.assignedSlot||e.parentNode||s(e)&&e.host||u(e);return s(t)?t.host:t}function P(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}},72695:function(e,t,n){n.d(t,{Fp:function(){return o},GW:function(){return u},I4:function(){return h},JB:function(){return F},KX:function(){return T},NM:function(){return i},Qq:function(){return v},Rn:function(){return m},VV:function(){return r},Wh:function(){return y},gy:function(){return x},hp:function(){return p},i8:function(){return w},k3:function(){return d},ku:function(){return a},pw:function(){return C},uZ:function(){return s},yd:function(){return P},ze:function(){return l}});let r=Math.min,o=Math.max,i=Math.round,u=Math.floor,l=e=>({x:e,y:e}),c={left:"right",right:"left",bottom:"top",top:"bottom"},f={start:"end",end:"start"};function s(e,t,n){return o(e,r(t,n))}function a(e,t){return"function"==typeof e?e(t):e}function d(e){return e.split("-")[0]}function p(e){return e.split("-")[1]}function m(e){return"x"===e?"y":"x"}function h(e){return"y"===e?"height":"width"}let g=new Set(["top","bottom"]);function v(e){return g.has(d(e))?"y":"x"}function y(e){return m(v(e))}function w(e,t,n){void 0===n&&(n=!1);let r=p(e),o=y(e),i=h(o),u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=C(u)),[u,C(u)]}function x(e){let t=C(e);return[b(e),t,b(t)]}function b(e){return e.replace(/start|end/g,e=>f[e])}let R=["left","right"],E=["right","left"],k=["top","bottom"],L=["bottom","top"];function T(e,t,n,r){let o=p(e),i=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?E:R;return t?R:E;case"left":case"right":return t?k:L;default:return[]}}(d(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(b)))),i}function C(e){return e.replace(/left|right|bottom|top/g,e=>c[e])}function P(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function F(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5096-d9222b69b30b3d56.js b/litellm/proxy/_experimental/out/_next/static/chunks/5096-d9222b69b30b3d56.js deleted file mode 100644 index 5ccce756f5..0000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5096-d9222b69b30b3d56.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5096,1623],{30150:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(5853),s=r(2265);let a=e=>{var t=(0,n._T)(e,[]);return s.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),s.createElement("path",{d:"M12 4v16m8-8H4"}))},i=e=>{var t=(0,n._T)(e,[]);return s.createElement("svg",Object.assign({},t,{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2.5"}),s.createElement("path",{d:"M20 12H4"}))};var o=r(13241),u=r(1153),l=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",h=s.forwardRef((e,t)=>{let{onSubmit:r,enableStepper:h=!0,disabled:p,onValueChange:f,onChange:m}=e,y=(0,n._T)(e,["onSubmit","enableStepper","disabled","onValueChange","onChange"]),g=(0,s.useRef)(null),[b,v]=s.useState(!1),w=s.useCallback(()=>{v(!0)},[]),x=s.useCallback(()=>{v(!1)},[]),[E,C]=s.useState(!1),k=s.useCallback(()=>{C(!0)},[]),P=s.useCallback(()=>{C(!1)},[]);return s.createElement(l.Z,Object.assign({type:"number",ref:(0,u.lq)([g,t]),disabled:p,makeInputClassName:(0,u.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&&w(),"ArrowUp"===e.key&&k()},onKeyUp:e=>{"ArrowDown"===e.key&&x(),"ArrowUp"===e.key&&P()},onChange:e=>{p||(null==f||f(parseFloat(e.target.value)),null==m||m(e))},stepper:h?s.createElement("div",{className:(0,o.q)("flex justify-center align-middle")},s.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=g.current)||void 0===e||e.stepDown(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,o.q)(!p&&d,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},s.createElement(i,{"data-testid":"step-down",className:(b?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"})),s.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=g.current)||void 0===e||e.stepUp(),null===(t=g.current)||void 0===t||t.dispatchEvent(new Event("input",{bubbles:!0})))},className:(0,o.q)(!p&&d,c,"group py-[10px] px-2.5 border-l border-tremor-border dark:border-dark-tremor-border")},s.createElement(a,{"data-testid":"step-up",className:(E?"scale-95":"")+" h-4 w-4 duration-75 transition group-active:scale-95"}))):null},y))});h.displayName="NumberInput"},16853:function(e,t,r){r.d(t,{Z:function(){return c}});var n=r(5853),s=r(96398),a=r(44140),i=r(2265),o=r(13241),u=r(1153);let l=(0,u.fn)("Textarea"),c=i.forwardRef((e,t)=>{let{value:r,defaultValue:c="",placeholder:d="Type...",error:h=!1,errorMessage:p,disabled:f=!1,className:m,onChange:y,onValueChange:g,autoHeight:b=!1}=e,v=(0,n._T)(e,["value","defaultValue","placeholder","error","errorMessage","disabled","className","onChange","onValueChange","autoHeight"]),[w,x]=(0,a.Z)(c,r),E=(0,i.useRef)(null),C=(0,s.Uh)(w);return(0,i.useEffect)(()=>{let e=E.current;if(b&&e){e.style.height="60px";let t=e.scrollHeight;e.style.height=t+"px"}},[b,E,w]),i.createElement(i.Fragment,null,i.createElement("textarea",Object.assign({ref:(0,u.lq)([E,t]),value:w,placeholder:d,disabled:f,className:(0,o.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,s.um)(C,f,h),f?"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:e=>{null==y||y(e),x(e.target.value),null==g||g(e.target.value)}},v)),h&&p?i.createElement("p",{className:(0,o.q)(l("errorMessage"),"text-sm text-red-500 mt-1")},p):null)});c.displayName="Textarea"},87452:function(e,t,r){r.d(t,{Z:function(){return d},r:function(){return c}});var n=r(5853),s=r(91054);r(42698),r(64016);var a=r(8710);r(33232);var i=r(13241),o=r(1153),u=r(2265);let l=(0,o.fn)("Accordion"),c=(0,u.createContext)({isOpen:!1}),d=u.forwardRef((e,t)=>{var r;let{defaultOpen:o=!1,children:d,className:h}=e,p=(0,n._T)(e,["defaultOpen","children","className"]),f=null!==(r=(0,u.useContext)(a.Z))&&void 0!==r?r:(0,i.q)("rounded-tremor-default border");return u.createElement(s.pJ,Object.assign({as:"div",ref:t,className:(0,i.q)(l("root"),"overflow-hidden","bg-tremor-background border-tremor-border","dark:bg-dark-tremor-background dark:border-dark-tremor-border",f,h),defaultOpen:o},p),e=>{let{open:t}=e;return u.createElement(c.Provider,{value:{isOpen:t}},d)})});d.displayName="Accordion"},88829:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),s=r(2265),a=r(91054),i=r(13241);let o=(0,r(1153).fn)("AccordionBody"),u=s.forwardRef((e,t)=>{let{children:r,className:u}=e,l=(0,n._T)(e,["children","className"]);return s.createElement(a.pJ.Panel,Object.assign({ref:t,className:(0,i.q)(o("root"),"w-full text-tremor-default px-4 pb-3","text-tremor-content","dark:text-dark-tremor-content",u)},l),r)});u.displayName="AccordionBody"},72208:function(e,t,r){r.d(t,{Z:function(){return c}});var n=r(5853),s=r(2265),a=r(91054);let i=e=>{var t=(0,n._T)(e,[]);return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},t),s.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 o=r(87452),u=r(13241);let l=(0,r(1153).fn)("AccordionHeader"),c=s.forwardRef((e,t)=>{let{children:r,className:c}=e,d=(0,n._T)(e,["children","className"]),{isOpen:h}=(0,s.useContext)(o.r);return s.createElement(a.pJ.Button,Object.assign({ref:t,className:(0,u.q)(l("root"),"w-full flex items-center justify-between px-4 py-3","text-tremor-content-emphasis","dark:text-dark-tremor-content-emphasis",c)},d),s.createElement("div",{className:(0,u.q)(l("children"),"flex flex-1 text-inherit mr-4")},r),s.createElement("div",null,s.createElement(i,{className:(0,u.q)(l("arrowIcon"),"h-5 w-5 -mr-1","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle",h?"transition-all":"transition-all -rotate-180")})))});c.displayName="AccordionHeader"},67982:function(e,t,r){r.d(t,{Z:function(){return u}});var n=r(5853),s=r(13241),a=r(1153),i=r(2265);let o=(0,a.fn)("Divider"),u=i.forwardRef((e,t)=>{let{className:r,children:a}=e,u=(0,n._T)(e,["className","children"]);return i.createElement("div",Object.assign({ref:t,className:(0,s.q)(o("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)},u),a?i.createElement(i.Fragment,null,i.createElement("div",{className:(0,s.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}),i.createElement("div",{className:(0,s.q)("text-inherit whitespace-nowrap")},a),i.createElement("div",{className:(0,s.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")})):i.createElement("div",{className:(0,s.q)("w-full h-[1px] bg-tremor-border dark:bg-dark-tremor-border")}))});u.displayName="Divider"},23628:function(e,t,r){var n=r(2265);let s=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=s},49084:function(e,t,r){var n=r(2265);let s=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=s},2894:function(e,t,r){r.d(t,{R:function(){return o},m:function(){return i}});var n=r(18238),s=r(7989),a=r(11255),i=class extends s.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.#s({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#n=(0,a.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#s({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#s({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,s=!this.#n.canStart();try{if(n)t();else{this.#s({type:"pending",variables:e,isPaused:s}),await this.#r.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#s({type:"pending",context:t,variables:e,isPaused:s})}let a=await this.#n.start();return await this.#r.config.onSuccess?.(a,e,this.state.context,this,r),await this.options.onSuccess?.(a,e,this.state.context,r),await this.#r.config.onSettled?.(a,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(a,null,e,this.state.context,r),this.#s({type:"success",data:a}),a}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.#s({type:"error",error:t})}}finally{this.#r.runNext(this)}}#s(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){r.d(t,{S:function(){return m}});var n=r(45345),s=r(21733),a=r(18238),i=r(24112),o=class extends i.l{constructor(e={}){super(),this.config=e,this.#a=new Map}#a;build(e,t,r){let a=t.queryKey,i=t.queryHash??(0,n.Rm)(a,t),o=this.get(i);return o||(o=new s.A({client:e,queryKey:a,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(o)),o}add(e){this.#a.has(e.queryHash)||(this.#a.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#a.get(e.queryHash);t&&(e.destroy(),t===e&&this.#a.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){a.Vr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#a.get(e)}getAll(){return[...this.#a.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){a.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){a.Vr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){a.Vr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},u=r(2894),l=class extends i.l{constructor(e={}){super(),this.config=e,this.#i=new Set,this.#o=new Map,this.#u=0}#i;#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.#i.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.#i.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(){a.Vr.batch(()=>{this.#i.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#i.clear(),this.#o.clear()})}getAll(){return Array.from(this.#i)}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){a.Vr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return a.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 p(e){return{onFetch:(t,r)=>{let s=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=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,s,a)=>{if(r)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);let i=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:s,direction:a?"backward":"forward",meta:t.options.meta};return c(e),e})(),o=await d(i),{maxPages:u}=t.options,l=a?n.Ht:n.VX;return{pages:l(e.pages,o,u),pageParams:l(e.pageParams,s,u)}};if(a&&i.length){let e="backward"===a,t={pages:i,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:f)(s,t);u=await h(t,r,e)}else{let t=e??i.length;do{let e=0===l?o[0]??s.initialPageParam:f(s,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 f(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 m=class{#l;#r;#c;#d;#h;#p;#f;#m;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.#p=0}mount(){this.#p++,1===this.#p&&(this.#f=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onFocus())}),this.#m=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#l.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#f?.(),this.#f=void 0,this.#m?.(),this.#m=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),s=r.state.data;return void 0===s?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#l.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let s=this.defaultQueryOptions({queryKey:e}),a=this.#l.get(s.queryHash),i=a?.state.data,o=(0,n.SE)(t,i);if(void 0!==o)return this.#l.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return a.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;a.Vr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#l;return a.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(a.Vr.batch(()=>this.#l.findAll(e).map(e=>e.cancel(r)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e,t={}){return a.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(a.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=p(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=p(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()}}},19616:function(e,t,r){r.d(t,{G:function(){return i}});var n=r(2265);let s={enabled:!0,leading:!1,trailing:!0,wait:0,onExecute:()=>{}};class a{constructor(e,t){this.fn=e,this._canLeadingExecute=!0,this._isPending=!1,this._executionCount=0,this._options={...s,...t}}setOptions(e){return this._options={...this._options,...e},this._options.enabled||(this._isPending=!1),this._options}getOptions(){return this._options}maybeExecute(...e){this._options.leading&&this._canLeadingExecute&&(this.executeFunction(...e),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(...e)},this._options.wait)}executeFunction(...e){this._options.enabled&&(this.fn(...e),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 i(e,t){let[r,s]=(0,n.useState)(e),i=function(e,t){let[r]=(0,n.useState)(()=>{var r;return Object.getOwnPropertyNames(Object.getPrototypeOf(r=new a(e,t))).filter(e=>"function"==typeof r[e]).reduce((e,t)=>{let n=r[t];return"function"==typeof n&&(e[t]=n.bind(r)),e},{})});return r.setOptions(t),r}(s,t);return[r,i.maybeExecute,i]}},91054:function(e,t,r){let n,s;r.d(t,{pJ:function(){return N}});var a,i=r(71049),o=r(11323),u=r(2265),l=r(66797),c=r(93980),d=r(65573),h=r(67561),p=r(98218),f=r(33443),m=r(28294),y=r(31370),g=r(72468),b=r(5664),v=r(38929);let w=null!=(a=u.startTransition)?a:function(e){e()};var x=r(52724),E=((n=E||{})[n.Open=0]="Open",n[n.Closed=1]="Closed",n),C=((s=C||{})[s.ToggleDisclosure=0]="ToggleDisclosure",s[s.CloseDisclosure=1]="CloseDisclosure",s[s.SetButtonId=2]="SetButtonId",s[s.SetPanelId=3]="SetPanelId",s[s.SetButtonElement=4]="SetButtonElement",s[s.SetPanelElement=5]="SetPanelElement",s);let k={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}},P=(0,u.createContext)(null);function O(e){let t=(0,u.useContext)(P);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,O),t}return t}P.displayName="DisclosureContext";let q=(0,u.createContext)(null);q.displayName="DisclosureAPIContext";let D=(0,u.createContext)(null);function S(e,t){return(0,g.E)(t.type,k,e,t)}D.displayName="DisclosurePanelContext";let T=u.Fragment,_=v.VN.RenderStrategy|v.VN.Static,N=Object.assign((0,v.yV)(function(e,t){let{defaultOpen:r=!1,...n}=e,s=(0,u.useRef)(null),a=(0,h.T)(t,(0,h.h)(e=>{s.current=e},void 0===e.as||e.as===u.Fragment)),i=(0,u.useReducer)(S,{disclosureState:r?0:1,buttonElement:null,panelElement:null,buttonId:null,panelId:null}),[{disclosureState:o,buttonId:l},d]=i,p=(0,c.z)(e=>{d({type:1});let t=(0,b.r)(s);if(!t||!l)return;let r=e?e instanceof HTMLElement?e:e.current instanceof HTMLElement?e.current:t.getElementById(l):t.getElementById(l);null==r||r.focus()}),y=(0,u.useMemo)(()=>({close:p}),[p]),w=(0,u.useMemo)(()=>({open:0===o,close:p}),[o,p]),x=(0,v.L6)();return u.createElement(P.Provider,{value:i},u.createElement(q.Provider,{value:y},u.createElement(f.Z,{value:p},u.createElement(m.up,{value:(0,g.E)(o,{0:m.ZM.Open,1:m.ZM.Closed})},x({ourProps:{ref:a},theirProps:n,slot:w,defaultTag:T,name:"Disclosure"})))))}),{Button:(0,v.yV)(function(e,t){let r=(0,u.useId)(),{id:n="headlessui-disclosure-button-".concat(r),disabled:s=!1,autoFocus:a=!1,...p}=e,[f,m]=O("Disclosure.Button"),g=(0,u.useContext)(D),b=null!==g&&g===f.panelId,w=(0,u.useRef)(null),E=(0,h.T)(w,t,(0,c.z)(e=>{if(!b)return m({type:4,element:e})}));(0,u.useEffect)(()=>{if(!b)return m({type:2,buttonId:n}),()=>{m({type:2,buttonId:null})}},[n,m,b]);let C=(0,c.z)(e=>{var t;if(b){if(1===f.disclosureState)return;switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),m({type:0}),null==(t=f.buttonElement)||t.focus()}}else switch(e.key){case x.R.Space:case x.R.Enter:e.preventDefault(),e.stopPropagation(),m({type:0})}}),k=(0,c.z)(e=>{e.key===x.R.Space&&e.preventDefault()}),P=(0,c.z)(e=>{var t;(0,y.P)(e.currentTarget)||s||(b?(m({type:0}),null==(t=f.buttonElement)||t.focus()):m({type:0}))}),{isFocusVisible:q,focusProps:S}=(0,i.F)({autoFocus:a}),{isHovered:T,hoverProps:_}=(0,o.X)({isDisabled:s}),{pressed:N,pressProps:I}=(0,l.x)({disabled:s}),M=(0,u.useMemo)(()=>({open:0===f.disclosureState,hover:T,active:N,disabled:s,focus:q,autofocus:a}),[f,T,N,q,s,a]),A=(0,d.f)(e,f.buttonElement),Q=b?(0,v.dG)({ref:E,type:A,disabled:s||void 0,autoFocus:a,onKeyDown:C,onClick:P},S,_,I):(0,v.dG)({ref:E,id:n,type:A,"aria-expanded":0===f.disclosureState,"aria-controls":f.panelElement?f.panelId:void 0,disabled:s||void 0,autoFocus:a,onKeyDown:C,onKeyUp:k,onClick:P},S,_,I);return(0,v.L6)()({ourProps:Q,theirProps:p,slot:M,defaultTag:"button",name:"Disclosure.Button"})}),Panel:(0,v.yV)(function(e,t){let r=(0,u.useId)(),{id:n="headlessui-disclosure-panel-".concat(r),transition:s=!1,...a}=e,[i,o]=O("Disclosure.Panel"),{close:l}=function e(t){let r=(0,u.useContext)(q);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,u.useState)(null),y=(0,h.T)(t,(0,c.z)(e=>{w(()=>o({type:5,element:e}))}),f);(0,u.useEffect)(()=>(o({type:3,panelId:n}),()=>{o({type:3,panelId:null})}),[n,o]);let g=(0,m.oJ)(),[b,x]=(0,p.Y)(s,d,null!==g?(g&m.ZM.Open)===m.ZM.Open:0===i.disclosureState),E=(0,u.useMemo)(()=>({open:0===i.disclosureState,close:l}),[i.disclosureState,l]),C={ref:y,id:n,...(0,p.X)(x)},k=(0,v.L6)();return u.createElement(m.uu,null,u.createElement(D.Provider,{value:i.panelId},k({ourProps:C,theirProps:a,slot:E,defaultTag:"div",features:_,visible:b,name:"Disclosure.Panel"})))})})},33443:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(2265);let s=(0,n.createContext)(()=>{});function a(e){let{value:t,children:r}=e;return n.createElement(s.Provider,{value:t},r)}}}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/5333-438ba079aae9630c.js b/litellm/proxy/_experimental/out/_next/static/chunks/5333-1540faf81c7d7006.js similarity index 99% rename from litellm/proxy/_experimental/out/_next/static/chunks/5333-438ba079aae9630c.js rename to litellm/proxy/_experimental/out/_next/static/chunks/5333-1540faf81c7d7006.js index 5e4051ca90..2a03ddfa5f 100644 --- a/litellm/proxy/_experimental/out/_next/static/chunks/5333-438ba079aae9630c.js +++ b/litellm/proxy/_experimental/out/_next/static/chunks/5333-1540faf81c7d7006.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5333],{57365:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(5853),o=n(2265),l=n(51975),i=n(13241);let u=(0,n(1153).fn)("SelectItem"),a=o.forwardRef((e,t)=>{let{value:n,icon:a,className:s,children:c}=e,d=(0,r._T)(e,["value","icon","className","children"]);return o.createElement(l.wt,Object.assign({className:(0,i.q)(u("root"),"flex justify-start items-center cursor-default text-tremor-default px-2.5 py-2.5","data-[focus]:bg-tremor-background-muted data-[focus]:text-tremor-content-strong data-[selected]:text-tremor-content-strong data-[selected]:bg-tremor-background-muted text-tremor-content-emphasis","dark:data-[focus]:bg-dark-tremor-background-muted dark:data-[focus]:text-dark-tremor-content-strong dark:data-[selected]:text-dark-tremor-content-strong dark:data-[selected]:bg-dark-tremor-background-muted dark:text-dark-tremor-content-emphasis",s),ref:t,key:n,value:n},d),a&&o.createElement(a,{className:(0,i.q)(u("icon"),"flex-none w-5 h-5 mr-1.5","text-tremor-content-subtle","dark:text-dark-tremor-content-subtle")}),o.createElement("span",{className:"whitespace-nowrap truncate"},null!=c?c:n))});a.displayName="SelectItem"},67101:function(e,t,n){n.d(t,{Z:function(){return c}});var r=n(5853),o=n(13241),l=n(1153),i=n(2265),u=n(9496);let a=(0,l.fn)("Grid"),s=(e,t)=>e&&Object.keys(t).includes(String(e))?t[e]:"",c=i.forwardRef((e,t)=>{let{numItems:n=1,numItemsSm:l,numItemsMd:c,numItemsLg:d,children:f,className:p}=e,m=(0,r._T)(e,["numItems","numItemsSm","numItemsMd","numItemsLg","children","className"]),g=s(n,u._m),v=s(l,u.LH),h=s(c,u.l5),b=s(d,u.N4),x=(0,o.q)(g,v,h,b);return i.createElement("div",Object.assign({ref:t,className:(0,o.q)(a("root"),"grid",x,p)},m),f)});c.displayName="Grid"},9496:function(e,t,n){n.d(t,{LH:function(){return o},N4:function(){return i},PT:function(){return u},SP:function(){return a},VS:function(){return s},_m:function(){return r},_w:function(){return c},l5:function(){return l}});let r={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"},o={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"},l={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"},i={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"},u={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"},a={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"},c={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"}},64803:function(e,t,n){n.d(t,{RR:function(){return m},YF:function(){return d},cv:function(){return f},dp:function(){return g},uY:function(){return p}});var r=n(51050),o=n(2265),l=n(54887),i="undefined"!=typeof document?o.useLayoutEffect:function(){};function u(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!u(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!u(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function a(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s(e,t){let n=a(e);return Math.round(t*n)/n}function c(e){let t=o.useRef(e);return i(()=>{t.current=e}),t}function d(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:d=[],platform:f,elements:{reference:p,floating:m}={},transform:g=!0,whileElementsMounted:v,open:h}=e,[b,x]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[E,y]=o.useState(d);u(E,d)||y(d);let[S,O]=o.useState(null),[R,w]=o.useState(null),C=o.useCallback(e=>{e!==M.current&&(M.current=e,O(e))},[]),P=o.useCallback(e=>{e!==k.current&&(k.current=e,w(e))},[]),L=p||S,T=m||R,M=o.useRef(null),k=o.useRef(null),I=o.useRef(b),F=null!=v,A=c(v),N=c(f),D=c(h),z=o.useCallback(()=>{if(!M.current||!k.current)return;let e={placement:t,strategy:n,middleware:E};N.current&&(e.platform=N.current),(0,r.oo)(M.current,k.current,e).then(e=>{let t={...e,isPositioned:!1!==D.current};H.current&&!u(I.current,t)&&(I.current=t,l.flushSync(()=>{x(t)}))})},[E,t,n,N,D]);i(()=>{!1===h&&I.current.isPositioned&&(I.current.isPositioned=!1,x(e=>({...e,isPositioned:!1})))},[h]);let H=o.useRef(!1);i(()=>(H.current=!0,()=>{H.current=!1}),[]),i(()=>{if(L&&(M.current=L),T&&(k.current=T),L&&T){if(A.current)return A.current(L,T,z);z()}},[L,T,z,A,F]);let _=o.useMemo(()=>({reference:M,floating:k,setReference:C,setFloating:P}),[C,P]),V=o.useMemo(()=>({reference:L,floating:T}),[L,T]),B=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!V.floating)return e;let t=s(V.floating,b.x),r=s(V.floating,b.y);return g?{...e,transform:"translate("+t+"px, "+r+"px)",...a(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,g,V.floating,b.x,b.y]);return o.useMemo(()=>({...b,update:z,refs:_,elements:V,floatingStyles:B}),[b,z,_,V,B])}let f=(e,t)=>({...(0,r.cv)(e),options:[e,t]}),p=(e,t)=>({...(0,r.uY)(e),options:[e,t]}),m=(e,t)=>({...(0,r.RR)(e),options:[e,t]}),g=(e,t)=>({...(0,r.dp)(e),options:[e,t]})},52307:function(e,t,n){n.d(t,{dk:function(){return f},fw:function(){return d},zH:function(){return c}});var r=n(2265),o=n(93980),l=n(73389),i=n(67561),u=n(87550),a=n(38929);let s=(0,r.createContext)(null);function c(){var e,t;return null!=(t=null==(e=(0,r.useContext)(s))?void 0:e.value)?t:void 0}function d(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)(()=>function(e){let n=(0,o.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),l=(0,r.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return r.createElement(s.Provider,{value:l},e.children)},[t])]}s.displayName="DescriptionContext";let f=Object.assign((0,a.yV)(function(e,t){let n=(0,r.useId)(),o=(0,u.B)(),{id:c="headlessui-description-".concat(n),...d}=e,f=function e(){let t=(0,r.useContext)(s);if(null===t){let t=Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),p=(0,i.T)(t);(0,l.e)(()=>f.register(c),[c,f.register]);let m=o||!1,g=(0,r.useMemo)(()=>({...f.slot,disabled:m}),[f.slot,m]),v={ref:p,...f.props,id:c};return(0,a.L6)()({ourProps:v,theirProps:d,slot:g,defaultTag:"p",name:f.name||"Description"})}),{})},7935:function(e,t,n){n.d(t,{__:function(){return p},bE:function(){return f},wp:function(){return d}});var r=n(2265),o=n(93980),l=n(73389),i=n(67561),u=n(87550),a=n(80281),s=n(38929);let c=(0,r.createContext)(null);function d(e){var t,n,o;let l=null!=(n=null==(t=(0,r.useContext)(c))?void 0:t.value)?n:void 0;return(null!=(o=null==e?void 0:e.length)?o:0)>0?[l,...e].filter(Boolean).join(" "):l}function f(){let{inherit:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=d(),[n,l]=(0,r.useState)([]),i=e?[t,...n].filter(Boolean):n;return[i.length>0?i.join(" "):void 0,(0,r.useMemo)(()=>function(e){let t=(0,o.z)(e=>(l(t=>[...t,e]),()=>l(t=>{let n=t.slice(),r=n.indexOf(e);return -1!==r&&n.splice(r,1),n}))),n=(0,r.useMemo)(()=>({register:t,slot:e.slot,name:e.name,props:e.props,value:e.value}),[t,e.slot,e.name,e.props,e.value]);return r.createElement(c.Provider,{value:n},e.children)},[l])]}c.displayName="LabelContext";let p=Object.assign((0,s.yV)(function(e,t){var n;let d=(0,r.useId)(),f=function e(){let t=(0,r.useContext)(c);if(null===t){let t=Error("You used a