machinaos 0.0.76 → 0.0.78
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/README.md +143 -107
- package/client/dist/assets/ActionBar-Du2MSFSz.js +1 -0
- package/client/dist/assets/ApiKeyInput-k2LBmBjb.js +1 -0
- package/client/dist/assets/ApiKeyPanel-C_bV9U0X.js +1 -0
- package/client/dist/assets/ApiUsageSection-CmVfwZzL.js +1 -0
- package/client/dist/assets/EmailPanel-CeKIMGu-.js +1 -0
- package/client/dist/assets/OAuthPanel-KA3t3Q2K.js +1 -0
- package/client/dist/assets/QrPairingPanel-NgNpJNuk.js +1 -0
- package/client/dist/assets/RateLimitSection-Du5YNVIA.js +1 -0
- package/client/dist/assets/StatusCard-DNLyayXc.js +1 -0
- package/client/dist/assets/index-DQ0nwhec.js +257 -0
- package/client/dist/assets/index-DxmbVskS.css +1 -0
- package/client/dist/assets/vendor-flow-CZmBvHRo.js +1 -0
- package/client/dist/assets/vendor-icons-CVrPjN2Q.js +22 -0
- package/client/dist/assets/vendor-markdown-CRou3yQ5.js +62 -0
- package/client/dist/assets/vendor-misc-C4VxKHs5.js +1 -0
- package/client/dist/assets/vendor-query-SzWcOU0G.js +1 -0
- package/client/dist/assets/vendor-radix-Dnos29jG.js +56 -0
- package/client/dist/assets/vendor-react-DvWIbVx0.js +1 -0
- package/client/dist/index.html +37 -3
- package/client/index.html +28 -1
- package/client/package.json +44 -40
- package/client/src/App.tsx +2 -0
- package/client/src/Dashboard.tsx +157 -45
- package/client/src/ParameterPanel.tsx +3 -5
- package/client/src/adapters/nodeSpecToDescription.ts +1 -0
- package/client/src/assets/icons/NodeIcon.tsx +32 -0
- package/client/src/assets/icons/index.ts +4 -0
- package/client/src/assets/icons/stripe.svg +1 -0
- package/client/src/assets/icons/themedGlyphs.ts +404 -0
- package/client/src/components/AIAgentNode.tsx +77 -53
- package/client/src/components/GenericNode.tsx +34 -52
- package/client/src/components/OutputPanel.tsx +64 -147
- package/client/src/components/ParameterRenderer.tsx +5 -3
- package/client/src/components/SkillEditorModal.tsx +9 -18
- package/client/src/components/SquareNode.tsx +97 -115
- package/client/src/components/StartNode.tsx +32 -42
- package/client/src/components/SvgFilterDefs.tsx +54 -0
- package/client/src/components/TeamMonitorNode.tsx +12 -14
- package/client/src/components/ToolkitNode.tsx +35 -60
- package/client/src/components/TriggerNode.tsx +43 -77
- package/client/src/components/__tests__/CredentialsModal.test.tsx +49 -45
- package/client/src/components/credentials/CredentialsModal.tsx +98 -30
- package/client/src/components/credentials/CredentialsPalette.tsx +73 -5
- package/client/src/components/credentials/catalogueAdapter.ts +17 -1
- package/client/src/components/credentials/panels/ApiKeyPanel.tsx +102 -37
- package/client/src/components/credentials/panels/EmailPanel.tsx +7 -19
- package/client/src/components/credentials/panels/OAuthPanel.tsx +5 -1
- package/client/src/components/credentials/panels/QrPairingPanel.tsx +1 -3
- package/client/src/components/credentials/primitives/ActionBar.tsx +7 -11
- package/client/src/components/credentials/primitives/OAuthConnect.tsx +19 -28
- package/client/src/components/credentials/sections/ProviderDefaultsSection.tsx +24 -3
- package/client/src/components/credentials/types.ts +12 -2
- package/client/src/components/credentials/useCredentialPanel.ts +43 -19
- package/client/src/components/icons/AIProviderIcons.tsx +16 -0
- package/client/src/components/onboarding/OnboardingWizard.tsx +23 -63
- package/client/src/components/onboarding/nodeRoleClasses.ts +23 -0
- package/client/src/components/onboarding/steps/CanvasStep.tsx +15 -21
- package/client/src/components/onboarding/steps/ConceptsStep.tsx +2 -11
- package/client/src/components/onboarding/steps/GetStartedStep.tsx +2 -10
- package/client/src/components/parameterPanel/InputSection.tsx +9 -7
- package/client/src/components/parameterPanel/MasterSkillEditor.tsx +84 -198
- package/client/src/components/parameterPanel/MiddleSection.tsx +57 -80
- package/client/src/components/parameterPanel/ToolSchemaEditor.tsx +31 -25
- package/client/src/components/parameterPanel/__tests__/InputSection.test.tsx +7 -2
- package/client/src/components/ui/AIResultModal.tsx +1 -1
- package/client/src/components/ui/CollapsibleSection.tsx +9 -5
- package/client/src/components/ui/CommandPalette.tsx +147 -0
- package/client/src/components/ui/CommandPaletteHost.tsx +189 -0
- package/client/src/components/ui/ComponentItem.tsx +13 -7
- package/client/src/components/ui/ComponentPalette.tsx +24 -13
- package/client/src/components/ui/ConsolePanel.tsx +19 -11
- package/client/src/components/ui/DropCap.tsx +28 -0
- package/client/src/components/ui/EditableNodeLabel.tsx +10 -2
- package/client/src/components/ui/InputNodesPanel.tsx +1 -1
- package/client/src/components/ui/Modal.tsx +38 -6
- package/client/src/components/ui/OutputDisplayPanel.tsx +1 -1
- package/client/src/components/ui/SettingsPanel.tsx +42 -13
- package/client/src/components/ui/StatusBar.tsx +108 -0
- package/client/src/components/ui/ThemeSwitcher.tsx +109 -0
- package/client/src/components/ui/TopToolbar.tsx +42 -25
- package/client/src/components/ui/WorkflowSidebar.tsx +32 -16
- package/client/src/components/ui/action-button.tsx +40 -15
- package/client/src/components/ui/button.tsx +24 -1
- package/client/src/components/ui/dropdown-menu.tsx +24 -2
- package/client/src/components/ui/input.tsx +19 -2
- package/client/src/components/ui/select.tsx +15 -0
- package/client/src/components/ui/textarea.tsx +15 -2
- package/client/src/contexts/AuthContext.tsx +148 -109
- package/client/src/contexts/ThemeContext.tsx +93 -17
- package/client/src/contexts/WebSocketContext.tsx +373 -206
- package/client/src/contexts/__tests__/AuthContext.test.tsx +221 -0
- package/client/src/hooks/__tests__/useDragVariable.test.ts +7 -1
- package/client/src/hooks/__tests__/useWorkflowOpsListener.test.ts +142 -0
- package/client/src/hooks/useAppTheme.ts +209 -7
- package/client/src/hooks/useAutoSkillEdges.ts +7 -2
- package/client/src/hooks/useCatalogueQuery.ts +67 -1
- package/client/src/hooks/useDragVariable.ts +1 -1
- package/client/src/hooks/useNodeAllowlist.ts +115 -8
- package/client/src/hooks/useOnboarding.ts +20 -8
- package/client/src/hooks/useParameterPanel.ts +2 -1
- package/client/src/hooks/useReactFlowNodes.ts +2 -1
- package/client/src/hooks/useSound.ts +185 -0
- package/client/src/hooks/useWorkflowManagement.ts +6 -8
- package/client/src/hooks/useWorkflowOpsListener.ts +90 -0
- package/client/src/index.css +65 -3
- package/client/src/lib/__tests__/connectionConfig.test.ts +91 -0
- package/client/src/lib/aiModelProviders.ts +8 -0
- package/client/src/lib/connectionConfig.ts +107 -0
- package/client/src/lib/queryPersist.ts +13 -5
- package/client/src/lib/sound.ts +393 -0
- package/client/src/main.tsx +20 -0
- package/client/src/store/useAppStore.ts +26 -0
- package/client/src/styles/canvasAnimations.ts +37 -36
- package/client/src/styles/theme.ts +36 -20
- package/client/src/test/setup.ts +1 -0
- package/client/src/themes/atomic.css +253 -0
- package/client/src/themes/base.css +373 -0
- package/client/src/themes/cyber.css +890 -0
- package/client/src/themes/dark.css +70 -0
- package/client/src/themes/edo.css +246 -0
- package/client/src/themes/greek.css +293 -0
- package/client/src/themes/light.css +78 -0
- package/client/src/themes/plague.css +253 -0
- package/client/src/themes/renaissance.css +727 -0
- package/client/src/themes/rot.css +249 -0
- package/client/src/themes/steampunk.css +272 -0
- package/client/src/themes/surveillance.css +289 -0
- package/client/src/themes/wasteland.css +250 -0
- package/client/src/types/INodeProperties.ts +5 -0
- package/client/src/types/NodeTypes.ts +11 -1
- package/client/src/types/__tests__/cloudEvents.test.ts +99 -0
- package/client/src/types/cloudEvents.ts +78 -0
- package/client/src/vite-env.d.ts +7 -0
- package/client/tsconfig.json +1 -1
- package/client/vite.config.js +62 -2
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/machina/commands/build.py +51 -7
- package/machina/pyproject.toml +4 -0
- package/machina/supervisor.py +12 -2
- package/machina/tree.py +71 -21
- package/package.json +4 -4
- package/scripts/install.js +16 -1
- package/server/config/ai_cli_providers.json +54 -0
- package/server/config/credential_providers.json +109 -2
- package/server/config/llm_defaults.json +24 -0
- package/server/config/model_registry.json +338 -499
- package/server/config/node_allowlist.json +16 -1
- package/server/config/pricing.json +8 -0
- package/server/constants.py +38 -15
- package/server/core/container.py +2 -2
- package/server/core/credentials_database.py +35 -2
- package/server/core/logging.py +4 -3
- package/server/main.py +99 -13
- package/server/models/node_metadata.py +1 -0
- package/server/nodejs/package.json +8 -6
- package/server/nodejs/src/index.ts +22 -5
- package/server/nodes/README.md +31 -4
- package/server/nodes/agent/_inline.py +2 -0
- package/server/nodes/agent/_specialized.py +6 -3
- package/server/nodes/agent/ai_agent.py +13 -3
- package/server/nodes/agent/chat_agent.py +6 -3
- package/server/nodes/agent/claude_code_agent.py +287 -75
- package/server/nodes/agent/codex_agent.py +239 -0
- package/server/nodes/agent/deep_agent.py +3 -3
- package/server/nodes/agent/rlm_agent.py +3 -3
- package/server/nodes/android/__init__.py +31 -1
- package/server/nodes/android/_base.py +9 -5
- package/server/{services/android_service.py → nodes/android/_dispatcher.py} +2 -2
- package/server/nodes/android/_handlers.py +154 -0
- package/server/nodes/android/_option_loaders.py +44 -0
- package/server/nodes/android/_refresh.py +127 -0
- package/server/{services/android → nodes/android/_relay}/client.py +4 -4
- package/server/{routers/android.py → nodes/android/_router.py} +27 -8
- package/server/nodes/browser/browser.py +2 -2
- package/server/nodes/code/_base.py +6 -2
- package/server/nodes/code/_claude_code.py +134 -0
- package/server/nodes/document/embedding_generator.py +3 -3
- package/server/nodes/document/http_scraper.py +3 -3
- package/server/nodes/document/vector_store.py +5 -5
- package/server/nodes/email/__init__.py +11 -1
- package/server/nodes/email/_filters.py +21 -0
- package/server/{services/himalaya_service.py → nodes/email/_himalaya.py} +6 -10
- package/server/{services/email_service.py → nodes/email/_service.py} +9 -13
- package/server/nodes/email/email_read.py +1 -1
- package/server/nodes/email/email_receive.py +54 -5
- package/server/nodes/email/email_send.py +1 -1
- package/server/nodes/filesystem/shell.py +24 -1
- package/server/nodes/google/__init__.py +55 -1
- package/server/{services/handlers/google_auth.py → nodes/google/_auth_helper.py} +8 -5
- package/server/nodes/google/_base.py +2 -2
- package/server/nodes/google/_credentials.py +5 -5
- package/server/nodes/google/_filters.py +25 -0
- package/server/nodes/google/_handlers.py +57 -0
- package/server/{services/google_oauth.py → nodes/google/_oauth.py} +195 -162
- package/server/nodes/google/_option_loaders.py +107 -0
- package/server/nodes/google/_refresh.py +66 -0
- package/server/nodes/google/_router.py +131 -0
- package/server/nodes/google/gmail_receive.py +41 -4
- package/server/nodes/groups.py +1 -0
- package/server/nodes/location/_credentials.py +45 -1
- package/server/{services/maps.py → nodes/location/_service.py} +18 -3
- package/server/nodes/location/gmaps_create.py +4 -4
- package/server/nodes/location/gmaps_locations.py +4 -4
- package/server/nodes/location/gmaps_nearby_places.py +4 -4
- package/server/nodes/model/_base.py +8 -3
- package/server/nodes/model/_credentials.py +96 -8
- package/server/nodes/model/_local_validator.py +345 -0
- package/server/nodes/model/lmstudio_chat_model.py +23 -0
- package/server/nodes/model/ollama_chat_model.py +25 -0
- package/server/nodes/proxy/_usage.py +2 -2
- package/server/nodes/proxy/proxy_config.py +14 -14
- package/server/nodes/proxy/proxy_request.py +4 -4
- package/server/nodes/scraper/_credentials.py +29 -1
- package/server/nodes/scraper/apify_actor.py +9 -9
- package/server/nodes/scraper/crawlee_scraper.py +5 -5
- package/server/nodes/search/brave_search.py +4 -0
- package/server/nodes/search/perplexity_search.py +9 -0
- package/server/nodes/search/serper_search.py +3 -0
- package/server/nodes/skill/simple_memory.py +12 -0
- package/server/nodes/social/_base.py +2 -2
- package/server/nodes/stripe/__init__.py +46 -0
- package/server/nodes/stripe/_credentials.py +33 -0
- package/server/nodes/stripe/_handlers.py +270 -0
- package/server/nodes/stripe/_install.py +127 -0
- package/server/nodes/stripe/_source.py +174 -0
- package/server/nodes/stripe/stripe_action.py +81 -0
- package/server/nodes/stripe/stripe_receive.py +92 -0
- package/server/nodes/telegram/_credentials.py +52 -1
- package/server/nodes/telegram/_handlers.py +19 -18
- package/server/nodes/telegram/_service.py +134 -32
- package/server/nodes/telegram/telegram_send.py +5 -6
- package/server/nodes/text/file_handler.py +2 -2
- package/server/nodes/text/text_generator.py +2 -2
- package/server/nodes/tool/agent_builder.py +630 -0
- package/server/nodes/tool/task_manager.py +144 -2
- package/server/nodes/twitter/__init__.py +38 -1
- package/server/nodes/twitter/_base.py +7 -7
- package/server/nodes/twitter/_credentials.py +1 -1
- package/server/nodes/twitter/_filters.py +37 -0
- package/server/nodes/twitter/_handlers.py +77 -0
- package/server/nodes/twitter/_oauth.py +124 -0
- package/server/nodes/twitter/_refresh.py +78 -0
- package/server/nodes/twitter/_router.py +29 -0
- package/server/nodes/twitter/twitter_receive.py +4 -0
- package/server/nodes/visuals.json +64 -19
- package/server/nodes/whatsapp/__init__.py +45 -5
- package/server/nodes/whatsapp/_base.py +3 -3
- package/server/nodes/whatsapp/_filters.py +137 -0
- package/server/nodes/whatsapp/_handlers.py +167 -0
- package/server/nodes/whatsapp/_option_loaders.py +68 -0
- package/server/nodes/whatsapp/_refresh.py +62 -0
- package/server/nodes/whatsapp/_runtime.py +1 -1
- package/server/pyproject.toml +29 -7
- package/server/routers/schemas.py +2 -2
- package/server/routers/webhook.py +26 -9
- package/server/routers/websocket.py +149 -810
- package/server/services/ai.py +89 -8
- package/server/services/auth.py +220 -43
- package/server/services/claude_oauth.py +126 -100
- package/server/services/cli_agent/__init__.py +78 -0
- package/server/services/cli_agent/_handlers.py +237 -0
- package/server/services/cli_agent/config.py +112 -0
- package/server/services/cli_agent/factory.py +48 -0
- package/server/services/cli_agent/lockfile.py +141 -0
- package/server/services/cli_agent/mcp_server.py +482 -0
- package/server/services/cli_agent/protocol.py +173 -0
- package/server/services/cli_agent/providers/__init__.py +9 -0
- package/server/services/cli_agent/providers/anthropic_claude.py +419 -0
- package/server/services/cli_agent/providers/google_gemini.py +80 -0
- package/server/services/cli_agent/providers/openai_codex.py +310 -0
- package/server/services/cli_agent/service.py +607 -0
- package/server/services/cli_agent/session.py +618 -0
- package/server/services/cli_agent/types.py +227 -0
- package/server/services/cli_agent/workflow_tools.py +233 -0
- package/server/services/credential_registry.py +26 -1
- package/server/services/deployment/manager.py +26 -145
- package/server/services/deployment/poll_registry.py +59 -0
- package/server/services/event_waiter.py +76 -246
- package/server/services/events/__init__.py +54 -0
- package/server/services/events/cli.py +78 -0
- package/server/services/events/daemon.py +163 -0
- package/server/services/events/envelope.py +281 -0
- package/server/services/events/lifecycle.py +99 -0
- package/server/services/events/oauth_lifecycle.py +534 -0
- package/server/services/events/polling.py +60 -0
- package/server/services/events/push.py +36 -0
- package/server/services/events/source.py +63 -0
- package/server/services/events/triggers.py +118 -0
- package/server/services/events/verifiers/__init__.py +25 -0
- package/server/services/events/verifiers/base.py +28 -0
- package/server/services/events/verifiers/github.py +25 -0
- package/server/services/events/verifiers/hmac_basic.py +32 -0
- package/server/services/events/verifiers/standard_webhooks.py +47 -0
- package/server/services/events/verifiers/stripe.py +42 -0
- package/server/services/events/webhook.py +105 -0
- package/server/services/handlers/tools.py +28 -186
- package/server/services/llm/config.py +7 -0
- package/server/services/llm/factory.py +8 -2
- package/server/services/memory/__init__.py +52 -0
- package/server/services/memory/jsonl.py +80 -0
- package/server/services/memory/markdown.py +65 -0
- package/server/services/memory/state.py +112 -0
- package/server/services/memory/vector_store.py +40 -0
- package/server/services/model_registry.py +76 -0
- package/server/services/node_allowlist.py +71 -15
- package/server/services/node_executor.py +2 -2
- package/server/services/node_output_schemas.py +21 -10
- package/server/services/node_spec.py +1 -1
- package/server/services/oauth_utils.py +1 -1
- package/server/services/plugin/__init__.py +2 -0
- package/server/services/plugin/base.py +44 -2
- package/server/services/plugin/credential.py +288 -1
- package/server/services/plugin/deps.py +105 -0
- package/server/services/plugin/edge_walker.py +12 -4
- package/server/services/plugin/oauth.py +381 -0
- package/server/services/plugin/polling.py +247 -0
- package/server/services/plugin/registry.py +145 -0
- package/server/services/plugin/singleton.py +65 -0
- package/server/services/plugin/ws.py +81 -0
- package/server/services/process_service.py +31 -2
- package/server/services/status_broadcaster.py +155 -238
- package/server/services/temporal/workflow.py +7 -7
- package/server/services/workflow.py +21 -3
- package/server/services/ws_handler_registry.py +111 -28
- package/server/skills/GUIDE.md +16 -1
- package/server/skills/assistant/agent-builder-skill/SKILL.md +166 -0
- package/server/skills/payments_agent/stripe-skill/SKILL.md +306 -0
- package/server/tests/credentials/test_auth_service.py +16 -9
- package/server/tests/credentials/test_credential_broadcasts.py +219 -0
- package/server/tests/credentials/test_google_oauth.py +6 -6
- package/server/tests/credentials/test_oauth_utils.py +1 -1
- package/server/tests/credentials/test_twitter_oauth.py +2 -2
- package/server/tests/credentials/test_websocket_handlers.py +44 -20
- package/server/tests/llm/test_factory.py +1 -0
- package/server/tests/llm/test_wiring.py +5 -1
- package/server/tests/nodes/_compat.py +24 -24
- package/server/tests/nodes/test_agent_builder.py +439 -0
- package/server/tests/nodes/test_ai_tools.py +18 -14
- package/server/tests/nodes/test_code_fs_process.py +17 -8
- package/server/tests/nodes/test_email.py +10 -9
- package/server/tests/nodes/test_google_workspace.py +2 -2
- package/server/tests/nodes/test_specialized_agents.py +100 -53
- package/server/tests/nodes/test_stripe_plugin.py +293 -0
- package/server/tests/nodes/test_telegram_social.py +4 -4
- package/server/tests/nodes/test_twitter.py +1 -1
- package/server/tests/nodes/test_web_automation.py +2 -2
- package/server/tests/nodes/test_whatsapp.py +9 -9
- package/server/tests/services/cli_agent/__init__.py +0 -0
- package/server/tests/services/cli_agent/test_mcp_server.py +432 -0
- package/server/tests/services/cli_agent/test_providers.py +358 -0
- package/server/tests/services/cli_agent/test_service.py +298 -0
- package/server/tests/services/memory/__init__.py +0 -0
- package/server/tests/services/memory/test_jsonl.py +188 -0
- package/server/tests/services/test_events.py +333 -0
- package/server/tests/test_node_spec.py +56 -16
- package/server/tests/test_plugin_helpers.py +116 -0
- package/server/tests/test_plugin_self_containment.py +486 -0
- package/server/tests/test_status_broadcasts.py +425 -0
- package/workflows/{AI Assistant_workflow-1777421105154-0m4snkzjf.json → AI Assistant_workflow-1778504793388-ou1m1tz2x.json } +70 -266
- package/workflows/{AI Employee_workflow-1777720598005-u4cm858dv.json → AI Employee_example_workflow-1777720598005-u4cm858dv.json } +112 -112
- package/workflows/Claude Assistant_workflow-1778380124051-mdibn807c.json +709 -0
- package/client/dist/assets/ActionBar-vzPpSR77.js +0 -1
- package/client/dist/assets/ApiKeyInput-Ds7AKFe8.js +0 -1
- package/client/dist/assets/ApiKeyPanel-gfblELep.js +0 -1
- package/client/dist/assets/ApiUsageSection-BMNWTe2r.js +0 -1
- package/client/dist/assets/EmailPanel-B1Om64p5.js +0 -1
- package/client/dist/assets/OAuthPanel-CXyQYGBz.js +0 -1
- package/client/dist/assets/QrPairingPanel-BgNuI1we.js +0 -1
- package/client/dist/assets/RateLimitSection-YYK8sx1T.js +0 -1
- package/client/dist/assets/StatusCard-DuYA5hJR.js +0 -1
- package/client/dist/assets/index-D9tZfgvi.js +0 -363
- package/client/dist/assets/index-al7snTkG.css +0 -1
- package/client/src/components/credentials/providers.tsx +0 -177
- package/server/routers/google.py +0 -277
- package/server/routers/maps.py +0 -142
- package/server/routers/twitter.py +0 -365
- package/server/services/claude_code_service.py +0 -106
- package/server/services/memory.py +0 -159
- package/server/services/node_option_loaders/__init__.py +0 -77
- package/server/services/node_option_loaders/android_loaders.py +0 -55
- package/server/services/node_option_loaders/google_loaders.py +0 -97
- package/server/services/node_option_loaders/whatsapp_loaders.py +0 -69
- package/server/services/twitter_oauth.py +0 -411
- package/server/services/websocket_client.py +0 -29
- /package/server/{services/android → nodes/android/_relay}/__init__.py +0 -0
- /package/server/{services/android → nodes/android/_relay}/broadcaster.py +0 -0
- /package/server/{services/android → nodes/android/_relay}/manager.py +0 -0
- /package/server/{services/android → nodes/android/_relay}/protocol.py +0 -0
- /package/server/{services/browser_service.py → nodes/browser/_service.py} +0 -0
- /package/server/{services/whatsapp_service.py → nodes/whatsapp/_service.py} +0 -0
- /package/server/skills/{task_agent → assistant}/write-todos-skill/SKILL.md +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import{a,j as p,R as z,b as Bn}from"./vendor-query-SzWcOU0G.js";import{r as jt,S as Aa}from"./vendor-flow-CZmBvHRo.js";function Ro(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function st(...e){return t=>{let n=!1;const o=e.map(r=>{const s=Ro(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():Ro(e[r],null)}}}}function k(...e){return a.useCallback(st(...e),e)}function Ne(e){const t=_a(e),n=a.forwardRef((o,r)=>{const{children:s,...i}=o,c=a.Children.toArray(s),l=c.find(Ta);if(l){const u=l.props.children,f=c.map(d=>d===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...i,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,f):null})}return p.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var $p=Ne("Slot");function _a(e){const t=a.forwardRef((n,o)=>{const{children:r,...s}=n;if(a.isValidElement(r)){const i=Ia(r),c=Ma(s,r.props);return r.type!==a.Fragment&&(c.ref=o?st(o,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qo=Symbol("radix.slottable");function Jo(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Qo,t}function Ta(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qo}function Ma(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Ia(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)}var Da=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],I=Da.reduce((e,t)=>{const n=Ne(`Primitive.${t}`),o=a.forwardRef((r,s)=>{const{asChild:i,...c}=r,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function er(e,t){e&&jt.flushSync(()=>e.dispatchEvent(t))}var tr=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"}),Na="VisuallyHidden",nr=a.forwardRef((e,t)=>p.jsx(I.span,{...e,ref:t,style:{...tr,...e.style}}));nr.displayName=Na;var Oa=nr;function ka(e,t){const n=a.createContext(t),o=s=>{const{children:i,...c}=s,l=a.useMemo(()=>c,Object.values(c));return p.jsx(n.Provider,{value:l,children:i})};o.displayName=e+"Provider";function r(s){const i=a.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function Z(e,t=[]){let n=[];function o(s,i){const c=a.createContext(i),l=n.length;n=[...n,i];const u=d=>{const{scope:h,children:v,...x}=d,m=h?.[e]?.[l]||c,g=a.useMemo(()=>x,Object.values(x));return p.jsx(m.Provider,{value:g,children:v})};u.displayName=s+"Provider";function f(d,h){const v=h?.[e]?.[l]||c,x=a.useContext(v);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const r=()=>{const s=n.map(i=>a.createContext(i));return function(c){const l=c?.[e]||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,ja(r,...t)]}function ja(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=o.reduce((c,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...c,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function it(e){const t=e+"CollectionProvider",[n,o]=Z(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:g,children:w}=m,y=z.useRef(null),C=z.useRef(new Map).current;return p.jsx(r,{scope:g,itemMap:C,collectionRef:y,children:w})};i.displayName=t;const c=e+"CollectionSlot",l=Ne(c),u=z.forwardRef((m,g)=>{const{scope:w,children:y}=m,C=s(c,w),b=k(g,C.collectionRef);return p.jsx(l,{ref:b,children:y})});u.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",h=Ne(f),v=z.forwardRef((m,g)=>{const{scope:w,children:y,...C}=m,b=z.useRef(null),S=k(g,b),P=s(f,w);return z.useEffect(()=>(P.itemMap.set(b,{ref:b,...C}),()=>{P.itemMap.delete(b)})),p.jsx(h,{[d]:"",ref:S,children:y})});v.displayName=f;function x(m){const g=s(e+"CollectionConsumer",m);return z.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const C=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((P,E)=>C.indexOf(P.ref.current)-C.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:i,Slot:u,ItemSlot:v},x,o]}function R(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var Y=globalThis?.document?a.useLayoutEffect:()=>{},La=Bn[" useInsertionEffect ".trim().toString()]||Y;function ie({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,i]=Fa({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const d=f.current;d!==c&&console.warn(`${o} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,o])}const u=a.useCallback(f=>{if(c){const d=$a(f)?f(e):f;d!==e&&i.current?.(d)}else s(f)},[c,e,s,i]);return[l,u]}function Fa({defaultProp:e,onChange:t}){const[n,o]=a.useState(e),r=a.useRef(n),s=a.useRef(t);return La(()=>{s.current=t},[t]),a.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function $a(e){return typeof e=="function"}function Ba(e,t){return a.useReducer((n,o)=>t[n][o]??n,e)}var ae=e=>{const{present:t,children:n}=e,o=Va(t),r=typeof n=="function"?n({present:o.isPresent}):a.Children.only(n),s=k(o.ref,Ha(r));return typeof n=="function"||o.isPresent?a.cloneElement(r,{ref:s}):null};ae.displayName="Presence";function Va(e){const[t,n]=a.useState(),o=a.useRef(null),r=a.useRef(e),s=a.useRef("none"),i=e?"mounted":"unmounted",[c,l]=Ba(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=ht(o.current);s.current=c==="mounted"?u:"none"},[c]),Y(()=>{const u=o.current,f=r.current;if(f!==e){const h=s.current,v=ht(u);e?l("MOUNT"):v==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&h!==v?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),Y(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=v=>{const m=ht(o.current).includes(CSS.escape(v.animationName));if(v.target===t&&m&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=v=>{v.target===t&&(s.current=ht(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function ht(e){return e?.animationName||"none"}function Ha(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)}var Wa=Bn[" useId ".trim().toString()]||(()=>{}),Ka=0;function re(e){const[t,n]=a.useState(Wa());return Y(()=>{n(o=>o??String(Ka++))},[e]),e||(t?`radix-${t}`:"")}var Lt="Collapsible",[Ua,or]=Z(Lt),[Ga,Vn]=Ua(Lt),rr=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:s,onOpenChange:i,...c}=e,[l,u]=ie({prop:o,defaultProp:r??!1,onChange:i,caller:Lt});return p.jsx(Ga,{scope:n,disabled:s,contentId:re(),open:l,onOpenToggle:a.useCallback(()=>u(f=>!f),[u]),children:p.jsx(I.div,{"data-state":Wn(l),"data-disabled":s?"":void 0,...c,ref:t})})});rr.displayName=Lt;var sr="CollapsibleTrigger",ir=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=Vn(sr,n);return p.jsx(I.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Wn(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:R(e.onClick,r.onOpenToggle)})});ir.displayName=sr;var Hn="CollapsibleContent",ar=a.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Vn(Hn,e.__scopeCollapsible);return p.jsx(ae,{present:n||r.open,children:({present:s})=>p.jsx(za,{...o,ref:t,present:s})})});ar.displayName=Hn;var za=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...s}=e,i=Vn(Hn,n),[c,l]=a.useState(o),u=a.useRef(null),f=k(t,u),d=a.useRef(0),h=d.current,v=a.useRef(0),x=v.current,m=i.open||c,g=a.useRef(m),w=a.useRef(void 0);return a.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),Y(()=>{const y=u.current;if(y){w.current=w.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const C=y.getBoundingClientRect();d.current=C.height,v.current=C.width,g.current||(y.style.transitionDuration=w.current.transitionDuration,y.style.animationName=w.current.animationName),l(o)}},[i.open,o]),p.jsx(I.div,{"data-state":Wn(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...s,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:m&&r})});function Wn(e){return e?"open":"closed"}var Ya=rr,Xa=ir,qa=ar,Za=a.createContext(void 0);function at(e){const t=a.useContext(Za);return e||t||"ltr"}var fe="Accordion",Qa=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Kn,Ja,ec]=it(fe),[Ft]=Z(fe,[ec,or]),Un=or(),cr=z.forwardRef((e,t)=>{const{type:n,...o}=e,r=o,s=o;return p.jsx(Kn.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?p.jsx(rc,{...s,ref:t}):p.jsx(oc,{...r,ref:t})})});cr.displayName=fe;var[lr,tc]=Ft(fe),[ur,nc]=Ft(fe,{collapsible:!1}),oc=z.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},collapsible:s=!1,...i}=e,[c,l]=ie({prop:n,defaultProp:o??"",onChange:r,caller:fe});return p.jsx(lr,{scope:e.__scopeAccordion,value:z.useMemo(()=>c?[c]:[],[c]),onItemOpen:l,onItemClose:z.useCallback(()=>s&&l(""),[s,l]),children:p.jsx(ur,{scope:e.__scopeAccordion,collapsible:s,children:p.jsx(dr,{...i,ref:t})})})}),rc=z.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...s}=e,[i,c]=ie({prop:n,defaultProp:o??[],onChange:r,caller:fe}),l=z.useCallback(f=>c((d=[])=>[...d,f]),[c]),u=z.useCallback(f=>c((d=[])=>d.filter(h=>h!==f)),[c]);return p.jsx(lr,{scope:e.__scopeAccordion,value:i,onItemOpen:l,onItemClose:u,children:p.jsx(ur,{scope:e.__scopeAccordion,collapsible:!0,children:p.jsx(dr,{...s,ref:t})})})}),[sc,$t]=Ft(fe),dr=z.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:o,dir:r,orientation:s="vertical",...i}=e,c=z.useRef(null),l=k(c,t),u=Ja(n),d=at(r)==="ltr",h=R(e.onKeyDown,v=>{if(!Qa.includes(v.key))return;const x=v.target,m=u().filter(M=>!M.ref.current?.disabled),g=m.findIndex(M=>M.ref.current===x),w=m.length;if(g===-1)return;v.preventDefault();let y=g;const C=0,b=w-1,S=()=>{y=g+1,y>b&&(y=C)},P=()=>{y=g-1,y<C&&(y=b)};switch(v.key){case"Home":y=C;break;case"End":y=b;break;case"ArrowRight":s==="horizontal"&&(d?S():P());break;case"ArrowDown":s==="vertical"&&S();break;case"ArrowLeft":s==="horizontal"&&(d?P():S());break;case"ArrowUp":s==="vertical"&&P();break}const E=y%w;m[E].ref.current?.focus()});return p.jsx(sc,{scope:n,disabled:o,direction:r,orientation:s,children:p.jsx(Kn.Slot,{scope:n,children:p.jsx(I.div,{...i,"data-orientation":s,ref:l,onKeyDown:o?void 0:h})})})}),Et="AccordionItem",[ic,Gn]=Ft(Et),fr=z.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...r}=e,s=$t(Et,n),i=tc(Et,n),c=Un(n),l=re(),u=o&&i.value.includes(o)||!1,f=s.disabled||e.disabled;return p.jsx(ic,{scope:n,open:u,disabled:f,triggerId:l,children:p.jsx(Ya,{"data-orientation":s.orientation,"data-state":xr(u),...c,...r,ref:t,disabled:f,open:u,onOpenChange:d=>{d?i.onItemOpen(o):i.onItemClose(o)}})})});fr.displayName=Et;var pr="AccordionHeader",mr=z.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=$t(fe,n),s=Gn(pr,n);return p.jsx(I.h3,{"data-orientation":r.orientation,"data-state":xr(s.open),"data-disabled":s.disabled?"":void 0,...o,ref:t})});mr.displayName=pr;var bn="AccordionTrigger",hr=z.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=$t(fe,n),s=Gn(bn,n),i=nc(bn,n),c=Un(n);return p.jsx(Kn.ItemSlot,{scope:n,children:p.jsx(Xa,{"aria-disabled":s.open&&!i.collapsible||void 0,"data-orientation":r.orientation,id:s.triggerId,...c,...o,ref:t})})});hr.displayName=bn;var vr="AccordionContent",gr=z.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=$t(fe,n),s=Gn(vr,n),i=Un(n);return p.jsx(qa,{role:"region","aria-labelledby":s.triggerId,"data-orientation":r.orientation,...i,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});gr.displayName=vr;function xr(e){return e?"open":"closed"}var Bp=cr,Vp=fr,Hp=mr,Wp=hr,Kp=gr;function ge(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}function ac(e,t=globalThis?.document){const n=ge(e);a.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var cc="DismissableLayer",Sn="dismissableLayer.update",lc="dismissableLayer.pointerDownOutside",uc="dismissableLayer.focusOutside",Po,wr=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ct=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...l}=e,u=a.useContext(wr),[f,d]=a.useState(null),h=f?.ownerDocument??globalThis?.document,[,v]=a.useState({}),x=k(t,E=>d(E)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(g),y=f?m.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,b=y>=w,S=pc(E=>{const M=E.target,L=[...u.branches].some(O=>O.contains(M));!b||L||(r?.(E),i?.(E),E.defaultPrevented||c?.())},h),P=mc(E=>{const M=E.target;[...u.branches].some(O=>O.contains(M))||(s?.(E),i?.(E),E.defaultPrevented||c?.())},h);return ac(E=>{y===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},h),a.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Po=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Ao(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Po)}},[f,h,n,u]),a.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Ao())},[f,u]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(Sn,E),()=>document.removeEventListener(Sn,E)},[]),p.jsx(I.div,{...l,ref:x,style:{pointerEvents:C?b?"auto":"none":void 0,...e.style},onFocusCapture:R(e.onFocusCapture,P.onFocusCapture),onBlurCapture:R(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,S.onPointerDownCapture)})});ct.displayName=cc;var dc="DismissableLayerBranch",fc=a.forwardRef((e,t)=>{const n=a.useContext(wr),o=a.useRef(null),r=k(t,o);return a.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(I.div,{...e,ref:r})});fc.displayName=dc;function pc(e,t=globalThis?.document){const n=ge(e),o=a.useRef(!1),r=a.useRef(()=>{});return a.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){yr(lc,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function mc(e,t=globalThis?.document){const n=ge(e),o=a.useRef(!1);return a.useEffect(()=>{const r=s=>{s.target&&!o.current&&yr(uc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ao(){const e=new CustomEvent(Sn);document.dispatchEvent(e)}function yr(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?er(r,s):r.dispatchEvent(s)}var dn="focusScope.autoFocusOnMount",fn="focusScope.autoFocusOnUnmount",_o={bubbles:!1,cancelable:!0},hc="FocusScope",Bt=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...i}=e,[c,l]=a.useState(null),u=ge(r),f=ge(s),d=a.useRef(null),h=k(t,m=>l(m)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let m=function(C){if(v.paused||!c)return;const b=C.target;c.contains(b)?d.current=b:Re(d.current,{select:!0})},g=function(C){if(v.paused||!c)return;const b=C.relatedTarget;b!==null&&(c.contains(b)||Re(d.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const S of C)S.removedNodes.length>0&&Re(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const y=new MutationObserver(w);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),y.disconnect()}}},[o,c,v.paused]),a.useEffect(()=>{if(c){Mo.add(v);const m=document.activeElement;if(!c.contains(m)){const w=new CustomEvent(dn,_o);c.addEventListener(dn,u),c.dispatchEvent(w),w.defaultPrevented||(vc(Cc(Cr(c)),{select:!0}),document.activeElement===m&&Re(c))}return()=>{c.removeEventListener(dn,u),setTimeout(()=>{const w=new CustomEvent(fn,_o);c.addEventListener(fn,f),c.dispatchEvent(w),w.defaultPrevented||Re(m??document.body,{select:!0}),c.removeEventListener(fn,f),Mo.remove(v)},0)}}},[c,u,f,v]);const x=a.useCallback(m=>{if(!n&&!o||v.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(g&&w){const y=m.currentTarget,[C,b]=gc(y);C&&b?!m.shiftKey&&w===b?(m.preventDefault(),n&&Re(C,{select:!0})):m.shiftKey&&w===C&&(m.preventDefault(),n&&Re(b,{select:!0})):w===y&&m.preventDefault()}},[n,o,v.paused]);return p.jsx(I.div,{tabIndex:-1,...i,ref:h,onKeyDown:x})});Bt.displayName=hc;function vc(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Re(o,{select:t}),document.activeElement!==n)return}function gc(e){const t=Cr(e),n=To(t,e),o=To(t.reverse(),e);return[n,o]}function Cr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function To(e,t){for(const n of e)if(!xc(n,{upTo:t}))return n}function xc(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}function wc(e){return e instanceof HTMLInputElement&&"select"in e}function Re(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wc(e)&&t&&e.select()}}var Mo=yc();function yc(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Io(e,t),e.unshift(t)},remove(t){e=Io(e,t),e[0]?.resume()}}}function Io(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Cc(e){return e.filter(t=>t.tagName!=="A")}var bc="Portal",lt=a.forwardRef((e,t)=>{const{container:n,...o}=e,[r,s]=a.useState(!1);Y(()=>s(!0),[]);const i=n||r&&globalThis?.document?.body;return i?Aa.createPortal(p.jsx(I.div,{...o,ref:t}),i):null});lt.displayName=bc;var pn=0;function zn(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Do()),document.body.insertAdjacentElement("beforeend",e[1]??Do()),pn++,()=>{pn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pn--}},[])}function Do(){const 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}var me=function(){return me=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},me.apply(this,arguments)};function br(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Sc(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}var Ct="right-scroll-bar-position",bt="width-before-scroll-bar",Ec="with-scroll-bars-hidden",Rc="--removed-body-scroll-bar-size";function mn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Pc(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Ac=typeof window<"u"?a.useLayoutEffect:a.useEffect,No=new WeakMap;function _c(e,t){var n=Pc(null,function(o){return e.forEach(function(r){return mn(r,o)})});return Ac(function(){var o=No.get(n);if(o){var r=new Set(o),s=new Set(e),i=n.current;r.forEach(function(c){s.has(c)||mn(c,null)}),s.forEach(function(c){r.has(c)||mn(c,i)})}No.set(n,e)},[e]),n}function Tc(e){return e}function Mc(e,t){t===void 0&&(t=Tc);var n=[],o=!1,r={read:function(){if(o)throw new 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(s){var i=t(s,o);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(o=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){o=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var l=function(){var f=i;i=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){i.push(f),u()},filter:function(f){return i=i.filter(f),n}}}};return r}function Ic(e){e===void 0&&(e={});var t=Mc(null);return t.options=me({async:!0,ssr:!1},e),t}var Sr=function(e){var t=e.sideCar,n=br(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return a.createElement(o,me({},n))};Sr.isSideCarExport=!0;function Dc(e,t){return e.useMedium(t),Sr}var Er=Ic(),hn=function(){},Vt=a.forwardRef(function(e,t){var n=a.useRef(null),o=a.useState({onScrollCapture:hn,onWheelCapture:hn,onTouchMoveCapture:hn}),r=o[0],s=o[1],i=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,d=e.shards,h=e.sideCar,v=e.noRelative,x=e.noIsolation,m=e.inert,g=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,C=e.gapMode,b=br(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,P=_c([n,t]),E=me(me({},b),r);return a.createElement(a.Fragment,null,f&&a.createElement(S,{sideCar:Er,removeScrollBar:u,shards:d,noRelative:v,noIsolation:x,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:C}),i?a.cloneElement(a.Children.only(c),me(me({},E),{ref:P})):a.createElement(y,me({},E,{className:l,ref:P}),c))});Vt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vt.classNames={fullWidth:bt,zeroRight:Ct};var Nc=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Oc(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nc();return t&&e.setAttribute("nonce",t),e}function kc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jc(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Oc())&&(kc(t,n),jc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fc=function(){var e=Lc();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Rr=function(){var e=Fc(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},$c={left:0,top:0,right:0,gap:0},vn=function(e){return parseInt(e||"",10)||0},Bc=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[vn(n),vn(o),vn(r)]},Vc=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $c;var t=Bc(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Hc=Rr(),We="data-scroll-locked",Wc=function(e,t,n,o){var r=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
2
|
+
.`.concat(Ec,` {
|
|
3
|
+
overflow: hidden `).concat(o,`;
|
|
4
|
+
padding-right: `).concat(c,"px ").concat(o,`;
|
|
5
|
+
}
|
|
6
|
+
body[`).concat(We,`] {
|
|
7
|
+
overflow: hidden `).concat(o,`;
|
|
8
|
+
overscroll-behavior: contain;
|
|
9
|
+
`).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
|
|
10
|
+
padding-left: `.concat(r,`px;
|
|
11
|
+
padding-top: `).concat(s,`px;
|
|
12
|
+
padding-right: `).concat(i,`px;
|
|
13
|
+
margin-left:0;
|
|
14
|
+
margin-top:0;
|
|
15
|
+
margin-right: `).concat(c,"px ").concat(o,`;
|
|
16
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.`).concat(Ct,` {
|
|
20
|
+
right: `).concat(c,"px ").concat(o,`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.`).concat(bt,` {
|
|
24
|
+
margin-right: `).concat(c,"px ").concat(o,`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(Ct," .").concat(Ct,` {
|
|
28
|
+
right: 0 `).concat(o,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(bt," .").concat(bt,` {
|
|
32
|
+
margin-right: 0 `).concat(o,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
body[`).concat(We,`] {
|
|
36
|
+
`).concat(Rc,": ").concat(c,`px;
|
|
37
|
+
}
|
|
38
|
+
`)},Oo=function(){var e=parseInt(document.body.getAttribute(We)||"0",10);return isFinite(e)?e:0},Kc=function(){a.useEffect(function(){return document.body.setAttribute(We,(Oo()+1).toString()),function(){var e=Oo()-1;e<=0?document.body.removeAttribute(We):document.body.setAttribute(We,e.toString())}},[])},Uc=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Kc();var s=a.useMemo(function(){return Vc(r)},[r]);return a.createElement(Hc,{styles:Wc(s,!t,r,n?"":"!important")})},En=!1;if(typeof window<"u")try{var vt=Object.defineProperty({},"passive",{get:function(){return En=!0,!0}});window.addEventListener("test",vt,vt),window.removeEventListener("test",vt,vt)}catch{En=!1}var Be=En?{passive:!1}:!1,Gc=function(e){return e.tagName==="TEXTAREA"},Pr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Gc(e)&&n[t]==="visible")},zc=function(e){return Pr(e,"overflowY")},Yc=function(e){return Pr(e,"overflowX")},ko=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Ar(e,o);if(r){var s=_r(e,o),i=s[1],c=s[2];if(i>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Xc=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},qc=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Ar=function(e,t){return e==="v"?zc(t):Yc(t)},_r=function(e,t){return e==="v"?Xc(t):qc(t)},Zc=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qc=function(e,t,n,o,r){var s=Zc(e,window.getComputedStyle(t).direction),i=s*o,c=n.target,l=t.contains(c),u=!1,f=i>0,d=0,h=0;do{if(!c)break;var v=_r(e,c),x=v[0],m=v[1],g=v[2],w=m-g-s*x;(x||w)&&Ar(e,c)&&(d+=w,h+=x);var y=c.parentNode;c=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(f&&Math.abs(d)<1||!f&&Math.abs(h)<1)&&(u=!0),u},gt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jo=function(e){return[e.deltaX,e.deltaY]},Lo=function(e){return e&&"current"in e?e.current:e},Jc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},el=function(e){return`
|
|
39
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
+
`)},tl=0,Ve=[];function nl(e){var t=a.useRef([]),n=a.useRef([0,0]),o=a.useRef(),r=a.useState(tl++)[0],s=a.useState(Rr)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=Sc([e.lockRef.current],(e.shards||[]).map(Lo),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var w=gt(m),y=n.current,C="deltaX"in m?m.deltaX:y[0]-w[0],b="deltaY"in m?m.deltaY:y[1]-w[1],S,P=m.target,E=Math.abs(C)>Math.abs(b)?"h":"v";if("touches"in m&&E==="h"&&P.type==="range")return!1;var M=window.getSelection(),L=M&&M.anchorNode,O=L?L===P||L.contains(P):!1;if(O)return!1;var D=ko(E,P);if(!D)return!0;if(D?S=E:(S=E==="v"?"h":"v",D=ko(E,P)),!D)return!1;if(!o.current&&"changedTouches"in m&&(C||b)&&(o.current=S),!S)return!0;var j=o.current||S;return Qc(j,g,m,j==="h"?C:b)},[]),l=a.useCallback(function(m){var g=m;if(!(!Ve.length||Ve[Ve.length-1]!==s)){var w="deltaY"in g?jo(g):gt(g),y=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&Jc(S.delta,w)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var C=(i.current.shards||[]).map(Lo).filter(Boolean).filter(function(S){return S.contains(g.target)}),b=C.length>0?c(g,C[0]):!i.current.noIsolation;b&&g.cancelable&&g.preventDefault()}}},[]),u=a.useCallback(function(m,g,w,y){var C={name:m,delta:g,target:w,should:y,shadowParent:ol(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(b){return b!==C})},1)},[]),f=a.useCallback(function(m){n.current=gt(m),o.current=void 0},[]),d=a.useCallback(function(m){u(m.type,jo(m),m.target,c(m,e.lockRef.current))},[]),h=a.useCallback(function(m){u(m.type,gt(m),m.target,c(m,e.lockRef.current))},[]);a.useEffect(function(){return Ve.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Be),document.addEventListener("touchmove",l,Be),document.addEventListener("touchstart",f,Be),function(){Ve=Ve.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Be),document.removeEventListener("touchmove",l,Be),document.removeEventListener("touchstart",f,Be)}},[]);var v=e.removeScrollBar,x=e.inert;return a.createElement(a.Fragment,null,x?a.createElement(s,{styles:el(r)}):null,v?a.createElement(Uc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ol(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rl=Dc(Er,nl);var Ht=a.forwardRef(function(e,t){return a.createElement(Vt,me({},e,{ref:t,sideCar:rl}))});Ht.classNames=Vt.classNames;var sl=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},He=new WeakMap,xt=new WeakMap,wt={},gn=0,Tr=function(e){return e&&(e.host||Tr(e.parentNode))},il=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Tr(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},al=function(e,t,n,o){var r=il(t,Array.isArray(e)?e:[e]);wt[n]||(wt[n]=new WeakMap);var s=wt[n],i=[],c=new Set,l=new Set(r),u=function(d){!d||c.has(d)||(c.add(d),u(d.parentNode))};r.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(c.has(h))f(h);else try{var v=h.getAttribute(o),x=v!==null&&v!=="false",m=(He.get(h)||0)+1,g=(s.get(h)||0)+1;He.set(h,m),s.set(h,g),i.push(h),m===1&&x&&xt.set(h,!0),g===1&&h.setAttribute(n,"true"),x||h.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),c.clear(),gn++,function(){i.forEach(function(d){var h=He.get(d)-1,v=s.get(d)-1;He.set(d,h),s.set(d,v),h||(xt.has(d)||d.removeAttribute(o),xt.delete(d)),v||d.removeAttribute(n)}),gn--,gn||(He=new WeakMap,He=new WeakMap,xt=new WeakMap,wt={})}},Yn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=sl(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),al(o,r,n,"aria-hidden")):function(){return null}},Wt="Dialog",[Mr,Ir]=Z(Wt),[cl,pe]=Mr(Wt),Dr=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,c=a.useRef(null),l=a.useRef(null),[u,f]=ie({prop:o,defaultProp:r??!1,onChange:s,caller:Wt});return p.jsx(cl,{scope:t,triggerRef:c,contentRef:l,contentId:re(),titleId:re(),descriptionId:re(),open:u,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(d=>!d),[f]),modal:i,children:n})};Dr.displayName=Wt;var Nr="DialogTrigger",Or=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(Nr,n),s=k(t,r.triggerRef);return p.jsx(I.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Zn(r.open),...o,ref:s,onClick:R(e.onClick,r.onOpenToggle)})});Or.displayName=Nr;var Xn="DialogPortal",[ll,kr]=Mr(Xn,{forceMount:void 0}),jr=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=pe(Xn,t);return p.jsx(ll,{scope:t,forceMount:n,children:a.Children.map(o,i=>p.jsx(ae,{present:n||s.open,children:p.jsx(lt,{asChild:!0,container:r,children:i})}))})};jr.displayName=Xn;var Rt="DialogOverlay",Lr=a.forwardRef((e,t)=>{const n=kr(Rt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(Rt,e.__scopeDialog);return s.modal?p.jsx(ae,{present:o||s.open,children:p.jsx(dl,{...r,ref:t})}):null});Lr.displayName=Rt;var ul=Ne("DialogOverlay.RemoveScroll"),dl=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(Rt,n);return p.jsx(Ht,{as:ul,allowPinchZoom:!0,shards:[r.contentRef],children:p.jsx(I.div,{"data-state":Zn(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Oe="DialogContent",Fr=a.forwardRef((e,t)=>{const n=kr(Oe,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(Oe,e.__scopeDialog);return p.jsx(ae,{present:o||s.open,children:s.modal?p.jsx(fl,{...r,ref:t}):p.jsx(pl,{...r,ref:t})})});Fr.displayName=Oe;var fl=a.forwardRef((e,t)=>{const n=pe(Oe,e.__scopeDialog),o=a.useRef(null),r=k(t,n.contentRef,o);return a.useEffect(()=>{const s=o.current;if(s)return Yn(s)},[]),p.jsx($r,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&s.preventDefault()}),onFocusOutside:R(e.onFocusOutside,s=>s.preventDefault())})}),pl=a.forwardRef((e,t)=>{const n=pe(Oe,e.__scopeDialog),o=a.useRef(!1),r=a.useRef(!1);return p.jsx($r,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),$r=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=e,c=pe(Oe,n),l=a.useRef(null),u=k(t,l);return zn(),p.jsxs(p.Fragment,{children:[p.jsx(Bt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(ct,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Zn(c.open),...i,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(hl,{titleId:c.titleId}),p.jsx(gl,{contentRef:l,descriptionId:c.descriptionId})]})]})}),qn="DialogTitle",Br=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(qn,n);return p.jsx(I.h2,{id:r.titleId,...o,ref:t})});Br.displayName=qn;var Vr="DialogDescription",Hr=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(Vr,n);return p.jsx(I.p,{id:r.descriptionId,...o,ref:t})});Hr.displayName=Vr;var Wr="DialogClose",Kr=a.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(Wr,n);return p.jsx(I.button,{type:"button",...o,ref:t,onClick:R(e.onClick,()=>r.onOpenChange(!1))})});Kr.displayName=Wr;function Zn(e){return e?"open":"closed"}var Ur="DialogTitleWarning",[ml,Gr]=ka(Ur,{contentName:Oe,titleName:qn,docsSlug:"dialog"}),hl=({titleId:e})=>{const t=Gr(Ur),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
+
|
|
43
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
+
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vl="DialogDescriptionWarning",gl=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gr(vl).contentName}}.`;return a.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},xl=Dr,wl=Or,yl=jr,Cl=Lr,bl=Fr,Sl=Br,El=Hr,zr=Kr,Yr="AlertDialog",[Rl]=Z(Yr,[Ir]),Se=Ir(),Xr=e=>{const{__scopeAlertDialog:t,...n}=e,o=Se(t);return p.jsx(xl,{...o,...n,modal:!0})};Xr.displayName=Yr;var Pl="AlertDialogTrigger",qr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(wl,{...r,...o,ref:t})});qr.displayName=Pl;var Al="AlertDialogPortal",Zr=e=>{const{__scopeAlertDialog:t,...n}=e,o=Se(t);return p.jsx(yl,{...o,...n})};Zr.displayName=Al;var _l="AlertDialogOverlay",Qr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(Cl,{...r,...o,ref:t})});Qr.displayName=_l;var Ke="AlertDialogContent",[Tl,Ml]=Rl(Ke),Il=Jo("AlertDialogContent"),Jr=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:o,...r}=e,s=Se(n),i=a.useRef(null),c=k(t,i),l=a.useRef(null);return p.jsx(ml,{contentName:Ke,titleName:es,docsSlug:"alert-dialog",children:p.jsx(Tl,{scope:n,cancelRef:l,children:p.jsxs(bl,{role:"alertdialog",...s,...r,ref:c,onOpenAutoFocus:R(r.onOpenAutoFocus,u=>{u.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[p.jsx(Il,{children:o}),p.jsx(Nl,{contentRef:i})]})})})});Jr.displayName=Ke;var es="AlertDialogTitle",ts=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(Sl,{...r,...o,ref:t})});ts.displayName=es;var ns="AlertDialogDescription",os=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(El,{...r,...o,ref:t})});os.displayName=ns;var Dl="AlertDialogAction",rs=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(zr,{...r,...o,ref:t})});rs.displayName=Dl;var ss="AlertDialogCancel",is=a.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:r}=Ml(ss,n),s=Se(n),i=k(t,r);return p.jsx(zr,{...s,...o,ref:i})});is.displayName=ss;var Nl=({contentRef:e})=>{const t=`\`${Ke}\` requires a description for the component to be accessible for screen reader users.
|
|
46
|
+
|
|
47
|
+
You can add a description to the \`${Ke}\` by passing a \`${ns}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
48
|
+
|
|
49
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ke}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
50
|
+
|
|
51
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Up=Xr,Gp=qr,zp=Zr,Yp=Qr,Xp=Jr,qp=rs,Zp=is,Qp=ts,Jp=os;function Kt(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ut(e){const[t,n]=a.useState(void 0);return Y(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,c=u.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Gt="Checkbox",[Ol]=Z(Gt),[kl,Qn]=Ol(Gt);function jl(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:i,name:c,onCheckedChange:l,required:u,value:f="on",internal_do_not_use_render:d}=e,[h,v]=ie({prop:n,defaultProp:r??!1,onChange:l,caller:Gt}),[x,m]=a.useState(null),[g,w]=a.useState(null),y=a.useRef(!1),C=x?!!i||!!x.closest("form"):!0,b={checked:h,disabled:s,setChecked:v,control:x,setControl:m,name:c,form:i,value:f,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Pe(r)?!1:r,isFormControl:C,bubbleInput:g,setBubbleInput:w};return p.jsx(kl,{scope:t,...b,children:$l(d)?d(b):o})}var as="CheckboxTrigger",cs=a.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:i,disabled:c,checked:l,required:u,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:h,isFormControl:v,bubbleInput:x}=Qn(as,e),m=k(r,f),g=a.useRef(l);return a.useEffect(()=>{const w=s?.form;if(w){const y=()=>d(g.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[s,d]),p.jsx(I.button,{type:"button",role:"checkbox","aria-checked":Pe(l)?"mixed":l,"aria-required":u,"data-state":fs(l),"data-disabled":c?"":void 0,disabled:c,value:i,...o,ref:m,onKeyDown:R(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:R(n,w=>{d(y=>Pe(y)?!0:!y),x&&v&&(h.current=w.isPropagationStopped(),h.current||w.stopPropagation())})})});cs.displayName=as;var Ll=a.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:i,disabled:c,value:l,onCheckedChange:u,form:f,...d}=e;return p.jsx(jl,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:c,required:i,onCheckedChange:u,name:o,form:f,value:l,internal_do_not_use_render:({isFormControl:h})=>p.jsxs(p.Fragment,{children:[p.jsx(cs,{...d,ref:t,__scopeCheckbox:n}),h&&p.jsx(ds,{__scopeCheckbox:n})]})})});Ll.displayName=Gt;var ls="CheckboxIndicator",Fl=a.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Qn(ls,n);return p.jsx(ae,{present:o||Pe(s.checked)||s.checked===!0,children:p.jsx(I.span,{"data-state":fs(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});Fl.displayName=ls;var us="CheckboxBubbleInput",ds=a.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:i,required:c,disabled:l,name:u,value:f,form:d,bubbleInput:h,setBubbleInput:v}=Qn(us,e),x=k(n,v),m=Kt(s),g=Ut(o);a.useEffect(()=>{const y=h;if(!y)return;const C=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(C,"checked").set,P=!r.current;if(m!==s&&S){const E=new Event("click",{bubbles:P});y.indeterminate=Pe(s),S.call(y,Pe(s)?!1:s),y.dispatchEvent(E)}},[h,m,s,r]);const w=a.useRef(Pe(s)?!1:s);return p.jsx(I.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??w.current,required:c,disabled:l,name:u,value:f,form:d,...t,tabIndex:-1,ref:x,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ds.displayName=us;function $l(e){return typeof e=="function"}function Pe(e){return e==="indeterminate"}function fs(e){return Pe(e)?"indeterminate":e?"checked":"unchecked"}const Bl=["top","right","bottom","left"],Ae=Math.min,ee=Math.max,Pt=Math.round,yt=Math.floor,ve=e=>({x:e,y:e}),Vl={left:"right",right:"left",bottom:"top",top:"bottom"};function Rn(e,t,n){return ee(e,Ae(t,n))}function Ce(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function Ye(e){return e.split("-")[1]}function Jn(e){return e==="x"?"y":"x"}function eo(e){return e==="y"?"height":"width"}function he(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function to(e){return Jn(he(e))}function Hl(e,t,n){n===void 0&&(n=!1);const o=Ye(e),r=to(e),s=eo(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=At(i)),[i,At(i)]}function Wl(e){const t=At(e);return[Pn(e),t,Pn(t)]}function Pn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Fo=["left","right"],$o=["right","left"],Kl=["top","bottom"],Ul=["bottom","top"];function Gl(e,t,n){switch(e){case"top":case"bottom":return n?t?$o:Fo:t?Fo:$o;case"left":case"right":return t?Kl:Ul;default:return[]}}function zl(e,t,n,o){const r=Ye(e);let s=Gl(be(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(Pn)))),s}function At(e){const t=be(e);return Vl[t]+e.slice(t.length)}function Yl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ps(e){return typeof e!="number"?Yl(e):{top:e,right:e,bottom:e,left:e}}function _t(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Bo(e,t,n){let{reference:o,floating:r}=e;const s=he(t),i=to(t),c=eo(i),l=be(t),u=s==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,h=o[c]/2-r[c]/2;let v;switch(l){case"top":v={x:f,y:o.y-r.height};break;case"bottom":v={x:f,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:d};break;case"left":v={x:o.x-r.width,y:d};break;default:v={x:o.x,y:o.y}}switch(Ye(t)){case"start":v[i]-=h*(n&&u?-1:1);break;case"end":v[i]+=h*(n&&u?-1:1);break}return v}async function Xl(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:v=0}=Ce(t,e),x=ps(v),g=c[h?d==="floating"?"reference":"floating":d],w=_t(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:l})),y=d==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},S=_t(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:C,strategy:l}):y);return{top:(w.top-S.top+x.top)/b.y,bottom:(S.bottom-w.bottom+x.bottom)/b.y,left:(w.left-S.left+x.left)/b.x,right:(S.right-w.right+x.right)/b.x}}const ql=50,Zl=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Xl},l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=Bo(u,o,l),h=o,v=0;const x={};for(let m=0;m<s.length;m++){const g=s[m];if(!g)continue;const{name:w,fn:y}=g,{x:C,y:b,data:S,reset:P}=await y({x:f,y:d,initialPlacement:o,placement:h,strategy:r,middlewareData:x,rects:u,platform:c,elements:{reference:e,floating:t}});f=C??f,d=b??d,x[w]={...x[w],...S},P&&v<ql&&(v++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(u=P.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):P.rects),{x:f,y:d}=Bo(u,h,l)),m=-1)}return{x:f,y:d,placement:h,strategy:r,middlewareData:x}},Ql=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:u,padding:f=0}=Ce(e,t)||{};if(u==null)return{};const d=ps(f),h={x:n,y:o},v=to(r),x=eo(v),m=await i.getDimensions(u),g=v==="y",w=g?"top":"left",y=g?"bottom":"right",C=g?"clientHeight":"clientWidth",b=s.reference[x]+s.reference[v]-h[v]-s.floating[x],S=h[v]-s.reference[v],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=P?P[C]:0;(!E||!await(i.isElement==null?void 0:i.isElement(P)))&&(E=c.floating[C]||s.floating[x]);const M=b/2-S/2,L=E/2-m[x]/2-1,O=Ae(d[w],L),D=Ae(d[y],L),j=O,B=E-m[x]-D,F=E/2-m[x]/2+M,V=Rn(j,F,B),N=!l.arrow&&Ye(r)!=null&&F!==V&&s.reference[x]/2-(F<j?O:D)-m[x]/2<0,$=N?F<j?F-j:F-B:0;return{[v]:h[v]+$,data:{[v]:V,centerOffset:F-V-$,...N&&{alignmentOffset:$}},reset:N}}}),Jl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...g}=Ce(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=be(r),y=he(c),C=be(c)===c,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=h||(C||!m?[At(c)]:Wl(c)),P=x!=="none";!h&&P&&S.push(...zl(c,m,x,b));const E=[c,...S],M=await l.detectOverflow(t,g),L=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&L.push(M[w]),d){const F=Hl(r,i,b);L.push(M[F[0]],M[F[1]])}if(O=[...O,{placement:r,overflows:L}],!L.every(F=>F<=0)){var D,j;const F=(((D=s.flip)==null?void 0:D.index)||0)+1,V=E[F];if(V&&(!(d==="alignment"?y!==he(V):!1)||O.every(T=>he(T.placement)===y?T.overflows[0]>0:!0)))return{data:{index:F,overflows:O},reset:{placement:V}};let N=(j=O.filter($=>$.overflows[0]<=0).sort(($,T)=>$.overflows[1]-T.overflows[1])[0])==null?void 0:j.placement;if(!N)switch(v){case"bestFit":{var B;const $=(B=O.filter(T=>{if(P){const A=he(T.placement);return A===y||A==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(A=>A>0).reduce((A,U)=>A+U,0)]).sort((T,A)=>T[1]-A[1])[0])==null?void 0:B[0];$&&(N=$);break}case"initialPlacement":N=c;break}if(r!==N)return{reset:{placement:N}}}return{}}}};function Vo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ho(e){return Bl.some(t=>e[t]>=0)}const eu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=Ce(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=Vo(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ho(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=Vo(i,n.floating);return{data:{escapedOffsets:c,escaped:Ho(c)}}}default:return{}}}}},ms=new Set(["left","top"]);async function tu(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=be(n),c=Ye(n),l=he(n)==="y",u=ms.has(i)?-1:1,f=s&&l?-1:1,d=Ce(t,e);let{mainAxis:h,crossAxis:v,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof x=="number"&&(v=c==="end"?x*-1:x),l?{x:v*f,y:h*u}:{x:h*u,y:v*f}}const nu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,l=await tu(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:i}}}}},ou=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:l={fn:w=>{let{x:y,y:C}=w;return{x:y,y:C}}},...u}=Ce(e,t),f={x:n,y:o},d=await s.detectOverflow(t,u),h=he(be(r)),v=Jn(h);let x=f[v],m=f[h];if(i){const w=v==="y"?"top":"left",y=v==="y"?"bottom":"right",C=x+d[w],b=x-d[y];x=Rn(C,x,b)}if(c){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",C=m+d[w],b=m-d[y];m=Rn(C,m,b)}const g=l.fn({...t,[v]:x,[h]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[v]:i,[h]:c}}}}}},ru=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=Ce(e,t),f={x:n,y:o},d=he(r),h=Jn(d);let v=f[h],x=f[d];const m=Ce(c,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const C=h==="y"?"height":"width",b=s.reference[h]-s.floating[C]+g.mainAxis,S=s.reference[h]+s.reference[C]-g.mainAxis;v<b?v=b:v>S&&(v=S)}if(u){var w,y;const C=h==="y"?"width":"height",b=ms.has(be(r)),S=s.reference[d]-s.floating[C]+(b&&((w=i.offset)==null?void 0:w[d])||0)+(b?0:g.crossAxis),P=s.reference[d]+s.reference[C]+(b?0:((y=i.offset)==null?void 0:y[d])||0)-(b?g.crossAxis:0);x<S?x=S:x>P&&(x=P)}return{[h]:v,[d]:x}}}},su=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:l=()=>{},...u}=Ce(e,t),f=await i.detectOverflow(t,u),d=be(r),h=Ye(r),v=he(r)==="y",{width:x,height:m}=s.floating;let g,w;d==="top"||d==="bottom"?(g=d,w=h===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(w=d,g=h==="end"?"top":"bottom");const y=m-f.top-f.bottom,C=x-f.left-f.right,b=Ae(m-f[g],y),S=Ae(x-f[w],C),P=!t.middlewareData.shift;let E=b,M=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=y),P&&!h){const O=ee(f.left,0),D=ee(f.right,0),j=ee(f.top,0),B=ee(f.bottom,0);v?M=x-2*(O!==0||D!==0?O+D:ee(f.left,f.right)):E=m-2*(j!==0||B!==0?j+B:ee(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:E});const L=await i.getDimensions(c.floating);return x!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function zt(){return typeof window<"u"}function Xe(e){return hs(e)?(e.nodeName||"").toLowerCase():"#document"}function te(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xe(e){var t;return(t=(hs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hs(e){return zt()?e instanceof Node||e instanceof te(e).Node:!1}function ue(e){return zt()?e instanceof Element||e instanceof te(e).Element:!1}function Ee(e){return zt()?e instanceof HTMLElement||e instanceof te(e).HTMLElement:!1}function Wo(e){return!zt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof te(e).ShadowRoot}function ut(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=de(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function iu(e){return/^(table|td|th)$/.test(Xe(e))}function Yt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const au=/transform|translate|scale|rotate|perspective|filter/,cu=/paint|layout|strict|content/,De=e=>!!e&&e!=="none";let xn;function no(e){const t=ue(e)?de(e):e;return De(t.transform)||De(t.translate)||De(t.scale)||De(t.rotate)||De(t.perspective)||!oo()&&(De(t.backdropFilter)||De(t.filter))||au.test(t.willChange||"")||cu.test(t.contain||"")}function lu(e){let t=_e(e);for(;Ee(t)&&!Ge(t);){if(no(t))return t;if(Yt(t))return null;t=_e(t)}return null}function oo(){return xn==null&&(xn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xn}function Ge(e){return/^(html|body|#document)$/.test(Xe(e))}function de(e){return te(e).getComputedStyle(e)}function Xt(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _e(e){if(Xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Wo(e)&&e.host||xe(e);return Wo(t)?t.host:t}function vs(e){const t=_e(e);return Ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ee(t)&&ut(t)?t:vs(t)}function tt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=vs(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=te(r);if(s){const c=An(i);return t.concat(i,i.visualViewport||[],ut(r)?r:[],c&&n?tt(c):[])}else return t.concat(r,tt(r,[],n))}function An(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gs(e){const t=de(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ee(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Pt(n)!==s||Pt(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function ro(e){return ue(e)?e:e.contextElement}function Ue(e){const t=ro(e);if(!Ee(t))return ve(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=gs(t);let i=(s?Pt(n.width):n.width)/o,c=(s?Pt(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const uu=ve(0);function xs(e){const t=te(e);return!oo()||!t.visualViewport?uu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function du(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==te(e)?!1:t}function ke(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=ro(e);let i=ve(1);t&&(o?ue(o)&&(i=Ue(o)):i=Ue(e));const c=du(s,n,o)?xs(s):ve(0);let l=(r.left+c.x)/i.x,u=(r.top+c.y)/i.y,f=r.width/i.x,d=r.height/i.y;if(s){const h=te(s),v=o&&ue(o)?te(o):o;let x=h,m=An(x);for(;m&&o&&v!==x;){const g=Ue(m),w=m.getBoundingClientRect(),y=de(m),C=w.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,b=w.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,d*=g.y,l+=C,u+=b,x=te(m),m=An(x)}}return _t({width:f,height:d,x:l,y:u})}function qt(e,t){const n=Xt(e).scrollLeft;return t?t.left+n:ke(xe(e)).left+n}function ws(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-qt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function fu(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=xe(o),c=t?Yt(t.floating):!1;if(o===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ve(1);const f=ve(0),d=Ee(o);if((d||!d&&!s)&&((Xe(o)!=="body"||ut(i))&&(l=Xt(o)),d)){const v=ke(o);u=Ue(o),f.x=v.x+o.clientLeft,f.y=v.y+o.clientTop}const h=i&&!d&&!s?ws(i,l):ve(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function pu(e){return Array.from(e.getClientRects())}function mu(e){const t=xe(e),n=Xt(e),o=e.ownerDocument.body,r=ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+qt(e);const c=-n.scrollTop;return de(o).direction==="rtl"&&(i+=ee(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const Ko=25;function hu(e,t){const n=te(e),o=xe(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,l=0;if(r){s=r.width,i=r.height;const f=oo();(!f||f&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const u=qt(o);if(u<=0){const f=o.ownerDocument,d=f.body,h=getComputedStyle(d),v=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(o.clientWidth-d.clientWidth-v);x<=Ko&&(s-=x)}else u<=Ko&&(s+=u);return{width:s,height:i,x:c,y:l}}function vu(e,t){const n=ke(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ee(e)?Ue(e):ve(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,u=o*s.y;return{width:i,height:c,x:l,y:u}}function Uo(e,t,n){let o;if(t==="viewport")o=hu(e,n);else if(t==="document")o=mu(xe(e));else if(ue(t))o=vu(t,n);else{const r=xs(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return _t(o)}function ys(e,t){const n=_e(e);return n===t||!ue(n)||Ge(n)?!1:de(n).position==="fixed"||ys(n,t)}function gu(e,t){const n=t.get(e);if(n)return n;let o=tt(e,[],!1).filter(c=>ue(c)&&Xe(c)!=="body"),r=null;const s=de(e).position==="fixed";let i=s?_e(e):e;for(;ue(i)&&!Ge(i);){const c=de(i),l=no(i);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||ut(i)&&!l&&ys(e,i))?o=o.filter(f=>f!==i):r=c,i=_e(i)}return t.set(e,o),o}function xu(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Yt(t)?[]:gu(t,this._c):[].concat(n),o],c=Uo(t,i[0],r);let l=c.top,u=c.right,f=c.bottom,d=c.left;for(let h=1;h<i.length;h++){const v=Uo(t,i[h],r);l=ee(v.top,l),u=Ae(v.right,u),f=Ae(v.bottom,f),d=ee(v.left,d)}return{width:u-d,height:f-l,x:d,y:l}}function wu(e){const{width:t,height:n}=gs(e);return{width:t,height:n}}function yu(e,t,n){const o=Ee(t),r=xe(t),s=n==="fixed",i=ke(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=ve(0);function u(){l.x=qt(r)}if(o||!o&&!s)if((Xe(t)!=="body"||ut(r))&&(c=Xt(t)),o){const v=ke(t,!0,s,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else r&&u();s&&!o&&r&&u();const f=r&&!o&&!s?ws(r,c):ve(0),d=i.left+c.scrollLeft-l.x-f.x,h=i.top+c.scrollTop-l.y-f.y;return{x:d,y:h,width:i.width,height:i.height}}function wn(e){return de(e).position==="static"}function Go(e,t){if(!Ee(e)||de(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xe(e)===n&&(n=n.ownerDocument.body),n}function Cs(e,t){const n=te(e);if(Yt(e))return n;if(!Ee(e)){let r=_e(e);for(;r&&!Ge(r);){if(ue(r)&&!wn(r))return r;r=_e(r)}return n}let o=Go(e,t);for(;o&&iu(o)&&wn(o);)o=Go(o,t);return o&&Ge(o)&&wn(o)&&!no(o)?n:o||lu(e)||n}const Cu=async function(e){const t=this.getOffsetParent||Cs,n=this.getDimensions,o=await n(e.floating);return{reference:yu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function bu(e){return de(e).direction==="rtl"}const Su={convertOffsetParentRelativeRectToViewportRelativeRect:fu,getDocumentElement:xe,getClippingRect:xu,getOffsetParent:Cs,getElementRects:Cu,getClientRects:pu,getDimensions:wu,getScale:Ue,isElement:ue,isRTL:bu};function bs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Eu(e,t){let n=null,o;const r=xe(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:d,width:h,height:v}=u;if(c||t(),!h||!v)return;const x=yt(d),m=yt(r.clientWidth-(f+h)),g=yt(r.clientHeight-(d+v)),w=yt(f),C={rootMargin:-x+"px "+-m+"px "+-g+"px "+-w+"px",threshold:ee(0,Ae(1,l))||1};let b=!0;function S(P){const E=P[0].intersectionRatio;if(E!==l){if(!b)return i();E?i(!1,E):o=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!bs(u,e.getBoundingClientRect())&&i(),b=!1}try{n=new IntersectionObserver(S,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,C)}n.observe(e)}return i(!0),s}function Ru(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=ro(e),f=r||s?[...u?tt(u):[],...t?tt(t):[]]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const d=u&&c?Eu(u,n):null;let h=-1,v=null;i&&(v=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&v&&t&&(v.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=v)==null||C.observe(t)})),n()}),u&&!l&&v.observe(u),t&&v.observe(t));let x,m=l?ke(e):null;l&&g();function g(){const w=ke(e);m&&!bs(m,w)&&n(),m=w,x=requestAnimationFrame(g)}return n(),()=>{var w;f.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d?.(),(w=v)==null||w.disconnect(),v=null,l&&cancelAnimationFrame(x)}}const Pu=nu,Au=ou,_u=Jl,Tu=su,Mu=eu,zo=Ql,Iu=ru,Du=(e,t,n)=>{const o=new Map,r={platform:Su,...n},s={...r.platform,_c:o};return Zl(e,t,{...r,platform:s})};var Nu=typeof document<"u",Ou=function(){},St=Nu?a.useLayoutEffect:Ou;function Tt(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Tt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Tt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ss(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yo(e,t){const n=Ss(e);return Math.round(t*n)/n}function yn(e){const t=a.useRef(e);return St(()=>{t.current=e}),t}function ku(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[f,d]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,v]=a.useState(o);Tt(h,o)||v(o);const[x,m]=a.useState(null),[g,w]=a.useState(null),y=a.useCallback(T=>{T!==P.current&&(P.current=T,m(T))},[]),C=a.useCallback(T=>{T!==E.current&&(E.current=T,w(T))},[]),b=s||x,S=i||g,P=a.useRef(null),E=a.useRef(null),M=a.useRef(f),L=l!=null,O=yn(l),D=yn(r),j=yn(u),B=a.useCallback(()=>{if(!P.current||!E.current)return;const T={placement:t,strategy:n,middleware:h};D.current&&(T.platform=D.current),Du(P.current,E.current,T).then(A=>{const U={...A,isPositioned:j.current!==!1};F.current&&!Tt(M.current,U)&&(M.current=U,jt.flushSync(()=>{d(U)}))})},[h,t,n,D,j]);St(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[u]);const F=a.useRef(!1);St(()=>(F.current=!0,()=>{F.current=!1}),[]),St(()=>{if(b&&(P.current=b),S&&(E.current=S),b&&S){if(O.current)return O.current(b,S,B);B()}},[b,S,B,O,L]);const V=a.useMemo(()=>({reference:P,floating:E,setReference:y,setFloating:C}),[y,C]),N=a.useMemo(()=>({reference:b,floating:S}),[b,S]),$=a.useMemo(()=>{const T={position:n,left:0,top:0};if(!N.floating)return T;const A=Yo(N.floating,f.x),U=Yo(N.floating,f.y);return c?{...T,transform:"translate("+A+"px, "+U+"px)",...Ss(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:U}},[n,c,N.floating,f.x,f.y]);return a.useMemo(()=>({...f,update:B,refs:V,elements:N,floatingStyles:$}),[f,B,V,N,$])}const ju=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?zo({element:o.current,padding:r}).fn(n):{}:o?zo({element:o,padding:r}).fn(n):{}}}},Lu=(e,t)=>{const n=Pu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fu=(e,t)=>{const n=Au(e);return{name:n.name,fn:n.fn,options:[e,t]}},$u=(e,t)=>({fn:Iu(e).fn,options:[e,t]}),Bu=(e,t)=>{const n=_u(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vu=(e,t)=>{const n=Tu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hu=(e,t)=>{const n=Mu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wu=(e,t)=>{const n=ju(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ku="Arrow",Es=a.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return p.jsx(I.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Es.displayName=Ku;var Uu=Es,so="Popper",[Rs,qe]=Z(so),[Gu,Ps]=Rs(so),As=e=>{const{__scopePopper:t,children:n}=e,[o,r]=a.useState(null);return p.jsx(Gu,{scope:t,anchor:o,onAnchorChange:r,children:n})};As.displayName=so;var _s="PopperAnchor",Ts=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Ps(_s,n),i=a.useRef(null),c=k(t,i),l=a.useRef(null);return a.useEffect(()=>{const u=l.current;l.current=o?.current||i.current,u!==l.current&&s.onAnchorChange(l.current)}),o?null:p.jsx(I.div,{...r,ref:c})});Ts.displayName=_s;var io="PopperContent",[zu,Yu]=Rs(io),Ms=a.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:v="optimized",onPlaced:x,...m}=e,g=Ps(io,n),[w,y]=a.useState(null),C=k(t,_=>y(_)),[b,S]=a.useState(null),P=Ut(b),E=P?.width??0,M=P?.height??0,L=o+(s!=="center"?"-"+s:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(u)?u:[u],j=D.length>0,B={padding:O,boundary:D.filter(qu),altBoundary:j},{refs:F,floatingStyles:V,placement:N,isPositioned:$,middlewareData:T}=ku({strategy:"fixed",placement:L,whileElementsMounted:(..._)=>Ru(..._,{animationFrame:v==="always"}),elements:{reference:g.anchor},middleware:[Lu({mainAxis:r+M,alignmentAxis:i}),l&&Fu({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?$u():void 0,...B}),l&&Bu({...B}),Vu({...B,apply:({elements:_,rects:H,availableWidth:q,availableHeight:W})=>{const{width:K,height:G}=H.reference,oe=_.floating.style;oe.setProperty("--radix-popper-available-width",`${q}px`),oe.setProperty("--radix-popper-available-height",`${W}px`),oe.setProperty("--radix-popper-anchor-width",`${K}px`),oe.setProperty("--radix-popper-anchor-height",`${G}px`)}}),b&&Wu({element:b,padding:c}),Zu({arrowWidth:E,arrowHeight:M}),h&&Hu({strategy:"referenceHidden",...B})]}),[A,U]=Ns(N),X=ge(x);Y(()=>{$&&X?.()},[$,X]);const ce=T.arrow?.x,we=T.arrow?.y,ne=T.arrow?.centerOffset!==0,[ye,J]=a.useState();return Y(()=>{w&&J(window.getComputedStyle(w).zIndex)},[w]),p.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:$?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(zu,{scope:n,placedSide:A,onArrowChange:S,arrowX:ce,arrowY:we,shouldHideArrow:ne,children:p.jsx(I.div,{"data-side":A,"data-align":U,...m,ref:C,style:{...m.style,animation:$?void 0:"none"}})})})});Ms.displayName=io;var Is="PopperArrow",Xu={top:"bottom",right:"left",bottom:"top",left:"right"},Ds=a.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=Yu(Is,o),i=Xu[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(Uu,{...r,ref:n,style:{...r.style,display:"block"}})})});Ds.displayName=Is;function qu(e){return e!==null}var Zu=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,i=r.arrow?.centerOffset!==0,c=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,f]=Ns(n),d={start:"0%",center:"50%",end:"100%"}[f],h=(r.arrow?.x??0)+c/2,v=(r.arrow?.y??0)+l/2;let x="",m="";return u==="bottom"?(x=i?d:`${h}px`,m=`${-l}px`):u==="top"?(x=i?d:`${h}px`,m=`${o.floating.height+l}px`):u==="right"?(x=`${-l}px`,m=i?d:`${v}px`):u==="left"&&(x=`${o.floating.width+l}px`,m=i?d:`${v}px`),{data:{x,y:m}}}});function Ns(e){const[t,n="center"]=e.split("-");return[t,n]}var ao=As,co=Ts,lo=Ms,uo=Ds,Cn="rovingFocusGroup.onEntryFocus",Qu={bubbles:!1,cancelable:!0},dt="RovingFocusGroup",[_n,Os,Ju]=it(dt),[ed,ks]=Z(dt,[Ju]),[td,nd]=ed(dt),js=a.forwardRef((e,t)=>p.jsx(_n.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(_n.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(od,{...e,ref:t})})}));js.displayName=dt;var od=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,h=a.useRef(null),v=k(t,h),x=at(s),[m,g]=ie({prop:i,defaultProp:c??null,onChange:l,caller:dt}),[w,y]=a.useState(!1),C=ge(u),b=Os(n),S=a.useRef(!1),[P,E]=a.useState(0);return a.useEffect(()=>{const M=h.current;if(M)return M.addEventListener(Cn,C),()=>M.removeEventListener(Cn,C)},[C]),p.jsx(td,{scope:n,orientation:o,dir:x,loop:r,currentTabStopId:m,onItemFocus:a.useCallback(M=>g(M),[g]),onItemShiftTab:a.useCallback(()=>y(!0),[]),onFocusableItemAdd:a.useCallback(()=>E(M=>M+1),[]),onFocusableItemRemove:a.useCallback(()=>E(M=>M-1),[]),children:p.jsx(I.div,{tabIndex:w||P===0?-1:0,"data-orientation":o,...d,ref:v,style:{outline:"none",...e.style},onMouseDown:R(e.onMouseDown,()=>{S.current=!0}),onFocus:R(e.onFocus,M=>{const L=!S.current;if(M.target===M.currentTarget&&L&&!w){const O=new CustomEvent(Cn,Qu);if(M.currentTarget.dispatchEvent(O),!O.defaultPrevented){const D=b().filter(N=>N.focusable),j=D.find(N=>N.active),B=D.find(N=>N.id===m),V=[j,B,...D].filter(Boolean).map(N=>N.ref.current);$s(V,f)}}S.current=!1}),onBlur:R(e.onBlur,()=>y(!1))})})}),Ls="RovingFocusGroupItem",Fs=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...c}=e,l=re(),u=s||l,f=nd(Ls,n),d=f.currentTabStopId===u,h=Os(n),{onFocusableItemAdd:v,onFocusableItemRemove:x,currentTabStopId:m}=f;return a.useEffect(()=>{if(o)return v(),()=>x()},[o,v,x]),p.jsx(_n.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:p.jsx(I.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:R(e.onMouseDown,g=>{o?f.onItemFocus(u):g.preventDefault()}),onFocus:R(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:R(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=id(g,f.orientation,f.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let C=h().filter(b=>b.focusable).map(b=>b.ref.current);if(w==="last")C.reverse();else if(w==="prev"||w==="next"){w==="prev"&&C.reverse();const b=C.indexOf(g.currentTarget);C=f.loop?ad(C,b+1):C.slice(b+1)}setTimeout(()=>$s(C))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:m!=null}):i})})});Fs.displayName=Ls;var rd={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sd(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function id(e,t,n){const o=sd(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return rd[o]}function $s(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function ad(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var cd=js,ld=Fs,Tn=["Enter"," "],ud=["ArrowDown","PageUp","Home"],Bs=["ArrowUp","PageDown","End"],dd=[...ud,...Bs],fd={ltr:[...Tn,"ArrowRight"],rtl:[...Tn,"ArrowLeft"]},pd={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ft="Menu",[nt,md,hd]=it(ft),[Fe,Vs]=Z(ft,[hd,qe,ks]),Zt=qe(),Hs=ks(),[vd,$e]=Fe(ft),[gd,pt]=Fe(ft),Ws=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:s,modal:i=!0}=e,c=Zt(t),[l,u]=a.useState(null),f=a.useRef(!1),d=ge(s),h=at(r);return a.useEffect(()=>{const v=()=>{f.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>f.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),p.jsx(ao,{...c,children:p.jsx(vd,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:p.jsx(gd,{scope:t,onClose:a.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:h,modal:i,children:o})})})};Ws.displayName=ft;var xd="MenuAnchor",fo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=Zt(n);return p.jsx(co,{...r,...o,ref:t})});fo.displayName=xd;var po="MenuPortal",[wd,Ks]=Fe(po,{forceMount:void 0}),Us=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=$e(po,t);return p.jsx(wd,{scope:t,forceMount:n,children:p.jsx(ae,{present:n||s.open,children:p.jsx(lt,{asChild:!0,container:r,children:o})})})};Us.displayName=po;var se="MenuContent",[yd,mo]=Fe(se),Gs=a.forwardRef((e,t)=>{const n=Ks(se,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=$e(se,e.__scopeMenu),i=pt(se,e.__scopeMenu);return p.jsx(nt.Provider,{scope:e.__scopeMenu,children:p.jsx(ae,{present:o||s.open,children:p.jsx(nt.Slot,{scope:e.__scopeMenu,children:i.modal?p.jsx(Cd,{...r,ref:t}):p.jsx(bd,{...r,ref:t})})})})}),Cd=a.forwardRef((e,t)=>{const n=$e(se,e.__scopeMenu),o=a.useRef(null),r=k(t,o);return a.useEffect(()=>{const s=o.current;if(s)return Yn(s)},[]),p.jsx(ho,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:R(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bd=a.forwardRef((e,t)=>{const n=$e(se,e.__scopeMenu);return p.jsx(ho,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Sd=Ne("MenuContent.ScrollLock"),ho=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:v,disableOutsideScroll:x,...m}=e,g=$e(se,n),w=pt(se,n),y=Zt(n),C=Hs(n),b=md(n),[S,P]=a.useState(null),E=a.useRef(null),M=k(t,E,g.onContentChange),L=a.useRef(0),O=a.useRef(""),D=a.useRef(0),j=a.useRef(null),B=a.useRef("right"),F=a.useRef(0),V=x?Ht:a.Fragment,N=x?{as:Sd,allowPinchZoom:!0}:void 0,$=A=>{const U=O.current+A,X=b().filter(_=>!_.disabled),ce=document.activeElement,we=X.find(_=>_.ref.current===ce)?.textValue,ne=X.map(_=>_.textValue),ye=kd(ne,U,we),J=X.find(_=>_.textValue===ye)?.ref.current;(function _(H){O.current=H,window.clearTimeout(L.current),H!==""&&(L.current=window.setTimeout(()=>_(""),1e3))})(U),J&&setTimeout(()=>J.focus())};a.useEffect(()=>()=>window.clearTimeout(L.current),[]),zn();const T=a.useCallback(A=>B.current===j.current?.side&&Ld(A,j.current?.area),[]);return p.jsx(yd,{scope:n,searchRef:O,onItemEnter:a.useCallback(A=>{T(A)&&A.preventDefault()},[T]),onItemLeave:a.useCallback(A=>{T(A)||(E.current?.focus(),P(null))},[T]),onTriggerLeave:a.useCallback(A=>{T(A)&&A.preventDefault()},[T]),pointerGraceTimerRef:D,onPointerGraceIntentChange:a.useCallback(A=>{j.current=A},[]),children:p.jsx(V,{...N,children:p.jsx(Bt,{asChild:!0,trapped:r,onMountAutoFocus:R(s,A=>{A.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:p.jsx(ct,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:h,onDismiss:v,children:p.jsx(cd,{asChild:!0,...C,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:S,onCurrentTabStopIdChange:P,onEntryFocus:R(l,A=>{w.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(lo,{role:"menu","aria-orientation":"vertical","data-state":ci(g.open),"data-radix-menu-content":"",dir:w.dir,...y,...m,ref:M,style:{outline:"none",...m.style},onKeyDown:R(m.onKeyDown,A=>{const X=A.target.closest("[data-radix-menu-content]")===A.currentTarget,ce=A.ctrlKey||A.altKey||A.metaKey,we=A.key.length===1;X&&(A.key==="Tab"&&A.preventDefault(),!ce&&we&&$(A.key));const ne=E.current;if(A.target!==ne||!dd.includes(A.key))return;A.preventDefault();const J=b().filter(_=>!_.disabled).map(_=>_.ref.current);Bs.includes(A.key)&&J.reverse(),Nd(J)}),onBlur:R(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(L.current),O.current="")}),onPointerMove:R(e.onPointerMove,ot(A=>{const U=A.target,X=F.current!==A.clientX;if(A.currentTarget.contains(U)&&X){const ce=A.clientX>F.current?"right":"left";B.current=ce,F.current=A.clientX}}))})})})})})})});Gs.displayName=se;var Ed="MenuGroup",vo=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(I.div,{role:"group",...o,ref:t})});vo.displayName=Ed;var Rd="MenuLabel",zs=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(I.div,{...o,ref:t})});zs.displayName=Rd;var Mt="MenuItem",Xo="menu.itemSelect",Qt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,s=a.useRef(null),i=pt(Mt,e.__scopeMenu),c=mo(Mt,e.__scopeMenu),l=k(t,s),u=a.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const h=new CustomEvent(Xo,{bubbles:!0,cancelable:!0});d.addEventListener(Xo,v=>o?.(v),{once:!0}),er(d,h),h.defaultPrevented?u.current=!1:i.onClose()}};return p.jsx(Ys,{...r,ref:l,disabled:n,onClick:R(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),u.current=!0},onPointerUp:R(e.onPointerUp,d=>{u.current||d.currentTarget?.click()}),onKeyDown:R(e.onKeyDown,d=>{const h=c.searchRef.current!=="";n||h&&d.key===" "||Tn.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Qt.displayName=Mt;var Ys=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=e,i=mo(Mt,n),c=Hs(n),l=a.useRef(null),u=k(t,l),[f,d]=a.useState(!1),[h,v]=a.useState("");return a.useEffect(()=>{const x=l.current;x&&v((x.textContent??"").trim())},[s.children]),p.jsx(nt.ItemSlot,{scope:n,disabled:o,textValue:r??h,children:p.jsx(ld,{asChild:!0,...c,focusable:!o,children:p.jsx(I.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:u,onPointerMove:R(e.onPointerMove,ot(x=>{o?i.onItemLeave(x):(i.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:R(e.onPointerLeave,ot(x=>i.onItemLeave(x))),onFocus:R(e.onFocus,()=>d(!0)),onBlur:R(e.onBlur,()=>d(!1))})})})}),Pd="MenuCheckboxItem",Xs=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return p.jsx(ei,{scope:e.__scopeMenu,checked:n,children:p.jsx(Qt,{role:"menuitemcheckbox","aria-checked":It(n)?"mixed":n,...r,ref:t,"data-state":xo(n),onSelect:R(r.onSelect,()=>o?.(It(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xs.displayName=Pd;var qs="MenuRadioGroup",[Ad,_d]=Fe(qs,{value:void 0,onValueChange:()=>{}}),Zs=a.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,s=ge(o);return p.jsx(Ad,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(vo,{...r,ref:t})})});Zs.displayName=qs;var Qs="MenuRadioItem",Js=a.forwardRef((e,t)=>{const{value:n,...o}=e,r=_d(Qs,e.__scopeMenu),s=n===r.value;return p.jsx(ei,{scope:e.__scopeMenu,checked:s,children:p.jsx(Qt,{role:"menuitemradio","aria-checked":s,...o,ref:t,"data-state":xo(s),onSelect:R(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Js.displayName=Qs;var go="MenuItemIndicator",[ei,Td]=Fe(go,{checked:!1}),ti=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,s=Td(go,n);return p.jsx(ae,{present:o||It(s.checked)||s.checked===!0,children:p.jsx(I.span,{...r,ref:t,"data-state":xo(s.checked)})})});ti.displayName=go;var Md="MenuSeparator",ni=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(I.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});ni.displayName=Md;var Id="MenuArrow",oi=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=Zt(n);return p.jsx(uo,{...r,...o,ref:t})});oi.displayName=Id;var Dd="MenuSub",[em,ri]=Fe(Dd),Je="MenuSubTrigger",si=a.forwardRef((e,t)=>{const n=$e(Je,e.__scopeMenu),o=pt(Je,e.__scopeMenu),r=ri(Je,e.__scopeMenu),s=mo(Je,e.__scopeMenu),i=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=a.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return a.useEffect(()=>f,[f]),a.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),l(null)}},[c,l]),p.jsx(fo,{asChild:!0,...u,children:p.jsx(Ys,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":ci(n.open),...e,ref:st(t,r.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:R(e.onPointerMove,ot(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:R(e.onPointerLeave,ot(d=>{f();const h=n.content?.getBoundingClientRect();if(h){const v=n.content?.dataset.side,x=v==="right",m=x?-5:5,g=h[x?"left":"right"],w=h[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:g,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x:g,y:h.bottom}],side:v}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:R(e.onKeyDown,d=>{const h=s.searchRef.current!=="";e.disabled||h&&d.key===" "||fd[o.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});si.displayName=Je;var ii="MenuSubContent",ai=a.forwardRef((e,t)=>{const n=Ks(se,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=$e(se,e.__scopeMenu),i=pt(se,e.__scopeMenu),c=ri(ii,e.__scopeMenu),l=a.useRef(null),u=k(t,l);return p.jsx(nt.Provider,{scope:e.__scopeMenu,children:p.jsx(ae,{present:o||s.open,children:p.jsx(nt.Slot,{scope:e.__scopeMenu,children:p.jsx(ho,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{i.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:R(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:R(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:R(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),h=pd[i.dir].includes(f.key);d&&h&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});ai.displayName=ii;function ci(e){return e?"open":"closed"}function It(e){return e==="indeterminate"}function xo(e){return It(e)?"indeterminate":e?"checked":"unchecked"}function Nd(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Od(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function kd(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Od(e,Math.max(s,0));r.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function jd(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],l=t[i],u=c.x,f=c.y,d=l.x,h=l.y;f>o!=h>o&&n<(d-u)*(o-f)/(h-f)+u&&(r=!r)}return r}function Ld(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return jd(n,t)}function ot(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Fd=Ws,$d=fo,Bd=Us,Vd=Gs,Hd=vo,Wd=zs,Kd=Qt,Ud=Xs,Gd=Zs,zd=Js,Yd=ti,Xd=ni,qd=oi,Zd=si,Qd=ai,Jt="DropdownMenu",[Jd]=Z(Jt,[Vs]),Q=Vs(),[ef,li]=Jd(Jt),ui=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,l=Q(t),u=a.useRef(null),[f,d]=ie({prop:r,defaultProp:s??!1,onChange:i,caller:Jt});return p.jsx(ef,{scope:t,triggerId:re(),triggerRef:u,contentId:re(),open:f,onOpenChange:d,onOpenToggle:a.useCallback(()=>d(h=>!h),[d]),modal:c,children:p.jsx(Fd,{...l,open:f,onOpenChange:d,dir:o,modal:c,children:n})})};ui.displayName=Jt;var di="DropdownMenuTrigger",fi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,s=li(di,n),i=Q(n);return p.jsx($d,{asChild:!0,...i,children:p.jsx(I.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:st(t,s.triggerRef),onPointerDown:R(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(s.onOpenToggle(),s.open||c.preventDefault())}),onKeyDown:R(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&s.onOpenToggle(),c.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});fi.displayName=di;var tf="DropdownMenuPortal",pi=e=>{const{__scopeDropdownMenu:t,...n}=e,o=Q(t);return p.jsx(Bd,{...o,...n})};pi.displayName=tf;var mi="DropdownMenuContent",hi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=li(mi,n),s=Q(n),i=a.useRef(!1);return p.jsx(Vd,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:t,onCloseAutoFocus:R(e.onCloseAutoFocus,c=>{i.current||r.triggerRef.current?.focus(),i.current=!1,c.preventDefault()}),onInteractOutside:R(e.onInteractOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hi.displayName=mi;var nf="DropdownMenuGroup",of=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Hd,{...r,...o,ref:t})});of.displayName=nf;var rf="DropdownMenuLabel",vi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Wd,{...r,...o,ref:t})});vi.displayName=rf;var sf="DropdownMenuItem",gi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Kd,{...r,...o,ref:t})});gi.displayName=sf;var af="DropdownMenuCheckboxItem",cf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Ud,{...r,...o,ref:t})});cf.displayName=af;var lf="DropdownMenuRadioGroup",uf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Gd,{...r,...o,ref:t})});uf.displayName=lf;var df="DropdownMenuRadioItem",ff=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(zd,{...r,...o,ref:t})});ff.displayName=df;var pf="DropdownMenuItemIndicator",mf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Yd,{...r,...o,ref:t})});mf.displayName=pf;var hf="DropdownMenuSeparator",xi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Xd,{...r,...o,ref:t})});xi.displayName=hf;var vf="DropdownMenuArrow",gf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(qd,{...r,...o,ref:t})});gf.displayName=vf;var xf="DropdownMenuSubTrigger",wf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Zd,{...r,...o,ref:t})});wf.displayName=xf;var yf="DropdownMenuSubContent",Cf=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Qd,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Cf.displayName=yf;var tm=ui,nm=fi,om=pi,rm=hi,sm=vi,im=gi,am=xi,bf="Label",wi=a.forwardRef((e,t)=>p.jsx(I.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));wi.displayName=bf;var cm=wi;function Dt(e,[t,n]){return Math.min(n,Math.max(t,e))}var wo="Progress",yo=100,[Sf]=Z(wo),[Ef,Rf]=Sf(wo),yi=a.forwardRef((e,t)=>{const{__scopeProgress:n,value:o=null,max:r,getValueLabel:s=Pf,...i}=e;(r||r===0)&&!qo(r)&&console.error(Af(`${r}`,"Progress"));const c=qo(r)?r:yo;o!==null&&!Zo(o,c)&&console.error(_f(`${o}`,"Progress"));const l=Zo(o,c)?o:null,u=Nt(l)?s(l,c):void 0;return p.jsx(Ef,{scope:n,value:l,max:c,children:p.jsx(I.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Nt(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":Si(l,c),"data-value":l??void 0,"data-max":c,...i,ref:t})})});yi.displayName=wo;var Ci="ProgressIndicator",bi=a.forwardRef((e,t)=>{const{__scopeProgress:n,...o}=e,r=Rf(Ci,n);return p.jsx(I.div,{"data-state":Si(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...o,ref:t})});bi.displayName=Ci;function Pf(e,t){return`${Math.round(e/t*100)}%`}function Si(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Nt(e){return typeof e=="number"}function qo(e){return Nt(e)&&!isNaN(e)&&e>0}function Zo(e,t){return Nt(e)&&!isNaN(e)&&e<=t&&e>=0}function Af(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${yo}\`.`}function _f(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
52
|
+
- a positive number
|
|
53
|
+
- less than the value passed to \`max\` (or ${yo} if no \`max\` prop is set)
|
|
54
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
55
|
+
|
|
56
|
+
Defaulting to \`null\`.`}var lm=yi,um=bi,Tf=[" ","Enter","ArrowUp","ArrowDown"],Mf=[" ","Enter"],je="Select",[en,tn,If]=it(je),[Ze]=Z(je,[If,qe]),nn=qe(),[Df,Te]=Ze(je),[Nf,Of]=Ze(je),Ei=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:i,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:h,required:v,form:x}=e,m=nn(t),[g,w]=a.useState(null),[y,C]=a.useState(null),[b,S]=a.useState(!1),P=at(u),[E,M]=ie({prop:o,defaultProp:r??!1,onChange:s,caller:je}),[L,O]=ie({prop:i,defaultProp:c,onChange:l,caller:je}),D=a.useRef(null),j=g?x||!!g.closest("form"):!0,[B,F]=a.useState(new Set),V=Array.from(B).map(N=>N.props.value).join(";");return p.jsx(ao,{...m,children:p.jsxs(Df,{required:v,scope:t,trigger:g,onTriggerChange:w,valueNode:y,onValueNodeChange:C,valueNodeHasChildren:b,onValueNodeHasChildrenChange:S,contentId:re(),value:L,onValueChange:O,open:E,onOpenChange:M,dir:P,triggerPointerDownPosRef:D,disabled:h,children:[p.jsx(en.Provider,{scope:t,children:p.jsx(Nf,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(N=>{F($=>new Set($).add(N))},[]),onNativeOptionRemove:a.useCallback(N=>{F($=>{const T=new Set($);return T.delete(N),T})},[]),children:n})}),j?p.jsxs(Yi,{"aria-hidden":!0,required:v,tabIndex:-1,name:f,autoComplete:d,value:L,onChange:N=>O(N.target.value),disabled:h,form:x,children:[L===void 0?p.jsx("option",{value:""}):null,Array.from(B)]},V):null]})})};Ei.displayName=je;var Ri="SelectTrigger",Pi=a.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=nn(n),i=Te(Ri,n),c=i.disabled||o,l=k(t,i.onTriggerChange),u=tn(n),f=a.useRef("touch"),[d,h,v]=qi(m=>{const g=u().filter(C=>!C.disabled),w=g.find(C=>C.value===i.value),y=Zi(g,m,w);y!==void 0&&i.onValueChange(y.value)}),x=m=>{c||(i.onOpenChange(!0),v()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return p.jsx(co,{asChild:!0,...s,children:p.jsx(I.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Xi(i.value)?"":void 0,...r,ref:l,onClick:R(r.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&x(m)}),onPointerDown:R(r.onPointerDown,m=>{f.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:R(r.onKeyDown,m=>{const g=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(g&&m.key===" ")&&Tf.includes(m.key)&&(x(),m.preventDefault())})})})});Pi.displayName=Ri;var Ai="SelectValue",_i=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:i="",...c}=e,l=Te(Ai,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,d=k(t,l.onValueNodeChange);return Y(()=>{u(f)},[u,f]),p.jsx(I.span,{...c,ref:d,style:{pointerEvents:"none"},children:Xi(l.value)?p.jsx(p.Fragment,{children:i}):s})});_i.displayName=Ai;var kf="SelectIcon",Ti=a.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return p.jsx(I.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Ti.displayName=kf;var jf="SelectPortal",Mi=e=>p.jsx(lt,{asChild:!0,...e});Mi.displayName=jf;var Le="SelectContent",Ii=a.forwardRef((e,t)=>{const n=Te(Le,e.__scopeSelect),[o,r]=a.useState();if(Y(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?jt.createPortal(p.jsx(Di,{scope:e.__scopeSelect,children:p.jsx(en.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(Ni,{...e,ref:t})});Ii.displayName=Le;var le=10,[Di,Me]=Ze(Le),Lf="SelectContentImpl",Ff=Ne("SelectContent.RemoveScroll"),Ni=a.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:i,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:v,sticky:x,hideWhenDetached:m,avoidCollisions:g,...w}=e,y=Te(Le,n),[C,b]=a.useState(null),[S,P]=a.useState(null),E=k(t,_=>b(_)),[M,L]=a.useState(null),[O,D]=a.useState(null),j=tn(n),[B,F]=a.useState(!1),V=a.useRef(!1);a.useEffect(()=>{if(C)return Yn(C)},[C]),zn();const N=a.useCallback(_=>{const[H,...q]=j().map(G=>G.ref.current),[W]=q.slice(-1),K=document.activeElement;for(const G of _)if(G===K||(G?.scrollIntoView({block:"nearest"}),G===H&&S&&(S.scrollTop=0),G===W&&S&&(S.scrollTop=S.scrollHeight),G?.focus(),document.activeElement!==K))return},[j,S]),$=a.useCallback(()=>N([M,C]),[N,M,C]);a.useEffect(()=>{B&&$()},[B,$]);const{onOpenChange:T,triggerPointerDownPosRef:A}=y;a.useEffect(()=>{if(C){let _={x:0,y:0};const H=W=>{_={x:Math.abs(Math.round(W.pageX)-(A.current?.x??0)),y:Math.abs(Math.round(W.pageY)-(A.current?.y??0))}},q=W=>{_.x<=10&&_.y<=10?W.preventDefault():C.contains(W.target)||T(!1),document.removeEventListener("pointermove",H),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",q,{capture:!0})}}},[C,T,A]),a.useEffect(()=>{const _=()=>T(!1);return window.addEventListener("blur",_),window.addEventListener("resize",_),()=>{window.removeEventListener("blur",_),window.removeEventListener("resize",_)}},[T]);const[U,X]=qi(_=>{const H=j().filter(K=>!K.disabled),q=H.find(K=>K.ref.current===document.activeElement),W=Zi(H,_,q);W&&setTimeout(()=>W.ref.current.focus())}),ce=a.useCallback((_,H,q)=>{const W=!V.current&&!q;(y.value!==void 0&&y.value===H||W)&&(L(_),W&&(V.current=!0))},[y.value]),we=a.useCallback(()=>C?.focus(),[C]),ne=a.useCallback((_,H,q)=>{const W=!V.current&&!q;(y.value!==void 0&&y.value===H||W)&&D(_)},[y.value]),ye=o==="popper"?Mn:Oi,J=ye===Mn?{side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:h,collisionPadding:v,sticky:x,hideWhenDetached:m,avoidCollisions:g}:{};return p.jsx(Di,{scope:n,content:C,viewport:S,onViewportChange:P,itemRefCallback:ce,selectedItem:M,onItemLeave:we,itemTextRefCallback:ne,focusSelectedItem:$,selectedItemText:O,position:o,isPositioned:B,searchRef:U,children:p.jsx(Ht,{as:Ff,allowPinchZoom:!0,children:p.jsx(Bt,{asChild:!0,trapped:y.open,onMountAutoFocus:_=>{_.preventDefault()},onUnmountAutoFocus:R(r,_=>{y.trigger?.focus({preventScroll:!0}),_.preventDefault()}),children:p.jsx(ct,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:_=>_.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:p.jsx(ye,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:_=>_.preventDefault(),...w,...J,onPlaced:()=>F(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:R(w.onKeyDown,_=>{const H=_.ctrlKey||_.altKey||_.metaKey;if(_.key==="Tab"&&_.preventDefault(),!H&&_.key.length===1&&X(_.key),["ArrowUp","ArrowDown","Home","End"].includes(_.key)){let W=j().filter(K=>!K.disabled).map(K=>K.ref.current);if(["ArrowUp","End"].includes(_.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(_.key)){const K=_.target,G=W.indexOf(K);W=W.slice(G+1)}setTimeout(()=>N(W)),_.preventDefault()}})})})})})})});Ni.displayName=Lf;var $f="SelectItemAlignedPosition",Oi=a.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=Te(Le,n),i=Me(Le,n),[c,l]=a.useState(null),[u,f]=a.useState(null),d=k(t,E=>f(E)),h=tn(n),v=a.useRef(!1),x=a.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:w,focusSelectedItem:y}=i,C=a.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&m&&g&&w){const E=s.trigger.getBoundingClientRect(),M=u.getBoundingClientRect(),L=s.valueNode.getBoundingClientRect(),O=w.getBoundingClientRect();if(s.dir!=="rtl"){const K=O.left-M.left,G=L.left-K,oe=E.left-G,Ie=E.width+oe,cn=Math.max(Ie,M.width),ln=window.innerWidth-le,un=Dt(G,[le,Math.max(le,ln-cn)]);c.style.minWidth=Ie+"px",c.style.left=un+"px"}else{const K=M.right-O.right,G=window.innerWidth-L.right-K,oe=window.innerWidth-E.right-G,Ie=E.width+oe,cn=Math.max(Ie,M.width),ln=window.innerWidth-le,un=Dt(G,[le,Math.max(le,ln-cn)]);c.style.minWidth=Ie+"px",c.style.right=un+"px"}const D=h(),j=window.innerHeight-le*2,B=m.scrollHeight,F=window.getComputedStyle(u),V=parseInt(F.borderTopWidth,10),N=parseInt(F.paddingTop,10),$=parseInt(F.borderBottomWidth,10),T=parseInt(F.paddingBottom,10),A=V+N+B+T+$,U=Math.min(g.offsetHeight*5,A),X=window.getComputedStyle(m),ce=parseInt(X.paddingTop,10),we=parseInt(X.paddingBottom,10),ne=E.top+E.height/2-le,ye=j-ne,J=g.offsetHeight/2,_=g.offsetTop+J,H=V+N+_,q=A-H;if(H<=ne){const K=D.length>0&&g===D[D.length-1].ref.current;c.style.bottom="0px";const G=u.clientHeight-m.offsetTop-m.offsetHeight,oe=Math.max(ye,J+(K?we:0)+G+$),Ie=H+oe;c.style.height=Ie+"px"}else{const K=D.length>0&&g===D[0].ref.current;c.style.top="0px";const oe=Math.max(ne,V+m.offsetTop+(K?ce:0)+J)+q;c.style.height=oe+"px",m.scrollTop=H-ne+m.offsetTop}c.style.margin=`${le}px 0`,c.style.minHeight=U+"px",c.style.maxHeight=j+"px",o?.(),requestAnimationFrame(()=>v.current=!0)}},[h,s.trigger,s.valueNode,c,u,m,g,w,s.dir,o]);Y(()=>C(),[C]);const[b,S]=a.useState();Y(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const P=a.useCallback(E=>{E&&x.current===!0&&(C(),y?.(),x.current=!1)},[C,y]);return p.jsx(Vf,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:P,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:p.jsx(I.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Oi.displayName=$f;var Bf="SelectPopperPosition",Mn=a.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=le,...s}=e,i=nn(n);return p.jsx(lo,{...i,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.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)"}})});Mn.displayName=Bf;var[Vf,Co]=Ze(Le,{}),In="SelectViewport",ki=a.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Me(In,n),i=Co(In,n),c=k(t,s.onViewportChange),l=a.useRef(0);return p.jsxs(p.Fragment,{children:[p.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:o}),p.jsx(en.Slot,{scope:n,children:p.jsx(I.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h?.current&&d){const v=Math.abs(l.current-f.scrollTop);if(v>0){const x=window.innerHeight-le*2,m=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),w=Math.max(m,g);if(w<x){const y=w+v,C=Math.min(x,y),b=y-C;d.style.height=C+"px",d.style.bottom==="0px"&&(f.scrollTop=b>0?b:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});ki.displayName=In;var ji="SelectGroup",[Hf,Wf]=Ze(ji),Li=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=re();return p.jsx(Hf,{scope:n,id:r,children:p.jsx(I.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Li.displayName=ji;var Fi="SelectLabel",$i=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Wf(Fi,n);return p.jsx(I.div,{id:r.id,...o,ref:t})});$i.displayName=Fi;var Ot="SelectItem",[Kf,Bi]=Ze(Ot),Vi=a.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...i}=e,c=Te(Ot,n),l=Me(Ot,n),u=c.value===o,[f,d]=a.useState(s??""),[h,v]=a.useState(!1),x=k(t,y=>l.itemRefCallback?.(y,o,r)),m=re(),g=a.useRef("touch"),w=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(Kf,{scope:n,value:o,disabled:r,textId:m,isSelected:u,onItemTextChange:a.useCallback(y=>{d(C=>C||(y?.textContent??"").trim())},[]),children:p.jsx(en.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:p.jsx(I.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:x,onFocus:R(i.onFocus,()=>v(!0)),onBlur:R(i.onBlur,()=>v(!1)),onClick:R(i.onClick,()=>{g.current!=="mouse"&&w()}),onPointerUp:R(i.onPointerUp,()=>{g.current==="mouse"&&w()}),onPointerDown:R(i.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:R(i.onPointerMove,y=>{g.current=y.pointerType,r?l.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(i.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:R(i.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(Mf.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});Vi.displayName=Ot;var et="SelectItemText",Hi=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,i=Te(et,n),c=Me(et,n),l=Bi(et,n),u=Of(et,n),[f,d]=a.useState(null),h=k(t,w=>d(w),l.onItemTextChange,w=>c.itemTextRefCallback?.(w,l.value,l.disabled)),v=f?.textContent,x=a.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Y(()=>(m(x),()=>g(x)),[m,g,x]),p.jsxs(p.Fragment,{children:[p.jsx(I.span,{id:l.textId,...s,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?jt.createPortal(s.children,i.valueNode):null]})});Hi.displayName=et;var Wi="SelectItemIndicator",Ki=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Bi(Wi,n).isSelected?p.jsx(I.span,{"aria-hidden":!0,...o,ref:t}):null});Ki.displayName=Wi;var Dn="SelectScrollUpButton",Ui=a.forwardRef((e,t)=>{const n=Me(Dn,e.__scopeSelect),o=Co(Dn,e.__scopeSelect),[r,s]=a.useState(!1),i=k(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(zi,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Ui.displayName=Dn;var Nn="SelectScrollDownButton",Gi=a.forwardRef((e,t)=>{const n=Me(Nn,e.__scopeSelect),o=Co(Nn,e.__scopeSelect),[r,s]=a.useState(!1),i=k(t,o.onScrollButtonChange);return Y(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;s(f)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(zi,{...e,ref:i,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Gi.displayName=Nn;var zi=a.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Me("SelectScrollButton",n),i=a.useRef(null),c=tn(n),l=a.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return a.useEffect(()=>()=>l(),[l]),Y(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),p.jsx(I.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(o,50))}),onPointerMove:R(r.onPointerMove,()=>{s.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(o,50))}),onPointerLeave:R(r.onPointerLeave,()=>{l()})})}),Uf="SelectSeparator",Gf=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return p.jsx(I.div,{"aria-hidden":!0,...o,ref:t})});Gf.displayName=Uf;var On="SelectArrow",zf=a.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=nn(n),s=Te(On,n),i=Me(On,n);return s.open&&i.position==="popper"?p.jsx(uo,{...r,...o,ref:t}):null});zf.displayName=On;var Yf="SelectBubbleInput",Yi=a.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=a.useRef(null),s=k(o,r),i=Kt(t);return a.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const d=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[i,t]),p.jsx(I.select,{...n,style:{...tr,...n.style},ref:s,defaultValue:t})});Yi.displayName=Yf;function Xi(e){return e===""||e===void 0}function qi(e){const t=ge(e),n=a.useRef(""),o=a.useRef(0),r=a.useCallback(i=>{const c=n.current+i;t(c),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=a.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function Zi(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Xf(e,Math.max(s,0));r.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Xf(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var dm=Ei,fm=Pi,pm=_i,mm=Ti,hm=Mi,vm=Ii,gm=ki,xm=Li,wm=$i,ym=Vi,Cm=Hi,bm=Ki,Sm=Ui,Em=Gi,Qi=["PageUp","PageDown"],Ji=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ea={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Qe="Slider",[kn,qf,Zf]=it(Qe),[ta]=Z(Qe,[Zf]),[Qf,on]=ta(Qe),na=a.forwardRef((e,t)=>{const{name:n,min:o=0,max:r=100,step:s=1,orientation:i="horizontal",disabled:c=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[o],value:f,onValueChange:d=()=>{},onValueCommit:h=()=>{},inverted:v=!1,form:x,...m}=e,g=a.useRef(new Set),w=a.useRef(0),C=i==="horizontal"?Jf:ep,[b=[],S]=ie({prop:f,defaultProp:u,onChange:D=>{[...g.current][w.current]?.focus(),d(D)}}),P=a.useRef(b);function E(D){const j=sp(b,D);O(D,j)}function M(D){O(D,w.current)}function L(){const D=P.current[w.current];b[w.current]!==D&&h(b)}function O(D,j,{commit:B}={commit:!1}){const F=lp(s),V=up(Math.round((D-o)/s)*s+o,F),N=Dt(V,[o,r]);S(($=[])=>{const T=op($,N,j);if(cp(T,l*s)){w.current=T.indexOf(N);const A=String(T)!==String($);return A&&B&&h(T),A?T:$}else return $})}return p.jsx(Qf,{scope:e.__scopeSlider,name:n,disabled:c,min:o,max:r,valueIndexToChangeRef:w,thumbs:g.current,values:b,orientation:i,form:x,children:p.jsx(kn.Provider,{scope:e.__scopeSlider,children:p.jsx(kn.Slot,{scope:e.__scopeSlider,children:p.jsx(C,{"aria-disabled":c,"data-disabled":c?"":void 0,...m,ref:t,onPointerDown:R(m.onPointerDown,()=>{c||(P.current=b)}),min:o,max:r,inverted:v,onSlideStart:c?void 0:E,onSlideMove:c?void 0:M,onSlideEnd:c?void 0:L,onHomeKeyDown:()=>!c&&O(o,0,{commit:!0}),onEndKeyDown:()=>!c&&O(r,b.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:j})=>{if(!c){const V=Qi.includes(D.key)||D.shiftKey&&Ji.includes(D.key)?10:1,N=w.current,$=b[N],T=s*V*j;O($+T,N,{commit:!0})}}})})})})});na.displayName=Qe;var[oa,ra]=ta(Qe,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Jf=a.forwardRef((e,t)=>{const{min:n,max:o,dir:r,inverted:s,onSlideStart:i,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...f}=e,[d,h]=a.useState(null),v=k(t,C=>h(C)),x=a.useRef(void 0),m=at(r),g=m==="ltr",w=g&&!s||!g&&s;function y(C){const b=x.current||d.getBoundingClientRect(),S=[0,b.width],E=bo(S,w?[n,o]:[o,n]);return x.current=b,E(C-b.left)}return p.jsx(oa,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:p.jsx(sa,{dir:m,"data-orientation":"horizontal",...f,ref:v,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const b=y(C.clientX);i?.(b)},onSlideMove:C=>{const b=y(C.clientX);c?.(b)},onSlideEnd:()=>{x.current=void 0,l?.()},onStepKeyDown:C=>{const S=ea[w?"from-left":"from-right"].includes(C.key);u?.({event:C,direction:S?-1:1})}})})}),ep=a.forwardRef((e,t)=>{const{min:n,max:o,inverted:r,onSlideStart:s,onSlideMove:i,onSlideEnd:c,onStepKeyDown:l,...u}=e,f=a.useRef(null),d=k(t,f),h=a.useRef(void 0),v=!r;function x(m){const g=h.current||f.current.getBoundingClientRect(),w=[0,g.height],C=bo(w,v?[o,n]:[n,o]);return h.current=g,C(m-g.top)}return p.jsx(oa,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:p.jsx(sa,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const g=x(m.clientY);s?.(g)},onSlideMove:m=>{const g=x(m.clientY);i?.(g)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:m=>{const w=ea[v?"from-bottom":"from-top"].includes(m.key);l?.({event:m,direction:w?-1:1})}})})}),sa=a.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:i,onEndKeyDown:c,onStepKeyDown:l,...u}=e,f=on(Qe,n);return p.jsx(I.span,{...u,ref:t,onKeyDown:R(e.onKeyDown,d=>{d.key==="Home"?(i(d),d.preventDefault()):d.key==="End"?(c(d),d.preventDefault()):Qi.concat(Ji).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:R(e.onPointerDown,d=>{const h=d.target;h.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(h)?h.focus():o(d)}),onPointerMove:R(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&r(d)}),onPointerUp:R(e.onPointerUp,d=>{const h=d.target;h.hasPointerCapture(d.pointerId)&&(h.releasePointerCapture(d.pointerId),s(d))})})}),ia="SliderTrack",aa=a.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=on(ia,n);return p.jsx(I.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});aa.displayName=ia;var jn="SliderRange",ca=a.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=on(jn,n),s=ra(jn,n),i=a.useRef(null),c=k(t,i),l=r.values.length,u=r.values.map(h=>da(h,r.min,r.max)),f=l>1?Math.min(...u):0,d=100-Math.max(...u);return p.jsx(I.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:c,style:{...e.style,[s.startEdge]:f+"%",[s.endEdge]:d+"%"}})});ca.displayName=jn;var Ln="SliderThumb",la=a.forwardRef((e,t)=>{const n=qf(e.__scopeSlider),[o,r]=a.useState(null),s=k(t,c=>r(c)),i=a.useMemo(()=>o?n().findIndex(c=>c.ref.current===o):-1,[n,o]);return p.jsx(tp,{...e,ref:s,index:i})}),tp=a.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:r,...s}=e,i=on(Ln,n),c=ra(Ln,n),[l,u]=a.useState(null),f=k(t,y=>u(y)),d=l?i.form||!!l.closest("form"):!0,h=Ut(l),v=i.values[o],x=v===void 0?0:da(v,i.min,i.max),m=rp(o,i.values.length),g=h?.[c.size],w=g?ip(g,x,c.direction):0;return a.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${x}% + ${w}px)`},children:[p.jsx(kn.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(I.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":i.min,"aria-valuenow":v,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0,...s,ref:f,style:v===void 0?{display:"none"}:e.style,onFocus:R(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})}),d&&p.jsx(ua,{name:r??(i.name?i.name+(i.values.length>1?"[]":""):void 0),form:i.form,value:v},o)]})});la.displayName=Ln;var np="RadioBubbleInput",ua=a.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const r=a.useRef(null),s=k(r,o),i=Kt(t);return a.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&f){const d=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[i,t]),p.jsx(I.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});ua.displayName=np;function op(e=[],t,n){const o=[...e];return o[n]=t,o.sort((r,s)=>r-s)}function da(e,t,n){const s=100/(n-t)*(e-t);return Dt(s,[0,100])}function rp(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function sp(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),o=Math.min(...n);return n.indexOf(o)}function ip(e,t,n){const o=e/2,s=bo([0,50],[0,o]);return(o-s(t)*n)*n}function ap(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function cp(e,t){if(t>0){const n=ap(e);return Math.min(...n)>=t}return!0}function bo(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function lp(e){return(String(e).split(".")[1]||"").length}function up(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Rm=na,Pm=aa,Am=ca,_m=la,rn="Switch",[dp]=Z(rn),[fp,pp]=dp(rn),fa=a.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:i,disabled:c,value:l="on",onCheckedChange:u,form:f,...d}=e,[h,v]=a.useState(null),x=k(t,C=>v(C)),m=a.useRef(!1),g=h?f||!!h.closest("form"):!0,[w,y]=ie({prop:r,defaultProp:s??!1,onChange:u,caller:rn});return p.jsxs(fp,{scope:n,checked:w,disabled:c,children:[p.jsx(I.button,{type:"button",role:"switch","aria-checked":w,"aria-required":i,"data-state":va(w),"data-disabled":c?"":void 0,disabled:c,value:l,...d,ref:x,onClick:R(e.onClick,C=>{y(b=>!b),g&&(m.current=C.isPropagationStopped(),m.current||C.stopPropagation())})}),g&&p.jsx(ha,{control:h,bubbles:!m.current,name:o,value:l,checked:w,required:i,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});fa.displayName=rn;var pa="SwitchThumb",ma=a.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=pp(pa,n);return p.jsx(I.span,{"data-state":va(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});ma.displayName=pa;var mp="SwitchBubbleInput",ha=a.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const i=a.useRef(null),c=k(i,s),l=Kt(n),u=Ut(t);return a.useEffect(()=>{const f=i.current;if(!f)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&v){const x=new Event("click",{bubbles:o});v.call(f,n),f.dispatchEvent(x)}},[l,n,o]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:c,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ha.displayName=mp;function va(e){return e?"checked":"unchecked"}var Tm=fa,Mm=ma,[sn]=Z("Tooltip",[qe]),an=qe(),ga="TooltipProvider",hp=700,Fn="tooltip.open",[vp,So]=sn(ga),xa=e=>{const{__scopeTooltip:t,delayDuration:n=hp,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,i=a.useRef(!0),c=a.useRef(!1),l=a.useRef(0);return a.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),p.jsx(vp,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};xa.displayName=ga;var rt="Tooltip",[gp,mt]=sn(rt),wa=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=e,l=So(rt,e.__scopeTooltip),u=an(t),[f,d]=a.useState(null),h=re(),v=a.useRef(0),x=i??l.disableHoverableContent,m=c??l.delayDuration,g=a.useRef(!1),[w,y]=ie({prop:o,defaultProp:r??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(Fn))):l.onClose(),s?.(E)},caller:rt}),C=a.useMemo(()=>w?g.current?"delayed-open":"instant-open":"closed",[w]),b=a.useCallback(()=>{window.clearTimeout(v.current),v.current=0,g.current=!1,y(!0)},[y]),S=a.useCallback(()=>{window.clearTimeout(v.current),v.current=0,y(!1)},[y]),P=a.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{g.current=!0,y(!0),v.current=0},m)},[m,y]);return a.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),p.jsx(ao,{...u,children:p.jsx(gp,{scope:t,contentId:h,open:w,stateAttribute:C,trigger:f,onTriggerChange:d,onTriggerEnter:a.useCallback(()=>{l.isOpenDelayedRef.current?P():b()},[l.isOpenDelayedRef,P,b]),onTriggerLeave:a.useCallback(()=>{x?S():(window.clearTimeout(v.current),v.current=0)},[S,x]),onOpen:b,onClose:S,disableHoverableContent:x,children:n})})};wa.displayName=rt;var $n="TooltipTrigger",ya=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=mt($n,n),s=So($n,n),i=an(n),c=a.useRef(null),l=k(t,c,r.onTriggerChange),u=a.useRef(!1),f=a.useRef(!1),d=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(co,{asChild:!0,...i,children:p.jsx(I.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:R(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:R(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:R(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:R(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:R(e.onBlur,r.onClose),onClick:R(e.onClick,r.onClose)})})});ya.displayName=$n;var Eo="TooltipPortal",[xp,wp]=sn(Eo,{forceMount:void 0}),Ca=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=mt(Eo,t);return p.jsx(xp,{scope:t,forceMount:n,children:p.jsx(ae,{present:n||s.open,children:p.jsx(lt,{asChild:!0,container:r,children:o})})})};Ca.displayName=Eo;var ze="TooltipContent",ba=a.forwardRef((e,t)=>{const n=wp(ze,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,i=mt(ze,e.__scopeTooltip);return p.jsx(ae,{present:o||i.open,children:i.disableHoverableContent?p.jsx(Sa,{side:r,...s,ref:t}):p.jsx(yp,{side:r,...s,ref:t})})}),yp=a.forwardRef((e,t)=>{const n=mt(ze,e.__scopeTooltip),o=So(ze,e.__scopeTooltip),r=a.useRef(null),s=k(t,r),[i,c]=a.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:d}=o,h=a.useCallback(()=>{c(null),d(!1)},[d]),v=a.useCallback((x,m)=>{const g=x.currentTarget,w={x:x.clientX,y:x.clientY},y=Ep(w,g.getBoundingClientRect()),C=Rp(w,y),b=Pp(m.getBoundingClientRect()),S=_p([...C,...b]);c(S),d(!0)},[d]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(l&&f){const x=g=>v(g,f),m=g=>v(g,l);return l.addEventListener("pointerleave",x),f.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",m)}}},[l,f,v,h]),a.useEffect(()=>{if(i){const x=m=>{const g=m.target,w={x:m.clientX,y:m.clientY},y=l?.contains(g)||f?.contains(g),C=!Ap(w,i);y?h():C&&(h(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,f,i,u,h]),p.jsx(Sa,{...e,ref:s})}),[Cp,bp]=sn(rt,{isInside:!1}),Sp=Jo("TooltipContent"),Sa=a.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=e,l=mt(ze,n),u=an(n),{onClose:f}=l;return a.useEffect(()=>(document.addEventListener(Fn,f),()=>document.removeEventListener(Fn,f)),[f]),a.useEffect(()=>{if(l.trigger){const d=h=>{h.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),p.jsx(ct,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:p.jsxs(lo,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(Sp,{children:o}),p.jsx(Cp,{scope:n,isInside:!0,children:p.jsx(Oa,{id:l.contentId,role:"tooltip",children:r||o})})]})})});ba.displayName=ze;var Ea="TooltipArrow",Ra=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=an(n);return bp(Ea,n).isInside?null:p.jsx(uo,{...r,...o,ref:t})});Ra.displayName=Ea;function Ep(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Rp(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Pp(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Ap(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],l=t[i],u=c.x,f=c.y,d=l.x,h=l.y;f>o!=h>o&&n<(d-u)*(o-f)/(h-f)+u&&(r=!r)}return r}function _p(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Tp(t)}function Tp(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Im=xa,Dm=wa,Nm=ya,Om=Ca,km=ba,jm=Ra,Mp=Symbol.for("react.lazy"),kt=Bn[" use ".trim().toString()];function Ip(e){return typeof e=="object"&&e!==null&&"then"in e}function Pa(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Mp&&"_payload"in e&&Ip(e._payload)}function Lm(e){const t=Dp(e),n=a.forwardRef((o,r)=>{let{children:s,...i}=o;Pa(s)&&typeof kt=="function"&&(s=kt(s._payload));const c=a.Children.toArray(s),l=c.find(Op);if(l){const u=l.props.children,f=c.map(d=>d===l?a.Children.count(u)>1?a.Children.only(null):a.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...i,ref:r,children:a.isValidElement(u)?a.cloneElement(u,void 0,f):null})}return p.jsx(t,{...i,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Dp(e){const t=a.forwardRef((n,o)=>{let{children:r,...s}=n;if(Pa(r)&&typeof kt=="function"&&(r=kt(r._payload)),a.isValidElement(r)){const i=jp(r),c=kp(s,r.props);return r.type!==a.Fragment&&(c.ref=o?st(o,i):i),a.cloneElement(r,c)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Np=Symbol("radix.slottable");function Op(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Np}function kp(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function jp(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)}export{tm as $,Jp as A,Zp as B,bl as C,El as D,qp as E,Gp as F,xm as G,Hp as H,mm as I,zp as J,Yp as K,wm as L,Im as M,Dm as N,Cl as O,yl as P,Nm as Q,xl as R,$p as S,Sl as T,Om as U,pm as V,km as W,jm as X,Ya as Y,ir as Z,ar as _,st as a,nm as a0,om as a1,rm as a2,sm as a3,im as a4,am as a5,Tm as a6,Mm as a7,Rm as a8,Pm as a9,Am as aa,_m as ab,zr as b,Lm as c,cm as d,dm as e,fm as f,hm as g,vm as h,gm as i,ym as j,bm as k,Cm as l,Sm as m,Em as n,lm as o,um as p,Ll as q,Fl as r,Bp as s,Vp as t,re as u,Wp as v,Kp as w,Up as x,Xp as y,Qp as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{R as V}from"./vendor-query-SzWcOU0G.js";var ve=t=>t.type==="checkbox",de=t=>t instanceof Date,Y=t=>t==null;const kt=t=>typeof t=="object";var B=t=>!Y(t)&&!Array.isArray(t)&&kt(t)&&!de(t),wt=t=>B(t)&&t.target?ve(t.target)?t.target.checked:t.target.value:t,Dt=(t,s)=>s.split(".").some((e,r,u)=>!isNaN(Number(e))&&t.has(u.slice(0,r).join("."))),Kt=t=>{const s=t.constructor&&t.constructor.prototype;return B(s)&&s.hasOwnProperty("isPrototypeOf")},ze=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function M(t){if(t instanceof Date)return new Date(t);const s=typeof FileList<"u"&&t instanceof FileList;if(ze&&(t instanceof Blob||s))return t;const e=Array.isArray(t);if(!e&&!(B(t)&&Kt(t)))return t;const r=e?[]:Object.create(Object.getPrototypeOf(t));for(const u in t)Object.prototype.hasOwnProperty.call(t,u)&&(r[u]=M(t[u]));return r}var Ae=t=>/^\w*$/.test(t),R=t=>t===void 0,xe=t=>Array.isArray(t)?t.filter(Boolean):[],Je=t=>xe(t.replace(/["|']|\]/g,"").split(/\.|\[/)),c=(t,s,e)=>{if(!s||!B(t))return e;const u=(Ae(s)?[s]:Je(s)).reduce((n,o)=>Y(n)?void 0:n[o],t);return R(u)||u===t?R(t[s])?e:t[s]:u},Z=t=>typeof t=="boolean",$=t=>typeof t=="function",O=(t,s,e)=>{let r=-1;const u=Ae(s)?[s]:Je(s),n=u.length,o=n-1;for(;++r<n;){const d=u[r];let k=e;if(r!==o){const x=t[d];k=B(x)||Array.isArray(x)?x:isNaN(+u[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;t[d]=k,t=t[d]}};const ue={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},te={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},se={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Te="form",Et="root",Qe=V.createContext(null);Qe.displayName="HookFormControlContext";const pe=()=>V.useContext(Qe);var St=(t,s,e,r=!0)=>{const u={};for(const n in t)Object.defineProperty(u,n,{get:()=>{const o=n;return s._proxyFormState[o]!==te.all&&(s._proxyFormState[o]=!r||te.all),e&&(e[o]=!0),t[o]}});return u};const ke=typeof window<"u"?V.useLayoutEffect:V.useEffect;function Yt(t){const s=pe(),{control:e=s,disabled:r,name:u,exact:n}=t||{},[o,d]=V.useState(()=>({...e._formState,defaultValues:e._defaultValues})),k=V.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ke(()=>e._subscribe({name:u,formState:k.current,exact:n,callback:x=>{!r&&d({...e._formState,...x,defaultValues:e._defaultValues})}}),[u,r,n]),V.useEffect(()=>{k.current.isValid&&e._setValid(!0)},[e]),V.useMemo(()=>St(o,e,k.current,!1),[o,e])}var G=t=>typeof t=="string",He=(t,s,e,r,u)=>G(t)?(r&&s.watch.add(t),c(e,t,u)):Array.isArray(t)?t.map(n=>(r&&s.watch.add(n),c(e,n))):(r&&(s.watchAll=!0),e),je=t=>Y(t)||!kt(t);function ee(t,s,e=new WeakSet){if(t===s)return!0;if(je(t)||je(s))return Object.is(t,s);if(de(t)&&de(s))return Object.is(t.getTime(),s.getTime());const r=Object.keys(t),u=Object.keys(s);if(r.length!==u.length)return!1;if(e.has(t)||e.has(s))return!0;e.add(t),e.add(s);for(const n of r){const o=t[n];if(!(n in s))return!1;if(n!=="ref"){const d=s[n];if(de(o)&&de(d)||(B(o)||Array.isArray(o))&&(B(d)||Array.isArray(d))?!ee(o,d,e):!Object.is(o,d))return!1}}return!0}function zt(t){const s=pe(),{control:e=s,name:r,defaultValue:u,disabled:n,exact:o,compute:d}=t||{},k=V.useRef(u),x=V.useRef(d),W=V.useRef(void 0),v=V.useRef(e),w=V.useRef(r);x.current=d;const[F,q]=V.useState(()=>{const m=e._getWatch(r,k.current);return x.current?x.current(m):m}),I=V.useCallback(m=>{const _=He(r,e._names,m||e._formValues,!1,k.current);return x.current?x.current(_):_},[e._formValues,e._names,r]),N=V.useCallback(m=>{if(!n){const _=He(r,e._names,m||e._formValues,!1,k.current);if(x.current){const b=x.current(_);ee(b,W.current)||(q(b),W.current=b)}else q(_)}},[e._formValues,e._names,n,r]);ke(()=>((v.current!==e||!ee(w.current,r))&&(v.current=e,w.current=r,N()),e._subscribe({name:r,formState:{values:!0},exact:o,callback:m=>{N(m.values)}})),[e,o,r,N]),V.useEffect(()=>e._removeUnmounted());const L=v.current!==e,A=w.current,S=V.useMemo(()=>{if(n)return null;const m=!L&&!ee(A,r);return L||m?I():null},[n,L,r,A,I]);return S!==null?S:F}function Jt(t){const s=pe(),{name:e,disabled:r,control:u=s,shouldUnregister:n,defaultValue:o,exact:d=!0}=t,k=Dt(u._names.array,e),x=V.useMemo(()=>c(u._formValues,e,c(u._defaultValues,e,o)),[u,e,o]),W=zt({control:u,name:e,defaultValue:x,exact:d}),v=Yt({control:u,name:e,exact:d}),w=V.useRef(t),F=V.useRef(u.register(e,{...t.rules,value:W,...Z(t.disabled)?{disabled:t.disabled}:{}}));w.current=t;const q=V.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!c(v.errors,e)},isDirty:{enumerable:!0,get:()=>!!c(v.dirtyFields,e)},isTouched:{enumerable:!0,get:()=>!!c(v.touchedFields,e)},isValidating:{enumerable:!0,get:()=>!!c(v.validatingFields,e)},error:{enumerable:!0,get:()=>c(v.errors,e)}}),[v,e]),I=V.useCallback(S=>F.current.onChange({target:{value:wt(S),name:e},type:ue.CHANGE}),[e]),N=V.useCallback(()=>F.current.onBlur({target:{value:c(u._formValues,e),name:e},type:ue.BLUR}),[e,u._formValues]),L=V.useCallback(S=>{const m=c(u._fields,e);m&&m._f&&S&&(m._f.ref={focus:()=>$(S.focus)&&S.focus(),select:()=>$(S.select)&&S.select(),setCustomValidity:_=>$(S.setCustomValidity)&&S.setCustomValidity(_),reportValidity:()=>$(S.reportValidity)&&S.reportValidity()})},[u._fields,e]),A=V.useMemo(()=>({name:e,value:W,...Z(r)||v.disabled?{disabled:v.disabled||r}:{},onChange:I,onBlur:N,ref:L}),[e,r,v.disabled,I,N,L,W]);return V.useEffect(()=>{const S=u._options.shouldUnregister||n;u.register(e,{...w.current.rules,...Z(w.current.disabled)?{disabled:w.current.disabled}:{}});const m=(_,b)=>{const C=c(u._fields,_);C&&C._f&&(C._f.mount=b)};if(m(e,!0),S){const _=M(c(u._options.defaultValues,e,w.current.defaultValue));O(u._defaultValues,e,_),R(c(u._formValues,e))&&O(u._formValues,e,_)}return!k&&u.register(e),()=>{(k?S&&!u._state.action:S)?u.unregister(e):m(e,!1)}},[e,u,k,n]),V.useEffect(()=>{u._setDisabledField({disabled:r,name:e})},[r,e,u]),V.useMemo(()=>({field:A,formState:v,fieldState:q}),[A,v,q])}const mr=t=>t.render(Jt(t)),Xe=V.createContext(null);Xe.displayName="HookFormContext";const hr=()=>V.useContext(Xe),vr=t=>{const{children:s,watch:e,getValues:r,getFieldState:u,setError:n,clearErrors:o,setValue:d,setValues:k,trigger:x,formState:W,resetField:v,reset:w,handleSubmit:F,unregister:q,control:I,register:N,setFocus:L,subscribe:A}=t,S=V.useMemo(()=>({watch:e,getValues:r,getFieldState:u,setError:n,clearErrors:o,setValue:d,setValues:k,trigger:x,formState:W,resetField:v,reset:w,handleSubmit:F,unregister:q,control:I,register:N,setFocus:L,subscribe:A}),[o,I,W,u,r,F,N,w,v,n,L,d,k,A,x,q,e]);return V.createElement(Xe.Provider,{value:S},V.createElement(Qe.Provider,{value:S.control},s))};var Qt=(t,s,e,r,u)=>s?{...e[t],types:{...e[t]&&e[t].types?e[t].types:{},[r]:u||!0}}:{},J=t=>Array.isArray(t)?t:[t],_t=()=>{let t=[];return{get observers(){return t},next:u=>{for(const n of t)n.next&&n.next(u)},subscribe:u=>(t.push(u),{unsubscribe:()=>{t=t.filter(n=>n!==u)}}),unsubscribe:()=>{t=[]}}};function Ct(t,s){const e={};for(const r in t)if(t.hasOwnProperty(r)){const u=t[r],n=s[r];if(u&&B(u)&&n){const o=Ct(u,n);B(o)&&(e[r]=o)}else t[r]&&(e[r]=n)}return e}var H=t=>B(t)&&!Object.keys(t).length,Ze=t=>t.type==="file",be=t=>{if(!ze)return!1;const s=t?t.ownerDocument:0;return t instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},Ot=t=>t.type==="select-multiple",et=t=>t.type==="radio",Xt=t=>et(t)||ve(t),Me=t=>be(t)&&t.isConnected;function Zt(t,s){const e=s.slice(0,-1).length;let r=0;for(;r<e;){if(Y(t)){t=void 0;break}t=t[s[r]],r++}return t}function er(t){for(const s in t)if(t.hasOwnProperty(s)&&!R(t[s]))return!1;return!0}function P(t,s){if(G(s)&&Object.prototype.hasOwnProperty.call(t,s))return delete t[s],t;const e=Array.isArray(s)?s:Ae(s)?[s]:Je(s),r=e.length===1?t:Zt(t,e),u=e.length-1,n=e[u];return r&&delete r[n],u!==0&&(B(r)&&H(r)||Array.isArray(r)&&er(r))&&P(t,e.slice(0,-1)),t}var tr=t=>{for(const s in t)if($(t[s]))return!0;return!1};function Rt(t){return Array.isArray(t)||B(t)&&!tr(t)}function $e(t,s={}){for(const e in t){const r=t[e];Rt(r)?(s[e]=Array.isArray(r)?[]:{},$e(r,s[e])):R(r)||(s[e]=!0)}return s}function Ge(t){if(t!==!1){if(t===!0)return!0;if(Array.isArray(t)){const s=t.map(e=>Ge(e));return s.some(e=>e!==void 0)?s:void 0}if(B(t)){const s={};for(const e in t){const r=Ge(t[e]);R(r)||(s[e]=r)}return Object.keys(s).length?s:void 0}}}function he(t,s,e){e||(e=$e(s));for(const r in t){const u=t[r];if(Rt(u))R(s)||je(e[r])?e[r]=$e(u,Array.isArray(u)?[]:{}):he(u,Y(s)?{}:s[r],e[r]);else{const n=s[r];e[r]=!ee(u,n)}}return Ge(e)||{}}const gt={value:!1,isValid:!1},mt={value:!0,isValid:!0};var Tt=t=>{if(Array.isArray(t)){if(t.length>1){const s=t.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:s,isValid:!!s.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!R(t[0].attributes.value)?R(t[0].value)||t[0].value===""?mt:{value:t[0].value,isValid:!0}:mt:gt}return gt},Mt=(t,{valueAsNumber:s,valueAsDate:e,setValueAs:r})=>R(t)?t:s?t===""?NaN:t&&+t:e&&G(t)?new Date(t):r?r(t):t;const ht={isValid:!1,value:null};var Ut=t=>Array.isArray(t)?t.reduce((s,e)=>e&&e.checked&&!e.disabled?{isValid:!0,value:e.value}:s,ht):ht;function vt(t){const s=t.ref;return Ze(s)?s.files:et(s)?Ut(t.refs).value:Ot(s)?[...s.selectedOptions].map(({value:e})=>e):ve(s)?Tt(t.refs).value:Mt(R(s.value)?t.ref.value:s.value,t)}var rr=(t,s,e,r)=>{const u={};for(const n of t){const o=c(s,n);o&&O(u,n,o._f)}return{criteriaMode:e,names:[...t],fields:u,shouldUseNativeValidation:r}},Fe=t=>t instanceof RegExp,me=t=>R(t)?t:Fe(t)?t.source:B(t)?Fe(t.value)?t.value.source:t.value:t,fe=t=>({isOnSubmit:!t||t===te.onSubmit,isOnBlur:t===te.onBlur,isOnChange:t===te.onChange,isOnAll:t===te.all,isOnTouch:t===te.onTouched});const Vt="AsyncFunction";var sr=t=>!!t&&!!t.validate&&!!($(t.validate)&&t.validate.constructor.name===Vt||B(t.validate)&&Object.values(t.validate).find(s=>s.constructor.name===Vt)),ir=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),Ke=(t,s,e)=>!e&&(s.watchAll||s.watch.has(t)||[...s.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const ye=(t,s,e,r)=>{for(const u of e||Object.keys(t)){const n=c(t,u);if(n){const{_f:o,...d}=n;if(o){if(o.refs&&o.refs[0]&&s(o.refs[0],u)&&!r)return!0;if(o.ref&&s(o.ref,o.name)&&!r)return!0;if(ye(d,s))break}else if(B(d)&&ye(d,s))break}}};function bt(t,s,e){const r=c(t,e);if(r||Ae(e))return{error:r,name:e};const u=e.split(".");for(;u.length;){const n=u.join("."),o=c(s,n),d=c(t,n);if(o&&!Array.isArray(o)&&e!==n)return{name:e};if(d&&d.type)return{name:n,error:d};if(d&&d.root&&d.root.type)return{name:`${n}.root`,error:d.root};u.pop()}return{name:e}}var ar=(t,s,e,r)=>{e(t);const{name:u,...n}=t;return H(n)||r&&Object.keys(n).length>=Object.keys(s).length||Object.keys(n).find(o=>s[o]===(!r||te.all))},nr=(t,s,e)=>!t||!s||t===s||J(t).some(r=>r&&(e?r===s:r.startsWith(s)||s.startsWith(r))),lr=(t,s,e,r,u)=>u.isOnAll?!1:!e&&u.isOnTouch?!(s||t):(e?r.isOnBlur:u.isOnBlur)?!t:(e?r.isOnChange:u.isOnChange)?t:!0,ur=(t,s)=>!xe(c(t,s)).length&&P(t,s),It=(t,s,e)=>{const r=J(c(t,e));return O(r,Et,s[e]),O(t,e,r),t};function Ft(t,s,e="validate"){if(G(t)||Array.isArray(t)&&t.every(G)||Z(t)&&!t)return{type:e,message:G(t)?t:"",ref:s}}var ce=t=>B(t)&&!Fe(t)?t:{value:t,message:""},Ye=async(t,s,e,r,u,n)=>{const{ref:o,refs:d,required:k,maxLength:x,minLength:W,min:v,max:w,pattern:F,validate:q,name:I,valueAsNumber:N,mount:L}=t._f,A=c(e,I);if(!L||s.has(I))return{};const S=d?d[0]:o,m=D=>{u&&S.reportValidity&&(S.setCustomValidity(Z(D)?"":D||""),S.reportValidity())},_={},b=et(o),C=ve(o),Q=b||C,X=(N||Ze(o))&&R(o.value)&&R(A)||be(o)&&o.value===""||A===""||Array.isArray(A)&&!A.length||N&&typeof A=="number"&&isNaN(A),oe=Qt.bind(null,I,r,_),_e=(D,T,U,j=se.maxLength,ie=se.minLength)=>{const re=D?T:U;_[I]={type:D?j:ie,message:re,ref:o,...oe(D?j:ie,re)}};if(n?!Array.isArray(A)||!A.length:k&&(!Q&&(X||Y(A))||Z(A)&&!A||C&&!Tt(d).isValid||b&&!Ut(d).isValid)){const{value:D,message:T}=G(k)?{value:!!k,message:k}:ce(k);if(D&&(_[I]={type:se.required,message:T,ref:S,...oe(se.required,T)},!r))return m(T),_}if(!X&&(!Y(v)||!Y(w))){let D,T;const U=ce(w),j=ce(v);if(!Y(A)&&!isNaN(A)){const ie=o.valueAsNumber||A&&+A;Y(U.value)||(D=ie>U.value),Y(j.value)||(T=ie<j.value)}else{const ie=o.valueAsDate||new Date(A),re=we=>new Date(new Date().toDateString()+" "+we),ge=o.type=="time",ne=o.type=="week";G(U.value)&&A&&(D=ge?re(A)>re(U.value):ne?A>U.value:ie>new Date(U.value)),G(j.value)&&A&&(T=ge?re(A)<re(j.value):ne?A<j.value:ie<new Date(j.value))}if((D||T)&&(_e(!!D,U.message,j.message,se.max,se.min),!r))return m(_[I].message),_}if((x||W)&&!X&&(G(A)||n&&Array.isArray(A))){const D=ce(x),T=ce(W),U=!Y(D.value)&&A.length>+D.value,j=!Y(T.value)&&A.length<+T.value;if((U||j)&&(_e(U,D.message,T.message),!r))return m(_[I].message),_}if(F&&!X&&G(A)){const{value:D,message:T}=ce(F);if(Fe(D)&&!A.match(D)&&(_[I]={type:se.pattern,message:T,ref:o,...oe(se.pattern,T)},!r))return m(T),_}if(q){if($(q)){const D=await q(A,e),T=Ft(D,S);if(T&&(_[I]={...T,...oe(se.validate,T.message)},!r))return m(T.message),_}else if(B(q)){let D={};for(const T in q){if(!H(D)&&!r)break;const U=Ft(await q[T](A,e),S,T);U&&(D={...U,...oe(T,U.message)},m(U.message),r&&(_[I]=D))}if(!H(D)&&(_[I]={ref:S,...D},!r))return _}}return m(!0),_};const or={mode:te.onSubmit,reValidateMode:te.onChange,shouldFocusError:!0},Lt={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function dr(t={}){let s={...or,...t},e={...M(Lt),isLoading:$(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},r={},u=B(s.defaultValues)||B(s.values)?M(s.defaultValues||s.values)||{}:{},n=s.shouldUnregister?{}:M(u),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},k,x=0;const W={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={...W};let w={...v};const F={array:_t(),state:_t()},q=s.criteriaMode===te.all,I=i=>a=>{clearTimeout(x),x=setTimeout(i,a)},N=async i=>{if(!o.keepIsValid&&!s.disabled&&(v.isValid||w.isValid||i)){let a;s.resolver?(a=H((await X()).errors),L()):a=await D({fields:r,onlyCheckValid:!0,eventType:ue.VALID}),a!==e.isValid&&F.state.next({isValid:a})}},L=(i,a)=>{!s.disabled&&(v.isValidating||v.validatingFields||w.isValidating||w.validatingFields)&&((i||Array.from(d.mount)).forEach(l=>{l&&(a?O(e.validatingFields,l,a):P(e.validatingFields,l))}),F.state.next({validatingFields:e.validatingFields,isValidating:!H(e.validatingFields)}))},A=()=>{e.dirtyFields=he(u,n)},S=(i,a=[],l,g,y=!0,f=!0)=>{if(g&&l&&!s.disabled){if(o.action=!0,f&&Array.isArray(c(r,i))){const h=l(c(r,i),g.argA,g.argB);y&&O(r,i,h)}if(f&&Array.isArray(c(e.errors,i))){const h=l(c(e.errors,i),g.argA,g.argB);y&&O(e.errors,i,h),ur(e.errors,i)}if((v.touchedFields||w.touchedFields)&&f&&Array.isArray(c(e.touchedFields,i))){const h=l(c(e.touchedFields,i),g.argA,g.argB);y&&O(e.touchedFields,i,h)}(v.dirtyFields||w.dirtyFields)&&A(),F.state.next({name:i,isDirty:U(i,a),dirtyFields:e.dirtyFields,errors:e.errors,isValid:e.isValid})}else O(n,i,a)},m=(i,a)=>{O(e.errors,i,a),F.state.next({errors:e.errors})},_=i=>{e.errors=i,F.state.next({errors:e.errors,isValid:!1})},b=(i,a,l,g)=>{const y=c(r,i);if(y){const f=R(c(n,i)),h=c(n,i,R(l)?c(u,i):l);R(h)||g&&g.defaultChecked||a?O(n,i,a?h:vt(y._f)):re(i,h),o.mount&&!o.action&&(N(),f&&e.isDirty&&(v.isDirty||w.isDirty)&&(U()||(e.isDirty=!1,F.state.next({...e}))))}},C=(i,a,l,g,y)=>{let f=!1,h=!1;const p={name:i};if(!s.disabled){if(!l||g){(v.isDirty||w.isDirty)&&(h=e.isDirty,e.isDirty=p.isDirty=U(),f=h!==p.isDirty);const E=ee(c(u,i),a);h=!!c(e.dirtyFields,i),E?P(e.dirtyFields,i):O(e.dirtyFields,i,!0),p.dirtyFields=e.dirtyFields,f=f||(v.dirtyFields||w.dirtyFields)&&h!==!E}if(l){const E=c(e.touchedFields,i);E||(O(e.touchedFields,i,l),p.touchedFields=e.touchedFields,f=f||(v.touchedFields||w.touchedFields)&&E!==l)}f&&y&&F.state.next(p)}return f?p:{}},Q=(i,a,l,g)=>{const y=c(e.errors,i),f=(v.isValid||w.isValid)&&Z(a)&&e.isValid!==a;if(s.delayError&&l?(k=I(()=>m(i,l)),k(s.delayError)):(clearTimeout(x),k=null,l?O(e.errors,i,l):P(e.errors,i)),(l?!ee(y,l):y)||!H(g)||f){const h={...g,...f&&Z(a)?{isValid:a}:{},errors:e.errors,name:i};e={...e,...h},F.state.next(h)}},X=async i=>(L(i,!0),await s.resolver(n,s.context,rr(i||d.mount,r,s.criteriaMode,s.shouldUseNativeValidation))),oe=async i=>{const{errors:a}=await X(i);if(L(i),i)for(const l of i){const g=c(a,l);g?O(e.errors,l,g):P(e.errors,l)}else e.errors=a;return a},_e=async({name:i,eventType:a})=>{if(t.validate){const l=await t.validate({formValues:n,formState:e,name:i,eventType:a});if(B(l))for(const g in l)l[g]&&Ve(`${Te}.${g}`,{message:G(l.message)?l.message:"",type:se.validate});else G(l)||!l?Ve(Te,{message:l||"",type:se.validate}):at(Te);return l}return!0},D=async({fields:i,onlyCheckValid:a,name:l,eventType:g,context:y={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(y.runRootValidation=!0,!await _e({name:l,eventType:g})&&(y.valid=!1,a)))return y.valid;for(const f in i){const h=i[f];if(h){const{_f:p,...E}=h;if(p){const K=d.array.has(p.name),ae=h._f&&sr(h._f);ae&&v.validatingFields&&L([p.name],!0);const z=await Ye(h,d.disabled,n,q,s.shouldUseNativeValidation&&!a,K);if(ae&&v.validatingFields&&L([p.name]),z[p.name]&&(y.valid=!1,a)||(!a&&(c(z,p.name)?K?It(e.errors,z,p.name):O(e.errors,p.name,z[p.name]):P(e.errors,p.name)),t.shouldUseNativeValidation&&z[p.name]))break}!H(E)&&await D({context:y,onlyCheckValid:a,fields:E,name:f,eventType:g})}}return y.valid},T=()=>{for(const i of d.unMount){const a=c(r,i);a&&(a._f.refs?a._f.refs.every(l=>!Me(l)):!Me(a._f.ref))&&Ee(i)}d.unMount=new Set},U=(i,a)=>!s.disabled&&(i&&a&&O(n,i,a),!ee(st(),u)),j=(i,a,l)=>He(i,d,{...o.mount?n:R(a)?u:G(i)?{[i]:a}:a},l,a),ie=i=>xe(c(o.mount?n:u,i,s.shouldUnregister?c(u,i,[]):[])),re=(i,a,l={})=>{const g=c(r,i);let y=a;if(g){const f=g._f;f&&(!f.disabled&&O(n,i,Mt(a,f)),y=be(f.ref)&&Y(a)?"":a,Ot(f.ref)?[...f.ref.options].forEach(h=>h.selected=y.includes(h.value)):f.refs?ve(f.ref)?f.refs.forEach(h=>{(!h.defaultChecked||!h.disabled)&&(Array.isArray(y)?h.checked=!!y.find(p=>p===h.value):h.checked=y===h.value||!!y)}):f.refs.forEach(h=>h.checked=h.value===y):Ze(f.ref)?f.ref.value="":(f.ref.value=y,f.ref.type||F.state.next({name:i,values:M(n)})))}(l.shouldDirty||l.shouldTouch)&&C(i,y,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&De(i)},ge=(i,a,l)=>{for(const g in a){if(!a.hasOwnProperty(g))return;const y=a[g],f=i+"."+g,h=c(r,f);(d.array.has(i)||B(y)||h&&!h._f)&&!de(y)?ge(f,y,l):re(f,y,l)}},ne=(i,a,l={})=>{const g=c(r,i),y=d.array.has(i),f=M(a),h=c(n,i),p=ee(h,f);if(O(n,i,f),y)F.array.next({name:i,values:M(n)}),(v.isDirty||v.dirtyFields||w.isDirty||w.dirtyFields)&&l.shouldDirty&&(A(),F.state.next({name:i,dirtyFields:e.dirtyFields,isDirty:U(i,f)}));else{const E=Array.isArray(f)&&!f.length||H(f);!g||g._f||Y(f)||E?re(i,f,l):ge(i,f,l)}if(!p){const E=Ke(i,d);F.state.next({...E&&e,name:o.mount||E?i:void 0,values:M(n)})}},we=i=>{const a=$(i)?i(n):i;ee(n,a)||(n={...n,...a},F.state.next({...e,values:n}))},tt=async i=>{o.mount=!0;const a=i.target;let l=a.name,g=!0;const y=c(r,l),f=E=>{g=Number.isNaN(E)||de(E)&&isNaN(E.getTime())||ee(E,c(n,l,E))},h=fe(s.mode),p=fe(s.reValidateMode);if(y){let E,K;const ae=a.type?vt(y._f):wt(i),z=i.type===ue.BLUR||i.type===ue.FOCUS_OUT,jt=!ir(y._f)&&!t.validate&&!s.resolver&&!c(e.errors,l)&&!y._f.deps||lr(z,c(e.touchedFields,l),e.isSubmitted,p,h),Oe=Ke(l,d,z);O(n,l,ae),z?(!a||!a.readOnly)&&(y._f.onBlur&&y._f.onBlur(i),k&&k(0)):y._f.onChange&&y._f.onChange(i);const Re=C(l,ae,z),$t=!H(Re)||Oe;if(!z&&F.state.next({name:l,type:i.type,values:M(n)}),jt)return(v.isValid||w.isValid)&&(s.mode==="onBlur"?z&&N():z||N()),$t&&F.state.next({name:l,...Oe?{}:Re});if(!s.resolver&&t.validate&&await _e({name:l,eventType:i.type}),!z&&Oe&&F.state.next({...e}),s.resolver){const{errors:ft}=await X([l]);if(L([l]),f(ae),g){const Gt=bt(e.errors,r,l),yt=bt(ft,r,Gt.name||l);E=yt.error,l=yt.name,K=H(ft)}}else L([l],!0),E=(await Ye(y,d.disabled,n,q,s.shouldUseNativeValidation))[l],L([l]),f(ae),g&&(E?K=!1:(v.isValid||w.isValid)&&(K=await D({fields:r,onlyCheckValid:!0,name:l,eventType:i.type})));g&&(y._f.deps&&(!Array.isArray(y._f.deps)||y._f.deps.length>0)&&De(y._f.deps),Q(l,K,E,Re))}},rt=(i,a)=>{if(c(e.errors,a)&&i.focus)return i.focus(),1},De=async(i,a={})=>{let l,g;const y=J(i);if(s.resolver){const f=await oe(R(i)?i:y);l=H(f),g=i?!y.some(h=>c(f,h)):l}else i?(g=(await Promise.all(y.map(async f=>{const h=c(r,f);return await D({fields:h&&h._f?{[f]:h}:h,eventType:ue.TRIGGER})}))).every(Boolean),!(!g&&!e.isValid)&&N()):g=l=await D({fields:r,name:i,eventType:ue.TRIGGER});return F.state.next({...!G(i)||(v.isValid||w.isValid)&&l!==e.isValid?{}:{name:i},...s.resolver||!i?{isValid:l}:{},errors:e.errors}),a.shouldFocus&&!g&&ye(r,rt,i?y:d.mount),g},st=(i,a)=>{let l={...o.mount?n:u};return a&&(l=Ct(a.dirtyFields?e.dirtyFields:e.touchedFields,l)),R(i)?l:G(i)?c(l,i):i.map(g=>c(l,g))},it=(i,a)=>({invalid:!!c((a||e).errors,i),isDirty:!!c((a||e).dirtyFields,i),error:c((a||e).errors,i),isValidating:!!c(e.validatingFields,i),isTouched:!!c((a||e).touchedFields,i)}),at=i=>{const a=i?J(i):void 0;a?.forEach(l=>P(e.errors,l)),a?a.forEach(l=>{F.state.next({name:l,errors:e.errors})}):F.state.next({errors:{}})},Ve=(i,a,l)=>{const g=(c(r,i,{_f:{}})._f||{}).ref,y=c(e.errors,i)||{},{ref:f,message:h,type:p,...E}=y;O(e.errors,i,{...E,...a,ref:g}),F.state.next({name:i,errors:e.errors,isValid:!1}),l&&l.shouldFocus&&g&&g.focus&&g.focus()},Nt=(i,a)=>$(i)?F.state.subscribe({next:l=>"values"in l&&i(l.values||j(void 0,a),l)}):j(i,a,!0),nt=i=>F.state.subscribe({next:a=>{if(nr(i.name,a.name,i.exact)&&ar(a,i.formState||v,Ht,i.reRenderRoot)){const l={...n};i.callback({values:l,...e,...a,defaultValues:u})}}}).unsubscribe,Bt=i=>(o.mount=!0,w={...w,...i.formState},nt({...i,formState:{...W,...i.formState}})),Ee=(i,a={})=>{for(const l of i?J(i):d.mount)d.mount.delete(l),d.array.delete(l),a.keepValue||(P(r,l),P(n,l)),!a.keepError&&P(e.errors,l),!a.keepDirty&&P(e.dirtyFields,l),!a.keepTouched&&P(e.touchedFields,l),!a.keepIsValidating&&P(e.validatingFields,l),!s.shouldUnregister&&!a.keepDefaultValue&&P(u,l);F.state.next({values:M(n)}),F.state.next({...e,...a.keepDirty?{isDirty:U()}:{}}),!a.keepIsValid&&N()},lt=({disabled:i,name:a})=>{if(Z(i)&&o.mount||i||d.disabled.has(a)){const y=d.disabled.has(a)!==!!i;i?d.disabled.add(a):d.disabled.delete(a),y&&o.mount&&!o.action&&N()}},Se=(i,a={})=>{let l=c(r,i);const g=Z(a.disabled)||Z(s.disabled),y=!d.registerName.has(i)&&l&&l._f&&!l._f.mount;return O(r,i,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:i}},name:i,mount:!0,...a}}),d.mount.add(i),l&&!y?lt({disabled:Z(a.disabled)?a.disabled:s.disabled,name:i}):b(i,!0,a.value),{...g?{disabled:a.disabled||s.disabled}:{},...s.progressive?{required:!!a.required,min:me(a.min),max:me(a.max),minLength:me(a.minLength),maxLength:me(a.maxLength),pattern:me(a.pattern)}:{},name:i,onChange:tt,onBlur:tt,ref:f=>{if(f){d.registerName.add(i),Se(i,a),d.registerName.delete(i),l=c(r,i);const h=R(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,p=Xt(h),E=l._f.refs||[];if(p?E.find(K=>K===h):h===l._f.ref)return;O(r,i,{_f:{...l._f,...p?{refs:[...E.filter(Me),h,...Array.isArray(c(u,i))?[{}]:[]],ref:{type:h.type,name:i}}:{ref:h}}}),b(i,!1,void 0,h)}else l=c(r,i,{}),l._f&&(l._f.mount=!1),(s.shouldUnregister||a.shouldUnregister)&&!(Dt(d.array,i)&&o.action)&&d.unMount.add(i)}}},Ce=()=>s.shouldFocusError&&ye(r,rt,d.mount),Pt=i=>{Z(i)&&(F.state.next({disabled:i}),ye(r,(a,l)=>{const g=c(r,l);g&&(a.disabled=g._f.disabled||i,Array.isArray(g._f.refs)&&g._f.refs.forEach(y=>{y.disabled=g._f.disabled||i}))},0,!1))},ut=(i,a)=>async l=>{let g;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let y=M(n);if(F.state.next({isSubmitting:!0}),s.resolver){const{errors:f,values:h}=await X();L(),e.errors=f,y=M(h)}else await D({fields:r,eventType:ue.SUBMIT});if(d.disabled.size)for(const f of d.disabled)P(y,f);if(P(e.errors,Et),H(e.errors)){F.state.next({errors:{}});try{await i(y,l)}catch(f){g=f}}else a&&await a({...e.errors},l),Ce(),setTimeout(Ce);if(F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:H(e.errors)&&!g,submitCount:e.submitCount+1,errors:e.errors}),g)throw g},Wt=(i,a={})=>{c(r,i)&&(R(a.defaultValue)?ne(i,M(c(u,i))):(ne(i,a.defaultValue),O(u,i,M(a.defaultValue))),a.keepTouched||P(e.touchedFields,i),a.keepDirty||(P(e.dirtyFields,i),e.isDirty=a.defaultValue?U(i,M(c(u,i))):U()),a.keepError||(P(e.errors,i),v.isValid&&N()),F.state.next({...e}))},ot=(i,a={})=>{const l=i?M(i):u,g=M(l),y=H(i),f=y?u:g;if(a.keepDefaultValues||(u=l),!a.keepValues){if(a.keepDirtyValues){const h=new Set([...d.mount,...Object.keys(he(u,n))]);for(const p of Array.from(h)){const E=c(e.dirtyFields,p),K=c(n,p),ae=c(f,p);E&&!R(K)?O(f,p,K):!E&&!R(ae)&&ne(p,ae)}}else{if(ze&&R(i))for(const h of d.mount){const p=c(r,h);if(p&&p._f){const E=Array.isArray(p._f.refs)?p._f.refs[0]:p._f.ref;if(be(E)){const K=E.closest("form");if(K){K.reset();break}}}}if(a.keepFieldsRef)for(const h of d.mount)ne(h,c(f,h));else r={}}n=s.shouldUnregister?a.keepDefaultValues?M(u):{}:M(f),F.array.next({values:{...f}}),F.state.next({values:{...f}})}d={mount:a.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!v.isValid||!!a.keepIsValid||!!a.keepDirtyValues||!s.shouldUnregister&&!H(f),o.watch=!!s.shouldUnregister,o.keepIsValid=!!a.keepIsValid,o.action=!1,a.keepErrors||(e.errors={}),F.state.next({submitCount:a.keepSubmitCount?e.submitCount:0,isDirty:y?!1:a.keepDirty?e.isDirty:!!(a.keepDefaultValues&&!ee(i,u)),isSubmitted:a.keepIsSubmitted?e.isSubmitted:!1,dirtyFields:y?{}:a.keepDirtyValues?a.keepDefaultValues&&n?he(u,n):e.dirtyFields:a.keepDefaultValues&&i?he(u,i):a.keepDirty?e.dirtyFields:{},touchedFields:a.keepTouched?e.touchedFields:{},errors:a.keepErrors?e.errors:{},isSubmitSuccessful:a.keepIsSubmitSuccessful?e.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:u})},dt=(i,a)=>ot($(i)?i(n):i,{...s.resetOptions,...a}),qt=(i,a={})=>{const l=c(r,i),g=l&&l._f;if(g){const y=g.refs?g.refs[0]:g.ref;y.focus&&setTimeout(()=>{y.focus(),a.shouldSelect&&$(y.select)&&y.select()})}},Ht=i=>{e={...e,...i}},ct={control:{register:Se,unregister:Ee,getFieldState:it,handleSubmit:ut,setError:Ve,_subscribe:nt,_runSchema:X,_updateIsValidating:L,_focusError:Ce,_getWatch:j,_getDirty:U,_setValid:N,_setFieldArray:S,_setDisabledField:lt,_setErrors:_,_getFieldArray:ie,_reset:ot,_resetDefaultValues:()=>$(s.defaultValues)&&s.defaultValues().then(i=>{dt(i,s.resetOptions),F.state.next({isLoading:!1})}),_removeUnmounted:T,_disableForm:Pt,_subjects:F,_proxyFormState:v,get _fields(){return r},get _formValues(){return n},get _state(){return o},set _state(i){o=i},get _defaultValues(){return u},get _names(){return d},set _names(i){d=i},get _formState(){return e},get _options(){return s},set _options(i){s={...s,...i}}},subscribe:Bt,trigger:De,register:Se,handleSubmit:ut,watch:Nt,setValue:ne,setValues:we,getValues:st,reset:dt,resetField:Wt,clearErrors:at,unregister:Ee,setError:Ve,setFocus:qt,getFieldState:it};return{...ct,formControl:ct}}var le=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const t=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const e=(Math.random()*16+t)%16|0;return(s=="x"?e:e&3|8).toString(16)})},Ue=(t,s,e={})=>e.shouldFocus||R(e.shouldFocus)?e.focusName||`${t}.${R(e.focusIndex)?s:e.focusIndex}.`:"",Ie=(t,s)=>[...t,...J(s)],Le=t=>Array.isArray(t)?t.map(()=>{}):void 0;function Ne(t,s,e){return[...t.slice(0,s),...J(e),...t.slice(s)]}var Be=(t,s,e)=>Array.isArray(t)?(R(t[e])&&(t[e]=void 0),t.splice(e,0,t.splice(s,1)[0]),t):[],Pe=(t,s)=>[...J(s),...J(t)];function cr(t,s){let e=0;const r=[...t];for(const u of s)r.splice(u-e,1),e++;return xe(r).length?r:[]}var We=(t,s)=>R(s)?[]:cr(t,J(s).sort((e,r)=>e-r)),qe=(t,s,e)=>{[t[s],t[e]]=[t[e],t[s]]},At=(t,s,e)=>(t[s]=e,t);function Vr(t){const s=pe(),{control:e=s,name:r,keyName:u="id",shouldUnregister:n,rules:o}=t,[d,k]=V.useState(e._getFieldArray(r)),x=V.useRef(e._getFieldArray(r).map(le)),W=V.useRef(!1);e._names.array.add(r),V.useMemo(()=>o&&d.length>=0&&e.register(r,o),[e,r,d.length,o]),ke(()=>e._subjects.array.subscribe({next:({values:m,name:_})=>{if(_===r||!_){const b=c(m,r);Array.isArray(b)&&(k(b),x.current=b.map(le))}}}).unsubscribe,[e,r]);const v=V.useCallback(m=>{W.current=!0,e._setFieldArray(r,m)},[e,r]),w=(m,_)=>{const b=J(M(m)),C=Ie(e._getFieldArray(r),b);e._names.focus=Ue(r,C.length-1,_),x.current=Ie(x.current,b.map(le)),v(C),k(C),e._setFieldArray(r,C,Ie,{argA:Le(m)})},F=(m,_)=>{const b=J(M(m)),C=Pe(e._getFieldArray(r),b);e._names.focus=Ue(r,0,_),x.current=Pe(x.current,b.map(le)),v(C),k(C),e._setFieldArray(r,C,Pe,{argA:Le(m)})},q=m=>{const _=We(e._getFieldArray(r),m);x.current=We(x.current,m),v(_),k(_),!Array.isArray(c(e._fields,r))&&O(e._fields,r,void 0),e._setFieldArray(r,_,We,{argA:m})},I=(m,_,b)=>{const C=J(M(_)),Q=Ne(e._getFieldArray(r),m,C);e._names.focus=Ue(r,m,b),x.current=Ne(x.current,m,C.map(le)),v(Q),k(Q),e._setFieldArray(r,Q,Ne,{argA:m,argB:Le(_)})},N=(m,_)=>{const b=e._getFieldArray(r);qe(b,m,_),qe(x.current,m,_),v(b),k(b),e._setFieldArray(r,b,qe,{argA:m,argB:_},!1)},L=(m,_)=>{const b=e._getFieldArray(r);Be(b,m,_),Be(x.current,m,_),v(b),k(b),e._setFieldArray(r,b,Be,{argA:m,argB:_},!1)},A=(m,_)=>{const b=M(_),C=At(e._getFieldArray(r),m,b);x.current=[...C].map((Q,X)=>!Q||X===m?le():x.current[X]),v(C),k([...C]),e._setFieldArray(r,C,At,{argA:m,argB:b},!0,!1)},S=m=>{const _=J(M(m));x.current=_.map(le),v([..._]),k([..._]),e._setFieldArray(r,[..._],b=>b,{},!0,!1)};return V.useEffect(()=>{e._state.action=!1,Ke(r,e._names)&&e._subjects.state.next({...e._formState});const m=fe(e._options.mode);if(W.current&&(!m.isOnSubmit||e._formState.isSubmitted)&&!fe(e._options.reValidateMode).isOnSubmit&&!m.isOnBlur)if(e._options.resolver)e._runSchema([r]).then(_=>{e._updateIsValidating([r]);const b=c(_.errors,r),C=c(e._formState.errors,r);(C?!b&&C.type||b&&(C.type!==b.type||C.message!==b.message):b&&b.type)&&(b?O(e._formState.errors,r,b):P(e._formState.errors,r),e._subjects.state.next({errors:e._formState.errors}))});else{const _=c(e._fields,r);_&&_._f&&!(fe(e._options.reValidateMode).isOnSubmit&&fe(e._options.mode).isOnSubmit)&&Ye(_,e._names.disabled,e._formValues,e._options.criteriaMode===te.all,e._options.shouldUseNativeValidation,!0).then(b=>!H(b)&&e._subjects.state.next({errors:It(e._formState.errors,b,r)}))}e._subjects.state.next({name:r,values:M(e._formValues)}),e._names.focus&&ye(e._fields,(_,b)=>{if(e._names.focus&&b.startsWith(e._names.focus)&&_.focus)return _.focus(),1}),e._names.focus="",e._setValid(),W.current=!1},[d,r,e]),V.useEffect(()=>(!c(e._formValues,r)&&e._setFieldArray(r),()=>{const m=!(e._options.shouldUnregister||n),_=(b,C)=>{const Q=c(e._fields,b);Q&&Q._f&&(Q._f.mount=C)};W.current&&m&&e._subjects.state.next({name:r,values:M(e._formValues)}),m?_(r,!1):e.unregister(r)}),[r,e,u,n]),{swap:V.useCallback(N,[v,r,e]),move:V.useCallback(L,[v,r,e]),prepend:V.useCallback(F,[v,r,e]),append:V.useCallback(w,[v,r,e]),remove:V.useCallback(q,[v,r,e]),insert:V.useCallback(I,[v,r,e]),update:V.useCallback(A,[v,r,e]),replace:V.useCallback(S,[v,r,e]),fields:V.useMemo(()=>d.map((m,_)=>({...m,[u]:x.current[_]||le()})),[d,u])}}function br(t={}){const s=V.useRef(void 0),e=V.useRef(void 0),[r,u]=V.useState(()=>({...M(Lt),isLoading:$(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:$(t.defaultValues)?void 0:t.defaultValues}));if(!s.current)if(t.formControl)s.current={...t.formControl,formState:r},t.defaultValues&&!$(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:o,...d}=dr(t);s.current={...d,formState:r}}const n=s.current.control;return n._options=t,ke(()=>{const o=n._subscribe({formState:n._proxyFormState,callback:()=>u({...n._formState}),reRenderRoot:!0});return u(d=>({...d,isReady:!0})),n._formState.isReady=!0,o},[n]),V.useEffect(()=>n._disableForm(t.disabled),[n,t.disabled]),V.useEffect(()=>{t.mode&&(n._options.mode=t.mode),t.reValidateMode&&(n._options.reValidateMode=t.reValidateMode)},[n,t.mode,t.reValidateMode]),V.useEffect(()=>{t.errors&&(n._setErrors(t.errors),n._focusError())},[n,t.errors]),V.useEffect(()=>{t.shouldUnregister&&n._subjects.state.next({values:n._getWatch()})},[n,t.shouldUnregister]),V.useEffect(()=>{if(n._proxyFormState.isDirty){const o=n._getDirty();o!==r.isDirty&&n._subjects.state.next({isDirty:o})}},[n,r.isDirty]),V.useEffect(()=>{var o;t.values&&!ee(t.values,e.current)?(n._reset(t.values,{keepFieldsRef:!0,...n._options.resetOptions}),!((o=n._options.resetOptions)===null||o===void 0)&&o.keepIsValid||n._setValid(),e.current=t.values,u(d=>({...d}))):n._resetDefaultValues()},[n,t.values]),V.useEffect(()=>{n._state.mount||(n._setValid(),n._state.mount=!0),n._state.watch&&(n._state.watch=!1,n._subjects.state.next({...n._formState})),n._removeUnmounted()}),s.current.formState=V.useMemo(()=>St(r,n),[n,r]),s.current}const xt=(t,s,e)=>{if(t&&"reportValidity"in t){const r=c(e,s);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},fr=(t,s)=>{for(const e in s.fields){const r=s.fields[e];r&&r.ref&&"reportValidity"in r.ref?xt(r.ref,e,t):r&&r.refs&&r.refs.forEach(u=>xt(u,e,t))}},Fr=(t,s)=>{s.shouldUseNativeValidation&&fr(t,s);const e={};for(const r in t){const u=c(s.fields,r),n=Object.assign(t[r]||{},{ref:u&&u.ref});if(yr(s.names||Object.keys(t),r)){const o=Object.assign({},c(e,r));O(o,"root",n),O(e,r,o)}else O(e,r,n)}return e},yr=(t,s)=>{const e=pt(s);return t.some(r=>pt(r).match(`^${e}\\.\\d+`))};function pt(t){return t.replace(/\]|\[/g,"")}export{mr as C,vr as F,Qt as a,Yt as b,br as c,Vr as d,fr as o,Fr as s,hr as u};
|
package/client/dist/index.html
CHANGED
|
@@ -4,9 +4,43 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
<!--
|
|
8
|
+
Theme typography. Each theme picks its display + body + mono via
|
|
9
|
+
the --font-display / --font-body / --font-mono tokens. Loading
|
|
10
|
+
these as `media="print" onload=...` defers the network cost so
|
|
11
|
+
the default light/dark theme (system fonts via @fontsource-
|
|
12
|
+
variable/geist bundled at build time) renders without blocking,
|
|
13
|
+
and Renaissance + Cyber fonts swap in once their stylesheets land.
|
|
14
|
+
|
|
15
|
+
Renaissance: Cinzel (display), Cormorant Garamond (body),
|
|
16
|
+
IM Fell English (mono / italic accents).
|
|
17
|
+
Cyber: Major Mono Display (display), VT323 (body fallback),
|
|
18
|
+
JetBrains Mono (body + mono).
|
|
19
|
+
-->
|
|
20
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
21
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
22
|
+
<link
|
|
23
|
+
rel="stylesheet"
|
|
24
|
+
href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400&family=Bevan&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=IM+Fell+English+SC&family=IM+Fell+English:ital@0;1&family=JetBrains+Mono:wght@400;500;600;700&family=Lato:wght@400;700&family=Major+Mono+Display&family=Pirata+One&family=Sawarabi+Mincho&family=Shippori+Mincho:wght@400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Special+Elite&family=UnifrakturCook:wght@700&family=VT323&display=swap"
|
|
25
|
+
media="print"
|
|
26
|
+
onload="this.media='all'"
|
|
27
|
+
/>
|
|
28
|
+
<noscript>
|
|
29
|
+
<link
|
|
30
|
+
rel="stylesheet"
|
|
31
|
+
href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400&family=Bevan&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=IM+Fell+English+SC&family=IM+Fell+English:ital@0;1&family=JetBrains+Mono:wght@400;500;600;700&family=Lato:wght@400;700&family=Major+Mono+Display&family=Pirata+One&family=Sawarabi+Mincho&family=Shippori+Mincho:wght@400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Special+Elite&family=UnifrakturCook:wght@700&family=VT323&display=swap"
|
|
32
|
+
/>
|
|
33
|
+
</noscript>
|
|
34
|
+
<title>MachinaOS</title>
|
|
35
|
+
<script type="module" crossorigin src="/assets/index-DQ0nwhec.js"></script>
|
|
36
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-query-SzWcOU0G.js">
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-flow-CZmBvHRo.js">
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-radix-Dnos29jG.js">
|
|
39
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-misc-C4VxKHs5.js">
|
|
40
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-markdown-CRou3yQ5.js">
|
|
41
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-icons-CVrPjN2Q.js">
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DvWIbVx0.js">
|
|
43
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DxmbVskS.css">
|
|
10
44
|
</head>
|
|
11
45
|
<body>
|
|
12
46
|
<div id="root"></div>
|
package/client/index.html
CHANGED
|
@@ -4,7 +4,34 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
|
|
7
|
+
<!--
|
|
8
|
+
Theme typography. Each theme picks its display + body + mono via
|
|
9
|
+
the --font-display / --font-body / --font-mono tokens. Loading
|
|
10
|
+
these as `media="print" onload=...` defers the network cost so
|
|
11
|
+
the default light/dark theme (system fonts via @fontsource-
|
|
12
|
+
variable/geist bundled at build time) renders without blocking,
|
|
13
|
+
and Renaissance + Cyber fonts swap in once their stylesheets land.
|
|
14
|
+
|
|
15
|
+
Renaissance: Cinzel (display), Cormorant Garamond (body),
|
|
16
|
+
IM Fell English (mono / italic accents).
|
|
17
|
+
Cyber: Major Mono Display (display), VT323 (body fallback),
|
|
18
|
+
JetBrains Mono (body + mono).
|
|
19
|
+
-->
|
|
20
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
21
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
22
|
+
<link
|
|
23
|
+
rel="stylesheet"
|
|
24
|
+
href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400&family=Bevan&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=IM+Fell+English+SC&family=IM+Fell+English:ital@0;1&family=JetBrains+Mono:wght@400;500;600;700&family=Lato:wght@400;700&family=Major+Mono+Display&family=Pirata+One&family=Sawarabi+Mincho&family=Shippori+Mincho:wght@400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Special+Elite&family=UnifrakturCook:wght@700&family=VT323&display=swap"
|
|
25
|
+
media="print"
|
|
26
|
+
onload="this.media='all'"
|
|
27
|
+
/>
|
|
28
|
+
<noscript>
|
|
29
|
+
<link
|
|
30
|
+
rel="stylesheet"
|
|
31
|
+
href="https://fonts.googleapis.com/css2?family=Anonymous+Pro:ital,wght@0,400;0,700;1,400&family=Bevan&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&family=IM+Fell+English+SC&family=IM+Fell+English:ital@0;1&family=JetBrains+Mono:wght@400;500;600;700&family=Lato:wght@400;700&family=Major+Mono+Display&family=Pirata+One&family=Sawarabi+Mincho&family=Shippori+Mincho:wght@400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Special+Elite&family=UnifrakturCook:wght@700&family=VT323&display=swap"
|
|
32
|
+
/>
|
|
33
|
+
</noscript>
|
|
34
|
+
<title>MachinaOS</title>
|
|
8
35
|
</head>
|
|
9
36
|
<body>
|
|
10
37
|
<div id="root"></div>
|