cartethyia 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +5 -1
- package/dist/dashboard/assets/{AccountCooldown-ChpdzxRH.js → AccountCooldown-Bjo92Qat.js} +1 -1
- package/dist/dashboard/assets/AccountCooldown-Bjo92Qat.js.gz +0 -0
- package/dist/dashboard/assets/{BannedPage-9igfctfZ.js → BannedPage-MsQaeQTs.js} +1 -1
- package/dist/dashboard/assets/BannedPage-MsQaeQTs.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-BO9nKg9w.js +1 -0
- package/dist/dashboard/assets/CliToolDetailPage-BO9nKg9w.js.gz +0 -0
- package/dist/dashboard/assets/{CliToolsPage-D3xqZbN-.js → CliToolsPage-DfWHTJ7v.js} +1 -1
- package/dist/dashboard/assets/CliToolsPage-DfWHTJ7v.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-BrCBQDAc.js +1 -0
- package/dist/dashboard/assets/CombosPage-BrCBQDAc.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-C6Uh33er.js +1 -0
- package/dist/dashboard/assets/ConsoleLogPage-C6Uh33er.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-8aS9hyJu.js +1 -0
- package/dist/dashboard/assets/CustomizationPage-8aS9hyJu.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-qomXThxX.js +1 -0
- package/dist/dashboard/assets/HealthEventsModal-qomXThxX.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-C8hKyXBe.js +1 -0
- package/dist/dashboard/assets/LoginPage-C8hKyXBe.js.gz +0 -0
- package/dist/dashboard/assets/ModelPicker-CWkTUtpX.js +1 -0
- package/dist/dashboard/assets/ModelPicker-CWkTUtpX.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-C-ExCy1V.js +1 -0
- package/dist/dashboard/assets/OverviewPage-C-ExCy1V.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-tr811uaF.js +3 -0
- package/dist/dashboard/assets/ProviderDetailPage-tr811uaF.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-BS9IEpvv.js +1 -0
- package/dist/dashboard/assets/ProvidersPage-BS9IEpvv.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-Rn_qXScb.js +7 -0
- package/dist/dashboard/assets/ProxyPage-Rn_qXScb.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-BihkgQSq.js +1 -0
- package/dist/dashboard/assets/QuotaPage-BihkgQSq.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-DhiEjm6T.js +1 -0
- package/dist/dashboard/assets/SettingsPage-DhiEjm6T.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-CXjUlfqr.js +1 -0
- package/dist/dashboard/assets/SetupPage-CXjUlfqr.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-C-_oD3F2.js +1 -0
- package/dist/dashboard/assets/SortableList-C-_oD3F2.js.gz +0 -0
- package/dist/dashboard/assets/{StudioPage-CbK3hXvU.js → StudioPage-u9IxmYOI.js} +3 -3
- package/dist/dashboard/assets/StudioPage-u9IxmYOI.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-BEVLVrwP.js +56 -0
- package/dist/dashboard/assets/UsagePage-BEVLVrwP.js.gz +0 -0
- package/dist/dashboard/assets/{api-keys-BmDbsior.js → api-keys-uNywYlfv.js} +1 -1
- package/dist/dashboard/assets/api-keys-uNywYlfv.js.gz +0 -0
- package/dist/dashboard/assets/{app-C-Y4oZT0.js → app-CafWtVXA.js} +1 -1
- package/dist/dashboard/assets/{app-C-Y4oZT0.js.gz → app-CafWtVXA.js.gz} +0 -0
- package/dist/dashboard/assets/app-DxivpfYG.css +2 -0
- package/dist/dashboard/assets/app-DxivpfYG.css.gz +0 -0
- package/dist/dashboard/assets/{assert-BHfaei-X.js → assert-NHwYq95t.js} +1 -1
- package/dist/dashboard/assets/{assert-BHfaei-X.js.gz → assert-NHwYq95t.js.gz} +0 -0
- package/dist/dashboard/assets/badge-6uzDDvqs.js +1 -0
- package/dist/dashboard/assets/badge-6uzDDvqs.js.gz +0 -0
- package/dist/dashboard/assets/banner-4_WNg2WZ.js +1 -0
- package/dist/dashboard/assets/banner-4_WNg2WZ.js.gz +0 -0
- package/dist/dashboard/assets/card--AtFedAq.js +1 -0
- package/dist/dashboard/assets/card--AtFedAq.js.gz +0 -0
- package/dist/dashboard/assets/{cli-tools-B0wBq-RL.js → cli-tools-B3e7dx3N.js} +1 -1
- package/dist/dashboard/assets/cli-tools-B3e7dx3N.js.gz +0 -0
- package/dist/dashboard/assets/clipboard-button-NreUx6c8.js +1 -0
- package/dist/dashboard/assets/clipboard-button-NreUx6c8.js.gz +0 -0
- package/dist/dashboard/assets/dialog-BtpsJU98.js +1 -0
- package/dist/dashboard/assets/dialog-BtpsJU98.js.gz +0 -0
- package/dist/dashboard/assets/drawer-WwwtzihF.js +1 -0
- package/dist/dashboard/assets/drawer-WwwtzihF.js.gz +0 -0
- package/dist/dashboard/assets/entry-Dj9AR0gY.js +4 -0
- package/dist/dashboard/assets/entry-Dj9AR0gY.js.gz +0 -0
- package/dist/dashboard/assets/entry-TJIye_jT.js +1 -0
- package/dist/dashboard/assets/entry-TJIye_jT.js.gz +0 -0
- package/dist/dashboard/assets/{entry-D4O2229X.js → entry-jy9_4-Ke.js} +1 -1
- package/dist/dashboard/assets/entry-jy9_4-Ke.js.gz +0 -0
- package/dist/dashboard/assets/github-badge-D_eM3IgG.js +1 -0
- package/dist/dashboard/assets/github-badge-D_eM3IgG.js.gz +0 -0
- package/dist/dashboard/assets/{index-CXm3FIyt.js → index-DCBtROoK.js} +2 -2
- package/dist/dashboard/assets/index-DCBtROoK.js.gz +0 -0
- package/dist/dashboard/assets/inline-BcNGF8Gr.js +1 -0
- package/dist/dashboard/assets/inline-BcNGF8Gr.js.gz +0 -0
- package/dist/dashboard/assets/input-BG41et9G.js +1 -0
- package/dist/dashboard/assets/input-BG41et9G.js.gz +0 -0
- package/dist/dashboard/assets/layout-C8mer_Ak.js +1 -0
- package/dist/dashboard/assets/layout-C8mer_Ak.js.gz +0 -0
- package/dist/dashboard/assets/list-row-Gh_W4OR_.js +1 -0
- package/dist/dashboard/assets/list-row-Gh_W4OR_.js.gz +0 -0
- package/dist/dashboard/assets/{live-yfEJFF9T.js → live-BJGYRBnR.js} +1 -1
- package/dist/dashboard/assets/live-BJGYRBnR.js.gz +0 -0
- package/dist/dashboard/assets/{model-bans-CT-TxSNX.js → model-bans-DeVLDA7I.js} +1 -1
- package/dist/dashboard/assets/model-bans-DeVLDA7I.js.gz +0 -0
- package/dist/dashboard/assets/numbers-Bs4LOOuf.js +2 -0
- package/dist/dashboard/assets/numbers-Bs4LOOuf.js.gz +0 -0
- package/dist/dashboard/assets/{routing-Cs6jl49L.js → routing-CcusqXA7.js} +1 -1
- package/dist/dashboard/assets/routing-CcusqXA7.js.gz +0 -0
- package/dist/dashboard/assets/select-DsX5QT8K.js +41 -0
- package/dist/dashboard/assets/select-DsX5QT8K.js.gz +0 -0
- package/dist/dashboard/assets/{settings-CfcTcOyU.js → settings-mpmXTgUa.js} +1 -1
- package/dist/dashboard/assets/settings-mpmXTgUa.js.gz +0 -0
- package/dist/dashboard/assets/stack-DwLmjUFK.js +1 -0
- package/dist/dashboard/assets/stack-DwLmjUFK.js.gz +0 -0
- package/dist/dashboard/assets/state-DYdQmdAl.js +1 -0
- package/dist/dashboard/assets/state-DYdQmdAl.js.gz +0 -0
- package/dist/dashboard/assets/switch-CidSfbG7.js +1 -0
- package/dist/dashboard/assets/switch-CidSfbG7.js.gz +0 -0
- package/dist/dashboard/assets/{useMutation-BQKMcJ1H.js → useMutation-w4u4CVue.js} +1 -1
- package/dist/dashboard/assets/useMutation-w4u4CVue.js.gz +0 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/dashboard/index.html.gz +0 -0
- package/dist/dashboard/precompressed-assets.json +51 -54
- package/package.json +1 -1
- package/scripts/cli/command/tray.ts +47 -8
- package/src/boot/app.ts +3 -2
- package/src/console/observability/contracts.ts +11 -1
- package/src/console/observability/store.ts +9 -6
- package/src/providers/discovery/openrouter-free-roster.ts +3 -11
- package/src/providers/discovery/probe-phases.ts +42 -5
- package/src/providers/discovery/probing-service.ts +25 -2
- package/src/providers/integrations/claude/claude.ts +3 -1
- package/src/providers/integrations/cloudflareai/cloudflareai-models.ts +3 -1
- package/src/providers/integrations/inferhub.ts +3 -1
- package/src/providers/integrations/kilo/kilo.ts +0 -1
- package/src/providers/integrations/kiro/kiro-catalog.ts +8 -2
- package/src/providers/integrations/openrouter/provider.ts +5 -15
- package/src/security/api-key-auth.ts +23 -0
- package/src/transport/guards/auth-guard.ts +2 -3
- package/dist/dashboard/assets/AccountCooldown-ChpdzxRH.js.gz +0 -0
- package/dist/dashboard/assets/BannedPage-9igfctfZ.js.gz +0 -0
- package/dist/dashboard/assets/CliToolDetailPage-ZRr2K2sF.js +0 -1
- package/dist/dashboard/assets/CliToolDetailPage-ZRr2K2sF.js.gz +0 -0
- package/dist/dashboard/assets/CliToolsPage-D3xqZbN-.js.gz +0 -0
- package/dist/dashboard/assets/CombosPage-CVnQPBBz.js +0 -1
- package/dist/dashboard/assets/CombosPage-CVnQPBBz.js.gz +0 -0
- package/dist/dashboard/assets/ConsoleLogPage-u6W1UXSc.js +0 -1
- package/dist/dashboard/assets/ConsoleLogPage-u6W1UXSc.js.gz +0 -0
- package/dist/dashboard/assets/CustomizationPage-CTTpCb25.js +0 -1
- package/dist/dashboard/assets/CustomizationPage-CTTpCb25.js.gz +0 -0
- package/dist/dashboard/assets/HealthEventsModal-C5XpWlvy.js +0 -1
- package/dist/dashboard/assets/HealthEventsModal-C5XpWlvy.js.gz +0 -0
- package/dist/dashboard/assets/LoginPage-DHoB3Agn.js +0 -1
- package/dist/dashboard/assets/LoginPage-DHoB3Agn.js.gz +0 -0
- package/dist/dashboard/assets/ModelPicker-oQ-SDXp8.js +0 -1
- package/dist/dashboard/assets/ModelPicker-oQ-SDXp8.js.gz +0 -0
- package/dist/dashboard/assets/OverviewPage-BrY4SgIt.js +0 -1
- package/dist/dashboard/assets/OverviewPage-BrY4SgIt.js.gz +0 -0
- package/dist/dashboard/assets/ProviderDetailPage-D9VSt7T_.js +0 -3
- package/dist/dashboard/assets/ProviderDetailPage-D9VSt7T_.js.gz +0 -0
- package/dist/dashboard/assets/ProvidersPage-Df77V5I5.js +0 -1
- package/dist/dashboard/assets/ProvidersPage-Df77V5I5.js.gz +0 -0
- package/dist/dashboard/assets/ProxyPage-CDfxP7AC.js +0 -7
- package/dist/dashboard/assets/ProxyPage-CDfxP7AC.js.gz +0 -0
- package/dist/dashboard/assets/QuotaPage-CY4o2t4p.js +0 -1
- package/dist/dashboard/assets/QuotaPage-CY4o2t4p.js.gz +0 -0
- package/dist/dashboard/assets/SettingsPage-CvjZxHE4.js +0 -1
- package/dist/dashboard/assets/SettingsPage-CvjZxHE4.js.gz +0 -0
- package/dist/dashboard/assets/SetupPage-D3nza7LH.js +0 -1
- package/dist/dashboard/assets/SetupPage-D3nza7LH.js.gz +0 -0
- package/dist/dashboard/assets/SortableList-Dtt12WT1.js +0 -1
- package/dist/dashboard/assets/SortableList-Dtt12WT1.js.gz +0 -0
- package/dist/dashboard/assets/StudioPage-CbK3hXvU.js.gz +0 -0
- package/dist/dashboard/assets/UsagePage-BQlWbWg2.js +0 -56
- package/dist/dashboard/assets/UsagePage-BQlWbWg2.js.gz +0 -0
- package/dist/dashboard/assets/api-keys-BmDbsior.js.gz +0 -0
- package/dist/dashboard/assets/app-BbpSarVV.css +0 -2
- package/dist/dashboard/assets/app-BbpSarVV.css.gz +0 -0
- package/dist/dashboard/assets/badge-DpXT4Ixt.js +0 -1
- package/dist/dashboard/assets/badge-DpXT4Ixt.js.gz +0 -0
- package/dist/dashboard/assets/banner-CSAAWLJv.js +0 -1
- package/dist/dashboard/assets/banner-CSAAWLJv.js.gz +0 -0
- package/dist/dashboard/assets/card-DEhRXXw4.js +0 -1
- package/dist/dashboard/assets/card-DEhRXXw4.js.gz +0 -0
- package/dist/dashboard/assets/check-D69FzdvC.js +0 -1
- package/dist/dashboard/assets/check-D69FzdvC.js.gz +0 -0
- package/dist/dashboard/assets/cli-tools-B0wBq-RL.js.gz +0 -0
- package/dist/dashboard/assets/clipboard-button-DOo6EU8O.js +0 -1
- package/dist/dashboard/assets/clipboard-button-DOo6EU8O.js.gz +0 -0
- package/dist/dashboard/assets/copy-ngmQ9zcZ.js +0 -1
- package/dist/dashboard/assets/copy-ngmQ9zcZ.js.gz +0 -0
- package/dist/dashboard/assets/dialog-BvQeBMfP.js +0 -1
- package/dist/dashboard/assets/dialog-BvQeBMfP.js.gz +0 -0
- package/dist/dashboard/assets/drawer-CMwPXwQB.js +0 -1
- package/dist/dashboard/assets/drawer-CMwPXwQB.js.gz +0 -0
- package/dist/dashboard/assets/entry-D4O2229X.js.gz +0 -0
- package/dist/dashboard/assets/entry-DKvr5Q9K.js +0 -1
- package/dist/dashboard/assets/entry-DKvr5Q9K.js.gz +0 -0
- package/dist/dashboard/assets/entry-FQCejoDY.js +0 -4
- package/dist/dashboard/assets/entry-FQCejoDY.js.gz +0 -0
- package/dist/dashboard/assets/github-badge-zliLvBwr.js +0 -1
- package/dist/dashboard/assets/github-badge-zliLvBwr.js.gz +0 -0
- package/dist/dashboard/assets/index-CXm3FIyt.js.gz +0 -0
- package/dist/dashboard/assets/inline-D1IlZZ8H.js +0 -1
- package/dist/dashboard/assets/inline-D1IlZZ8H.js.gz +0 -0
- package/dist/dashboard/assets/input-BpVZdrbc.js +0 -1
- package/dist/dashboard/assets/input-BpVZdrbc.js.gz +0 -0
- package/dist/dashboard/assets/layout-BioLW7gN.js +0 -1
- package/dist/dashboard/assets/layout-BioLW7gN.js.gz +0 -0
- package/dist/dashboard/assets/list-row-CwVcGAIc.js +0 -1
- package/dist/dashboard/assets/list-row-CwVcGAIc.js.gz +0 -0
- package/dist/dashboard/assets/live-yfEJFF9T.js.gz +0 -0
- package/dist/dashboard/assets/model-bans-CT-TxSNX.js.gz +0 -0
- package/dist/dashboard/assets/numbers-CFL4_Dqc.js +0 -1
- package/dist/dashboard/assets/numbers-CFL4_Dqc.js.gz +0 -0
- package/dist/dashboard/assets/routing-Cs6jl49L.js.gz +0 -0
- package/dist/dashboard/assets/select-C0Rer3gF.js +0 -41
- package/dist/dashboard/assets/select-C0Rer3gF.js.gz +0 -0
- package/dist/dashboard/assets/settings-CfcTcOyU.js.gz +0 -0
- package/dist/dashboard/assets/stack-C9_uUjaA.js +0 -1
- package/dist/dashboard/assets/stack-C9_uUjaA.js.gz +0 -0
- package/dist/dashboard/assets/state-DA0B95UQ.js +0 -1
- package/dist/dashboard/assets/state-DA0B95UQ.js.gz +0 -0
- package/dist/dashboard/assets/switch-Cittxy-x.js +0 -1
- package/dist/dashboard/assets/switch-Cittxy-x.js.gz +0 -0
- package/dist/dashboard/assets/toast-CNt_jzO4.js +0 -2
- package/dist/dashboard/assets/toast-CNt_jzO4.js.gz +0 -0
- package/dist/dashboard/assets/useMutation-BQKMcJ1H.js.gz +0 -0
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-DHoB3Agn.js","assets/jsx-runtime-CXUMngI_.js","assets/toast-CNt_jzO4.js","assets/app-C-Y4oZT0.js","assets/app-BbpSarVV.css","assets/log-in-BmRjy60c.js","assets/query-keys-D7wX2vM5.js","assets/input-BpVZdrbc.js","assets/eye-off-Bk5g2luF.js","assets/eye-C_hawfH4.js","assets/SetupPage-D3nza7LH.js","assets/layout-BioLW7gN.js","assets/backup-file-gdKIlg8U.js","assets/BannedPage-9igfctfZ.js","assets/OverviewPage-BrY4SgIt.js","assets/model-bans-CT-TxSNX.js","assets/assert-BHfaei-X.js","assets/useMutation-BQKMcJ1H.js","assets/mutation-BkoLM5Ba.js","assets/fingerprint-pattern-BWuHtbW4.js","assets/check-D69FzdvC.js","assets/chevron-right-BXIy5l3h.js","assets/SortableList-Dtt12WT1.js","assets/stack-C9_uUjaA.js","assets/copy-ngmQ9zcZ.js","assets/download-A0SW9OCW.js","assets/gauge-BbIMy7MB.js","assets/state-DA0B95UQ.js","assets/key-round-UkavsGxp.js","assets/clipboard-button-DOo6EU8O.js","assets/use-clipboard-B0Sy03fE.js","assets/dialog-BvQeBMfP.js","assets/use-presence-BSZEBx7U.js","assets/pencil-768ysRAr.js","assets/plus-DIdX_g-x.js","assets/refresh-cw-BqJFk4sU.js","assets/route-CNSNj9Zm.js","assets/search-JOKus9rb.js","assets/shield-check-DVS0Foqh.js","assets/settings-CfcTcOyU.js","assets/sparkles-BRaRUxAU.js","assets/trash-Cppn5c3R.js","assets/card-DEhRXXw4.js","assets/download-dRFo5_Wu.js","assets/tokens-DDxMbSRL.js","assets/badge-DpXT4Ixt.js","assets/select-C0Rer3gF.js","assets/ModelPicker-oQ-SDXp8.js","assets/ProviderIcon-CmfzxpVM.js","assets/switch-Cittxy-x.js","assets/inline-D1IlZZ8H.js","assets/api-keys-BmDbsior.js","assets/cli-tools-B0wBq-RL.js","assets/quota-DZGyp0N5.js","assets/UsagePage-BQlWbWg2.js","assets/terminal-Bd4ee8TA.js","assets/drawer-CMwPXwQB.js","assets/circle-check-BU3v_mFW.js","assets/cog-CdWhsajs.js","assets/image-BPaouViG.js","assets/scaling-nWE4Cx8f.js","assets/wrench-B6E1oEuY.js","assets/use-reduced-motion-C4B0R6Sz.js","assets/numbers-CFL4_Dqc.js","assets/privacy-mode-GM8bej85.js","assets/use-timeout-BwcBBRrT.js","assets/banner-CSAAWLJv.js","assets/live-yfEJFF9T.js","assets/stream-retry-5QnVuSSo.js","assets/ProviderDetailPage-D9VSt7T_.js","assets/arrow-left-CpBxkoxI.js","assets/brain-Cwed_72z.js","assets/circle-alert-CntYHV5v.js","assets/layers-2-glBbjl.js","assets/power-off-Yjw9GMJh.js","assets/rotate-ccw-CufcqITi.js","assets/list-row-CwVcGAIc.js","assets/routing-Cs6jl49L.js","assets/HealthEventsModal-C5XpWlvy.js","assets/AccountCooldown-ChpdzxRH.js","assets/ProvidersPage-Df77V5I5.js","assets/dialog-actions-B1axpEg7.js","assets/CombosPage-CVnQPBBz.js","assets/arrow-right-Dl5yKnp8.js","assets/QuotaPage-CY4o2t4p.js","assets/ProxyPage-CDfxP7AC.js","assets/SettingsPage-CvjZxHE4.js","assets/CliToolsPage-D3xqZbN-.js","assets/ToolIcon-K1ckcDKg.js","assets/CliToolDetailPage-ZRr2K2sF.js","assets/ConsoleLogPage-u6W1UXSc.js","assets/CustomizationPage-CTTpCb25.js","assets/StudioPage-CbK3hXvU.js","assets/message-circle-CCxGwRvv.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,o as t,r as n,t as r}from"./jsx-runtime-CXUMngI_.js";import{t as i}from"./index-CXm3FIyt.js";import{a,o,r as s,t as c}from"./app-C-Y4oZT0.js";import{n as l,r as u,t as d}from"./terminal-Bd4ee8TA.js";import{_ as f,c as p,d as m,g as h,h as g,l as _,m as v,p as y,r as b,s as ee,t as x,u as te,v as ne,y as re}from"./toast-CNt_jzO4.js";import{t as ie}from"./dialog-BvQeBMfP.js";import{C as S,T as C,_ as ae,c as oe,d as se,f as ce,g as le,h as ue,l as de,m as fe,n as pe,p as me,r as he,s as ge,t as _e,v as w,w as ve}from"./assert-BHfaei-X.js";import{C as ye,D as be,E as xe,O as T,P as Se,S as Ce,_ as we,a as E,b as Te,c as Ee,d as De,f as Oe,g as ke,i as D,j as Ae,k as je,l as O,o as k,r as Me,t as A,v as j,w as Ne,y as Pe}from"./query-keys-D7wX2vM5.js";import{t as Fe}from"./mutation-BkoLM5Ba.js";import{t as M}from"./useMutation-BQKMcJ1H.js";import{t as Ie}from"./dialog-actions-B1axpEg7.js";var Le=e(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Re=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ze=e(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Be=e(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Ve=e(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),He=e(`memory-stick`,[[`path`,{d:`M12 12v-2`,key:`fwoke6`}],[`path`,{d:`M12 18v-2`,key:`qj6yno`}],[`path`,{d:`M16 12v-2`,key:`heuere`}],[`path`,{d:`M16 18v-2`,key:`s1ct0w`}],[`path`,{d:`M2 11h1.5`,key:`15p63e`}],[`path`,{d:`M20 18v-2`,key:`12ehxp`}],[`path`,{d:`M20.5 11H22`,key:`khsy7a`}],[`path`,{d:`M4 18v-2`,key:`1c3oqr`}],[`path`,{d:`M8 12v-2`,key:`1mwtfd`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`rect`,{x:`2`,y:`6`,width:`20`,height:`10`,rx:`2`,key:`1qcswk`}]]),Ue=e(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),We=e(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Ge=e(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Ke=e(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),qe=e(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),Je=e(`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`}]]),Ye=e(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Xe=e(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ze=e(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]);function Qe(e){let t;if(e.then(e=>(t=e,e),T)?.catch?.(T),t!==void 0)return{data:t}}function $e(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function et(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(T),r}function tt(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:et(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function nt(e){return e.state.isPaused}function rt(e){return e.state.status===`success`}function it(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??nt,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[$e(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??rt,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[tt(e,o,a)]:[])}}function at(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?Qe(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a?a(f):f,m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l!==void 0&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l??Date.now(),...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l??Date.now()}});c&&!d&&!h&&!g&&(l===void 0||l>m.state.dataUpdatedAt)&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(T)})}var ot=class extends Te{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Fe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=st(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=st(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=st(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=st(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){j.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>xe(t,e))}findAll(e={}){return this.getAll().filter(t=>xe(e,t))}notify(e){j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return j.batch(()=>Promise.all(e.map(e=>e.continue().catch(T))))}};function st(e){return e.options.scope?.id}var ct=class extends Te{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Ne(r,t),a=this.get(i);return a||(a=new Oe({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){j.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>be(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>be(e,t)):t}notify(e){j.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){j.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){j.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ct,this.#t=e.mutationCache||new ot,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Pe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=we.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ae(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ce(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return j.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;j.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return j.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=j.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(T).catch(T)}invalidateQueries(e,t={}){return j.batch(()=>(this.#e.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 n={...t,cancelRefetch:t.cancelRefetch??!0},r=j.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(T)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(T)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Ae(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ae(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(T).catch(T)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(T).catch(T)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return we.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ye(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{je(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ye(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{je(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ne(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Se&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},N=t(n(),1),ut=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,dt=/^[\\/]{2}/;function ft(e,t){return t+e.replace(/\\/g,`/`)}var pt=`popstate`;function mt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ht(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return vt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:I(t)}return bt(t,n,null,e)}function P(e,t){if(e===!1||e==null)throw Error(t)}function F(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function gt(){return Math.random().toString(36).substring(2,10)}function _t(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function vt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?yt(t):t,state:n,key:t&&t.key||r||gt(),mask:i}}function I({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function yt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function bt(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=mt(e)?e:vt(h.location,e,t);n&&n(r,e),l=u()+1;let d=_t(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=mt(e)?e:vt(h.location,e,t);n&&n(r,e),l=u();let i=_t(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return xt(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(pt,d),c=e,()=>{i.removeEventListener(pt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function xt(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),P(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:I(t);return i=i.replace(/ $/,`%20`),!n&&dt.test(i)&&(i=r+i),new URL(i,r)}function St(e,t,n=`/`){return Ct(e,t,n,!1)}function Ct(e,t,n,r,i){let a=L((typeof t==`string`?yt(t):t).pathname||`/`,n);if(a==null)return null;let o=i??wt(e),s=null,c=Vt(a);for(let e=0;s==null&&e<o.length;++e)s=Lt(o[e],c,r);return s}function wt(e){let t=Tt(e);return Dt(t),t}function Tt(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;P(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=R([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(P(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Tt(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Ft(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Bt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Et(e.path))a(e,t,!0,n)}),t}function Et(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Et(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Dt(e){e.sort((e,t)=>e.score===t.score?It(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ot=/^:[\w-]+$/,kt=3,At=2,jt=1,Mt=10,Nt=-2,Pt=e=>e===`*`;function Ft(e,t){let n=e.split(`/`),r=n.length;return n.some(Pt)&&(r+=Nt),t&&(r+=At),n.filter(e=>!Pt(e)).reduce((e,t)=>e+(Ot.test(t)?kt:t===``?jt:Mt),r)}function It(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Lt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?zt(u,l,s.matcher,s.compiledParams):Rt(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Rt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:R([a,d.pathname]),pathnameBase:Yt(R([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=R([a,d.pathnameBase]))}return o}function Rt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Bt(e.path,e.caseSensitive,e.end);return zt(e,t,n,r)}function zt(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=z(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=z(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Bt(e,t=!1,n=!0){F(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Vt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return F(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function L(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Ht(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?yt(e):e,a;return n?(n=Jt(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Ut(n.substring(1),`/`):Ut(n,t)):a=t,{pathname:a,search:Xt(r),hash:Zt(i)}}function Ut(e,t){let n=z(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Wt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Gt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Kt(e){let t=Gt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function qt(e,t,n,r=!1){let i;typeof e==`string`?i=yt(e):(i={...e},P(!i.pathname||!i.pathname.includes(`?`),Wt(`?`,`pathname`,`search`,i)),P(!i.pathname||!i.pathname.includes(`#`),Wt(`#`,`pathname`,`hash`,i)),P(!i.search||!i.search.includes(`#`),Wt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ht(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Jt=e=>e.replace(/[\\/]{2,}/g,`/`),R=e=>Jt(e.join(`/`));function z(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Yt=e=>z(e).replace(/^\/*/,`/`),Xt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Zt=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Qt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function $t(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function en(e){return R(e.map(e=>e.route.path).filter(Boolean))||`/`}var tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function nn(e,t){let n=e;if(typeof n!=`string`||!ut.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(tn)try{let e=new URL(window.location.href),r=dt.test(n)?new URL(ft(n,e.protocol)):new URL(n),a=L(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{F(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var rn=new URL(`http://localhost`);function an(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),rn)}catch{return rn}}function on(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function sn(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function cn(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!on(i,n),s=!on(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!sn(e,i)||!on(i,a)))throw Error(`External navigation is not allowed`)}var ln=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(ln);var un=[`GET`,...ln];new Set(un);var dn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function fn(e){try{return dn.includes(new URL(e).protocol)}catch{return!1}}var B=N.createContext(null);B.displayName=`DataRouter`;var pn=N.createContext(null);pn.displayName=`DataRouterState`;var mn=N.createContext(!1);function hn(){return N.useContext(mn)}var gn=N.createContext({isTransitioning:!1});gn.displayName=`ViewTransition`;var _n=N.createContext(new Map);_n.displayName=`Fetchers`;var vn=N.createContext(null);vn.displayName=`Await`;var V=N.createContext(null);V.displayName=`Navigation`;var yn=N.createContext(null);yn.displayName=`Location`;var H=N.createContext({outlet:null,matches:[],isDataRoute:!1});H.displayName=`Route`;var bn=N.createContext(null);bn.displayName=`RouteError`;var xn=`REACT_ROUTER_ERROR`,Sn=`REDIRECT`,Cn=`ROUTE_ERROR_RESPONSE`;function wn(e){if(e.startsWith(`${xn}:${Sn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Tn(e){if(e.startsWith(`${xn}:${Cn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Qt(t.status,t.statusText,t.data)}catch{}}function En(e,{relative:t}={}){P(U(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=N.useContext(V),{hash:i,pathname:a,search:o}=jn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:R([n,a])),r.createHref({pathname:s,search:o,hash:i})}function U(){return N.useContext(yn)!=null}function W(){return P(U(),`useLocation() may be used only in the context of a <Router> component.`),N.useContext(yn).location}var Dn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function On(e){N.useContext(V).static||N.useLayoutEffect(e)}function G(){let{isDataRoute:e}=N.useContext(H);return e?Jn():kn()}function kn(){P(U(),`useNavigate() may be used only in the context of a <Router> component.`);let e=N.useContext(B),{basename:t,navigator:n}=N.useContext(V),{matches:r}=N.useContext(H),{pathname:i}=W(),a=JSON.stringify(Kt(r)),o=N.useRef(!1);return On(()=>{o.current=!0}),N.useCallback((r,s={})=>{if(F(o.current,Dn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=qt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:R([t,c.pathname])),cn(typeof r==`string`?r:I(r),n.createHref(c),an(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}N.createContext(null);function An(){let{matches:e}=N.useContext(H);return e[e.length-1]?.params??{}}function jn(e,{relative:t}={}){let{matches:n}=N.useContext(H),{pathname:r}=W(),i=JSON.stringify(Kt(n));return N.useMemo(()=>qt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Mn(e,t){return Nn(e,t)}function Nn(e,t,n){P(U(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=N.useContext(V),{matches:i}=N.useContext(H),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Xn(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
3
|
-
|
|
4
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=W(),d;if(t){let e=typeof t==`string`?yt(t):t;P(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):St(e,{pathname:p});F(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),F(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Bn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:R([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:R([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?N.createElement(yn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Pn(){let e=qn(),t=$t(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=N.createElement(N.Fragment,null,N.createElement(`p`,null,`💿 Hey developer 👋`),N.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,N.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,N.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),N.createElement(N.Fragment,null,N.createElement(`h2`,null,`Unexpected Application Error!`),N.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?N.createElement(`pre`,{style:i},n):null,o)}var Fn=N.createElement(Pn,null),In=class extends N.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Tn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:N.createElement(H.Provider,{value:this.props.routeContext},N.createElement(bn.Provider,{value:e,children:this.props.component}));return this.context?N.createElement(Rn,{error:e},t):t}};In.contextType=mn;var Ln=new WeakMap;function Rn({children:e,error:t}){let{basename:n,navigator:r}=N.useContext(V);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=wn(t.digest);if(e){let i=Ln.get(t);if(i)throw i;let a=nn(e.location,n),o=a.absoluteURL||a.to;if(cn(e.location,o,an(r),`allow-explicit`),fn(o))throw Error(`Invalid redirect location`);if(tn&&!Ln.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Ln.set(t,n),n}}return N.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function zn({routeContext:e,match:t,children:n}){let r=N.useContext(B);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),N.createElement(H.Provider,{value:e},n)}function Bn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);P(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:en(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Fn,o&&(s<0&&c===0?(Xn(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?N.createElement(n.route.Component,null):n.route.element?n.route.element:e,N.createElement(zn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?N.createElement(In,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Vn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hn(e){let t=N.useContext(B);return P(t,Vn(e)),t}function Un(e){let t=N.useContext(pn);return P(t,Vn(e)),t}function Wn(e){let t=N.useContext(H);return P(t,Vn(e)),t}function Gn(e){let t=Wn(e),n=t.matches[t.matches.length-1];return P(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Kn(){return Gn(`useRouteId`)}function qn(){let e=N.useContext(bn),t=Un(`useRouteError`),n=Gn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Jn(){let{router:e}=Hn(`useNavigate`),t=Gn(`useNavigate`),n=N.useRef(!1);return On(()=>{n.current=!0}),N.useCallback(async(r,i={})=>{F(n.current,Dn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Yn={};function Xn(e,t,n){!t&&!Yn[e]&&(Yn[e]=!0,F(!1,n))}N.memo(Zn);function Zn({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Nn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Qn({to:e,replace:t,state:n,relative:r}){P(U(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=N.useContext(V);F(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=N.useContext(H),{pathname:s}=W(),c=G(),l=qt(e,Kt(o),s,r===`path`);cn(typeof e==`string`?e:I(e),a.createHref(l),an(a),`reject`);let u=JSON.stringify(l);return N.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function K(e){P(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function $n({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){P(!U(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=N.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=yt(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=N.useMemo(()=>{let e=L(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return F(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:N.createElement(V.Provider,{value:c},N.createElement(yn.Provider,{children:t,value:h}))}function er({children:e,location:t}){return Mn(tr(e),t)}N.Component;function tr(e,t=[]){let n=[];return N.Children.forEach(e,(e,r)=>{if(!N.isValidElement(e))return;let i=[...t,r];if(e.type===N.Fragment){n.push.apply(n,tr(e.props.children,i));return}P(e.type===K,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),P(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=tr(e.props.children,i)),n.push(a)}),n}var nr=`get`,rr=`application/x-www-form-urlencoded`;function ir(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ar(e){return ir(e)&&e.tagName.toLowerCase()===`button`}function or(e){return ir(e)&&e.tagName.toLowerCase()===`form`}function sr(e){return ir(e)&&e.tagName.toLowerCase()===`input`}function cr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function lr(e,t){return e.button===0&&(!t||t===`_self`)&&!cr(e)}function ur(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function dr(e,t){let n=ur(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var fr=null;function pr(){if(fr===null)try{new FormData(document.createElement(`form`),0),fr=!1}catch{fr=!0}return fr}var mr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function hr(e){return e!=null&&!mr.has(e)?(F(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rr}"`),null):e}function gr(e,t){let n,r,i,a,o;if(or(e)){let o=e.getAttribute(`action`);r=o?L(o,t):null,n=e.getAttribute(`method`)||nr,i=hr(e.getAttribute(`enctype`))||rr,a=new FormData(e)}else if(ar(e)||sr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?L(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||nr,i=hr(e.getAttribute(`formenctype`))||hr(o.getAttribute(`enctype`))||rr,a=new FormData(o,e),!pr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ir(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=nr,r=null,i=rr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function _r(e,t){if(e===!1||e==null)throw Error(t)}function vr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&L(i.pathname,t)===`/`?`${z(t)}/_root.${r}`:`${z(i.pathname)}.${r}`,i}async function yr(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function br(e){return e!=null&&typeof e.page==`string`}function xr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Sr(e,t,n){return Dr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await yr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(xr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Cr(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function wr(e,t,{includeHydrateFallback:n}={}){return Tr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Tr(e){return[...new Set(e)]}function Er(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Dr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!br(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Er(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Or(){let e=N.useContext(B);return _r(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function kr(){let e=N.useContext(pn);return _r(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ar=N.createContext(void 0);Ar.displayName=`FrameworkContext`;function jr(){let e=N.useContext(Ar);return _r(e,`You must render this element inside a <HydratedRouter> element`),e}function Mr(e,t){let n=N.useContext(Ar),[r,i]=N.useState(!1),[a,o]=N.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=N.useRef(null);N.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),N.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Nr(s,p),onBlur:Nr(c,m),onMouseEnter:Nr(l,p),onMouseLeave:Nr(u,m),onTouchStart:Nr(d,p)}]:[a,f,{}]:[!1,f,{}]}function Nr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Pr({page:e,...t}){let n=hn(),{nonce:r}=jr(),{router:i}=Or(),a=N.useMemo(()=>St(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?N.createElement(Ir,{page:e,matches:a,...t}):N.createElement(Lr,{page:e,matches:a,...t})):null}function Fr(e){let{manifest:t,routeModules:n}=jr(),[r,i]=N.useState([]);return N.useEffect(()=>{let r=!1;return Sr(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ir({page:e,matches:t,...n}){let r=W(),{future:i}=jr(),{basename:a}=Or(),o=N.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=vr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return N.createElement(N.Fragment,null,o.map(e=>N.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Lr({page:e,matches:t,...n}){let r=W(),{future:i,manifest:a,routeModules:o}=jr(),{basename:s}=Or(),{loaderData:c,matches:l}=kr(),u=N.useMemo(()=>Cr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=N.useMemo(()=>Cr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=N.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=vr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=N.useMemo(()=>wr(d,a),[d,a]),m=Fr(d);return N.createElement(N.Fragment,null,f.map(e=>N.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>N.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>N.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Rr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}N.Component;var zr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{zr&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Br({basename:e,children:t,useTransitions:n,window:r}){let i=N.useRef();i.current??=ht({window:r,v5Compat:!0});let a=i.current,[o,s]=N.useState({action:a.action,location:a.location}),c=N.useCallback(e=>{n===!1?s(e):N.startTransition(()=>s(e))},[n]);return N.useLayoutEffect(()=>a.listen(c),[a,c]),N.createElement($n,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Vr=N.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=N.useContext(V),v=typeof l==`string`&&ut.test(l),y=nn(l,h);l=y.to;let b=En(l,{relative:r}),ee=W(),x=null;if(o){let e=qt(o,[],ee.mask?ee.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:R([h,e.pathname])),x=g.createHref(e)}let[te,ne,re]=Mr(n,p),ie=Kr(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function S(t){e&&e(t),t.defaultPrevented||ie(t)}let C=!(y.isExternal||i),ae=N.createElement(`a`,{...p,...re,href:(C?x:void 0)||y.absoluteURL||b,onClick:C?S:e,ref:Rr(m,ne),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return te&&!v?N.createElement(N.Fragment,null,ae,N.createElement(Pr,{page:b})):ae});Vr.displayName=`Link`;var Hr=N.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=jn(a,{relative:c.relative}),d=W(),f=N.useContext(pn),{navigator:p,basename:m}=N.useContext(V),h=f!=null&&Qr(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=L(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,ee=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),x={isActive:b,isPending:ee,isTransitioning:h},te=b?e:void 0,ne;ne=typeof n==`function`?n(x):[n,b?`active`:null,ee?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let re=typeof i==`function`?i(x):i;return N.createElement(Vr,{...c,"aria-current":te,className:ne,ref:l,style:re,to:a,viewTransition:o},typeof s==`function`?s(x):s)});Hr.displayName=`NavLink`;var Ur=N.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=nr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=N.useContext(V),g=Xr(),_=Zr(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&ut.test(s);return N.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?N.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Ur.displayName=`Form`;function Wr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gr(e){let t=N.useContext(B);return P(t,Wr(e)),t}function Kr(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=G(),d=W(),f=jn(e,{relative:o});return N.useCallback(p=>{if(lr(p,t)){p.preventDefault();let t=n===void 0?I(d)===I(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?N.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function qr(e){F(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=N.useRef(ur(e)),n=N.useRef(!1),r=W(),i=N.useMemo(()=>dr(r.search,n.current?null:t.current),[r.search]),a=G();return[i,N.useCallback((e,t)=>{let r=ur(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Jr=0,Yr=()=>`__${String(++Jr)}__`;function Xr(){let{router:e}=Gr(`useSubmit`),{basename:t}=N.useContext(V),n=Kn(),r=e.fetch,i=e.navigate;return N.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=gr(e,t);if(a.navigate===!1){let e=a.fetcherKey||Yr();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Zr(e,{relative:t}={}){let{basename:n}=N.useContext(V),r=N.useContext(H);P(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...jn(e||`.`,{relative:t})},o=W();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:R([n,a.pathname])),I(a)}function Qr(e,{relative:t}={}){let n=N.useContext(gn);P(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Gr(`useViewTransitionState`),i=jn(e,{relative:t});if(!n.isTransitioning)return!1;let a=L(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=L(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Rt(i.pathname,o)!=null||Rt(i.pathname,a)!=null}var $r=t(o(),1),ei=a(),ti=`cartethyia.customization`,q=`media`,ni=`background`,ri=1,ii=`/console-backgrounds.jpg`;function ai(){let{promise:e,resolve:t,reject:n}=Promise.withResolvers(),r=indexedDB.open(ti,ri);return r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(q)||e.createObjectStore(q)},r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error??Error(`Could not open the media database.`)),e}function oi(e){let{promise:t,resolve:n,reject:r}=Promise.withResolvers();return e.onsuccess=()=>n(e.result),e.onerror=()=>r(e.error??Error(`The media database rejected the request.`)),t}function si(e,t){let{promise:n,resolve:r,reject:i}=Promise.withResolvers();return e.oncomplete=()=>r(),e.onerror=()=>i(e.error??Error(t)),n}async function ci(){let e=await ai();try{let t=await oi(e.transaction(q,`readonly`).objectStore(q).get(ni));if(!t||!t.blob)return null;let n=t;return{blob:n.blob,kind:n.kind,url:URL.createObjectURL(n.blob)}}finally{e.close()}}async function li(e,t){let n=await ai();try{let r=n.transaction(q,`readwrite`);r.objectStore(q).put({blob:e,kind:t},ni),await si(r,`Could not store the background.`)}finally{n.close()}}async function ui(){let e=await ai();try{let t=e.transaction(q,`readwrite`);t.objectStore(q).delete(ni),await si(t,`Could not remove the background.`)}finally{e.close()}}var di=2560,fi=.85;async function pi(e){let t=await createImageBitmap(e).catch(()=>null);if(!t)return e;try{let n=Math.max(t.width,t.height),r=Math.min(1,di/n),i=document.createElement(`canvas`);i.width=Math.max(1,Math.round(t.width*r)),i.height=Math.max(1,Math.round(t.height*r));let a=i.getContext(`2d`);return a?(a.drawImage(t,0,0,i.width,i.height),await gi(i)??e):e}finally{t.close()}}var mi=4294967296,hi=268435456;function gi(e){let{promise:t,resolve:n}=Promise.withResolvers();return e.toBlob(e=>n(e),`image/webp`,fi),t}function _i(e){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:null}var vi=[`none`,`frosted`,`vibrancy`,`heavy`],J={backgroundSet:!1,backgroundEnabled:!0,backgroundRevision:0,backgroundOpacity:20,backgroundScale:100,backgroundX:0,backgroundY:0,backgroundBlur:5,blurCards:`frosted`,blurChrome:`frosted`,blurCardsAmount:45,blurCardsDepth:20,blurChromeAmount:25,blurChromeDepth:10,blurCardsEnabled:!0,blurChromeEnabled:!0,emptyOutline:!1},yi=`cartethyia.customization`,bi=`cartethyia-customization-change`,xi=[`cards`,`chrome`];function Si(e){return typeof e==`string`&&vi.includes(e)}function Y(e,t,n,r){let i=typeof e==`number`?e:Number(e);return Number.isFinite(i)?Math.min(n,Math.max(t,i)):r}function Ci(e){let t=typeof e==`object`&&e&&!Array.isArray(e)?e:{};return{backgroundSet:t.backgroundSet===!0,backgroundRevision:Y(t.backgroundRevision,0,2**53-1,0),backgroundEnabled:typeof t.backgroundEnabled==`boolean`?t.backgroundEnabled:J.backgroundEnabled,backgroundOpacity:Y(t.backgroundOpacity,0,100,J.backgroundOpacity),backgroundScale:Y(t.backgroundScale,100,180,J.backgroundScale),backgroundX:Y(t.backgroundX,-100,100,J.backgroundX),backgroundY:Y(t.backgroundY,-100,100,J.backgroundY),backgroundBlur:Y(t.backgroundBlur,0,100,J.backgroundBlur),blurCards:Si(t.blurCards)?t.blurCards:J.blurCards,blurChrome:Si(t.blurChrome)?t.blurChrome:J.blurChrome,blurCardsAmount:Y(t.blurCardsAmount,0,100,J.blurCardsAmount),blurChromeAmount:Y(t.blurChromeAmount,0,100,J.blurChromeAmount),blurCardsDepth:Y(t.blurCardsDepth,0,100,J.blurCardsDepth),blurChromeDepth:Y(t.blurChromeDepth,0,100,J.blurChromeDepth),blurCardsEnabled:t.blurCardsEnabled!==!1,blurChromeEnabled:t.blurChromeEnabled!==!1,emptyOutline:t.emptyOutline===!0}}var wi=null;function Ti(){if(wi)return wi;if(typeof window>`u`)return J;try{wi=Ci(JSON.parse(window.localStorage.getItem(yi)??`null`))}catch{wi={...J}}return wi}function Ei(e){if(typeof document>`u`)return;let t=document.documentElement;t.dataset.blurCards=e.blurCards,t.dataset.blurChrome=e.blurChrome,t.style.setProperty(`--blur-cards`,`${e.blurCardsAmount}`),t.style.setProperty(`--blur-chrome`,`${e.blurChromeAmount}`),t.style.setProperty(`--blur-cards-depth`,`${e.blurCardsDepth}`),t.style.setProperty(`--blur-chrome-depth`,`${e.blurChromeDepth}`),t.dataset.blurCardsOn=e.blurCardsEnabled?`true`:`false`,t.dataset.blurChromeOn=e.blurChromeEnabled?`true`:`false`,t.dataset.emptyOutline=e.emptyOutline?`true`:`false`,t.dataset.bgActive=e.backgroundEnabled?`true`:`false`,t.style.setProperty(`--bg-opacity`,(e.backgroundOpacity/100).toFixed(2)),t.style.setProperty(`--bg-scale`,(e.backgroundScale/100).toFixed(2)),t.style.setProperty(`--bg-x`,`${e.backgroundX}%`),t.style.setProperty(`--bg-y`,`${e.backgroundY}%`),t.style.setProperty(`--bg-blur`,`${Math.round(e.backgroundBlur*.4)}px`)}function Di(e){try{window.localStorage.setItem(yi,JSON.stringify(e))}catch{}}function Oi(e){let t=Ci({...Ti(),...e});return wi=t,typeof window<`u`&&(Di(t),Ei(t),window.dispatchEvent(new CustomEvent(bi))),t}function ki(){let[e,t]=(0,N.useState)(Ti);return(0,N.useEffect)(()=>{let e=()=>t(Ti());return window.addEventListener(bi,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(bi,e),window.removeEventListener(`storage`,e)}},[]),[e,e=>t(Oi(e))]}var Ai=xi,X=r(),ji=`(max-width: 767px)`,Mi=`(prefers-reduced-motion: reduce)`;function Ni(e){let[t,n]=(0,N.useState)(()=>typeof window<`u`&&window.matchMedia(e).matches);return(0,N.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function Pi(){let[e,t]=(0,N.useState)(()=>typeof document>`u`||!document.hidden);return(0,N.useEffect)(()=>{let e=()=>t(!document.hidden);return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e}function Fi(){let[e]=ki(),[t,n]=(0,N.useState)(null),r=Ni(ji),i=Ni(Mi),a=Pi();(0,N.useEffect)(()=>{if(!e.backgroundSet){n(e=>(e&&URL.revokeObjectURL(e.url),{blob:new Blob,kind:`image`,url:ii}));return}let t=!1,r=null;return ci().then(e=>{if(t){e&&URL.revokeObjectURL(e.url);return}r=e,n(e)}).catch(()=>{t||n(null)}),()=>{t=!0,r&&URL.revokeObjectURL(r.url)}},[e.backgroundSet,e.backgroundRevision]);let o=(0,N.useRef)(null),s=t?.kind===`video`&&!r&&!i&&a;return(0,N.useEffect)(()=>{let e=o.current;if(e){if(s){e.play().catch(()=>{});return}e.pause()}},[s]),!t||!e.backgroundEnabled?null:(0,X.jsx)(`div`,{className:`custom-background`,"data-kind":t.kind,"data-playing":s?`true`:`false`,"aria-hidden":`true`,children:t.kind===`video`?(0,X.jsx)(`video`,{ref:o,className:`custom-background-media`,src:t.url,autoPlay:s,loop:!0,muted:!0,playsInline:!0,preload:r?`metadata`:`auto`}):(0,X.jsx)(`img`,{className:`custom-background-media`,src:t.url,alt:``})})}function Ii({open:e,onClose:t,onConfirm:n,title:r,message:i,confirmLabel:a=`Confirm`,cancelLabel:o=`Cancel`,danger:s}){let[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(!1);return(0,N.useEffect)(()=>{e&&(l(null),d(!1))},[e]),(0,X.jsx)(ie,{open:e,onClose:t,title:r,description:i,children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-8 py-2 px-0`,children:[(0,X.jsx)(`p`,{className:`text-body text-text-secondary leading-normal`,children:i}),c?(0,X.jsx)(`p`,{role:`alert`,className:`text-caption text-red`,children:c}):null,(0,X.jsxs)(Ie,{children:[(0,X.jsx)(b,{variant:`secondary`,size:`sm`,onClick:t,disabled:u,children:o}),(0,X.jsx)(b,{variant:s?`danger`:`primary`,size:`sm`,onClick:()=>{u||(l(null),d(!0),Promise.resolve().then(()=>n()).then(()=>t()).catch(e=>{l(O(e,`Action failed. Please try again.`)),d(!1)}))},disabled:u,children:u?`Working…`:a})]})]})})}var Li=`cartethyia.query-cache`,Z=`client`,Ri=`default`,zi=1;function Bi(){let{promise:e,resolve:t,reject:n}=Promise.withResolvers(),r=indexedDB.open(Li,zi);return r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(Z)||e.createObjectStore(Z)},r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error??Error(`Could not open the query cache.`)),e}function Vi(e){let{promise:t,resolve:n,reject:r}=Promise.withResolvers();return e.onsuccess=()=>n(e.result),e.onerror=()=>r(e.error??Error(`The query cache rejected the request.`)),t}function Hi(e,t){let{promise:n,resolve:r,reject:i}=Promise.withResolvers();return e.oncomplete=()=>r(),e.onerror=()=>i(e.error??Error(t)),n}function Ui(e){if(typeof e!=`object`||!e||!(`version`in e)||!(`state`in e))return!1;let{version:t,state:n}=e;return t===1&&typeof n==`object`&&!!n}async function Wi(e){try{let t=await Bi();try{let n=t.transaction(Z,`readwrite`);n.objectStore(Z).put({version:1,state:e},Ri),await Hi(n,`Could not store the query cache.`)}finally{t.close()}}catch{}}async function Gi(){try{let e=await Bi();try{let t=await Vi(e.transaction(Z,`readonly`).objectStore(Z).get(Ri));return Ui(t)?t.state:void 0}finally{e.close()}}catch{return}}async function Ki(){try{let e=await Bi();try{let t=e.transaction(Z,`readwrite`);t.objectStore(Z).delete(Ri),await Hi(t,`Could not remove the query cache.`)}finally{e.close()}}catch{}}var Q=new lt({defaultOptions:{queries:D,mutations:Me}});function qi(e){let[t,n,r]=e.queryKey;return t===`console`?n===`session`?!0:n===`providers`?r===void 0||e.queryKey[3]===`models`:n===`settings`?r===`runtime`:n===`cli-tools`&&r===`registry`:!1}async function Ji(){let e=await Gi();e!==void 0&&at(Q,e)}function Yi(){Ki()}function Xi(){let e,t=Q.getQueryCache().subscribe(t=>{t.type===`updated`&&(t.action.type===`success`||t.action.type===`error`)&&e===void 0&&(e=setTimeout(()=>{e=void 0,Wi(it(Q,{shouldDehydrateQuery:qi}))},2e3))});return()=>{e!==void 0&&clearTimeout(e),t()}}function Zi(e){let[t,n]=(e.trim().replace(/^v/i,``).split(`+`,1)[0]??``).split(`-`,2);if(t===void 0||!/^\d+\.\d+\.\d+$/.test(t))return null;let r=t.split(`.`).map(Number);if(r.length!==3||r.some(e=>!Number.isSafeInteger(e)||e<0))return null;let i=n===void 0||n.length===0?[]:n.split(`.`).map(e=>/^\d+$/.test(e)?Number(e):e);return i.some(e=>typeof e==`number`&&(!Number.isSafeInteger(e)||e<0))?null:{core:[r[0]??0,r[1]??0,r[2]??0],prerelease:i}}function Qi(e,t){if(e===void 0||t===void 0)return!1;let n=Zi(e),r=Zi(t);return n===null||r===null?t.trim()!==e.trim():$i(r,n)>0}function $i(e,t){for(let n=0;n<e.core.length;n+=1){let r=e.core[n]??0,i=t.core[n]??0;if(r!==i)return r>i?1:-1}if(e.prerelease.length===0&&t.prerelease.length>0)return 1;if(e.prerelease.length>0&&t.prerelease.length===0)return-1;for(let n=0;n<Math.max(e.prerelease.length,t.prerelease.length);n+=1){let r=e.prerelease[n],i=t.prerelease[n];if(r===void 0)return-1;if(i===void 0)return 1;if(r!==i)return typeof r==`number`&&typeof i==`string`?-1:typeof r==`string`&&typeof i==`number`||r>i?1:-1}return 0}var ea=5e3,ta=new WeakMap,na={"/":[{queryKey:A.settings.runtime,read:e=>k(`/settings/runtime`,{signal:e})},{queryKey:A.apiKeys.all,read:e=>k(`/api-keys`,{signal:e}).then(_e)}],"/providers":[{queryKey:A.providers.all,read:e=>k(`/providers`,{signal:e}).then(se)}],"/proxy":[{queryKey:A.network.pools,read:e=>k(`/network/pools`,{signal:e}).then(oe)}]};function ra(e,t){let n=na[t];if(n===void 0)return Promise.resolve();let r=Date.now(),i=ta.get(e);if(i!==void 0){if(i>r)return Promise.resolve();ta.delete(e)}return Promise.allSettled(n.map(t=>e.fetchQuery({queryKey:t.queryKey,queryFn:e=>t.read(w(e)),...D}))).then(t=>{if(t.some(e=>e.status===`rejected`&&!ke(e.reason))){ta.set(e,Date.now()+ea);return}ta.delete(e)})}var ia=3e3,aa=20;function oa(e){if(typeof e!=`object`||!e)return;let t=e;if(!(typeof t.id!=`string`||typeof t.title!=`string`||typeof t.message!=`string`||typeof t.createdAt!=`string`||t.kind!==`memory-high`&&t.kind!==`memory-growth`&&t.kind!==`update-available`||t.level!==`warning`&&t.level!==`info`))return{id:t.id,kind:t.kind,title:t.title,message:t.message,createdAt:t.createdAt,level:t.level,...t.href===`https://github.com/risunCodex/Cartethyia/releases`?{href:t.href}:{}}}function sa(){let[e,t]=(0,N.useState)([]);return(0,N.useEffect)(()=>{let e=!0,n,r,i=()=>{e&&(n=new EventSource(`/console/api/notifications/stream`),n.addEventListener(`notification`,n=>{let r;try{r=JSON.parse(n.data)}catch{return}let i=oa(r);i&&e&&t(e=>[i,...e.filter(e=>e.id!==i.id)].slice(0,aa))}),n.onerror=()=>{n?.close(),n=void 0,e&&r===void 0&&(r=setTimeout(()=>{r=void 0,i()},ia))})};return i(),()=>{e=!1,n?.close(),clearTimeout(r)}},[]),e}function ca(){return S({queryKey:A.session.current,queryFn:()=>Ee(),staleTime:6e4,gcTime:3e5,retry:!1,refetchOnWindowFocus:!1})}function la(){return S({queryKey:A.system.health,queryFn:e=>k(`/system/health`,{signal:w(e)}).then(ce),...D,refetchInterval:E.status})}function ua(){return S({queryKey:A.releases.githubLatest,queryFn:e=>k(`/updates/release`,{signal:w(e)}).then(he),...D,staleTime:18e5,refetchInterval:18e5,retry:!1})}function da(e){return S({queryKey:A.usageAnalytics.summary(e),queryFn:t=>k(`/system/usage/summary?period=${encodeURIComponent(e)}`,{signal:w(t)}).then(ae),...D,refetchInterval:E.status})}function fa(e){return S({queryKey:A.usageAnalytics.chart(e),queryFn:t=>k(`/system/usage/chart?period=${encodeURIComponent(e)}`,{signal:w(t)}).then(fe),...D,refetchInterval:E.status})}function pa(e,t){return S({queryKey:A.usageAnalytics.by(e,t),queryFn:n=>k(`/system/usage/by-${t}?period=${encodeURIComponent(e)}`,{signal:w(n)}).then(me),...D,refetchInterval:E.status})}function ma(e,t=50,n){let r=n==null?``:`&httpStatus=${encodeURIComponent(String(n))}`;return S({queryKey:A.usageAnalytics.requests(e,t,n),queryFn:n=>k(`/system/usage/requests?period=${encodeURIComponent(e)}&limit=${encodeURIComponent(String(t))}${r}`,{signal:w(n)}).then(le),...D,placeholderData:e=>e,refetchInterval:E.live})}function ha(e){return S({queryKey:A.usageAnalytics.requestDetail(e??`_`),queryFn:t=>{if(!e)throw{status:400,code:`invalid_request`,message:`Request is required`};return k(`/system/usage/requests/${encodeURIComponent(e)}`,{signal:w(t)}).then(ue)},enabled:e!==null,...D})}function ga(e){return S({queryKey:A.audit.list(e??{}),queryFn:t=>{let n=new URLSearchParams;e?.action&&n.set(`action`,e.action),e?.actor&&n.set(`actor`,e.actor),e?.cursor&&n.set(`cursor`,e.cursor),e?.limit&&n.set(`limit`,String(e.limit));let r=n.toString()?`?${n.toString()}`:``;return k(`/audit${r}`,{signal:w(t)}).then(pe)},...D})}function _a(){return S({queryKey:A.providers.all,queryFn:e=>k(`/providers`,{signal:w(e)}).then(se),...D,gcTime:6e5,refetchInterval:E.catalog})}function va(e){return S({queryKey:A.providers.detail(e??``),queryFn:t=>k(`/providers/${encodeURIComponent(e??``)}`,{signal:w(t)}).then(de),enabled:!!e,...D})}function ya(e){return S({queryKey:A.providers.models(e),queryFn:t=>{if(!e)throw{status:400,code:`invalid_request`,message:`Provider is required`};return k(`/providers/${encodeURIComponent(e)}/models`,{signal:w(t)}).then(ge)},...D,staleTime:3e5,gcTime:6e5,enabled:!!e})}function ba(){let e=C();return M({mutationFn:({providerId:e,modelIds:t,wireFamily:n,metadata:r})=>k(`/providers/${encodeURIComponent(e)}/models`,{method:`POST`,body:JSON.stringify({modelIds:t,...n?{wireFamily:n}:{},...r?{metadata:r}:{}})}),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:A.providers.models(n.providerId)}),x.success(`Models registered`,`${n.modelIds.length} model(s) added to ${n.providerId}`)},onError:e=>{x.error(`Failed to register models`,O(e))}})}function xa(){let e=C();return M({mutationFn:({providerId:e,request:t})=>k(`/providers/${encodeURIComponent(e)}/models/probe`,{method:`POST`,body:JSON.stringify(t)}),onSettled:async(t,n,r)=>{await Na(e,r.providerId)}})}function Sa(){return M({mutationFn:e=>k(`/providers/connection-test`,{method:`POST`,body:JSON.stringify(e)})})}function Ca(){let e=C();return M({mutationFn:({providerId:e,request:t})=>k(`/providers/${encodeURIComponent(e)}/accounts/probe`,{method:`POST`,body:JSON.stringify(t)}),onSettled:async(t,n,r)=>{await Na(e,r.providerId)}})}function wa(){let e=C();return M({mutationFn:({providerId:e,request:t})=>k(`/providers/${encodeURIComponent(e)}/models`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:A.providers.models(n.providerId)})}})}function Ta(){let e=C();return M({mutationFn:({providerId:e,modelId:t,route:n,metadata:r})=>k(`/providers/${encodeURIComponent(e)}/models`,{method:`PATCH`,body:JSON.stringify({modelId:t,route:n,enabled:!0,metadata:r})}),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:A.providers.models(n.providerId)}),x.success(`Model updated`,`${n.modelId} limits and capabilities saved`)},onError:e=>{x.error(`Failed to update model`,O(e))}})}function Ea(){let e=C();return M({mutationFn:({providerId:e,request:t})=>k(`/providers/${encodeURIComponent(e)}/models`,{method:`DELETE`,body:JSON.stringify(t)}),onSuccess:async(t,n)=>{await e.invalidateQueries({queryKey:A.providers.models(n.providerId)})}})}function Da(e){return S({queryKey:A.providers.accounts(e),queryFn:t=>k(`/providers/${encodeURIComponent(e??``)}/accounts`,{signal:w(t)}),enabled:!!e,...D,staleTime:3e4,gcTime:6e5})}function Oa(){let e=C();return M({mutationFn:({providerId:e,request:t})=>k(`/providers/${encodeURIComponent(e)}/accounts`,{method:`POST`,body:JSON.stringify(t)}),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.accounts(n.providerId)}),e.invalidateQueries({queryKey:A.providers.all})])}})}function ka(){let e=C();return M({mutationFn:({providerId:e,accounts:t})=>k(`/providers/${encodeURIComponent(e)}/accounts/batch`,{method:`POST`,body:JSON.stringify({accounts:t})}),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.accounts(n.providerId)}),e.invalidateQueries({queryKey:A.providers.all})])}})}function Aa(){let e=C();return M({mutationFn:({providerId:e,accountId:t,request:n})=>k(`/providers/${encodeURIComponent(e)}/accounts/${encodeURIComponent(t)}`,{method:`PATCH`,body:JSON.stringify(n)}),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.accounts(n.providerId)}),e.invalidateQueries({queryKey:A.providers.all})])}})}function ja(e,t){return S({queryKey:A.providers.healthEvents(e,t),queryFn:n=>k(`/providers/${encodeURIComponent(e??``)}/accounts/${encodeURIComponent(t??``)}/health-events`,{signal:w(n)}),enabled:!!e&&!!t,...D,refetchInterval:E.status})}async function Ma(e,t){await e.invalidateQueries({predicate:e=>{let n=e.queryKey;return n[0]===`console`&&n[1]===`providers`&&n[2]===t&&n[3]===`accounts`&&n[5]===`health-events`}})}async function Na(e,t){await Promise.all([e.invalidateQueries({queryKey:A.providers.accounts(t)}),Ma(e,t),e.invalidateQueries({queryKey:A.providers.all})])}function Pa(){let e=C();return M({mutationFn:({providerId:e,accountId:t})=>k(`/providers/${encodeURIComponent(e)}/accounts/${encodeURIComponent(t)}/recover`,{method:`POST`,body:`{}`}),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.accounts(n.providerId)}),e.invalidateQueries({queryKey:A.providers.healthEvents(n.providerId,n.accountId)}),e.invalidateQueries({queryKey:A.providers.all})]),x.success(`Account recovered`)},onError:e=>{x.error(`Could not recover the account.`,O(e))}})}function Fa(){return M({mutationFn:({providerId:e,accountIds:t})=>k(`/providers/${encodeURIComponent(e)}/accounts/export`,{method:`POST`,body:JSON.stringify({accountIds:t})})})}function Ia(){return M({mutationFn:({providerId:e,accountLabel:t,parameters:n})=>k(`/providers/${encodeURIComponent(e)}/oauth/authorize`,{method:`POST`,body:JSON.stringify({...t?{accountLabel:t}:{},...n&&Object.keys(n).length>0?{parameters:n}:{}})})})}function La(){let e=C();return M({mutationFn:({providerId:e,code:t,state:n})=>k(`/providers/${encodeURIComponent(e)}/oauth/callback?${new URLSearchParams({code:t,state:n}).toString()}`),onSuccess:async(t,n)=>{await Na(e,n.providerId)}})}function Ra(){return M({mutationFn:({providerId:e,accountLabel:t,parameters:n})=>k(`/providers/${encodeURIComponent(e)}/oauth/device/start`,{method:`POST`,body:JSON.stringify({...t?{accountLabel:t}:{},...n&&Object.keys(n).length>0?{parameters:n}:{}})})})}function za(){let e=C();return M({mutationFn:({providerId:e,credential:t,fields:n,accountLabel:r})=>k(`/providers/${encodeURIComponent(e)}/oauth/import`,{method:`POST`,body:JSON.stringify({credential:t,...n&&Object.keys(n).length>0?{fields:n}:{},...r?{accountLabel:r}:{}})}),onSuccess:async(t,n)=>{await Na(e,n.providerId),await e.invalidateQueries({queryKey:A.quota.all})}})}function Ba(){let e=C();return M({mutationFn:({providerId:e,deviceAuthId:t})=>k(`/providers/${encodeURIComponent(e)}/oauth/device/poll`,{method:`POST`,body:JSON.stringify({deviceAuthId:t})}),onSuccess:async(t,n)=>{t.status===`complete`&&await Promise.all([e.invalidateQueries({queryKey:A.providers.accounts(n.providerId)}),e.invalidateQueries({queryKey:A.providers.healthEvents(n.providerId,t.accountId)}),e.invalidateQueries({queryKey:A.quota.all}),Na(e,n.providerId)])}})}function Va(){let e=C();return M({mutationFn:e=>k(`/providers`,{method:`POST`,body:JSON.stringify(e)}),onSuccess:async t=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.all}),e.invalidateQueries({queryKey:A.modelRouting.all})]),x.success(`Provider created`,t.label??t.providerId)},onError:e=>{x.error(`Failed to create provider`,O(e))}})}function Ha(){let e=C();return M({mutationFn:({providerId:e,request:t})=>k(`/providers/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),onSuccess:async(t,{providerId:n})=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.all}),e.invalidateQueries({queryKey:A.providers.detail(n)})]),x.success(`Provider updated`,n)},onError:e=>{x.error(`Failed to update provider`,O(e))}})}function Ua(){let e=C();return M({mutationFn:({providerId:e,enabled:t})=>k(`/providers/platform/global/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}),onSuccess:async(t,{providerId:n})=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.all}),e.invalidateQueries({queryKey:A.providers.detail(n)})])}})}function Wa(e={}){let t=C();return M({mutationFn:e=>k(`/providers/${encodeURIComponent(e)}/models/sync`,{method:`POST`,body:`{}`}),onSuccess:async(n,r)=>{await t.invalidateQueries({queryKey:A.providers.models(r)}),e.silent||x.success(`Models fetched`,n.synced>0?`${n.synced} new model${n.synced===1?``:`s`} added`:`No new models found`)},onError:t=>{e.silent||x.error(`Failed to fetch models`,O(t))}})}function Ga(){let e=C();return M({mutationFn:e=>k(`/providers/${encodeURIComponent(e)}`,{method:`DELETE`}),onSuccess:async(t,n)=>{await Promise.all([e.invalidateQueries({queryKey:A.providers.all}),e.invalidateQueries({queryKey:A.quota.all}),e.invalidateQueries({queryKey:A.modelRouting.all})]),x.success(`Provider deleted`,n)},onError:e=>{x.error(`Failed to delete provider`,O(e))}})}var Ka={name:`cartethyia`,version:`2.5.0`,description:`A powerful, self-hosted reverse proxy for OpenAI- and Anthropic-compatible AI clients, powered by native Bun and Elysia. It serves both protocols from a single server, routes every model across any configured provider, and translates requests and responses in real time — streaming and prompt caching included. Underneath it runs a full delivery engine: per-account health tracking, quota and cooldown enforcement, automatic failover across pools and providers, usage accounting, and telemetry. Point OpenCode, Cline, Claude Code, Codex, or any compatible client at Cartethyia and it keeps its native protocol while the gateway absorbs every provider-specific difference behind it. Runs on embedded SQLite or external PostgreSQL with optional Redis coordination, ships as a global CLI with a system-tray console, and needs only Bun 1.4+ alongside Node.js/npm.`,license:`GPL-3.0-only`,type:`module`,packageManager:`bun@1.4.0`,repository:{type:`git`,url:`git+https://github.com/risunCodex/Cartethyia.git`},homepage:`https://github.com/risunCodex/Cartethyia#readme`,bugs:{url:`https://github.com/risunCodex/Cartethyia/issues`},keywords:[`ai`,`gateway`,`llm`,`bun`,`self-hosted`],bin:{cartethyia:`scripts/cli/bin/cartethyia.cjs`,carte:`scripts/cli/bin/carte.cjs`},files:[`scripts/cli/`,`src/`,`migrations/`,`dist/dashboard/`,`.env.example`,`README.md`],workspaces:[`dashboard`],engines:{bun:`>=1.4.0`},scripts:{dev:`bun run dev:stack`,"dev:watch":`bun run scripts/dev/supervisor.ts`,test:`bun run scripts/ci/run.ts`,build:`bun run scripts/binary/build.ts`,prepack:`bun run dashboard:build`,setup:`bun run scripts/cli/command/setup.ts`,start:`bun run scripts/cli/main.ts start`,doctor:`bun run scripts/cli/command/doctor.ts`,"probe:egress":`bun run scripts/operations/probe-egress.ts`,restart:`bun run scripts/binary/restart.ts`,"build:aot":`bun run scripts/binary/aot.ts`,"dev:stack":`concurrently -n BACKEND,DASHBOARD -c cyan,magenta --kill-others-on-fail "bun run dev:backend" "bun run dashboard:dev"`,typecheck:`tsc --noEmit`,"test:watch":`bun run scripts/ci/run.ts --watch`,"test-db:up":`docker compose -f docker-compose.test.yml up -d --wait postgres-test`,"dev:backend":`bun run --hot src/main.ts`,"dev:console-auth":`bun run scripts/qa/console-session.ts`,"dev:visual-baseline":`bun run scripts/qa/visual-baseline.ts`,"build:binary":`bun run scripts/binary/compile.ts`,"test:backend":`bun run scripts/ci/run.ts --scope backend`,"test-db:down":`docker compose -f docker-compose.test.yml down`,"dashboard:dev":`bun run --cwd dashboard dev`,"test-db:check":`bun run scripts/ci/db-check.ts`,"dashboard:test":`bun run scripts/ci/run.ts --scope dashboard`,"test-db:reset":`docker compose -f docker-compose.test.yml down -v && docker compose -f docker-compose.test.yml up -d --wait postgres-test`,"dashboard:build":`bun run --cwd dashboard build`,"dashboard:typecheck":`bun run --cwd dashboard typecheck`,"check:migrations":`bun run scripts/ci/check-migrations.ts`},dependencies:{"drizzle-orm":`0.45.2`,elysia:`^2.0.0-beta.16`,enquirer:`^2.4.1`,ioredis:`6.0.0`,jose:`^6.2.12`,jsonrepair:`^3.15.0`,pg:`8.23.0`,pino:`^10.3.1`,"pino-pretty":`^13.1.3`,protobufjs:`^7.6.5`,"socks-proxy-agent":`^10.1.0`,systray2:`2.1.4`,typebox:`1.3.27`,ws:`8.22.0`},devDependencies:{"@types/pg":`8.11.10`,"@types/ws":`8.18.1`,"bun-types":`1.4.0`,concurrently:`^10.0.5`,"drizzle-kit":`^0.31.11`,typescript:`5.9.2`}}.version,qa=`v${Ka.replace(/\.0$/,``)} (Jinhsi)`,Ja=[{label:`Main`,items:[{label:`Overview`,path:`/`,icon:Be},{label:`Usage`,path:`/usage`,icon:u},{label:`Providers`,path:`/providers`,icon:Je},{label:`Model Lab`,path:`/model-lab`,icon:ne}]},{label:`Control`,items:[{label:`Combos & Routes`,path:`/combos`,icon:ze},{label:`Quota Management`,path:`/quota`,icon:Xe},{label:`Proxy & Requests`,path:`/proxy`,icon:l},{label:`CLI Tools`,path:`/cli-tools`,icon:d}]},{label:`Tools`,items:[{label:`Coming soon`,path:`#tools-coming-soon-1`,icon:f,disabled:!0},{label:`Coming soon`,path:`#tools-coming-soon-2`,icon:f,children:Array.from({length:5},(e,t)=>({label:`Coming soon ${t+1}`,path:`#tools-coming-soon-${t+3}`,icon:f,disabled:!0}))}]},{label:`System`,items:[{label:`Customization`,path:`/customization`,icon:Ge},{label:`Console Log`,path:`/console-log`,icon:qe},{label:`Settings`,path:`/settings`,icon:Ye}]}],Ya={"/":{title:`Overview`,sub:`Gateway health, capacity, and live metrics`,icon:Be},"/usage":{title:`Usage & Metrics`,sub:`Token economics, requests, and cost breakdown`,icon:u},"/providers":{title:`Provider Catalog`,sub:`Upstream credentials, models, and latency`,icon:Je},"/combos":{title:`Combos & Routing`,sub:`Failover policies, model aliases, and weighted routes`,icon:ze},"/quota":{title:`Quota Management`,sub:`Rate limits, leases, and tenant quotas`,icon:Xe},"/proxy":{title:`Proxy & Requests`,sub:`Network pools, SOCKS5/HTTP egress, and dispatch`,icon:l},"/customization":{title:`Customization`,sub:`Background, transparency, and blur`,icon:Ge},"/model-lab":{title:`Model Lab`,sub:`Chat a routed model without leaving the console`,icon:ne},"/console-log":{title:`Console Log`,sub:`Live server logs and audit trail`,icon:qe},"/cli-tools":{title:`CLI Tools`,sub:`Claude Code CLI, OpenCode, and local developer tool integrations`,icon:d},"/settings":{title:`Settings`,sub:`Account security, runtime preferences, and state recovery`,icon:Ye}},Xa={title:`Console`,sub:`Cartethyia AI Gateway Administration`,icon:Be};function Za(e,t){let n=/^\/providers\/([^/]+)\/?$/.exec(e);if(n?.[1]){let e=t.find(e=>e.providerId===n[1]);return{title:e?.label||e?.displayName||n[1],sub:`Routing, accounts, models, and health`,icon:Je}}let r=/^\/cli-tools\/([^/]+)\/?$/.exec(e);return r?.[1]?{title:`CLI Tool`,sub:`${r[1]} — mappings, endpoints, and downloadable config`,icon:d}:Ya[e]??Xa}function Qa(){try{return la()}catch{return{data:void 0,isError:!1,isFetching:!1,isPending:!1}}}function $a(){let[e,t]=(0,N.useState)(()=>_()),n=p(e);return(0,N.useEffect)(()=>{let e=()=>t(_());return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),(0,N.useEffect)(()=>{ee(e)},[e]),(0,X.jsx)(`button`,{type:`button`,onClick:()=>{let e=n?`light`:`dark`;t(e),te(e)},"aria-label":`Toggle theme`,"aria-pressed":n,className:`topbar-icon-button`,title:n?`Switch to light mode`:`Switch to dark mode`,children:(0,X.jsx)(`span`,{className:`grid place-items-center`,children:n?(0,X.jsx)(v,{size:17}):(0,X.jsx)(g,{size:17})},n?`sun`:`moon`)})}var eo=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}),to=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`,timeZone:`UTC`});function no(e){if(!Number.isFinite(e)||e<0)return`Unavailable`;let t=Math.floor(e);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=n%60,i=Math.floor(n/60),a=i%24,o=Math.floor(i/24);return o>0?`${o}d ${a}h ${r}m`:i>0?`${i}h ${r}m`:`${n}m`}function ro(e){if(!Number.isFinite(e)||e<0)return`Unavailable`;let t=e>=1024**3?{divisor:1024**3,label:`GiB`}:{divisor:1024**2,label:`MiB`};return`${(e/t.divisor).toFixed(1)} ${t.label}`}function io({icon:e,label:t,value:n,detail:r,title:i}){return(0,X.jsxs)(`div`,{className:`min-w-0 rounded-control border border-inner-border bg-surface-2 p-3`,title:i,children:[(0,X.jsxs)(`dt`,{className:`flex items-center gap-2 text-micro font-medium text-text-tertiary`,children:[(0,X.jsx)(e,{size:13,strokeWidth:1.8,className:`shrink-0`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:t})]}),(0,X.jsx)(`dd`,{className:`mt-1 truncate font-mono text-caption font-semibold tabular-nums text-text-primary`,children:n}),r?(0,X.jsx)(`dd`,{className:`mt-1 text-micro text-text-secondary`,children:r}):null]})}function ao({health:e}){let[t,n]=(0,N.useState)(!1),[r,i]=(0,N.useState)(()=>new Date),a=(0,N.useRef)(null),o=(0,N.useRef)(null),s=sa();(0,N.useEffect)(()=>{if(!t)return;i(new Date);let e=window.setInterval(()=>i(new Date),1e3);return()=>window.clearInterval(e)},[t]),(0,N.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.target;o.current&&!o.current.contains(t)&&a.current&&!a.current.contains(t)&&n(!1)},r=e=>{e.key===`Escape`&&n(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,r),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,r)}},[t]);let c=e?e.status===`healthy`?`All systems operational`:e.status===`degraded`?`Gateway degraded`:`Gateway unhealthy`:`System health unavailable`,l=e?e.status===`healthy`?`Postgres & Redis admission connected.`:e.status===`degraded`?`Check connection logs.`:`Gateway is reporting an unhealthy status.`:`Live gateway metrics are not available.`,u=e&&[Number.isFinite(e.memory_percent)?`${e.memory_percent.toFixed(1)}% of system RAM`:void 0,e.database_in_process?`In-process DB included`:void 0].filter(Boolean).join(` · `)||void 0,d=e?Number.isFinite(e.cpu_percent)?Number.isFinite(e.cpu_cores)&&e.cpu_cores>0?`1-min load · ${e.cpu_cores} cores`:`Normalized 1-min load`:`Not reported on this platform`:void 0;return(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsxs)(`button`,{ref:a,type:`button`,className:`topbar-icon-button`,"aria-label":`Notifications`,"aria-expanded":t,"aria-haspopup":`dialog`,onClick:()=>n(e=>!e),children:[(0,X.jsx)(Le,{size:17}),s.length>0?(0,X.jsx)(`span`,{"aria-label":`${s.length} notifications`,className:`absolute right-1.5 top-1.5 size-2 rounded-full bg-accent`}):null]}),t?(0,$r.createPortal)((0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`fixed inset-0 z-floating bg-overlay backdrop-blur-dialog`,onClick:()=>n(!1)}),(0,X.jsxs)(`div`,{ref:o,role:`dialog`,"aria-label":`Notifications`,className:`app-topbar-popover popout-enter glass rounded-sidebar border border-inner-border bg-popover-bg p-5 shadow-popout z-popover`,children:[(0,X.jsxs)(`div`,{className:`mb-3 flex shrink-0 items-center justify-between`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3 font-bold text-body-lg`,children:[(0,X.jsx)(`span`,{className:`w-13 h-13 rounded-pill bg-accent-soft text-accent grid place-items-center`,children:(0,X.jsx)(Le,{size:13})}),(0,X.jsx)(`span`,{children:`Notifications`})]}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Close notifications`,onClick:()=>n(!1),className:`cursor-pointer border-none bg-transparent p-2 text-caption text-text-tertiary`,children:(0,X.jsx)(y,{size:14})})]}),(0,X.jsxs)(`div`,{className:`scroll-region min-h-0 flex-1 flex flex-col gap-3`,children:[s.length>0?(0,X.jsx)(`section`,{"aria-label":`Notifications`,className:`flex flex-col gap-2`,children:s.map(e=>(0,X.jsxs)(`article`,{className:`flex items-start gap-3 rounded-card border p-4 ${e.level===`warning`?`border-orange-soft bg-orange-soft`:`border-accent/25 bg-accent-soft`}`,children:[(0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`span`,{className:`block text-caption font-semibold text-text-primary`,children:e.title}),(0,X.jsx)(`span`,{className:`mt-1 block text-badge text-text-secondary`,children:e.message})]}),e.href?(0,X.jsx)(`a`,{className:`shrink-0 text-badge font-semibold text-accent`,href:e.href,target:`_blank`,rel:`noreferrer`,children:`Release`}):null]},e.id))}):(0,X.jsx)(`div`,{className:`rounded-card border border-inner-border bg-surface-2 p-4 text-badge text-text-secondary`,children:`No active memory or update alerts.`}),(0,X.jsxs)(`div`,{className:`flex items-start gap-3 rounded-card border border-inner-border bg-surface-2 p-4`,children:[(0,X.jsx)(`span`,{className:`mt-0.5 grid w-12 h-12 shrink-0 place-items-center rounded-control bg-surface-1 text-text-secondary`,children:(0,X.jsx)(Je,{size:16,"aria-hidden":`true`})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`font-semibold text-caption`,children:c}),(0,X.jsx)(`p`,{className:`text-badge text-text-secondary mt-1`,children:l})]})]}),(0,X.jsxs)(`dl`,{"aria-label":`Runtime metrics`,className:`grid grid-cols-2 gap-2`,children:[(0,X.jsx)(io,{icon:re,label:`Local time`,value:eo.format(r)}),(0,X.jsx)(io,{icon:f,label:`UTC`,value:to.format(r)}),(0,X.jsx)(io,{icon:Ze,label:`Uptime`,value:e?no(e.uptime_seconds):`Unavailable`,detail:e&&Number.isFinite(e.uptime_seconds)&&e.uptime_seconds>=0?`Gateway process running`:void 0}),(0,X.jsx)(io,{icon:He,label:`Process RSS`,value:e?ro(e.memory_bytes):`Unavailable`,detail:u,title:`Process resident set size; percentage is share of system RAM.`}),(0,X.jsx)(io,{icon:ze,label:`CPU load`,value:e&&Number.isFinite(e.cpu_percent)?`${e.cpu_percent.toFixed(1)}%`:`Unavailable`,detail:d,title:`One-minute load average normalized by the number of CPU cores.`}),(0,X.jsx)(io,{icon:We,label:`Runtime`,value:e?.platform?.trim()||`Unavailable`,detail:e?.platform?.trim()?`Gateway host platform`:void 0,title:e?.platform?.trim()||`Runtime platform unavailable`})]}),(0,X.jsxs)(`div`,{className:`flex items-start gap-3 rounded-card border border-inner-border bg-surface-2 p-4`,children:[(0,X.jsx)(`span`,{className:`mt-0.5 grid w-12 h-12 shrink-0 place-items-center rounded-control bg-surface-1 text-text-secondary`,children:(0,X.jsx)(Ke,{size:16,"aria-hidden":`true`})}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`font-semibold text-caption`,children:qa}),(0,X.jsx)(`p`,{className:`text-badge text-text-secondary mt-1`,children:`High-performance AI Gateway & Protocol Orchestrator.`})]})]})]})]})]}),document.body):null]})}function oo({group:e,pathname:t,onIntent:n}){return(0,X.jsxs)(`div`,{className:`nav-group-section`,children:[(0,X.jsx)(`p`,{className:`nav-group-title`,children:e.label}),(0,X.jsx)(so,{items:e.items,pathname:t,onIntent:n})]})}function so({items:e,pathname:t,onIntent:n}){let r=(0,N.useRef)(null),[i,a]=(0,N.useState)({top:0,height:0,opacity:0}),[o,s]=(0,N.useState)(()=>new Set);return(0,N.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=e.querySelector(`[data-active="true"]`);if(!t){a(e=>({...e,opacity:0}));return}let n=e.getBoundingClientRect(),i=t.getBoundingClientRect();a({top:i.top-n.top,height:i.height,opacity:1})},[t,e]),(0,X.jsxs)(`div`,{ref:r,className:`nav-items-container`,children:[(0,X.jsx)(`div`,{className:`sidebar-active-indicator`,style:{transform:`translateY(${i.top}px)`,height:`${i.height}px`,opacity:i.opacity},"aria-hidden":`true`}),e.map(e=>{if(e.children!==void 0){let t=o.has(e.path??e.label);return(0,X.jsxs)(`div`,{children:[(0,X.jsxs)(`button`,{type:`button`,className:`nav-link-item w-full`,"aria-expanded":t,onClick:()=>s(t=>{let n=new Set(t),r=e.path??e.label;return n.has(r)?n.delete(r):n.add(r),n}),children:[(0,X.jsx)(e.icon,{size:17,className:`nav-link-icon`}),(0,X.jsx)(`span`,{children:e.label}),(0,X.jsx)(Re,{size:14,className:`ml-auto shrink-0 transition-transform ${t?`rotate-180`:``}`,"aria-hidden":`true`})]}),t?(0,X.jsx)(`div`,{className:`ml-6 border-l border-inner-border pl-2`,children:e.children.map(e=>(0,X.jsxs)(`button`,{type:`button`,className:`nav-link-item w-full cursor-not-allowed opacity-55`,disabled:!0,title:`Coming soon`,children:[(0,X.jsx)(e.icon,{size:15,className:`nav-link-icon`}),(0,X.jsx)(`span`,{children:e.label}),(0,X.jsx)(`span`,{className:`nav-link-badge`,children:`Soon`})]},e.path??e.label))}):null]},e.path??e.label)}if(e.disabled)return(0,X.jsxs)(`button`,{type:`button`,className:`nav-link-item w-full cursor-not-allowed opacity-55`,disabled:!0,"aria-label":`${e.label} — unavailable`,title:`Coming soon`,children:[(0,X.jsx)(e.icon,{size:17,className:`nav-link-icon`}),(0,X.jsx)(`span`,{children:e.label}),(0,X.jsx)(`span`,{className:`nav-link-badge`,children:`Soon`})]},e.path??e.label);if(e.path===void 0)return null;let r=e.path,i=r===`/`?t===`/`:t===r||t.startsWith(`${r}/`);return(0,X.jsxs)(Hr,{to:r,end:r===`/`,"data-active":i?`true`:void 0,className:`nav-link-item ${i?`active`:``}`,onMouseEnter:()=>n(r),onFocus:()=>n(r),children:[(0,X.jsx)(e.icon,{size:17,className:`nav-link-icon`}),(0,X.jsx)(`span`,{children:e.label}),e.badge?(0,X.jsx)(`span`,{className:`nav-link-badge`,children:e.badge}):null]},r)})]})}function co({user:e,children:t}){let n=G(),r=W(),[i,a]=(0,N.useState)(!1),[o,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(!1),f=Qa(),p=ua(),m=f.data?.version??Ka,h=p.data?.tag_name?.replace(/^v/,``),g=Qi(m,h),_=_a(),v=e=>{ra(Q,e)};(0,N.useEffect)(()=>{a(!1)},[r.pathname]),(0,N.useEffect)(()=>{let e=()=>a(!1);return window.addEventListener(`cartethyia:overlay-open`,e),()=>window.removeEventListener(`cartethyia:overlay-open`,e)},[]),(0,N.useLayoutEffect)(()=>{window.scrollTo(0,0)},[r.pathname]);let y=async()=>{l(!0);try{await k(`/auth/logout`,{method:`POST`})}finally{Q.clear(),Yi(),n(`/login`,{replace:!0})}};(0,N.useEffect)(()=>(document.documentElement.dataset.glassEnabled=`true`,Ei(Ti()),()=>{delete document.documentElement.dataset.glassEnabled}),[]);let b=Za(r.pathname,_.data??[]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:`app-bg`,"aria-hidden":`true`}),(0,X.jsx)(`div`,{className:`app-shell-frame`,children:(0,X.jsxs)(`div`,{className:`app-shell-root`,"data-drawer":i?`open`:void 0,"data-page-scroll":r.pathname===`/console-log`?`contained`:void 0,onClick:e=>{i&&e.target.closest(`.app-main-column`)&&a(!1)},children:[(0,X.jsxs)(`aside`,{className:`glass app-sidebar ${i?`is-open`:``}`,"aria-label":`Dashboard navigation`,children:[(0,X.jsxs)(`div`,{className:`brand-header`,children:[(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`brand-icon overflow-hidden p-0`,children:(0,X.jsx)(`img`,{src:`/assets/brand/sidebar_ico.jpg`,alt:`Cartethyia`,onError:e=>{e.currentTarget.onerror=null,e.currentTarget.src=`/assets/brand/sidebar_ico.jpg`},className:`w-full h-full object-cover block`})}),(0,X.jsxs)(`div`,{className:`brand-meta`,children:[(0,X.jsx)(`div`,{className:`brand-name`,children:(0,X.jsx)(`span`,{children:`Cartethyia`})}),(0,X.jsxs)(`div`,{className:`brand-version-badge`,children:[(0,X.jsx)(`a`,{href:s,target:`_blank`,rel:`noreferrer`,className:`brand-version-link`,children:qa}),g?(0,X.jsxs)(`a`,{href:p.data?.html_url??c,target:`_blank`,rel:`noreferrer`,className:`brand-update-badge`,title:h===void 0?`A newer Cartethyia release is available on GitHub`:`Update available on GitHub: v${h}`,children:[(0,X.jsx)(Ke,{size:9,className:`shrink-0`,"aria-hidden":`true`}),h===void 0?`update`:`Update v${h}`]}):null]})]})]}),(0,X.jsx)(`nav`,{className:`flex-1 overflow-y-auto py-2 px-0`,children:Ja.map(e=>(0,X.jsx)(oo,{group:e,pathname:r.pathname,onIntent:v},e.label))}),(0,X.jsx)(`div`,{className:`sidebar-user-card`,children:(0,X.jsxs)(`div`,{className:`user-card-content`,children:[(0,X.jsx)(`div`,{className:`user-avatar`,"aria-hidden":`true`,children:(e.displayName??e.email).slice(0,2).toUpperCase()}),(0,X.jsxs)(`div`,{className:`user-info`,children:[(0,X.jsx)(`p`,{className:`user-name`,children:e.displayName||`Admin`}),(0,X.jsx)(`p`,{className:`user-role`,children:e.email})]}),(0,X.jsx)(`button`,{type:`button`,onClick:()=>d(!0),disabled:o,"aria-label":`Sign out`,title:`Sign out`,className:`topbar-icon-button w-15 h-15 rounded-inset`,children:(0,X.jsx)(Ve,{size:14})})]})})]}),(0,X.jsxs)(`div`,{className:`app-main-column`,children:[(0,X.jsx)(Fi,{}),(0,X.jsxs)(`header`,{className:`glass app-topbar`,children:[(0,X.jsx)(`button`,{type:`button`,"aria-label":`Open navigation`,className:`topbar-menu-btn`,onClick:()=>a(!0),children:(0,X.jsx)(Ue,{size:18})}),(0,X.jsxs)(`div`,{className:`topbar-meta`,children:[(0,X.jsxs)(`h1`,{className:`topbar-title`,children:[(0,X.jsx)(b.icon,{className:`topbar-title-icon`,size:16,"aria-hidden":`true`}),b.title]}),(0,X.jsx)(`p`,{className:`topbar-subtitle`,children:b.sub})]}),(0,X.jsxs)(`div`,{className:`topbar-actions`,children:[(0,X.jsx)($a,{}),(0,X.jsx)(ao,{health:f.data})]})]}),(0,X.jsx)(`main`,{className:`route-enter w-full min-w-0`,children:t})]})]})}),(0,X.jsx)(Ii,{open:u,onClose:()=>d(!1),onConfirm:y,title:`Sign out?`,message:`You will need to sign in again to open the console.`,confirmLabel:`Sign out`,danger:!0})]})}var lo=class extends N.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[console] route render failed:`,e,t.componentStack)}componentDidUpdate(e){e.resetKey!==this.props.resetKey&&this.state.error!==null&&this.setState({error:null})}render(){return this.state.error===null?this.props.children:(0,X.jsx)(`main`,{className:`auth-viewport`,children:(0,X.jsxs)(`div`,{className:`card-solid auth-window border border-red-soft`,children:[(0,X.jsxs)(`div`,{className:`auth-header`,children:[(0,X.jsx)(`h1`,{className:`auth-title`,children:`Console view failed`}),(0,X.jsx)(`p`,{className:`auth-desc`,children:`This view could not be rendered.`})]}),(0,X.jsxs)(`div`,{className:`rounded-panel border border-inner-border bg-surface-2 p-7 leading-normal text-caption text-text-secondary`,children:[(0,X.jsx)(`strong`,{className:`block text-text-primary mb-2`,children:`Rendering error`}),(0,X.jsx)(`span`,{className:`select-text break-words`,children:this.state.error.message})]}),(0,X.jsx)(`button`,{type:`button`,className:`btn btn-primary inline-flex w-full items-center justify-center rounded-control bg-accent font-semibold text-accent-foreground mt-3 h-20 text-caption`,onClick:()=>window.location.reload(),children:`Reload console`})]})})}},uo=3e5;function fo(e){return`cartethyia:lazy-retry:${e}`}function po(e,t){if(e===null)return!0;let n=Number(e);return!Number.isFinite(n)||t-n>uo}function mo(){try{return typeof sessionStorage>`u`?void 0:sessionStorage}catch{return}}function $(e,t,n={}){let r=n.storage??mo(),i=n.reload??(()=>{window.location.reload()}),a=n.now??(()=>Date.now()),o=fo(t);return(0,N.lazy)(async()=>{try{let t=await e();try{r?.removeItem(o)}catch{}return t}catch(e){let t=null;try{t=r?.getItem(o)??null}catch{t=null}if(po(t,a())){try{r?.setItem(o,String(a()))}catch{}return i(),new Promise(()=>{})}throw e}})}function ho(){return(0,X.jsxs)(`div`,{role:`status`,"aria-label":`Loading console`,className:`min-h-dvh flex flex-col items-center justify-center gap-6 text-text-tertiary`,children:[(0,X.jsx)(h,{size:22,className:`animate-spin`,"aria-hidden":`true`}),(0,X.jsx)(`p`,{className:`text-caption`,children:`Loading console…`})]})}var go=$(()=>i(()=>import(`./LoginPage-DHoB3Agn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`login`),_o=$(()=>i(()=>import(`./SetupPage-D3nza7LH.js`),__vite__mapDeps([10,1,2,3,4,6,7,8,9,11,12])),`setup`),vo=$(()=>i(()=>import(`./BannedPage-9igfctfZ.js`),__vite__mapDeps([13,1])),`banned`),yo=$(()=>i(()=>import(`./OverviewPage-BrY4SgIt.js`),__vite__mapDeps([14,1,15,16,6,17,18,19,20,21,22,2,3,4,23,24,25,8,9,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,7,46,47,48,49,50,51,52,11,53])),`overview`),bo=$(()=>i(()=>import(`./UsagePage-BQlWbWg2.js`),__vite__mapDeps([54,1,55,56,3,4,2,32,15,16,6,17,18,20,57,58,24,25,8,9,59,27,5,36,60,61,62,42,43,44,63,46,23,50,11,64,65,66,67,68])),`usage`),xo=$(()=>i(()=>import(`./ProviderDetailPage-D9VSt7T_.js`),__vite__mapDeps([69,1,55,70,71,19,20,72,57,2,3,4,58,24,25,8,9,26,59,27,28,73,31,32,33,34,74,35,75,37,41,61,16,6,42,43,44,63,45,7,46,48,49,23,50,53,76,77,17,18,78,11,64,79,65,66])),`provider-detail`),So=$(()=>i(()=>import(`./ProvidersPage-Df77V5I5.js`),__vite__mapDeps([80,1,2,3,4,8,9,27,31,32,34,41,6,81,42,45,7,46,20,48,49,23,50,76,64,79])),`providers`),Co=$(()=>i(()=>import(`./CombosPage-CVnQPBBz.js`),__vite__mapDeps([82,1,83,22,2,3,4,23,24,27,73,31,32,33,34,36,37,41,6,81,42,30,7,8,9,46,20,47,16,44,45,48,50,76,77,17,18,65])),`combos`),wo=$(()=>i(()=>import(`./QuotaPage-CY4o2t4p.js`),__vite__mapDeps([84,1,55,20,21,2,3,4,8,27,31,32,35,75,41,6,42,45,46,48,49,23,50,11,53,78,16,17,18])),`quota`),To=$(()=>i(()=>import(`./ProxyPage-CDfxP7AC.js`),__vite__mapDeps([85,1,55,2,3,4,25,8,9,26,27,31,32,33,34,74,75,38,41,16,6,17,18,42,43,63,45,7,46,20,49,23,50,11,64,67,68])),`proxy`),Eo=$(()=>i(()=>import(`./SettingsPage-CvjZxHE4.js`),__vite__mapDeps([86,1,2,3,4,25,9,27,31,32,39,16,6,17,18,41,42,43,7,8,46,20,49,23,66,12])),`settings`),Do=$(()=>i(()=>import(`./CliToolsPage-D3xqZbN-.js`),__vite__mapDeps([87,1,55,27,2,3,4,42,45,23,50,52,16,6,17,18,88,11])),`cli-tools`),Oo=$(()=>i(()=>import(`./CliToolDetailPage-ZRr2K2sF.js`),__vite__mapDeps([89,1,70,57,2,3,4,25,27,36,37,6,42,43,45,7,8,9,46,20,47,31,32,16,44,48,49,23,50,51,17,18,52,88])),`cli-tool-detail`),ko=$(()=>i(()=>import(`./ConsoleLogPage-u6W1UXSc.js`),__vite__mapDeps([90,1,2,3,4,27,35,37,38,41,6,42,63,68,45,7,8,9,11])),`console-log`),Ao=$(()=>i(()=>import(`./CustomizationPage-CTTpCb25.js`),__vite__mapDeps([91,1,2,3,4,59,73,75,42,49,23,50])),`customization`),jo=$(()=>i(()=>import(`./StudioPage-CbK3hXvU.js`),__vite__mapDeps([92,1,56,3,4,2,32,71,20,72,24,25,26,93,31,33,75,61,42,7,8,9,46,47,36,37,16,6,44,45,48,51,17,18])),`studio`);function Mo(){let e=G(),t=W();return(0,N.useEffect)(()=>(De(n=>{if(Q.clear(),Yi(),n===`banned`){e(`/banned`,{replace:!0});return}e(`/login?returnTo=${encodeURIComponent(t.pathname)}`,{replace:!0})}),()=>De(void 0)),[e,t.pathname]),null}function No(){let e=W();return(0,X.jsx)(lo,{resetKey:`${e.pathname}${e.search}`,children:(0,X.jsx)(N.Suspense,{fallback:(0,X.jsx)(ho,{}),children:(0,X.jsxs)(er,{children:[(0,X.jsx)(K,{path:`/login`,element:(0,X.jsx)(go,{})}),(0,X.jsx)(K,{path:`/setup`,element:(0,X.jsx)(_o,{})}),(0,X.jsx)(K,{path:`/banned`,element:(0,X.jsx)(vo,{})}),(0,X.jsx)(K,{path:`/*`,element:(0,X.jsx)(Po,{})})]})})})}function Po(){let[e,t]=(0,N.useState)({kind:`loading`}),n=W(),r=G(),[i]=(0,N.useState)(()=>n.pathname);return(0,N.useEffect)(()=>{let e=new AbortController;return Q.fetchQuery({queryKey:A.session.current,queryFn:()=>Ee(),staleTime:6e4}).then(n=>{if(!e.signal.aborted){if(n){Q.setQueryData(A.session.current,n),t({kind:`ready`,user:n}),n.isFirstBoot&&i!==`/setup`&&r(`/setup`,{replace:!0});return}Q.removeQueries({queryKey:A.session.current}),k(`/auth/first-boot`,{signal:e.signal}).then(n=>{e.signal.aborted||t({kind:`unauthenticated`,needsSetup:n.requires_setup})}).catch(()=>{e.signal.aborted||t({kind:`unauthenticated`,needsSetup:!1})})}}).catch(n=>{e.signal.aborted||(typeof n==`object`&&n&&`status`in n&&n.status===403?t({kind:`blocked`}):t({kind:`unauthenticated`,needsSetup:!1}))}),()=>e.abort()},[i,r]),e.kind===`loading`?null:e.kind===`blocked`?(0,X.jsx)(Qn,{to:`/banned`,replace:!0}):e.kind===`unauthenticated`?(0,X.jsx)(Qn,{to:e.needsSetup?`/setup`:`/login?returnTo=${encodeURIComponent(n.pathname)}`,replace:!0}):(0,X.jsx)(co,{user:e.user,children:(0,X.jsx)(lo,{resetKey:n.pathname,children:(0,X.jsxs)(er,{children:[(0,X.jsx)(K,{path:`/`,element:(0,X.jsx)(yo,{})}),(0,X.jsx)(K,{path:`/usage`,element:(0,X.jsx)(bo,{})}),(0,X.jsx)(K,{path:`/providers`,element:(0,X.jsx)(So,{})}),(0,X.jsx)(K,{path:`/providers/:providerId`,element:(0,X.jsx)(xo,{})}),(0,X.jsx)(K,{path:`/combos`,element:(0,X.jsx)(Co,{})}),(0,X.jsx)(K,{path:`/quota`,element:(0,X.jsx)(wo,{})}),(0,X.jsx)(K,{path:`/proxy`,element:(0,X.jsx)(To,{})}),(0,X.jsx)(K,{path:`/console-log`,element:(0,X.jsx)(ko,{})}),(0,X.jsx)(K,{path:`/customization`,element:(0,X.jsx)(Ao,{})}),(0,X.jsx)(K,{path:`/model-lab`,element:(0,X.jsx)(jo,{})}),(0,X.jsx)(K,{path:`/cli-tools`,element:(0,X.jsx)(Do,{})}),(0,X.jsx)(K,{path:`/cli-tools/:toolId`,element:(0,X.jsx)(Oo,{})}),(0,X.jsx)(K,{path:`/settings`,element:(0,X.jsx)(Eo,{})}),(0,X.jsx)(K,{path:`*`,element:(0,X.jsx)(Qn,{to:`/`,replace:!0})})]})})})}function Fo(){return(0,X.jsx)(ve,{client:Q,children:(0,X.jsxs)(Br,{basename:`/console`,children:[(0,X.jsx)(Mo,{}),(0,X.jsx)(No,{}),(0,X.jsx)(m,{position:`top-right`,offset:{top:`6rem`,right:`1rem`},mobileOffset:{top:`6rem`,left:`1rem`,right:`1rem`},visibleToasts:2,richColors:!0,duration:5e3,toastOptions:{className:`toast-surface select-text`,descriptionClassName:`select-text`,classNames:{title:`select-text`},style:{background:`var(--glass-bg-2)`,border:`1px solid var(--glass-border-2)`,color:`var(--text-primary)`,fontSize:`12.5px`,userSelect:`text`},actionButtonStyle:{background:`var(--accent)`,color:`var(--accent-foreground)`},cancelButtonStyle:{background:`var(--surface-muted)`,color:`var(--text-primary)`}}})]})})}function Io(e){document.title=`Cartethyia Console`,Ji().finally(()=>{Xi(),(0,ei.createRoot)(e).render((0,X.jsx)(N.StrictMode,{children:(0,X.jsx)(Fo,{})}))})}export{qr as $,ca as A,Oi as B,Wa as C,Ha as D,Ta as E,da as F,ui as G,mi as H,Q as I,pi as J,_i as K,Ii as L,fa as M,ha as N,Aa as O,ma as P,An as Q,Ai as R,Ra as S,Ua as T,hi as U,ki as V,ii as W,Vr as X,li as Y,G as Z,_a as _,Oa as a,Re as at,wa as b,Ea as c,Ba as d,Ze as et,Ca as f,ya as g,va as h,Va as i,Be as it,pa as j,ga as k,Fa as l,Da as m,Io as mountConsole,ja as n,Je as nt,ka as o,xa as p,ci as q,La as r,qe as rt,Ga as s,Ka as t,Xe as tt,za as u,Pa as v,Sa as w,Ia as x,ba as y,J as z};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t,r as n,t as r}from"./jsx-runtime-CXUMngI_.js";import{i,n as a,r as o}from"./app-C-Y4oZT0.js";var s=e(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),c=t(n(),1),l=r(),u=`https://img.shields.io`;function d(e,t){let n=new URLSearchParams({style:`flat-square`,labelColor:`0b1220`,color:t});return`${u}/github/${e}/${a}?${n.toString()}`}function f({size:e=16}){return(0,l.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,l.jsx)(`path`,{d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z`})})}function p({size:e=15}){return(0,l.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,l.jsx)(`path`,{d:`M0 0v16h16V0H0Zm13 13h-2V5H8v8H3V3h10v10Z`})})}function m({size:e=15}){return(0,l.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,l.jsx)(`path`,{d:`m15.5 6.3-.02-.06-2.14-5.58a.56.56 0 0 0-.22-.26.57.57 0 0 0-.65.03.57.57 0 0 0-.19.29l-1.45 4.42H5.17L3.72.72A.57.57 0 0 0 3.53.43a.57.57 0 0 0-.65-.03.56.56 0 0 0-.22.26L.52 6.24l-.02.06a3.97 3.97 0 0 0 1.32 4.59l.01.01.02.02 3.25 2.44 1.61 1.22.98.74a.67.67 0 0 0 .81 0l.98-.74 1.61-1.22 3.26-2.45.01-.01a3.97 3.97 0 0 0 1.32-4.59Z`})})}function h({size:e=15}){return(0,l.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,l.jsx)(`path`,{d:`M13.55 3.02A12.6 12.6 0 0 0 10.5 2.1a8.9 8.9 0 0 0-.4.83 11.7 11.7 0 0 0-3.2 0 8.6 8.6 0 0 0-.41-.83 12.6 12.6 0 0 0-3.05.92C1.3 5.75.85 8.4 1.07 11.01a12.7 12.7 0 0 0 3.74 1.9c.3-.41.57-.85.8-1.31-.44-.17-.86-.37-1.26-.6l.31-.24a9 9 0 0 0 7.68 0l.31.24c-.4.23-.82.43-1.26.6.23.46.5.9.8 1.31a12.7 12.7 0 0 0 3.74-1.9c.26-3.03-.44-5.66-1.98-7.99ZM5.68 9.4c-.73 0-1.33-.67-1.33-1.49s.59-1.49 1.33-1.49c.74 0 1.34.68 1.33 1.49 0 .82-.59 1.49-1.33 1.49Zm4.64 0c-.73 0-1.33-.67-1.33-1.49s.59-1.49 1.33-1.49c.74 0 1.34.68 1.33 1.49 0 .82-.59 1.49-1.33 1.49Z`})})}function g({id:e,size:t}){return e===`npm`?(0,l.jsx)(p,{size:t}):e===`gitlab`?(0,l.jsx)(m,{size:t}):e===`discord`?(0,l.jsx)(h,{size:t}):(0,l.jsx)(f,{size:t})}function _({className:e=``}){let[t,n]=(0,c.useState)(!1),r=(0,c.useRef)(null),a=(0,c.useId)(),s=(0,c.useCallback)(()=>n(!1),[]);return(0,c.useEffect)(()=>{if(!t)return;let e=e=>{r.current!==null&&!r.current.contains(e.target)&&s()},n=e=>{e.key===`Escape`&&s()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,n),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,n)}},[t,s]),(0,l.jsx)(`div`,{className:e,ref:r,children:(0,l.jsxs)(`div`,{className:`github-split`,children:[(0,l.jsxs)(`a`,{className:`github-badge`,href:o,target:`_blank`,rel:`noreferrer`,"aria-label":`Cartethyia on GitHub`,children:[(0,l.jsx)(f,{size:15}),(0,l.jsx)(`img`,{className:`github-badge-metric`,src:d(`stars`,`2ea043`),alt:`GitHub stars`,height:20,loading:`lazy`,decoding:`async`}),(0,l.jsx)(`img`,{className:`github-badge-metric`,src:d(`forks`,`1f6feb`),alt:`GitHub forks`,height:20,loading:`lazy`,decoding:`async`})]}),(0,l.jsx)(`button`,{type:`button`,className:`github-split-toggle`,"aria-haspopup":`menu`,"aria-expanded":t,"aria-controls":a,"aria-label":`More ways to get Cartethyia`,onClick:()=>n(e=>!e),children:(0,l.jsx)(`svg`,{width:12,height:12,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:(0,l.jsx)(`path`,{d:`M8 11 3 5h10l-5 6Z`})})}),t?(0,l.jsx)(`div`,{className:`github-split-menu`,id:a,role:`menu`,"aria-label":`Source and package links`,children:i.map(e=>(0,l.jsxs)(`a`,{className:`github-split-item`,href:e.href,target:`_blank`,rel:`noreferrer`,role:`menuitem`,onClick:s,children:[(0,l.jsx)(g,{id:e.id,size:14}),(0,l.jsxs)(`span`,{className:`github-split-item-text`,children:[(0,l.jsx)(`span`,{className:`github-split-item-label`,children:e.label}),(0,l.jsx)(`span`,{className:`github-split-item-hint`,children:e.hint})]})]},e.id))}):null]})})}export{s as n,_ as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CXUMngI_.js";import{a as t}from"./toast-CNt_jzO4.js";import{r as n}from"./stack-C9_uUjaA.js";var r=e(),i={center:`items-center`,start:`items-start`,end:`items-end`,"flex-start":`items-start`,"flex-end":`items-end`,baseline:`items-baseline`,stretch:`items-stretch`},a={center:`justify-center`,start:`justify-start`,end:`justify-end`,"flex-start":`justify-start`,"flex-end":`justify-end`,"space-between":`justify-between`,"space-around":`justify-around`,"space-evenly":`justify-evenly`};function o({children:e,gap:t=3,gapRaw:n,align:i=`center`,justify:a,wrap:o=!0,style:c,className:l=``}){return(0,r.jsx)(s,{gap:t,gapRaw:n,align:i,justify:a,wrap:o,style:c,className:l,children:e})}function s({children:e,gap:o=4,gapRaw:s,align:c=`center`,justify:l,wrap:u=!1,style:d,className:f=``}){let p=n(o,4);return(0,r.jsx)(`div`,{className:t(`flex flex-row`,i[c??``]??``,a[l??``]??``,u&&`flex-wrap`,s===void 0?p:null,f),style:s===void 0?d:{gap:s,...d},children:e})}export{s as n,o as t};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e,r as t,t as n}from"./jsx-runtime-CXUMngI_.js";import{a as r}from"./toast-CNt_jzO4.js";import{t as i}from"./eye-off-Bk5g2luF.js";import{t as a}from"./eye-C_hawfH4.js";var o=e(t(),1),s=n(),c=`w-full rounded-control border border-inner-border bg-surface-2 text-text-primary px-6 py-4 text-body outline-none transition-[border-color,box-shadow] duration-(--dur-micro) ease-spring focus:border-accent focus:shadow-focus`,l=(0,o.forwardRef)(({label:e,hint:t,error:n,id:l,type:u,className:d=``,showPasswordToggle:f,...p},m)=>{let h=u===`password`,g=h||f,[_,v]=(0,o.useState)(!1);return(0,s.jsxs)(`div`,{className:`form-group flex w-full flex-col gap-3`,children:[e?(0,s.jsxs)(`label`,{htmlFor:l,className:`form-label flex items-center justify-between text-caption font-semibold text-text-primary`,children:[(0,s.jsx)(`span`,{children:e}),t?(0,s.jsx)(`span`,{className:`form-hint text-badge font-normal text-text-tertiary`,children:t}):null]}):null,(0,s.jsxs)(`div`,{className:`relative flex items-center w-full`,children:[(0,s.jsx)(`input`,{ref:m,id:l,type:h?_?`text`:`password`:u,className:r(`form-input`,c,g&&`pr-18`,d),...p}),g?(0,s.jsx)(`button`,{type:`button`,onClick:()=>v(e=>!e),"aria-label":_?`Hide password`:`Show password`,"aria-pressed":_,className:`absolute right-5 bg-transparent border-none text-text-tertiary cursor-pointer p-1 inline-flex items-center justify-center`,children:_?(0,s.jsx)(i,{size:16}):(0,s.jsx)(a,{size:16})}):null]}),n?(0,s.jsx)(`p`,{className:`form-error mt-2 text-badge text-red`,role:`alert`,children:n}):null]})});l.displayName=`Input`;var u=(0,o.forwardRef)(({className:e,...t},n)=>(0,s.jsx)(`input`,{ref:n,type:`file`,className:r(`form-file-input box-border min-w-0 h-16 flex-auto cursor-pointer rounded-control border border-inner-border bg-surface-2 py-0 pl-0 pr-2 font-sans text-badge text-text-secondary transition-colors duration-(--dur-micro) ease-standard enabled:hover:border-border-strong focus-visible:outline-2 focus-visible:outline-focus-ring focus-visible:outline-offset-1 disabled:cursor-not-allowed disabled:opacity-60`,`file:h-full file:mr-4 file:px-5 file:py-0 file:rounded-l-control file:rounded-r-none file:border-0 file:border-r file:border-inner-border file:bg-surface-1 file:font-sans file:text-badge file:font-semibold file:text-text-primary file:cursor-pointer disabled:file:cursor-not-allowed file:hover:bg-surface-hover`,e),...t}));u.displayName=`FileInput`;var d=(0,o.forwardRef)(({label:e,hint:t,error:n,id:i,className:a=``,...o},l)=>(0,s.jsxs)(`div`,{className:`form-group flex w-full flex-col gap-3`,children:[e?(0,s.jsxs)(`label`,{htmlFor:i,className:`form-label flex items-center justify-between text-caption font-semibold text-text-primary`,children:[(0,s.jsx)(`span`,{children:e}),t?(0,s.jsx)(`span`,{className:`form-hint text-badge font-normal text-text-tertiary`,children:t}):null]}):null,(0,s.jsx)(`textarea`,{ref:l,id:i,className:r(`form-textarea`,c,a),...o}),n?(0,s.jsx)(`p`,{className:`form-error mt-2 text-badge text-red`,role:`alert`,children:n}):null]}));d.displayName=`Textarea`;export{l as n,d as r,u as t};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CXUMngI_.js";import{a as t}from"./toast-CNt_jzO4.js";var n=e();function r({eyebrow:e,title:r,description:i,action:a,icon:o,level:s=2}){let c=!!(e||r||i),l=s===1?`h1`:s===3?`h3`:`h2`;return(0,n.jsxs)(`div`,{className:t(`section-header flex items-center justify-between gap-6 max-small:flex-col max-small:items-start max-small:gap-4`,c?void 0:`justify-end`),children:[c?(0,n.jsxs)(`div`,{className:`section-header-text min-w-0`,children:[e?(0,n.jsx)(`p`,{className:`text-badge font-bold uppercase tracking-label text-text-tertiary mb-1`,children:e}):null,r?(0,n.jsx)(l,{className:`font-head text-title font-bold tracking-[-0.02em] text-text-primary`,children:r}):null,i?(0,n.jsx)(`p`,{className:`mt-1 text-caption text-text-secondary`,children:i}):null]}):null,o?(0,n.jsx)(`div`,{className:`card-header-icon grid size-14 shrink-0 place-items-center rounded-pill bg-accent-soft text-accent [&_svg]:size-7.5`,children:o}):null,a?(0,n.jsx)(`div`,{className:`section-header-action max-small:w-full max-small:[&_button]:w-full`,children:a}):null]})}function i({label:e,value:r,detail:i,icon:a,tone:o,status:s,valueColor:c,action:l,size:u=`default`}){let d={teal:`text-teal`,purple:`text-accent`,green:`text-green`,orange:`text-orange`,red:`text-red`,accent:`text-accent`}[o||(s===`cooldown`?`orange`:s===`disabled`?`red`:`accent`)]??`text-accent`;return(0,n.jsxs)(`div`,{className:t(`stat-card min-w-0 border border-inner-border rounded-card bg-surface-2`,u===`roomy`?`p-9`:`p-6`),children:[(0,n.jsxs)(`div`,{className:t(`flex items-center justify-between gap-4 font-bold uppercase tracking-label`,u===`roomy`?`text-caption`:`text-micro`,d),children:[(0,n.jsxs)(`span`,{className:`inline-flex items-center gap-4 min-w-0`,children:[a,(0,n.jsx)(`span`,{children:e})]}),l?(0,n.jsx)(`span`,{className:`shrink-0`,children:l}):null]}),(0,n.jsx)(`p`,{className:t(`font-mono tabular-nums font-bold leading-[1.15] mb-0`,u===`roomy`?`text-hero mt-4`:`text-display mt-1`),style:c?{color:c}:void 0,children:r}),(0,n.jsx)(`span`,{className:t(`stat-card-detail line-clamp-2 wrap-anywhere text-text-secondary`,u===`roomy`?`mt-2 text-body`:`text-badge`),children:i})]})}function a({headers:e,children:r,maxHeight:i,onScroll:a,sortKey:o,sortDirection:s,onSort:c,scrollRegion:l=!1,dense:u=!1}){return(0,n.jsx)(`div`,{className:t(`data-table-container`,l&&`scroll-region`),style:i?{maxHeight:i,overflowY:`auto`}:void 0,onScroll:a,children:(0,n.jsxs)(`table`,{className:t(`data-table text-caption`,u&&`text-badge [&_th]:px-4 [&_th]:py-2.5 [&_td]:px-4 [&_td]:py-2.5 [&_th]:text-text-secondary [&_th]:font-semibold [&_th]:normal-case [&_th]:tracking-normal [&_td]:tabular-nums`),children:[(0,n.jsx)(`thead`,{children:(0,n.jsx)(`tr`,{children:e.map(e=>{let r=typeof e==`string`?e:e.key,i=typeof e==`string`?e:e.label,a=typeof e!=`string`&&e.sortable===!0&&c!==void 0,l=o===r;return(0,n.jsx)(`th`,{scope:`col`,"aria-sort":l?s===`asc`?`ascending`:`descending`:void 0,children:a?(0,n.jsxs)(`button`,{type:`button`,onClick:()=>c(r),title:`Sort by ${i}`,className:`inline-flex items-center gap-2 cursor-pointer`,children:[(0,n.jsx)(`span`,{children:i}),(0,n.jsx)(`span`,{"aria-hidden":`true`,className:t(`text-micro`,l?`opacity-100`:`opacity-[0.35]`),children:l?s===`asc`?`▲`:`▼`:`△`})]}):i},r)})})}),(0,n.jsx)(`tbody`,{children:r})]})})}export{r as n,i as r,a as t};
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CXUMngI_.js";import{a as t}from"./toast-CNt_jzO4.js";var n=e();function r({children:e,leading:r,actions:i,density:a=`default`,className:o=``,...s}){return(0,n.jsxs)(`div`,{className:t(`list-row flex items-center gap-6 rounded-control border border-inner-border bg-surface-2 min-w-0 px-7 py-5`,a===`compact`&&`list-row-compact px-5 py-3 rounded-inset gap-4`,o),...s,children:[r?(0,n.jsx)(`div`,{className:`list-row-leading shrink-0`,children:r}):null,(0,n.jsx)(`div`,{className:`list-row-body flex-1 min-w-0 flex flex-col gap-2`,children:e}),i?(0,n.jsx)(`div`,{className:`list-row-actions flex items-center gap-2 shrink-0 flex-wrap`,children:i}):null]})}export{r as t};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){if(e==null||!Number.isFinite(e))return`—`;if(e<0)return`${Math.round(e)} B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;let i=r===0?0:1;return`${n.toFixed(i)} ${t[r]}`}function t(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function n(e){return e==null||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)} s`}function r(e,t){return e==null||!Number.isFinite(e)?`—`:Math.round(e).toLocaleString(t)}function i(e,t){return e==null||!Number.isFinite(e)?`—`:e.toLocaleString(t,{maximumFractionDigits:2})}export{t as a,r as i,i as n,n as r,e as t};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{o as e,r as t,t as n}from"./jsx-runtime-CXUMngI_.js";import{o as r}from"./app-C-Y4oZT0.js";import{t as i}from"./check-D69FzdvC.js";import{a}from"./toast-CNt_jzO4.js";import{at as o}from"./entry-FQCejoDY.js";var s=e(t(),1),c=e(r(),1),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0});function d(e,[t,n]){return Math.min(n,Math.max(t,e))}u(d,`clamp`);var f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=!!(typeof window<`u`&&window.document&&window.document.createElement);function h(e,t,{checkForDefaultPrevented:n=!0}={}){return p(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}p(h,`composeEventHandlers`);function g(e){if(!m)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}p(g,`getOwnerWindow`);function _(e){if(!m)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}p(_,`getOwnerDocument`);function v(e,t=!1){let{activeElement:n}=_(e);if(!n?.nodeName)return null;if(y(n)&&n.contentDocument)return v(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=_(n).getElementById(e);if(t)return t}}return n}p(v,`getActiveElement`);function y(e){return e.tagName===`IFRAME`}p(y,`isFrame`);var b=n(),x=Object.defineProperty,S=(e,t)=>x(e,`name`,{value:t,configurable:!0});function C(e,t){let n=s.createContext(t);n.displayName=e+`Context`;let r=S(e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,b.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=s.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return S(i,`useContext`),[r,i]}S(C,`createContext`);function w(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=S(t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,b.jsx)(c.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function c(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return S(c,`useContext`),[o,c]}S(r,`createContext`);let i=S(()=>{let t=n.map(e=>s.createContext(e));return S(function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,T(i,...t)]}S(w,`createContextScope`);function T(...e){let t=e[0];if(e.length===1)return t;let n=S(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return S(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}S(T,`composeContextScopes`);var E=Object.defineProperty,D=(e,t)=>E(e,`name`,{value:t,configurable:!0});function O(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}D(O,`setRef`);function k(...e){return t=>{let n=!1,r=e.map(e=>{let r=O(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():O(e[t],null)}}}}D(k,`composeRefs`);function A(...e){return s.useCallback(k(...e),e)}D(A,`useComposedRefs`);var j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0});function N(e){let t=s.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];te(r)&&typeof ae==`function`&&(r=ae(r._payload)),s.Children.forEach(r,e=>{if(z(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;te(n)&&typeof ae==`function`&&(n=ae(n._payload)),a=I(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=s.cloneElement(a,void 0,c):!o&&s.Children.count(r)===1&&s.isValidElement(r)&&(a=r);let l=a?R(a):void 0,u=A(n,l);if(!a){if(r||r===0)throw Error(o?ie(e):re(e));return r}let d=L(i,a.props??{});return a.type!==s.Fragment&&(d.ref=n?u:l),s.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}M(N,`createSlot`);var P=Symbol.for(`radix.slottable`);function F(e){let t=M(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=P,t}M(F,`createSlottable`);var I=M((e,t)=>{if(`child`in e.props){let t=e.props.child;return s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null}return s.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function L(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}M(L,`mergeProps`);function R(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}M(R,`getElementRef`);function z(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===P}M(z,`isSlottable`);var ee=Symbol.for(`react.lazy`);function te(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===ee&&`_payload`in e&&ne(e._payload)}M(te,`isLazyComponent`);function ne(e){return typeof e==`object`&&!!e&&`then`in e}M(ne,`isPromiseLike`);var re=M(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ie=M(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ae=s.use,oe=Object.defineProperty,B=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function se(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=B(e=>{let{scope:t,children:n}=e,r=s.useRef(null),a=s.useRef(new Map).current;return(0,b.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let c=e+`CollectionSlot`,l=N(c),u=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(c,n).collectionRef);return(0,b.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=N(d),m=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),c=A(t,o),l=a(d,n);return s.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,b.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return s.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return B(h,`useCollection`),[{Provider:o,Slot:u,ItemSlot:m},h,r]}B(se,`createCollection`);var ce=new WeakMap,le=class e extends Map{static{B(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ce.set(this,!0)}set(e,t){return ce.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=fe(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ue(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ue(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ue(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ue(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=de(e,t);return n===-1?void 0:e[n]}B(ue,`at`);function de(e,t){let n=e.length,r=fe(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}B(de,`toSafeIndex`);function fe(e){return e!==e||e===0?0:Math.trunc(e)}B(fe,`toSafeInteger`);function pe(e){let t=e+`CollectionProvider`,[n,r]=w(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new le,setItemMap:B(()=>void 0,`setItemMap`)}),o=B(({state:e,...t})=>e?(0,b.jsx)(l,{...t,state:e}):(0,b.jsx)(c,{...t}),`CollectionProvider`);o.displayName=t;let c=B(e=>{let t=g();return(0,b.jsx)(l,{...e,state:t})},`CollectionInit`);c.displayName=t+`Init`;let l=B(e=>{let{scope:t,children:n,state:r}=e,a=s.useRef(null),[o,c]=s.useState(null),l=A(a,c),[u,d]=r;return s.useEffect(()=>{if(!o)return;let e=_e(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,b.jsx)(i,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);l.displayName=t+`Impl`;let u=e+`CollectionSlot`,d=N(u),f=s.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=A(t,a(u,n).collectionRef);return(0,b.jsx)(d,{ref:i,children:r})});f.displayName=u;let p=e+`CollectionItemSlot`,m=N(p),h=s.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=s.useRef(null),[c,l]=s.useState(null),u=A(t,o,l),{setItemMap:d}=a(p,n),f=s.useRef(i);me(f.current,i)||(f.current=i);let h=f.current;return s.useEffect(()=>{let e=h;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(ge):(t.set(c,{...e,element:c}),t.toSorted(ge)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new le(e)))}},[c,h,d]),(0,b.jsx)(m,{"data-radix-collection-item":``,ref:u,children:r})});h.displayName=p;function g(){return s.useState(new le)}B(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return B(_,`useCollection`),[{Provider:o,Slot:f,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}B(pe,`createCollection`);function me(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}B(me,`shallowEqual`);function he(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}B(he,`isElementPreceding`);function ge(e,t){return!e[1].element||!t[1].element?0:he(e[1].element,t[1].element)?-1:1}B(ge,`sortByDocumentPosition`);function _e(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}B(_e,`getChildListObserver`);var ve=Object.defineProperty,ye=(e,t)=>ve(e,`name`,{value:t,configurable:!0}),be=s.createContext(void 0);function xe(e){let t=s.useContext(be);return e||t||`ltr`}ye(xe,`useDirection`);var Se=Object.defineProperty,Ce=(e,t)=>Se(e,`name`,{value:t,configurable:!0}),V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=N(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,b.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function we(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))}Ce(we,`dispatchDiscreteCustomEvent`);var Te=Object.defineProperty,Ee=(e,t)=>Te(e,`name`,{value:t,configurable:!0});function H(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ee(H,`useCallbackRef`);var De=Object.defineProperty,U=(e,t)=>De(e,`name`,{value:t,configurable:!0}),Oe=`dismissableLayer.update`,ke=`dismissableLayer.pointerDownOutside`,Ae=`dismissableLayer.focusOutside`,je,Me=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Ne=s.forwardRef(U(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=e,d=s.useContext(Me),[f,p]=s.useState(null),m=f?.ownerDocument??globalThis?.document,[,g]=s.useState({}),_=A(t,p),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y?v.indexOf(y):-1,S=f?v.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=s.useRef(!1),E=Ie(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=Le(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},m),O=f?S===v.length-1:!1,k=H(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return s.useEffect(()=>{if(O)return m.addEventListener(`keydown`,k,{capture:!0}),()=>m.removeEventListener(`keydown`,k,{capture:!0})},[m,O,k]),s.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(je=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Re(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=je))}},[f,m,n,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Re())},[f,d]),s.useEffect(()=>{let e=U(()=>g({}),`handleUpdate`);return document.addEventListener(Oe,e),()=>document.removeEventListener(Oe,e)},[]),(0,b.jsx)(V.div,{...u,ref:_,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:h(e.onFocusCapture,D.onFocusCapture),onBlurCapture:h(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:h(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function Pe(){let e=s.useContext(Me),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}U(Pe,`useDismissableLayerSurface`);var Fe=U(()=>!0,`IS_TRUE`);function Ie(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Fe}=t,c=H(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}U(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}U(t,`isOutsideInteractionIntercepted`);function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}U(s,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}U(p,`handleInteractionBubble`);let m=U(a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ze(ke,c,p,{discrete:!0})};if(U(s,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:U(()=>l.current=!0,`onPointerDownCapture`)}}U(Ie,`usePointerDownOutside`);function Le(e,t=globalThis?.document){let n=H(e),r=s.useRef(!1);return s.useEffect(()=>{let e=U(e=>{e.target&&!r.current&&ze(Ae,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:U(()=>r.current=!0,`onFocusCapture`),onBlurCapture:U(()=>r.current=!1,`onBlurCapture`)}}U(Le,`useFocusOutside`);function Re(){let e=new CustomEvent(Oe);document.dispatchEvent(e)}U(Re,`dispatchUpdate`);function ze(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?we(i,a):i.dispatchEvent(a)}U(ze,`handleAndDispatchCustomEvent`);var Be=Object.defineProperty,Ve=(e,t)=>Be(e,`name`,{value:t,configurable:!0}),He=0,Ue=null;function We(e){return Ge(),e.children}Ve(We,`FocusGuards`);function Ge(){s.useEffect(()=>{Ue||={start:Ke(),end:Ke()};let{start:e,end:t}=Ue;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),He++,()=>{He===1&&(Ue?.start.remove(),Ue?.end.remove(),Ue=null),He=Math.max(0,He-1)}},[])}Ve(Ge,`useFocusGuards`);function Ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Ve(Ke,`createFocusGuard`);var qe=Object.defineProperty,W=(e,t)=>qe(e,`name`,{value:t,configurable:!0}),Je=`focusScope.autoFocusOnMount`,Ye=`focusScope.autoFocusOnUnmount`,Xe={bubbles:!1,cancelable:!0},Ze=s.forwardRef(W(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),u=H(i),d=H(a),f=s.useRef(null),p=A(t,l),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(m.paused||!c)return;let t=e.target;c.contains(t)?f.current=t:G(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||G(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&G(c)};W(e,`handleFocusIn`),W(t,`handleFocusOut`),W(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,m.paused]),s.useEffect(()=>{if(c){it.add(m);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Je,Xe);c.addEventListener(Je,u),c.dispatchEvent(t),t.defaultPrevented||(Qe(st(et(c)),{select:!0}),document.activeElement===e&&G(c))}return()=>{c.removeEventListener(Je,u),setTimeout(()=>{let t=new CustomEvent(Ye,Xe);c.addEventListener(Ye,d),c.dispatchEvent(t),t.defaultPrevented||G(e??document.body,{select:!0}),c.removeEventListener(Ye,d),it.remove(m)},0)}}},[c,u,d,m]);let h=s.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=$e(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&G(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&G(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,b.jsx)(V.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Qe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(G(r,{select:t}),document.activeElement!==n)return}W(Qe,`focusFirst`);function $e(e){let t=et(e);return[tt(t,e),tt(t.reverse(),e)]}W($e,`getTabbableEdges`);function et(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:W(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}W(et,`getTabbableCandidates`);function tt(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):nt(r,{upTo:t})))return r}W(tt,`findVisible`);function nt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}W(nt,`isHidden`);function rt(e){return e instanceof HTMLInputElement&&`select`in e}W(rt,`isSelectableInput`);function G(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rt(e)&&t&&e.select()}}W(G,`focus`);var it=at();function at(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=ot(e,t),e.unshift(t)},remove(t){e=ot(e,t),e[0]?.resume()}}}W(at,`createFocusScopesStack`);function ot(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}W(ot,`arrayRemove`);function st(e){return e.filter(e=>e.tagName!==`A`)}W(st,`removeLinks`);var K=globalThis?.document?s.useLayoutEffect:()=>{},ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=s.useId||(()=>void 0),dt=0;function ft(e){let[t,n]=s.useState(ut());return K(()=>{e||n(e=>e??String(dt++))},[e]),e||(t?`radix-${t}`:``)}lt(ft,`useId`);var pt=[`top`,`right`,`bottom`,`left`],mt=Math.min,ht=Math.max,gt=Math.round,_t=Math.floor,vt=e=>({x:e,y:e}),yt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bt(e,t,n){return ht(e,mt(t,n))}function xt(e,t){return typeof e==`function`?e(t):e}function St(e){return e.split(`-`)[0]}function Ct(e){return e.split(`-`)[1]}function wt(e){return e===`x`?`y`:`x`}function Tt(e){return e===`y`?`height`:`width`}function q(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Et(e){return wt(q(e))}function Dt(e,t,n){n===void 0&&(n=!1);let r=Ct(e),i=Et(e),a=Tt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=It(o)),[o,It(o)]}function Ot(e){let t=It(e);return[kt(e),t,kt(t)]}function kt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var At=[`left`,`right`],jt=[`right`,`left`],Mt=[`top`,`bottom`],Nt=[`bottom`,`top`];function Pt(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jt:At:t?At:jt;case`left`:case`right`:return t?Mt:Nt;default:return[]}}function Ft(e,t,n,r){let i=Ct(e),a=Pt(St(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kt)))),a}function It(e){let t=St(e);return yt[t]+e.slice(t.length)}function Lt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Rt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Lt(e)}function zt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Bt(e,t,n){let{reference:r,floating:i}=e,a=q(t),o=Et(t),s=Tt(o),c=St(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ct(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Vt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xt(t,e),p=Rt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=zt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=zt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ht=50,Ut=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Vt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ht&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Bt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Wt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xt(e,t)||{};if(l==null)return{};let d=Rt(u),f={x:n,y:r},p=Et(i),m=Tt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mt(d[_],T),D=mt(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=bt(E,k,O),j=!c.arrow&&Ct(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Gt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=St(r),_=q(o),v=St(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[It(o)]:Ot(o)),x=p!==`none`;!d&&x&&b.push(...Ft(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Dt(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===q(t)||T.every(e=>q(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=q(e.placement);return t===_||t===`y`}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]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Kt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qt(e){return pt.some(t=>e[t]>=0)}var Jt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xt(e,t);switch(i){case`referenceHidden`:{let e=Kt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:qt(e)}}}case`escaped`:{let e=Kt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:qt(e)}}}default:return{}}}}},Yt=new Set([`left`,`top`]);async function Xt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=St(n),s=Ct(n),c=q(n)===`y`,l=Yt.has(o)?-1:1,u=a&&c?-1:1,d=xt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Zt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Xt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Qt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=q(i),p=wt(f),m=u[p],h=u[f],g=(e,t)=>bt(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},$t=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xt(e,t),u={x:n,y:r},d=q(i),f=wt(d),p=u[f],m=u[d],h=xt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Yt.has(St(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},en=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=xt(e,t),c=await i.detectOverflow(t,s),l=St(n),u=Ct(n),d=q(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=mt(p-c[m],g),y=mt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ht(c.left,c.right):S=p-2*ht(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function tn(){return typeof window<`u`}function nn(e){return an(e)?(e.nodeName||``).toLowerCase():`#document`}function J(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rn(e){return((an(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function an(e){return tn()?e instanceof Node||e instanceof J(e).Node:!1}function Y(e){return tn()?e instanceof Element||e instanceof J(e).Element:!1}function on(e){return tn()?e instanceof HTMLElement||e instanceof J(e).HTMLElement:!1}function sn(e){return!tn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof J(e).ShadowRoot}function cn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ln(e){return/^(table|td|th)$/.test(nn(e))}function un(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var dn=/transform|translate|scale|rotate|perspective|filter/,fn=/paint|layout|strict|content/,pn=e=>!!e&&e!==`none`,mn;function hn(e){let t=Y(e)?X(e):e;return pn(t.transform)||pn(t.translate)||pn(t.scale)||pn(t.rotate)||pn(t.perspective)||!_n()&&(pn(t.backdropFilter)||pn(t.filter))||dn.test(t.willChange||``)||fn.test(t.contain||``)}function gn(e){let t=bn(e);for(;on(t)&&!vn(t);){if(hn(t))return t;if(un(t))return null;t=bn(t)}return null}function _n(){return mn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),mn}function vn(e){return/^(html|body|#document)$/.test(nn(e))}function X(e){return J(e).getComputedStyle(e)}function yn(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(nn(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||sn(e)&&e.host||rn(e);return sn(t)?t.host:t}function xn(e){let t=bn(e);return vn(t)?(e.ownerDocument||e).body:on(t)&&cn(t)?t:xn(t)}function Sn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xn(e),i=r===e.ownerDocument?.body,a=J(r);if(i){let e=Cn(a);return t.concat(a,a.visualViewport||[],cn(r)?r:[],e&&n?Sn(e):[])}return t.concat(r,Sn(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wn(e){let t=X(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=on(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gt(n)!==a||gt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Tn(e){return Y(e)?e:e.contextElement}function En(e){let t=Tn(e);if(!on(t))return vt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wn(t),o=(a?gt(n.width):n.width)/r,s=(a?gt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Dn=vt(0);function On(e){let t=J(e);return!_n()||!t.visualViewport?Dn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===J(e)}function An(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Tn(e),o=vt(1);t&&(r?Y(r)&&(o=En(r)):o=En(e));let s=kn(a,n,r)?On(a):vt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=J(a),t=Y(r)?J(r):r,n=e,i=Cn(n);for(;i&&t!==n;){let e=En(i),t=i.getBoundingClientRect(),r=X(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=J(i),i=Cn(n)}}return zt({width:u,height:d,x:c,y:l})}function jn(e,t){let n=yn(e).scrollLeft;return t?t.left+n:An(rn(e)).left+n}function Mn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jn(e,n),y:n.top+t.scrollTop}}function Nn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=rn(r),s=t?un(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1),u=vt(0),d=on(r);if((d||!a)&&((nn(r)!==`body`||cn(o))&&(c=yn(r)),d)){let e=An(r);l=En(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mn(o,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Pn(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fn(e){let t=yn(e),n=e.ownerDocument.body,r=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+jn(e),o=-t.scrollTop;return X(n).direction===`rtl`&&(a+=ht(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var In=25;function Ln(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=J(e),a=rn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!_n()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(jn(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=In&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Rn(e,t){let n=An(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=En(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ln(e,n,t);else if(t===`document`)r=Fn(rn(e));else if(Y(t))r=Rn(t,n);else{let n=On(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zt(r)}function Bn(e,t){let n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>Y(e)&&nn(e)!==`body`),i=null,a=X(e).position===`fixed`,o=a?bn(e):e;for(;Y(o)&&!vn(o);){let e=X(o),t=hn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bn(o)}return t.set(e,r),r}function Vn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?un(t)?[]:Bn(t,this._c):[].concat(n),r],o=zn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=zn(t,a[e],i);s=ht(n.top,s),c=mt(n.right,c),l=mt(n.bottom,l),u=ht(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hn(e){let{width:t,height:n}=wn(e);return{width:t,height:n}}function Un(e,t,n){let r=on(t),i=rn(t),a=n===`fixed`,o=An(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vt(0);if((r||!a)&&((nn(t)!==`body`||cn(i))&&(s=yn(t)),r)){let e=An(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=jn(i));let l=i&&!r&&!a?Mn(i,s):vt(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Wn(e){return X(e).position===`static`}function Gn(e,t){if(!on(e)||X(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return rn(e)===n&&(n=n.ownerDocument.body),n}function Kn(e,t){let n=J(e);if(un(e))return n;if(!on(e)){let t=bn(e);for(;t&&!vn(t);){if(Y(t)&&!Wn(t))return t;t=bn(t)}return n}let r=Gn(e,t);for(;r&&ln(r)&&Wn(r);)r=Gn(r,t);return r&&vn(r)&&Wn(r)&&!hn(r)?n:r||gn(e)||n}var qn=async function(e){let t=this.getOffsetParent||Kn,n=this.getDimensions,r=await n(e.floating);return{reference:Un(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jn(e){return X(e).direction===`rtl`}var Yn={convertOffsetParentRelativeRectToViewportRelativeRect:Nn,getDocumentElement:rn,getClippingRect:Vn,getOffsetParent:Kn,getElementRects:qn,getClientRects:Pn,getDimensions:Hn,getScale:En,isElement:Y,isRTL:Jn};function Xn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zn(e,t,n){let r=null,i,a=rn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=_t(d),h=_t(a.clientWidth-(u+f)),g=_t(a.clientHeight-(d+p)),_=_t(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ht(0,mt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xn(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=J(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Tn(e),u=i||a?[...l?Sn(l):[],...t?Sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zn(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?An(e):null;c&&g();function g(){let t=An(e);h&&!Xn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $n=Zt,er=Qt,tr=Gt,nr=en,rr=Jt,ir=Wt,ar=$t,or=(e,t,n)=>{let r=new Map,i=n??{},a={...Yn,...i.platform,_c:r};return Ut(e,t,{...i,platform:a})},sr=typeof document<`u`?s.useLayoutEffect:function(){};function cr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!cr(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!cr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function lr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ur(e,t){let n=lr(e);return Math.round(t*n)/n}function dr(e){let t=s.useRef(e);return sr(()=>{t.current=e}),t}function fr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=s.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=s.useState(r);cr(m,r)||h(r);let[g,_]=s.useState(null),[v,y]=s.useState(null),b=s.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=s.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=s.useRef(null),T=s.useRef(null),E=s.useRef(f),D=u!=null,O=dr(u),k=dr(i),A=dr(d),j=s.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),or(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!cr(E.current,t)&&(E.current=t,c.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);sr(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=s.useRef(!1);sr(()=>(M.current=!0,()=>{M.current=!1}),[]),sr(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=s.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=s.useMemo(()=>({reference:S,floating:C}),[S,C]),F=s.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ur(P.floating,f.x),r=ur(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...lr(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return s.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var pr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ir({element:r.current,padding:i}).fn(n):r?ir({element:r,padding:i}).fn(n):{}}}},mr=(e,t)=>{let n=$n(e);return{name:n.name,fn:n.fn,options:[e,t]}},hr=(e,t)=>{let n=er(e);return{name:n.name,fn:n.fn,options:[e,t]}},gr=(e,t)=>({fn:ar(e).fn,options:[e,t]}),_r=(e,t)=>{let n=tr(e);return{name:n.name,fn:n.fn,options:[e,t]}},vr=(e,t)=>{let n=nr(e);return{name:n.name,fn:n.fn,options:[e,t]}},yr=(e,t)=>{let n=rr(e);return{name:n.name,fn:n.fn,options:[e,t]}},br=(e,t)=>{let n=pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},xr=Object.defineProperty,Sr=(e,t)=>xr(e,`name`,{value:t,configurable:!0});function Cr(e){let[t,n]=s.useState(void 0);return K(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Sr(Cr,`useSize`);var wr=Object.defineProperty,Tr=(e,t)=>wr(e,`name`,{value:t,configurable:!0}),Er=`Popper`,[Dr,Or]=w(Er),[kr,Ar]=Dr(Er),jr=Tr(e=>{let{__scopePopper:t,children:n}=e,[r,i]=s.useState(null),[a,o]=s.useState(void 0);return(0,b.jsx)(kr,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Mr=`PopperAnchor`,Nr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ar(Mr,n),o=s.useRef(null),c=a.onAnchorChange,l=A(t,s.useCallback(e=>{o.current=e,e&&c(e)},[c])),u=s.useRef(null);s.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&Br(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,b.jsx)(V.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Pr=`PopperContent`,[Fr,Ir]=Dr(Pr),Lr=s.forwardRef(Tr(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=Ar(Pr,n),[v,y]=s.useState(null),x=A(t,y),[S,C]=s.useState(null),w=Cr(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(u)?u:[u],j=k.length>0,M={padding:O,boundary:k.filter(Rr),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=fr({strategy:`fixed`,placement:D,whileElementsMounted:Tr((...e)=>Qn(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[mr({mainAxis:i+E,alignmentAxis:o}),l&&hr({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?gr():void 0,...M}),l&&_r({...M}),vr({...M,apply:Tr(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&br({element:S,padding:c}),zr({arrowWidth:T,arrowHeight:E}),p&&yr({strategy:`referenceHidden`,...M,boundary:j?M.boundary:void 0})]}),R=_.setPlacementState;K(()=>(R(F),()=>{R(void 0)}),[F,R]);let[z,ee]=Br(F),te=H(h);K(()=>{I&&te?.()},[I,te]);let ne=L.arrow?.x,re=L.arrow?.y,ie=L.arrow?.centerOffset!==0,[ae,oe]=s.useState();return K(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,b.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,b.jsx)(Fr,{scope:n,placedSide:z,placedAlign:ee,onArrowChange:C,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,b.jsx)(V.div,{"data-side":z,"data-align":ee,...g,ref:x,style:{...g.style,animation:I?g.style?.animation:`none`}})})})},`PopperContent`));function Rr(e){return e!==null}Tr(Rr,`isNotNull`);var zr=Tr(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Br(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Br(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Tr(Br,`getSideAndAlignFromPlacement`);var Vr=jr,Hr=Nr,Ur=Lr,Wr=Object.defineProperty,Gr=s.forwardRef(((e,t)=>Wr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=s.useState(!1);K(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?c.createPortal((0,b.jsx)(V.div,{...r,ref:t}),o):null},`Portal`)),Kr=Object.defineProperty,qr=(e,t)=>Kr(e,`name`,{value:t,configurable:!0});function Jr(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}qr(Jr,`useStateMachine`);var Yr=qr(e=>{let{present:t,children:n}=e,r=Xr(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Qr(r.ref,ei(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null},`Presence`);function Xr(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Jr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??$r(r.current),o.current=void 0):a.current=`none`},[c]),K(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=$r(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),K(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=qr(a=>{let o=$r(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=qr(e=>{e.target===t&&(a.current=$r(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=$r(t)}else r.current=null;n(e)},[])}}qr(Xr,`usePresence`);function Zr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qr(Zr,`setRef`);function Qr(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Zr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Zr(n[e],null)}}},[])}qr(Qr,`useStableComposedRefs`);function $r(e){return e?.animationName||`none`}qr($r,`getAnimationName`);function ei(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qr(ei,`getElementRef`);var ti=Object.defineProperty,ni=(e,t)=>ti(e,`name`,{value:t,configurable:!0}),ri=s.useEffectEvent,ii=s.useInsertionEffect;function ai(e){if(typeof ri==`function`)return ri(e);let t=s.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof ii==`function`?ii(()=>{t.current=e}):K(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}ni(ai,`useEffectEvent`);var oi=Object.defineProperty,si=(e,t)=>oi(e,`name`,{value:t,configurable:!0}),ci=s.useInsertionEffect||K;function li({prop:e,defaultProp:t,onChange:n=si(()=>{},`onChange`),caller:r}){let[i,a,o]=ui({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,s.useCallback(t=>{if(c){let n=di(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}si(li,`useControllableState`);function ui({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return ci(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}si(ui,`useUncontrolledState`);function di(e){return typeof e==`function`}si(di,`isFunction`);var fi=Symbol(`RADIX:SYNC_STATE`);function pi(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:c}=t,l=i!==void 0,u=ai(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=s.useReducer((t,n)=>{if(n.type===fi)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=s.useRef(m);s.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=s.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return s.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:fi,state:i})},[i,f.state,l]),[g,p]}si(pi,`useControllableStateReducer`);var mi=Object.defineProperty,hi=(e,t)=>mi(e,`name`,{value:t,configurable:!0});function gi(e){let t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}hi(gi,`usePrevious`);var _i=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),vi=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},yi=new WeakMap,bi=new WeakMap,xi={},Si=0,Ci=function(e){return e&&(e.host||Ci(e.parentNode))},wi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ci(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ti=function(e,t,n,r){var i=wi(t,Array.isArray(e)?e:[e]);xi[n]||(xi[n]=new WeakMap);var a=xi[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(yi.get(e)||0)+1,l=(a.get(e)||0)+1;yi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&bi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Si++,function(){o.forEach(function(e){var t=yi.get(e)-1,i=a.get(e)-1;yi.set(e,t),a.set(e,i),t||(bi.has(e)||e.removeAttribute(r),bi.delete(e)),i||e.removeAttribute(n)}),Si--,Si||(yi=new WeakMap,yi=new WeakMap,bi=new WeakMap,xi={})}},Ei=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||vi(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ti(r,i,n,`aria-hidden`)):function(){return null}},Z=function(){return Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Z.apply(this,arguments)};function Di(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Oi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ki=`right-scroll-bar-position`,Ai=`width-before-scroll-bar`,ji=`with-scroll-bars-hidden`,Mi=`--removed-body-scroll-bar-size`;function Ni(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pi(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fi=typeof window<`u`?s.useLayoutEffect:s.useEffect,Ii=new WeakMap;function Li(e,t){var n=Pi(t||null,function(t){return e.forEach(function(e){return Ni(e,t)})});return Fi(function(){var t=Ii.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ni(e,null)}),i.forEach(function(e){r.has(e)||Ni(e,a)})}Ii.set(n,e)},[e]),n}function Ri(e){return e}function zi(e,t){t===void 0&&(t=Ri);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Bi(e){e===void 0&&(e={});var t=zi(null);return t.options=Z({async:!0,ssr:!1},e),t}var Vi=function(e){var t=e.sideCar,n=Di(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,Z({},n))};Vi.isSideCarExport=!0;function Hi(e,t){return e.useMedium(t),Vi}var Ui=Bi(),Wi=function(){},Gi=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:Wi,onWheelCapture:Wi,onTouchMoveCapture:Wi}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Di(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Li([n,t]),w=Z(Z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ui,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),Z(Z({},w),{ref:C})):s.createElement(y,Z({},w,{className:l,ref:C}),c))});Gi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Gi.classNames={fullWidth:Ai,zeroRight:ki};var Ki=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function qi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ki();return t&&e.setAttribute(`nonce`,t),e}function Ji(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Yi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Xi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qi())&&(Ji(t,n),Yi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Zi=function(){var e=Xi();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qi=function(){var e=Zi();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},$i={left:0,top:0,right:0,gap:0},ea=function(e){return parseInt(e||``,10)||0},ta=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ea(n),ea(r),ea(i)]},na=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return $i;var t=ta(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ra=Qi(),ia=`data-scroll-locked`,aa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${ji} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${ia}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${ki} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${Ai} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${ki} .${ki} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${Ai} .${Ai} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${ia}] {
|
|
36
|
-
${Mi}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},oa=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},sa=function(){s.useEffect(function(){return document.body.setAttribute(ia,(oa()+1).toString()),function(){var e=oa()-1;e<=0?document.body.removeAttribute(ia):document.body.setAttribute(ia,e.toString())}},[])},ca=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;sa();var a=s.useMemo(function(){return na(i)},[i]);return s.createElement(ra,{styles:aa(a,!t,i,n?``:`!important`)})},la=!1;if(typeof window<`u`)try{var ua=Object.defineProperty({},"passive",{get:function(){return la=!0,!0}});window.addEventListener(`test`,ua,ua),window.removeEventListener(`test`,ua,ua)}catch{la=!1}var da=la?{passive:!1}:!1,fa=function(e){return e.tagName===`TEXTAREA`},pa=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!fa(e)&&n[t]===`visible`)},ma=function(e){return pa(e,`overflowY`)},ha=function(e){return pa(e,`overflowX`)},ga=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ya(e,r)){var i=ba(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_a=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},va=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ya=function(e,t){return e===`v`?ma(t):ha(t)},ba=function(e,t){return e===`v`?_a(t):va(t)},xa=function(e,t){return e===`h`&&t===`rtl`?-1:1},Sa=function(e,t,n,r,i){var a=xa(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=ba(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ya(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ca=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wa=function(e){return[e.deltaX,e.deltaY]},Ta=function(e){return e&&`current`in e?e.current:e},Ea=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Da=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},Oa=0,ka=[];function Aa(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState(Oa++)[0],a=s.useState(Qi)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Oi([e.lockRef.current],(e.shards||[]).map(Ta),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ca(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ga(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ga(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Sa(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(ka.length&&ka[ka.length-1]===a){var r=`deltaY`in n?wa(n):Ca(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ea(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(Ta).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ja(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=Ca(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,wa(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,Ca(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return ka.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,da),document.addEventListener(`touchmove`,l,da),document.addEventListener(`touchstart`,d,da),function(){ka=ka.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,da),document.removeEventListener(`touchmove`,l,da),document.removeEventListener(`touchstart`,d,da)}},[]);var m=e.removeScrollBar,h=e.inert;return s.createElement(s.Fragment,null,h?s.createElement(a,{styles:Da(i)}):null,m?s.createElement(ca,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ja(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ma=Hi(Ui,Aa),Na=s.forwardRef(function(e,t){return s.createElement(Gi,Z({},e,{ref:t,sideCar:Ma}))});Na.classNames=Gi.classNames;var Pa=Object.defineProperty,Q=(e,t)=>Pa(e,`name`,{value:t,configurable:!0}),Fa=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Ia=[` `,`Enter`],La=`Select`,[Ra,za,Ba]=se(La),[Va,Ha]=w(La,[Ba,Or]),Ua=Or(),[Wa,Ga]=Va(La),[Ka,qa]=Va(La);function Ja(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:h,internal_do_not_use_render:g}=e,_=Ua(t),[v,y]=s.useState(null),[x,S]=s.useState(null),[C,w]=s.useState(!1),T=xe(u),[E,D]=li({prop:r,defaultProp:i??!1,onChange:a,caller:La}),[O,k]=li({prop:o,defaultProp:c,onChange:l,caller:La}),A=s.useRef(null),j=s.useRef(O);s.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=Q(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,k]);let M=!v||!!h||!!v.closest(`form`),[N,P]=s.useState(new Set),F=ft(),I=Array.from(N).map(e=>e.props.value).join(`;`),L=s.useCallback(e=>{P(t=>new Set(t).add(e))},[]),R=s.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:m,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:F,value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:p,name:d,autoComplete:f,form:h,nativeOptions:N,nativeSelectKey:I,isFormControl:M};return(0,b.jsx)(Vr,{..._,children:(0,b.jsx)(Wa,{scope:t,...z,children:(0,b.jsx)(Ra.Provider,{scope:t,children:(0,b.jsx)(Ka,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:R,children:Oo(g)?g(z):n})})})})}Q(Ja,`SelectProvider`);var Ya=Q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,b.jsx)(Ja,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,b.jsxs)(b.Fragment,{children:[n,e?(0,b.jsx)(Do,{__scopeSelect:t}):null]})})},`Select`),Xa=`SelectTrigger`,Za=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Ua(n),o=Ga(Xa,n),c=o.disabled||r,l=A(t,o.onTriggerChange),u=za(n),d=s.useRef(`touch`),[f,p,m]=Ao(e=>{let t=u().filter(e=>!e.disabled),n=jo(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=Q(e=>{c||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,b.jsx)(Hr,{asChild:!0,...a,children:(0,b.jsx)(V.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:c,"data-disabled":c?``:void 0,"data-placeholder":ko(o.value)?``:void 0,...i,ref:l,onClick:h(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&g(e)}),onPointerDown:h(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:h(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&Fa.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),Qa=`SelectValue`,$a=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...c}=e,l=Ga(Qa,n),{onValueNodeHasChildrenChange:u}=l,d=a!==void 0,f=A(t,l.onValueNodeChange);K(()=>{u(d)},[u,d]);let p=ko(l.value);return(0,b.jsx)(V.span,{...c,asChild:!p&&c.asChild,ref:f,style:{pointerEvents:`none`},children:(0,b.jsx)(s.Fragment,{children:p?o:a},p?`placeholder`:`value`)})},`SelectValue`)),eo=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,b.jsx)(V.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[to,no]=Va(`SelectPortal`,{forceMount:void 0}),ro=Q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,b.jsx)(to,{scope:e.__scopeSelect,forceMount:n,children:(0,b.jsx)(Gr,{asChild:!0,...r})})},`SelectPortal`),io=`SelectContent`,ao=s.forwardRef(Q(function(e,t){let n=no(io,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=Ga(io,e.__scopeSelect),[o,c]=s.useState();return K(()=>{c(new DocumentFragment)},[]),(0,b.jsx)(Yr,{present:r||a.open,children:({present:e})=>e?(0,b.jsx)(uo,{...i,ref:t}):(0,b.jsx)(oo,{...i,fragment:o})})},`SelectContent`)),oo=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?c.createPortal((0,b.jsx)(so,{scope:n,children:(0,b.jsx)(Ra.Slot,{scope:n,children:(0,b.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),$=10,[so,co]=Va(io),lo=N(`SelectContent.RemoveScroll`),uo=s.forwardRef(Q(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,x=Ga(io,n),[S,C]=s.useState(null),[w,T]=s.useState(null),E=A(t,C),[D,O]=s.useState(null),[k,j]=s.useState(null),M=za(n),[N,P]=s.useState(!1),F=s.useRef(!1);s.useEffect(()=>{if(S)return Ei(S)},[S]),Ge();let I=s.useCallback(e=>{let[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,w]),L=s.useCallback(()=>I([D,S]),[I,D,S]);s.useEffect(()=>{N&&L()},[N,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=x;s.useEffect(()=>{if(S){let e={x:0,y:0},t=Q(t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},`handlePointerMove`),n=Q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(S)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null},`handlePointerUp`);return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[S,R,z]),s.useEffect(()=>{let e=Q(()=>R(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[ee,te]=Ao(e=>{let t=M().filter(e=>!e.disabled),n=jo(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=s.useCallback((e,t,n)=>{let r=!F.current&&!n;(x.value!==void 0&&x.value===t||r)&&(O(e),r&&(F.current=!0))},[x.value]),re=s.useCallback(()=>S?.focus(),[S]),ie=s.useCallback((e,t,n)=>{let r=!F.current&&!n;(x.value!==void 0&&x.value===t||r)&&j(e)},[x.value]),ae=r===`popper`?po:fo,oe=ae===po?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,b.jsx)(so,{scope:n,content:S,viewport:w,onViewportChange:T,itemRefCallback:ne,selectedItem:D,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:L,selectedItemText:k,position:r,isPositioned:N,searchRef:ee,children:(0,b.jsx)(Na,{as:lo,allowPinchZoom:!0,children:(0,b.jsx)(Ze,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:h(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,b.jsx)(Ne,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,b.jsx)(ae,{role:`listbox`,id:x.contentId,"data-state":x.open?`open`:`closed`,dir:x.dir,onContextMenu:e=>e.preventDefault(),...y,...oe,onPlaced:()=>P(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:h(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),fo=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=Ga(io,n),o=co(io,n),[c,l]=s.useState(null),[u,f]=s.useState(null),p=A(t,f),m=za(n),h=s.useRef(!1),g=s.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:x}=o,S=s.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-$,f=d(a,[$,Math.max($,u-l)]);c.style.minWidth=s+`px`,c.style.left=f+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-$,f=d(a,[$,Math.max($,u-l)]);c.style.minWidth=s+`px`,c.style.right=f+`px`}let o=m(),s=window.innerHeight-$*2,l=_.scrollHeight,f=window.getComputedStyle(u),p=parseInt(f.borderTopWidth,10),g=parseInt(f.paddingTop,10),b=parseInt(f.borderBottomWidth,10),x=parseInt(f.paddingBottom,10),S=p+g+l+x+b,C=Math.min(v.offsetHeight*5,S),w=window.getComputedStyle(_),T=parseInt(w.paddingTop,10),E=parseInt(w.paddingBottom,10),D=e.top+e.height/2-$,O=s-D,k=v.offsetHeight/2,A=v.offsetTop+k,j=p+g+A,M=S-j;if(j<=D){let e=o.length>0&&v===o[o.length-1].ref.current;c.style.bottom=`0px`;let t=u.clientHeight-_.offsetTop-_.offsetHeight,n=j+Math.max(O,k+(e?E:0)+t+b);c.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;c.style.top=`0px`;let t=Math.max(D,p+_.offsetTop+(e?T:0)+k)+M;c.style.height=t+`px`,_.scrollTop=j-D+_.offsetTop}c.style.margin=`${$}px 0`,c.style.minHeight=C+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,c,u,_,v,y,a.dir,r]);K(()=>S(),[S]);let[C,w]=s.useState();K(()=>{u&&w(window.getComputedStyle(u).zIndex)},[u]);let T=s.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]);return(0,b.jsx)(mo,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:(0,b.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,b.jsx)(V.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),po=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=$,...a}=e,o=Ua(n);return(0,b.jsx)(Ur,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[mo,ho]=Va(io,{}),go=`SelectViewport`,_o=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=co(go,n),o=ho(go,n),c=A(t,a.onViewportChange),l=s.useRef(0);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,b.jsx)(Ra.Slot,{scope:n,children:(0,b.jsx)(V.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:c,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:h(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(l.current-t.scrollTop);if(e>0){let r=window.innerHeight-$*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}l.current=t.scrollTop})})})]})},`SelectViewport`)),[vo,yo]=Va(`SelectGroup`),bo=`SelectItem`,[xo,So]=Va(bo),Co=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=Ga(bo,n),l=co(bo,n),u=c.value===r,[d,f]=s.useState(a??``),[p,m]=s.useState(!1),g=A(t,H(e=>l.itemRefCallback?.(e,r,i))),_=ft(),v=s.useRef(`touch`),y=Q(()=>{i||(c.onValueChange(r),c.onOpenChange(!1))},`handleSelect`);return(0,b.jsx)(xo,{scope:n,value:r,disabled:i,textId:_,isSelected:u,onItemTextChange:s.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,b.jsx)(Ra.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:(0,b.jsx)(V.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":u&&p,"data-state":u?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:h(o.onFocus,()=>m(!0)),onBlur:h(o.onBlur,()=>m(!1)),onClick:h(o.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:h(o.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:h(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:h(o.onPointerMove,e=>{v.current=e.pointerType,i?l.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:h(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:h(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(l.searchRef?.current===``||e.key!==` `)&&(Ia.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),wo=`SelectItemIndicator`,To=s.forwardRef(Q(function(e,t){let{__scopeSelect:n,...r}=e;return So(wo,n).isSelected?(0,b.jsx)(V.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Eo=`SelectBubbleInput`,Do=s.forwardRef(Q(function({__scopeSelect:e,...t},n){let r=Ga(Eo,e),{value:i,onValueChange:a,required:o,disabled:c,name:l,autoComplete:u,form:d}=r,{nativeOptions:f,nativeSelectKey:p}=r,m=s.useRef(null),h=A(n,m),g=i??``,_=gi(g),v=Array.from(f).some(e=>(e.props.value??``)===``);return s.useEffect(()=>{let e=m.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,b.jsxs)(V.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:l,autoComplete:u,disabled:c,form:d,onChange:e=>a(e.target.value),...t,style:{..._i,...t.style},ref:h,defaultValue:g,children:[ko(i)&&!v?(0,b.jsx)(`option`,{value:``}):null,Array.from(f)]},p)},`SelectBubbleInput`));function Oo(e){return typeof e==`function`}Q(Oo,`isFunction`);function ko(e){return e===``||e===void 0}Q(ko,`shouldShowPlaceholder`);function Ao(e){let t=H(e),n=s.useRef(``),r=s.useRef(0),i=s.useCallback(e=>{let i=n.current+e;t(i),Q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=s.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Q(Ao,`useTypeaheadSearch`);function jo(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Mo(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Q(jo,`findNextItem`);function Mo(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Q(Mo,`wrapArray`);function No({label:e,hint:t,error:n,htmlFor:r,children:i}){return(0,b.jsxs)(`div`,{className:`form-group`,children:[e?(0,b.jsxs)(`label`,{className:`form-label`,htmlFor:r,children:[e,t?(0,b.jsx)(`span`,{className:`form-hint`,children:t}):null]}):null,i,n?(0,b.jsx)(`p`,{className:`form-error`,role:`alert`,children:n}):null]})}var Po={sm:`h-15`,md:`h-18`,lg:`h-22`};function Fo(e){return e===``?void 0:e}function Io(e,t=[]){return e!==``||t.some(e=>e.value===``)}function Lo({value:e,onValueChange:t,options:n,placeholder:r=`Select…`,label:s,"aria-label":c,disabled:l,id:u,style:d,className:f=``,size:p=`md`,error:m}){let h=Fo(e),g=e=>{Io(e,n)&&t?.(e)},_=n.find(t=>t.value===e)?.label,v=(0,b.jsxs)(Ya,{value:h,onValueChange:g,disabled:l,children:[(0,b.jsxs)(Za,{id:u,"aria-label":c??s,className:a(`radix-select-trigger inline-flex items-center justify-between gap-4 w-full px-6 rounded-control border border-inner-border bg-surface-2 text-text-primary text-caption font-sans text-left cursor-pointer transition-[border-color,background-color] duration-150 ease-spring hover:border-border-strong focus-visible:outline-2 focus-visible:outline-focus-ring focus-visible:outline-offset-1 aria-disabled:opacity-70 aria-disabled:cursor-default aria-disabled:pointer-events-none [&_svg]:text-text-tertiary [&_svg]:transition-transform [&_svg]:duration-150 [&_svg]:ease-spring data-[state=open]:[&_svg]:rotate-180`,Po[p],f),style:{...d,opacity:l?.6:1,cursor:l?`not-allowed`:`pointer`},children:[(0,b.jsx)($a,{placeholder:r,asChild:!0,children:(0,b.jsx)(`span`,{children:_??r})}),(0,b.jsx)(eo,{asChild:!0,children:(0,b.jsx)(o,{size:14})})]}),(0,b.jsx)(ro,{children:(0,b.jsx)(ao,{position:`popper`,sideOffset:4,className:`radix-select-content z-toast min-w-[var(--radix-select-trigger-width)] max-h-140 max-h-[var(--radix-select-content-available-height)] overflow-hidden overflow-y-auto border border-border-strong rounded-card bg-popover-bg shadow-popout backdrop-blur-xl p-2.5 box-border`,children:(0,b.jsx)(_o,{children:n.map(e=>(0,b.jsxs)(Co,{value:e.value,disabled:e.disabled,className:`radix-select-item flex items-center justify-between gap-4 px-5 py-4 rounded-control text-caption font-medium text-text-primary cursor-pointer outline-none transition-colors duration-150 select-none data-[highlighted]:bg-surface-hover data-[state=checked]:font-semibold data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed`,textValue:e.label,children:[(0,b.jsx)(`span`,{children:e.label}),(0,b.jsx)(To,{className:`radix-select-indicator inline-flex items-center text-accent`,children:(0,b.jsx)(i,{size:14})})]},e.value))})})})]});return s?(0,b.jsx)(No,{label:s,error:m,htmlFor:u,children:v}):v}export{Lo as t};
|
|
Binary file
|