foxclaw 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -29
- package/bin/foxclaw.cjs +51 -0
- package/index.js +11 -10
- package/package.json +46 -38
- package/python/.dockerignore +35 -0
- package/python/.env.example +165 -0
- package/python/.gitattributes +46 -0
- package/python/.github/workflows/ci.yml +122 -0
- package/python/.github/workflows/release.yml +183 -0
- package/python/Dockerfile +64 -0
- package/python/LICENSE +21 -0
- package/python/MANIFEST.in +14 -0
- package/python/README.md +192 -0
- package/python/README_CN.md +324 -0
- package/python/bench/bm25_audit.py +199 -0
- package/python/bench/bm25_regression.py +178 -0
- package/python/bench/bm25_stress.py +159 -0
- package/python/bench/cd_audit.py +238 -0
- package/python/bench/chaos.py +142 -0
- package/python/bench/concurrency.py +103 -0
- package/python/bench/e2e_real_models.py +95 -0
- package/python/bench/llm_retry_test.py +248 -0
- package/python/bench/load_test.py +196 -0
- package/python/bench/vector_ivf_upgrade.py +134 -0
- package/python/docs/CHANNELS.md +195 -0
- package/python/docs/GOVERNANCE.md +164 -0
- package/python/docs/RELEASE.md +109 -0
- package/python/docs/RUN.md +75 -0
- package/python/docs/RUN_CN.md +121 -0
- package/python/docs//351/205/215/347/275/256/346/214/207/345/215/227.md +152 -0
- package/python/evals/__init__.py +0 -0
- package/python/evals/governance/README.md +61 -0
- package/python/evals/governance/__init__.py +0 -0
- package/python/evals/governance/cases.py +152 -0
- package/python/evals/governance/compare_embeddings.py +94 -0
- package/python/evals/governance/convergence.svg +11 -0
- package/python/evals/governance/report.json +371 -0
- package/python/evals/governance/run_evals.py +400 -0
- package/python/examples/governance_middleware_demo.py +77 -0
- package/python/examples/langgraph_governance_demo.py +108 -0
- package/python/examples/sample_itinerary.csv +6 -0
- package/python/examples/sample_knowledge.csv +9 -0
- package/python/examples/sample_transactions.csv +14 -0
- package/python/foxclaw/__init__.py +526 -0
- package/python/foxclaw/agents/__init__.py +12 -0
- package/python/foxclaw/agents/agents.py +35 -0
- package/python/foxclaw/agents/base.py +865 -0
- package/python/foxclaw/agents/impl/__init__.py +1 -0
- package/python/foxclaw/agents/impl/_helpers.py +78 -0
- package/python/foxclaw/agents/impl/finance.py +248 -0
- package/python/foxclaw/agents/impl/office.py +367 -0
- package/python/foxclaw/agents/impl/supervisor.py +659 -0
- package/python/foxclaw/agents/mixins/_context.py +151 -0
- package/python/foxclaw/agents/mixins/augment.py +149 -0
- package/python/foxclaw/agents/mixins/llm.py +66 -0
- package/python/foxclaw/agents/mixins/memory.py +35 -0
- package/python/foxclaw/agents/mixins/preference.py +81 -0
- package/python/foxclaw/agents/mixins/prompt.py +77 -0
- package/python/foxclaw/agents/mixins/skillbox.py +58 -0
- package/python/foxclaw/agents/mixins/tool_exec.py +443 -0
- package/python/foxclaw/api/__init__.py +283 -0
- package/python/foxclaw/api/app.py +123 -0
- package/python/foxclaw/api/middleware.py +317 -0
- package/python/foxclaw/api/routes/ahs.py +417 -0
- package/python/foxclaw/api/routes/attachments.py +117 -0
- package/python/foxclaw/api/routes/browser.py +39 -0
- package/python/foxclaw/api/routes/domain.py +314 -0
- package/python/foxclaw/api/routes/knowledge.py +163 -0
- package/python/foxclaw/api/routes/llm_admin.py +461 -0
- package/python/foxclaw/api/routes/memory.py +89 -0
- package/python/foxclaw/api/routes/orchestration.py +41 -0
- package/python/foxclaw/api/routes/recovery.py +43 -0
- package/python/foxclaw/api/routes/review.py +275 -0
- package/python/foxclaw/api/routes/search.py +37 -0
- package/python/foxclaw/api/routes/system.py +327 -0
- package/python/foxclaw/api/routes/task.py +281 -0
- package/python/foxclaw/api/routes/ws.py +68 -0
- package/python/foxclaw/api/spine.py +55 -0
- package/python/foxclaw/browser/__init__.py +13 -0
- package/python/foxclaw/browser/action/__init__.py +1 -0
- package/python/foxclaw/browser/action/action_executor.py +54 -0
- package/python/foxclaw/browser/action/action_types.py +45 -0
- package/python/foxclaw/browser/action/action_verifier.py +68 -0
- package/python/foxclaw/browser/action/url_policy.py +147 -0
- package/python/foxclaw/browser/adapter/__init__.py +1 -0
- package/python/foxclaw/browser/adapter/base_adapter.py +23 -0
- package/python/foxclaw/browser/adapter/web_adapter.py +46 -0
- package/python/foxclaw/browser/driver/__init__.py +1 -0
- package/python/foxclaw/browser/driver/base_driver.py +61 -0
- package/python/foxclaw/browser/driver/playwright_driver.py +166 -0
- package/python/foxclaw/browser/perception/__init__.py +1 -0
- package/python/foxclaw/browser/perception/dom_extractor.py +43 -0
- package/python/foxclaw/browser/perception/element_indexer.py +57 -0
- package/python/foxclaw/browser/perception/semantic_reducer.py +33 -0
- package/python/foxclaw/browser/perception/snapshot.py +29 -0
- package/python/foxclaw/browser/service.py +148 -0
- package/python/foxclaw/browser/session/__init__.py +1 -0
- package/python/foxclaw/browser/session/session_manager.py +57 -0
- package/python/foxclaw/capability/__init__.py +12 -0
- package/python/foxclaw/capability/embedding_service.py +67 -0
- package/python/foxclaw/channels/__init__.py +140 -0
- package/python/foxclaw/channels/discord.py +184 -0
- package/python/foxclaw/channels/dispatcher.py +204 -0
- package/python/foxclaw/channels/feishu.py +225 -0
- package/python/foxclaw/channels/openclaw_bridge.py +156 -0
- package/python/foxclaw/channels/signing.py +187 -0
- package/python/foxclaw/channels/telegram.py +121 -0
- package/python/foxclaw/channels/weixin.py +225 -0
- package/python/foxclaw/cli.py +154 -0
- package/python/foxclaw/cognitive/__init__.py +4 -0
- package/python/foxclaw/cognitive/reasoner.py +82 -0
- package/python/foxclaw/cognitive/state.py +147 -0
- package/python/foxclaw/core/__init__.py +9 -0
- package/python/foxclaw/core/audit_chain.py +133 -0
- package/python/foxclaw/core/audit_sink.py +100 -0
- package/python/foxclaw/core/compaction.py +283 -0
- package/python/foxclaw/core/config.py +65 -0
- package/python/foxclaw/core/confirm_nonce.py +157 -0
- package/python/foxclaw/core/dispatch.py +27 -0
- package/python/foxclaw/core/envfile.py +48 -0
- package/python/foxclaw/core/failure_policy.py +151 -0
- package/python/foxclaw/core/gateway.py +85 -0
- package/python/foxclaw/core/governance_audit.py +175 -0
- package/python/foxclaw/core/idempotency.py +289 -0
- package/python/foxclaw/core/injection_guard.py +221 -0
- package/python/foxclaw/core/memory_adapter.py +516 -0
- package/python/foxclaw/core/metrics.py +89 -0
- package/python/foxclaw/core/model_router.py +1097 -0
- package/python/foxclaw/core/paths.py +103 -0
- package/python/foxclaw/core/recovery.py +362 -0
- package/python/foxclaw/core/scheduler.py +144 -0
- package/python/foxclaw/core/secrets.py +134 -0
- package/python/foxclaw/core/sessions.py +157 -0
- package/python/foxclaw/core/settings.py +430 -0
- package/python/foxclaw/core/shared_write.py +198 -0
- package/python/foxclaw/core/steering_queue.py +153 -0
- package/python/foxclaw/core/system_bus.py +84 -0
- package/python/foxclaw/core/thought_chain.py +318 -0
- package/python/foxclaw/core/token_meter.py +235 -0
- package/python/foxclaw/core/tools.py +172 -0
- package/python/foxclaw/core/tracing.py +390 -0
- package/python/foxclaw/core/truth_pipeline.py +114 -0
- package/python/foxclaw/core/vec_recall_adapter.py +503 -0
- package/python/foxclaw/core/verify.py +181 -0
- package/python/foxclaw/core/web_search.py +242 -0
- package/python/foxclaw/finance/__init__.py +15 -0
- package/python/foxclaw/finance/evidence.py +153 -0
- package/python/foxclaw/finance/fx.py +100 -0
- package/python/foxclaw/finance/graph.py +188 -0
- package/python/foxclaw/finance/models.py +150 -0
- package/python/foxclaw/finance/nlparse.py +575 -0
- package/python/foxclaw/finance/policy.py +329 -0
- package/python/foxclaw/finance/reasoner.py +129 -0
- package/python/foxclaw/finance/reasoning.py +340 -0
- package/python/foxclaw/finance/reconcile.py +180 -0
- package/python/foxclaw/finance/runtime.py +527 -0
- package/python/foxclaw/governance/__init__.py +24 -0
- package/python/foxclaw/governance/middleware.py +184 -0
- package/python/foxclaw/harness/__init__.py +17 -0
- package/python/foxclaw/harness/_base.py +72 -0
- package/python/foxclaw/harness/_policy.py +359 -0
- package/python/foxclaw/harness/drift.py +89 -0
- package/python/foxclaw/harness/event_bus.py +31 -0
- package/python/foxclaw/harness/harness.py +446 -0
- package/python/foxclaw/harness/loop_detection.py +152 -0
- package/python/foxclaw/itinerary/__init__.py +10 -0
- package/python/foxclaw/itinerary/amap_client.py +117 -0
- package/python/foxclaw/itinerary/models.py +80 -0
- package/python/foxclaw/itinerary/reasoner.py +101 -0
- package/python/foxclaw/itinerary/reasoning.py +174 -0
- package/python/foxclaw/itinerary/runtime.py +148 -0
- package/python/foxclaw/kernel/__init__.py +13 -0
- package/python/foxclaw/kernel/capabilities.py +73 -0
- package/python/foxclaw/kernel/policy_gate.py +114 -0
- package/python/foxclaw/kernel/process_manager.py +205 -0
- package/python/foxclaw/kernel/scheduler.py +131 -0
- package/python/foxclaw/kernel/sentinel.py +453 -0
- package/python/foxclaw/kernel/sentinel_client.py +246 -0
- package/python/foxclaw/kernel/spine.py +97 -0
- package/python/foxclaw/knowledge/__init__.py +376 -0
- package/python/foxclaw/knowledge/truth_crystallizer.py +92 -0
- package/python/foxclaw/learning/__init__.py +12 -0
- package/python/foxclaw/learning/knowledge_graph.py +149 -0
- package/python/foxclaw/learning/models.py +93 -0
- package/python/foxclaw/learning/reasoner.py +70 -0
- package/python/foxclaw/learning/runtime.py +363 -0
- package/python/foxclaw/learning/spaced_repetition.py +96 -0
- package/python/foxclaw/mcp_server.py +189 -0
- package/python/foxclaw/orchestration/__init__.py +184 -0
- package/python/foxclaw/pipeline/__init__.py +23 -0
- package/python/foxclaw/pipeline/cognitive_pipeline.py +481 -0
- package/python/foxclaw/pipeline/supervisor_stages.py +230 -0
- package/python/foxclaw/planning/__init__.py +17 -0
- package/python/foxclaw/planning/llm_planner.py +232 -0
- package/python/foxclaw/planning/planner.py +99 -0
- package/python/foxclaw/search/__init__.py +24 -0
- package/python/foxclaw/search/agent_port.py +194 -0
- package/python/foxclaw/search/evidence.py +113 -0
- package/python/foxclaw/search/external_search.py +50 -0
- package/python/foxclaw/search/hkc_read_port.py +60 -0
- package/python/foxclaw/search/internal_search.py +73 -0
- package/python/foxclaw/search/models.py +129 -0
- package/python/foxclaw/search/planner.py +44 -0
- package/python/foxclaw/search/retriever.py +39 -0
- package/python/foxclaw/search/runtime.py +134 -0
- package/python/foxclaw/search/strategy.py +44 -0
- package/python/foxclaw/skills/__init__.py +613 -0
- package/python/foxclaw/skills/hooks_spec.py +73 -0
- package/python/foxclaw/skills/lifecycle.py +278 -0
- package/python/foxclaw/skills/markdown_skill.py +174 -0
- package/python/foxclaw/skills/markdown_store.py +39 -0
- package/python/foxclaw/skills/mcp_client.py +190 -0
- package/python/foxclaw/skills/mcp_store.py +43 -0
- package/python/foxclaw/skills/permission.py +180 -0
- package/python/foxclaw/skills/pipeline.py +386 -0
- package/python/foxclaw/skills/policy.py +80 -0
- package/python/foxclaw/skills/review.py +72 -0
- package/python/foxclaw/skills/store.py +57 -0
- package/python/frontend/assets/core_bg.jpg +0 -0
- package/python/frontend/deck/auth.js +32 -0
- package/python/frontend/deck/chat_model_picker.js +537 -0
- package/python/frontend/deck/domain.js +296 -0
- package/python/frontend/deck/main.js +1950 -0
- package/python/frontend/deck/markdown.js +48 -0
- package/python/frontend/deck/settings.js +324 -0
- package/python/frontend/deck/state.js +6 -0
- package/python/frontend/deck/util.js +6 -0
- package/python/frontend/deck/visuals.js +212 -0
- package/python/frontend/deck.css +855 -0
- package/python/frontend/deck.html +686 -0
- package/python/frontend/deck_v2.html +341 -0
- package/python/frontend/planet/index.html +266 -0
- package/python/frontend/planet/planet.css +579 -0
- package/python/frontend/planet/planet.js +1637 -0
- package/python/frontend/planet/vendor/three.core.min.js +6 -0
- package/python/frontend/planet/vendor/three.module.min.js +6 -0
- package/python/frontend/v3/assets/index-BD7VPbMV.js +33 -0
- package/python/frontend/v3/assets/index-CAvnYWGH.css +1 -0
- package/python/frontend/v3/index.html +15 -0
- package/python/frontend/widget_runtime.js +295 -0
- package/python/frontend/widgets.js +696 -0
- package/python/frontend_src/index.html +14 -0
- package/python/frontend_src/package-lock.json +1376 -0
- package/python/frontend_src/package.json +19 -0
- package/python/frontend_src/src/App.vue +62 -0
- package/python/frontend_src/src/api.js +89 -0
- package/python/frontend_src/src/components/ChatDock.vue +377 -0
- package/python/frontend_src/src/components/ComposerMenu.vue +75 -0
- package/python/frontend_src/src/components/DocViewer.vue +171 -0
- package/python/frontend_src/src/components/Inspector.vue +241 -0
- package/python/frontend_src/src/components/LeftRail.vue +394 -0
- package/python/frontend_src/src/components/MenuPopover.vue +130 -0
- package/python/frontend_src/src/components/MessageStream.vue +401 -0
- package/python/frontend_src/src/components/ModelPicker.vue +355 -0
- package/python/frontend_src/src/components/QuickIngest.vue +118 -0
- package/python/frontend_src/src/components/Stage.vue +226 -0
- package/python/frontend_src/src/components/ToolMenu.vue +144 -0
- package/python/frontend_src/src/components/TopBar.vue +90 -0
- package/python/frontend_src/src/components/panels/ActivityPanel.vue +84 -0
- package/python/frontend_src/src/components/panels/AgentsPanel.vue +86 -0
- package/python/frontend_src/src/components/panels/KnowledgePanel.vue +441 -0
- package/python/frontend_src/src/components/panels/MemoryPanel.vue +118 -0
- package/python/frontend_src/src/components/panels/PanelBox.vue +51 -0
- package/python/frontend_src/src/components/panels/ReviewPanel.vue +308 -0
- package/python/frontend_src/src/components/panels/SettingsPanel.vue +254 -0
- package/python/frontend_src/src/components/panels/TasksPanel.vue +74 -0
- package/python/frontend_src/src/components/panels/ToolsPanel.vue +640 -0
- package/python/frontend_src/src/components/panels/UsagePanel.vue +105 -0
- package/python/frontend_src/src/lib/fmt.js +48 -0
- package/python/frontend_src/src/lib/md.js +204 -0
- package/python/frontend_src/src/main.js +7 -0
- package/python/frontend_src/src/stores/app.js +106 -0
- package/python/frontend_src/src/stores/chat.js +484 -0
- package/python/frontend_src/src/stores/model.js +104 -0
- package/python/frontend_src/src/stores/panels.js +330 -0
- package/python/frontend_src/src/styles/base.css +138 -0
- package/python/frontend_src/src/styles/panel.css +117 -0
- package/python/frontend_src/src/styles/tokens.css +78 -0
- package/python/frontend_src/vite.config.js +46 -0
- package/python/pyproject.toml +265 -0
- package/python/skills/README.md +123 -0
- package/python/skills/execution-contract/SKILL.md +30 -0
- package/python/skills/general-assistant/SKILL.md +34 -0
- package/python/skills/planner/SKILL.md +33 -0
- package/python/skills/schedule-itinerary/SKILL.md +35 -0
- package/python/skills/skill-composition/SKILL.md +31 -0
- package/python/skills/skill-guard/SKILL.md +67 -0
- package/python/skills/skill-memory/SKILL.md +50 -0
- package/python/skills/skill-router/SKILL.md +35 -0
- package/python/tests/conftest.py +76 -0
- package/python/tests/run_all.py +263 -0
- package/python/tests/test_agent_lifecycle.py +360 -0
- package/python/tests/test_ahs_p2.py +414 -0
- package/python/tests/test_anthropic_tools.py +206 -0
- package/python/tests/test_api.py +87 -0
- package/python/tests/test_api_auth.py +83 -0
- package/python/tests/test_api_host_guard.py +69 -0
- package/python/tests/test_attachments.py +167 -0
- package/python/tests/test_audit_chain.py +121 -0
- package/python/tests/test_audit_sink.py +136 -0
- package/python/tests/test_browser.py +153 -0
- package/python/tests/test_browser_request_guard.py +184 -0
- package/python/tests/test_capabilities.py +158 -0
- package/python/tests/test_channel_signing.py +192 -0
- package/python/tests/test_channel_trust.py +109 -0
- package/python/tests/test_channels.py +184 -0
- package/python/tests/test_cli.py +46 -0
- package/python/tests/test_compaction_toolpair.py +119 -0
- package/python/tests/test_config_layering.py +65 -0
- package/python/tests/test_confirm_nonce.py +197 -0
- package/python/tests/test_context_compaction_wiring.py +130 -0
- package/python/tests/test_dispatch.py +95 -0
- package/python/tests/test_domain_evals.py +403 -0
- package/python/tests/test_domain_import.py +78 -0
- package/python/tests/test_domain_reasoners.py +148 -0
- package/python/tests/test_e2e.py +178 -0
- package/python/tests/test_emb_cache.py +107 -0
- package/python/tests/test_embedding_singleton.py +89 -0
- package/python/tests/test_envfile.py +83 -0
- package/python/tests/test_evals_smoke.py +114 -0
- package/python/tests/test_event_spine.py +182 -0
- package/python/tests/test_evidence_semantic.py +101 -0
- package/python/tests/test_evidence_sse.py +97 -0
- package/python/tests/test_file_ingest.py +146 -0
- package/python/tests/test_finance.py +153 -0
- package/python/tests/test_finance_ledger.py +252 -0
- package/python/tests/test_finance_persist.py +178 -0
- package/python/tests/test_gateway.py +144 -0
- package/python/tests/test_governance.py +468 -0
- package/python/tests/test_governance_audit.py +359 -0
- package/python/tests/test_governance_middleware.py +143 -0
- package/python/tests/test_hkc.py +286 -0
- package/python/tests/test_hkc_index_build_manager.py +339 -0
- package/python/tests/test_hkc_manifest_reuse.py +317 -0
- package/python/tests/test_hkc_search_event_sync.py +533 -0
- package/python/tests/test_import_path_guard.py +161 -0
- package/python/tests/test_injection_guard.py +211 -0
- package/python/tests/test_integration.py +141 -0
- package/python/tests/test_itinerary.py +103 -0
- package/python/tests/test_kee_semantic.py +89 -0
- package/python/tests/test_kernel.py +222 -0
- package/python/tests/test_learning.py +110 -0
- package/python/tests/test_llm_admin.py +160 -0
- package/python/tests/test_llm_planner.py +366 -0
- package/python/tests/test_markdown_skills.py +73 -0
- package/python/tests/test_markdown_skills_openclaw.py +71 -0
- package/python/tests/test_mcp_connectors.py +109 -0
- package/python/tests/test_mcp_guardian_discovery.py +91 -0
- package/python/tests/test_mcp_no_memory.py +43 -0
- package/python/tests/test_mcp_policy_gate.py +77 -0
- package/python/tests/test_mcp_server.py +95 -0
- package/python/tests/test_memory_recall.py +95 -0
- package/python/tests/test_metrics.py +66 -0
- package/python/tests/test_multi_chain.py +102 -0
- package/python/tests/test_multimodal.py +135 -0
- package/python/tests/test_negotiation.py +146 -0
- package/python/tests/test_orchestration.py +119 -0
- package/python/tests/test_orchestration_decoupled.py +109 -0
- package/python/tests/test_p3_p5_hardening.py +338 -0
- package/python/tests/test_parallel_dispatch.py +215 -0
- package/python/tests/test_pipeline.py +533 -0
- package/python/tests/test_plan_visible.py +86 -0
- package/python/tests/test_planner.py +95 -0
- package/python/tests/test_policy_gate.py +109 -0
- package/python/tests/test_reasoner.py +185 -0
- package/python/tests/test_release_check.py +263 -0
- package/python/tests/test_resume_checkpoint.py +156 -0
- package/python/tests/test_routing.py +95 -0
- package/python/tests/test_scheduler.py +141 -0
- package/python/tests/test_search.py +204 -0
- package/python/tests/test_secrets.py +159 -0
- package/python/tests/test_semantic.py +78 -0
- package/python/tests/test_sessions.py +91 -0
- package/python/tests/test_settings.py +281 -0
- package/python/tests/test_shadow_learning.py +330 -0
- package/python/tests/test_shared_write.py +207 -0
- package/python/tests/test_skill_taint_gate.py +154 -0
- package/python/tests/test_skills.py +133 -0
- package/python/tests/test_stats_and_events.py +165 -0
- package/python/tests/test_streaming.py +60 -0
- package/python/tests/test_supervisor_pipeline.py +177 -0
- package/python/tests/test_supervisor_triage.py +108 -0
- package/python/tests/test_taint.py +117 -0
- package/python/tests/test_task_stream.py +85 -0
- package/python/tests/test_thinking_sse.py +67 -0
- package/python/tests/test_thinking_stream.py +76 -0
- package/python/tests/test_tool_center.py +129 -0
- package/python/tests/test_tool_parallel.py +113 -0
- package/python/tests/test_tool_params.py +103 -0
- package/python/tests/test_tool_use.py +242 -0
- package/python/tests/test_toplevel_concurrency.py +117 -0
- package/python/tests/test_tracing.py +290 -0
- package/python/tests/test_truth_crystallizer.py +127 -0
- package/python/tests/test_truth_flow.py +93 -0
- package/python/tests/test_url_policy.py +53 -0
- package/python/tests/test_verify_evidence.py +225 -0
- package/python/tests/test_version_sync.py +71 -0
- package/python/tests/test_web_trigger.py +99 -0
- package/python/tools/check_faiss_type.py +31 -0
- package/python/tools/check_log.ps1 +46 -0
- package/python/tools/ivf_status.py +72 -0
- package/python/tools/mypy_baseline.txt +5 -0
- package/python/tools/mypy_ratchet.py +97 -0
- package/python/tools/pack.py +178 -0
- package/python/tools/release_check.py +349 -0
- package/python/tools/restart_foxclaw.ps1 +74 -0
- package/python/tools/shared_write_audit.py +204 -0
- package/python/tools/size_baseline.txt +28 -0
- package/python/tools/size_check.py +102 -0
- package/python/tools/verify_env.bat +2 -0
- package/python/tools/verify_env.py +25 -0
- package/python/vendor/HMR_LICENSE +37 -0
- package/python/vendor/HMR_README.md +65 -0
- package/python/vendor/hkc/LICENSE +37 -0
- package/python/vendor/hkc/hkc_ace/__init__.py +0 -0
- package/python/vendor/hkc/hkc_ace/ace.py +457 -0
- package/python/vendor/hkc/hkc_ace/skill_taxonomy.json +465 -0
- package/python/vendor/hkc/hkc_api/__init__.py +0 -0
- package/python/vendor/hkc/hkc_api/container.py +416 -0
- package/python/vendor/hkc/hkc_api/ingest_jobs.py +103 -0
- package/python/vendor/hkc/hkc_api/main.py +157 -0
- package/python/vendor/hkc/hkc_api/routes/__init__.py +0 -0
- package/python/vendor/hkc/hkc_api/routes/ability.py +151 -0
- package/python/vendor/hkc/hkc_api/routes/config.py +51 -0
- package/python/vendor/hkc/hkc_api/routes/knowledge.py +630 -0
- package/python/vendor/hkc/hkc_api/routes/search.py +88 -0
- package/python/vendor/hkc/hkc_api/schemas.py +153 -0
- package/python/vendor/hkc/hkc_api/synthesis.py +179 -0
- package/python/vendor/hkc/hkc_core/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/graph/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/graph/base.py +188 -0
- package/python/vendor/hkc/hkc_core/graph/sqlite_store.py +789 -0
- package/python/vendor/hkc/hkc_core/models/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/models/enums.py +65 -0
- package/python/vendor/hkc/hkc_core/models/ku.py +307 -0
- package/python/vendor/hkc/hkc_core/utils/__init__.py +0 -0
- package/python/vendor/hkc/hkc_core/utils/id_gen.py +113 -0
- package/python/vendor/hkc/hkc_crystallizer/__init__.py +44 -0
- package/python/vendor/hkc/hkc_crystallizer/adapters.py +94 -0
- package/python/vendor/hkc/hkc_crystallizer/candidate.py +145 -0
- package/python/vendor/hkc/hkc_crystallizer/crystallizer.py +179 -0
- package/python/vendor/hkc/hkc_crystallizer/ingress.py +90 -0
- package/python/vendor/hkc/hkc_kde/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kde/chunker.py +197 -0
- package/python/vendor/hkc/hkc_kde/extractor.py +623 -0
- package/python/vendor/hkc/hkc_kde/kde.py +298 -0
- package/python/vendor/hkc/hkc_kde/loaders/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kde/loaders/ebook_loader.py +153 -0
- package/python/vendor/hkc/hkc_kde/loaders/office_loader.py +194 -0
- package/python/vendor/hkc/hkc_kde/loaders/pdf_loader.py +162 -0
- package/python/vendor/hkc/hkc_kde/loaders/text_loader.py +157 -0
- package/python/vendor/hkc/hkc_kde/loaders/web_loader.py +91 -0
- package/python/vendor/hkc/hkc_kde/models.py +74 -0
- package/python/vendor/hkc/hkc_kde/packager.py +329 -0
- package/python/vendor/hkc/hkc_kde/relation_disc.py +151 -0
- package/python/vendor/hkc/hkc_kee/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kee/dedup.py +227 -0
- package/python/vendor/hkc/hkc_kee/fingerprint.py +106 -0
- package/python/vendor/hkc/hkc_kee/kee.py +541 -0
- package/python/vendor/hkc/hkc_kep/__init__.py +0 -0
- package/python/vendor/hkc/hkc_kep/event_bus.py +205 -0
- package/python/vendor/hkc/hkc_sdk/__init__.py +63 -0
- package/python/vendor/hkc/hkc_sdk/base.py +151 -0
- package/python/vendor/hkc/hkc_sdk/direct_client.py +153 -0
- package/python/vendor/hkc/hkc_sdk/exceptions.py +39 -0
- package/python/vendor/hkc/hkc_sdk/http_client.py +166 -0
- package/python/vendor/hkc/hkc_sdk/models.py +171 -0
- package/python/vendor/hkc/hkc_search/__init__.py +0 -0
- package/python/vendor/hkc/hkc_search/bm25.py +325 -0
- package/python/vendor/hkc/hkc_search/embedding_backends.py +374 -0
- package/python/vendor/hkc/hkc_search/graph_search.py +132 -0
- package/python/vendor/hkc/hkc_search/hybrid.py +331 -0
- package/python/vendor/hkc/hkc_search/index_build_manager.py +378 -0
- package/python/vendor/hkc/hkc_search/vector_search.py +484 -0
- package/python/vendor/hmr/__init__.py +0 -0
- package/python/vendor/hmr/core/__init__.py +0 -0
- package/python/vendor/hmr/core/hmr.py +684 -0
- package/python/vendor/hmr/core/models.py +310 -0
- package/python/vendor/hmr/engines/__init__.py +0 -0
- package/python/vendor/hmr/engines/evolution.py +710 -0
- package/python/vendor/hmr/engines/jit_compiler.py +472 -0
- package/python/vendor/hmr/engines/lifecycle.py +264 -0
- package/python/vendor/hmr/engines/policy.py +625 -0
- package/python/vendor/hmr/engines/recall.py +260 -0
- package/python/vendor/hmr/engines/runtime_state.py +158 -0
- package/python/vendor/hmr/engines/scheduler.py +323 -0
- package/python/vendor/hmr/engines/semantic.py +150 -0
- package/python/vendor/hmr/engines/temporal.py +261 -0
- package/python/vendor/hmr/engines/thought_chain.py +635 -0
- package/python/vendor/hmr/graph/__init__.py +0 -0
- package/python/vendor/hmr/graph/cwg.py +338 -0
- package/python/vendor/hmr/graph/memory_graph.py +530 -0
- package/python/vendor/hmr/storage/__init__.py +0 -0
- package/python/vendor/hmr/storage/memory_fs.py +300 -0
- package/python/vendor/hmr/storage/vector_store.py +520 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function s(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=s(o);fetch(o.href,i)}})();/**
|
|
2
|
+
* @vue/shared v3.5.45
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function Sl(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ye={},fs=[],wt=()=>{},zo=()=>!1,Sn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Mn=e=>e.startsWith("onUpdate:"),Ee=Object.assign,Ml=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},mr=Object.prototype.hasOwnProperty,fe=(e,t)=>mr.call(e,t),Z=Array.isArray,Gt=e=>Zs(e)==="[object Map]",Vt=e=>Zs(e)==="[object Set]",Gl=e=>Zs(e)==="[object Date]",le=e=>typeof e=="function",xe=e=>typeof e=="string",ft=e=>typeof e=="symbol",he=e=>e!==null&&typeof e=="object",Jo=e=>(he(e)||le(e))&&le(e.then)&&le(e.catch),Go=Object.prototype.toString,Zs=e=>Go.call(e),_r=e=>Zs(e).slice(8,-1),Yo=e=>Zs(e)==="[object Object]",Tl=e=>xe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Rs=Sl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Tn=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},yr=/-\w/g,ze=Tn(e=>e.replace(yr,t=>t.slice(1).toUpperCase())),br=/\B([A-Z])/g,ts=Tn(e=>e.replace(br,"-$1").toLowerCase()),En=Tn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wn=Tn(e=>e?`on${En(e)}`:""),kt=(e,t)=>!Object.is(e,t),dn=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},Xo=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},en=e=>{const t=parseFloat(e);return isNaN(t)?e:t},kr=e=>{const t=xe(e)?Number(e):NaN;return isNaN(t)?e:t};let Yl;const An=()=>Yl||(Yl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function xt(e){if(Z(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],o=xe(n)?Cr(n):xt(n);if(o)for(const i in o)t[i]=o[i]}return t}else if(xe(e)||he(e))return e}const $r=/;(?![^(]*\))/g,wr=/:([^]+)/,xr=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Cr(e){const t={};return e.replace(xr,s=>s.startsWith("/*")?"":s).split($r).forEach(s=>{if(s){const n=s.split(wr);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function se(e){let t="";if(xe(e))t=e;else if(Z(e))for(let s=0;s<e.length;s++){const n=se(e[s]);n&&(t+=n+" ")}else if(he(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Sr="itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",Mr=Sl(Sr);function Qo(e){return!!e||e===""}function Tr(e,t,s){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Ut(e[o],t[o],s);return n}function Xl(e,t,s){if(e.size!==t.size)return!1;const n=Array.from(t),o=new Uint8Array(n.length);for(const i of e){let r=-1;for(let u=0;u<n.length;u++)if(!o[u]&&Ut(i,n[u],s)){r=u;break}if(r<0)return!1;o[r]=1}return!0}function Er(e,t,s){let n=Gt(e),o=Gt(t);if(n||o||(n=Vt(e),o=Vt(t),n||o))return n&&o?Xl(e,t,s):!1;const i=Object.keys(e).length,r=Object.keys(t).length;if(i!==r)return!1;for(const u in e){const a=e.hasOwnProperty(u),c=t.hasOwnProperty(u);if(a&&!c||!a&&c||!Ut(e[u],t[u],s))return!1}return String(e)===String(t)}function Ql(e,t,s,n){s||(s=[new Map,new Map]);const[o,i]=s;if(o.has(e)||i.has(t))return o.get(e)===t&&i.get(t)===e;o.set(e,t),i.set(t,e);const r=n(e,t,s);return o.delete(e),i.delete(t),r}function Ut(e,t,s){if(e===t)return!0;let n=Gl(e),o=Gl(t);return n||o?n&&o?e.getTime()===t.getTime():!1:(n=ft(e),o=ft(t),n||o?e===t:(n=Z(e),o=Z(t),n||o?n&&o?Ql(e,t,s,Tr):!1:(n=he(e),o=he(t),n||o?!n||!o?!1:Ql(e,t,s,Er):String(e)===String(t))))}function El(e,t){return e.findIndex(s=>Ut(s,t))}const Zo=e=>!!(e&&e.__v_isRef===!0),f=e=>xe(e)?e:e==null?"":Z(e)||he(e)&&(e.toString===Go||!le(e.toString))?Zo(e)?f(e.value):JSON.stringify(e,ei,2):String(e),ei=(e,t)=>Zo(t)?ei(e,t.value):Gt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,o],i)=>(s[zn(n,i)+" =>"]=o,s),{})}:Vt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>zn(s))}:ft(t)?zn(t):he(t)&&!Z(t)&&!Yo(t)?String(t):t,zn=(e,t="")=>{var s;return ft(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
|
|
6
|
+
* @vue/reactivity v3.5.45
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let De;class Ar{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&De&&(De.active?(this.parent=De,this.index=(De.scopes||(De.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes){const n=this.scopes.slice();for(t=0,s=n.length;t<s;t++)n[t].pause()}for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes){const o=this.scopes.slice();for(t=0,s=o.length;t<s;t++)o[t].resume()}const n=this.effects.slice();for(t=0,s=n.length;t<s;t++)n[t].resume()}}run(t){if(this._active){const s=De;try{return De=this,t()}finally{De=s}}}on(){++this._on===1&&(this.prevScope=De,De=this)}off(){if(this._on>0&&--this._on===0){if(De===this)De=this.prevScope;else{let t=De;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(s=0,n=o.length;s<n;s++)o[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Or(){return De}let $e;const Jn=new WeakSet;class ti{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,De&&(De.active?De.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Jn.has(this)&&(Jn.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ni(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Zl(this),li(this);const t=$e,s=dt;$e=this,dt=!0;try{return this.fn()}finally{oi(this),$e=t,dt=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Il(t);this.deps=this.depsTail=void 0,Zl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Jn.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){rl(this)&&this.run()}get dirty(){return rl(this)}}let si=0,Ls,Ds;function ni(e,t=!1){if(e.flags|=8,t){e.next=Ds,Ds=e;return}e.next=Ls,Ls=e}function Al(){si++}function Ol(){if(--si>0)return;if(Ds){let t=Ds;for(Ds=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Ls;){let t=Ls;for(Ls=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function li(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function oi(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),Il(n),Ir(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function rl(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ii(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function ii(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Vs)||(e.globalVersion=Vs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!rl(e))))return;e.flags|=2;const t=e.dep,s=$e,n=dt;$e=e,dt=!0;try{li(e);const o=e.fn(e._value);(t.version===0||kt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{$e=s,dt=n,oi(e),e.flags&=-3}}function Il(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let i=s.computed.deps;i;i=i.nextDep)Il(i,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Ir(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let dt=!0;const ri=[];function Ct(){ri.push(dt),dt=!1}function St(){const e=ri.pop();dt=e===void 0?!0:e}function Zl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=$e;$e=void 0;try{t()}finally{$e=s}}}let Vs=0;class Pr{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Pl{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!$e||!dt||$e===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==$e)s=this.activeLink=new Pr($e,this),$e.deps?(s.prevDep=$e.depsTail,$e.depsTail.nextDep=s,$e.depsTail=s):$e.deps=$e.depsTail=s,ai(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=$e.depsTail,s.nextDep=void 0,$e.depsTail.nextDep=s,$e.depsTail=s,$e.deps===s&&($e.deps=n)}return s}trigger(t){this.version++,Vs++,this.notify(t)}notify(t){Al();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Ol()}}}function ai(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)ai(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const al=new WeakMap,ps=Symbol(""),ul=Symbol(""),Us=Symbol("");function Ue(e,t,s){if(dt&&$e){let n=al.get(e);n||al.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new Pl),o.map=n,o.key=s),o.track()}}function Dt(e,t,s,n,o,i){const r=al.get(e);if(!r){Vs++;return}const u=a=>{a&&a.trigger()};if(Al(),t==="clear")r.forEach(u);else{const a=Z(e),c=a&&Tl(s);if(a&&s==="length"){const d=Number(n);r.forEach((v,k)=>{(k==="length"||k===Us||!ft(k)&&k>=d)&&u(v)})}else switch((s!==void 0||r.has(void 0))&&u(r.get(s)),c&&u(r.get(Us)),t){case"add":a?c&&u(r.get("length")):(u(r.get(ps)),Gt(e)&&u(r.get(ul)));break;case"delete":a||(u(r.get(ps)),Gt(e)&&u(r.get(ul)));break;case"set":Gt(e)&&u(r.get(ps));break}}Ol()}function ms(e){const t=de(e);return t===e||(Ue(t,"iterate",Us),nt(e))?t:Tt(e)?Yt(e)?t.map(s=>Zt(ot(s))):t.map(Zt):t.map(ot)}function On(e){return Ue(e=de(e),"iterate",Us),e}function _t(e,t){return Tt(e)?Zt(Yt(e)?ot(t):t):ot(t)}const Rr={__proto__:null,[Symbol.iterator](){return Gn(this,Symbol.iterator,e=>_t(this,e))},concat(...e){return ms(this).concat(...e.map(t=>Z(t)?ms(t):t))},entries(){return Gn(this,"entries",e=>(e[1]=_t(this,e[1]),e))},every(e,t){return It(this,"every",e,t,void 0,arguments)},filter(e,t){return It(this,"filter",e,t,s=>s.map(n=>_t(this,n)),arguments)},find(e,t){return It(this,"find",e,t,s=>_t(this,s),arguments)},findIndex(e,t){return It(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return It(this,"findLast",e,t,s=>_t(this,s),arguments)},findLastIndex(e,t){return It(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return It(this,"forEach",e,t,void 0,arguments)},includes(...e){return Yn(this,"includes",e)},indexOf(...e){return Yn(this,"indexOf",e)},join(e){return ms(this).join(e)},lastIndexOf(...e){return Yn(this,"lastIndexOf",e)},map(e,t){return It(this,"map",e,t,void 0,arguments)},pop(){return xs(this,"pop")},push(...e){return xs(this,"push",e)},reduce(e,...t){return to(this,"reduce",e,t)},reduceRight(e,...t){return to(this,"reduceRight",e,t)},shift(){return xs(this,"shift")},some(e,t){return It(this,"some",e,t,void 0,arguments)},splice(...e){return xs(this,"splice",e)},toReversed(){return ms(this).toReversed()},toSorted(e){return ms(this).toSorted(e)},toSpliced(...e){return ms(this).toSpliced(...e)},unshift(...e){return xs(this,"unshift",e)},values(){return Gn(this,"values",e=>_t(this,e))}};function Gn(e,t,s){const n=On(e),o=n[t],i=o.call(n);if(n!==e&&!nt(e)){if(i[Symbol.toStringTag]==="Array Iterator"){const r=Object.create(Object.getPrototypeOf(i));return r.next=()=>eo(i.next(),s),o!==ui[t]&&Object.defineProperties(r,{return:{get(){const u=i.return;return typeof u=="function"?u.bind(i):u}},throw:{get(){const u=i.throw;return typeof u=="function"?u.bind(i):u}}}),r}i._next=i.next,i.next=()=>eo(i._next(),s)}return i}function eo(e,t){return e.done||(e.value=t(e.value)),e}const ui=Array.prototype;function It(e,t,s,n,o,i){const r=On(e),u=r!==e&&!nt(e),a=r[t];if(a!==ui[t]){const v=a.apply(e,i);return u?ot(v):v}let c=s;r!==e&&(u?c=function(v,k){return s.call(this,_t(e,v),k,e)}:s.length>2&&(c=function(v,k){return s.call(this,v,k,e)}));const d=a.call(r,c,n);return u&&o?o(d):d}function to(e,t,s,n){const o=On(e),i=o!==e&&!nt(e);let r=s,u=!1;o!==e&&(i?(u=n.length===0,r=function(c,d,v){return u&&(u=!1,c=_t(e,c)),s.call(this,c,_t(e,d),v,e)}):s.length>3&&(r=function(c,d,v){return s.call(this,c,d,v,e)}));const a=o[t](r,...n);return u?_t(e,a):a}function Yn(e,t,s){const n=de(e);Ue(n,"iterate",Us);const o=n[t](...s);return(o===-1||o===!1)&&Dl(s[0])?(s[0]=de(s[0]),n[t](...s)):o}function xs(e,t,s=[]){Ct(),Al();const n=de(e)[t].apply(e,s);return Ol(),St(),n}const Lr=Sl("__proto__,__v_isRef,__isVue"),ci=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ft));function Dr(e){ft(e)||(e=String(e));const t=de(this);return Ue(t,"has",e),t.hasOwnProperty(e)}class di{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return i;if(s==="__v_raw")return n===(o?i?Wr:gi:i?hi:pi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const r=Z(t);if(!o){let a;if(r&&(a=Rr[s]))return a;if(s==="hasOwnProperty")return Dr}const u=Reflect.get(t,s,Fe(t)?t:n);if((ft(s)?ci.has(s):Lr(s))||(o||Ue(t,"get",s),i))return u;if(Fe(u)){const a=r&&Tl(s)?u:u.value;return o&&he(a)?dl(a):a}return he(u)?o?dl(u):Mt(u):u}}class fi extends di{constructor(t=!1){super(!1,t)}set(t,s,n,o){let i=t[s];const r=Z(t)&&Tl(s);if(!this._isShallow){const c=Tt(i);if(!nt(n)&&!Tt(n)&&(i=de(i),n=de(n)),!r&&Fe(i)&&!Fe(n))return c||(i.value=n),!0}const u=r?Number(s)<t.length:fe(t,s),a=Reflect.set(t,s,n,Fe(t)?t:o);return t===de(o)&&a&&(u?kt(n,i)&&Dt(t,"set",s,n):Dt(t,"add",s,n)),a}deleteProperty(t,s){const n=fe(t,s);t[s];const o=Reflect.deleteProperty(t,s);return o&&n&&Dt(t,"delete",s,void 0),o}has(t,s){const n=Reflect.has(t,s);return(!ft(s)||!ci.has(s))&&Ue(t,"has",s),n}ownKeys(t){return Ue(t,"iterate",Z(t)?"length":ps),Reflect.ownKeys(t)}}class Nr extends di{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const jr=new fi,Fr=new Nr,Vr=new fi(!0);const cl=e=>e,nn=e=>Reflect.getPrototypeOf(e);function Ur(e,t,s){return function(...n){const o=this.__v_raw,i=de(o),r=Gt(i),u=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...n),d=s?cl:t?Zt:ot;return!t&&Ue(i,"iterate",a?ul:ps),Ee(Object.create(c),{next(){const{value:v,done:k}=c.next();return k?{value:v,done:k}:{value:u?[d(v[0]),d(v[1])]:d(v),done:k}}})}}function ln(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(o){const i=this.__v_raw,r=de(i),u=de(o);e||(kt(o,u)&&Ue(r,"get",o),Ue(r,"get",u));const{has:a}=nn(r),c=t?cl:e?Zt:ot;if(a.call(r,o))return c(i.get(o));if(a.call(r,u))return c(i.get(u));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&Ue(de(o),"iterate",ps),o.size},has(o){const i=this.__v_raw,r=de(i),u=de(o);return e||(kt(o,u)&&Ue(r,"has",o),Ue(r,"has",u)),o===u?i.has(o):i.has(o)||i.has(u)},forEach(o,i){const r=this,u=r.__v_raw,a=de(u),c=t?cl:e?Zt:ot;return!e&&Ue(a,"iterate",ps),u.forEach((d,v)=>o.call(i,c(d),c(v),r))}};return Ee(s,e?{add:ln("add"),set:ln("set"),delete:ln("delete"),clear:ln("clear")}:{add(o){const i=de(this),r=nn(i),u=de(o),a=!t&&!nt(o)&&!Tt(o)?u:o;return r.has.call(i,a)||kt(o,a)&&r.has.call(i,o)||kt(u,a)&&r.has.call(i,u)||(i.add(a),Dt(i,"add",a,a)),this},set(o,i){!t&&!nt(i)&&!Tt(i)&&(i=de(i));const r=de(this),{has:u,get:a}=nn(r);let c=u.call(r,o);c||(o=de(o),c=u.call(r,o));const d=a.call(r,o);return r.set(o,i),c?kt(i,d)&&Dt(r,"set",o,i):Dt(r,"add",o,i),this},delete(o){const i=de(this),{has:r,get:u}=nn(i);let a=r.call(i,o);a||(o=de(o),a=r.call(i,o)),u&&u.call(i,o);const c=i.delete(o);return a&&Dt(i,"delete",o,void 0),c},clear(){const o=de(this),i=o.size!==0,r=o.clear();return i&&Dt(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=Ur(o,e,t)}),s}function Rl(e,t){const s=Hr(e,t);return(n,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?n:Reflect.get(fe(s,o)&&o in n?s:n,o,i)}const Br={get:Rl(!1,!1)},Kr={get:Rl(!1,!0)},qr={get:Rl(!0,!1)};const pi=new WeakMap,hi=new WeakMap,gi=new WeakMap,Wr=new WeakMap;function zr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Mt(e){return Tt(e)?e:Ll(e,!1,jr,Br,pi)}function Jr(e){return Ll(e,!1,Vr,Kr,hi)}function dl(e){return Ll(e,!0,Fr,qr,gi)}function Ll(e,t,s,n,o){if(!he(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=zr(_r(e));if(r===0)return e;const u=new Proxy(e,r===2?n:s);return o.set(e,u),u}function Yt(e){return Tt(e)?Yt(e.__v_raw):!!(e&&e.__v_isReactive)}function Tt(e){return!!(e&&e.__v_isReadonly)}function nt(e){return!!(e&&e.__v_isShallow)}function Dl(e){return e?!!e.__v_raw:!1}function de(e){const t=e&&e.__v_raw;return t?de(t):e}function Gr(e){return!fe(e,"__v_skip")&&Object.isExtensible(e)&&Xo(e,"__v_skip",!0),e}const ot=e=>he(e)?Mt(e):e,Zt=e=>he(e)?dl(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function W(e){return Yr(e,!1)}function Yr(e,t){return Fe(e)?e:new Xr(e,t)}class Xr{constructor(t,s){this.dep=new Pl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:de(t),this._value=s?t:ot(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||nt(t)||Tt(t);t=n?t:de(t),kt(t,s)&&(this._rawValue=t,this._value=n?t:ot(t),this.dep.trigger())}}function m(e){return Fe(e)?e.value:e}const Qr={get:(e,t,s)=>t==="__v_raw"?e:m(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Fe(o)&&!Fe(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function vi(e){return Yt(e)?e:new Proxy(e,Qr)}class Zr{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new Pl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Vs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&$e!==this)return ni(this,!0),!0}get value(){const t=this.dep.track();return ii(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ea(e,t,s=!1){let n,o;return le(e)?n=e:(n=e.get,o=e.set),new Zr(n,o,s)}const on={},hn=new WeakMap;let us;function ta(e,t=!1,s=us){if(s){let n=hn.get(s);n||hn.set(s,n=[]),n.push(e)}}function sa(e,t,s=ye){const{immediate:n,deep:o,once:i,scheduler:r,augmentJob:u,call:a}=s,c=T=>o?T:nt(T)||o===!1||o===0?Nt(T,1):Nt(T);let d,v,k,$,P=!1,b=!1;if(Fe(e)?(v=()=>e.value,P=nt(e)):Yt(e)?(v=()=>c(e),P=!0):Z(e)?(b=!0,P=e.some(T=>Yt(T)||nt(T)),v=()=>e.map(T=>{if(Fe(T))return T.value;if(Yt(T))return c(T);if(le(T))return a?a(T,2):T()})):le(e)?t?v=a?()=>a(e,2):e:v=()=>{if(k){Ct();try{k()}finally{St()}}const T=us;us=d;try{return a?a(e,3,[$]):e($)}finally{us=T}}:v=wt,t&&o){const T=v,X=o===!0?1/0:o;v=()=>Nt(T(),X)}const A=Or(),E=()=>{d.stop(),A&&A.active&&Ml(A.effects,d)};if(i&&t){const T=t;t=(...X)=>{try{return T(...X)}finally{E()}}}let M=b?new Array(e.length).fill(on):on;const I=T=>{if(!(!(d.flags&1)||!d.dirty&&!T))if(t){const X=d.run();if(T||o||P||(b?X.some((ce,K)=>kt(ce,M[K])):kt(X,M))){const ce=us;Ct();try{k&&k(),us=d;const K=[X,M===on?void 0:b&&M[0]===on?[]:M,$];M=X,a?a(t,3,K):t(...K)}finally{us=ce,St()}}}else d.run()};return u&&u(I),d=new ti(v),d.scheduler=r?()=>r(I,!1):I,$=T=>ta(T,!1,d),k=d.onStop=()=>{const T=hn.get(d);if(T){if(a)a(T,4);else for(const X of T)X();hn.delete(d)}},t?n?I(!0):M=d.run():r?r(I.bind(null,!0),!0):d.run(),E.pause=d.pause.bind(d),E.resume=d.resume.bind(d),E.stop=E,E}function Nt(e,t=1/0,s){if(t<=0||!he(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Fe(e))Nt(e.value,t,s);else if(Z(e))for(let n=0;n<e.length;n++)Nt(e[n],t,s);else if(Vt(e)||Gt(e))e.forEach(n=>{Nt(n,t,s)});else if(Yo(e)){for(const n in e)Nt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Nt(e[n],t,s)}return e}/**
|
|
10
|
+
* @vue/runtime-core v3.5.45
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function tn(e,t,s,n){try{return n?e(...n):e()}catch(o){In(o,t,s)}}function it(e,t,s,n){if(le(e)){const o=tn(e,t,s,n);return o&&Jo(o)&&o.catch(i=>{In(i,t,s,void 0,!0)}),o}if(Z(e)){const o=[];for(let i=0;i<e.length;i++)o.push(it(e[i],t,s,n));return o}}function In(e,t,s,n=!0,o=!1){const i=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:u}=t&&t.appContext.config||ye;if(t){let a=t.parent;const c=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${s}`;for(;a;){const v=a.ec;if(v&&!a.isUnmounted&&(!o||a.scope.active)){for(let k=0;k<v.length;k++)if(v[k](e,c,d)===!1)return}a=a.parent}if(r){Ct(),tn(r,null,10,[e,c,d]),St();return}}na(e,s,i,n,u)}function na(e,t,s,n=!0,o=!1){if(o)throw e;console.error(e)}const qe=[];let ct=-1;const yt=[];let zt=null,_s=0;const mi=Promise.resolve();let gn=null;function jt(e){const t=gn||mi;return e?t.then(this?e.bind(this):e):t}function la(e){let t=ct+1,s=qe.length;for(;t<s;){const n=t+s>>>1,o=qe[n],i=Hs(o);i<e||i===e&&o.flags&2?t=n+1:s=n}return t}function Pn(e){if(!(e.flags&1)){const t=Hs(e),s=qe[qe.length-1];!s||!(e.flags&2)&&t>=Hs(s)?qe.push(e):qe.splice(la(t),0,e),e.flags|=1,_i()}}function _i(){gn||(gn=mi.then(ki))}function oa(e){if(!Z(e))zt&&e.id===-1?zt.splice(_s+1,0,e):e.flags&1||(yt.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)yt.push(e[t]);_i()}function yi(e,t,s,n=ct+1){for(;n<qe.length;n++){const o=qe[n];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;qe.splice(n,1),n=e?n-1:ct,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function bi(e,t,s=0){if(yt.length){let n=yt,o=0;if(t){n=[];for(let r=0;r<yt.length;r++){const u=yt[r];(u.i!==void 0?!u.i||u.i.uid<s:t.has(u))?yt[o++]=u:n.push(u)}}const i=[...new Set(n)].sort((r,u)=>Hs(r)-Hs(u));if(yt.length=o,zt){for(let r=0;r<i.length;r++)zt.push(i[r]);return}for(zt=i,_s=0;_s<zt.length;_s++){const r=zt[_s];r.flags&4&&(r.flags&=-2),r.flags&8||r(),r.flags&=-2}zt=null,_s=0}}let Xn=!1;function ia(e,t){if(Xn){e();return}const s=t===void 0?void 0:new Set(yt);e(),Xn=!0;try{yi(void 0,t),bi(void 0,s,t)}finally{Xn=!1}}const Hs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ki(e){try{for(ct=0;ct<qe.length;ct++){const t=qe[ct];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),tn(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ct<qe.length;ct++){const t=qe[ct];t&&(t.flags&=-2)}ct=-1,qe.length=0,bi(),gn=null,(qe.length||yt.length)&&ki()}}let Ne=null,$i=null;function vn(e){const t=Ne;return Ne=e,$i=e&&e.type.__scopeId||null,t}function pt(e,t=Ne,s){if(!t||e._n)return e;const n=(...o)=>{n._d&&bn(-1);const i=vn(t),r=Ft.length;let u;try{u=e(...o)}finally{for(let a=Ft.length;a>r;a--)Vl();vn(i),n._d&&bn(1)}return u};return n._n=!0,n._c=!0,n._d=!0,n}function ae(e,t){if(Ne===null)return e;const s=jn(Ne),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,u,a=ye]=t[o];i&&(le(i)&&(i={mounted:i,updated:i}),i.deep&&Nt(r),n.push({dir:i,instance:s,value:r,oldValue:void 0,arg:u,modifiers:a}))}return e}function ls(e,t,s,n){let o=e;if(n==="beforeMount")e._mount=e;else if(n==="beforeUpdate"){const u=t&&t._mount;u&&(u._latest=e,e._mount=u)}else if(n==="mounted"){const u=e._latest;e._mount=e._latest=void 0,u&&(o=u,u._mount=void 0)}const i=o.dirs,r=t&&t.dirs;for(let u=0;u<i.length;u++){let a=i[u];r?a.oldValue=r[u].value:n==="mounted"&&a.oldValue!==void 0&&(a=Ee({},a,{oldValue:void 0}));let c=a.dir[n];c&&(Ct(),it(c,s,8,[e.el,a,o,t]),St())}}function ra(e,t){if(He){let s=He.provides;const n=He.parent&&He.parent.provides;n===s&&(s=He.provides=Object.create(n)),s[e]=t}}function fn(e,t,s=!1){const n=er();if(n||ks){let o=ks?ks._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return s&&le(t)?t.call(n&&n.proxy):t}}const aa=Symbol.for("v-scx"),ua=()=>fn(aa);function hs(e,t,s){return wi(e,t,s)}function wi(e,t,s=ye){const{immediate:n,deep:o,flush:i,once:r}=s,u=Ee({},s),a=t&&n||!t&&i!=="post";let c;if(zs){if(i==="sync"){const $=ua();c=$.__watcherHandles||($.__watcherHandles=[])}else if(!a){const $=()=>{};return $.stop=wt,$.resume=wt,$.pause=wt,$}}const d=He;u.call=($,P,b)=>it($,d,P,b);let v=!1;i==="post"?u.scheduler=$=>{$.i=d,Ve($,d&&d.suspense)}:i!=="sync"&&(v=!0,u.scheduler=($,P)=>{P?$():Pn($)}),u.augmentJob=$=>{t&&($.flags|=4),v&&($.flags|=2,d&&($.id=d.uid,$.i=d))};const k=sa(e,t,u);return zs&&(c?c.push(k):a&&k()),k}function ca(e,t,s){const n=this.proxy,o=xe(e)?e.includes(".")?xi(n,e):()=>n[e]:e.bind(n,n);let i;le(t)?i=t:(i=t.handler,s=t);const r=sn(this),u=wi(o,i.bind(n),s);return r(),u}function xi(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;o<s.length&&n;o++)n=n[s[o]];return n}}const Wt=new WeakMap,Ci=Symbol("_vte"),Rn=e=>e.__isTeleport,cs=e=>e&&(e.disabled||e.disabled===""),da=e=>e&&(e.defer||e.defer===""),so=e=>typeof SVGElement<"u"&&e instanceof SVGElement,no=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,fl=(e,t)=>{const s=e&&e.to;return xe(s)?t?t(s):null:s},fa={name:"Teleport",__isTeleport:!0,process(e,t,s,n,o,i,r,u,a,c){const{mc:d,pc:v,pbc:k,o:{insert:$,querySelector:P,createText:b,createComment:A,parentNode:E}}=c,M=cs(t.props);let{dynamicChildren:I}=t;const T=(K,x,S)=>{K.shapeFlag&16&&d(K.children,x,S,o,i,r,u,a)},X=(K=t)=>{const x=cs(K.props),S=K.target=fl(K.props,P),R=pl(S,K,b,$);S&&(r!=="svg"&&so(S)?r="svg":r!=="mathml"&&no(S)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(S),x||(T(K,S,R),Ts(K,!1)))},ce=K=>{const x=()=>{if(Wt.get(K)===x){if(Wt.delete(K),cs(K.props)){const S=E(K.el)||s;T(K,S,K.anchor),Ts(K,!0)}X(K)}};Wt.set(K,x),Ve(x,i)};if(e==null){const K=t.el=b(""),x=t.anchor=b("");if($(K,s,n),$(x,s,n),da(t.props)||i&&i.pendingBranch){ce(t);return}M&&(T(t,s,x),Ts(t,!0)),X()}else{t.el=e.el;const K=t.anchor=e.anchor,x=Wt.get(e);if(x){x.flags|=8,Wt.delete(e),ce(t);return}t.targetStart=e.targetStart;const S=t.target=e.target,R=t.targetAnchor=e.targetAnchor,z=cs(e.props),B=z?s:S,re=z?K:R;if(r==="svg"||so(S)?r="svg":(r==="mathml"||no(S))&&(r="mathml"),I?(k(e.dynamicChildren,I,B,o,i,r,u),Fl(e,t,!0)):a||v(e,t,B,re,o,i,r,u,!1),M)z?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):rn(t,s,K,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const be=fl(t.props,P);be&&(t.target=be,rn(t,be,null,c,0))}else z&&rn(t,S,R,c,1);Ts(t,M)}},remove(e,t,s,{um:n,o:{remove:o}},i){const{shapeFlag:r,children:u,anchor:a,targetStart:c,targetAnchor:d,target:v,props:k}=e,$=cs(k),P=i||!$,b=Wt.get(e);if(b&&(b.flags|=8,Wt.delete(e)),v&&(o(c),o(d)),i&&o(a),!b&&($||v)&&r&16)for(let A=0;A<u.length;A++){const E=u[A];n(E,t,s,P,!!E.dynamicChildren)}},move:rn,hydrate:pa};function rn(e,t,s,{o:{insert:n},m:o},i=2){i===0&&(e.targetStart&&n(e.targetStart,t,s),n(e.targetAnchor,t,s),s=e.targetAnchor);const{el:r,anchor:u,shapeFlag:a,children:c,props:d}=e,v=i===2;if(v&&n(r,t,s),!Wt.has(e)&&(!v||cs(d))&&a&16)for(let k=0;k<c.length;k++)o(c[k],t,s,2);v&&n(u,t,s)}function pa(e,t,s,n,o,i,{o:{nextSibling:r,parentNode:u,querySelector:a,insert:c,createText:d}},v){function k(A,E){let M=E;for(;M;){if(M&&M.nodeType===8){if(M.data==="teleport start anchor")t.targetStart=M;else if(M.data==="teleport anchor"){t.targetAnchor=M,A._lpa=t.targetAnchor&&r(t.targetAnchor);break}}M=r(M)}}function $(A,E){E.anchor=v(r(A),E,u(A),s,n,o,i)}const P=t.target=fl(t.props,a),b=cs(t.props);if(P){const A=P._lpa||P.firstChild;t.shapeFlag&16&&(b?($(e,t),k(P,A),t.targetAnchor||pl(P,t,d,c,u(e)===P?e:null)):(t.anchor=r(e),k(P,A),t.targetAnchor||pl(P,t,d,c),v(A&&r(A),t,P,s,n,o,i))),Ts(t,b)}else b&&t.shapeFlag&16&&($(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const ha=fa;function Ts(e,t){const s=e.ctx;if(s&&s.ut){let n,o;for(t?(n=e.el,o=e.anchor):(n=e.targetStart,o=e.targetAnchor);n&&n!==o;)n.nodeType===1&&n.setAttribute("data-v-owner",s.uid),n=n.nextSibling;s.ut()}}function pl(e,t,s,n,o=null){const i=t.targetStart=s(""),r=t.targetAnchor=s("");return i[Ci]=r,e&&(n(i,e,o),n(r,e,o)),r}const st=Symbol("_leaveCb"),Cs=Symbol("_enterCb");function ga(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ae(()=>{e.isMounted=!0}),vs(()=>{e.isUnmounting=!0}),e}const tt=[Function,Array],Si={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:tt,onEnter:tt,onAfterEnter:tt,onEnterCancelled:tt,onBeforeLeave:tt,onLeave:tt,onAfterLeave:tt,onLeaveCancelled:tt,onBeforeAppear:tt,onAppear:tt,onAfterAppear:tt,onAppearCancelled:tt},va={name:"BaseTransition",props:Si,setup(e,{slots:t}){const s=er(),n=ga();return()=>{const o=t.default&&Ei(t.default(),!0),i=o&&o.length?Mi(o):s.subTree?N():void 0;if(!i)return;const r=de(e),{mode:u}=r;if(n.isLeaving)return Qn(i);const a=mn(i);if(!a)return Qn(i);const c=hl(a,r,n,s);a.type!==je&&gs(a,c);let d=s.subTree&&mn(s.subTree);if(d&&d.type!==je&&!ds(d,a)&&Bs(s.subTree)){let v=hl(d,r,n,s);if(gs(d,v),u==="out-in"&&a.type!==je)return n.isLeaving=!0,v.afterLeave=()=>{if(n.isLeaving=!1,!(s.job.flags&8))if(s.effect.flags&2){const k=()=>{s.job.flags&8||s.update()};k.i=s,Pn(k)}else s.update();delete v.afterLeave,d=void 0},Qn(i);u==="in-out"&&a.type!==je?v.delayLeave=(k,$,P)=>{const b=Ti(n,d);b[String(d.key)]=d,k[st]=()=>{$(),k[st]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{P(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function Mi(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==je){t=s;break}}return t}const ma=va;function Ti(e,t){const{leavingVNodes:s}=e;let n=s.get(t.type);return n||(n=Object.create(null),s.set(t.type,n)),n}function hl(e,t,s,n){const{appear:o,mode:i,persisted:r=!1,onBeforeEnter:u,onEnter:a,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:v,onLeave:k,onAfterLeave:$,onLeaveCancelled:P,onBeforeAppear:b,onAppear:A,onAfterAppear:E,onAppearCancelled:M}=t,I=String(e.key),T=Ti(s,e),X=(x,S)=>{x&&it(x,n,9,S)},ce=(x,S)=>{const R=S[1];X(x,S),Z(x)?x.every(z=>z.length<=1)&&R():x.length<=1&&R()},K={mode:i,persisted:r,beforeEnter(x){let S=u;if(!s.isMounted)if(o)S=b||u;else return;x[st]&&x[st](!0);const R=T[I];if(R&&ds(e,R)){let z=R.el[st];if(!z){const B=Bs(R);z=B&&B.el[st]}z&&z()}X(S,[x])},enter(x){if(T[I]===e)return;let S=a,R=c,z=d;if(!s.isMounted)if(o)S=A||a,R=E||c,z=M||d;else return;let B=!1;x[Cs]=be=>{B||(B=!0,be?X(z,[x]):X(R,[x]),K.delayedLeave&&K.delayedLeave(),x[Cs]=void 0)};const re=x[Cs].bind(null,!1);S?ce(S,[x,re]):re()},leave(x,S){const R=String(e.key);if(x[Cs]&&x[Cs](!0),s.isUnmounting)return S();X(v,[x]);let z=!1;x[st]=re=>{z||(z=!0,S(),re?X(P,[x]):X($,[x]),x[st]=void 0,T[R]===e&&delete T[R])};const B=x[st].bind(null,!1);T[R]=e,k?ce(k,[x,B]):B()},clone(x){const S=hl(x,t,s,n);return S.afterLeave=()=>{K.afterLeave&&K.afterLeave()},S.delayLeave=(R,z,B)=>{K.delayLeave?K.delayLeave(R,z,B):B()},S.delayedLeave=()=>{K.delayedLeave&&K.delayedLeave()},S}};return K}function Qn(e){if(Ln(e))return e=es(e),e.children=null,e}function mn(e){if(!Ln(e))return Rn(e.type)&&e.children?Mi(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&le(s.default))return s.default()}}function gs(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const s=e.component.subTree;gs(Rn(s.type)&&mn(s)||s,t)}else if(e.shapeFlag&128){const s=e.suspense;if(s){const n=s.isHydrating?s.pendingBranch:s.activeBranch;n&&gs(n,t.clone(n))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===F&&Z(e.children)){const s=Fi(e.children,!1);s&&gs(s,t)}}function Ei(e,t=!1,s){let n=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const u=s==null?r.key:String(s)+String(r.key!=null?r.key:i);r.type===F?(r.patchFlag&128&&o++,n=n.concat(Ei(r.children,t,u))):(t||r.type!==je)&&n.push(u!=null?es(r,{key:u}):r)}if(o>1)for(let i=0;i<n.length;i++)n[i].patchFlag=-2;return n}function Bs(e){if(e.component)return Bs(e.component.subTree);if(e.type===F){const t=Z(e.children)&&Fi(e.children,!1);return t?Bs(t):void 0}if(e.type!==je)return e}function Ai(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function lo(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const _n=new WeakMap;function Ns(e,t,s,n,o=!1){if(Z(e)){e.forEach((b,A)=>Ns(b,t&&(Z(t)?t[A]:t),s,n,o));return}if(bs(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Ns(e,t,s,n.component.subTree);return}const i=n.shapeFlag&4?jn(n.component):n.el,r=o?null:i,{i:u,r:a}=e,c=t&&t.r,d=u.refs===ye?u.refs={}:u.refs,v=u.setupState,k=de(v),$=v===ye?zo:b=>lo(d,b)?!1:fe(k,b),P=(b,A)=>!(A&&lo(d,A));if(c!=null&&c!==a){if(oo(t),xe(c))d[c]=null,$(c)&&(v[c]=null);else if(Fe(c)){const b=t;P(c,b.k)&&(c.value=null),b.k&&(d[b.k]=null)}}if(le(a))tn(a,u,12,[r,d]);else{const b=xe(a),A=Fe(a);if(b||A){const E=()=>{if(e.f){const M=b?$(a)?v[a]:d[a]:P()||!e.k?a.value:d[e.k];if(o)Z(M)&&Ml(M,i);else if(Z(M))M.includes(i)||M.push(i);else if(b)d[a]=[i],$(a)&&(v[a]=d[a]);else{const I=[i];P(a,e.k)&&(a.value=I),e.k&&(d[e.k]=I)}}else b?(d[a]=r,$(a)&&(v[a]=r)):A&&(P(a,e.k)&&(a.value=r),e.k&&(d[e.k]=r))};if(r){const M=()=>{E(),_n.delete(e)};M.id=-1,_n.set(e,M),Ve(M,s)}else oo(e),E()}}}function oo(e){const t=_n.get(e);t&&(t.flags|=8,_n.delete(e))}An().requestIdleCallback;An().cancelIdleCallback;const bs=e=>!!e.type.__asyncLoader,Ln=e=>e.type.__isKeepAlive;function _a(e,t){Oi(e,"a",t)}function ya(e,t){Oi(e,"da",t)}function Oi(e,t,s=He){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Ks(t,n,s),s){let o=s.parent;for(;o&&o.parent;)Ln(o.parent.vnode)&&ba(n,t,s,o),o=o.parent}}function ba(e,t,s,n){const o=Ks(t,e,n,!0),i=Ks("um",()=>Ml(n[t],o),s);i.flags=16}function Ks(e,t,s=He,n=!1){if(s){const o=s[e]||(s[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Ct();const u=sn(s),a=it(t,s,e,r);return u(),St(),a});return n?o.unshift(i):o.push(i),i}}const Bt=e=>(t,s=He)=>{(!zs||e==="sp")&&Ks(e,(...n)=>t(...n),s)},ka=Bt("bm"),Ae=Bt("m"),$a=Bt("bu"),wa=Bt("u"),vs=Bt("bum"),Ii=Bt("um"),xa=Bt("sp"),Ca=Bt("rtg"),Sa=Bt("rtc");function Ma(e,t=He){Ks("ec",e,t)}const Ta="components",Pi=Symbol.for("v-ndc");function Ea(e){return xe(e)?Aa(Ta,e,!1)||e:e||Pi}function Aa(e,t,s=!0,n=!1){const o=Ne||He;if(o){const i=o.type;{const u=gu(i,!1);if(u&&(u===t||u===ze(t)||u===En(ze(t))))return i}const r=io(o[e]||i[e],t)||io(o.appContext[e],t);return!r&&n?i:r}}function io(e,t){return e&&(e[t]||e[ze(t)]||e[En(ze(t))])}function Y(e,t,s,n){let o;const i=s,r=Z(e);if(r||xe(e)){const u=r&&Yt(e);let a=!1,c=!1;u&&(a=!nt(e),c=Tt(e),e=On(e)),o=new Array(e.length);for(let d=0,v=e.length;d<v;d++)o[d]=t(a?c?Zt(ot(e[d])):ot(e[d]):e[d],d,void 0,i)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let u=0;u<e;u++)o[u]=t(u+1,u,void 0,i)}else if(he(e))if(e[Symbol.iterator])o=Array.from(e,(u,a)=>t(u,a,void 0,i));else{const u=Object.keys(e);o=new Array(u.length);for(let a=0,c=u.length;a<c;a++){const d=u[a];o[a]=t(e[d],d,a,i)}}else o=[];return o}function Oa(e,t,s,n,o,i){if(s==null&&(s={}),Ne.ce||Ne.parent&&bs(Ne.parent)&&Ne.parent.ce){const c=s.key==null?Ee({},s,{key:i}):s,d=Object.keys(c).length>0;return p(),Re(F,null,[Se("slot",c,n)],d?-2:64)}let r=e[t];r&&r._c&&(r._d=!1);const u=Ft.length;p();let a;try{const c=r&&Ri(r(s)),d=s.key||i||c&&c.key;a=Re(F,{key:(d&&!ft(d)?d:`_${t}`)+(!c&&n?"_fb":"")},c||(n?n():[]),c&&e._===1?64:-2)}catch(c){for(let d=Ft.length;d>u;d--)Vl();throw c}finally{r&&r._c&&(r._d=!0)}return a}function Ri(e){return e.some(t=>$s(t)?!(t.type===je||t.type===F&&!Ri(t.children)):!0)?e:null}const gl=e=>e?tr(e)?jn(e):gl(e.parent):null,js=Ee(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>gl(e.parent),$root:e=>gl(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Di(e),$forceUpdate:e=>e.f||(e.f=()=>{Pn(e.update)}),$nextTick:e=>e.n||(e.n=jt.bind(e.proxy)),$watch:e=>ca.bind(e)}),Zn=(e,t)=>e!==ye&&!e.__isScriptSetup&&fe(e,t),Ia={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:i,accessCache:r,type:u,appContext:a}=e;if(t[0]!=="$"){const k=r[t];if(k!==void 0)switch(k){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return i[t]}else{if(Zn(n,t))return r[t]=1,n[t];if(o!==ye&&fe(o,t))return r[t]=2,o[t];if(fe(i,t))return r[t]=3,i[t];if(s!==ye&&fe(s,t))return r[t]=4,s[t];vl&&(r[t]=0)}}const c=js[t];let d,v;if(c)return t==="$attrs"&&Ue(e.attrs,"get",""),c(e);if((d=u.__cssModules)&&(d=d[t]))return d;if(s!==ye&&fe(s,t))return r[t]=4,s[t];if(v=a.config.globalProperties,fe(v,t))return v[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:i}=e;return Zn(o,t)?(o[t]=s,!0):n!==ye&&fe(n,t)?(n[t]=s,!0):fe(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:i,type:r}},u){let a;return!!(s[u]||e!==ye&&u[0]!=="$"&&fe(e,u)||Zn(t,u)||fe(i,u)||fe(n,u)||fe(js,u)||fe(o.config.globalProperties,u)||(a=r.__cssModules)&&a[u])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:fe(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function ro(e){return Z(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let vl=!0;function Pa(e){const t=Di(e),s=e.proxy,n=e.ctx;vl=!1,t.beforeCreate&&ao(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:u,provide:a,inject:c,created:d,beforeMount:v,mounted:k,beforeUpdate:$,updated:P,activated:b,deactivated:A,beforeDestroy:E,beforeUnmount:M,destroyed:I,unmounted:T,render:X,renderTracked:ce,renderTriggered:K,errorCaptured:x,serverPrefetch:S,expose:R,inheritAttrs:z,components:B,directives:re,filters:be}=t;if(c&&Ra(c,n,null),r)for(const ge in r){const pe=r[ge];le(pe)&&(n[ge]=pe.bind(s))}if(o){const ge=o.call(s,s);he(ge)&&(e.data=Mt(ge))}if(vl=!0,i)for(const ge in i){const pe=i[ge],at=le(pe)?pe.bind(s,s):le(pe.get)?pe.get.bind(s,s):wt,te=!le(pe)&&le(pe.set)?pe.set.bind(s):wt,Et=G({get:at,set:te});Object.defineProperty(n,ge,{enumerable:!0,configurable:!0,get:()=>Et.value,set:Je=>Et.value=Je})}if(u)for(const ge in u)Li(u[ge],n,s,ge);if(a){const ge=le(a)?a.call(s):a;Reflect.ownKeys(ge).forEach(pe=>{ra(pe,ge[pe])})}d&&ao(d,e,"c");function ke(ge,pe){Z(pe)?pe.forEach(at=>ge(at.bind(s))):pe&&ge(pe.bind(s))}if(ke(ka,v),ke(Ae,k),ke($a,$),ke(wa,P),ke(_a,b),ke(ya,A),ke(Ma,x),ke(Sa,ce),ke(Ca,K),ke(vs,M),ke(Ii,T),ke(xa,S),Z(R))if(R.length){const ge=e.exposed||(e.exposed={});R.forEach(pe=>{Object.defineProperty(ge,pe,{get:()=>s[pe],set:at=>s[pe]=at,enumerable:!0})})}else e.exposed||(e.exposed={});X&&e.render===wt&&(e.render=X),z!=null&&(e.inheritAttrs=z),B&&(e.components=B),re&&(e.directives=re),S&&Ai(e)}function Ra(e,t,s=wt){Z(e)&&(e=ml(e));for(const n in e){const o=e[n];let i;he(o)?"default"in o?i=fn(o.from||n,o.default,!0):i=fn(o.from||n):i=fn(o),Fe(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[n]=i}}function ao(e,t,s){it(Z(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function Li(e,t,s,n){let o=n.includes(".")?xi(s,n):()=>s[n];if(xe(e)){const i=t[e];le(i)&&hs(o,i)}else if(le(e))hs(o,e.bind(s));else if(he(e))if(Z(e))e.forEach(i=>Li(i,t,s,n));else{const i=le(e.handler)?e.handler.bind(s):t[e.handler];le(i)&&hs(o,i,e)}}function Di(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,u=i.get(t);let a;return u?a=u:!o.length&&!s&&!n?a=t:(a={},o.length&&o.forEach(c=>yn(a,c,r,!0)),yn(a,t,r)),he(t)&&i.set(t,a),a}function yn(e,t,s,n=!1){const{mixins:o,extends:i}=t;i&&yn(e,i,s,!0),o&&o.forEach(r=>yn(e,r,s,!0));for(const r in t)if(!(n&&r==="expose")){const u=La[r]||s&&s[r];e[r]=u?u(e[r],t[r]):t[r]}return e}const La={data:uo,props:co,emits:co,methods:Es,computed:Es,beforeCreate:Ke,created:Ke,beforeMount:Ke,mounted:Ke,beforeUpdate:Ke,updated:Ke,beforeDestroy:Ke,beforeUnmount:Ke,destroyed:Ke,unmounted:Ke,activated:Ke,deactivated:Ke,errorCaptured:Ke,serverPrefetch:Ke,components:Es,directives:Es,watch:Na,provide:uo,inject:Da};function uo(e,t){return t?e?function(){return Ee(le(e)?e.call(this,this):e,le(t)?t.call(this,this):t)}:t:e}function Da(e,t){return Es(ml(e),ml(t))}function ml(e){if(Z(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Ke(e,t){return e?[...new Set([].concat(e,t))]:t}function Es(e,t){return e?Ee(Object.create(null),e,t):t}function co(e,t){return e?Z(e)&&Z(t)?[...new Set([...e,...t])]:Ee(Object.create(null),ro(e),ro(t??{})):t}function Na(e,t){if(!e)return t;if(!t)return e;const s=Ee(Object.create(null),e);for(const n in t)s[n]=Ke(e[n],t[n]);return s}function Ni(){return{app:null,config:{isNativeTag:zo,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let ja=0;function Fa(e,t){return function(n,o=null){le(n)||(n=Ee({},n)),o!=null&&!he(o)&&(o=null);const i=Ni(),r=new WeakSet,u=[];let a=!1;const c=i.app={_uid:ja++,_component:n,_props:o,_container:null,_context:i,_instance:null,version:_u,get config(){return i.config},set config(d){},use(d,...v){return r.has(d)||(d&&le(d.install)?(r.add(d),d.install(c,...v)):le(d)&&(r.add(d),d(c,...v))),c},mixin(d){return i.mixins.includes(d)||i.mixins.push(d),c},component(d,v){return v?(i.components[d]=v,c):i.components[d]},directive(d,v){return v?(i.directives[d]=v,c):i.directives[d]},mount(d,v,k){if(!a){const $=c._ceVNode||Se(n,o);return $.appContext=i,k===!0?k="svg":k===!1&&(k=void 0),e($,d,k),a=!0,c._container=d,d.__vue_app__=c,jn($.component)}},onUnmount(d){u.push(d)},unmount(){a&&(it(u,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(d,v){return i.provides[d]=v,c},runWithContext(d){const v=ks;ks=c;try{return d()}finally{ks=v}}};return c}}let ks=null;const Va=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ze(t)}Modifiers`]||e[`${ts(t)}Modifiers`];function Ua(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||ye;let o=s;const i=t.startsWith("update:"),r=i&&Va(n,t.slice(7));r&&(r.trim&&(o=s.map(d=>xe(d)?d.trim():d)),r.number&&(o=o.map(en)));let u,a=n[u=Wn(t)]||n[u=Wn(ze(t))];!a&&i&&(a=n[u=Wn(ts(t))]),a&&it(a,e,6,o);const c=n[u+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,it(c,e,6,o)}}const Ha=new WeakMap;function ji(e,t,s=!1){const n=s?Ha:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const i=e.emits;let r={},u=!1;if(!le(e)){const a=c=>{const d=ji(c,t,!0);d&&(u=!0,Ee(r,d))};!s&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!u?(he(e)&&n.set(e,null),null):(Z(i)?i.forEach(a=>r[a]=null):Ee(r,i),he(e)&&n.set(e,r),r)}function Dn(e,t){return!e||!Sn(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),fe(e,t[0].toLowerCase()+t.slice(1))||fe(e,ts(t))||fe(e,t))}function fo(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[i],slots:r,attrs:u,emit:a,render:c,renderCache:d,props:v,data:k,setupState:$,ctx:P,inheritAttrs:b}=e,A=vn(e);let E,M;try{if(s.shapeFlag&4){const T=o||n,X=T;E=bt(c.call(X,T,d,v,$,k,P)),M=u}else{const T=t;E=bt(T.length>1?T(v,{attrs:u,slots:r,emit:a}):T(v,null)),M=t.props?u:Ba(u)}}catch(T){Ft.length=0,In(T,e,1),E=Se(je)}let I=E;if(M&&b!==!1){const T=Object.keys(M),{shapeFlag:X}=I;T.length&&X&7&&(i&&T.some(Mn)&&(M=Ka(M,i)),I=es(I,M,!1,!0))}if(s.dirs&&(I=es(I,null,!1,!0),I.dirs=I.dirs?I.dirs.concat(s.dirs):s.dirs),s.transition){const T=Rn(I.type)&&mn(I)||I;gs(T,s.transition)}return E=I,vn(A),E}function Fi(e,t=!0){let s;for(let n=0;n<e.length;n++){const o=e[n];if($s(o)){if(o.type!==je||o.children==="v-if"){if(s)return;s=o}}else return}return s}const Ba=e=>{let t;for(const s in e)(s==="class"||s==="style"||Sn(s))&&((t||(t={}))[s]=e[s]);return t},Ka=(e,t)=>{const s={};for(const n in e)(!Mn(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function qa(e,t,s){const{props:n,children:o,component:i}=e,{props:r,children:u,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&a>=0){if(a&1024)return!0;if(a&16)return n?po(n,r,c):!!r;if(a&8){const d=t.dynamicProps;for(let v=0;v<d.length;v++){const k=d[v];if(Vi(r,n,k)&&!Dn(c,k))return!0}}}else return(o||u)&&(!u||!u.$stable)?!0:n===r?!1:n?r?po(n,r,c):!0:!!r;return!1}function po(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let o=0;o<n.length;o++){const i=n[o];if(!fe(e,i)||Vi(t,e,i)&&!Dn(s,i))return!0}return!1}function Vi(e,t,s){const n=e[s],o=t[s];return s==="style"&&he(n)&&he(o)?!Ut(n,o):n!==o}function Wa({vnode:e,parent:t,suspense:s},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=n,e=o),o===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Ui={},Hi=()=>Object.create(Ui),Bi=e=>Object.getPrototypeOf(e)===Ui;function za(e,t,s,n=!1){const o={},i=Hi();e.propsDefaults=Object.create(null),Ki(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);s?e.props=n?o:Jr(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function Ja(e,t,s,n){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,u=de(o),[a]=e.propsOptions;let c=!1;if((n||r>0)&&!(r&16)){if(r&8){const d=e.vnode.dynamicProps;for(let v=0;v<d.length;v++){let k=d[v];if(Dn(e.emitsOptions,k))continue;const $=t[k];if(a)if(fe(i,k))$!==i[k]&&(i[k]=$,c=!0);else{const P=ze(k);o[P]=_l(a,u,P,$,e,!1)}else $!==i[k]&&(i[k]=$,c=!0)}}}else{Ki(e,t,o,i)&&(c=!0);let d;for(const v in u)(!t||!fe(t,v)&&((d=ts(v))===v||!fe(t,d)))&&(a?s&&(s[v]!==void 0||s[d]!==void 0)&&(o[v]=_l(a,u,v,void 0,e,!0)):delete o[v]);if(i!==u)for(const v in i)(!t||!fe(t,v))&&(delete i[v],c=!0)}c&&Dt(e.attrs,"set","")}function Ki(e,t,s,n){const[o,i]=e.propsOptions;let r=!1,u;if(t)for(let a in t){if(Rs(a))continue;const c=t[a];let d;o&&fe(o,d=ze(a))?!i||!i.includes(d)?s[d]=c:(u||(u={}))[d]=c:Dn(e.emitsOptions,a)||(!(a in n)||c!==n[a])&&(n[a]=c,r=!0)}if(i){const a=de(s),c=u||ye;for(let d=0;d<i.length;d++){const v=i[d];s[v]=_l(o,a,v,c[v],e,!fe(c,v))}}return r}function _l(e,t,s,n,o,i){const r=e[s];if(r!=null){const u=fe(r,"default");if(u&&n===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&le(a)){const{propsDefaults:c}=o;if(s in c)n=c[s];else{const d=sn(o);n=c[s]=a.call(null,t),d()}}else n=a;o.ce&&o.ce._setProp(s,n)}r[0]&&(i&&!u?n=!1:r[1]&&(n===""||n===ts(s))&&(n=!0))}return n}const Ga=new WeakMap;function qi(e,t,s=!1){const n=s?Ga:t.propsCache,o=n.get(e);if(o)return o;const i=e.props,r={},u=[];let a=!1;if(!le(e)){const d=v=>{a=!0;const[k,$]=qi(v,t,!0);Ee(r,k),$&&u.push(...$)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!a)return he(e)&&n.set(e,fs),fs;if(Z(i))for(let d=0;d<i.length;d++){const v=ze(i[d]);ho(v)&&(r[v]=ye)}else if(i)for(const d in i){const v=ze(d);if(ho(v)){const k=i[d],$=r[v]=Z(k)||le(k)?{type:k}:Ee({},k),P=$.type;let b=!1,A=!0;if(Z(P))for(let E=0;E<P.length;++E){const M=P[E],I=le(M)&&M.name;if(I==="Boolean"){b=!0;break}else I==="String"&&(A=!1)}else b=le(P)&&P.name==="Boolean";$[0]=b,$[1]=A,(b||fe($,"default"))&&u.push(v)}}const c=[r,u];return he(e)&&n.set(e,c),c}function ho(e){return e[0]!=="$"&&!Rs(e)}const Nl=e=>e==="_"||e==="_ctx"||e==="$stable",jl=e=>Z(e)?e.map(bt):[bt(e)],Ya=(e,t,s)=>{if(t._n)return t;const n=pt((...o)=>jl(t(...o)),s);return n._c=!1,n},Wi=(e,t,s)=>{const n=e._ctx;for(const o in e){if(Nl(o))continue;const i=e[o];if(le(i))t[o]=Ya(o,i,n);else if(i!=null){const r=jl(i);t[o]=()=>r}}},zi=(e,t)=>{const s=jl(t);e.slots.default=()=>s},Ji=(e,t,s)=>{for(const n in t)(s||!Nl(n))&&(e[n]=t[n])},Xa=(e,t,s)=>{const n=e.slots=Hi();if(e.vnode.shapeFlag&32){const o=t._;o?(Ji(n,t,s),s&&Xo(n,"_",o,!0)):Wi(t,n)}else t&&zi(e,t)},Qa=(e,t,s)=>{const{vnode:n,slots:o}=e;let i=!0,r=ye;if(n.shapeFlag&32){const u=t._;u?s&&u===1?i=!1:Ji(o,t,s):(i=!t.$stable,Wi(t,o)),r=t}else t&&(zi(e,t),r={default:1});if(i)for(const u in o)!Nl(u)&&r[u]==null&&delete o[u]},Ve=lu;function Za(e){return eu(e)}function eu(e,t){const s=An();s.__VUE__=!0;const{insert:n,remove:o,patchProp:i,createElement:r,createText:u,createComment:a,setText:c,setElementText:d,parentNode:v,nextSibling:k,setScopeId:$=wt,insertStaticContent:P}=e,b=(_,w,C,g=null,y=null,O=null,V=void 0,U=null,H=!!w.dynamicChildren)=>{if(_===w)return;_&&!ds(_,w)&&(g=At(_),Je(_,y,O,!0),_=null),w.patchFlag===-2&&(H=!1,w.dynamicChildren=null),w.dynamicChildren&&_&&_.dynamicChildren&&_.dynamicChildren.hasOnce&&(w.dynamicChildren===fs&&(w.dynamicChildren=[]),w.dynamicChildren.hasOnce=!0);const{type:L,ref:Q,shapeFlag:q}=w;switch(L){case Nn:A(_,w,C,g);break;case je:E(_,w,C,g);break;case tl:_==null&&M(w,C,g,V);break;case F:B(_,w,C,g,y,O,V,U,H);break;default:q&1?X(_,w,C,g,y,O,V,U,H):q&6?re(_,w,C,g,y,O,V,U,H):(q&64||q&128)&&L.process(_,w,C,g,y,O,V,U,H,ns)}Q!=null&&y?Ns(Q,_&&_.ref,O,w||_,!w):Q==null&&_&&_.ref!=null&&Ns(_.ref,null,O,_,!0)},A=(_,w,C,g)=>{if(_==null)n(w.el=u(w.children),C,g);else{const y=w.el=_.el;w.children!==_.children&&c(y,w.children)}},E=(_,w,C,g)=>{_==null?n(w.el=a(w.children||""),C,g):w.el=_.el},M=(_,w,C,g)=>{[_.el,_.anchor]=P(_.children,w,C,g,_.el,_.anchor)},I=({el:_,anchor:w},C,g)=>{let y;for(;_&&_!==w;)y=k(_),n(_,C,g),_=y;n(w,C,g)},T=({el:_,anchor:w})=>{let C;for(;_&&_!==w;)C=k(_),o(_),_=C;o(w)},X=(_,w,C,g,y,O,V,U,H)=>{if(w.type==="svg"?V="svg":w.type==="math"&&(V="mathml"),_==null)ce(w,C,g,y,O,V,U,H);else{const L=_.el&&_.el._isVueCE?_.el:null;try{L&&L._beginPatch(),S(_,w,y,O,V,U,H)}finally{L&&L._endPatch()}}},ce=(_,w,C,g,y,O,V,U)=>{let H,L;const{props:Q,shapeFlag:q,transition:ee,dirs:ne}=_;if(H=_.el=r(_.type,O,Q&&Q.is,Q),q&8?d(H,_.children):q&16&&x(_.children,H,null,g,y,el(_,O),V,U),ne&&ls(_,null,g,"created"),K(H,_,_.scopeId,V,g),Q){for(const _e in Q)_e!=="value"&&!Rs(_e)&&i(H,_e,null,Q[_e],O,g);"value"in Q&&i(H,"value",null,Q.value,O),(L=Q.onVnodeBeforeMount)&&mt(L,g,_)}ne&&ls(_,null,g,"beforeMount");const ue=tu(y,ee);ue?ee.beforeEnter(H):ee&&!ee.persisted&&(H[nu]=!0),n(H,w,C),((L=Q&&Q.onVnodeMounted)||ue||ne)&&Ve(()=>{try{L&&mt(L,g,_),ue&&ee.enter(H),ne&&ls(_,null,g,"mounted")}finally{}},y)},K=(_,w,C,g,y)=>{if(C&&$(_,C),g)for(let O=0;O<g.length;O++)$(_,g[O]);if(y){let O=y.subTree;if(w===O||Yi(O.type)&&(O.ssContent===w||O.ssFallback===w)){const V=y.vnode;K(_,V,V.scopeId,V.slotScopeIds,y.parent)}}},x=(_,w,C,g,y,O,V,U,H=0)=>{for(let L=H;L<_.length;L++){const Q=_[L]=U?Lt(_[L]):bt(_[L]);b(null,Q,w,C,g,y,O,V,U)}},S=(_,w,C,g,y,O,V)=>{const U=w.el=_.el;let{patchFlag:H,dynamicChildren:L,dirs:Q}=w;H|=_.patchFlag&16;const q=_.props||ye,ee=w.props||ye;let ne;if(C&&os(C,!1),(ne=ee.onVnodeBeforeUpdate)&&mt(ne,C,w,_),Q&&ls(w,_,C,"beforeUpdate"),C&&os(C,!0),L&&(!_.dynamicChildren||_.dynamicChildren.length!==L.length)&&(H=0,V=!1,L=null),(q.innerHTML&&ee.innerHTML==null||q.textContent&&ee.textContent==null)&&d(U,""),L?R(_.dynamicChildren,L,U,C,g,el(w,y),O):V||pe(_,w,U,null,C,g,el(w,y),O,!1),H>0){if(H&16)z(U,q,ee,C,y);else if(H&2&&q.class!==ee.class&&i(U,"class",null,ee.class,y),H&4&&i(U,"style",q.style,ee.style,y),H&8){const ue=w.dynamicProps;for(let _e=0;_e<ue.length;_e++){const ve=ue[_e],Pe=q[ve],Le=ee[ve];(Le!==Pe||ve==="value")&&i(U,ve,Pe,Le,y,C)}}H&1&&_.children!==w.children&&d(U,w.children)}else!V&&L==null&&z(U,q,ee,C,y);((ne=ee.onVnodeUpdated)||Q)&&Ve(()=>{ne&&mt(ne,C,w,_),Q&&ls(w,_,C,"updated")},g)},R=(_,w,C,g,y,O,V)=>{for(let U=0;U<w.length;U++){const H=_[U],L=w[U],Q=H.el||Fs(H),q=Q&&(H.type===F||!ds(H,L)||H.shapeFlag&198)?v(Q):C;b(H,L,q,null,g,y,O,V,!0)}},z=(_,w,C,g,y)=>{if(w!==C){if(w!==ye)for(const O in w)!Rs(O)&&!(O in C)&&i(_,O,w[O],null,y,g);for(const O in C){if(Rs(O))continue;const V=C[O],U=w[O];V!==U&&O!=="value"&&i(_,O,U,V,y,g)}"value"in C&&i(_,"value",w.value,C.value,y)}},B=(_,w,C,g,y,O,V,U,H)=>{const L=w.el=_?_.el:u(""),Q=w.anchor=_?_.anchor:u("");let{patchFlag:q,dynamicChildren:ee,slotScopeIds:ne}=w;ne&&(U=U?U.concat(ne):ne),_==null?(n(L,C,g),n(Q,C,g),x(w.children||[],C,Q,y,O,V,U,H)):q>0&&q&64&&ee&&_.dynamicChildren&&_.dynamicChildren.length===ee.length?(R(_.dynamicChildren,ee,C,y,O,V,U),(w.key!=null||y&&w===y.subTree)&&Fl(_,w,!0)):pe(_,w,C,Q,y,O,V,U,H)},re=(_,w,C,g,y,O,V,U,H)=>{w.slotScopeIds=U,_==null?w.shapeFlag&512?y.ctx.activate(w,C,g,V,H):be(w,C,g,y,O,V,H):Te(_,w,H)},be=(_,w,C,g,y,O,V)=>{const U=_.component=cu(_,g,y);if(Ln(_)&&(U.ctx.renderer=ns),du(U,!1,V),U.asyncDep){if(y&&y.registerDep(U,ke,V,O),!_.el){const H=U.subTree=Se(je);E(null,H,w,C),_.placeholder=H.el}}else ke(U,_,w,C,y,O,V)},Te=(_,w,C)=>{const g=w.component=_.component;if(qa(_,w,C))if(g.asyncDep&&!g.asyncResolved){w.el=_.el,w.placeholder=_.placeholder,ge(g,w,C);return}else g.next=w,g.update();else w.el=_.el,w.placeholder=_.placeholder,g.vnode=w},ke=(_,w,C,g,y,O,V)=>{const U=()=>{if(_.isMounted){let{next:q,bu:ee,u:ne,parent:ue,vnode:_e}=_;{const gt=Gi(_);if(gt){q&&(q.el=_e.el,ge(_,q,V)),gt.asyncDep.then(()=>{const Ot=()=>{_.job.flags&8||(y&&y.pendingBranch?Ve(Ot,y):L())};Ot.flags=48,Ve(Ot,y)});return}}let ve=q,Pe;os(_,!1),q?(q.el=_e.el,ge(_,q,V)):q=_e,ee&&dn(ee),(Pe=q.props&&q.props.onVnodeBeforeUpdate)&&mt(Pe,ue,q,_e),os(_,!0);const Le=fo(_),ut=_.subTree;_.subTree=Le,b(ut,Le,v(ut.el||Fs(ut)),At(ut),_,y,O),q.el=Le.el,ve===null&&Wa(_,Le.el),ne&&Ve(ne,y),(Pe=q.props&&q.props.onVnodeUpdated)&&Ve(()=>mt(Pe,ue,q,_e),y)}else{let q;const{el:ee,props:ne}=w,{bm:ue,m:_e,parent:ve,root:Pe,type:Le}=_,ut=bs(w);os(_,!1),ue&&dn(ue),!ut&&(q=ne&&ne.onVnodeBeforeMount)&&mt(q,ve,w),os(_,!0);{Pe.ce&&Pe.ce._hasShadowRoot()&&Pe.ce._injectChildStyle(Le,_.parent?_.parent.type:void 0);const gt=_.subTree=fo(_);b(null,gt,C,g,_,y,O),w.el=gt.el}if(_e&&Ve(_e,y),!ut&&(q=ne&&ne.onVnodeMounted)){const gt=w;Ve(()=>mt(q,ve,gt),y)}(w.shapeFlag&256||ve&&bs(ve.vnode)&&ve.vnode.shapeFlag&256)&&_.a&&Ve(_.a,y),_.isMounted=!0,w=C=g=null}};_.scope.on();const H=_.effect=new ti(U);_.scope.off();const L=_.update=H.run.bind(H),Q=_.job=H.runIfDirty.bind(H);Q.i=_,Q.id=_.uid,H.scheduler=()=>Pn(Q),os(_,!0),L()},ge=(_,w,C)=>{w.component=_;const g=_.vnode.props;_.vnode=w,_.next=null,Ja(_,w.props,g,C),Qa(_,w.children,C),Ct(),yi(_),St()},pe=(_,w,C,g,y,O,V,U,H=!1)=>{const L=_&&_.children,Q=_?_.shapeFlag:0,q=w.children,{patchFlag:ee,shapeFlag:ne}=w;if(ee>0){if(ee&128){te(L,q,C,g,y,O,V,U,H);return}else if(ee&256){at(L,q,C,g,y,O,V,U,H);return}}ne&8?(Q&16&&Ge(L,y,O),q!==L&&d(C,q)):Q&16?ne&16?te(L,q,C,g,y,O,V,U,H):Ge(L,y,O,!0):(Q&8&&d(C,""),ne&16&&x(q,C,g,y,O,V,U,H))},at=(_,w,C,g,y,O,V,U,H)=>{_=_||fs,w=w||fs;const L=_.length,Q=w.length,q=Math.min(L,Q);let ee;for(ee=0;ee<q;ee++){const ne=w[ee]=H?Lt(w[ee]):bt(w[ee]);b(_[ee],ne,C,null,y,O,V,U,H)}L>Q?Ge(_,y,O,!0,!1,q):x(w,C,g,y,O,V,U,H,q)},te=(_,w,C,g,y,O,V,U,H)=>{let L=0;const Q=w.length;let q=_.length-1,ee=Q-1;for(;L<=q&&L<=ee;){const ne=_[L],ue=w[L]=H?Lt(w[L]):bt(w[L]);if(ds(ne,ue))b(ne,ue,C,null,y,O,V,U,H);else break;L++}for(;L<=q&&L<=ee;){const ne=_[q],ue=w[ee]=H?Lt(w[ee]):bt(w[ee]);if(ds(ne,ue))b(ne,ue,C,null,y,O,V,U,H);else break;q--,ee--}if(L>q){if(L<=ee){const ne=ee+1,ue=ne<Q?w[ne].el:g;for(;L<=ee;)b(null,w[L]=H?Lt(w[L]):bt(w[L]),C,ue,y,O,V,U,H),L++}}else if(L>ee)for(;L<=q;)Je(_[L],y,O,!0),L++;else{const ne=L,ue=L,_e=new Map;for(L=ue;L<=ee;L++){const Qe=w[L]=H?Lt(w[L]):bt(w[L]);Qe.key!=null&&_e.set(Qe.key,L)}let ve,Pe=0;const Le=ee-ue+1;let ut=!1,gt=0;const Ot=new Array(Le);for(L=0;L<Le;L++)Ot[L]=0;for(L=ne;L<=q;L++){const Qe=_[L];if(Pe>=Le){Je(Qe,y,O,!0);continue}let vt;if(Qe.key!=null)vt=_e.get(Qe.key);else for(ve=ue;ve<=ee;ve++)if(Ot[ve-ue]===0&&ds(Qe,w[ve])){vt=ve;break}vt===void 0?Je(Qe,y,O,!0):(Ot[vt-ue]=L+1,vt>=gt?gt=vt:ut=!0,b(Qe,w[vt],C,null,y,O,V,U,H),Pe++)}const Wl=ut?su(Ot):fs;for(ve=Wl.length-1,L=Le-1;L>=0;L--){const Qe=ue+L,vt=w[Qe],zl=w[Qe+1],Jl=Qe+1<Q?zl.el||Fs(zl):g;Ot[L]===0?b(null,vt,C,Jl,y,O,V,U,H):ut&&(ve<0||L!==Wl[ve]?Et(vt,C,Jl,2):ve--)}}},Et=(_,w,C,g,y=null)=>{const{el:O,type:V,transition:U,children:H,shapeFlag:L}=_;if(L&6){Et(_.component.subTree,w,C,g);return}if(L&128){_.suspense.move(w,C,g);return}if(L&64){V.move(_,w,C,ns);return}if(V===F){n(O,w,C);for(let q=0;q<H.length;q++)Et(H[q],w,C,g);n(_.anchor,w,C);return}if(V===tl){I(_,w,C);return}if(g!==2&&L&1&&U)if(g===0)U.persisted&&!O[st]?n(O,w,C):(U.beforeEnter(O),n(O,w,C),Ve(()=>U.enter(O),y));else{const{leave:q,delayLeave:ee,afterLeave:ne}=U,ue=()=>{_.ctx.isUnmounted?o(O):n(O,w,C)},_e=()=>{const ve=O._isLeaving||!!O[st];O._isLeaving&&O[st](!0),U.persisted&&!ve?ue():q(O,()=>{ue(),ne&&ne()})};ee?ee(O,ue,_e):_e()}else n(O,w,C)},Je=(_,w,C,g=!1,y=!1)=>{const{type:O,props:V,ref:U,children:H,dynamicChildren:L,shapeFlag:Q,patchFlag:q,dirs:ee,cacheIndex:ne,memo:ue}=_;if((q===-2||L&&L.hasOnce)&&(y=!1),U!=null&&(Ct(),Ns(U,null,C,_,!0),St()),ne!=null&&(!_.ctx||_.ctx===w)&&(w.renderCache[ne]=void 0),Q&256&&w.ctx.deactivate(_))return;const _e=Q&1&&ee,ve=!bs(_);let Pe;if(ve&&(Pe=V&&V.onVnodeBeforeUnmount)&&mt(Pe,w,_),Q&6)ht(_.component,C,g);else{if(Q&128){_.suspense.unmount(C,g);return}_e&&ls(_,null,w,"beforeUnmount"),Q&64?_.type.remove(_,w,C,ns,g):L&&!L.hasOnce&&(O!==F||q>0&&q&64)?Ge(L,w,C,!1,!0):(O===F&&q&384||!y&&Q&16)&&Ge(H,w,C),g&&ss(_)}const Le=ue!=null&&ne==null;(ve&&(Pe=V&&V.onVnodeUnmounted)||_e||Le)&&Ve(()=>{Pe&&mt(Pe,w,_),_e&&ls(_,null,w,"unmounted"),Le&&(_.el=null)},C)},ss=_=>{const{type:w,el:C,anchor:g,transition:y}=_,O=w===F;if(O&&!y){Xe(C,g);return}if(w===tl){T(_),y&&!y.persisted&&y.afterLeave&&y.afterLeave();return}const V=O?Bs(_):_,U=()=>{O?v(C)&&Xe(C,g):o(C),y&&!y.persisted&&y.afterLeave&&y.afterLeave()};if(V&&V.shapeFlag&1&&y&&!y.persisted){const{leave:H,delayLeave:L}=y,Q=V.el,q=()=>H(Q,U);L?L(Q,U,q):q()}else U()},Xe=(_,w)=>{let C;for(;_!==w;)C=k(_),o(_),_=C;o(w)},ht=(_,w,C)=>{const{bum:g,scope:y,job:O,subTree:V,um:U,m:H,a:L}=_;go(H),go(L),g&&dn(g),y.stop(),O?(O.flags|=8,Je(V,_,w,C)):V&&(V.transition=_.vnode.transition,Je(V,_,w,C)),U&&Ve(U,w);const Q=()=>{_.isUnmounted=!0};Q.flags=16,Ve(Q,w)},Ge=(_,w,C,g=!1,y=!1,O=0)=>{for(let V=O;V<_.length;V++)Je(_[V],w,C,g,y)},At=_=>{if(_.shapeFlag&6)return At(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();const w=k(_.anchor||_.el),C=w&&w[Ci];return C?k(C):w},Ie=(_,w,C)=>{const g=_&&w._vnode?void 0:_&&_.component?_.component.uid:uu();ia(()=>{_==null?w._vnode&&Je(w._vnode,null,null,!0):b(w._vnode||null,_,w,null,null,null,C),w._vnode=_},g)},ns={p:b,um:Je,m:Et,r:ss,mt:be,mc:x,pc:pe,pbc:R,n:At,o:e};return{render:Ie,hydrate:void 0,createApp:Fa(Ie)}}function el({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function os({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function tu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Fl(e,t,s=!1){const n=e.children,o=t.children;if(Z(n)&&Z(o))for(let i=0;i<n.length;i++){const r=n[i];let u=o[i];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=o[i]=Lt(o[i]),u.el=r.el),!s&&u.patchFlag!==-2&&Fl(r,u)),u.type===Nn&&(u.patchFlag===-1&&(u=o[i]=Lt(u)),u.el=r.el),u.type===je&&!u.el&&(u.el=r.el)}}function su(e){const t=e.slice(),s=[0];let n,o,i,r,u;const a=e.length;for(n=0;n<a;n++){const c=e[n];if(c!==0){if(o=s[s.length-1],e[o]<c){t[n]=o,s.push(n);continue}for(i=0,r=s.length-1;i<r;)u=i+r>>1,e[s[u]]<c?i=u+1:r=u;c<e[s[i]]&&(i>0&&(t[n]=s[i-1]),s[i]=n)}}for(i=s.length,r=s[i-1];i-- >0;)s[i]=r,r=t[r];return s}function Gi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Gi(t)}function go(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Fs(e){if(e.placeholder)return e.placeholder;const t=e.component;if(t)return Fs(t.subTree);const s=e.suspense;return s&&s.activeBranch?Fs(s.activeBranch):null}const Yi=e=>e.__isSuspense,nu=Symbol("_deferredEnter");function lu(e,t){t&&t.pendingBranch?Z(e)?t.effects.push(...e):t.effects.push(e):oa(e)}const F=Symbol.for("v-fgt"),Nn=Symbol.for("v-txt"),je=Symbol.for("v-cmt"),tl=Symbol.for("v-stc"),Ft=[];let Ze=null;function p(e=!1){Ft.push(Ze=e?null:[])}function Vl(){Ft.pop(),Ze=Ft[Ft.length-1]||null}let qs=1;function bn(e,t=!1){qs+=e,e<0&&Ze&&t&&(Ze.hasOnce=!0)}function Xi(e){return e.dynamicChildren=qs>0?Ze||fs:null,Vl(),qs>0&&Ze&&Ze.push(e),e}function h(e,t,s,n,o,i){return Xi(l(e,t,s,n,o,i,!0))}function Re(e,t,s,n,o){return Xi(Se(e,t,s,n,o,!0))}function $s(e){return e?e.__v_isVNode===!0:!1}function ds(e,t){return e.type===t.type&&e.key===t.key}const Qi=({key:e})=>e??null,pn=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?xe(e)||Fe(e)||le(e)?{i:Ne,r:e,k:t,f:!!s}:e:null);function l(e,t=null,s=null,n=0,o=null,i=e===F?0:1,r=!1,u=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Qi(t),ref:t&&pn(t),scopeId:$i,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ne};return u?(kn(a,s),i&128&&e.normalize(a)):s&&(a.shapeFlag|=xe(s)?8:16),qs>0&&!r&&Ze&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&Ze.push(a),a}const Se=ou;function ou(e,t=null,s=null,n=0,o=null,i=!1){if((!e||e===Pi)&&(e=je),$s(e)){const u=es(e,t,!0);return s&&kn(u,s),qs>0&&!i&&Ze&&(u.shapeFlag&6?Ze[Ze.indexOf(e)]=u:Ze.push(u)),u.patchFlag=-2,u}if(vu(e)&&(e=e.__vccOpts),t){t=iu(t);let{class:u,style:a}=t;u&&!xe(u)&&(t.class=se(u)),he(a)&&(Dl(a)&&!Z(a)&&(a=Ee({},a)),t.style=xt(a))}const r=xe(e)?1:Yi(e)?128:Rn(e)?64:he(e)?4:le(e)?2:0;return l(e,t,s,n,o,r,i,!0)}function iu(e){return e?Dl(e)?Ee({},e):Bi(e)?Ee({},e[nr]||e):e:null}function es(e,t,s=!1,n=!1){const{props:o,ref:i,patchFlag:r,children:u,transition:a}=e,c=t?ru(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Qi(c),ref:t&&t.ref?s&&i?Z(i)?i.concat(pn(t)):[i,pn(t)]:pn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==F?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&es(e.ssContent),ssFallback:e.ssFallback&&es(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return a&&n&&gs(d,a.clone(d)),d}function D(e=" ",t=0){return Se(Nn,null,e,t)}function N(e="",t=!1){return t?(p(),Re(je,null,e)):Se(je,null,e)}function bt(e){return e==null||typeof e=="boolean"?Se(je):Z(e)?Se(F,null,e.slice()):$s(e)?Lt(e):Se(Nn,null,String(e))}function Lt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:es(e)}function kn(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Z(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),kn(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!Bi(t)?t._ctx=Ne:o===3&&Ne&&(Ne.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(le(t)){if(n&65){kn(e,{default:t});return}t={default:t,_ctx:Ne},s=32}else t=String(t),n&64?(s=16,t=[D(t)]):s=8;e.children=t,e.shapeFlag|=s}function ru(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=se([t.class,n.class]));else if(o==="style")t.style=xt([t.style,n.style]);else if(Sn(o)){const i=t[o],r=n[o];r&&i!==r&&!(Z(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!Mn(o)&&(t[o]=r)}else o!==""&&(t[o]=n[o])}return t}function mt(e,t,s,n=null){it(e,t,7,[s,n])}const au=Ni();let Zi=0;function uu(){return Zi}function cu(e,t,s){const n=e.type,o=(t?t.appContext:e.appContext)||au,i={uid:Zi++,vnode:e,type:n,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ar(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:qi(n,o),emitsOptions:ji(n,o),emit:null,emitted:null,propsDefaults:ye,inheritAttrs:n.inheritAttrs,ctx:ye,data:ye,props:ye,attrs:ye,slots:ye,refs:ye,setupState:ye,setupContext:null,suspense:s,suspenseId:s?s.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=Ua.bind(null,i),e.ce&&e.ce(i),i}let He=null;const er=()=>He||Ne;let $n,Ws;{const e=An(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};$n=t("__VUE_INSTANCE_SETTERS__",s=>He=s),Ws=t("__VUE_SSR_SETTERS__",s=>zs=s)}const sn=e=>{const t=He;return $n(e),e.scope.on(),()=>{e.scope.off(),$n(t)}},vo=()=>{He&&He.scope.off(),$n(null)};function tr(e){return e.vnode.shapeFlag&4}let zs=!1;function du(e,t=!1,s=!1){t&&Ws(t);const{props:n,children:o}=e.vnode,i=tr(e);za(e,n,i,t),Xa(e,o,s||t);const r=i?fu(e,t):void 0;return t&&Ws(!1),r}function fu(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ia);const{setup:n}=s;if(n){Ct();const o=e.setupContext=n.length>1?hu(e):null,i=sn(e),r=tn(n,e,0,[e.props,o]),u=Jo(r);if(St(),i(),(u||e.sp)&&!bs(e)&&Ai(e),u){if(r.then(vo,vo),t)return r.then(a=>{Ws(!0);try{mo(e,a,t)}finally{Ws(!1)}}).catch(a=>{In(a,e,0,void 0,!0),e.ssrRender=(c,d)=>d("<!---->")});e.asyncDep=r}else mo(e,r)}else sr(e)}function mo(e,t,s){le(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:he(t)&&(e.setupState=vi(t)),sr(e)}function sr(e,t,s){const n=e.type;e.render||(e.render=n.render||wt);{const o=sn(e);Ct();try{Pa(e)}finally{St(),o()}}}const nr=Symbol(),pu={get(e,t){return Ue(e,"get",""),t===nr?e:e[t]}};function hu(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pu),slots:e.slots,emit:e.emit,expose:t}}function jn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(vi(Gr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in js)return js[s](e)},has(t,s){return s in t||s in js}})):e.proxy}function gu(e,t=!0){return le(e)?e.displayName||e.name:e.name||t&&e.__name}function vu(e){return le(e)&&"__vccOpts"in e}const G=(e,t)=>ea(e,t,zs);function mu(e,t,s){try{bn(-1);const n=arguments.length;return n===2?he(t)&&!Z(t)?$s(t)?Se(e,null,[t]):Se(e,t):Se(e,null,t):(n>3?s=Array.prototype.slice.call(arguments,2):n===3&&$s(s)&&(s=[s]),Se(e,t,s))}finally{bn(1)}}const _u="3.5.45";/**
|
|
14
|
+
* @vue/runtime-dom v3.5.45
|
|
15
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
+
* @license MIT
|
|
17
|
+
**/let yl;const _o=typeof window<"u"&&window.trustedTypes;if(_o)try{yl=_o.createPolicy("vue",{createHTML:e=>e})}catch{}const lr=yl?e=>yl.createHTML(e):e=>e,yu="http://www.w3.org/2000/svg",bu="http://www.w3.org/1998/Math/MathML",Rt=typeof document<"u"?document:null,yo=Rt&&Rt.createElement("template"),ku={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?Rt.createElementNS(yu,e):t==="mathml"?Rt.createElementNS(bu,e):s?Rt.createElement(e,{is:s}):Rt.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>Rt.createTextNode(e),createComment:e=>Rt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Rt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,i){const r=s?s.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===i||!(o=o.nextSibling)););else{yo.innerHTML=lr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const u=yo.content;if(n==="svg"||n==="mathml"){const a=u.firstChild;for(;a.firstChild;)u.appendChild(a.firstChild);u.removeChild(a)}t.insertBefore(u,s)}return[r?r.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},qt="transition",Ss="animation",Js=Symbol("_vtc"),or={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},$u=Ee({},Si,or),wu=e=>(e.displayName="Transition",e.props=$u,e),xu=wu((e,{slots:t})=>mu(ma,Cu(e),t)),is=(e,t=[])=>{Z(e)?e.forEach(s=>s(...t)):e&&e(...t)},bo=e=>e?Z(e)?e.some(t=>t.length>1):e.length>1:!1;function Cu(e){const t={};for(const B in e)B in or||(t[B]=e[B]);if(e.css===!1)return t;const{name:s="v",type:n,duration:o,enterFromClass:i=`${s}-enter-from`,enterActiveClass:r=`${s}-enter-active`,enterToClass:u=`${s}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:d=u,leaveFromClass:v=`${s}-leave-from`,leaveActiveClass:k=`${s}-leave-active`,leaveToClass:$=`${s}-leave-to`}=e,P=Su(o),b=P&&P[0],A=P&&P[1],{onBeforeEnter:E,onEnter:M,onEnterCancelled:I,onLeave:T,onLeaveCancelled:X,onBeforeAppear:ce=E,onAppear:K=M,onAppearCancelled:x=I}=t,S=(B,re,be,Te)=>{B._enterCancelled=Te,rs(B,re?d:u),rs(B,re?c:r),be&&be()},R=(B,re)=>{B._isLeaving=!1,rs(B,v),rs(B,$),rs(B,k),re&&re()},z=B=>(re,be)=>{const Te=B?K:M,ke=()=>S(re,B,be);is(Te,[re,ke]),ko(()=>{rs(re,B?a:i),Pt(re,B?d:u),bo(Te)||$o(re,n,b,ke)})};return Ee(t,{onBeforeEnter(B){is(E,[B]),Pt(B,i),Pt(B,r)},onBeforeAppear(B){is(ce,[B]),Pt(B,a),Pt(B,c)},onEnter:z(!1),onAppear:z(!0),onLeave(B,re){B._isLeaving=!0;const be=()=>R(B,re);Pt(B,v),B._enterCancelled?(Pt(B,k),Co(B)):(Co(B),Pt(B,k)),ko(()=>{B._isLeaving&&(rs(B,v),Pt(B,$),bo(T)||$o(B,n,A,be))}),is(T,[B,be])},onEnterCancelled(B){S(B,!1,void 0,!0),is(I,[B])},onAppearCancelled(B){S(B,!0,void 0,!0),is(x,[B])},onLeaveCancelled(B){R(B),is(X,[B])}})}function Su(e){if(e==null)return null;if(he(e))return[sl(e.enter),sl(e.leave)];{const t=sl(e);return[t,t]}}function sl(e){return kr(e)}function Pt(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.add(s)),(e[Js]||(e[Js]=new Set)).add(t)}function rs(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const s=e[Js];s&&(s.delete(t),s.size||(e[Js]=void 0))}function ko(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Mu=0;function $o(e,t,s,n){const o=e._endId=++Mu,i=()=>{o===e._endId&&n()};if(s!=null)return setTimeout(i,s);const{type:r,timeout:u,propCount:a}=Tu(e,t);if(!r)return n();const c=r+"end";let d=0;const v=()=>{e.removeEventListener(c,k),i()},k=$=>{$.target===e&&++d>=a&&v()};setTimeout(()=>{d<a&&v()},u+1),e.addEventListener(c,k)}function Tu(e,t){const s=window.getComputedStyle(e),n=P=>(s[P]||"").split(", "),o=n(`${qt}Delay`),i=n(`${qt}Duration`),r=wo(o,i),u=n(`${Ss}Delay`),a=n(`${Ss}Duration`),c=wo(u,a);let d=null,v=0,k=0;t===qt?r>0&&(d=qt,v=r,k=i.length):t===Ss?c>0&&(d=Ss,v=c,k=a.length):(v=Math.max(r,c),d=v>0?r>c?qt:Ss:null,k=d?d===qt?i.length:a.length:0);const $=d===qt&&/\b(?:transform|all)(?:,|$)/.test(n(`${qt}Property`).toString());return{type:d,timeout:v,propCount:k,hasTransform:$}}function wo(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((s,n)=>xo(s)+xo(e[n])))}function xo(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Co(e){return(e?e.ownerDocument:document).body.offsetHeight}function Eu(e,t,s){const n=e[Js];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const So=Symbol("_vod"),Au=Symbol("_vsh"),Ou=Symbol(""),Iu=/(?:^|;)\s*display\s*:/;function Pu(e,t,s){const n=e.style,o=xe(s);let i=!1;if(s&&!o){if(t)if(xe(t))for(const r of t.split(";")){const u=r.slice(0,r.indexOf(":")).trim();s[u]==null&&As(n,u,"")}else for(const r in t)s[r]==null&&As(n,r,"");for(const r in s){r==="display"&&(i=!0);const u=s[r];u!=null?Lu(e,r,!xe(t)&&t?t[r]:void 0,u)||As(n,r,u):As(n,r,"")}}else if(o){if(t!==s){const r=n[Ou];r&&(s+=";"+r),n.cssText=s,i=Iu.test(s)}}else t&&e.removeAttribute("style");So in e&&((!o||t!==s)&&(e[So]=i?n.display:""),e[Au]&&(n.display="none"))}const an=/\s*!important$/;function As(e,t,s){if(Z(s))s.forEach(n=>As(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))an.test(s)?e.setProperty(t,s.replace(an,""),"important"):e.setProperty(t,s);else{const n=Ru(e,t);an.test(s)?e.setProperty(ts(n),s.replace(an,""),"important"):e[n]=s}}const Mo=["Webkit","Moz","ms"],nl={};function Ru(e,t){const s=nl[t];if(s)return s;let n=ze(t);if(n!=="filter"&&n in e)return nl[t]=n;n=En(n);for(let o=0;o<Mo.length;o++){const i=Mo[o]+n;if(i in e)return nl[t]=i}return t}function Lu(e,t,s,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&xe(n)&&s===n}const To="http://www.w3.org/1999/xlink";function Eo(e,t,s,n,o,i=Mr(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(To,t.slice(6,t.length)):e.setAttributeNS(To,t,s):s==null||i&&!Qo(s)?e.removeAttribute(t):e.setAttribute(t,i?"":ft(s)?String(s):s)}function Ao(e,t,s,n,o){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?lr(s):s);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const u=i==="OPTION"?e.getAttribute("value")||"":e.value,a=s==null?e.type==="checkbox"?"on":"":String(s);(u!==a||!("_value"in e))&&(e.value=a),s==null&&e.removeAttribute(t),e._value=s;return}let r=!1;if(s===""||s==null){const u=typeof e[t];u==="boolean"?s=Qo(s):s==null&&u==="string"?(s="",r=!0):u==="number"&&(s=0,r=!0)}try{e[t]=s}catch{}r&&e.removeAttribute(o||t)}function Jt(e,t,s,n){e.addEventListener(t,s,n)}function Du(e,t,s,n){e.removeEventListener(t,s,n)}const Oo=Symbol("_vei");function Nu(e,t,s,n,o=null){const i=e[Oo]||(e[Oo]={}),r=i[t];if(n&&r)r.value=n;else{const[u,a]=Vu(t);if(n){const c=i[t]=Bu(n,o);Jt(e,u,c,a)}else r&&(Du(e,u,r,a),i[t]=void 0)}}const ju=/(Once|Passive|Capture)$/,Fu=/^on:?(?:Once|Passive|Capture)$/;function Vu(e){let t,s;for(;(s=e.match(ju))&&!Fu.test(e);)t||(t={}),e=e.slice(0,e.length-s[1].length),t[s[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):ts(e.slice(2)),t]}let ll=0;const Uu=Promise.resolve(),Hu=()=>ll||(Uu.then(()=>ll=0),ll=Date.now());function Bu(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const o=s.value;if(Z(o)){const i=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{i.call(n),n._stopped=!0};const r=o.slice(),u=[n];for(let a=0;a<r.length&&!n._stopped;a++){const c=r[a];c&&it(c,t,5,u)}}else it(o,t,5,[n])};return s.value=e,s.attached=Hu(),s}const Io=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ku=(e,t,s,n,o,i)=>{const r=o==="svg";t==="class"?Eu(e,n,r):t==="style"?Pu(e,s,n):Sn(t)?Mn(t)||Nu(e,t,s,n,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):qu(e,t,n,r))?(Ao(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Eo(e,t,n,r,i,t!=="value")):e._isVueCE&&(Wu(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!xe(n)))?Ao(e,ze(t),n,i,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Eo(e,t,n,r))};function qu(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Io(t)&&le(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Io(t)&&xe(s)?!1:t in e}function Wu(e,t){const s=e._def.props;if(!s)return!1;const n=ze(t);return Array.isArray(s)?s.some(o=>ze(o)===n):Object.keys(s).some(o=>ze(o)===n)}const ws=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Z(t)?s=>dn(t,s):t};function zu(e){e.target.composing=!0}function Po(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const $t=Symbol("_assign"),un=Symbol("_initialValue");function ol(e,t,s){return t&&(e=e.trim()),s&&(e=en(e)),e}const me={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e.parentNode&&(e.type==="text"?e[un]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[un]=e.defaultValue.replace(/\r\n?/g,`
|
|
18
|
+
`))),e[$t]=ws(o);const i=n||o.props&&o.props.type==="number";Jt(e,t?"change":"input",r=>{r.target.composing||e[$t](ol(e.value,s,i))}),(s||i)&&Jt(e,"change",()=>{e.value=ol(e.value,s,i)}),t||(Jt(e,"compositionstart",zu),Jt(e,"compositionend",Po),Jt(e,"change",Po))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const o=t??"",i=e[un];delete e[un],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[$t](ol(e.value,s,n)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:i}},r){if(e[$t]=ws(r),e.composing)return;const u=(i||e.type==="number")&&!/^0\d/.test(e.value)?en(e.value):e.value,a=t??"";if(u===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===a)||(e.value=a)}},il={deep:!0,created(e,t,s){e[$t]=ws(s),Jt(e,"change",()=>{const n=e._modelValue,o=Gs(e),i=e.checked,r=e[$t];if(Z(n)){const u=El(n,o),a=u!==-1;if(i&&!a)r(n.concat(o));else if(!i&&a){const c=[...n];c.splice(u,1),r(c)}}else if(Vt(n)){const u=new Set(n);i?u.add(o):u.delete(o),r(u)}else r(ir(e,i))})},mounted:Ro,beforeUpdate(e,t,s){e[$t]=ws(s),Ro(e,t,s)}};function Ro(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(Z(t))o=El(t,n.props.value)>-1;else if(Vt(t))o=t.has(n.props.value);else{if(t===s)return;o=Ut(t,ir(e,!0))}e.checked!==o&&(e.checked=o)}const Os={deep:!0,created(e,{value:t,modifiers:{number:s}},n){e._modelValue=t,Jt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?en(Gs(a)):Gs(a)),i=e.multiple,r=i?Vt(e._modelValue)?new Set(o):o:o[0],u=e._pendingValue=[i,i?Z(r)?o.slice():o:r];try{e[$t](r)}finally{jt(()=>{e._pendingValue===u&&(e._pendingValue=void 0)})}}),e[$t]=ws(n)},mounted(e,{value:t,modifiers:{number:s}}){Lo(e,t,s)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[$t]=ws(s)},updated(e,{value:t,modifiers:{number:s}}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Ju(t,n[1],n[0]))&&Lo(e,t,s)}};function Ju(e,t,s){if(!s||Z(e))return Ut(e,t);if(Vt(e)){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}return!1}function Lo(e,t,s=!1){const n=e.multiple,o=Z(t);if(!(n&&!o&&!Vt(t))){for(let i=0,r=e.options.length;i<r;i++){const u=e.options[i],a=Gs(u);if(n)if(o){const c=typeof a;c==="string"||c==="number"?u.selected=t.some(d=>String(d)===String(a)):u.selected=El(t,a)>-1}else u.selected=t.has(a)||s&&typeof a=="string"&&t.has(en(a));else if(Ut(Gs(u),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Gs(e){return"_value"in e?e._value:e.value}function ir(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Gu=["ctrl","shift","alt","meta"],Yu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Gu.some(s=>e[`${s}Key`]&&!t.includes(s))},Ye=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((o,...i)=>{for(let r=0;r<t.length;r++){const u=Yu[t[r]];if(u&&u(o,t))return}return e(o,...i)}))},Xu={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ys=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const i=ts(o.key);if(t.some(r=>r===i||Xu[r]===i))return e(o)}))},Qu=Ee({patchProp:Ku},ku);let Do;function Zu(){return Do||(Do=Za(Qu))}const ec=((...e)=>{const t=Zu().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=sc(n);if(!o)return;const i=t._component;!le(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=s(o,!1,tc(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t});function tc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function sc(e){return xe(e)?document.querySelector(e):e}const Ul="/api";function nc(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e.reasons||e.warnings||[],s=e.error||e.message||"";return s||t.length?[s,...Array.isArray(t)?t:[t]].filter(Boolean).join(" · "):JSON.stringify(e)}return""}async function Fn(e,t){let s=`${t} -> ${e.status}`,n=null;try{const i=await e.json();i&&i.detail!==void 0&&(n=i.detail,s=nc(i.detail)||s)}catch{}const o=new Error(s);return o.status=e.status,o.detail=n,o}async function oe(e,t){const s=await fetch(Ul+e,t);if(!s.ok)throw await Fn(s,e);return s.json()}async function et(e,t){return oe(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function Xs(e){return oe(e,{method:"DELETE"})}async function lc(e,t){return oe(e,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function oc(e,t){return oe(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function ic(e,t){const s=await fetch(Ul+e,{method:"POST",body:t});if(!s.ok)throw await Fn(s,e);return s.json()}async function wn(e,t){const s=await fetch(e,t);if(!s.ok)throw await Fn(s,e);return s.json()}async function rc(e,t){const s=await fetch(e,{method:"POST",body:t});if(!s.ok)throw await Fn(s,e);return s.json()}const J=Mt({sessions:[],sessionsState:"idle",sessionId:null,module:"overview",doc:null,railOpen:!0,railMode:"progress",officeStats:{waypoints:0,conflicts:0,alerts:0,active:0,total:0}}),Hl=[{id:"overview",label:"概览",tag:"Overview",group:""},{id:"activity",label:"活动",tag:"Activity",group:"工作台"},{id:"tasks",label:"定时任务",tag:"Tasks",group:"工作台",icon:"clock"},{id:"agents",label:"代理",tag:"Agents",group:"工作台",icon:"bot",beta:!0},{id:"tools",label:"技能·连接器",tag:"Tools",group:"能力",icon:"plug"},{id:"usage",label:"使用情况",tag:"Usage",group:"能力"},{id:"knowledge",label:"学习库",tag:"Knowledge",group:"知识",icon:"book",quick:["review","memory"]},{id:"review",label:"复习",tag:"Review",group:"知识",icon:"review"},{id:"memory",label:"记忆中心",tag:"Memory",group:"知识",icon:"memory"},{id:"settings",label:"设置",tag:"Settings",group:"系统"}],Bl=["knowledge","tasks","tools","agents"],ac=()=>Bl.map(e=>Hl.find(t=>t.id===e)).filter(Boolean),uc=()=>Hl.filter(e=>!Bl.includes(e.id)),bl=e=>Hl.find(t=>t.id===e)?.label??e;async function Vn(){J.sessionsState="loading";try{const e=await oe("/sessions?limit=50");J.sessions=e.sessions||[],J.sessionsState="ok"}catch{J.sessions=[],J.sessionsState="error"}}function rr(e){J.sessionId=e.id,J.doc=null,J.railMode="progress"}async function cc(){const[e,t]=await Promise.all([oe("/orchestration/situation").catch(()=>null),oe("/processes?limit=5").catch(()=>null)]);J.officeStats={waypoints:e?.itinerary?.waypoints??0,conflicts:e?.itinerary?.conflicts??0,alerts:(e?.alerts||[]).length,active:t?.stats?.active??0,total:t?.stats?.total??0}}function Ht(e){J.module=e,J.doc=null}function Un(e){J.doc=e,J.railMode="context",J.railOpen=!0}function kl(){J.doc=null,J.railMode="progress"}const Oe=(e,t)=>{const s=e.__vccOpts||e;for(const[n,o]of t)s[n]=o;return s},dc={class:"topbar"},fc={class:"stat"},pc={__name:"TopBar",setup(e){const t=W("···"),s=W("dim");Ae(async()=>{try{await oe("/status"),t.value="在线",s.value="ok"}catch{t.value="离线",s.value="bad"}});function n(){window.open("/planet/","_blank","noopener")}function o(){Ht(J.module==="settings"?"overview":"settings")}return(i,r)=>(p(),h("header",dc,[r[1]||(r[1]=l("div",{class:"brand"},[l("div",{class:"logo"},"F"),l("h1",null,"Foxclaw"),l("span",{class:"ver"},"v3.0")],-1)),r[2]||(r[2]=l("div",{class:"spacer"},null,-1)),l("div",fc,[r[0]||(r[0]=l("span",{class:"lbl"},"系统状态",-1)),l("span",{class:se(["val",s.value])},f(t.value),3)]),l("button",{class:"tbtn",title:"打开 HKC 知识星球",onClick:n},"🌐 知识星球"),l("button",{class:se(["tbtn",{on:m(J).module==="settings"}]),title:"设置 (Ctrl+,)",onClick:o},"⚙",2)]))}},hc=Oe(pc,[["__scopeId","data-v-a49bd237"]]),gc={class:"pop-head"},vc={class:"pop-body"},mc={key:0,class:"pop-sec"},_c=["onClick"],yc={class:"lbl"},bc={class:"tag"},kc={__name:"MenuPopover",props:{anchor:{type:Object,default:null},active:{type:String,default:"overview"}},emits:["pick","close"],setup(e,{emit:t}){const s=e,n=t,o=G(()=>{const c=[];let d=null;for(const v of uc()){if(!v.group){c.push({title:"",items:[v]});continue}(!d||d.title!==v.group)&&(d={title:v.group,items:[]},c.push(d)),d.items.push(v)}return c}),i=G(()=>{const c=s.anchor;if(!c)return{left:"16px",top:"120px"};const d=(c.bottom??0)+6;return{left:`${c.left}px`,top:`${d}px`}});function r(c){c.target.closest(".nav-pop")||c.target.closest(".rail-anchor")||n("close")}function u(c){c.key==="Escape"&&n("close")}function a(){n("close")}return Ae(()=>{document.addEventListener("mousedown",r,!0),document.addEventListener("keydown",u),window.addEventListener("resize",a)}),vs(()=>{document.removeEventListener("mousedown",r,!0),document.removeEventListener("keydown",u),window.removeEventListener("resize",a)}),(c,d)=>(p(),Re(ha,{to:"body"},[l("div",{class:"nav-pop",style:xt(i.value)},[l("div",gc,[d[1]||(d[1]=D("更多功能 ",-1)),l("span",{class:"x",title:"关闭 (Esc)",onClick:d[0]||(d[0]=v=>c.$emit("close"))},"✕")]),l("div",vc,[(p(!0),h(F,null,Y(o.value,(v,k)=>(p(),h(F,{key:k},[v.title?(p(),h("div",mc,f(v.title),1)):N("",!0),(p(!0),h(F,null,Y(v.items,$=>(p(),h("button",{key:$.id,class:se(["pop-item",{on:$.id===e.active}]),onClick:P=>c.$emit("pick",$.id)},[l("span",yc,f($.label),1),l("span",bc,f($.tag),1)],10,_c))),128))],64))),128))])],4)]))}},$c=Oe(kc,[["__scopeId","data-v-ae8e199a"]]),ar="sfx.chat.mode",Hn="sfx.sessionId",No=20,j=Mt({mode:localStorage.getItem(ar)||"stream",attachments:[],images:[],ingest:null,toast:"",messages:[],sessionId:null,streamState:"idle"});let jo=0;function ie(e,t=2800){j.toast=String(e),clearTimeout(jo),jo=setTimeout(()=>j.toast="",t)}function xn(e){j.mode=e,localStorage.setItem(ar,e)}async function wc(e){if(!e)return;if(e.size>No*1048576)return ie(`${e.name} 超过 ${No}MB`);const t=new FormData;t.append("file",e);try{const s=await ic("/upload",t);j.attachments.push({...s,kind:"file"}),ie(`已附加 ${s.name}${s.text?"":"(二进制,仅元数据)"}`)}catch(s){ie(`上传失败:${s.message}`)}}function xc(e){if(!e)return;if(!e.type.startsWith("image/"))return ie("不是图片文件");const t=new FileReader;t.onload=()=>j.images.push({name:e.name,url:String(t.result)}),t.onerror=()=>ie(`读取失败:${e.name}`),t.readAsDataURL(e)}function Cc(e){j.attachments.splice(e,1)}function Sc(e){j.images.splice(e,1)}async function ur(e,t=""){if(!e)return;if(j.ingest)return ie("等当前文件摄入完成再传下一个");j.ingest={name:e.name,pct:0,status:"queued",ku:0};const s=new FormData;s.append("file",e),t&&s.append("collection",t);let n;try{n=(await rc("/knowledge/ingest/file/async",s)).job_id}catch(o){return j.ingest={...j.ingest,status:"error",msg:o.message},ie(`摄入失败:${o.message}`)}Tc(n)}async function Mc(e){const t=[...e].filter(Boolean);for(const s of t){for(await ur(s);j.ingest&&j.ingest.status!=="error"&&j.ingest.status!=="done";)await new Promise(n=>setTimeout(n,600));j.ingest=null}t.length&&ie(`文件夹摄入完成 · ${t.length} 个文件`)}async function Tc(e){const t=Date.now()+6e5;for(;Date.now()<t;){await new Promise(s=>setTimeout(s,900));try{const s=await wn(`/knowledge/ingest/jobs/${e}`),n=s.total?Math.round(s.processed/s.total*100):s.status==="done"?100:0;if(j.ingest={name:s.filename,pct:n,status:s.status,ku:s.ku_count,msg:s.error},s.status==="done")return ie(`${s.filename} 摄入完成 · ${s.ku_count} 条`);if(s.status==="error")return ie(`${s.filename} 摄入失败:${s.error||"未知"}`)}catch(s){return j.ingest=null,ie(`进度查询失败:${s.message}`)}}j.ingest=null,ie("摄入超时,后台可能仍在跑")}const Ec={perceive:"感知",recall:"召回",meta_check:"自检",schedule:"排程",route:"路由",plan:"规划",dispatch:"分发",act:"执行",aggregate:"汇总",verify:"核验",reflect:"反思"};function Ac(e){return{role:e.role,content:e.content||"",ts:(e.ts||0)*1e3,attachments:e.attachments||[],thinking:"",evidence:[],error:"",streaming:!1}}function Kl(e){j.sessionId=e,J.sessionId=e,localStorage.setItem(Hn,e)}async function Oc(){const e=localStorage.getItem(Hn);e&&await Bn(e,{quiet:!0})}async function Bn(e,{quiet:t=!1}={}){if(e){dr();try{const s=await oe(`/sessions/${encodeURIComponent(e)}`);Kl(e),j.messages=(s.messages||[]).map(Ac),j.streamState="idle"}catch(s){j.sessionId===e&&(j.sessionId=null,localStorage.removeItem(Hn)),t||ie(`会话加载失败:${s.message}`)}}}const cr=Mt({ingestTick:0});function Ic(){cr.ingestTick+=1}function Pc(e){j.messages.push({role:"assistant",content:e,ts:Date.now(),thinking:"",evidence:[],error:"",notice:"",streaming:!1})}async function Rc(e){const t=String(e||"").trim();if(!t)return ie("用法:/搜索 关键词");if(j.streamState==="streaming")return ie("正在生成,先点停止");j.messages.push({role:"user",content:`/搜索 ${t}`,ts:Date.now(),attachments:[],thinking:"",streaming:!1}),j.messages.push({role:"assistant",content:"检索中…",ts:Date.now(),search:null,thinking:"",evidence:[],error:"",notice:"",streaming:!1,stage:"检索"});const s=j.messages[j.messages.length-1];try{const n=await et("/search/query",{query:t,agent_id:"supervisor",internal_only:!0}),o=n.graph&&n.graph.nodes||[];s.search={route:n.route||"HSR",confidence:n.confidence||0,iterations:n.iterations||0,nodes:o.slice(0,6).map(i=>({fact:i.fact,source:i.source,origin:i.origin,confidence:i.confidence}))},s.content=o.length?`命中 ${o.length} 条证据 · 整体置信度 ${Math.round((n.confidence||0)*100)}%`:"没有检索到相关证据"}catch(n){s.content="",s.error=`检索失败:${n.message}`}finally{s.stage=""}}async function Kn(){dr();try{const e=await et("/sessions",{});return Kl(e.id),j.messages=[],j.streamState="idle",await Vn(),e.id}catch(e){return ie(`新建会话失败:${e.message}`),null}}async function Lc(e,t){const s=String(t||"").trim().slice(0,60);if(!(!e||!s))try{await et(`/sessions/${encodeURIComponent(e)}/rename`,{title:s});const n=J.sessions.find(o=>o.id===e);n&&(n.title=s)}catch(n){ie(`重命名失败:${n.message}`)}}async function Dc(e){if(!e)return;try{await Xs(`/sessions/${encodeURIComponent(e)}`)}catch(s){return ie(`删除失败:${s.message}`)}if(J.sessions=J.sessions.filter(s=>s.id!==e),j.sessionId!==e)return;const t=J.sessions[0];t?await Bn(t.id):await Kn()}async function Nc(e){if(j.streamState==="streaming")return ie("正在生成,先点停止");const t=j.messages.indexOf(e);if(t<0)return;let s=-1;for(let i=t;i>=0;i-=1)if(j.messages[i].role==="user"){s=i;break}if(s<0)return ie("找不到对应的提问,无法重试");const n=j.messages[s],o=n.content;j.messages.splice(s),j.attachments=(n.attachments||[]).map(i=>({...i,kind:"file"})),j.images=(n.images||[]).map(i=>({...i})),await ql(o)}async function jc(){if(j.sessionId)return j.sessionId;const e=localStorage.getItem(Hn);if(e)try{return await oe(`/sessions/${e}`),Kl(e),e}catch{}return Kn()}let Xt=null,Is=0;function dr(){if(Is+=1,Xt){try{Xt.abort()}catch{}Xt=null}for(const e of j.messages)e.streaming&&(e.streaming=!1);j.streamState="idle"}function Fo(){Xt&&Xt.abort()}function Fc(e){const t=/^data:([^;]+);base64,(.*)$/.exec(e||"");return t?{media_type:t[1],data:t[2]}:null}async function ql(e){const t=String(e??"").trim();if(j.streamState==="streaming")return ie("正在生成,先点停止");if(!t&&!j.attachments.length&&!j.images.length)return;const s=await jc();if(!s)return;const n=j.images.map(v=>Fc(v.url)).filter(Boolean),o=j.attachments.map(v=>({name:v.name,size:v.size,mime:v.mime,url:v.url,text:v.text||""})),i=j.messages.filter(v=>v.content&&v.role&&!v.error).slice(-12).map(v=>({role:v.role,content:v.content}));j.messages.push({role:"user",content:t,ts:Date.now(),attachments:o,streaming:!1,thinking:"",images:j.images.map(v=>({...v}))}),j.messages.push({role:"assistant",content:"",thinking:"",evidence:[],error:"",notice:"",ts:Date.now(),streaming:!0,stage:"",plan:null});const r=j.messages[j.messages.length-1];j.attachments=[],j.images=[],j.streamState="streaming";const u=j.mode==="orchestrate",a=u?"/task/stream":"/chat/stream",c=u?{task:t,agent_id:"supervisor",session_id:s,context:{}}:{task:t,agent_id:"supervisor",history:i,session_id:s,images:n,attachments:o},d=++Is;Xt=new AbortController;try{const v=await fetch(Ul+a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c),signal:Xt.signal});if(!v.ok)throw new Error(`${a} -> ${v.status}`);if(await Hc(v,(k,$)=>Vc(r,k,$)),d!==Is)return;r.streaming=!1,j.streamState="done"}catch(v){if(d!==Is)return;r.streaming=!1,v&&v.name==="AbortError"?(j.streamState="done",r.content||(r.error="已停止")):(r.error=v&&v.message||"请求失败",j.streamState="error")}finally{d===Is&&(Xt=null,Vn())}}function Vc(e,t,s){if(t==="thinking"||s.thinking){e.thinking+=s.thinking||"";return}if(t==="evidence"||s.evidence){e.evidence=s.evidence||[];return}if(s.delta){e.content+=s.delta;return}if(s.stage){e.stage=Ec[s.stage]||s.stage;return}if(s.plan){e.plan=s.plan;return}if(s.result){Uc(e,s.result);return}if(s.error){e.error=s.error;return}s.done&&(e.streaming=!1)}function Uc(e,t){if(!t||typeof t!="object")return;if(t.interrupted)return void(e.error="管线已中断");if(t.error==="harness_blocked")return void(e.error="被 harness 策略拦截");t.status==="needs_confirmation"&&(e.notice="需要确认后才继续");const s=t.res??t.result??t.answer;s&&!e.content&&(e.content=typeof s=="string"?s:JSON.stringify(s,null,2))}async function Hc(e,t){if(!e.body)throw new Error("响应无流式主体");const s=e.body.getReader(),n=new TextDecoder;let o="";for(;;){const{value:i,done:r}=await s.read();if(r)break;o+=n.decode(i,{stream:!0});let u;for(;(u=o.indexOf(`
|
|
19
|
+
|
|
20
|
+
`))>=0;){const a=o.slice(0,u);if(o=o.slice(u+2),!a.trim())continue;const c=(a.match(/^event:\s*(\S+)/m)||[])[1]||"message",d=((a.match(/^data:\s*([\s\S]*)$/m)||[])[1]||"").trim();if(!d)continue;let v;try{v=JSON.parse(d)}catch{continue}t(c,v)}}}const Bc={class:"col col--left rail-left"},Kc={class:"rail-nav"},qc=["onClick"],Wc={class:"ic"},zc={viewBox:"0 0 24 24"},Jc=["d"],Gc={key:0,class:"beta"},Yc={key:0,class:"rail-acts"},Xc=["title","aria-label","onClick"],Qc={viewBox:"0 0 24 24"},Zc=["d"],ed=["aria-expanded"],td={class:"ic"},sd={viewBox:"0 0 24 24"},nd=["d"],ld={key:0,class:"cur"},od={class:"sec-head"},id={class:"ns-list scroll"},rd={key:0,class:"empty"},ad={key:1,class:"empty"},ud={key:2,class:"empty"},cd=["onKeydown","onBlur"],dd=["title","onClick"],fd={class:"ns-acts"},pd=["onClick"],hd=["onClick"],gd={__name:"LeftRail",setup(e){const t=W(null),s=W(!1),n=W(null),o=G(()=>J.sessions.length),i=ac(),r=G(()=>!Bl.includes(J.module)),u=G(()=>r.value&&J.module!=="overview"?bl(J.module):""),a={book:["M5 5.6A2.1 2.1 0 0 1 7.1 3.5H19v17H7.1A2.1 2.1 0 0 1 5 18.4z","M5 18.4a2.1 2.1 0 0 1 2.1-2.1H19","M9 8h6","M9 11.2h4"],clock:["M12 3.2a8.8 8.8 0 1 0 0 17.6 8.8 8.8 0 0 0 0-17.6z","M12 7.4V12l3.3 1.9"],plug:["M9 3v4.2","M15 3v4.2","M6.8 7.2h10.4v4.6a5.2 5.2 0 0 1-10.4 0z","M12 17v4"],bot:["M4.8 8.2h14.4A1.8 1.8 0 0 1 21 10v6.6a1.8 1.8 0 0 1-1.8 1.8H4.8A1.8 1.8 0 0 1 3 16.6V10a1.8 1.8 0 0 1 1.8-1.8z","M12 4.4v3.8","M8.6 12.8h.01","M15.4 12.8h.01"],more:["M6 12h.01","M12 12h.01","M18 12h.01"],review:["M20.4 12a8.4 8.4 0 0 1-14.3 5.9","M3.6 12a8.4 8.4 0 0 1 14.3-5.9","M17.9 2.6v3.6h-3.6","M6.1 21.4v-3.6h3.6"],memory:["M7.2 3.4h9.6v17.2L12 17.2l-4.8 3.4z"],dot:["M12 10.6a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"]},c=x=>a[x]||a.dot,d=x=>(x.quick||[]).map(S=>({id:S,label:bl(S),icon:S}));Ae(Vn);function v(){if(s.value){s.value=!1;return}const x=t.value?.getBoundingClientRect();x&&(n.value={left:x.left,bottom:x.bottom}),s.value=!0}function k(x){Ht(x),s.value=!1}function $(x){rr(x),Bn(x.id)}const P=W(""),b=W("");let A=null;function E(x){P.value=x.id,b.value=x.title||"",jt(()=>{A?.focus(),A?.select()})}function M(){P.value=""}async function I(x){if(P.value!==x.id)return;P.value="";const S=b.value.trim();!S||S===(x.title||"")||await Lc(x.id,S)}async function T(x){const S=x.title||"新会话";confirm(`删除会话「${S}」?
|
|
21
|
+
对话历史会一起删掉,不可恢复。`)&&await Dc(x.id)}async function X(){await Kn(),Ht("overview")}function ce(x){return x?new Date(x*1e3).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):""}function K(x){return[ce(x.updated_at),x.message_count?`${x.message_count} 条`:""].filter(Boolean).join(" · ")}return(x,S)=>(p(),h("aside",Bc,[l("button",{class:"new-sess",title:"开一个新会话",onClick:X},"+ 新会话"),l("nav",Kc,[(p(!0),h(F,null,Y(m(i),R=>(p(),h("div",{key:R.id,class:se(["rail-row",{on:m(J).module===R.id,sub:(R.quick||[]).includes(m(J).module)}])},[l("button",{class:"rail-item",onClick:z=>k(R.id)},[l("span",Wc,[(p(),h("svg",zc,[(p(!0),h(F,null,Y(c(R.icon),(z,B)=>(p(),h("path",{key:B,d:z},null,8,Jc))),128))]))]),l("b",null,f(R.label),1),R.beta?(p(),h("span",Gc,"BETA")):N("",!0)],8,qc),R.quick?(p(),h("span",Yc,[(p(!0),h(F,null,Y(d(R),z=>(p(),h("button",{key:z.id,class:"act",title:`打开${z.label}`,"aria-label":z.label,onClick:Ye(B=>k(z.id),["stop"])},[(p(),h("svg",Qc,[(p(!0),h(F,null,Y(c(z.icon),(B,re)=>(p(),h("path",{key:re,d:B},null,8,Zc))),128))]))],8,Xc))),128))])):N("",!0)],2))),128)),l("div",{class:se(["rail-row",{on:r.value}])},[l("button",{ref_key:"btnRef",ref:t,class:"rail-item rail-anchor","aria-expanded":s.value,title:"其它功能",onClick:v},[l("span",td,[(p(),h("svg",sd,[(p(!0),h(F,null,Y(c("more"),(R,z)=>(p(),h("path",{key:z,d:R},null,8,nd))),128))]))]),S[2]||(S[2]=l("b",null,"更多",-1)),u.value?(p(),h("span",ld,f(u.value),1)):N("",!0),l("span",{class:se(["caret",{open:s.value}])},"▾",2)],8,ed)],2)]),l("div",od,[S[3]||(S[3]=D(" 会话历史 ",-1)),l("em",null,f(o.value),1)]),l("div",id,[m(J).sessionsState==="loading"?(p(),h("div",rd,"加载中…")):m(J).sessionsState==="error"?(p(),h("div",ad,"后端未连接")):o.value?(p(!0),h(F,{key:3},Y(m(J).sessions,R=>(p(),h("div",{key:R.id,class:se(["ns-row",{on:R.id===m(J).sessionId}])},[P.value===R.id?ae((p(),h("input",{key:0,ref_for:!0,ref:z=>Fe(A)?A.value=z:A=z,"onUpdate:modelValue":S[0]||(S[0]=z=>b.value=z),class:"ns-edit",maxlength:"60","aria-label":"会话标题",onKeydown:[Ys(Ye(z=>I(R),["prevent"]),["enter"]),Ys(Ye(M,["prevent"]),["esc"])],onBlur:z=>I(R)},null,40,cd)),[[me,b.value]]):(p(),h(F,{key:1},[l("button",{class:"ns-item",title:R.title||"新会话",onClick:z=>$(R)},[l("b",null,f(R.title||"新会话"),1),l("span",null,f(K(R)),1)],8,dd),l("span",fd,[l("button",{class:"act",title:"重命名会话",onClick:Ye(z=>E(R),["stop"])},[...S[4]||(S[4]=[l("svg",{viewBox:"0 0 24 24"},[l("path",{d:"M4.4 19.6h4l10.8-10.8-4-4L4.4 15.6z"}),l("path",{d:"M14.4 5.6l3.8 3.8"})],-1)])],8,pd),l("button",{class:"act del",title:"删除会话",onClick:Ye(z=>T(R),["stop"])},[...S[5]||(S[5]=[l("svg",{viewBox:"0 0 24 24"},[l("path",{d:"M5 7h14"}),l("path",{d:"M9.6 7V4.6h4.8V7"}),l("path",{d:"M6.8 7l.8 12.4h8.8L17.2 7"})],-1)])],8,hd)])],64))],2))),128)):(p(),h("div",ud,"还没有会话 · 发一条消息即开始"))]),s.value?(p(),Re($c,{key:0,anchor:n.value,active:m(J).module,onPick:k,onClose:S[1]||(S[1]=R=>s.value=!1)},null,8,["anchor","active"])):N("",!0)]))}},vd=Oe(gd,[["__scopeId","data-v-1d26869a"]]),$l=e=>String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),Vo=/^\s*(`{3,}|~{3,})\s*([\w+#.-]*)\s*$/,md=/^(#{1,6})\s+(.*)$/,_d=/^\s*([-*_])\1{2,}\s*$/,yd=/^\s*(?:[-*+]|\d+[.)])\s+(.*)$/,bd=/^\s*\d+[.)]\s+/,kd=/^>\s?(.*)$/,Uo=/^\s*\|.*\|\s*$/,$d=/^\s*\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/;function ys(e){const t=[];let s=$l(e).replace(/`([^`]+)`/g,(n,o)=>(t.push(o),`\0${t.length-1}\0`));return s=s.replace(/\*\*([^*\n]+)\*\*/g,"<strong>$1</strong>").replace(/(^|[^\w*])\*([^*\n]+)\*(?!\*)/g,"$1<em>$2</em>").replace(/~~([^~\n]+)~~/g,"<del>$1</del>").replace(/\[([^\]\n]+)\]\(([^)\s]+)\)/g,(n,o,i)=>/^https?:\/\//i.test(i)?`<a href="${i}" target="_blank" rel="noreferrer">${o}</a>`:n),s.replace(/\u0000(\d+)\u0000/g,(n,o)=>`<code>${t[Number(o)]}</code>`)}function wd(e,t,s){const n=s?"md-code md-open":"md-code",o=e?` data-lang="${$l(e)}"`:"";return`<pre class="${n}"${o}><code>${$l(t)}</code></pre>`}function Ho(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function xd(e){if(!e.length)return"";const t=e[0],s=e.slice(1),n=t.map(i=>`<th>${ys(i)}</th>`).join(""),o=s.map(i=>`<tr>${i.map(r=>`<td>${ys(r)}</td>`).join("")}</tr>`).join("");return`<table><thead><tr>${n}</tr></thead>${s.length?`<tbody>${o}</tbody>`:""}</table>`}function fr(e){const t=String(e??"").replace(/\r\n?/g,`
|
|
22
|
+
`).replace(/\n$/,"");if(!t.trim())return"";const s=t.split(`
|
|
23
|
+
`),n=[];let o=[],i=null,r=[];const u=()=>{o.length&&(n.push(`<p>${o.map(ys).join("<br>")}</p>`),o=[])},a=()=>{i&&(n.push(`<${i.tag}>${i.items.map(k=>`<li>${k}</li>`).join("")}</${i.tag}>`),i=null)},c=()=>{r.length&&(n.push(`<blockquote>${r.map(ys).join("<br>")}</blockquote>`),r=[])},d=()=>{u(),a(),c()};let v=0;for(;v<s.length;){const k=s[v].replace(/\s+$/,"");if(!k.trim()){d(),v+=1;continue}const $=Vo.exec(k);if($){d();const E=$[1][0],M=$[2]||"",I=[];let T=!1,X=v+1;for(;X<s.length;X+=1){const ce=s[X],K=Vo.exec(ce);if(K&&K[1][0]===E){T=!0;break}I.push(ce)}n.push(wd(M,I.join(`
|
|
24
|
+
`),!T)),v=T?X+1:X;continue}if(Uo.test(k)&&v+1<s.length&&$d.test(s[v+1])&&s[v+1].includes("-")){d();const E=[Ho(k)];let M=v+2;for(;M<s.length&&Uo.test(s[M]);)E.push(Ho(s[M])),M+=1;n.push(xd(E)),v=M;continue}const P=md.exec(k);if(P){d();const E=Math.min(P[1].length+1,5);n.push(`<h${E}>${ys(P[2])}</h${E}>`),v+=1;continue}if(_d.test(k)){d(),n.push("<hr />"),v+=1;continue}const b=yd.exec(k);if(b){u(),c();const E=bd.test(k)?"ol":"ul";(!i||i.tag!==E)&&(a(),i={tag:E,items:[]}),i.items.push(ys(b[1])),v+=1;continue}const A=kd.exec(k);if(A){u(),a(),r.push(A[1]),v+=1;continue}a(),c(),o.push(k.trim()),v+=1}return d(),n.join("")}const Cd={key:0,class:"cli"},Sd={class:"term-bar"},Md={class:"path"},Td={class:"lang"},Ed={class:"term-body scroll"},Ad={class:"no"},Od={class:"code"},Id={key:1,class:"read scroll"},Pd={class:"read-head"},Rd={class:"read-meta"},Ld={key:0},Dd={key:1},Nd=["innerHTML"],jd={__name:"DocViewer",props:{doc:{type:Object,required:!0}},setup(e){const t=e,s=G(()=>(t.doc.content||"").replace(/\n$/,"").split(`
|
|
25
|
+
`)),n=G(()=>fr(t.doc.content));return(o,i)=>e.doc.kind==="code"?(p(),h("div",Cd,[l("div",Sd,[i[0]||(i[0]=l("span",{class:"tl"},null,-1)),i[1]||(i[1]=l("span",{class:"tl"},null,-1)),i[2]||(i[2]=l("span",{class:"tl"},null,-1)),l("code",Md,f(e.doc.path),1),l("span",Td,f(e.doc.lang),1)]),l("div",Ed,[(p(!0),h(F,null,Y(s.value,(r,u)=>(p(),h("div",{key:u,class:"row"},[l("span",Ad,f(u+1),1),l("span",Od,f(r||" "),1)]))),128))])])):(p(),h("article",Id,[l("header",Pd,[l("h2",null,f(e.doc.title),1),l("div",Rd,[e.doc.meta?(p(),h("span",Ld,f(e.doc.meta),1)):N("",!0),e.doc.path?(p(),h("code",Dd,f(e.doc.path),1)):N("",!0)])]),l("div",{class:"read-body md",innerHTML:n.value},null,8,Nd)]))}},Fd=Oe(jd,[["__scopeId","data-v-c1942c38"]]),Vd={class:"ms-in"},Ud={key:0,class:"u-body"},Hd={key:0,class:"u-atts"},Bd={class:"u-text"},Kd={class:"u-time"},qd={key:1,class:"a-body"},Wd={class:"a-head"},zd={key:0,class:"stage"},Jd={key:1,class:"live-tag"},Gd={class:"a-time"},Yd={key:0,class:"fold think"},Xd={class:"fold-body"},Qd={key:1,class:"fold plan",open:""},Zd={class:"fold-body"},ef={key:2,class:"sres"},tf={class:"sres-h"},sf={class:"sroute"},nf=["innerHTML"],lf={key:4,class:"a-text waiting"},of={key:5,class:"notice"},rf={key:6,class:"err"},af={key:7,class:"fold ev"},uf={class:"fold-body"},cf={class:"ev-st"},df=["href"],ff={key:1,class:"ev-file"},pf={key:8,class:"a-acts"},hf=["onClick"],gf=["onClick"],vf={__name:"MessageStream",setup(e){const t=W(null);let s=!0;function n(){const $=t.value;$&&(s=$.scrollHeight-$.scrollTop-$.clientHeight<80)}hs(()=>j.messages.map($=>`${($.content||"").length}:${($.thinking||"").length}:${$.streaming?1:0}`).join("|"),async()=>{if(!s)return;await jt();const $=t.value;$&&($.scrollTop=$.scrollHeight)});function o($){return $?new Date($).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit",hour12:!1}):""}function i($){return/^https?:\/\//i.test($&&$.ref||"")}function r($){return typeof $=="string"?$:$.desc||$.task||$.label||JSON.stringify($)}const u={memory:"记忆",knowledge:"知识",web:"联网",agent:"态势"};function a($){return u[$]||$||"证据"}const c=W(-1);let d=0;async function v($,P){const b=$.content||"";try{await navigator.clipboard.writeText(b)}catch{const A=document.createElement("textarea");A.value=b,A.style.position="fixed",A.style.opacity="0",document.body.appendChild(A),A.select();try{document.execCommand("copy")}catch{}A.remove()}c.value=P,clearTimeout(d),d=setTimeout(()=>c.value=-1,1600)}function k($){return $===j.messages.length-1}return($,P)=>(p(),h("div",{ref_key:"box",ref:t,class:"ms scroll",onScroll:n},[l("div",Vd,[(p(!0),h(F,null,Y(m(j).messages,(b,A)=>(p(),h("article",{key:A,class:se(["msg",b.role])},[b.role==="user"?(p(),h("div",Ud,[b.attachments&&b.attachments.length?(p(),h("div",Hd,[(p(!0),h(F,null,Y(b.attachments,(E,M)=>(p(),h("span",{key:M,class:"u-att"},f(E.name),1))),128))])):N("",!0),l("p",Bd,f(b.content),1),l("div",Kd,f(o(b.ts)),1)])):(p(),h("div",qd,[l("div",Wd,[l("span",{class:se(["avatar",{live:b.streaming}])},null,2),P[0]||(P[0]=l("span",{class:"who"},"主管 Agent",-1)),b.stage?(p(),h("span",zd,"◌ "+f(b.stage),1)):N("",!0),b.streaming?(p(),h("span",Jd,"生成中")):N("",!0),l("span",Gd,f(o(b.ts)),1)]),b.thinking?(p(),h("details",Yd,[l("summary",null,[P[1]||(P[1]=D("推理过程 ",-1)),l("em",null,f(b.thinking.length)+" 字",1)]),l("pre",Xd,f(b.thinking),1)])):N("",!0),b.plan&&(b.plan.steps||[]).length?(p(),h("details",Qd,[l("summary",null,[P[2]||(P[2]=D(" 执行计划 ",-1)),l("em",null,f(b.plan.steps.length)+" 步 · "+f(b.plan.flow||"single"),1)]),l("ol",Zd,[(p(!0),h(F,null,Y(b.plan.steps,(E,M)=>(p(),h("li",{key:M},f(r(E)),1))),128))])])):N("",!0),b.search?(p(),h("div",ef,[l("div",tf,[l("span",sf,f(b.search.route),1),l("span",null,"置信度 "+f(Math.round((b.search.confidence||0)*100))+"%",1),l("span",null,f(b.search.iterations)+" 轮迭代",1)]),(p(!0),h(F,null,Y(b.search.nodes,(E,M)=>(p(),h("div",{key:M,class:"srow"},[l("span",{class:se(["ssrc",E.source])},f(a(E.source)),3),l("p",null,f(E.fact),1),l("em",null,f(Math.round((E.confidence||0)*100)),1)]))),128))])):N("",!0),b.content?(p(),h("div",{key:3,class:se(["a-text",{streaming:b.streaming}]),innerHTML:m(fr)(b.content)},null,10,nf)):b.streaming?(p(),h("p",lf,[...P[3]||(P[3]=[l("span",{class:"dots"},"···",-1)])])):N("",!0),b.notice?(p(),h("div",of,f(b.notice),1)):N("",!0),b.error?(p(),h("div",rf,"✕ "+f(b.error),1)):N("",!0),b.evidence&&b.evidence.length?(p(),h("details",af,[l("summary",null,[P[4]||(P[4]=D("执行证据 ",-1)),l("em",null,f(b.evidence.length)+" 项",1)]),l("div",uf,[(p(!0),h(F,null,Y(b.evidence,(E,M)=>(p(),h("div",{key:M,class:"ev-row"},[l("span",{class:se(["ev-dot",E.status||"unverified"])},null,2),l("b",null,f(E.tool||E.kind||"工具"),1),l("span",cf,f(E.status||E.reason||""),1),(p(!0),h(F,null,Y(E.evidence||[],(I,T)=>(p(),h(F,{key:T},[i(I)?(p(),h("a",{key:0,class:"ev-link",href:I.ref,target:"_blank",rel:"noreferrer"},f(I.label||I.ref),9,df)):(p(),h("span",ff,f(I.label||I.ref),1))],64))),128))]))),128))])])):N("",!0),!b.streaming&&(b.content||b.error)?(p(),h("div",pf,[b.content?(p(),h("button",{key:0,class:"mini",onClick:E=>v(b,A)},f(c.value===A?"已复制":"复制"),9,hf)):N("",!0),k(A)?(p(),h("button",{key:1,class:"mini",onClick:E=>m(Nc)(b)},"重试",8,gf)):N("",!0)])):N("",!0)]))],2))),128))])],544))}},mf=Oe(vf,[["__scopeId","data-v-6b551382"]]),_f={class:"panel"},yf={class:"ph"},bf={class:"tt"},kf={key:0,class:"pn-tag"},$f={class:"pb scroll"},wf={key:0,class:"pn-st"},xf={key:1,class:"pn-st err"},Cf={__name:"PanelBox",props:{title:{type:String,default:""},tag:{type:String,default:""},state:{type:String,default:"idle"},ready:{type:Boolean,default:!1}},emits:["refresh"],setup(e){const t=e;return(s,n)=>(p(),h("section",_f,[l("header",yf,[l("div",bf,[l("h2",null,f(t.title),1),t.tag?(p(),h("span",kf,f(t.tag),1)):N("",!0)]),l("button",{class:se(["rf",{spin:t.state==="loading"}]),title:"重新拉取",onClick:n[0]||(n[0]=o=>s.$emit("refresh"))}," 刷新 ",2)]),l("div",$f,[t.state==="loading"&&!t.ready?(p(),h("div",wf,"加载中…")):t.state==="error"?(p(),h("div",xf,"后端未连接,这个面板暂时拉不到数据")):Oa(s.$slots,"default",{},void 0,!0,2)])]))}},Kt=Oe(Cf,[["__scopeId","data-v-1bd36f1d"]]),Me=e=>e.then(t=>t,()=>null),Be=Mt({activity:{state:"idle",events:[],traces:[],thought:null},tasks:{state:"idle",sched:{},processes:[],procStats:{}},agents:{state:"idle",list:[],info:null},tools:{state:"idle",skills:[],md:[],breakers:{}},usage:{state:"idle",tokens:null,gateway:{},metrics:null,slow:[]},knowledge:{state:"idle",stats:{},index:{},sources:[],abilities:[],recent:[],recentTotal:0,ingest:"idle",ingestMsg:"",ingestErr:""},memory:{state:"idle",stats:{},recent:[],prefs:[]},review:{state:"idle",stats:{cards:0,learned:0,fresh:0,due:0,avg_mastery:0,load7:{},risk:[]},queue:[],index:0,revealed:!1,session:"idle",lastMsg:""}}),wl={async activity(e){const[t,s,n]=await Promise.all([Me(oe("/bus/history?limit=40")),Me(oe("/traces?limit=25")),Me(oe("/thoughtchain/supervisor/summary"))]);return e.events=t?.events||[],e.traces=(s?.traces||[]).slice().sort((o,i)=>(i.duration_ms||0)-(o.duration_ms||0)),e.thought=n,!!(t||s||n)},async tasks(e){const[t,s]=await Promise.all([Me(oe("/scheduler/stats")),Me(oe("/processes?limit=30"))]);return e.sched=t||{},e.processes=s?.processes||[],e.procStats=s?.stats||{},!!(t||s)},async agents(e){const[t,s]=await Promise.all([Me(oe("/status")),Me(oe("/system/info"))]);return e.list=t?Object.values(t):[],e.info=s,!!(t||s)},async tools(e){const[t,s,n]=await Promise.all([Me(oe("/ahs/skills")),Me(oe("/ahs/md-skills")),Me(oe("/ahs/breaker"))]);return e.skills=t?.skills||[],e.md=s?.skills||[],e.breakers=n?.breakers||{},!!(t||s||n)},async usage(e){const[t,s,n]=await Promise.all([Me(oe("/tokens")),Me(oe("/gateway/stats")),Me(oe("/metrics"))]);return e.tokens=t&&!t.error?t:null,e.gateway=s||{},e.metrics=n,e.slow=Object.entries(n?.endpoints||{}).map(([o,i])=>({name:o,...i})).sort((o,i)=>(i.p95_ms||0)-(o.p95_ms||0)).slice(0,6),!!(t||s||n)},async knowledge(e){const[t,s,n,o]=await Promise.all([Me(wn("/stats")),Me(wn("/knowledge/sources")),Me(oe("/knowledge/abilities")),Me(oe("/knowledge/recent?limit=50"))]);return e.stats=t||{},e.index=t?.index_build||{},e.sources=s?.sources||[],e.abilities=n?.abilities||[],e.recent=o?.kus||[],e.recentTotal=o?.total??e.recent.length,!!(t||s||n||o)},async review(e){const[t,s]=await Promise.all([Me(oe("/review/stats")),Me(oe("/review/queue?limit=20&fresh_limit=10"))]);return t&&(e.stats={...e.stats,...t}),s?.cards&&e.session!=="running"&&(e.queue=s.cards,e.index=0,e.revealed=!1,e.session==="done"&&(e.session="idle")),!!(t||s)},async memory(e){const[t,s,n]=await Promise.all([Me(oe("/memory/stats")),Me(oe("/memory/recent?limit=12")),Me(oe("/preferences"))]);return e.stats=t||{},e.recent=s?.memories||[],e.prefs=n?.preferences||[],!!(t||s||n)}};async function rt(e,t=!1){const s=Be[e];if(!s||!wl[e]||!t&&s.state!=="idle"&&s.state!=="error")return;s.state="loading";let n=!1;try{n=await wl[e](s)}catch{n=!1}s.state=n?"ok":"error"}const We=e=>rt(e,!0);async function Sf(e,t){await lc(`/ahs/md-skills/${encodeURIComponent(e)}`,{enabled:t}),await We("tools")}async function pr({text:e,title:t="",domain:s=""}){const n=Be.knowledge,o=(e||"").trim();if(!o)throw new Error("先写点内容再收录");n.ingest="busy",n.ingestMsg="",n.ingestErr="";try{const i=await et("/knowledge/ingest",{text:o,source_title:(t||"").trim(),domain:(s||"").trim()}),r=Object.entries(i?.counts||{}).map(([a,c])=>`${a} ${c}`).join(" · ");n.ingest="ok";const u=i?.ku_count??0;n.ingestMsg=u?`已抽取 ${u} 条知识单元${r?` · ${r}`:""}`:"模型没从这段文字里抽出知识条目 —— 试试写得更具体(谁 / 是什么 / 为什么)";try{await wl.knowledge(n),n.state="ok"}catch{}return i}catch(i){throw n.ingest="error",n.ingestErr=String(i?.message||i),i}}async function xl(){const e=Be.review;e.queue.length||await rt("review",!0),e.queue.length&&(e.session="running",e.index=0,e.revealed=!1,e.lastMsg="")}function Mf(){Be.review.revealed=!0}async function Tf(e){const t=Be.review,s=t.queue[t.index];if(!s)return null;const n=await et("/review/grade",{ku_id:s.ku_id,grade:e}),o=n?.next_in_days??1;t.lastMsg=`${s.name} → ${o>1?`${o} 天后`:"明天"}再复习`,t.index+=1,t.revealed=!1,t.index>=t.queue.length&&(t.session="done");const i=await oe("/review/stats").catch(()=>null);return i&&(t.stats={...t.stats,...i}),n}async function Ef(e){await Xs(`/preferences/${encodeURIComponent(e)}`),await We("memory")}async function Af(e){const t=await oe(`/ahs/md-skills/${encodeURIComponent(e)}`);Un({id:`skill:${t.id}`,kind:"text",lang:"markdown",title:t.name||t.id,path:`skills/${t.id}/SKILL.md`,meta:`指令技能 · v${t.version||"—"} · trust ${t.trust||"—"}`,content:t.body||t.description||"(正文为空)"})}const Of=[["statement","陈述"],["definition","定义"],["summary","摘要"],["description","描述"],["aliases","别名"],["verifiable","可验证"],["source","来源"],["source_type","来源类型"],["author","作者"],["year","年份"],["page","页码"],["quote","原文引用"],["supports","支持"],["contradicts","矛盾"]],If=e=>Array.isArray(e)?e.length?e.join("、"):"":typeof e=="boolean"?e?"是":"否":e===0||e===""||e==null?"":String(e);async function Qs(e){const t=await wn(`/knowledge/ku/${encodeURIComponent(e)}`),s=t.extra||{},o=Of.map(([r,u])=>[u,If(s[r])]).filter(([,r])=>r).filter(([,r])=>r!==t.summary&&r!==t.name),i=[];o.length&&i.push(o.map(([r,u])=>`- **${r}**: ${u}`).join(`
|
|
26
|
+
`)),s.source_text&&i.push(`### 出处原文
|
|
27
|
+
|
|
28
|
+
${s.source_text}`),Un({id:`ku:${t.ku_id}`,kind:"text",lang:"markdown",title:t.name||t.ku_id,path:`knowledge/${t.ku_type}/${t.ku_id}`,meta:`${t.ku_type} · ${t.domain||"未分域"} · 置信度 ${Math.round((t.confidence||0)*100)}%`,content:i.join(`
|
|
29
|
+
|
|
30
|
+
`)||"这条知识单元没有附带正文,只有一个名称。"})}async function Pf(){const e=await oe("/tokens/report");Un({id:"token-report",kind:"code",lang:"text",title:"token-report",path:"foxclaw/api/routes/system.py",meta:"Token 消耗报告 · 实时生成",content:e.report||"(暂无报告)"})}function hr(e){if(!e)return null;if(typeof e=="string"){const n=new Date(e);return Number.isNaN(n.getTime())?null:n}const t=e>1e12?e:e*1e3,s=new Date(t);return Number.isNaN(s.getTime())?null:s}function Cn(e){const t=hr(e);return t?t.toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}):""}function gr(e){const t=hr(e);if(!t)return"";const s=Math.max(0,(Date.now()-t.getTime())/1e3);return s<60?"刚刚":s<3600?`${Math.floor(s/60)} 分钟前`:s<86400?`${Math.floor(s/3600)} 小时前`:`${Math.floor(s/86400)} 天前`}function we(e){return e==null||Number.isNaN(e)?"0":Number(e).toLocaleString("zh-CN")}function Ps(e){return e==null?"—":e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}function lt(e,t=46){const s=String(e??"").replace(/\s+/g," ").trim();return s.length>t?s.slice(0,t)+"…":s}const Rf={class:"pn-kpi"},Lf={class:"pn-cols"},Df={class:"pn-sec"},Nf={class:"pn-h"},jf={key:0,class:"pn-empty"},Ff=["title"],Vf={class:"m"},Uf={class:"s"},Hf={class:"r"},Bf={class:"pn-sec"},Kf={class:"pn-h"},qf={key:0,class:"pn-empty"},Wf=["title"],zf={class:"m"},Jf={class:"s"},Gf={class:"r"},Yf={class:"pn-sec"},Xf={class:"pn-note"},Qf={__name:"ActivityPanel",setup(e){const t=Be.activity;Ae(()=>rt("activity"));const s=G(()=>t.events.length>0||t.traces.length>0||!!t.thought),n=G(()=>t.events.slice(0,14)),o=G(()=>t.traces.slice(0,8));function i(u){const a=u.payload||{};return a.task||a.reason||a.phase||a.agent_id||u.topic||u.channel||"(空事件)"}function r(u){const a=u.source?`来源 ${u.source}`:"";return[u.channel,a].filter(Boolean).join(" · ")}return(u,a)=>(p(),Re(Kt,{title:"活动",tag:"Activity",state:m(t).state,ready:s.value,onRefresh:a[0]||(a[0]=c=>m(We)("activity"))},{default:pt(()=>[l("div",Rf,[l("div",null,[l("b",null,f(n.value.length),1),a[1]||(a[1]=l("span",null,"事件",-1))]),l("div",null,[l("b",null,f(m(t).traces.length),1),a[2]||(a[2]=l("span",null,"请求链路",-1))]),l("div",null,[l("b",null,f(m(t).thought?.total_nodes??0),1),a[3]||(a[3]=l("span",null,"思考节点",-1))]),l("div",null,[l("b",null,f(m(t).thought?Math.round((m(t).thought.avg_confidence??0)*100)+"%":"—"),1),a[4]||(a[4]=l("span",null,"平均置信度",-1))])]),l("div",Lf,[l("div",Df,[l("div",Nf,[a[5]||(a[5]=D("事件总线 ",-1)),l("em",null,f(m(t).events.length),1)]),n.value.length?N("",!0):(p(),h("div",jf," 还没有事件。发一条消息、让 Agent 跑一步,执行 → 审计 → 记忆的流转会记在这里。 ")),(p(!0),h(F,null,Y(n.value,(c,d)=>(p(),h("div",{key:d,class:"pn-row static",title:i(c)},[l("span",Vf,[l("b",null,f(m(lt)(i(c),40)),1),l("span",Uf,f(r(c)),1)]),l("span",Hf,f(m(gr)(c.ts)),1)],8,Ff))),128))]),l("div",Bf,[l("div",Kf,[a[6]||(a[6]=D("最慢请求链路 ",-1)),l("em",null,f(m(t).traces.length),1)]),o.value.length?N("",!0):(p(),h("div",qf," 还没有链路记录。任何一次 API 调用都会留下 trace。 ")),(p(!0),h(F,null,Y(o.value,(c,d)=>(p(),h("div",{key:c.trace_id||d,class:"pn-row",title:c.trace_id},[l("span",zf,[l("b",null,f(m(lt)(c.name,34)),1),l("span",Jf,f(c.span_count||0)+" span",1)]),l("span",Gf,f(m(Ps)(c.duration_ms)),1)],8,Wf))),128))])]),l("div",Yf,[l("div",Xf,[D(" 思考链健康度:共 "+f(m(t).thought?.total_nodes??0)+" 个节点,阻塞 "+f(m(t).thought?.blocked_nodes??0)+" 个, 警告 "+f(m(t).thought?.warned_nodes??0)+" 个,阻塞率 "+f(m(t).thought?Math.round((m(t).thought.block_rate??0)*100)+"%":"—")+"。 数据来自 ",1),a[7]||(a[7]=l("code",null,"/api/bus/history",-1)),a[8]||(a[8]=D("、",-1)),a[9]||(a[9]=l("code",null,"/api/traces",-1)),a[10]||(a[10]=D("、",-1)),a[11]||(a[11]=l("code",null,"/api/thoughtchain/{agent}/summary",-1)),a[12]||(a[12]=D("。 ",-1))])])]),_:1},8,["state","ready"]))}},Zf=Oe(Qf,[["__scopeId","data-v-b8ba3716"]]),ep={class:"pn-kpi"},tp={class:"pn-sec"},sp={class:"pn-h"},np={key:0,class:"pn-empty"},lp={class:"m"},op={class:"s"},ip={class:"r"},rp={class:"pn-sec"},ap={key:0,class:"pn-empty"},up={key:1,class:"pn-chips"},cp={class:"pn-note"},dp={__name:"TasksPanel",setup(e){const t=Be.tasks;Ae(()=>rt("tasks"));const s=G(()=>t.state==="ok"&&Object.keys(t.sched).length>0),n=G(()=>t.procStats?.by_state||{});function o(u){return u==="completed"?"green":u==="failed"?"red":u==="running"?"amber":""}const i={created:"已创建",queued:"排队中",scheduled:"已调度",running:"执行中",completed:"已完成",failed:"失败"},r=u=>i[u]||u;return(u,a)=>(p(),Re(Kt,{title:"任务",tag:"Tasks",state:m(t).state,ready:s.value,onRefresh:a[0]||(a[0]=c=>m(We)("tasks"))},{default:pt(()=>[l("div",ep,[l("div",null,[l("b",null,f(m(t).sched.submitted??0),1),a[1]||(a[1]=l("span",null,"已提交",-1))]),l("div",null,[l("b",null,f(m(t).sched.running??0),1),a[2]||(a[2]=l("span",null,"执行中",-1))]),l("div",null,[l("b",null,f(m(t).sched.completed??0),1),a[3]||(a[3]=l("span",null,"已完成",-1))]),l("div",null,[l("b",null,f(m(t).sched.failed??0),1),a[4]||(a[4]=l("span",null,"失败",-1))]),l("div",null,[l("b",null,f(m(t).procStats?.active??0),1),a[5]||(a[5]=l("span",null,"活跃进程",-1))])]),l("div",tp,[l("div",sp,[a[6]||(a[6]=D("进程生命周期 ",-1)),l("em",null,f(m(t).processes.length),1)]),m(t).processes.length?N("",!0):(p(),h("div",np,[...a[7]||(a[7]=[D(" 还没有任务进程。任务是按「进程」记录的:提交后排入调度,执行完进入终态, 每一步的 ",-1),l("code",null,"state_history",-1),D(" 都能追溯。 ",-1)])])),(p(!0),h(F,null,Y(m(t).processes,c=>(p(),h("div",{key:c.process_id,class:"pn-row"},[l("span",lp,[l("b",null,f(m(lt)(c.task,52)),1),l("span",op,[D(f(c.agent_id||"未分配")+" ",1),c.route_hint?(p(),h(F,{key:0},[D(" · "+f(c.route_hint),1)],64)):N("",!0),D(" · "+f((c.state_history||[]).join(" → ")),1)])]),l("span",{class:se(["pn-tag",o(c.state)])},f(r(c.state)),3),l("span",ip,f(m(gr)(c.created_at)),1)]))),128))]),l("div",rp,[a[8]||(a[8]=l("div",{class:"pn-h"},"按状态分布",-1)),Object.keys(n.value).length?(p(),h("div",up,[(p(!0),h(F,null,Y(n.value,(c,d)=>(p(),h("span",{key:d,class:"pn-chip"},f(r(d))+" "+f(c),1))),128))])):(p(),h("div",ap,"暂时没有进程状态。"))]),l("div",cp,[D(" 并发峰值 "+f(m(t).sched.peak_running??0)+" / 上限 "+f(m(t).sched.max_concurrency??"未设")+"。 数据来自 ",1),a[9]||(a[9]=l("code",null,"/api/scheduler/stats",-1)),a[10]||(a[10]=D(" 与 ",-1)),a[11]||(a[11]=l("code",null,"/api/processes",-1)),a[12]||(a[12]=D("。 ",-1))])]),_:1},8,["state","ready"]))}},fp={class:"pn-kpi"},pp={class:"pn-sec"},hp={class:"pn-h"},gp={key:0,class:"pn-empty"},vp=["onClick"],mp={class:"m"},_p={class:"id"},yp={class:"s"},bp={key:0,class:"det"},kp={class:"kv"},$p={class:"kv"},wp={class:"kv"},xp={class:"kv"},Cp={class:"kv"},Sp={class:"pn-note"},Mp={__name:"AgentsPanel",setup(e){const t=Be.agents,s=W("");Ae(()=>rt("agents"));const n=G(()=>t.list.length>0),o=G(()=>t.list.filter(a=>a.harness?.shadow_mode).length),i=G(()=>t.list.reduce((a,c)=>a+(c.thought_chain?.total_nodes||0),0)),r=G(()=>t.list.reduce((a,c)=>a+(c.thought_chain?.blocked_nodes||0),0));function u(a){s.value=s.value===a?"":a}return(a,c)=>(p(),Re(Kt,{title:"代理",tag:"Agents",state:m(t).state,ready:n.value,onRefresh:c[0]||(c[0]=d=>m(We)("agents"))},{default:pt(()=>[l("div",fp,[l("div",null,[l("b",null,f(m(t).list.length),1),c[1]||(c[1]=l("span",null,"代理",-1))]),l("div",null,[l("b",null,f(o.value),1),c[2]||(c[2]=l("span",null,"影子模式",-1))]),l("div",null,[l("b",null,f(i.value),1),c[3]||(c[3]=l("span",null,"思考节点",-1))]),l("div",null,[l("b",null,f(r.value),1),c[4]||(c[4]=l("span",null,"被拦截",-1))])]),l("div",pp,[l("div",hp,[c[5]||(c[5]=D("代理清单 ",-1)),l("em",null,f(m(t).list.length),1)]),m(t).list.length?N("",!0):(p(),h("div",gp,"后端没有返回任何 Agent。")),(p(!0),h(F,null,Y(m(t).list,d=>(p(),h("div",{key:d.agent_id,class:"ag"},[l("div",{class:"pn-row clickable",onClick:v=>u(d.agent_id)},[l("span",mp,[l("b",null,[D(f(d.agent_name)+" ",1),l("em",_p,f(d.agent_id),1)]),l("span",yp,f(d.thought_chain?.total_nodes??0)+" 节点 · 置信度 "+f(Math.round((d.thought_chain?.avg_confidence??0)*100))+"% · 规则 "+f(d.harness?.policy?.total_rules??0)+" 条 ",1)]),l("span",{class:se(["pn-tag",d.harness?.shadow_mode?"amber":"green"])},f(d.harness?.shadow_mode?"影子":"在线"),3)],8,vp),s.value===d.agent_id?(p(),h("div",bp,[l("div",kp,[c[6]||(c[6]=l("span",null,"拦截阈值",-1)),l("b",null," warn "+f(d.harness?.thresholds?.warn??"—")+" / block "+f(d.harness?.thresholds?.block??"—"),1)]),l("div",$p,[c[7]||(c[7]=l("span",null,"漂移检测",-1)),l("b",null,f(d.harness?.thresholds?.embedding_mode||"—"),1)]),l("div",wp,[c[8]||(c[8]=l("span",null,"语义维度",-1)),l("b",null,f(d.harness?.thresholds?.semantic_degraded?"已降级(仅 tool/scope 两维)":"正常"),1)]),l("div",xp,[c[9]||(c[9]=l("span",null,"阻塞 / 警告",-1)),l("b",null,f(d.thought_chain?.blocked_nodes??0)+" / "+f(d.thought_chain?.warned_nodes??0),1)]),l("div",Cp,[c[10]||(c[10]=l("span",null,"影子轮次",-1)),l("b",null,f(d.harness?.thresholds?.run_count??0)+" / "+f(d.harness?.thresholds?.shadow_rounds??"—"),1)])])):N("",!0)]))),128))]),l("div",Sp,[m(t).info?(p(),h(F,{key:0},[c[11]||(c[11]=D(" 版本 ",-1)),l("code",null,f(m(t).info.version),1),c[12]||(c[12]=D(" · 数据目录 ",-1)),l("code",null,f(m(t).info.data_dir),1)],64)):N("",!0),c[13]||(c[13]=D(" 数据来自 ",-1)),c[14]||(c[14]=l("code",null,"/api/status",-1)),c[15]||(c[15]=D(" 与 ",-1)),c[16]||(c[16]=l("code",null,"/api/system/info",-1)),c[17]||(c[17]=D("。 ",-1))])]),_:1},8,["state","ready"]))}},Tp=Oe(Mp,[["__scopeId","data-v-ed4a5be6"]]),Ep={class:"pn-kpi"},Ap={key:0,class:"pn-st err"},Op={class:"pn-cols"},Ip={class:"pn-sec"},Pp={class:"pn-h"},Rp={key:0,class:"pn-empty"},Lp=["title"],Dp={class:"m"},Np={class:"s"},jp=["onClick"],Fp=["disabled","onClick"],Vp={key:0,class:"tk-test"},Up={key:0,class:"tip dim"},Hp=["onUpdate:modelValue","placeholder"],Bp={class:"fbar"},Kp=["disabled","onClick"],qp=["disabled","onClick"],Wp={key:1,class:"pn-note meta bad"},zp={class:"r-h"},Jp={key:0},Gp={key:0},Yp={class:"pn-sec"},Xp={class:"pn-h"},Qp={key:0,class:"pn-empty"},Zp=["onClick"],eh={class:"m"},th={class:"s"},sh=["disabled","title","onClick"],nh={class:"pn-sec"},lh={class:"pn-h"},oh={key:0,class:"tk-form"},ih={class:"frow"},rh={class:"f"},ah={class:"f"},uh={class:"f"},ch={class:"frow"},dh={class:"f"},fh={class:"f"},ph=["value"],hh={class:"f narrow"},gh={class:"f"},vh={class:"f"},mh={class:"frow"},_h={class:"f grow"},yh={class:"f narrow"},bh={class:"f"},kh={class:"chk"},$h={key:1,class:"frow"},wh={class:"f"},xh={class:"f"},Ch={class:"chk"},Sh={class:"chk"},Mh={class:"fbar"},Th=["disabled"],Eh=["disabled"],Ah={key:1,class:"tip bad"},Oh={key:2,class:"tip ok"},Ih={key:3,class:"tip dim"},Ph={key:1,class:"pn-note"},Rh={class:"pn-sec"},Lh={class:"pn-h"},Dh={key:0,class:"tk-form"},Nh={class:"frow"},jh={class:"f"},Fh={class:"f"},Vh={class:"f"},Uh={class:"frow"},Hh={class:"f narrow"},Bh={class:"f grow"},Kh={class:"fbar"},qh=["disabled"],Wh=["disabled"],zh={key:1,class:"tip bad"},Jh={key:2,class:"tip ok"},Gh={key:3,class:"tip dim"},Yh={key:1,class:"pn-empty"},Xh=["title"],Qh={class:"m"},Zh={class:"s"},eg=["disabled","onClick"],tg=["onClick"],sg={__name:"ToolsPanel",setup(e){const t=Be.tools,s=W(""),n=W(""),o=W([]);async function i(){try{const C=await oe("/ahs/mcp/servers");o.value=C.servers||[]}catch{o.value=[]}}Ae(()=>{rt("tools"),i()});const r=G(()=>t.skills.length>0||t.md.length>0||o.value.length>0),u=G(()=>t.skills.filter(C=>C.blocked).length+t.md.filter(C=>C.blocked).length),a=G(()=>Object.keys(t.breakers||{}).length),c={high:"green",medium:"amber",low:"red"},d=C=>({high:"高信任",medium:"中信任",low:"低信任"})[C]||C||"—";async function v(C){n.value="";try{await Af(C.id)}catch(g){n.value=String(g.message||g)}}async function k(C){s.value=C.id,n.value="";try{await Sf(C.id,!C.enabled)}catch(g){n.value=String(g.message||g)}s.value=""}const $=W(""),P=W({}),b=W(!1),A=W(null),E=W(""),M=W("");function I(){$.value="",P.value={},A.value=null,E.value="",M.value=""}function T(C){if($.value===C.id){I();return}const g={};for(const[y]of Object.entries(C.params||{}))g[y]="";$.value=C.id,P.value=g,A.value=null,E.value="",M.value="",n.value=""}function X(C,g){const y={};for(const[O,V]of Object.entries(C||{})){const U=String(g[O]??"").trim();if(U==="")continue;const H=String(V||"").toLowerCase();H.includes("bool")?y[O]=/^(1|true|yes|y|是)$/i.test(U):H.includes("float")||H.includes("number")?y[O]=Number(U):H.includes("int")?y[O]=parseInt(U,10)||0:y[O]=U}return y}async function ce(C,g=!1){if(!b.value){b.value=!0,E.value="";try{const y=await et(`/ahs/skills/${encodeURIComponent(C.id)}/test`,{args:X(C.params,P.value),confirmed:g,mode:"strict",confirm_nonce:g?M.value:""});A.value=y,M.value=y.confirm_nonce||""}catch(y){E.value=String(y.message||y)}finally{b.value=!1}}}const K=C=>{if(C==null)return"";if(typeof C=="string")return C;try{return JSON.stringify(C,null,2)}catch{return String(C)}};async function x(C){if(confirm(`删除技能「${C.name||C.id}」?它的触发词和参数会一起消失。`)){s.value=C.id,n.value="";try{await Xs(`/ahs/skills/${encodeURIComponent(C.id)}`),$.value===C.id&&I(),await We("tools"),await i()}catch(g){n.value=String(g.message||g)}finally{s.value=""}}}const S=C=>String(C||"").split(/[,,\s]+/).map(g=>g.trim()).filter(Boolean);function R(C){const g={};for(const y of String(C||"").split(/[,,;\n]/)){const O=y.search(/[::]/),V=(O<0?y:y.slice(0,O)).trim(),U=O<0?"":y.slice(O+1).trim();V&&(g[V]=U||"str")}return g}function z(C){const g={};for(const y of String(C||"").split(`
|
|
31
|
+
`)){const O=y.indexOf(":");O>0&&(g[y.slice(0,O).trim()]=y.slice(O+1).trim())}return g}const B={read:"read · 只读",write:"write · 写入",send:"send · 代发",pay:"pay · 付款"},re=W(!1),be=W(!1),Te=W(""),ke=W(""),ge=W(!1),pe=W("query:str"),at=W(""),te=Mt({id:"",name:"",description:"",kind:"web_api",side_effect:"read",endpoint:"",http_method:"GET",mcp_server:"",mcp_tool:"",triggers:"",timeout:10,destructive:!1,external:!0,allow_local:!1});function Et(){re.value=!re.value,Te.value="",ke.value="",ge.value=!1}async function Je(C=!1){if(be.value)return;const g=te.id.trim();if(Te.value="",ke.value="",!g){Te.value="技能 id 必填";return}be.value=!0;const y={id:g,name:(te.name||g).trim(),description:te.description.trim(),kind:te.kind,triggers:S(te.triggers),side_effect:te.side_effect,destructive:!!te.destructive,external:!!te.external,params:R(pe.value),endpoint:te.kind==="web_api"?te.endpoint.trim():"",http_method:te.http_method,http_headers:z(at.value),param_location:"auto",allow_local:!!te.allow_local,timeout:Number(te.timeout)||10,mcp_server:te.kind==="mcp"?te.mcp_server.trim():"",mcp_tool:te.kind==="mcp"?te.mcp_tool.trim():"",acknowledged:C};try{const O=await et("/ahs/skills",y),V=(O.warnings||[]).length?` · ${O.warnings.join(";")}`:"";ke.value=`${O.created?"已安装":"已更新"}「${y.name}」${V}`,ge.value=!1,Object.assign(te,{id:"",name:"",description:"",endpoint:"",triggers:"",mcp_server:"",mcp_tool:""}),await We("tools")}catch(O){Te.value=String(O.message||O),ge.value=!!(O.detail&&O.detail.needs_ack)}finally{be.value=!1}}const ss=W(!1),Xe=W(!1),ht=W(""),Ge=W(""),At=W(!1),Ie=Mt({id:"",name:"",url:"",transport:"streamable_http",headers:""});function ns(){ss.value=!ss.value,ht.value="",Ge.value="",At.value=!1}async function qn(C=!1){if(Xe.value)return;const g=Ie.id.trim();if(ht.value="",Ge.value="",!g||!Ie.url.trim()){ht.value="id 和 URL 都要填";return}Xe.value=!0;try{const y=await et("/ahs/mcp/servers",{id:g,name:Ie.name.trim()||g,url:Ie.url.trim(),headers:z(Ie.headers),transport:Ie.transport,acknowledged:C});Ge.value=`已接入 ${y.server?.name||g} · 注册 ${y.tools_registered??0} 个工具`,At.value=!1,Object.assign(Ie,{id:"",name:"",url:"",headers:""}),await i(),await We("tools")}catch(y){ht.value=String(y.message||y),At.value=!!(y.detail&&y.detail.needs_ack)}finally{Xe.value=!1}}async function _(C){if(!Xe.value){Xe.value=!0,ht.value="",Ge.value="";try{const g=await et(`/ahs/mcp/servers/${encodeURIComponent(C.id)}/refresh`,{});Ge.value=`已重连 ${C.name||C.id} · 现共 ${g.tools??0} 个工具`,await i(),await We("tools")}catch(g){ht.value=String(g.message||g)}finally{Xe.value=!1}}}async function w(C){if(confirm(`移除连接器「${C.name||C.id}」?它注册的 MCP 技能会一起删掉。`)){n.value="";try{const g=await Xs(`/ahs/mcp/servers/${encodeURIComponent(C.id)}`);await i(),await We("tools"),Ge.value=`已移除,连带删除 ${g.removed_skills??0} 个技能`}catch(g){n.value=String(g.message||g)}}}return(C,g)=>(p(),Re(Kt,{title:"技能",tag:"Tools",state:m(t).state,ready:r.value,onRefresh:g[25]||(g[25]=y=>{m(We)("tools"),i()})},{default:pt(()=>[l("div",Ep,[l("div",null,[l("b",null,f(m(t).skills.length+m(t).md.length),1),g[26]||(g[26]=l("span",null,"技能总数",-1))]),l("div",null,[l("b",null,f(m(t).skills.length),1),g[27]||(g[27]=l("span",null,"执行技能",-1))]),l("div",null,[l("b",null,f(m(t).md.length),1),g[28]||(g[28]=l("span",null,"指令技能",-1))]),l("div",null,[l("b",null,f(u.value),1),g[29]||(g[29]=l("span",null,"被封杀",-1))]),l("div",null,[l("b",null,f(a.value),1),g[30]||(g[30]=l("span",null,"熔断中",-1))])]),n.value?(p(),h("div",Ap,f(n.value),1)):N("",!0),l("div",Op,[l("div",Ip,[l("div",Pp,[g[31]||(g[31]=D("执行技能 ",-1)),l("em",null,f(m(t).skills.length),1)]),m(t).skills.length?N("",!0):(p(),h("div",Rp,"没有注册的执行技能。")),(p(!0),h(F,null,Y(m(t).skills,y=>(p(),h(F,{key:y.id},[l("div",{class:"pn-row",title:y.description},[l("span",Dp,[l("b",null,f(y.name||y.id),1),l("span",Np,[D(f(y.kind)+" · "+f(y.side_effect||"read"),1),y.source==="user"?(p(),h(F,{key:0},[D(" · 用户安装")],64)):N("",!0),y.blocked?(p(),h(F,{key:1},[D(" · 已封杀")],64)):N("",!0)])]),l("span",{class:se(["pn-tag",c[y.trust]||""])},f(d(y.trust)),3),l("button",{class:se(["mbtn",{on:$.value===y.id}]),onClick:O=>T(y)},f($.value===y.id?"收起":"测试"),11,jp),y.source!=="builtin"?(p(),h("button",{key:0,class:"mbtn danger",disabled:s.value===y.id,onClick:O=>x(y)}," 删除 ",8,Fp)):N("",!0)],8,Lp),$.value===y.id?(p(),h("div",Vp,[y.params&&Object.keys(y.params).length?N("",!0):(p(),h("div",Up," 该技能没有声明参数,直接运行即可。 ")),(p(!0),h(F,null,Y(y.params||{},(O,V)=>(p(),h("label",{key:V,class:"f"},[l("span",null,[D(f(V),1),l("em",null,f(O),1)]),ae(l("input",{"onUpdate:modelValue":U=>P.value[V]=U,placeholder:String(O||"str"),spellcheck:"false"},null,8,Hp),[[me,P.value[V]]])]))),128)),l("div",Bp,[l("button",{class:"go",disabled:b.value,onClick:O=>ce(y,!1)},f(b.value?"调用中…":"运行"),9,Kp),A.value&&A.value.status==="needs_confirmation"?(p(),h("button",{key:0,class:"go warn",disabled:b.value,onClick:O=>ce(y,!0)}," 确认并重跑 ",8,qp)):N("",!0),g[32]||(g[32]=l("span",{class:"tip dim"},"走真实权限 / 断路器 / SSRF 校验",-1))]),E.value?(p(),h("div",Wp,f(E.value),1)):N("",!0),A.value?(p(),h("div",{key:2,class:se(["tk-res",A.value.success?"ok":"bad"])},[l("div",zp,[l("b",null,f(A.value.status),1),A.value.message?(p(),h("span",Jp,f(A.value.message),1)):N("",!0)]),K(A.value.output)?(p(),h("pre",Gp,f(K(A.value.output)),1)):N("",!0)],2)):N("",!0)])):N("",!0)],64))),128))]),l("div",Yp,[l("div",Xp,[g[33]||(g[33]=D("指令技能 ",-1)),l("em",null,f(m(t).md.length),1)]),m(t).md.length?N("",!0):(p(),h("div",Qp,"没有 SKILL.md 指令技能。")),(p(!0),h(F,null,Y(m(t).md,y=>(p(),h("div",{key:y.id,class:"pn-row clickable",title:"点击查看 SKILL.md 正文",onClick:O=>v(y)},[l("span",eh,[l("b",null,f(y.name||y.id),1),l("span",th,f(m(lt)(y.description||"无描述",34)),1)]),l("span",{class:se(["pn-tag",c[y.trust]||""])},f(d(y.trust)),3),l("button",{class:se(["sw",{on:y.enabled}]),disabled:s.value===y.id,title:y.enabled?"点击停用":"点击启用",onClick:Ye(O=>k(y),["stop"])},f(y.enabled?"启用":"停用"),11,sh)],8,Zp))),128))])]),l("div",nh,[l("div",lh,[g[34]||(g[34]=D(" 安装技能 ",-1)),l("button",{class:"mbtn",onClick:Et},f(re.value?"收起":"+ 新增"),1)]),re.value?(p(),h("div",oh,[l("div",ih,[l("label",rh,[g[35]||(g[35]=l("span",null,"id",-1)),ae(l("input",{"onUpdate:modelValue":g[0]||(g[0]=y=>te.id=y),placeholder:"weather_query",spellcheck:"false"},null,512),[[me,te.id]])]),l("label",ah,[g[36]||(g[36]=l("span",null,"名称",-1)),ae(l("input",{"onUpdate:modelValue":g[1]||(g[1]=y=>te.name=y),placeholder:"查天气"},null,512),[[me,te.name]])])]),l("label",uh,[g[37]||(g[37]=l("span",null,"描述",-1)),ae(l("input",{"onUpdate:modelValue":g[2]||(g[2]=y=>te.description=y),placeholder:"给模型看的说明:能做什么,什么时候用"},null,512),[[me,te.description]])]),l("div",ch,[l("label",dh,[g[39]||(g[39]=l("span",null,"类型",-1)),ae(l("select",{"onUpdate:modelValue":g[3]||(g[3]=y=>te.kind=y)},[...g[38]||(g[38]=[l("option",{value:"web_api"},"web_api · HTTP 接口",-1),l("option",{value:"mcp"},"mcp · 已有 server 的工具",-1)])],512),[[Os,te.kind]])]),l("label",fh,[g[40]||(g[40]=l("span",null,"副作用",-1)),ae(l("select",{"onUpdate:modelValue":g[4]||(g[4]=y=>te.side_effect=y)},[(p(),h(F,null,Y(B,(y,O)=>l("option",{key:O,value:O},f(y),9,ph)),64))],512),[[Os,te.side_effect]])]),l("label",hh,[g[41]||(g[41]=l("span",null,"超时(s)",-1)),ae(l("input",{"onUpdate:modelValue":g[5]||(g[5]=y=>te.timeout=y),type:"number",min:"1",max:"120"},null,512),[[me,te.timeout,void 0,{number:!0}]])])]),l("label",gh,[g[42]||(g[42]=l("span",null,"触发词(逗号分隔)",-1)),ae(l("input",{"onUpdate:modelValue":g[6]||(g[6]=y=>te.triggers=y),placeholder:"天气, 气温, 下雨"},null,512),[[me,te.triggers]])]),l("label",vh,[g[43]||(g[43]=l("span",null,"参数(schema:名:类型)",-1)),ae(l("input",{"onUpdate:modelValue":g[7]||(g[7]=y=>pe.value=y),placeholder:"city:str, days:int",spellcheck:"false"},null,512),[[me,pe.value]])]),te.kind==="web_api"?(p(),h(F,{key:0},[l("div",mh,[l("label",_h,[g[44]||(g[44]=l("span",null,"endpoint",-1)),ae(l("input",{"onUpdate:modelValue":g[8]||(g[8]=y=>te.endpoint=y),placeholder:"https://api.example.com/weather",spellcheck:"false"},null,512),[[me,te.endpoint]])]),l("label",yh,[g[46]||(g[46]=l("span",null,"方法",-1)),ae(l("select",{"onUpdate:modelValue":g[9]||(g[9]=y=>te.http_method=y)},[...g[45]||(g[45]=[l("option",null,"GET",-1),l("option",null,"POST",-1)])],512),[[Os,te.http_method]])])]),l("label",bh,[g[47]||(g[47]=l("span",null,"请求头(每行 Key: Value)",-1)),ae(l("textarea",{"onUpdate:modelValue":g[10]||(g[10]=y=>at.value=y),rows:"2",spellcheck:"false",placeholder:"Authorization: Bearer xxx"},null,512),[[me,at.value]])]),l("label",kh,[ae(l("input",{"onUpdate:modelValue":g[11]||(g[11]=y=>te.allow_local=y),type:"checkbox"},null,512),[[il,te.allow_local]]),g[48]||(g[48]=D(" 允许访问内网 / 本机地址",-1))])],64)):(p(),h("div",$h,[l("label",wh,[g[49]||(g[49]=l("span",null,"MCP server",-1)),ae(l("input",{"onUpdate:modelValue":g[12]||(g[12]=y=>te.mcp_server=y),placeholder:"amap-maps",spellcheck:"false"},null,512),[[me,te.mcp_server]])]),l("label",xh,[g[50]||(g[50]=l("span",null,"工具名",-1)),ae(l("input",{"onUpdate:modelValue":g[13]||(g[13]=y=>te.mcp_tool=y),placeholder:"maps_direction",spellcheck:"false"},null,512),[[me,te.mcp_tool]])])])),l("label",Ch,[ae(l("input",{"onUpdate:modelValue":g[14]||(g[14]=y=>te.destructive=y),type:"checkbox"},null,512),[[il,te.destructive]]),g[51]||(g[51]=D(" 不可逆操作(删除 / 付款这类)",-1))]),l("label",Sh,[ae(l("input",{"onUpdate:modelValue":g[15]||(g[15]=y=>te.external=y),type:"checkbox"},null,512),[[il,te.external]]),g[52]||(g[52]=D(" 会调用外部服务(联网)",-1))]),l("div",Mh,[l("button",{class:"go",disabled:be.value,onClick:g[16]||(g[16]=y=>Je(!1))},f(be.value?"安装中…":"安装"),9,Th),ge.value?(p(),h("button",{key:0,class:"go warn",disabled:be.value,onClick:g[17]||(g[17]=y=>Je(!0))}," 已知风险,继续安装 ",8,Eh)):N("",!0),Te.value?(p(),h("span",Ah,f(Te.value),1)):ke.value?(p(),h("span",Oh,f(ke.value),1)):(p(),h("span",Ih,"同 id 覆盖更新;内置技能的 id 不可覆盖"))])])):(p(),h("div",Ph,[...g[53]||(g[53]=[D(" 只能装 ",-1),l("code",null,"web_api",-1),D(" 与 ",-1),l("code",null,"mcp",-1),D(" 两类 —— 本地代码技能不接受从界面安装。 ",-1)])]))]),l("div",Rh,[l("div",Lh,[g[54]||(g[54]=D(" 连接器 ",-1)),l("em",null,f(o.value.length),1),l("button",{class:"mbtn",onClick:ns},f(ss.value?"收起":"+ 接入"),1)]),ss.value?(p(),h("div",Dh,[l("div",Nh,[l("label",jh,[g[55]||(g[55]=l("span",null,"id",-1)),ae(l("input",{"onUpdate:modelValue":g[18]||(g[18]=y=>Ie.id=y),placeholder:"my-notes",spellcheck:"false"},null,512),[[me,Ie.id]])]),l("label",Fh,[g[56]||(g[56]=l("span",null,"显示名",-1)),ae(l("input",{"onUpdate:modelValue":g[19]||(g[19]=y=>Ie.name=y),placeholder:"我的备忘录"},null,512),[[me,Ie.name]])])]),l("label",Vh,[g[57]||(g[57]=l("span",null,"URL",-1)),ae(l("input",{"onUpdate:modelValue":g[20]||(g[20]=y=>Ie.url=y),placeholder:"https://example.com/mcp",spellcheck:"false"},null,512),[[me,Ie.url]])]),l("div",Uh,[l("label",Hh,[g[59]||(g[59]=l("span",null,"传输",-1)),ae(l("select",{"onUpdate:modelValue":g[21]||(g[21]=y=>Ie.transport=y)},[...g[58]||(g[58]=[l("option",{value:"streamable_http"},"streamable_http",-1),l("option",{value:"sse"},"sse",-1)])],512),[[Os,Ie.transport]])]),l("label",Bh,[g[60]||(g[60]=l("span",null,"请求头(每行 Key: Value)",-1)),ae(l("textarea",{"onUpdate:modelValue":g[22]||(g[22]=y=>Ie.headers=y),rows:"2",spellcheck:"false",placeholder:"Authorization: Bearer xxx"},null,512),[[me,Ie.headers]])])]),l("div",Kh,[l("button",{class:"go",disabled:Xe.value,onClick:g[23]||(g[23]=y=>qn(!1))},f(Xe.value?"连接中…":"接入"),9,qh),At.value?(p(),h("button",{key:0,class:"go warn",disabled:Xe.value,onClick:g[24]||(g[24]=y=>qn(!0))}," 已知风险,继续 ",8,Wh)):N("",!0),ht.value?(p(),h("span",zh,f(ht.value),1)):Ge.value?(p(),h("span",Jh,f(Ge.value),1)):(p(),h("span",Gh,"接入后会连一次,把它暴露的工具注册成技能"))])])):N("",!0),o.value.length?N("",!0):(p(),h("div",Yh," 还没接入外部应用。邮箱、你自己的另一个知识库这类需要授权的,会作为 MCP 服务出现在这一节。 ")),(p(!0),h(F,null,Y(o.value,y=>(p(),h("div",{key:y.id,class:"pn-row",title:y.url},[l("span",Qh,[l("b",null,f(y.name||y.id),1),l("span",Zh,[D(f(y.tool_count??0)+" 个工具",1),y.transport?(p(),h(F,{key:0},[D(" · "+f(y.transport),1)],64)):N("",!0)])]),l("button",{class:"mbtn",disabled:Xe.value,onClick:O=>_(y)},"重连",8,eg),l("button",{class:"mbtn danger",onClick:O=>w(y)},"移除",8,tg)],8,Xh))),128))]),g[61]||(g[61]=l("div",{class:"pn-note"},[D(" 指令技能正文 "),l("code",null,"/api/ahs/md-skills/{id}"),D(",执行技能运行 "),l("code",null,"POST /api/ahs/skills/{id}/test"),D("; 连接器与技能面板是同一份数据("),l("code",null,"/api/ahs/mcp/servers"),D(")。 ")],-1))]),_:1},8,["state","ready"]))}},ng=Oe(sg,[["__scopeId","data-v-b744f6ab"]]),lg={class:"pn-kpi"},og={key:0,class:"pn-st err"},ig={class:"pn-cols"},rg={class:"pn-sec"},ag={class:"pn-h"},ug={key:0,class:"pn-empty"},cg={class:"m"},dg={class:"s"},fg={class:"r"},pg={class:"pn-sec"},hg={class:"pn-h"},gg={key:0,class:"pn-empty"},vg={class:"m"},mg={class:"s"},_g={class:"r"},yg={class:"m"},bg={class:"s"},kg={class:"r"},$g={class:"pn-sec"},wg={class:"pn-h"},xg={key:0,class:"pn-empty"},Cg=["title"],Sg={class:"m"},Mg={class:"s"},Tg={class:"r"},Eg={class:"pn-sec acts"},Ag={class:"hint"},Og={__name:"UsagePanel",setup(e){const t=Be.usage,s=W("");Ae(()=>rt("usage"));const n=G(()=>!!t.tokens||Object.keys(t.gateway||{}).length>0),o=G(()=>t.tokens?.summary||{}),i=G(()=>Object.entries(t.tokens?.by_agent||{})),r=G(()=>Object.entries(t.tokens?.by_provider||{})),u=G(()=>Object.entries(t.metrics?.llm||{})),a=G(()=>Math.round((t.metrics?.uptime_s||0)/3600));async function c(){s.value="";try{await Pf()}catch(d){s.value=String(d.message||d)}}return(d,v)=>(p(),Re(Kt,{title:"使用情况",tag:"Usage",state:m(t).state,ready:n.value,onRefresh:v[0]||(v[0]=k=>m(We)("usage"))},{default:pt(()=>[l("div",lg,[l("div",null,[l("b",null,f(m(we)(o.value.total_tokens??0)),1),v[1]||(v[1]=l("span",null,"总 token",-1))]),l("div",null,[l("b",null,f(m(we)(o.value.calls??0)),1),v[2]||(v[2]=l("span",null,"调用次数",-1))]),l("div",null,[l("b",null,f(m(we)(Math.round(o.value.avg_tokens_per_call??0))),1),v[3]||(v[3]=l("span",null,"平均 / 次",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).gateway.rejected_total??0)),1),v[4]||(v[4]=l("span",null,"网关拒绝",-1))]),l("div",null,[l("b",null,f(a.value)+"h",1),v[5]||(v[5]=l("span",null,"已运行",-1))])]),s.value?(p(),h("div",og,f(s.value),1)):N("",!0),l("div",ig,[l("div",rg,[l("div",ag,[v[6]||(v[6]=D("按 Agent ",-1)),l("em",null,f(i.value.length),1)]),i.value.length?N("",!0):(p(),h("div",ug,"还没有 token 消耗记录。")),(p(!0),h(F,null,Y(i.value,([k,$])=>(p(),h("div",{key:k,class:"pn-row"},[l("span",cg,[l("b",null,f(k),1),l("span",dg,"输入 "+f(m(we)($.input_tokens))+" · 输出 "+f(m(we)($.output_tokens)),1)]),l("span",fg,f(m(we)($.total_tokens)),1)]))),128))]),l("div",pg,[l("div",hg,[v[7]||(v[7]=D("按 provider ",-1)),l("em",null,f(r.value.length),1)]),r.value.length?N("",!0):(p(),h("div",gg,"还没有 provider 记录。")),(p(!0),h(F,null,Y(r.value,([k,$])=>(p(),h("div",{key:k,class:"pn-row"},[l("span",vg,[l("b",null,f(k),1),l("span",mg,f($.calls)+" 次调用",1)]),l("span",_g,f(m(we)($.total_tokens)),1)]))),128)),(p(!0),h(F,null,Y(u.value,([k,$])=>(p(),h("div",{key:"llm-"+k,class:"pn-row"},[l("span",yg,[l("b",null,f(k)+" 延迟",1),l("span",bg,"p50 "+f(m(Ps)($.p50_ms))+" · p95 "+f(m(Ps)($.p95_ms))+" · 错误率 "+f(Math.round(($.error_rate||0)*100))+"%",1)]),l("span",kg,f($.count)+" 次",1)]))),128))])]),l("div",$g,[l("div",wg,[v[8]||(v[8]=D("最慢端点 p95 ",-1)),l("em",null,f(m(t).slow.length),1)]),m(t).slow.length?N("",!0):(p(),h("div",xg,"还没有端点耗时统计。")),(p(!0),h(F,null,Y(m(t).slow,k=>(p(),h("div",{key:k.name,class:"pn-row",title:k.name},[l("span",Sg,[l("b",null,f(m(lt)(k.name,46)),1),l("span",Mg,f(k.count)+" 次 · 错误 "+f(k.errors)+" · 平均 "+f(m(Ps)(k.avg_ms)),1)]),l("span",Tg,f(m(Ps)(k.p95_ms)),1)],8,Cg))),128))]),l("div",Eg,[l("button",{class:"btn",onClick:c},"在中间舞台打开完整报告"),l("span",Ag,"网关 "+f(m(t).gateway.enabled?"已启用":"未启用")+" · "+f(m(t).gateway.rate_per_min??"—")+"/分 · 配额 "+f(m(we)(m(t).gateway.quota_per_hour??0))+"/时 ",1)])]),_:1},8,["state","ready"]))}},Ig=Oe(Og,[["__scopeId","data-v-1a916225"]]),Pg={class:"kb-in"},Rg=["onKeydown"],Lg={class:"kb-bar"},Dg={key:0,class:"tip"},Ng={key:1,class:"tip ok"},jg={key:2,class:"tip bad"},Fg={key:3,class:"tip dim"},Vg=["disabled"],Ug={class:"pn-kpi"},Hg={class:"pn-sec"},Bg={class:"pn-h"},Kg={class:"kb-find"},qg=["value"],Wg=["disabled"],zg={key:0,class:"pn-note meta bad"},Jg={key:1,class:"kb-hits"},Gg=["title","onClick"],Yg={class:"m"},Xg={class:"s"},Qg={class:"r"},Zg={key:2,class:"pn-empty"},ev={class:"pn-sec"},tv={class:"pn-h"},sv={key:0,class:"pn-empty"},nv=["title","onClick"],lv={class:"m"},ov={class:"s"},iv={class:"r"},rv={class:"pn-cols"},av={class:"pn-sec"},uv={class:"pn-h"},cv={class:"pn-row"},dv={class:"m"},fv={class:"s"},pv={class:"pn-note meta"},hv={class:"pn-sec"},gv={class:"pn-h"},vv={key:0,class:"pn-empty"},mv={class:"m"},_v={class:"r"},yv={class:"pn-h sec-gap"},bv={key:1,class:"pn-empty"},kv=["title"],$v={class:"m"},wv={class:"s"},xv={class:"pn-sec"},Cv={class:"pn-h"},Sv={key:0,class:"pn-empty"},Mv={key:1,class:"pn-chips"},Tv=["onClick"],Ev={key:2,class:"pn-note meta"},Av={key:3,class:"pn-note meta bad"},Ov={key:4,class:"kb-ab"},Iv={key:0,class:"pn-note meta"},Pv={class:"kb-ab-h"},Rv={class:"pn-note meta"},Lv={key:0,class:"pn-chips gap"},Dv={class:"kb-ab-h"},Nv={class:"v"},jv={class:"pn-note meta"},Fv={class:"m"},Vv={class:"s"},Uv={class:"r"},Hv={class:"m"},Bv={__name:"KnowledgePanel",setup(e){const t=Be.knowledge;Ae(()=>rt("knowledge"));const s=W(""),n=W(""),o=W(""),i=G(()=>Object.keys(t.stats||{}).length>0),r=G(()=>t.index||{}),u=G(()=>Object.entries(t.stats?.ku_counts||{})),a=G(()=>t.ingest==="busy");hs(s,K=>{K&&!a.value&&(t.ingest="idle",t.ingestMsg="",t.ingestErr="")});async function c(){if(!(!s.value.trim()||a.value))try{await pr({text:s.value,title:n.value,domain:o.value}),s.value="",n.value=""}catch{}}const d=W(""),v=W("hybrid"),k=[{v:"hybrid",label:"混合"},{v:"bm25",label:"关键词"},{v:"vector",label:"语义"},{v:"graph",label:"图谱"}],$=W("idle"),P=W(""),b=W([]);async function A(){const K=d.value.trim();if(!(!K||$.value==="busy")){$.value="busy",P.value="";try{const x=await et("/knowledge/search",{query:K,mode:v.value,top_k:12});b.value=x.hits||[],x.available===!1?($.value="err",P.value="HKC 未启用(未 vendor 或缺依赖)"):x.error?($.value="err",P.value=x.error):$.value="ok"}catch(x){b.value=[],$.value="err",P.value=x.message}}}const E=W(""),M=W("idle"),I=W(""),T=W(null);async function X(K){if(E.value===K&&T.value){E.value="",T.value=null,M.value="idle";return}E.value=K,M.value="busy",I.value="",T.value=null;try{T.value=await oe(`/knowledge/ability/${encodeURIComponent(K)}`),M.value="ok"}catch(x){M.value="err",I.value=x.message}}function ce(K){if(K==null)return"";if(typeof K=="number")return`${Math.round(K*100)}%`;if(typeof K=="object"){const x=K.overall??K.score??K.value??K.ratio;if(typeof x=="number")return`${Math.round(x*100)}%`}return""}return(K,x)=>(p(),Re(Kt,{title:"学习库",tag:"Knowledge",state:m(t).state,ready:i.value,onRefresh:x[5]||(x[5]=S=>m(We)("knowledge"))},{default:pt(()=>[l("div",Pg,[ae(l("textarea",{"onUpdate:modelValue":x[0]||(x[0]=S=>s.value=S),rows:"3",spellcheck:"false",placeholder:"写一句或一小段知识 —— 一句话也算。长文档、整本书走知识星球。",onKeydown:Ys(Ye(c,["ctrl","prevent"]),["enter"])},null,40,Rg),[[me,s.value]]),l("div",Lg,[ae(l("input",{"onUpdate:modelValue":x[1]||(x[1]=S=>n.value=S),class:"f-title",placeholder:"标题(可选)"},null,512),[[me,n.value]]),ae(l("input",{"onUpdate:modelValue":x[2]||(x[2]=S=>o.value=S),class:"f-domain",placeholder:"领域(可选)"},null,512),[[me,o.value]]),a.value?(p(),h("span",Dg,"抽取中,可能要几十秒…")):m(t).ingest==="ok"?(p(),h("span",Ng,f(m(t).ingestMsg),1)):m(t).ingest==="error"?(p(),h("span",jg,f(m(t).ingestErr),1)):(p(),h("span",Fg,"Ctrl + Enter 收录")),l("button",{class:"go",disabled:!s.value.trim()||a.value,onClick:c},f(a.value?"收录中…":"收录"),9,Vg)])]),l("div",Ug,[l("div",null,[l("b",null,f(m(we)(m(t).stats.total_kus??0)),1),x[6]||(x[6]=l("span",null,"知识单元",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).stats.total_relations??0)),1),x[7]||(x[7]=l("span",null,"关系",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).stats.graph_nodes??0)),1),x[8]||(x[8]=l("span",null,"图谱节点",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).stats.open_conflicts??0)),1),x[9]||(x[9]=l("span",null,"待裁决冲突",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).stats.vector_size??0)),1),x[10]||(x[10]=l("span",null,"向量条目",-1))])]),l("div",Hg,[l("div",Bg,[x[11]||(x[11]=D("检索 ",-1)),l("em",null,f(b.value.length),1)]),l("div",Kg,[ae(l("input",{"onUpdate:modelValue":x[3]||(x[3]=S=>d.value=S),placeholder:"按关键词 / 语义检索整个知识库…",onKeydown:Ys(A,["enter"])},null,544),[[me,d.value]]),ae(l("select",{"onUpdate:modelValue":x[4]||(x[4]=S=>v.value=S),"aria-label":"检索模式"},[(p(),h(F,null,Y(k,S=>l("option",{key:S.v,value:S.v},f(S.label),9,qg)),64))],512),[[Os,v.value]]),l("button",{class:"go",disabled:!d.value.trim()||$.value==="busy",onClick:A},f($.value==="busy"?"检索中…":"检索"),9,Wg)]),$.value==="err"?(p(),h("div",zg,f(P.value),1)):b.value.length?(p(),h("div",Jg,[(p(!0),h(F,null,Y(b.value,S=>(p(),h("button",{key:S.ku_id,class:"kb-hit",title:S.summary||S.name,onClick:R=>m(Qs)(S.ku_id)},[l("span",Yg,[l("b",null,f(m(lt)(S.name||S.ku_id,52)),1),l("span",Xg,f(S.ku_type||"KU")+" · "+f(S.mode||v.value),1)]),l("span",Qg,f(S.score!=null?Number(S.score).toFixed(2):""),1)],8,Gg))),128))])):$.value==="ok"?(p(),h("div",Zg,"没有命中,换个词或换模式试试。")):N("",!0)]),l("div",ev,[l("div",tv,[x[12]||(x[12]=D("最近录入 ",-1)),l("em",null,f(m(t).recentTotal),1)]),m(t).recent.length?N("",!0):(p(),h("div",sv," 还没有录入知识。上面写一句话就能收录 —— 长文档走知识星球。 ")),(p(!0),h(F,null,Y(m(t).recent,S=>(p(),h("div",{key:S.ku_id,class:"pn-row clickable",title:S.summary||S.name,onClick:R=>m(Qs)(S.ku_id)},[l("span",lv,[l("b",null,f(m(lt)(S.name||S.ku_id,46)),1),l("span",ov,f(S.ku_type)+" · "+f(S.domain||"未分域"),1)]),l("span",iv,f(m(Cn)(S.created_at)),1)],8,nv))),128))]),l("div",rv,[l("div",av,[l("div",uv,[x[13]||(x[13]=D("索引状态 ",-1)),l("em",null,f(r.value.index_state||"—"),1)]),l("div",cv,[l("span",dv,[l("b",null,f(r.value.index_state==="ready"?"索引就绪":"索引"+(r.value.index_state||"未知")),1),l("span",fv," 扫描 "+f(m(we)(r.value.scanned??0))+" · 就绪 "+f(m(we)(r.value.ready??0))+" · 待处理 "+f(m(we)(r.value.pending??0))+" · 失败 "+f(m(we)(r.value.failed??0)),1)]),l("span",{class:se(["pn-tag",r.value.index_state==="ready"?"green":"amber"])},f(r.value.index_version||"v—"),3)]),l("div",pv,[x[14]||(x[14]=D(" 向量模型 ",-1)),l("code",null,f(m(t).stats.embedding||"未知"),1),x[15]||(x[15]=l("br",null,null,-1)),D(" BM25 "+f(m(we)(m(t).stats.bm25_size??0))+" · 向量 "+f(m(we)(m(t).stats.vector_size??0)),1),x[16]||(x[16]=l("br",null,null,-1)),x[17]||(x[17]=D(" 数据目录 ",-1)),l("code",null,f(m(t).stats.data_dir||"—"),1)])]),l("div",hv,[l("div",gv,[x[18]||(x[18]=D("按知识域 ",-1)),l("em",null,f(u.value.length),1)]),u.value.length?N("",!0):(p(),h("div",vv,"摄入资料后,这里按知识域统计条目数。")),(p(!0),h(F,null,Y(u.value,([S,R])=>(p(),h("div",{key:S,class:"pn-row"},[l("span",mv,[l("b",null,f(S),1)]),l("span",_v,f(R),1)]))),128)),l("div",yv,[x[19]||(x[19]=D("书籍来源 ",-1)),l("em",null,f(m(t).sources.length),1)]),m(t).sources.length?N("",!0):(p(),h("div",bv," 还没有整本摄入的资料。PDF / EPUB 走知识星球导入。 ")),(p(!0),h(F,null,Y(m(t).sources.slice(0,8),(S,R)=>(p(),h("div",{key:R,class:"pn-row",title:S.name||S.source},[l("span",$v,[l("b",null,f(m(lt)(S.name||S.source||"未命名资料",34)),1),l("span",wv,f(S.year||"年份未知"),1)])],8,kv))),128))])]),l("div",xv,[l("div",Cv,[x[20]||(x[20]=D("能力清单 ",-1)),l("em",null,f(m(t).abilities.length),1)]),m(t).abilities.length?(p(),h("div",Mv,[(p(!0),h(F,null,Y(m(t).abilities,S=>(p(),h("button",{key:S,class:se(["pn-chip",{on:E.value===S}]),onClick:R=>X(S)},f(S),11,Tv))),128))])):(p(),h("div",Sv,"后端没有返回能力清单。")),M.value==="busy"?(p(),h("div",Ev,"编译中…")):M.value==="err"?(p(),h("div",Av,"编译失败:"+f(I.value),1)):T.value?(p(),h("div",Ov,[T.value.available===!1?(p(),h("div",Iv,"HKC 未启用,无法编译能力。")):T.value.sufficient===!1?(p(),h(F,{key:1},[l("div",Pv,[D(f(E.value),1),x[21]||(x[21]=l("span",{class:"v"},"知识不足",-1))]),l("div",Rv,f(T.value.reason||"覆盖不足,暂不授予该能力。"),1),(T.value.missing_skills||[]).length?(p(),h("div",Lv,[(p(!0),h(F,null,Y(T.value.missing_skills,S=>(p(),h("span",{key:S,class:"pn-chip warn"},f(S),1))),128))])):N("",!0)],64)):T.value.ability?(p(),h(F,{key:2},[l("div",Dv,[D(f(T.value.ability.display_name||E.value)+" ",1),l("span",Nv,f(T.value.ability.version||""),1)]),l("div",jv,f(T.value.ability.domain||"未分域")+" · 覆盖 "+f(ce(T.value.ability.coverage)||"—"),1),(p(!0),h(F,null,Y(T.value.ability.skills||[],S=>(p(),h("div",{key:S.skill_key,class:"pn-row"},[l("span",Fv,[l("b",null,f(S.display_name||S.skill_key),1),l("span",Vv,f(S.concept_hits??0)+" 个概念命中",1)]),l("span",Uv,f(ce(S.coverage)),1)]))),128)),(p(!0),h(F,null,Y(T.value.ability.workflows||[],(S,R)=>(p(),h("div",{key:"w"+R,class:"pn-row"},[l("span",Hv,[l("b",null,f(S),1)])]))),128))],64)):N("",!0)])):N("",!0)]),x[22]||(x[22]=l("div",{class:"pn-note"},[D(" 录入走 "),l("code",null,"POST /api/knowledge/ingest"),D("(KDE 抽取 → KEE 演化), 列表读 "),l("code",null,"/api/knowledge/recent"),D(";书籍走知识星球。 ")],-1))]),_:1},8,["state","ready"]))}},Kv=Oe(Bv,[["__scopeId","data-v-6d319f83"]]),qv={class:"pn-kpi"},Wv={class:"rv-grid"},zv={class:"pn-h"},Jv={key:0},Gv={key:1},Yv={key:0,class:"card"},Xv={class:"ct"},Qv={class:"pn-tag"},Zv={class:"dim"},e1={key:0,class:"pn-tag new"},t1={key:1,class:"dim"},s1={key:0,class:"sum"},n1={key:1,class:"src"},l1={class:"grades"},o1={key:2,class:"err"},i1={key:1,class:"done"},r1={key:0},a1={key:2,class:"idle"},u1={key:0},c1={key:1,class:"dim"},d1={key:2,class:"dim"},f1={class:"side"},p1=["viewBox"],h1=["y1","y2"],g1=["d"],v1=["cx","cy"],m1={class:"axis"},_1={class:"dim"},y1={class:"pn-h",style:{"margin-top":"16px"}},b1={class:"load"},k1=["onClick"],$1={class:"m"},w1={class:"s"},cn=620,as=130,Ms=30,x1={__name:"ReviewPanel",setup(e){const t=Be.review,s=W("");Ae(()=>rt("review"));const n=G(()=>t.stats||{}),o=G(()=>t.queue[t.index]||null),i=G(()=>t.queue.length),r=G(()=>Math.min(t.index+1,i.value)),u=G(()=>Math.round((n.value.avg_mastery||0)*100)),a=G(()=>(n.value.due||0)+(n.value.fresh||0)),c=G(()=>{const P=o.value,b=P?.interval||0,A=P?.ease_factor||2.5,E=b>0?9.49*b*(A/2.5):1.2,M=[];for(let X=0;X<=Ms;X+=.5){const ce=Math.exp(-X/E);M.push(`${(X/Ms*cn).toFixed(1)},${(as-ce*as).toFixed(1)}`)}const I=P?.days_until_due??0,T=b>0&&I<=Ms;return{path:`M${M.join(" L")}`,s:E,due:T?{x:I/Ms*cn,y:as-Math.exp(-I/E)*as}:null,now:{x:0,y:0}}}),d=G(()=>{const P=o.value;if(!P||!P.interval)return"新卡:曲线是「不复习就忘」的示意";const b=P.due_in_hours||0,A=b<=0?"已到期":b<24?`${Math.round(b)} 小时后`:`${P.days_until_due} 天后`;return`S≈${c.value.s.toFixed(1)} 天 · 下次 ${A}`}),v=G(()=>{const P=n.value.load7?.by_day||{};return Array.from({length:7},(b,A)=>({d:A,n:P[A]??P[String(A)]??0}))}),k=G(()=>Math.max(1,...v.value.map(P=>P.n)));async function $(P){s.value="";try{await Tf(P)}catch(b){s.value=String(b?.message||b)}}return(P,b)=>(p(),Re(Kt,{title:"复习",tag:"SM-2",state:m(t).state,ready:m(t).state==="ok",onRefresh:b[7]||(b[7]=A=>m(We)("review"))},{default:pt(()=>[l("div",qv,[l("div",null,[l("b",null,f(n.value.cards),1),b[8]||(b[8]=l("span",null,"复习卡",-1))]),l("div",null,[l("b",null,f(n.value.due),1),b[9]||(b[9]=l("span",null,"今日到期",-1))]),l("div",null,[l("b",null,f(n.value.fresh),1),b[10]||(b[10]=l("span",null,"新卡",-1))]),l("div",null,[l("b",null,f(u.value)+"%",1),b[11]||(b[11]=l("span",null,"平均掌握",-1))])]),l("div",Wv,[l("section",null,[l("div",zv,[b[12]||(b[12]=D(" 学习卡 ",-1)),m(t).session==="running"?(p(),h("em",Jv,f(r.value)+" / "+f(i.value),1)):(p(),h("em",Gv,"队列 "+f(i.value)+" 张",1))]),m(t).session==="running"&&o.value?(p(),h("div",Yv,[l("div",Xv,[l("span",Qv,f(o.value.ku_type),1),l("span",Zv,f(o.value.domain||"未分域"),1),o.value.is_new?(p(),h("span",e1,"新卡")):(p(),h("span",t1,"第 "+f((o.value.repetitions||0)+1)+" 次",1))]),l("h3",null,f(o.value.name),1),m(t).revealed?(p(),h(F,{key:0},[o.value.summary&&o.value.summary!==o.value.name?(p(),h("p",s1,f(o.value.summary),1)):N("",!0),o.value.text?(p(),h("p",n1,f(o.value.text),1)):N("",!0),l("div",l1,[l("button",{class:"g g0",onClick:b[0]||(b[0]=A=>$(0))},[...b[13]||(b[13]=[D("忘记",-1),l("span",null,"重新开始",-1)])]),l("button",{class:"g g3",onClick:b[1]||(b[1]=A=>$(3))},[...b[14]||(b[14]=[D("模糊",-1),l("span",null,"间隔不涨",-1)])]),l("button",{class:"g g4",onClick:b[2]||(b[2]=A=>$(4))},[...b[15]||(b[15]=[D("记得",-1),l("span",null,"正常推进",-1)])]),l("button",{class:"g g5",onClick:b[3]||(b[3]=A=>$(5))},[...b[16]||(b[16]=[D("轻松",-1),l("span",null,"EF +0.1",-1)])])])],64)):(p(),h(F,{key:1},[b[17]||(b[17]=l("p",{class:"hint"},"先在心里回想一遍,再显示答案。凭印象评分,不要凭「刚才看过」。",-1)),l("button",{class:"act",onClick:b[4]||(b[4]=A=>m(Mf)())},"显示答案")],64)),s.value?(p(),h("p",o1,f(s.value),1)):N("",!0)])):m(t).session==="done"?(p(),h("div",i1,[b[18]||(b[18]=l("b",null,"这一轮过完了",-1)),m(t).lastMsg?(p(),h("p",r1,f(m(t).lastMsg),1)):N("",!0),b[19]||(b[19]=l("p",{class:"dim"},"下一轮按 SM-2 排期,到期的会重新出现在这里。",-1)),l("button",{class:"act",onClick:b[5]||(b[5]=A=>m(xl)())},"再来一轮")])):(p(),h("div",a1,[a.value?(p(),h("p",u1,[b[20]||(b[20]=D(" 今日待办:",-1)),l("b",null,f(n.value.due),1),b[21]||(b[21]=D(" 张到期 + ",-1)),l("b",null,f(n.value.fresh),1),b[22]||(b[22]=D(" 张新卡 ",-1))])):n.value.cards?(p(),h("p",d1,"今天的卡都过完了。明天再来,间隔会按 SM-2 自然拉长。")):(p(),h("p",c1," 还没有复习卡。在右栏上部或学习库录一句知识,抽取出的知识单元会自动变成卡。 ")),a.value?(p(),h("button",{key:3,class:"act",onClick:b[6]||(b[6]=A=>m(xl)())}," 开始复习 "+f(Math.min(a.value,20))+" 张 ",1)):N("",!0)]))]),l("aside",f1,[b[26]||(b[26]=l("div",{class:"pn-h"},[D("遗忘曲线 "),l("em",null,"R = e^(−t/S)")],-1)),(p(),h("svg",{class:"curve",viewBox:`0 0 ${cn} ${as}`,preserveAspectRatio:"none"},[l("line",{class:"ref",x1:"0",y1:as*.1,x2:cn,y2:as*.1},null,8,h1),l("path",{class:"line",d:c.value.path},null,8,g1),c.value.due?(p(),h("circle",{key:0,class:"dot",cx:c.value.due.x,cy:c.value.due.y,r:"4"},null,8,v1)):N("",!0)],8,p1)),l("div",m1,[b[23]||(b[23]=l("span",null,"今天",-1)),l("span",_1,f(d.value),1),l("span",null,"+"+f(Ms)+" 天")]),b[27]||(b[27]=l("p",{class:"note"}," 排期规则:答「忘记」重置为 1 天;答「记得 / 轻松」按 1 → 6 → 16 天递进, EF 每次 ±0.1 微调,间隔随熟练度拉长。 ",-1)),b[28]||(b[28]=l("p",{class:"note warn"}," 进度存在知识单元自身,和知识星球共用同一个库。所以在星球里「按来源删除」删掉的 卡片,进度会一起消失;清库接口会清空全部知识与进度。 ",-1)),l("div",y1,[b[24]||(b[24]=D(" 未来 7 天 ",-1)),l("em",null,f(n.value.load7?.total_due||0)+" 张",1)]),l("div",b1,[(p(!0),h(F,null,Y(v.value,A=>(p(),h("div",{key:A.d,class:"bar"},[l("i",{style:xt({height:`${Math.max(2,A.n/k.value*34)}px`}),class:se({zero:!A.n})},null,6),l("span",null,f(A.d===0?"今":`+${A.d}`),1),l("em",null,f(A.n),1)]))),128))]),n.value.risk?.length?(p(),h(F,{key:0},[b[25]||(b[25]=l("div",{class:"pn-h",style:{"margin-top":"16px"}},"遗忘风险",-1)),(p(!0),h(F,null,Y(n.value.risk,A=>(p(),h("button",{key:A.item_id,class:"pn-row clickable",onClick:E=>m(Qs)(A.item_id)},[l("span",$1,[l("b",null,f(A.name||A.item_id),1),l("span",w1,f(A.reason),1)])],8,k1))),128))],64)):N("",!0)])])]),_:1},8,["state","ready"]))}},C1=Oe(x1,[["__scopeId","data-v-473d3e36"]]),S1={class:"pn-kpi"},M1={key:0,class:"pn-st err"},T1={class:"pn-cols"},E1={class:"pn-sec"},A1={class:"pn-h"},O1={key:0,class:"pn-empty"},I1=["onClick"],P1={class:"m"},R1={class:"s"},L1={key:0,class:"pn-tag"},D1={class:"r"},N1={class:"pn-sec"},j1={class:"pn-h"},F1={key:0,class:"pn-empty"},V1={class:"m"},U1={class:"r"},H1={class:"pn-h sec-gap"},B1={key:1,class:"pn-empty"},K1={class:"m"},q1={class:"s"},W1=["disabled","onClick"],z1={class:"pn-note"},J1={__name:"MemoryPanel",setup(e){const t=Be.memory,s=W(""),n=W("");Ae(()=>rt("memory"));const o=G(()=>!!t.stats.backend),i=G(()=>Object.entries(t.stats.by_agent||{}));function r(a){Un({id:`mem:${a.id}`,kind:"text",lang:"markdown",title:a.title||a.id,path:`memory/${a.id}.md`,meta:`${a.type||"记忆"} · ${a.agent||"—"} · ${Cn(a.created_at)}`,content:a.summary||"(无摘要)"})}async function u(a){n.value=a.id,s.value="";try{await Ef(a.id)}catch(c){s.value=String(c.message||c)}n.value=""}return(a,c)=>(p(),Re(Kt,{title:"记忆中心",tag:"Memory",state:m(t).state,ready:o.value,onRefresh:c[0]||(c[0]=d=>m(We)("memory"))},{default:pt(()=>[l("div",S1,[l("div",null,[l("b",null,f(m(we)(m(t).stats.total_memories??0)),1),c[1]||(c[1]=l("span",null,"记忆条目",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).stats.relations??0)),1),c[2]||(c[2]=l("span",null,"关联",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).stats.shared??0)),1),c[3]||(c[3]=l("span",null,"共享",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).stats.private??0)),1),c[4]||(c[4]=l("span",null,"私有",-1))]),l("div",null,[l("b",null,f(m(we)(m(t).prefs.length)),1),c[5]||(c[5]=l("span",null,"用户偏好",-1))])]),s.value?(p(),h("div",M1,f(s.value),1)):N("",!0),l("div",T1,[l("div",E1,[l("div",A1,[c[6]||(c[6]=D("最近记忆 ",-1)),l("em",null,f(m(t).recent.length),1)]),m(t).recent.length?N("",!0):(p(),h("div",O1," 还没有记忆。聊过的内容会被 HMR 提炼成记忆条目,这里能看到最新的几条。 ")),(p(!0),h(F,null,Y(m(t).recent,d=>(p(),h("div",{key:d.id,class:"pn-row clickable",title:"点击看全文",onClick:v=>r(d)},[l("span",P1,[l("b",null,f(m(lt)(d.title||d.id,40)),1),l("span",R1,f(d.type||"记忆")+" · "+f(d.agent||"—"),1)]),d.shared?(p(),h("span",L1,"共享")):N("",!0),l("span",D1,f(m(Cn)(d.created_at)),1)],8,I1))),128))]),l("div",N1,[l("div",j1,[c[7]||(c[7]=D("按 Agent ",-1)),l("em",null,f(i.value.length),1)]),i.value.length?N("",!0):(p(),h("div",F1,"没有按 Agent 的分布数据。")),(p(!0),h(F,null,Y(i.value,([d,v])=>(p(),h("div",{key:d,class:"pn-row"},[l("span",V1,[l("b",null,f(d),1)]),l("span",U1,f(v),1)]))),128)),l("div",H1,[c[8]||(c[8]=D("用户偏好 ",-1)),l("em",null,f(m(t).prefs.length),1)]),m(t).prefs.length?N("",!0):(p(),h("div",B1," 还没有记录偏好。你对 Agent 说过的长期设定会落在这里,误存的可以就地删掉。 ")),(p(!0),h(F,null,Y(m(t).prefs,d=>(p(),h("div",{key:d.id,class:"pn-row"},[l("span",K1,[l("b",null,f(m(lt)(d.content||d.id,40)),1),l("span",q1,f(d.id),1)]),l("button",{class:"del",disabled:n.value===d.id,title:"删除这条偏好",onClick:Ye(v=>u(d),["stop"])}," 删除 ",8,W1)]))),128))])]),l("div",z1,[c[9]||(c[9]=D(" 后端 ",-1)),l("code",null,f(m(t).stats.backend||"—"),1),D(" v"+f(m(t).stats.version||"—")+" · 向量 ",1),l("code",null,f(m(t).stats.embedding||"—"),1),c[10]||(c[10]=D("。 数据来自 ",-1)),c[11]||(c[11]=l("code",null,"/api/memory/stats",-1)),c[12]||(c[12]=D("、",-1)),c[13]||(c[13]=l("code",null,"/api/memory/recent",-1)),c[14]||(c[14]=D("、",-1)),c[15]||(c[15]=l("code",null,"/api/preferences",-1)),c[16]||(c[16]=D("。 ",-1))])]),_:1},8,["state","ready"]))}},G1=Oe(J1,[["__scopeId","data-v-e89267a4"]]),Ce=Mt({providers:[],custom:[],current:null,state:"idle",err:""});let Bo=!1;async function Qt(e=!1){if(!(Bo&&!e)){Ce.state="loading";try{const t=await oe("/llm/models");Ce.providers=t.providers||[],Ce.custom=t.custom||[],Ce.current=t.current||null,Ce.state="ok",Bo=!0}catch(t){Ce.state="error",Ce.err=t.message}}}function Cl(){const e=Ce.current;if(!e)return{name:"Auto",color:"#7e93b8",sub:"跟随 .env 默认"};if(e.source==="custom"){const s=Ce.custom.find(n=>n.name===e.name);return{name:e.name,color:"#a78bfa",sub:s?s.model:"自定义"}}const t=Ce.providers.find(s=>s.provider===e.provider);return{name:t?t.label:e.provider,color:t?t.color:"#7e93b8",sub:e.provider}}async function vr({source:e,provider:t=null,name:s=null}){const n={source:e};t&&(n.provider=t),s&&(n.name=s);const o=await et("/llm/select",n);return Ce.current=o.current||null,o}function Y1(){const e=Ce.current,t=[{source:"auto",key:"auto",label:"Auto",sub:"跟随 .env 默认",color:"#7e93b8",active:!e}];for(const s of Ce.providers)t.push({source:"preset",key:s.provider,label:s.label||s.provider,sub:s.provider,color:s.color||"#7e93b8",configured:s.configured!==!1,active:!!e&&e.source!=="custom"&&e.provider===s.provider});for(const s of Ce.custom)t.push({source:"custom",key:s.name,label:s.name,sub:s.model||"自定义",color:"#a78bfa",active:!!e&&e.source==="custom"&&e.name===s.name});return t}async function X1(e){await et("/llm/custom/add",e),await Qt(!0)}async function Ko(e){return et("/llm/test",e)}async function Q1(e){return oe(`/llm/custom/${encodeURIComponent(e)}`)}async function Z1(e,t){await oc(`/llm/custom/${encodeURIComponent(e)}`,t),await Qt(!0)}async function em(e){await Xs(`/llm/custom/${encodeURIComponent(e)}`),Ce.current&&Ce.current.name===e&&(Ce.current=null),await Qt(!0)}var qo={git:{sha:"f700690",ts:1794079428e3}};const tm={class:"card"},sm=["aria-expanded"],nm={class:"ic"},lm={viewBox:"0 0 24 24"},om=["d"],im={class:"hint"},rm={key:0,class:"sub"},am=["onClick"],um={class:"m"},cm={key:0,class:"pn-tag green"},dm={key:1,class:"pn-tag amber"},fm={key:0,class:"tip err"},pm={class:"ic"},hm={viewBox:"0 0 24 24"},gm=["d"],vm={class:"card"},mm={class:"row static"},_m={class:"ic"},ym={viewBox:"0 0 24 24"},bm=["d"],km={class:"seg"},$m=["aria-expanded"],wm={class:"ic"},xm={viewBox:"0 0 24 24"},Cm=["d"],Sm={class:"hint"},Mm={key:0,class:"sub"},Tm={class:"card"},Em=["title"],Am={class:"ic"},Om={viewBox:"0 0 24 24"},Im=["d"],Pm={class:"m"},Rm={class:"foot"},Lm={class:"mono"},Dm={__name:"SettingsPanel",setup(e){const t=typeof qo>"u"?null:qo,s=t?.git?.sha||"dev",n=(()=>{const A=t?.git?.ts||0;if(!A)return"本地构建";const E=Math.floor((Date.now()-A)/864e5);return E<=0?"今天":`${E} 天前`})(),o=W(""),i=W(null),r=W(""),u=G(()=>Cl()),a=G(()=>Y1()),c=[["Enter","发送"],["Shift + Enter","换行"],["/","命令补全(如 /搜索)"],["@","技能补全"],["↑ ↓","在补全列表里选"],["Esc","关闭补全 / 浮层"],["Ctrl + ,","打开设置"]];Ae(()=>{Qt(),d()});async function d(){i.value=null;try{await oe("/status"),i.value=!0}catch{i.value=!1}}async function v(){await Qt(!0).catch(()=>{}),d()}async function k(A){try{await vr({source:A.source,provider:A.source==="preset"?A.key:null,name:A.source==="custom"?A.key:null}),o.value="",ie(`模型已切到 ${A.label}`)}catch(E){r.value=E.message,ie(`切换失败:${E.message}`,4e3)}}function $(A){xn(A),ie(A==="stream"?"流式:逐字输出":"编排:先出计划再逐步执行")}const P={gear:["M12 9.2a2.8 2.8 0 1 0 0 5.6 2.8 2.8 0 0 0 0-5.6z","M12 3.2v2.2","M12 18.6v2.2","M3.2 12h2.2","M18.6 12h2.2","M5.8 5.8l1.6 1.6","M16.6 16.6l1.6 1.6","M18.2 5.8l-1.6 1.6","M7.4 16.6l-1.6 1.6"],gauge:["M3.6 15.6a8.4 8.4 0 1 1 16.8 0","M12 15.6l4.2-4.8"],chat:["M19.6 14.8a1.8 1.8 0 0 1-1.8 1.8H8.6L5 20v-3.4H6.2A1.8 1.8 0 0 1 4.4 14.8V6.4A1.8 1.8 0 0 1 6.2 4.6h11.6a1.8 1.8 0 0 1 1.8 1.8z"],keys:["M3.8 8.2h16.4v7.6H3.8z","M7 11h.01","M11 11h.01","M15 11h.01","M9 13.8h6"],server:["M4.4 5.4h15.2v4.8H4.4z","M4.4 13.8h15.2v4.8H4.4z","M7.4 7.8h.01","M7.4 16.2h.01"]},b=A=>P[A]||P.gear;return(A,E)=>(p(),Re(Kt,{title:"设置",tag:"Settings",state:"idle",ready:!0,onRefresh:v},{default:pt(()=>[l("div",tm,[E[9]||(E[9]=l("div",{class:"grp"},"模型",-1)),l("button",{class:"row","aria-expanded":o.value==="model",onClick:E[0]||(E[0]=M=>o.value=o.value==="model"?"":"model")},[l("span",nm,[(p(),h("svg",lm,[(p(!0),h(F,null,Y(b("gear"),(M,I)=>(p(),h("path",{key:I,d:M},null,8,om))),128))]))]),E[5]||(E[5]=l("span",{class:"m"},[l("b",null,"模型与供应商"),l("span",null,"切换后服务端立即生效,不用重启")],-1)),l("span",im,[l("i",{class:"dot",style:xt({background:u.value.color})},null,4),D(f(u.value.name),1)]),l("span",{class:se(["chev",{open:o.value==="model"}])},"›",2)],8,sm),o.value==="model"?(p(),h("div",rm,[(p(!0),h(F,null,Y(a.value,M=>(p(),h("button",{key:`${M.source}-${M.key}`,class:se(["opt",{on:M.active}]),onClick:I=>k(M)},[l("span",{class:"dot",style:xt({background:M.color})},null,4),l("span",um,[l("b",null,f(M.label),1),l("span",null,f(M.sub),1)]),M.active?(p(),h("span",cm,"当前")):M.configured===!1?(p(),h("span",dm,"未配置")):N("",!0)],10,am))),128)),E[6]||(E[6]=l("p",{class:"tip"}," 「未配置」= 后端缺该厂商的 Key。自定义模型的 Key / Base URL 在输入框左侧的模型胶囊里加。 ",-1)),r.value?(p(),h("p",fm,f(r.value),1)):N("",!0)])):N("",!0),l("button",{class:"row",onClick:E[1]||(E[1]=M=>m(Ht)("usage"))},[l("span",pm,[(p(),h("svg",hm,[(p(!0),h(F,null,Y(b("gauge"),(M,I)=>(p(),h("path",{key:I,d:M},null,8,gm))),128))]))]),E[7]||(E[7]=l("span",{class:"m"},[l("b",null,"使用情况"),l("span",null,"token、调用次数、余额")],-1)),E[8]||(E[8]=l("span",{class:"chev"},"›",-1))])]),l("div",vm,[E[12]||(E[12]=l("div",{class:"grp"},"对话",-1)),l("div",mm,[l("span",_m,[(p(),h("svg",ym,[(p(!0),h(F,null,Y(b("chat"),(M,I)=>(p(),h("path",{key:I,d:M},null,8,bm))),128))]))]),E[10]||(E[10]=l("span",{class:"m"},[l("b",null,"模式"),l("span",null,"逐字流式 / 先出计划再逐步执行")],-1)),l("span",km,[l("button",{class:se({on:m(j).mode==="stream"}),onClick:E[2]||(E[2]=M=>$("stream"))},"流式",2),l("button",{class:se({on:m(j).mode==="orchestrate"}),onClick:E[3]||(E[3]=M=>$("orchestrate"))},"编排",2)])]),l("button",{class:"row","aria-expanded":o.value==="keys",onClick:E[4]||(E[4]=M=>o.value=o.value==="keys"?"":"keys")},[l("span",wm,[(p(),h("svg",xm,[(p(!0),h(F,null,Y(b("keys"),(M,I)=>(p(),h("path",{key:I,d:M},null,8,Cm))),128))]))]),E[11]||(E[11]=l("span",{class:"m"},[l("b",null,"快捷键"),l("span",null,"输入框里的键位")],-1)),l("span",Sm,f(c.length)+" 条",1),l("span",{class:se(["chev",{open:o.value==="keys"}])},"›",2)],8,$m),o.value==="keys"?(p(),h("div",Mm,[(p(),h(F,null,Y(c,M=>l("div",{key:M[0],class:"kv"},[l("kbd",null,f(M[0]),1),l("span",null,f(M[1]),1)])),64))])):N("",!0)]),l("div",Tm,[E[14]||(E[14]=l("div",{class:"grp"},"系统",-1)),l("button",{class:"row",title:i.value?"再探一次":"重试",onClick:d},[l("span",Am,[(p(),h("svg",Om,[(p(!0),h(F,null,Y(b("server"),(M,I)=>(p(),h("path",{key:I,d:M},null,8,Im))),128))]))]),l("span",Pm,[E[13]||(E[13]=l("b",null,"后端连接",-1)),l("span",null,"/api · "+f(i.value===null?"探测中…":i.value?"在线":"离线"),1)]),l("span",{class:se(["pn-tag",i.value?"green":i.value===!1?"amber":""])},f(i.value===null?"…":i.value?"正常":"重试"),3)],8,Em)]),l("div",Rm,[l("span",Lm,"git@"+f(m(s))+" · "+f(m(n)),1),E[15]||(E[15]=l("span",{class:"dev",title:"本地构建"},"▭",-1))])]),_:1}))}},Nm=Oe(Dm,[["__scopeId","data-v-b16facc4"]]),jm={class:"stage"},Fm={key:0,class:"tabs"},Vm={class:"t"},Um={key:2,class:"core"},Hm={key:1,class:"core-empty"},Bm={class:"tries"},Km=["onClick"],qm={class:"rm"},Wm={key:1,class:"recent"},zm={class:"rk-list"},Jm=["title","onClick"],Gm={__name:"Stage",setup(e){const t={activity:Zf,tasks:dp,agents:Tp,tools:ng,usage:Ig,knowledge:Kv,review:C1,memory:G1,settings:Nm},s=G(()=>t[J.module]||null),n=G(()=>!!J.doc),o=["现在系统里有哪些技能可以用?","帮我把今天要做的事排个优先级","用一句话说清你能帮我做什么"],i=W([]);Ae(async()=>{J.sessions.length||Vn().catch(()=>{});const a=await oe("/knowledge/recent?limit=5").catch(()=>null);i.value=a?.kus||[]});const r=G(()=>{const a=j.messages.length?J.sessionId:"";return J.sessions.find(c=>c.id!==a&&(c.message_count||0)>0)||null});function u(){const a=r.value;a&&(rr(a),Bn(a.id))}return(a,c)=>(p(),h("section",jm,[n.value?(p(),h("div",Fm,[m(J).module!=="overview"?(p(),h("button",{key:0,class:se(["tab",{on:!m(J).doc}]),onClick:c[0]||(c[0]=d=>m(kl)())},f(m(bl)(m(J).module)),3)):N("",!0),m(J).doc?(p(),h("button",{key:1,class:"tab on doc",onClick:c[1]||(c[1]=d=>m(kl)())},[l("span",Vm,f(m(J).doc.title),1),c[2]||(c[2]=l("span",{class:"x",title:"关闭"},"✕",-1))])):N("",!0)])):N("",!0),l("div",{class:se(["stage-body",{bare:!n.value}])},[m(J).doc?(p(),Re(Fd,{key:0,doc:m(J).doc},null,8,["doc"])):s.value?(p(),Re(Ea(s.value),{key:m(J).module})):(p(),h("div",Um,[m(j).messages.length?(p(),Re(mf,{key:0})):(p(),h("div",Hm,[c[6]||(c[6]=l("div",{class:"hero"},[l("div",{class:"hero-t"},"问我任何事"),l("div",{class:"core-cap"},"主管 Agent 会按需调度子 Agent;想让它读你的知识库,直接问就行")],-1)),l("div",Bm,[(p(),h(F,null,Y(o,d=>l("button",{key:d,class:"try",onClick:v=>m(ql)(d)},[c[3]||(c[3]=l("span",{class:"arrow"},"→",-1)),D(f(d),1)],8,Km)),64))]),r.value?(p(),h("button",{key:0,class:"resume",onClick:u},[c[4]||(c[4]=l("span",{class:"rl"},"继续上次",-1)),l("b",null,f(m(lt)(r.value.title||"未命名会话",28)),1),l("span",qm,f(r.value.message_count)+" 条消息",1)])):N("",!0),i.value.length?(p(),h("div",Wm,[c[5]||(c[5]=l("div",{class:"rh"},"最近知识",-1)),l("div",zm,[(p(!0),h(F,null,Y(i.value,d=>(p(),h("button",{key:d.ku_id,class:"rk",title:d.summary||d.name,onClick:v=>m(Qs)(d.ku_id)},f(m(lt)(d.name||d.ku_id,30)),9,Jm))),128))])])):N("",!0)]))]))],2)]))}},Ym=Oe(Gm,[["__scopeId","data-v-654a383a"]]),Xm={class:"cm"},Qm={class:"cm-h"},Zm=["onMouseenter","onMousedown"],e_={key:0},t_={key:0,class:"cm-empty"},s_={__name:"ComposerMenu",props:{items:{type:Array,default:()=>[]},index:{type:Number,default:0},hint:{type:String,default:""}},emits:["pick","hover"],setup(e){return(t,s)=>(p(),h("div",Xm,[l("div",Qm,f(e.hint),1),(p(!0),h(F,null,Y(e.items,(n,o)=>(p(),h("button",{key:`${n.label}-${o}`,class:se(["cm-it",{on:o===e.index}]),onMouseenter:i=>t.$emit("hover",o),onMousedown:Ye(i=>t.$emit("pick",o),["prevent"])},[l("b",null,f(n.label),1),l("span",null,f(n.desc),1),n.tag?(p(),h("em",e_,f(n.tag),1)):N("",!0)],42,Zm))),128)),e.items.length?N("",!0):(p(),h("div",t_,"没有匹配项")),s[0]||(s[0]=l("div",{class:"cm-f"},"↑↓ 选择 · Enter 确认 · Esc 关闭",-1))]))}},n_=Oe(s_,[["__scopeId","data-v-d6468d56"]]),l_=["title"],o_={class:"nm"},i_={key:0,class:"pop"},r_={key:0,class:"tg"},a_={key:0,class:"empty"},u_={key:1,class:"empty"},c_=["onClick"],d_={key:0,class:"tg"},f_={key:1,class:"tg warn"},p_=["disabled","onClick"],h_=["onClick"],g_={key:0,class:"tg"},v_=["disabled","onClick"],m_=["onClick"],__=["onClick"],y_={key:4,class:"tres"},b_={class:"foot"},k_={class:"fhead"},$_=["disabled"],w_=["placeholder"],x_=["disabled"],C_={__name:"ModelPicker",setup(e){const t=W(!1),s=W(null),n=W(null),o=W(!1),i=G(Cl);Ae(Qt);function r(){t.value=!t.value,t.value&&(n.value=null,Qt(!0))}function u(M){s.value&&!s.value.contains(M.target)&&(t.value=!1)}Ae(()=>document.addEventListener("mousedown",u,!0)),vs(()=>document.removeEventListener("mousedown",u,!0));async function a(M){if(!o.value){o.value=!0;try{await vr(M),t.value=!1,ie(`已切换到 ${Cl().name}`)}catch(I){ie(`切换失败:${I.message}`)}finally{o.value=!1}}}function c(){n.value={edit:!1,name:"",base_url:"",api_key:"",model:"",note:""}}async function d(M){o.value=!0;try{const I=await Q1(M.name);n.value={edit:!0,original:I.name||M.name,name:I.name||M.name,base_url:I.base_url||"",api_key:"",model:I.model||"",note:I.note||"",has_key:!!I.has_key}}catch(I){ie(`读取失败:${I.message}`)}finally{o.value=!1}}async function v(){const M=n.value;if(!M.name.trim()||!M.base_url.trim()||!M.model.trim())return ie("名称 / Base URL / 模型 ID 都必填");if(!M.edit&&!M.api_key.trim())return ie("Key 必填");o.value=!0;try{if(M.edit){const I={base_url:M.base_url.trim(),model:M.model.trim(),note:M.note||""};M.api_key.trim()&&(I.api_key=M.api_key.trim()),await Z1(M.original,I),ie("已保存修改")}else await X1({name:M.name.trim(),base_url:M.base_url.trim(),api_key:M.api_key.trim(),model:M.model.trim(),note:M.note||""}),ie("已添加自定义模型");n.value=null}catch(I){ie(`${M.edit?"保存":"添加"}失败:${I.message}`)}finally{o.value=!1}}const k=W("idle"),$=W(""),P=W("");async function b(M,I){if(k.value!=="busy"){k.value="busy",$.value=`${M}:${I||""}`,P.value="";try{const T=M==="custom"?await Ko({source:"custom",name:I}):await Ko({source:"preset",provider:I});T.ok?(k.value="ok",P.value=`${T.latency_ms??"?"}ms · ${T.model||I}${T.reply?` · ${String(T.reply).slice(0,40)}`:""}`):(k.value="err",P.value=T.error||"测试失败")}catch(T){k.value="err",P.value=String(T.message||T)}}}async function A(M){if(confirm(`删除自定义模型「${M.name}」?`))try{await em(M.name),ie("已删除")}catch(I){ie(`删除失败:${I.message}`)}}function E(M,I){const T=Ce.current;return T?T.source!==M?!1:M==="preset"?T.provider===I:T.name===I:M==="auto"}return(M,I)=>(p(),h("div",{ref_key:"root",ref:s,class:"mp"},[l("button",{class:se(["pill",{on:t.value}]),title:`当前模型:${i.value.sub}`,onClick:r},[l("span",{class:"dot",style:xt({background:i.value.color,boxShadow:`0 0 6px ${i.value.color}`})},null,4),l("span",o_,f(i.value.name),1),I[8]||(I[8]=l("span",{class:"caret"},"▾",-1))],10,l_),t.value?(p(),h("div",i_,[n.value?(p(),h("form",{key:1,class:"form",onSubmit:Ye(v,["prevent"])},[l("div",k_,[D(f(n.value.edit?"编辑自定义模型":"添加自定义模型")+" ",1),l("span",{class:"x",onClick:I[2]||(I[2]=T=>n.value=null)},"✕")]),l("label",null,[I[14]||(I[14]=D("名称 ",-1)),ae(l("input",{"onUpdate:modelValue":I[3]||(I[3]=T=>n.value.name=T),disabled:n.value.edit,placeholder:"我的 DeepSeek"},null,8,$_),[[me,n.value.name]])]),l("label",null,[I[15]||(I[15]=D("Base URL",-1)),ae(l("input",{"onUpdate:modelValue":I[4]||(I[4]=T=>n.value.base_url=T),placeholder:"https://api.deepseek.com/v1"},null,512),[[me,n.value.base_url]])]),l("label",null,[I[16]||(I[16]=D("API Key ",-1)),ae(l("input",{"onUpdate:modelValue":I[5]||(I[5]=T=>n.value.api_key=T),type:"password",placeholder:n.value.edit?n.value.has_key?"留空 = 保留原 Key":"尚未设置,请填写":"sk-…"},null,8,w_),[[me,n.value.api_key]])]),l("label",null,[I[17]||(I[17]=D("模型 ID",-1)),ae(l("input",{"onUpdate:modelValue":I[6]||(I[6]=T=>n.value.model=T),placeholder:"deepseek-chat"},null,512),[[me,n.value.model]])]),l("label",null,[I[18]||(I[18]=D("备注",-1)),ae(l("input",{"onUpdate:modelValue":I[7]||(I[7]=T=>n.value.note=T),placeholder:"可选:这个模型用在哪 / 限速多少"},null,512),[[me,n.value.note]])]),l("button",{class:"submit",disabled:o.value},f(o.value?"保存中…":n.value.edit?"保存修改":"保存并保持未选中"),9,x_)],32)):(p(),h(F,{key:0},[l("button",{class:se(["it",{on:E("auto")}]),onClick:I[0]||(I[0]=T=>a({source:"auto"}))},[I[9]||(I[9]=l("span",{class:"dot",style:{background:"#7e93b8"}},null,-1)),I[10]||(I[10]=l("span",{class:"tx"},[l("b",null,"Auto"),l("span",null,"跟随 .env 默认")],-1)),E("auto")?(p(),h("span",r_,"当前")):N("",!0)],2),I[13]||(I[13]=l("div",{class:"sep"},"预置",-1)),m(Ce).state==="loading"?(p(),h("div",a_,"加载中…")):m(Ce).state==="error"?(p(),h("div",u_,"读取失败:"+f(m(Ce).err),1)):(p(!0),h(F,{key:2},Y(m(Ce).providers,T=>(p(),h("div",{key:T.provider,class:se(["it",{on:E("preset",T.provider),dis:!T.configured}])},[l("span",{class:"dot",style:xt({background:T.color,boxShadow:`0 0 6px ${T.color}`})},null,4),l("button",{class:"tx plain",onClick:X=>T.configured?a({source:"preset",provider:T.provider}):m(ie)(`${T.provider} 未在 .env 配置 Key`)},[l("b",null,f(T.label),1),l("span",null,f(T.provider),1)],8,c_),E("preset",T.provider)?(p(),h("span",d_,"当前")):T.configured?N("",!0):(p(),h("span",f_,"未配置")),l("button",{class:"x",disabled:!T.configured||k.value==="busy",title:"连通性测试",onClick:Ye(X=>b("preset",T.provider),["stop"])},f(k.value==="busy"&&$.value===`preset:${T.provider}`?"…":"测"),9,p_)],2))),128)),m(Ce).custom.length?(p(),h(F,{key:3},[I[12]||(I[12]=l("div",{class:"sep"},"自定义",-1)),(p(!0),h(F,null,Y(m(Ce).custom,T=>(p(),h("div",{key:T.name,class:se(["it",{on:E("custom",T.name)}])},[I[11]||(I[11]=l("span",{class:"dot",style:{background:"#a78bfa","box-shadow":"0 0 6px #a78bfa"}},null,-1)),l("button",{class:"tx plain",onClick:X=>a({source:"custom",name:T.name})},[l("b",null,f(T.name),1),l("span",null,[D(f(T.model),1),T.note?(p(),h(F,{key:0},[D(" · "+f(T.note),1)],64)):N("",!0)])],8,h_),E("custom",T.name)?(p(),h("span",g_,"当前")):N("",!0),l("button",{class:"x",disabled:k.value==="busy",title:"连通性测试",onClick:Ye(X=>b("custom",T.name),["stop"])},f(k.value==="busy"&&$.value===`custom:${T.name}`?"…":"测"),9,v_),l("button",{class:"x",title:"编辑",onClick:Ye(X=>d(T),["stop"])},"编",8,m_),l("span",{class:"x",title:"删除",onClick:X=>A(T)},"✕",8,__)],2))),128))],64)):N("",!0),k.value==="busy"?(p(),h("div",y_,"测试中…")):P.value?(p(),h("div",{key:5,class:se(["tres",k.value])},f(k.value==="ok"?"✓":"✕")+" "+f(P.value),3)):N("",!0),l("div",b_,[l("button",{class:"fbtn",onClick:c},"+ 添加自定义模型"),l("button",{class:"fbtn",title:"重新读取",onClick:I[1]||(I[1]=T=>m(Qt)(!0))},"⟳")])],64))])):N("",!0)],512))}},S_=Oe(C_,[["__scopeId","data-v-a6c9839a"]]),M_={key:0,class:"pop"},T_=["onClick"],E_={class:"ic"},A_={class:"tx"},O_={class:"foot"},I_={__name:"ToolMenu",setup(e){const t=W(!1),s=W(null),n=W(null),o=W(null),i=W(null),r=W(null),u=G(()=>[{ic:j.mode==="stream"?"⚡":"🔧",b:j.mode==="stream"?"流式对话":"编排任务",s:"点击切换模式",act:()=>xn(j.mode==="stream"?"orchestrate":"stream")},{ic:"📎",b:"上传文件",s:"摄入知识库",act:()=>{c(),n.value?.click()}},{ic:"📁",b:"导入文件夹",s:"逐个摄入",act:()=>{c(),o.value?.click()}},{ic:"🖼",b:"附加图片",s:"发给视觉模型",act:()=>{c(),i.value?.click()}},{ic:"📄",b:"附件文件",s:"随问题发给 AI",act:()=>{c(),r.value?.click()}},{ic:"🔌",b:"技能 · 连接器",s:"到技能面板看全部",act:()=>{c(),Ht("tools")}}]);function a(){t.value=!t.value}function c(){t.value=!1}hs(()=>cr.ingestTick,()=>n.value?.click());function d(b){s.value&&!s.value.contains(b.target)&&c()}Ae(()=>document.addEventListener("mousedown",d,!0)),vs(()=>document.removeEventListener("mousedown",d,!0));async function v(b){const A=b.target.files&&b.target.files[0];b.target.value="",A&&await ur(A)}async function k(b){const A=[...b.target.files||[]];b.target.value="",A.length&&await Mc(A)}function $(b){const A=[...b.target.files||[]];b.target.value="",A.forEach(xc),A.length&&ie(`已附加 ${A.length} 张图片`)}async function P(b){const A=[...b.target.files||[]];b.target.value="";for(const E of A)await wc(E)}return(b,A)=>(p(),h("div",{ref_key:"root",ref:s,class:"tm"},[l("button",{class:se(["plus",{on:t.value}]),title:"工具:模式 / 上传 / 文件夹 / 图片 / 附件 / 连接器",onClick:a}," + ",2),t.value?(p(),h("div",M_,[A[0]||(A[0]=l("div",{class:"sec"},"工具",-1)),(p(!0),h(F,null,Y(u.value,(E,M)=>(p(),h("button",{key:M,class:"it",onClick:I=>E.act()},[l("span",E_,f(E.ic),1),l("span",A_,[l("b",null,f(E.b),1),l("span",null,f(E.s),1)])],8,T_))),128)),l("div",O_," 附件 "+f(m(j).attachments.length)+" · 图片 "+f(m(j).images.length)+" · "+f(m(j).mode==="stream"?"流式":"编排"),1)])):N("",!0),l("input",{ref_key:"inFile",ref:n,type:"file",hidden:"",accept:".pdf,.md,.txt,.epub,.mobi,.azw3,.docx,.xlsx",onChange:v},null,544),l("input",{ref_key:"inFolder",ref:o,type:"file",hidden:"",webkitdirectory:"",directory:"",multiple:"",onChange:k},null,544),l("input",{ref_key:"inImg",ref:i,type:"file",hidden:"",accept:"image/*",multiple:"",onChange:$},null,544),l("input",{ref_key:"inAttach",ref:r,type:"file",hidden:"",multiple:"",onChange:P},null,544)],512))}},P_=Oe(I_,[["__scopeId","data-v-b8d9204f"]]),R_={class:"dock"},L_={class:"dock-in"},D_={key:0,class:"chips"},N_=["title"],j_={class:"cn"},F_={class:"cs"},V_=["onClick"],U_=["title"],H_=["src","alt"],B_=["onClick"],K_={class:"cn"},q_={class:"cs"},W_={class:"bar"},z_={class:"wrap"},J_=["title"],G_={key:0,class:"toast"},Y_=84,X_={__name:"ChatDock",setup(e){const t=W(""),s=W(null),n=W(null),o=W(""),i=W(0),r=W([]),u=[{key:"/新建",desc:"开一个新会话",run:()=>Kn()},{key:"/流式",desc:"切到流式对话",run:()=>{xn("stream"),ie("已切到流式对话")}},{key:"/任务",desc:"切到编排任务",run:()=>{xn("orchestrate"),ie("已切到编排任务")}},{key:"/搜索",desc:"检索记忆/知识/联网:/搜索 关键词",arg:!0},{key:"/摄入",desc:"选文件摄入知识库",run:()=>Ic()},{key:"/设置",desc:"打开设置面板",run:()=>Ht("settings")},{key:"/停止",desc:"停止当前生成",run:()=>Fo()},{key:"/清屏",desc:"只清空当前显示,不动后端",run:()=>{j.messages=[]}},{key:"/帮助",desc:"列出全部命令",run:()=>Pc(u.map(x=>`${x.key.padEnd(6)} ${x.desc}`).join(`
|
|
32
|
+
`))}],a=()=>j.streamState==="streaming",c=G(()=>{const x=o.value.toLowerCase();return n.value==="slash"?u.filter(S=>S.key.slice(1).toLowerCase().includes(x)||S.desc.includes(o.value)).map(S=>({label:S.key,desc:S.desc,tag:S.arg?"带参数":""})):n.value==="at"?r.value.filter(S=>S.label.toLowerCase().includes(x)||(S.desc||"").includes(o.value)).slice(0,8):[]}),d=G(()=>n.value==="slash"?"命令":"提及技能");Ae(async()=>{M(),window.addEventListener("resize",X);try{const[x,S]=await Promise.all([oe("/ahs/md-skills").catch(()=>({})),oe("/ahs/skills").catch(()=>({}))]);r.value=[...(x.skills||[]).filter(R=>R.enabled!==!1).map(R=>({label:R.name,desc:R.description||"",tag:"技能"})),...(S.skills||[]).map(R=>({label:R.name||R.id,desc:R.description||"",tag:R.kind||"工具"}))]}catch{}}),vs(()=>window.removeEventListener("resize",X));function v(){const x=s.value;if(!x)return;const S=x.selectionStart??t.value.length,R=t.value.slice(0,S),z=/(^|\s)\/([^\s/]*)$/.exec(R);if(z){n.value!=="slash"&&(i.value=0),n.value="slash",o.value=z[2];return}const B=/(^|\s)@([^\s@]*)$/.exec(R);if(B){n.value!=="at"&&(i.value=0),n.value="at",o.value=B[2];return}n.value=null}hs(t,()=>jt(v));function k(){n.value=null}function $(x){const S=c.value[x];if(!S)return;const R=s.value,z=R?R.selectionStart:t.value.length,B=t.value.slice(0,z);if(n.value==="slash"){const Te=u.find(ke=>ke.key===S.label);if(Te&&Te.arg){t.value=`${Te.key} `,k(),jt(()=>{R&&R.focus(),M()});return}t.value="",k(),jt(M),Te&&Te.run&&Te.run();return}const re=B.lastIndexOf("@"),be=t.value.slice(z);t.value=`${B.slice(0,re)}@${S.label} ${be}`,k(),jt(()=>{R&&R.focus(),M()})}function P(x){if(!x.startsWith("/"))return!1;const[S,...R]=x.split(/\s+/),z=u.find(re=>re.key===S);if(!z)return ie(`未知命令:${S}`),!0;const B=R.join(" ").trim();return z.key==="/搜索"?Rc(B):z.run&&z.run(),!0}function b(){if(a())return Fo();const x=t.value.trim();!x&&!j.attachments.length&&!j.images.length||(t.value="",k(),jt(M),!P(x)&&ql(x))}const A=W(!1);function E(){return Math.max(180,Math.min(340,Math.round(window.innerHeight*.42)))}function M(){const x=s.value;if(!x)return;x.style.height="auto";const S=x.scrollHeight,R=A.value?Y_:0;x.style.height=`${Math.min(Math.max(S,R),E())}px`}function I(){A.value=!0,M()}function T(){A.value=!1,M()}function X(){M()}function ce(x){if(n.value&&c.value.length){const S=c.value.length;if(x.key==="ArrowDown"){x.preventDefault(),i.value=(i.value+1)%S;return}if(x.key==="ArrowUp"){x.preventDefault(),i.value=(i.value-1+S)%S;return}if(x.key==="Enter"){x.preventDefault(),$(i.value);return}if(x.key==="Escape"){x.preventDefault(),k();return}}x.key!=="Enter"||x.shiftKey||x.isComposing||(x.preventDefault(),b())}function K(x){return x>=1048576?`${(x/1048576).toFixed(1)}M`:`${Math.max(1,Math.round(x/1024))}K`}return(x,S)=>(p(),h("div",R_,[l("div",L_,[m(j).attachments.length||m(j).images.length||m(j).ingest?(p(),h("div",D_,[(p(!0),h(F,null,Y(m(j).attachments,(R,z)=>(p(),h("div",{key:R.id||z,class:"chip",title:`${R.name} · ${R.url}`},[l("span",j_,f(R.name),1),l("span",F_,f(K(R.size)),1),l("span",{class:"cx",onClick:B=>m(Cc)(z)},"✕",8,V_)],8,N_))),128)),(p(!0),h(F,null,Y(m(j).images,(R,z)=>(p(),h("div",{key:`img${z}`,class:"chip img",title:R.name},[l("img",{src:R.url,alt:R.name},null,8,H_),l("span",{class:"cx",onClick:B=>m(Sc)(z)},"✕",8,B_)],8,U_))),128)),m(j).ingest?(p(),h("div",{key:0,class:se(["chip ing",m(j).ingest.status])},[l("span",K_,f(m(j).ingest.name),1),l("span",q_,f(m(j).ingest.status==="done"?`${m(j).ingest.ku} 条`:m(j).ingest.status==="error"?"失败":`${m(j).ingest.pct}%`),1),l("span",W_,[l("i",{style:xt({width:`${m(j).ingest.status==="done"?100:m(j).ingest.pct}%`})},null,4)]),m(j).ingest.status==="done"||m(j).ingest.status==="error"?(p(),h("span",{key:0,class:"cx",onClick:S[0]||(S[0]=R=>m(j).ingest=null)},"✕")):N("",!0)],2)):N("",!0)])):N("",!0),n.value&&c.value.length?(p(),Re(n_,{key:1,items:c.value,index:i.value,hint:d.value,onPick:$,onHover:S[1]||(S[1]=R=>i.value=R)},null,8,["items","index","hint"])):N("",!0),l("div",z_,[Se(P_),Se(S_),ae(l("textarea",{ref_key:"ta",ref:s,"onUpdate:modelValue":S[2]||(S[2]=R=>t.value=R),rows:"1",placeholder:"告诉我你想做什么… / 命令 · @ 技能 · Enter 发送",onKeydown:ce,onInput:M,onFocus:I,onBlur:T,onClick:v,onKeyup:v},null,544),[[me,t.value]]),l("button",{class:se(["send",{stop:a()}]),title:a()?"停止生成":"发送",onClick:b},f(a()?"■":"➤"),11,J_)])]),Se(xu,{name:"fade"},{default:pt(()=>[m(j).toast?(p(),h("div",G_,f(m(j).toast),1)):N("",!0)]),_:1})]))}},Q_=Oe(X_,[["__scopeId","data-v-56c02103"]]),Z_={class:"qi"},ey=["onKeydown"],ty={class:"qi-b"},sy=["disabled"],ny={__name:"QuickIngest",setup(e){const t=Be.knowledge,s=W(""),n=W("");let o=null;const i=G(()=>t.ingest==="busy"),r=G(()=>i.value?"抽取中,可能要几十秒…":t.ingestErr||t.ingestMsg),u=G(()=>i.value?"busy":t.ingestErr?"err":"ok");function a(){clearTimeout(o),o=setTimeout(()=>{t.ingest="idle",t.ingestMsg="",t.ingestErr=""},8e3)}async function c(){const d=s.value.trim();if(!(i.value||!d)){s.value="";try{await pr({text:d,title:n.value}),n.value=""}catch{}a()}}return Ii(()=>clearTimeout(o)),(d,v)=>(p(),h("section",Z_,[v[2]||(v[2]=l("div",{class:"qi-h"},[D(" 收录知识 "),l("em",null,"短知识 · 长文档走知识星球")],-1)),ae(l("textarea",{"onUpdate:modelValue":v[0]||(v[0]=k=>s.value=k),class:"qi-ta",rows:"2",placeholder:"写一句就算一条,Ctrl+Enter 收录",onKeydown:Ys(Ye(c,["ctrl","prevent"]),["enter"])},null,40,ey),[[me,s.value]]),l("div",ty,[ae(l("input",{"onUpdate:modelValue":v[1]||(v[1]=k=>n.value=k),class:"qi-title",placeholder:"标题(可选)"},null,512),[[me,n.value]]),l("button",{class:"qi-go",disabled:i.value||!s.value.trim(),onClick:c},f(i.value?"抽取中…":"收录"),9,sy)]),r.value?(p(),h("div",{key:0,class:se(["qi-msg",u.value])},f(r.value),3)):N("",!0)]))}},ly=Oe(ny,[["__scopeId","data-v-222c5f05"]]),oy={class:"col col--right rail-right"},iy={class:"head"},ry={class:"seg"},ay={key:0,class:"pip"},uy={key:0,class:"body scroll"},cy={class:"sec"},dy={class:"kpi"},fy={key:0,class:"empty"},py=["disabled"],hy={key:0,class:"empty"},gy={class:"sec"},vy={class:"kpi"},my={class:"sub-h"},_y={key:0,class:"empty"},yy=["title","onClick"],by={key:0,class:"empty"},ky={key:1,class:"body scroll"},$y={class:"doc-head"},wy={class:"path"},xy={key:0,class:"meta"},Cy={class:"sec"},Sy={key:0,class:"empty"},My={class:"n"},Ty={class:"acts"},Ey={key:1,class:"empty"},Ay=10,Oy={__name:"Inspector",setup(e){Ae(()=>{cc(),rt("knowledge"),rt("review")});const t=G(()=>J.doc),s=Be.knowledge,n=Be.review,o=G(()=>(n.stats.due||0)+(n.stats.fresh||0)),i=G(()=>Math.round((n.stats.avg_mastery||0)*100));function r(){J.railMode="progress",Ht("review"),xl()}const u=G(()=>s.recent.slice(0,Ay)),a=G(()=>s.recentTotal>u.value.length);function c(){J.railMode="progress",Ht("knowledge")}const d=G(()=>{const v=t.value;if(!v)return[];const k=v.content||"";return v.kind==="code"?k.split(`
|
|
33
|
+
`).filter($=>/^(def |class |async def |function |export )/.test($)).map($=>$.replace(/\s*[({].*$/,"").trim()).slice(0,12):k.split(/\n{2,}/).map($=>$.trim()).filter(Boolean).slice(0,6).map($=>$.length>26?$.slice(0,26)+"…":$)});return(v,k)=>(p(),h("aside",oy,[l("div",iy,[l("div",ry,[l("button",{class:se({on:m(J).railMode==="progress"}),onClick:k[0]||(k[0]=$=>m(J).railMode="progress")},"进度",2),l("button",{class:se({on:m(J).railMode==="context"}),onClick:k[1]||(k[1]=$=>m(J).railMode="context")},[k[4]||(k[4]=D(" 上下文",-1)),t.value?(p(),h("span",ay)):N("",!0)],2)]),l("button",{class:"collapse",title:"收起检视栏",onClick:k[2]||(k[2]=$=>m(J).railOpen=!1)},"⟩")]),m(J).railMode==="progress"?(p(),h("div",uy,[Se(ly),l("section",cy,[k[9]||(k[9]=l("div",{class:"sec-h"},[D("学习 "),l("em",null,"SM-2")],-1)),l("div",dy,[l("div",null,[l("b",null,f(m(n).stats.due),1),k[5]||(k[5]=l("span",null,"今日到期",-1))]),l("div",null,[l("b",null,f(m(n).stats.fresh),1),k[6]||(k[6]=l("span",null,"新卡",-1))]),l("div",null,[l("b",null,f(i.value)+"%",1),k[7]||(k[7]=l("span",null,"平均掌握",-1))]),l("div",null,[l("b",null,f(m(n).stats.risk.length),1),k[8]||(k[8]=l("span",null,"遗忘风险",-1))])]),m(n).state==="error"?(p(),h("div",fy,"后端未连接")):(p(),h(F,{key:1},[l("button",{class:"go",disabled:!o.value,onClick:r},f(o.value?`开始复习 ${o.value} 张`:"今天没有要复习的"),9,py),m(n).stats.cards?N("",!0):(p(),h("div",hy,"录入的知识会自动变成复习卡"))],64))]),l("section",gy,[k[16]||(k[16]=l("div",{class:"sec-h"},[D("办公 "),l("em",null,"OfficeAgent")],-1)),l("div",vy,[l("div",null,[l("b",null,f(m(J).officeStats.waypoints),1),k[10]||(k[10]=l("span",null,"行程点",-1))]),l("div",null,[l("b",null,f(m(J).officeStats.conflicts),1),k[11]||(k[11]=l("span",null,"行程冲突",-1))]),l("div",null,[l("b",null,f(m(J).officeStats.alerts),1),k[12]||(k[12]=l("span",null,"告警",-1))]),l("div",null,[l("b",null,f(m(J).officeStats.active),1),k[13]||(k[13]=l("span",null,"进行中",-1))])]),l("div",my,[k[14]||(k[14]=D("最近知识 ",-1)),l("em",null,f(m(s).recentTotal),1)]),m(s).state==="error"?(p(),h("div",_y,"后端未连接")):(p(),h(F,{key:1},[(p(!0),h(F,null,Y(u.value,$=>(p(),h("button",{key:$.ku_id,class:"row",title:$.summary||$.name,onClick:P=>m(Qs)($.ku_id)},[l("b",null,f($.name),1),l("span",null,f($.ku_type)+" · "+f(m(Cn)($.created_at)),1)],8,yy))),128)),u.value.length?N("",!0):(p(),h("div",by," 还没有录入知识。到「学习库」写一句就能收录,长文档走知识星球。 ")),a.value?(p(),h("button",{key:1,class:"more",title:"到学习库看全部",onClick:c},[k[15]||(k[15]=l("span",{class:"bars"},[l("i"),l("i"),l("i")],-1)),D("更多 "+f(m(s).recentTotal)+" 条 ",1)])):N("",!0)],64))])])):(p(),h("div",ky,[t.value?(p(),h(F,{key:0},[l("div",$y,[l("div",{class:se(["kind",t.value.kind])},f(t.value.kind==="code"?"CLI":"TEXT"),3),l("h3",null,f(t.value.title),1),l("code",wy,f(t.value.path),1),t.value.meta?(p(),h("div",xy,f(t.value.meta),1)):N("",!0)]),l("section",Cy,[k[17]||(k[17]=l("div",{class:"sec-h"},"大纲",-1)),d.value.length?N("",!0):(p(),h("div",Sy,"无可提取的结构")),(p(!0),h(F,null,Y(d.value,($,P)=>(p(),h("div",{key:P,class:"out-line"},[l("span",My,f(P+1),1),D(f($),1)]))),128))]),l("div",Ty,[l("button",{onClick:k[3]||(k[3]=$=>m(kl)())},"关闭文档")])],64)):(p(),h("div",Ey,[...k[18]||(k[18]=[D("在中间舞台点开一份文件",-1),l("br",null,null,-1),D("这里会显示它的上下文与大纲",-1)])]))]))]))}},Iy=Oe(Oy,[["__scopeId","data-v-55b20952"]]),Py={class:"app"},Ry={class:"col col--mid mid"},Wo=1180,Ly={__name:"App",setup(e){const t=W(!1);function s(){const o=window.innerWidth<Wo;o!==t.value&&(t.value=o,o&&(J.railOpen=!1))}Ae(()=>{Oc(),t.value=window.innerWidth<Wo,t.value&&(J.railOpen=!1),window.addEventListener("keydown",n),window.addEventListener("resize",s)}),vs(()=>{window.removeEventListener("keydown",n),window.removeEventListener("resize",s)});function n(o){o.ctrlKey&&(o.key===","||o.code==="Comma")&&(o.preventDefault(),Ht("settings"))}return(o,i)=>(p(),h("div",Py,[Se(hc),l("div",{class:se(["workspace",{"is-collapsed":!m(J).railOpen}])},[Se(vd),l("main",Ry,[Se(Ym),Se(Q_)]),Se(Iy)],2),t.value&&m(J).railOpen?(p(),h("div",{key:0,class:"rail-scrim",onClick:i[0]||(i[0]=r=>m(J).railOpen=!1)})):N("",!0),m(J).railOpen?N("",!0):(p(),h("button",{key:1,class:"rail-handle",title:"展开检视栏",onClick:i[1]||(i[1]=r=>m(J).railOpen=!0)}," 检视 "))]))}};ec(Ly).mount("#app");
|