@xopcai/xopc 0.0.323 → 0.0.325
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/plugin.js +1 -9
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DFzmThVi.js → agent-avatar-dicebear-CxfXpPWs.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CDHe8gJf.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DYFYiuig.js → agent-plugin-dialog-DMv-udoZ.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BqIlB5Co.js → agents-D_xOAXgj.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BgvMRGWe.js → app-management-settings-panel-p7fZB4dT.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CliHU03A.js → appearance-settings-C-clVcfp.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Dz2g7eAN.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DnuPpm0u.js → archive-plugin-Xm6xChUX.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BiwaK0ie.js → attachment-load-Di8kuG4L.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CJSISGQH.js → automations-page-GUZgDhKj.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BUZhG9aJ.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-KDjduQZO.js → binary-plugins-OCrDjC9O.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-bclvgove.js → block-editor-m9tqvu7x.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CfQ2T9t6.js → browser-automation-inputs-DSWXq9lI.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Cxq38Nnp.js → browser-automations-page-DuOaridE.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-D2_PgHep.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-7Y_pJqyt.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-B-Igy1ro.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DKQC62nQ.js → chat-terminal-dock-BfnVh8oo.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-D1whpIqL.js → computer-settings-page-aRG2lU4w.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BAuYTgf5.js → connector-service-page-B5EhnfJH.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-7HfRt1LW.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-CtDyij_x.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-DOuVO2M1.js → dependency-picker-z6ouWxmz.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D9tu6Bhu.js → desktop-pet-BsIYCAkG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CQPXub2f.js → desktop-pet-settings-z-0aQ5ct.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DxkOYSut.js → device-pairing-wizard-DlmhQvY5.js} +1 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CtWClPz-.js → extension-debug-page-Ct9pABNW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BHh9HLCz.js → extension-page-BktsR4hj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BdT3v5Uh.js → extension-settings-page-BQJc-vXH.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-1eqyz9vZ.js → gateway-config-swr-CoQVulMd.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CZas_Ekx.js → gateway-settings-BfDVlvy6.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-C4rsW6vJ.js → gateway-startup-retry-B5GJ-CQV.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CI_eQTPL.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-B5DXMylk.js → image-generation-api-DvWDkbk1.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-B1JH0G5j.js → imports-page-DFpQfHVU.js} +1 -1
- package/dist/gateway/static/root/assets/index-19rMUT3d.js +121 -0
- package/dist/gateway/static/root/assets/{index-CNc4N4TX.css → index-BKL5tg2f.css} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DGrLJ8Yh.js → keyboard-shortcuts-settings-ctJLm8TP.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-C9kaP3Dy.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DqjStqbL.js → local-apps-page-BxC_LTqq.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BIkcRr3t.js → locale-store-BPZR8x9b.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Ok5SpG-G.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-gCfH4cwH.js → management-settings-aOzRaQHM.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-Ck_5MADq.js → markdown-view-Dft8ASFD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DTsZqgo6.js → media-plugins-ni5zJ4Ok.js} +1 -1
- package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-C9OEltN9.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-Dj9rMgdi.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-DTI_g4tz.js → page-context-capture-button-BJA3d8vU.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-CfW_Q-K5.js → page-tabs-Dyc3wKkl.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CuPN-vAn.js → preview-open-alternatives-tIOIQbNX.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BHjxRz1E.js → product-open-page-DQctU8z3.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Dy-EwZcc.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-Bk-es4i9.js → projects-page-JaGKa6rM.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BAAZUGnU.js → registry-api-DWWO6ajd.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cb8-nd60.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CHJBJKL1.js → runtime-tools-settings-panel-xhOSYfiX.js} +1 -1
- package/dist/gateway/static/root/assets/scenes-page-ClBkFdRY.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-FQAit5HL.js → schema-form-z8IeSdBp.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BYW5l_nY.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDNwmXuH.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BDc6bw1q.js → settings-form-section-BXTJAser.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DnhxBJjV.js → settings-page-Br9no5e4.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D3KNSQ5g.js → settings-page-layout-D6745w0p.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D2N9764S.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DVQCRxwK.js → share-preview-page-CE0SER59.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Dk3_QOKQ.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CPt61fEv.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-Db6PB2C6.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-mDwC9UJ-.js → skills-page.utils-DrtW5FBy.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Bk7GrMij.js → system-settings-panel-CuY1Zh5s.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-o7RiDUMi.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-D3Aquraj.js → tunnel-api-PGHDgvWb.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C1xQ-sHn.js → use-autosave-B55oBQUt.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-DspelwAa.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DCNECvcp.js → voice-api-key-field-By6Lgbse.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-B-_niUTU.js → voice-config-api-BaxITrwZ.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BrGx_JS_.js → work-discovery-overlay-DdhgIlyf.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CmmC2Pdr.js → workflow-run-setup-panel-BOJYQaxX.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-6ObD0IQZ.js +6 -0
- package/dist/gateway/static/root/index.html +11 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/home.js +284 -55
- package/dist/packages/gateway-contract/src/index.js +0 -2
- package/dist/packages/gateway-contract/src/notifications.js +3 -10
- package/dist/src/activity/emitter.js +2 -1
- package/dist/src/activity/service.js +2 -1
- package/dist/src/agent/agent-manager.d.ts +3 -2
- package/dist/src/agent/agent-manager.js +36 -44
- package/dist/src/agent/agent-scope.d.ts +19 -48
- package/dist/src/agent/agent-scope.js +47 -169
- package/dist/src/agent/background-review/run-background-review.js +5 -4
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/commands/command-registry.js +7 -3
- package/dist/src/agent/context/coordinator.js +1 -1
- package/dist/src/agent/context/execution-context.js +2 -1
- package/dist/src/agent/context/execution-scope.js +2 -1
- package/dist/src/agent/context/workspace-seed.d.ts +1 -2
- package/dist/src/agent/context/workspace-seed.js +3 -3
- package/dist/src/agent/context/workspace-state.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +2 -2
- package/dist/src/agent/embedded/run-turn.js +2 -1
- package/dist/src/agent/embedded/sqlite-hydrating-session-manager.js +2 -1
- package/dist/src/agent/external-tools/cliProvider.js +2 -1
- package/dist/src/agent/external-tools/composio-provider.js +2 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/index.js +2 -3
- package/dist/src/agent/external-tools/mcp-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +4 -5
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/ipc/bus.js +1 -1
- package/dist/src/agent/ipc/socket.js +3 -3
- package/dist/src/agent/media-generation/runtime-shared.d.ts +1 -1
- package/dist/src/agent/media-generation/runtime-shared.js +1 -1
- package/dist/src/agent/memory/plugin-discovery.js +1 -2
- package/dist/src/agent/models/manager.d.ts +1 -1
- package/dist/src/agent/models/manager.js +2 -2
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +1 -1
- package/dist/src/agent/prompt/response-language.js +2 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +6 -3
- package/dist/src/agent/prompt/system-prompt.js +2 -1
- package/dist/src/agent/reply/post-compaction-context.js +2 -2
- package/dist/src/agent/service/build-direct-message-content.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -1
- package/dist/src/agent/service/parse-outbound-session-key.js +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -2
- package/dist/src/agent/service/webchat-tts.js +2 -1
- package/dist/src/agent/service.d.ts +1 -1
- package/dist/src/agent/service.js +12 -11
- package/dist/src/agent/service.types.d.ts +2 -0
- package/dist/src/agent/session/session-inspector.js +4 -5
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +5 -0
- package/dist/src/agent/starter-agents.d.ts +4 -5
- package/dist/src/agent/starter-agents.js +21 -20
- package/dist/src/agent/tasks/task-judge-service.js +2 -2
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +31 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +2 -3
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +10 -9
- package/dist/src/agent/tools/image-generate-tool.js +1 -1
- package/dist/src/agent/tools/workflow-tool.js +2 -3
- package/dist/src/agent/tools/xopc-use-tool.d.ts +3 -2
- package/dist/src/agent/tools/xopc-use-tool.js +54 -6
- package/dist/src/agent/workflow/workflow-child-tools.js +1 -2
- package/dist/src/agent/workspace-runtime/registry.d.ts +1 -1
- package/dist/src/agent/workspace-runtime/registry.js +2 -2
- package/dist/src/agent-catalog/capabilities.d.ts +3 -0
- package/dist/src/agent-catalog/capabilities.js +238 -0
- package/dist/src/agent-catalog/id.d.ts +15 -0
- package/dist/src/agent-catalog/id.js +101 -0
- package/dist/src/agent-catalog/index.d.ts +6 -0
- package/dist/src/agent-catalog/index.js +10 -0
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.d.ts +11 -0
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +195 -0
- package/dist/src/agent-catalog/repository.d.ts +39 -0
- package/dist/src/agent-catalog/repository.js +319 -0
- package/dist/src/agent-catalog/service.d.ts +33 -0
- package/dist/src/agent-catalog/service.js +202 -0
- package/dist/src/agent-catalog/test-support.d.ts +14 -0
- package/dist/src/agent-catalog/test-support.js +34 -0
- package/dist/src/agent-catalog/types.d.ts +26 -0
- package/dist/src/agent-catalog/types.js +1 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +1 -172
- package/dist/src/agent-config/schema.js +2 -41
- package/dist/src/auth/credentials.js +3 -3
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/sync-provider-auth.d.ts +1 -1
- package/dist/src/auth/sync-provider-auth.js +5 -9
- package/dist/src/automations/capabilities/drafts.js +8 -7
- package/dist/src/automations/service/action-executor.js +2 -1
- package/dist/src/bootstrap/application-state.d.ts +10 -0
- package/dist/src/bootstrap/application-state.js +26 -0
- package/dist/src/browser/automations/repository.js +2 -1
- package/dist/src/browser/automations/schema.d.ts +1 -1
- package/dist/src/browser/automations/service.d.ts +1 -1
- package/dist/src/browser/native-messaging-host.js +5 -4
- package/dist/src/browser/providers/extension.js +4 -2
- package/dist/src/browser/providers/realtime-extension.js +2 -1
- package/dist/src/capabilities/readiness/from-config.js +7 -4
- package/dist/src/capabilities/runtime/dispatcher.d.ts +1 -0
- package/dist/src/capabilities/runtime/dispatcher.js +10 -4
- package/dist/src/capabilities/runtime/product.js +2 -0
- package/dist/src/channels/catalog/channel-catalog-service.js +7 -13
- package/dist/src/chat-commands/agent-edit.js +4 -3
- package/dist/src/chat-commands/builtins/config.js +6 -8
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +1 -1
- package/dist/src/chat-commands/config-paths.js +1 -1
- package/dist/src/chat-commands/context.js +2 -3
- package/dist/src/chat-previews/store.js +2 -1
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/agent.js +4 -4
- package/dist/src/cli/commands/agents.d.ts +1 -1
- package/dist/src/cli/commands/agents.js +36 -48
- package/dist/src/cli/commands/auth.js +2 -1
- package/dist/src/cli/commands/browser-cli-helpers.js +1 -2
- package/dist/src/cli/commands/channels.js +2 -4
- package/dist/src/cli/commands/config.js +4 -5
- package/dist/src/cli/commands/connectors.js +1 -2
- package/dist/src/cli/commands/doctor/checks/channel-config.js +2 -4
- package/dist/src/cli/commands/doctor/checks/channel-pairing-pending.js +1 -2
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -2
- package/dist/src/cli/commands/doctor/checks/config-health.js +1 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +4 -4
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -2
- package/dist/src/cli/commands/doctor/checks/gateway-service.js +1 -2
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +13 -11
- package/dist/src/cli/commands/doctor/checks/security-audit.js +1 -2
- package/dist/src/cli/commands/doctor/checks/session-integrity.js +3 -3
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -2
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +5 -7
- package/dist/src/cli/commands/extension-agent-plugin.js +1 -2
- package/dist/src/cli/commands/extension-dev.js +2 -4
- package/dist/src/cli/commands/extension-marketplace.js +1 -2
- package/dist/src/cli/commands/extension-pack.js +1 -2
- package/dist/src/cli/commands/extension.js +1 -2
- package/dist/src/cli/commands/gateway/run-foreground.js +3 -3
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/history.js +2 -1
- package/dist/src/cli/commands/image.js +2 -2
- package/dist/src/cli/commands/init.js +11 -30
- package/dist/src/cli/commands/mcp.js +1 -2
- package/dist/src/cli/commands/models.js +13 -11
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -2
- package/dist/src/cli/commands/onboard/gateway.js +1 -2
- package/dist/src/cli/commands/onboard/model.d.ts +1 -1
- package/dist/src/cli/commands/onboard/model.js +18 -26
- package/dist/src/cli/commands/onboard.js +4 -2
- package/dist/src/cli/commands/platform.js +1 -0
- package/dist/src/cli/commands/project.js +3 -3
- package/dist/src/cli/commands/providers.js +2 -1
- package/dist/src/cli/commands/runtime.js +1 -2
- package/dist/src/cli/commands/search.js +1 -2
- package/dist/src/cli/commands/skills.js +1 -2
- package/dist/src/cli/commands/tui-runner.js +3 -2
- package/dist/src/cli/commands/tui.js +6 -8
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/voice.js +1 -2
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/cli/index.js +4 -2
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +15 -16
- package/dist/src/cli/utils/session.js +1 -2
- package/dist/src/computer/model-config.d.ts +3 -3
- package/dist/src/computer/model-config.js +10 -20
- package/dist/src/computer/runtime.js +1 -1
- package/dist/src/config/agent-model-intents.js +2 -2
- package/dist/src/config/agent-profile.d.ts +5 -6
- package/dist/src/config/agent-profile.js +19 -19
- package/dist/src/config/config-surface.d.ts +0 -3
- package/dist/src/config/default-model.js +2 -6
- package/dist/src/config/index.js +7 -8
- package/dist/src/config/loader.js +12 -18
- package/dist/src/config/models-json.d.ts +6 -6
- package/dist/src/config/paths.d.ts +18 -19
- package/dist/src/config/paths.js +35 -35
- package/dist/src/config/reload.d.ts +0 -1
- package/dist/src/config/reload.js +1 -6
- package/dist/src/config/rules.js +0 -15
- package/dist/src/config/schema.d.ts +3 -406
- package/dist/src/config/schema.js +24 -86
- package/dist/src/config/validate-channel-configs.js +8 -14
- package/dist/src/config/workspace-dirs.d.ts +3 -4
- package/dist/src/config/workspace-dirs.js +9 -8
- package/dist/src/config/workspace-path-helpers.d.ts +1 -1
- package/dist/src/config/workspace-path-helpers.js +2 -2
- package/dist/src/connectors/cli/lifecycle.js +2 -1
- package/dist/src/connectors/composio-managed-events.js +2 -1
- package/dist/src/connectors/connected-source-ingestion.js +2 -1
- package/dist/src/connectors/connected-source-understanding.js +4 -2
- package/dist/src/connectors/content-enrichment.js +2 -1
- package/dist/src/connectors/learning-coordinator.js +2 -1
- package/dist/src/connectors/runtime-adapter-registry.js +2 -1
- package/dist/src/connectors/workflow-preflight.d.ts +8 -1
- package/dist/src/connectors/workflow-preflight.js +11 -3
- package/dist/src/discussions/analyzer.js +2 -2
- package/dist/src/endpoint-tools/runtime.js +2 -1
- package/dist/src/execution-environments/subject.js +2 -1
- package/dist/src/extensions/activation-context.js +3 -16
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/discover-extensions.js +9 -15
- package/dist/src/extensions/extension-metadata-snapshot.d.ts +1 -1
- package/dist/src/extensions/extension-metadata-snapshot.js +9 -16
- package/dist/src/extensions/index.js +4 -10
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +7 -14
- package/dist/src/extensions/manifest-registry.js +93 -98
- package/dist/src/extensions/marketplace.js +5 -2
- package/dist/src/extensions/normalize-manifest.js +12 -17
- package/dist/src/extensions/update.js +1 -2
- package/dist/src/files/file-service.js +7 -8
- package/dist/src/gateway/agents-admin.d.ts +23 -27
- package/dist/src/gateway/agents-admin.js +109 -130
- package/dist/src/gateway/file-path-classifier.js +3 -3
- package/dist/src/gateway/file-space-service.js +2 -1
- package/dist/src/gateway/global-defaults-admin.d.ts +6 -4
- package/dist/src/gateway/global-defaults-admin.js +21 -20
- package/dist/src/gateway/hono/app.js +2 -1
- package/dist/src/gateway/hono/lib/config-payload.js +12 -9
- package/dist/src/gateway/hono/middleware/auth.js +2 -1
- package/dist/src/gateway/hono/middleware/scopes.js +2 -1
- package/dist/src/gateway/hono/routes/agents.js +22 -49
- package/dist/src/gateway/hono/routes/browser.js +4 -2
- package/dist/src/gateway/hono/routes/channels.js +1 -2
- package/dist/src/gateway/hono/routes/cli-connectors.js +2 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -1
- package/dist/src/gateway/hono/routes/composer-history.js +2 -1
- package/dist/src/gateway/hono/routes/config-patch/index.d.ts +1 -3
- package/dist/src/gateway/hono/routes/config-patch/index.js +1 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +18 -11
- package/dist/src/gateway/hono/routes/config.js +0 -2
- package/dist/src/gateway/hono/routes/connectors.js +8 -4
- package/dist/src/gateway/hono/routes/context-sources.js +4 -3
- package/dist/src/gateway/hono/routes/device-pairing-approval.js +2 -1
- package/dist/src/gateway/hono/routes/device-push.js +3 -2
- package/dist/src/gateway/hono/routes/devices.js +6 -3
- package/dist/src/gateway/hono/routes/discussions.js +2 -1
- package/dist/src/gateway/hono/routes/endpoint-tools.js +2 -1
- package/dist/src/gateway/hono/routes/global-defaults.js +8 -16
- package/dist/src/gateway/hono/routes/home.js +93 -4
- package/dist/src/gateway/hono/routes/interaction-state.js +2 -1
- package/dist/src/gateway/hono/routes/models.js +8 -7
- package/dist/src/gateway/hono/routes/notes.js +4 -5
- package/dist/src/gateway/hono/routes/projects.js +6 -6
- package/dist/src/gateway/hono/routes/public-gateway.js +2 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +4 -2
- package/dist/src/gateway/hono/routes/shares.js +4 -3
- package/dist/src/gateway/hono/routes/site-shares.js +2 -2
- package/dist/src/gateway/hono/routes/status.js +2 -3
- package/dist/src/gateway/hono/routes/tasks.js +1 -2
- package/dist/src/gateway/hono/routes/user-model-refresh.js +2 -1
- package/dist/src/gateway/hono/routes/user-model.js +3 -2
- package/dist/src/gateway/hono/routes/work-discovery.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.d.ts +19 -10
- package/dist/src/gateway/image-generation-setup.js +59 -23
- package/dist/src/gateway/index.js +1 -4
- package/dist/src/gateway/lock.js +13 -18
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +4 -3
- package/dist/src/gateway/run-loop.js +2 -3
- package/dist/src/gateway/security/gateway-scopes.js +6 -2
- package/dist/src/gateway/security/index.js +4 -1
- package/dist/src/gateway/service/agent-runner.js +4 -2
- package/dist/src/gateway/service/app-context-access.js +2 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +0 -1
- package/dist/src/gateway/service/config-coordinator.js +4 -22
- package/dist/src/gateway/service/marketplace-service.js +3 -1
- package/dist/src/gateway/service/run-gateway-agent.js +4 -2
- package/dist/src/gateway/service/session-input-coordinator.js +4 -2
- package/dist/src/gateway/service.d.ts +5 -0
- package/dist/src/gateway/service.js +109 -33
- package/dist/src/gateway/session-context-summary.js +4 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +15 -10
- package/dist/src/home-intelligence/application-service.d.ts +31 -0
- package/dist/src/home-intelligence/application-service.js +134 -0
- package/dist/src/home-intelligence/capability-preflight.d.ts +32 -0
- package/dist/src/home-intelligence/capability-preflight.js +118 -0
- package/dist/src/home-intelligence/evaluation.d.ts +34 -0
- package/dist/src/home-intelligence/evaluation.js +49 -0
- package/dist/src/home-intelligence/generator.d.ts +125 -0
- package/dist/src/home-intelligence/generator.js +227 -0
- package/dist/src/home-intelligence/host.d.ts +53 -0
- package/dist/src/home-intelligence/host.js +257 -0
- package/dist/src/home-intelligence/notification.d.ts +8 -0
- package/dist/src/home-intelligence/notification.js +20 -0
- package/dist/src/home-intelligence/policy.d.ts +16 -0
- package/dist/src/home-intelligence/policy.js +152 -0
- package/dist/src/home-intelligence/repository.d.ts +81 -0
- package/dist/src/home-intelligence/repository.js +495 -0
- package/dist/src/home-intelligence/snapshot.d.ts +43 -0
- package/dist/src/home-intelligence/snapshot.js +133 -0
- package/dist/src/home-intelligence/strategy.d.ts +14 -0
- package/dist/src/home-intelligence/strategy.js +10 -0
- package/dist/src/home-intelligence/types.d.ts +13 -0
- package/dist/src/home-intelligence/types.js +1 -0
- package/dist/src/infra/update-restart.js +4 -2
- package/dist/src/knowledge/connected-knowledge-pipeline.js +2 -1
- package/dist/src/knowledge/ingestion-service.js +2 -1
- package/dist/src/knowledge-memory/repository.js +2 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/local-apps/store.js +2 -1
- package/dist/src/mcp/channel-bridge.js +1 -2
- package/dist/src/mcp/channel-server.js +1 -2
- package/dist/src/mcp/gateway-http-client.js +1 -2
- package/dist/src/media/session-references.js +2 -1
- package/dist/src/memory-maintenance/service.js +2 -1
- package/dist/src/migrations/memory-config.js +1 -2
- package/dist/src/notes/agent-context.js +2 -1
- package/dist/src/notes/attachment-ref.js +8 -4
- package/dist/src/notes/note-attachment-sync.js +2 -1
- package/dist/src/notes/note-index-meta.js +14 -7
- package/dist/src/notes/note-markdown.js +13 -7
- package/dist/src/notes/service.js +6 -3
- package/dist/src/notes/store.js +4 -2
- package/dist/src/notifications/device-store.js +1 -1
- package/dist/src/notifications/planner.js +24 -0
- package/dist/src/notifications/service.d.ts +7 -14
- package/dist/src/notifications/service.js +13 -3
- package/dist/src/notifications/store.js +1 -1
- package/dist/src/notifications/types.d.ts +1 -1
- package/dist/src/notifications/types.js +1 -1
- package/dist/src/projects/capabilities/write.js +2 -1
- package/dist/src/projects/project-agent-suggestion.js +1 -1
- package/dist/src/projects/project-agent.js +4 -4
- package/dist/src/projects/project-service.js +2 -1
- package/dist/src/projects/workspace.js +3 -2
- package/dist/src/providers/index.js +3 -3
- package/dist/src/providers/model-reference-auditor.d.ts +1 -2
- package/dist/src/providers/model-reference-auditor.js +8 -5
- package/dist/src/realtime/runtime.js +2 -1
- package/dist/src/routing/binding-schema.d.ts +41 -0
- package/dist/src/routing/binding-schema.js +26 -0
- package/dist/src/routing/bindings.d.ts +4 -2
- package/dist/src/routing/bindings.js +4 -4
- package/dist/src/routing/index.d.ts +1 -1
- package/dist/src/routing/resolve-route.d.ts +7 -24
- package/dist/src/routing/resolve-route.js +17 -18
- package/dist/src/routing/resolve-tui-session-key.d.ts +1 -4
- package/dist/src/routing/resolve-tui-session-key.js +10 -9
- package/dist/src/scenes/execution.d.ts +1 -1
- package/dist/src/scenes/model.js +1 -1
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +6 -4
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/session/config-store.js +2 -1
- package/dist/src/session/init-session-turn.js +2 -1
- package/dist/src/session/resolve-session.js +2 -1
- package/dist/src/session/session-workspace.js +1 -1
- package/dist/src/session/store.js +3 -2
- package/dist/src/storage/sqlite/activity-repository.js +6 -2
- package/dist/src/storage/sqlite/browser-tab-binding-repository.js +6 -2
- package/dist/src/storage/sqlite/clarification-wait-repository.js +13 -8
- package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +8 -3
- package/dist/src/storage/sqlite/composer-input-history-repository.js +8 -3
- package/dist/src/storage/sqlite/config-repository.js +9 -5
- package/dist/src/storage/sqlite/connector-learning-repository.js +6 -2
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +6 -2
- package/dist/src/storage/sqlite/context-evidence-repository.js +8 -3
- package/dist/src/storage/sqlite/context-extraction-repository.js +8 -3
- package/dist/src/storage/sqlite/device-access-repository.js +15 -9
- package/dist/src/storage/sqlite/device-pairing-approval.js +6 -2
- package/dist/src/storage/sqlite/device-pairing-repository.js +10 -5
- package/dist/src/storage/sqlite/endpoint-principal-repository.js +6 -2
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +6 -2
- package/dist/src/storage/sqlite/endpoint-tool-invocation-repository.js +6 -2
- package/dist/src/storage/sqlite/gateway-identity-repository.js +6 -2
- package/dist/src/storage/sqlite/home-attention-repository.js +6 -2
- package/dist/src/storage/sqlite/index.d.ts +0 -1
- package/dist/src/storage/sqlite/index.js +72 -42
- package/dist/src/storage/sqlite/interaction-state-repository.js +10 -4
- package/dist/src/storage/sqlite/knowledge-repository.js +6 -2
- package/dist/src/storage/sqlite/migrations/203_remove_retired_proactive_contracts.sql +70 -0
- package/dist/src/storage/sqlite/migrations/204_home_intelligence.sql +78 -0
- package/dist/src/storage/sqlite/migrations/205_agent_catalog.sql +66 -0
- package/dist/src/storage/sqlite/migrations/206_home_advice_strategy_version.sql +3 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +2 -0
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +8 -4
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.d.ts +7 -1
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +2 -2
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- package/dist/src/storage/sqlite/note-agent-context-repository.js +6 -2
- package/dist/src/storage/sqlite/notes-repository.js +9 -4
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-task-plan-repository.js +14 -9
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +9 -5
- package/dist/src/storage/sqlite/sidebar-layout-repository.js +14 -9
- package/dist/src/storage/sqlite/transcript-repository.js +10 -6
- package/dist/src/storage/sqlite/user-people-repository.js +8 -3
- package/dist/src/storage/sqlite/user-trust-repository.js +8 -3
- package/dist/src/tasks/attention-governor.d.ts +0 -1
- package/dist/src/tasks/attention-governor.js +1 -7
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/execution-context.d.ts +2 -2
- package/dist/src/tasks/execution-context.js +6 -5
- package/dist/src/tasks/home-query-service.d.ts +3 -2
- package/dist/src/tasks/home-query-service.js +23 -44
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-context-repository.d.ts +1 -1
- package/dist/src/tasks/task-contract-planner.d.ts +0 -3
- package/dist/src/tasks/task-contract-planner.js +1 -4
- package/dist/src/tasks/task-handoff-service.d.ts +0 -2
- package/dist/src/tasks/task-handoff-service.js +3 -3
- package/dist/src/tasks/task-value-metrics-service.js +2 -1
- package/dist/src/tui/backends/embedded-backend.js +12 -14
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -3
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +3 -3
- package/dist/src/tui/tui.js +5 -5
- package/dist/src/tunnel/registration-proof.js +2 -1
- package/dist/src/user-context/access-policy.js +2 -1
- package/dist/src/user-context/domain.d.ts +1 -1
- package/dist/src/user-context/domain.js +18 -13
- package/dist/src/user-context/extraction/registry.js +2 -1
- package/dist/src/user-context/interaction-state.js +4 -1
- package/dist/src/user-context/relationship-continuity.js +2 -1
- package/dist/src/user-context/trust-policy.js +13 -8
- package/dist/src/user-model/bootstrap.js +2 -1
- package/dist/src/user-model/capture/executor.js +4 -2
- package/dist/src/user-model/capture/semantic.d.ts +1 -1
- package/dist/src/user-model/capture/semantic.js +1 -1
- package/dist/src/user-model/domain.js +7 -2
- package/dist/src/user-model/goals.js +2 -1
- package/dist/src/user-model/index.js +4 -1
- package/dist/src/user-model/repository.js +2 -1
- package/dist/src/utils/helpers.js +1 -4
- package/dist/src/utils/index.js +2 -2
- package/dist/src/utils/logger/index.d.ts +1 -1
- package/dist/src/utils/logger/index.js +2 -2
- package/dist/src/utils/logger/redact.d.ts +2 -0
- package/dist/src/utils/logger/redact.js +11 -3
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/voice/realtime/memory-context.js +2 -1
- package/dist/src/voice/realtime/persona-context.js +6 -6
- package/dist/src/voice/tts/audio.js +1 -1
- package/dist/src/work-discovery/analyzer.js +3 -3
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/work-discovery/service.js +12 -11
- package/dist/src/workflows/draft/workflow-draft-service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +4 -5
- package/dist/src/workflows/store/paths.js +1 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CAFHadiy.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Drt3Foi9.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-B-Eduqwz.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-Dwgir6mu.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-H5L5vynP.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-uFKh3Hd0.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-RFBRYe5S.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Px-v3Q6Q.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-CfCo3lqh.js +0 -1
- package/dist/gateway/static/root/assets/home-page-w3_aWeNt.js +0 -1
- package/dist/gateway/static/root/assets/index--3c0awkr.js +0 -121
- package/dist/gateway/static/root/assets/local-app-workbench-page-BYKrJpFF.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-Dl4kM4Na.js +0 -2
- package/dist/gateway/static/root/assets/messages-7VAhscYe.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-j6sioeL1.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CMvvHv0f.js +0 -8
- package/dist/gateway/static/root/assets/popover-select-B-GDnZO9.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-C9K_e-EV.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CLGJNA42.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-ClLAD1pz.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-Xj8MkXN1.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DwALV8mi.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-F0rCQ-2a.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-C7hf6Cov.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-xPrFejRE.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-RdDYu7Yj.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-2A966jFY.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CnBxPBVe.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BZVpqw4T.js +0 -6
- package/dist/packages/gateway-contract/src/proactive.js +0 -136
- package/dist/src/commands/agents.config.d.ts +0 -31
- package/dist/src/commands/agents.config.js +0 -129
- package/dist/src/gateway/hono/routes/config-patch/agents.d.ts +0 -2
- package/dist/src/gateway/hono/routes/config-patch/agents.js +0 -6
- package/dist/src/storage/sqlite/relationship-settings-repository.d.ts +0 -17
- package/dist/src/storage/sqlite/relationship-settings-repository.js +0 -65
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/block-editor-bclvgove.js","assets/rolldown-runtime-aKtaBQYM.js","assets/index--3c0awkr.js","assets/preload-helper-zJ_50EbN.js","assets/es2015-DBLcMg5B.js","assets/vendor-react-BOUWij0V.js","assets/dist-CxGUk8J-.js","assets/dist-CI_fqRk-.js","assets/floating-ui.dom-B7uQOZZW.js","assets/markdown-view-Ck_5MADq.js","assets/dist-BGTk37IG.js","assets/chunk-KS7C4IRE-BMYIfy9x.js","assets/createLucideIcon-DPHK1VkS.js","assets/download-Dk-ZjtO6.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/locale-store-BIkcRr3t.js","assets/messages-7VAhscYe.js","assets/cn-JdwAhgNB.js","assets/app-link-C6gA5Nck.js","assets/product-delivery-bv3z8Xkh.js","assets/schemas-88fK3zzl.js","assets/local-apps-Bpja8nC6.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/markdown-view-DSjfHfaW.css","assets/dist-Che_jiQF.js","assets/vendor-swr-BIWyz7Rc.js","assets/check-DUBLcKHA.js","assets/popover-select-B-GDnZO9.js","assets/skeleton-BwbyijEw.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/settings-shell-layer-context-BTQUDoJ2.js","assets/circle-check-C23XjkUj.js","assets/copy-Dv6d4Dvw.js","assets/middleware-Pd0e8Igk.js","assets/capabilities-uFKh3Hd0.js","assets/tasks-CDR_RVbQ.js","assets/conversation-identity-Cw0n9uzK.js","assets/files-BK6enEvD.js","assets/tool-activity-BtJkgjFf.js","assets/turn-outcome-D0SnyZ3Z.js","assets/button-CS04eWY9.js","assets/registry-api-BAAZUGnU.js","assets/gateway-startup-retry-C4rsW6vJ.js","assets/gateway-config-swr-1eqyz9vZ.js","assets/electron-env-Dit0bHgy.js","assets/index-CNc4N4TX.css","assets/vendor-codemirror-DFxP3B9T.js","assets/with-selector-aYPsXwdl.js","assets/block-editor-BdOTO0Yo.css","assets/markdown-editor-BhBJANcx.js","assets/code-editor-CXIH8jQw.js","assets/languages-BFe8nIOO.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{f as a,t as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./check-DUBLcKHA.js";import{n as c,r as l}from"./popover-select-B-GDnZO9.js";import{t as u}from"./circle-check-C23XjkUj.js";import{t as d}from"./copy-Dv6d4Dvw.js";import{t as f}from"./download-Dk-ZjtO6.js";import{t as p}from"./x-B_N4OPjy.js";import{t as m}from"./cn-JdwAhgNB.js";import{a as h,c as g,f as _,n as v,r as y}from"./locale-store-BIkcRr3t.js";import{t as b}from"./messages-7VAhscYe.js";import{a as x,i as S,n as C,o as w,r as T,s as E,t as D}from"./dist-BGTk37IG.js";import{t as O}from"./copy-to-clipboard-HOJ79TWv.js";import{i as k}from"./vendor-swr-BIWyz7Rc.js";import{t as A}from"./button-CS04eWY9.js";import{t as j}from"./skeleton-BwbyijEw.js";import{$i as M,$o as N,Ar as P,At as F,Au as I,Bc as L,Bn as ee,Bu as R,Dc as z,Ec as te,Fn as ne,Gn as re,Ho as B,I as ie,Ic as ae,In as oe,Io as V,Jn as se,Kc as ce,Ki as le,Kn as H,L as U,Ln as ue,Nl as de,Oc as W,Or as fe,Pn as pe,Qn as G,Rl as K,Rn as me,Sd as he,Un as ge,Vn as q,Wn as _e,Xi as ve,Yn as ye,Zc as be,Zn as xe,a as Se,ar as Ce,ba as we,c as Te,cr as Ee,dr as De,ea as Oe,er as ke,id as Ae,ir as je,j as Me,jr as Ne,ju as Pe,kr as Fe,ku as Ie,l as Le,ln as Re,lr as ze,lu as Be,ml as Ve,nl as J,o as He,or as Ue,qi as We,ql as Ge,qn as Ke,s as qe,sr as Je,ul as Ye,un as Xe,wu as Ze,xd as Qe,zn as $e}from"./index--3c0awkr.js";import{t as Y}from"./page-context-capture-button-DTI_g4tz.js";var X=n(),Z=e(t(),1),Q=r(),et=(0,Z.createContext)(null);function tt(){let e=(0,X.c)(1),t=(0,Z.useContext)(et);if(!t){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={openImage:nt},e[0]=t):t=e[0],t}return t}function nt(){}function rt(e){let t=(0,X.c)(22),{children:n,closeLabel:r}=e,i=r===void 0?`Close`:r,[a,o]=(0,Z.useState)(null),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(e,t)=>{o({src:e,alt:t})},t[0]=s):s=t[0];let c=s,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={openImage:c},t[1]=l):l=t[1];let u=l,d=a!==null,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{e||o(null)},t[2]=f):f=t[2];let h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Q.jsx)(x,{className:`fixed inset-0 z-[70] bg-scrim/90 backdrop-blur-sm`}),t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=m(`fixed inset-0 z-[71] flex items-center justify-center p-4 outline-none`,`data-[state=open]:animate-in data-[state=closed]:animate-out`),t[4]=g):g=t[4];let _=a?.alt||`Image preview`,v;t[5]===_?v=t[6]:(v=(0,Q.jsx)(E,{className:`sr-only`,children:_}),t[5]=_,t[6]=v);let y;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(p,{className:`size-5`,"aria-hidden":!0}),t[7]=y):y=t[7];let b;t[8]===i?b=t[9]:(b=(0,Q.jsx)(C,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":i,className:`absolute right-4 top-4 z-10 rounded-lg bg-surface-panel/80 p-2 text-fg-muted backdrop-blur transition-colors hover:bg-surface-hover hover:text-fg`,children:y})}),t[8]=i,t[9]=b);let S;t[10]===a?S=t[11]:(S=a?(0,Q.jsx)(`img`,{src:a.src,alt:a.alt??``,className:`max-h-[min(90vh,900px)] max-w-[min(95vw,1200px)] rounded-lg object-contain shadow-lg`}):null,t[10]=a,t[11]=S);let O;t[12]!==b||t[13]!==S||t[14]!==v?(O=(0,Q.jsxs)(w,{children:[h,(0,Q.jsxs)(T,{className:g,"aria-describedby":void 0,children:[v,b,S]})]}),t[12]=b,t[13]=S,t[14]=v,t[15]=O):O=t[15];let k;t[16]!==O||t[17]!==d?(k=(0,Q.jsx)(D,{open:d,onOpenChange:f,children:O}),t[16]=O,t[17]=d,t[18]=k):k=t[18];let A;return t[19]!==n||t[20]!==k?(A=(0,Q.jsxs)(et.Provider,{value:u,children:[n,k]}),t[19]=n,t[20]=k,t[21]=A):A=t[21],A}var it=6e4,at=36e5,ot=864e5;function st(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function $(e,t,n){let r=t-e;if(r<it)return n.justNow;if(r<at){let e=Math.floor(r/it);return n.minutesAgo.replace(`{{n}}`,String(e))}let i=st(t);if(e>=i)return n.today+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(e>=i-ot)return n.yesterday+` `+new Date(e).toLocaleTimeString(n.locale,{hour:`2-digit`,minute:`2-digit`});if(r<7*ot){let e=Math.floor(r/ot);return n.daysAgo.replace(`{{n}}`,String(e))}return new Date(e).toLocaleDateString(n.locale,{month:`short`,day:`numeric`})}function ct(e,t,n){let r=st(t);if(e>=r)return n.today;if(e>=r-ot)return n.yesterday;let i=new Date(e),a=new Date(t);return i.getFullYear()===a.getFullYear()?i.toLocaleDateString(n.locale,{month:`long`,day:`numeric`}):i.toLocaleDateString(n.locale,{year:`numeric`,month:`long`,day:`numeric`})}function lt(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function ut(e){let t=(0,X.c)(45),{title:n,description:r,prompt:i,coverage:o,className:s,variant:c}=e,l=c===void 0?`card`:c,d=v(pt),f=b(d).automations.suggestions,p=b(d).automations,h=a(),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g={revalidateOnFocus:!1,refreshInterval:15e3},t[0]=g):g=t[0];let{data:_}=k(o?`automation-suggestion-coverage`:null,ft,g),y=o?_?.automations.find(e=>Te(e,o)):void 0,x=y?He(y,p):[];if(l===`titleAction`){if(y){let e;t[1]===s?e=t[2]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg border border-emerald-500/25 bg-emerald-500/10 px-2.5 py-1.5`,s),t[1]=s,t[2]=e);let n;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`size-3.5 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[3]=n):n=t[3];let r;return t[4]===h?r=t[5]:(r=()=>h(`/automations`),t[4]=h,t[5]=r),(0,Q.jsxs)(`section`,{className:e,children:[n,(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,children:f.coveredTitle}),(0,Q.jsx)(A,{variant:`ghost`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:r,children:f.manage})]})}let e;t[6]===s?e=t[7]:(e=m(`flex min-w-0 items-center gap-2 rounded-lg bg-surface-panel px-2.5 py-1.5 shadow-surface`,s),t[6]=s,t[7]=e);let a;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Ge,{className:`size-3.5 shrink-0 text-accent`,"aria-hidden":!0}),t[8]=a):a=t[8];let o;t[9]!==r||t[10]!==n?(o=(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs font-medium text-fg`,title:r,children:n}),t[9]=r,t[10]=n,t[11]=o):o=t[11];let c;t[12]!==h||t[13]!==i?(c=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[12]=h,t[13]=i,t[14]=c):c=t[14];let l;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(L,{className:`size-3.5`,"aria-hidden":!0}),t[15]=l):l=t[15],(0,Q.jsxs)(`section`,{className:e,children:[a,o,(0,Q.jsxs)(A,{variant:`secondary`,className:`h-7 shrink-0 rounded-md px-2 text-xs`,onClick:c,children:[l,f.setup]})]})}if(y){let e;t[16]===s?e=t[17]:(e=m(`rounded-lg border border-emerald-500/25 bg-emerald-500/10 p-3`,s),t[16]=s,t[17]=e);let n;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(u,{className:`mt-0.5 size-4 shrink-0 text-emerald-700 dark:text-emerald-300`,"aria-hidden":!0}),t[18]=n):n=t[18];let r;t[19]===h?r=t[20]:(r=()=>h(`/automations`),t[19]=h,t[20]=r);let i;return t[21]!==f||t[22]!==r?(i=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsx)(A,{variant:`ghost`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:r,children:f.manage})}),t[21]=f,t[22]=r,t[23]=i):i=t[23],(0,Q.jsxs)(`section`,{className:e,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:f.coveredTitle}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:qe(f.coveredDescription,{name:y.name})})]})]}),(0,Q.jsxs)(`div`,{className:`mt-2 rounded-md bg-surface-base/55 px-2.5 py-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg`,children:p.explain.whyCovered}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:x.map(dt)})]}),i]})}let S;t[24]===s?S=t[25]:(S=m(`rounded-lg bg-surface-panel p-3 shadow-surface`,s),t[24]=s,t[25]=S);let C;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(Ge,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[26]=C):C=t[26];let w;t[27]===n?w=t[28]:(w=(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n}),t[27]=n,t[28]=w);let T;t[29]===r?T=t[30]:(T=(0,Q.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:r}),t[29]=r,t[30]=T);let E;t[31]!==w||t[32]!==T?(E=(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[C,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[w,T]})]}),t[31]=w,t[32]=T,t[33]=E):E=t[33];let D;t[34]!==h||t[35]!==i?(D=()=>{h(`/automations?${new URLSearchParams({draft:i,autogenerate:`1`}).toString()}`)},t[34]=h,t[35]=i,t[36]=D):D=t[36];let O;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(L,{className:`size-3.5`,"aria-hidden":!0}),t[37]=O):O=t[37];let j;t[38]!==f.create||t[39]!==D?(j=(0,Q.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,Q.jsxs)(A,{variant:`secondary`,className:`h-8 rounded-md px-2.5 text-xs`,onClick:D,children:[O,f.create]})}),t[38]=f.create,t[39]=D,t[40]=j):j=t[40];let M;return t[41]!==j||t[42]!==S||t[43]!==E?(M=(0,Q.jsxs)(`section`,{className:S,children:[E,j]}),t[41]=j,t[42]=S,t[43]=E,t[44]=M):M=t[44],M}function dt(e){return(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-xs text-fg-muted`,children:e},e)}function ft(){return Le.list()}function pt(e){return e.language}function mt(e){let t=(0,X.c)(51),{initial:n,zh:r,busy:i,onClose:a,onSave:o}=e,[s,c]=(0,Z.useState)(n),l;t[0]!==i||t[1]!==a?(l=e=>{!e&&!i&&a()},t[0]=i,t[1]=a,t[2]=l):l=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(x,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),t[3]=u):u=t[3];let d=r?`编辑纪要内容`:`Edit meeting content`,f;t[4]===d?f=t[5]:(f=(0,Q.jsx)(`header`,{className:`border-b border-edge p-4`,children:(0,Q.jsx)(E,{children:d})}),t[4]=d,t[5]=f);let p=r?`人工修改会保留,重新整理不会覆盖。已创建任务保持不变。`:`Your changes survive regeneration. Existing tasks remain unchanged.`,m;t[6]===p?m=t[7]:(m=(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:p}),t[6]=p,t[7]=m);let h=r?`内容`:`Content`,g;t[8]===s?g=t[9]:(g=e=>c({...s,text:e.target.value}),t[8]=s,t[9]=g);let _;t[10]!==s.text||t[11]!==g?(_=(0,Q.jsx)(`textarea`,{className:`mt-1 min-h-32 w-full rounded border border-edge bg-transparent p-2`,value:s.text,onChange:g}),t[10]=s.text,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==h||t[14]!==_?(v=(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[h,_]}),t[13]=h,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==s||t[17]!==r?(y=s.kind===`actionItems`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`负责人原话`:`Owner as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.owner??``,onChange:e=>c({...s,owner:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`block text-sm`,children:[r?`期限原话`:`Date as stated`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-transparent p-2`,value:s.dueDate??``,onChange:e=>c({...s,dueDate:e.target.value})})]})]}):null,t[16]=s,t[17]=r,t[18]=y):y=t[18];let b;t[19]!==s||t[20]!==r?(b=s.kind===`summary`?null:(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!s.ignored,onChange:e=>c({...s,ignored:e.target.checked})}),r?`忽略此项`:`Ignore this item`]}),t[19]=s,t[20]=r,t[21]=b):b=t[21];let S;t[22]!==v||t[23]!==y||t[24]!==b||t[25]!==m?(S=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:[m,v,y,b]}),t[22]=v,t[23]=y,t[24]=b,t[25]=m,t[26]=S):S=t[26];let C=r?`取消`:`Cancel`,O;t[27]!==i||t[28]!==a||t[29]!==C?(O=(0,Q.jsx)(A,{disabled:i,onClick:a,children:C}),t[27]=i,t[28]=a,t[29]=C,t[30]=O):O=t[30];let k;t[31]!==i||t[32]!==s.text?(k=i||!s.text.trim(),t[31]=i,t[32]=s.text,t[33]=k):k=t[33];let j;t[34]!==s||t[35]!==o?(j=()=>void o(s),t[34]=s,t[35]=o,t[36]=j):j=t[36];let M=r?`保存修改`:`Save changes`,N;t[37]!==k||t[38]!==j||t[39]!==M?(N=(0,Q.jsx)(A,{variant:`primary`,disabled:k,onClick:j,children:M}),t[37]=k,t[38]=j,t[39]=M,t[40]=N):N=t[40];let P;t[41]!==O||t[42]!==N?(P=(0,Q.jsxs)(`footer`,{className:`flex justify-end gap-2 border-t border-edge p-3`,children:[O,N]}),t[41]=O,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==S||t[45]!==P||t[46]!==f?(F=(0,Q.jsxs)(w,{children:[u,(0,Q.jsxs)(T,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(32rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[f,S,P]})]}),t[44]=S,t[45]=P,t[46]=f,t[47]=F):F=t[47];let I;return t[48]!==l||t[49]!==F?(I=(0,Q.jsx)(D,{open:!0,onOpenChange:l,children:F}),t[48]=l,t[49]=F,t[50]=I):I=t[50],I}function ht(e,t,n){if(t===`summary`){let r=e.organization;if(!r)return``;let i=r.organization;if(!i)return``;let a=e=>e.filter(e=>n.showIgnored||!e.ignored);return JSON.stringify({discussionId:e.discussion.id,view:t,revision:r.revision,transcriptRevision:r.transcriptRevision,summary:i.summary,decisions:a(i.decisions),actionItems:a(i.actionItems),risks:a(i.risks),openQuestions:a(i.openQuestions),chapters:i.chapters},null,2)}let r=n.query.toLocaleLowerCase(),i=e.transcript.segments.filter(e=>(e.displayText??e.rawText??``).toLocaleLowerCase().includes(r)||e.speakerLabel?.toLocaleLowerCase().includes(r)).slice(0,n.page*50);return i.length?JSON.stringify({discussionId:e.discussion.id,view:t,revision:e.transcript.revision,scope:`loaded filtered segments only`,segments:i.map(e=>({sequence:e.sequence,startedAtMs:e.startedAtMs,speaker:e.speakerLabel,text:e.displayText??e.rawText??``}))},null,2):``}var gt=e=>`${String(Math.floor(e/6e4)).padStart(2,`0`)}:${String(Math.floor(e/1e3)%60).padStart(2,`0`)}`;function _t({noteId:e}){let t=v(e=>e.language)===`zh`,{data:n,mutate:r,isLoading:i}=k([`note-discussion-document`,e],()=>Re(e),{refreshInterval:e=>e&&([`recording`,`stopping`,`sealing`,`organizing`].includes(e.discussion.status)||e.recordingJob?.state===`queued`||e.recordingJob?.state===`running`)?3e3:0}),a=n?.discussion.id,u=`/api/discussions/${encodeURIComponent(a??``)}`,{data:d=[],mutate:m}=k(a?`${u}/actions`:null,e=>h(y(e)),{refreshInterval:1e4}),[g,_]=(0,Z.useState)(`summary`),[b,S]=(0,Z.useState)(``),[C,O]=(0,Z.useState)(`general`),[M,N]=(0,Z.useState)(null),[P,F]=(0,Z.useState)(null),[I,L]=(0,Z.useState)(null),[ee,R]=(0,Z.useState)(!1),[z,te]=(0,Z.useState)([]),[ne,re]=(0,Z.useState)(null),[B,ie]=(0,Z.useState)(!1),[ae,oe]=(0,Z.useState)(1),V=(0,Z.useRef)(null),se=(0,Z.useRef)(null),[ce,le]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{let e=()=>{r(),m()};return window.addEventListener(`discussion-updated`,e),window.addEventListener(`discussion-segment-updated`,e),()=>{window.removeEventListener(`discussion-updated`,e),window.removeEventListener(`discussion-segment-updated`,e)}},[r,m]),(0,Z.useEffect)(()=>{n?.discussion.template&&O(n.discussion.template)},[n?.discussion.template]);async function H(e){if(!B){ie(!0),re(null);try{await e(),await r(),await m()}catch(e){re(e instanceof Error?e.message:String(e))}finally{ie(!1)}}}function U(e){V.current&&(V.current.readyState===0?(se.current=e/1e3,V.current.load()):V.current.currentTime=e/1e3,V.current.play().catch(()=>void 0))}async function ue(e,t){n?.organization&&await H(async()=>{N((await h(y(`${u}/transcript?revision=${t??n.organization.transcriptRevision}`))).segments.filter(t=>e.includes(t.sequence)))})}let de=(e,n,r)=>n.some(e=>ee||!e.ignored)?(0,Q.jsxs)(`section`,{className:`space-y-2`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold text-fg`,children:e}),n.filter(e=>ee||!e.ignored).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 text-sm`,children:[(0,Q.jsxs)(`p`,{className:`flex-1 whitespace-pre-wrap`,children:[e.text,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更`:`Later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B,onClick:()=>L({kind:r,itemId:e.id,text:e.text,ignored:e.ignored}),children:t?`编辑`:`Edit`}),e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`shrink-0 text-accent-fg`,onClick:()=>void ue(e.evidenceSegmentIds,e.evidenceRevision),children:t?`原话`:`Source`}):(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:t?`暂无定位`:`No source timing`})]},e.id))]}):null;if(i)return(0,Q.jsx)(j,{className:`h-48 w-full`});if(!n)return null;let{discussion:W,transcript:fe,organization:pe}=n,G=pe?.organization,K=[`stopping`,`sealing`,`organizing`].includes(W.status),me=[`recording`,`completed`,`needs_attention`].includes(W.status),he=fe.segments.filter(e=>(e.displayText??e.rawText??``).toLocaleLowerCase().includes(b.toLocaleLowerCase())||e.speakerLabel?.toLocaleLowerCase().includes(b.toLocaleLowerCase())),ge=ht(n,g,{query:b,page:ae,showIgnored:ee});return(0,Q.jsxs)(`section`,{className:`relative flex h-full min-h-0 w-full flex-col text-fg`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 flex-wrap items-center gap-3 border-b border-edge-subtle p-4`,children:[(0,Q.jsx)(Ze,{className:`size-4 text-accent`}),(0,Q.jsxs)(`span`,{className:`text-sm font-medium`,children:[gt(W.durationMs??0),` · `,K?t?`正在整理`:`Processing`:W.status===`completed`?t?`整理完成`:`Ready`:W.status]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsxs)(c,{value:C,"aria-label":t?`纪要模板`:`Summary template`,onChange:e=>O(e.target.value),children:[(0,Q.jsx)(l,{value:`general`,children:t?`通用会议`:`General`}),(0,Q.jsx)(l,{value:`project`,children:t?`项目例会`:`Project`}),(0,Q.jsx)(l,{value:`review`,children:t?`需求评审`:`Review`}),(0,Q.jsx)(l,{value:`interview`,children:t?`客户访谈`:`Interview`})]}),(0,Q.jsxs)(A,{disabled:B||K||!W.canonicalTranscript,onClick:()=>void H(()=>h(y(`${u}/organize`),{method:`POST`,body:JSON.stringify({template:C})})),children:[(0,Q.jsx)(J,{className:`size-3.5`}),t?`重新整理`:`Regenerate`]})]})]}),(0,Q.jsxs)(`nav`,{"aria-label":t?`会议内容`:`Meeting content`,className:`flex shrink-0 items-center gap-4 border-b border-edge-subtle px-4 py-2 text-sm`,children:[[`summary`,`transcript`].map(e=>(0,Q.jsx)(`button`,{className:g===e?`font-medium text-accent-fg`:`text-fg-muted`,onClick:()=>_(e),children:e===`summary`?t?`纪要与行动`:`Summary & actions`:t?`逐字稿`:`Transcript`},e)),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(f,{className:`size-3`}),[`md`,`txt`,`srt`].map(e=>(0,Q.jsx)(`a`,{className:`text-accent-fg`,href:y(`${u}/export?format=${e}`),download:!0,children:e.toUpperCase()},e))]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b border-edge-subtle px-4 py-2`,children:[(0,Q.jsx)(Y,{resource:{kind:`note`,id:e,revision:String(n.note.remoteVersion??1)},selection:{text:ge,draft:!1},label:t?`引用当前会议内容到新对话`:`Reference displayed meeting content`,disabled:B||K||!!(I||P)||!ge||ge.length>16e3}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:ge.length>16e3?t?`内容超过 16,000 字符,请筛选更少的逐字稿内容后重试。`:`Over 16,000 characters. Filter fewer transcript segments and try again.`:t?`仅附带当前纪要或已加载的筛选逐字稿,不含录音;作为用户提供的文本。`:`Includes this summary or loaded filtered transcript only, not audio; treated as user-provided text.`})]}),ne?(0,Q.jsx)(`p`,{role:`alert`,className:`px-4 py-2 text-sm text-danger`,children:ne}):null,n.recordingJob?.state===`queued`||n.recordingJob?.state===`running`?(0,Q.jsx)(`p`,{role:`status`,className:`px-4 py-2 text-sm text-fg-muted`,children:t?`录音已上传,正在后台校验与保存。关闭此页面不会中断处理。`:`Recording uploaded. Verification and saving continue in the background, even if you close this page.`}):null,W.status===`needs_attention`?(0,Q.jsxs)(`div`,{className:`flex gap-2 p-4 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:W.failureMessage}),(0,Q.jsx)(`button`,{disabled:B,onClick:()=>void H(()=>Xe(W.id)),children:t?`重试`:`Retry`})]}):null,pe&&pe.transcriptRevision!==fe.revision?(0,Q.jsx)(`p`,{className:`px-4 py-2 text-xs text-fg-muted`,children:t?`转写已修改,当前纪要引用的是修改前版本。重新整理可生成新版纪要。`:`Transcript changed. This summary cites the previous revision; regenerate to update.`}):null,(0,Q.jsx)(`main`,{className:`min-h-0 flex-1 overflow-y-auto p-4 sm:p-6`,children:g===`summary`?G?(0,Q.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:G.summaryEditedByUser?t?`概要已人工编辑`:`Overview edited`:``}),(0,Q.jsx)(`button`,{disabled:B||K,onClick:()=>L({kind:`summary`,itemId:`summary`,text:G.summary}),children:t?`编辑概要`:`Edit overview`})]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:G.summary}),(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:ee,onChange:e=>R(e.target.checked)}),t?`显示已忽略项`:`Show ignored items`]}),z.length?(0,Q.jsx)(A,{disabled:B,onClick:()=>void H(async()=>{for(let e of z)await h(y(`${u}/actions/${encodeURIComponent(e)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:pe.revision})});te([])}),children:t?`加入所选 ${z.length} 项任务`:`Add ${z.length} selected tasks`}):null,de(t?`已决定事项`:`Decisions`,G.decisions,`decisions`),G.actionItems.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`下一步行动`:`Next actions`}),G.actionItems.filter(e=>ee||!e.ignored).map(e=>{let n=d.find(t=>t.actionId===e.id);return(0,Q.jsxs)(`article`,{className:`rounded-lg border border-edge-subtle p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[!n&&!e.ignored&&(!(e.supersededBy||e.disputedBy)||e.reviewedChangeId===(e.supersededBy??e.disputedBy))?(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`${t?`选择行动`:`Select action`}: ${e.title}`,className:`ui-checkbox`,checked:z.includes(e.id),onChange:t=>te(t.target.checked?[...z,e.id]:z.filter(t=>t!==e.id))}):null,(0,Q.jsxs)(`p`,{className:`flex-1 text-sm font-medium`,children:[e.title,e.supersededBy||e.disputedBy?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?`有后续变更,请复核`:`Review later changes`}):null,e.editedByUser?(0,Q.jsx)(`span`,{className:`ml-2 text-xs text-fg-muted`,children:t?e.ignored?`已忽略`:`人工编辑`:e.ignored?`Ignored`:`Edited`}):null]}),(0,Q.jsx)(`button`,{className:`text-xs text-fg-muted`,disabled:B||K,onClick:()=>L({kind:`actionItems`,itemId:e.id,text:e.title,owner:e.owner,dueDate:e.dueDate,ignored:e.ignored}),children:t?`编辑`:`Edit`})]}),(0,Q.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.owner??(t?`负责人未明确`:`Owner unspecified`),` · `,e.dueDate??(t?`期限未明确`:`Date unspecified`)]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs`,children:[e.evidenceSegmentIds.length?(0,Q.jsx)(`button`,{disabled:B,className:`text-accent-fg`,onClick:()=>void ue(e.evidenceSegmentIds,e.evidenceRevision),children:t?`查看原话`:`Source`}):null,n?n.deleted?(0,Q.jsx)(`span`,{children:t?`关联任务已删除`:`Linked task deleted`}):(0,Q.jsx)(o,{className:`text-accent-fg`,to:`/tasks/${encodeURIComponent(n.taskId)}`,children:n.resolution===`done`?t?`已完成 · 查看任务`:`Done · View task`:t?`查看任务 / 交给助手`:`View task / Delegate`}):e.ignored?null:(0,Q.jsx)(A,{disabled:B||!!(e.supersededBy||e.disputedBy)&&e.reviewedChangeId!==(e.supersededBy??e.disputedBy),onClick:()=>void H(()=>h(y(`${u}/actions/${encodeURIComponent(e.id)}/convert`),{method:`POST`,body:JSON.stringify({organizationRevision:pe.revision})})),children:t?`加入我的任务`:`Add to my tasks`})]})]},e.id)})]}):null,de(t?`风险`:`Risks`,G.risks,`risks`),de(t?`尚未确定`:`Open questions`,G.openQuestions,`openQuestions`),G.changes?.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`前后变更`:`Changes during the meeting`}),G.changes.map(e=>{let n=[...G.decisions,...G.actionItems,...G.risks,...G.openQuestions],r=n.find(t=>t.id===e.fromId),i=n.find(t=>t.id===e.toId);return!r||!i?null:(0,Q.jsxs)(`article`,{className:`space-y-2 rounded border border-edge p-3 text-sm`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:e.relation===`supersedes`?t?`后续撤销或替代`:`Later superseded`:t?`存在冲突,尚未明确解决`:`Unresolved conflict`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void ue(r.evidenceSegmentIds,r.evidenceRevision),children:`title`in r?r.title:r.text}),(0,Q.jsx)(`span`,{children:`↓`}),(0,Q.jsx)(`button`,{className:`block text-left text-accent-fg`,onClick:()=>void ue(i.evidenceSegmentIds,i.evidenceRevision),children:`title`in i?i.title:i.text})]},`${e.fromId}:${e.toId}`)})]}):null,G.chapters.length?(0,Q.jsxs)(`section`,{className:`space-y-3`,children:[(0,Q.jsx)(`h3`,{className:`font-semibold`,children:t?`章节回顾`:`Chapters`}),G.chapters.map((e,t)=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`button`,{className:`text-sm text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[gt(e.startedAtMs),` · `,e.title]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary})]},t))]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:K?t?`录音已保存,纪要正在生成。可以先查看逐字稿。`:`Recording saved. Summary is processing; you can read the transcript.`:t?`录音结束后自动生成纪要。`:`Summary appears after recording ends.`}),K?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(j,{className:`h-6 w-3/4`}),(0,Q.jsx)(j,{className:`h-24 w-full`})]}):null]}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-edge px-3`,children:[(0,Q.jsx)(be,{className:`size-4 text-fg-muted`}),(0,Q.jsx)(`input`,{className:`w-full bg-transparent py-2 text-sm outline-none`,placeholder:t?`查找原话或说话人`:`Search words or speaker`,value:b,onChange:e=>{S(e.target.value),oe(1)}})]}),he.slice(0,ae*50).map(e=>(0,Q.jsxs)(`article`,{className:`rounded-md border p-3 ${ce>=e.startedAtMs&&ce<e.endedAtMs?`border-accent`:`border-edge-subtle`}`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center gap-3 text-xs text-fg-muted`,children:[(0,Q.jsxs)(`button`,{className:`inline-flex items-center gap-1 text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[(0,Q.jsx)(Ye,{className:`size-3`}),gt(e.startedAtMs)]}),(0,Q.jsx)(`span`,{children:e.speakerLabel??(t?`未区分说话人`:`Speaker unknown`)}),me&&e.status===`confirmed`?(0,Q.jsx)(`button`,{className:`ml-auto`,onClick:()=>F({segment:e,text:e.displayText??e.rawText??``,speaker:e.speakerLabel??``}),children:t?`校对`:`Edit`}):null]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-6`,children:e.displayText??e.rawText??(t?`等待转写`:`Awaiting transcription`)})]},e.sequence)),he.length>ae*50?(0,Q.jsx)(A,{onClick:()=>oe(ae+1),children:t?`加载更多`:`More`}):null]})}),W.audioAttachmentId&&!W.audioDeletedAt?(0,Q.jsxs)(`footer`,{className:`shrink-0 border-t border-edge-subtle p-3`,children:[(0,Q.jsx)(`audio`,{ref:V,controls:!0,preload:`metadata`,className:`h-10 w-full`,src:y(`${u}/audio`),onTimeUpdate:()=>le((V.current?.currentTime??0)*1e3),onLoadedMetadata:()=>{se.current!==null&&V.current&&(V.current.currentTime=se.current,se.current=null)},onError:()=>re(t?`录音暂不可播放`:`Recording unavailable`)}),(0,Q.jsx)(`a`,{className:`mt-1 block text-right text-xs text-accent-fg`,href:y(`${u}/audio`),download:!0,children:t?`下载录音`:`Download recording`})]}):null,M?(0,Q.jsxs)(`aside`,{"aria-label":t?`原话证据`:`Source evidence`,className:`absolute inset-y-0 right-0 z-10 flex w-[min(26rem,100%)] flex-col border-l border-edge bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(`h3`,{children:t?`原话证据`:`Source evidence`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭`:`Close`,onClick:()=>N(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto p-4`,children:M.length?M.map(e=>(0,Q.jsxs)(`article`,{children:[(0,Q.jsxs)(`button`,{className:`mb-2 text-xs text-accent-fg`,onClick:()=>U(e.startedAtMs),children:[gt(e.startedAtMs),` · `,e.speakerLabel??(t?`说话人未明确`:`Unknown speaker`)]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-7`,children:e.displayText??e.rawText})]},e.sequence)):(0,Q.jsx)(`p`,{children:t?`此版本暂无可定位原话。`:`No timed source available for this revision.`})})]}):null,I&&pe?(0,Q.jsx)(mt,{initial:I,zh:t,busy:B,onClose:()=>L(null),onSave:e=>H(async()=>{await h(y(`${u}/summary`),{method:`PATCH`,body:JSON.stringify({...e,expectedRevision:pe.revision})}),L(null)})},`${I.kind}:${I.itemId}:${pe.revision}`):null,P?(0,Q.jsx)(D,{open:!0,onOpenChange:e=>{e||F(null)},children:(0,Q.jsxs)(w,{children:[(0,Q.jsx)(x,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(T,{"aria-describedby":void 0,className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(28rem,90dvh)] w-[min(36rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between border-b border-edge p-4`,children:[(0,Q.jsx)(E,{children:t?`校对逐字稿`:`Edit transcript`}),(0,Q.jsx)(`button`,{"aria-label":t?`关闭校对`:`Close editor`,onClick:()=>F(null),children:(0,Q.jsx)(p,{className:`size-4`})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-3 overflow-y-auto p-4`,children:[(0,Q.jsxs)(`label`,{className:`block text-xs`,children:[t?`本段说话人`:`Speaker for this segment`,(0,Q.jsx)(`input`,{className:`mt-1 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:P.speaker,onChange:e=>F({...P,speaker:e.target.value})})]}),P.segment.speakerLabel?(0,Q.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,checked:!!P.applyToSpeakerGroup,onChange:e=>F({...P,applyToSpeakerGroup:e.target.checked})}),t?`同时更名所有同标签片段;输入已有标签可合并说话人`:`Rename all segments with this label; use an existing label to merge speakers`]}):null,(0,Q.jsx)(`textarea`,{className:`min-h-32 w-full rounded border border-edge bg-surface-inset p-2 text-sm`,value:P.text,onChange:e=>F({...P,text:e.target.value})})]}),(0,Q.jsx)(`footer`,{className:`border-t border-edge p-3`,children:(0,Q.jsxs)(A,{variant:`primary`,disabled:B||!P.text.trim(),onClick:()=>void H(async()=>{await h(y(`${u}/segments/${P.segment.sequence}`),{method:`PATCH`,body:JSON.stringify({displayText:P.text,speakerLabel:P.speaker,expectedRevision:P.segment.revision,applyToSpeakerGroup:P.applyToSpeakerGroup,expectedTranscriptRevision:fe.revision})}),F(null)}),children:[(0,Q.jsx)(s,{className:`size-4`}),t?`保存修订`:`Save revision`]})})]})]})}):null]})}var vt={edit:Ve,ai_edit:L,sync:J,restore:he};function yt(e,t){return{edit:t.triggerEdit,ai_edit:t.triggerAiEdit,sync:t.triggerSync,restore:t.triggerRestore}[e]??e}function bt({noteId:e,activeTimestamp:t,onSelect:n,onClose:r,onRestored:i}){let a=v(e=>e.language),o=b(a).notes,s={justNow:o.justNow,minutesAgo:o.minutesAgo,today:o.today,yesterday:o.yesterday,daysAgo:o.daysAgo,locale:_(a)},{data:c}=k(e?[`note-history`,e]:null,()=>ye(e)),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),y=(0,Z.useCallback)(async t=>{u(!0),g(null);try{await Ee(e,t),f(null),i()}catch{g(o.restoreFailed)}finally{u(!1)}},[e,o.restoreSuccess,o.restoreFailed,i]),x=Date.now();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-edge px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,Q.jsx)(Be,{className:`size-4`,"aria-hidden":!0}),o.history]}),(0,Q.jsx)(`button`,{type:`button`,onClick:r,className:`rounded-lg p-1 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(p,{className:`size-4`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[h?(0,Q.jsx)(`p`,{className:`border-b border-danger/20 bg-danger-soft px-4 py-2 text-xs text-danger`,role:`alert`,children:h}):null,c?.length?(0,Q.jsx)(`ul`,{className:`divide-y divide-edge`,children:c.map(e=>{let r=vt[e.trigger]??Ve,i=t===e.timestamp,a=d===e.timestamp;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:m(`w-full px-4 py-3 text-left transition-colors`,i?`bg-accent/10`:`hover:bg-surface-hover`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(r,{className:`size-3.5 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:yt(e.trigger,o)}),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-fg-muted`,children:$(e.timestamp,x,s)})]}),e.snippet&&(0,Q.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-muted/60`,children:e.snippet})]}),i&&(0,Q.jsx)(`div`,{className:`border-t border-edge/50 px-4 py-2`,children:a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-fg-muted`,children:o.restoreConfirm}),(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),y(e.timestamp)},disabled:l,className:`shrink-0 rounded-lg bg-accent px-3 py-1 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:opacity-50`,children:l?`...`:o.restore}),(0,Q.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),f(null)},className:`shrink-0 rounded-lg px-2 py-1 text-xs text-fg-muted hover:bg-surface-hover`,children:`Cancel`})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),f(e.timestamp)},className:`rounded-lg bg-surface-hover px-3 py-1 text-xs font-medium text-fg transition-colors hover:bg-accent hover:text-on-accent`,children:o.restore})})]},e.timestamp)})}):(0,Q.jsxs)(`div`,{className:`px-4 py-8 text-center`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-medium text-fg-muted`,children:o.historyEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted/60`,children:o.historyEmptyDescription})]})]})]})}function xt({noteId:e,note:t,catalyzing:n,onCatalyze:r,onClose:i,noteThreads:o,openingChat:s,onOpenChat:c,onOpenNewChat:l}){let u=b(v(e=>e.language)).notes,d=a(),f=t?.aiDeep?.catalysis,p=f?.report??null,[h,g]=(0,Z.useState)(null),[_,y]=(0,Z.useState)(!1),{data:x,mutate:S,isLoading:C}=k(e?[`note-agent-context-status`,e]:null,()=>H(e),{revalidateOnFocus:!1}),w=(0,Z.useCallback)(async()=>{if(!_){y(!0),g(null);try{await S(()=>je(e),{revalidate:!1})}catch(e){g(`${u.contextRebuildFailed}: ${e instanceof Error?e.message:u.quickCaptureFailedHint}`)}finally{y(!1)}}},[_,S,u.contextRebuildFailed,u.quickCaptureFailedHint,e]),T=(0,Z.useCallback)(async t=>{try{await Ce(e,t)}catch{}},[e]);return(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-edge-subtle px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(L,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`text-sm font-semibold text-fg`,children:u.catalysisSectionTitle})]}),(0,Q.jsx)(`button`,{type:`button`,onClick:i,"aria-label":u.lightboxClose,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:(0,Q.jsx)(Qe,{className:`size-4 rotate-180`,"aria-hidden":!0})})]}),(0,Q.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[(0,Q.jsx)(`p`,{className:`mb-4 text-xs leading-relaxed text-fg-muted`,children:u.catalysisSectionDescription}),x?(0,Q.jsxs)(`section`,{className:`mb-4 rounded-xl bg-surface-base p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.contextStatusTitle}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void w(),disabled:C||_,className:`rounded-md px-1.5 py-0.5 text-[11px] font-medium text-accent transition-colors hover:bg-accent/10 disabled:cursor-not-allowed disabled:opacity-50`,children:_?u.processing:u.contextRebuild}),(0,Q.jsx)(`span`,{className:m(`rounded-full px-2 py-0.5 text-[11px] font-medium`,x.status===`ready`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`:x.status===`partial`?`bg-amber-500/10 text-amber-600 dark:text-amber-300`:`bg-red-500/10 text-red-600 dark:text-red-300`),children:x.status})]}),(0,Q.jsx)(`div`,{className:`mt-2 text-xs leading-relaxed text-fg-muted`,children:u.contextStatusDetail.replace(`{{attachments}}`,String(x.attachments.length)).replace(`{{tokens}}`,String(x.tokenEstimate??0))}),h?(0,Q.jsx)(`p`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:h}):null,x.attachments.length>0?(0,Q.jsx)(`div`,{className:`mt-3 space-y-1.5`,children:x.attachments.slice(0,5).map(e=>(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded-lg bg-surface-hover px-2 py-1.5 text-xs`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`shrink-0 text-fg-muted`,children:e.status})]},e.attachmentId))}):null]}):null,(0,Q.jsx)(`button`,{type:`button`,onClick:r,disabled:n,className:`w-full rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:n?u.processing:p?u.recatalyze:u.catalyzeAction}),p?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.valueHypothesis}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-fg`,children:p.valueHypothesis})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.targetUsers}),(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:p.targetUsers.slice(0,5).map(e=>(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2 py-0.5 text-xs text-fg`,children:e},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.keyQuestions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.keyQuestions.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.mvpPathLabel}),(0,Q.jsx)(`ol`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.mvpPath.slice(0,3).map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-fg-muted`,children:[t+1,`.`]}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.risks}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.risks.slice(0,3).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-fg-muted`}),(0,Q.jsx)(`span`,{children:e})]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:u.nextActions}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm leading-relaxed text-fg`,children:p.nextActions.slice(0,4).map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`rounded bg-accent/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-accent`,children:e.kind}),(0,Q.jsx)(`span`,{children:e.text})]},`${e.kind}:${e.text}`))})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-xs text-fg-muted`,children:u.confidenceLabel.replace(`{{percent}}`,String(Math.round(p.confidence*100)))}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackHelpfulAria,children:(0,Q.jsx)(z,{className:`size-3.5`,"aria-hidden":!0})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void T(`not_helpful`),className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,f?.feedback===`not_helpful`&&`bg-accent/10 text-accent`),"aria-label":u.feedbackNotHelpfulAria,children:(0,Q.jsx)(W,{className:`size-3.5`,"aria-hidden":!0})})]})]})]}):(0,Q.jsx)(`div`,{className:`mt-4 rounded-lg border border-dashed border-edge-subtle px-3 py-6 text-center text-sm text-fg-muted`,children:u.noCatalysisReportHint}),(0,Q.jsxs)(`section`,{className:`mt-6 rounded-xl bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,Q.jsx)(de,{className:`size-4 text-accent`,"aria-hidden":!0}),u.relatedThreadsTitle]}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:u.relatedThreadsDescription})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:c,disabled:s,className:`rounded-lg border border-edge px-2.5 py-1.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`,children:s?u.openingChat:u.openThread}),(0,Q.jsx)(`button`,{type:`button`,onClick:l,disabled:s,className:`rounded-lg bg-accent px-2.5 py-1.5 text-xs font-medium text-on-accent transition-colors hover:bg-accent/90 disabled:cursor-not-allowed disabled:opacity-50`,children:u.newThread})]})]}),o.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:o.slice(0,5).map(e=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>d(`/chat/${encodeURIComponent(e.key)}`),className:`w-full rounded-lg border border-edge-subtle px-3 py-2 text-left transition-colors hover:bg-surface-hover`,children:[(0,Q.jsx)(`div`,{className:`truncate text-sm font-medium text-fg`,children:e.name||u.noteDiscussionFallback}),(0,Q.jsx)(`div`,{className:`mt-0.5 text-xs text-fg-muted`,children:u.messageCount.replace(`{{count}}`,String(e.messageCount??0))})]},e.key))}):(0,Q.jsx)(`div`,{className:`rounded-lg border border-dashed border-edge-subtle px-3 py-5 text-center text-sm text-fg-muted`,children:u.noThreads})]})]})]})}var St=[{value:`86400000`,zh:`24 小时`,en:`24 hours`},{value:`604800000`,zh:`7 天`,en:`7 days`},{value:`2592000000`,zh:`30 天`,en:`30 days`}];function Ct({open:e,onOpenChange:t,note:n}){let r=v(e=>e.language)===`zh`,i=r?Dt:Ot,{data:a,mutate:o}=k(e?[`note-shares`,n.id]:null,()=>xe(n.id)),u=k(e?`hosted-share-auth-status`:null,ve),f=u.data===!0,m=k(e&&f?`hosted-publication-capabilities`:null,We),h=m.data?.publishing.allowed===!0,g=k(e&&f?[`hosted-note-publications`,n.id]:null,()=>se(n.id)),[_,y]=(0,Z.useState)(new Set),[b,j]=(0,Z.useState)(`86400000`),[N,P]=(0,Z.useState)(``),[L,ee]=(0,Z.useState)(``),[R,z]=(0,Z.useState)(`hosted`),[te,ne]=(0,Z.useState)(!1),[re,B]=(0,Z.useState)(null),[ie,ae]=(0,Z.useState)(null),[oe,V]=(0,Z.useState)(!1),[H,U]=(0,Z.useState)(null),ue=(0,Z.useMemo)(()=>{let e=new Set;return n.markdown.replace(/xopc-attachment:\/\/notes\/([^/]+)\/([^\s)]+)/gi,(t,r,i)=>{try{decodeURIComponent(r)===n.id&&e.add(decodeURIComponent(i))}catch{}return t}),(n.attachments??[]).filter(t=>e.has(t.id))},[n.attachments,n.id,n.markdown]);(0,Z.useEffect)(()=>{e&&(y(new Set(ue.map(e=>e.id))),ae(null),V(!1),U(null))},[e,ue]);let de=async()=>{ne(!0),U(null);try{let e={expectedNoteVersion:n.updatedAt,attachmentIds:[..._],ttlMs:Number(b),maxViews:N.trim()?Number(N):null,description:L.trim()||void 0};R===`hosted`?(ae((await q(n.id,e)).shareUrl),await g.mutate()):(ae((await ge(n.id,e)).payload.shareUrl),await o())}catch(e){U(e instanceof Error?e.message:String(e))}finally{ne(!1)}},W=async(e,t)=>{B(e.id),U(null);try{t===`refresh`?await Ue(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[..._]}):await M(e.id),await g.mutate()}catch(e){U(e instanceof Error?e.message:String(e))}finally{B(null)}},fe=async(e,t)=>{B(e.id),U(null);try{t===`refresh`?await Je(n.id,e.id,{expectedNoteVersion:n.updatedAt,attachmentIds:[..._]}):t===`extend`?await le(e.id,864e5):await Oe(e.id),await o()}catch(e){U(e instanceof Error?e.message:String(e))}finally{B(null)}},pe=async e=>{U(null);try{if(!await O(e)){V(!1),U(i.copyFailed);return}V(!0),window.setTimeout(()=>V(!1),1500)}catch{V(!1),U(i.copyFailed)}};return(0,Q.jsx)(D,{open:e,onOpenChange:t,children:(0,Q.jsxs)(w,{children:[(0,Q.jsx)(x,{className:`xopc-dialog-overlay fixed inset-0 z-[70] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(T,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[71] flex h-[min(42rem,calc(100dvh-2rem))] w-[min(40rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(E,{className:`flex items-center gap-2 text-base font-semibold text-fg`,children:[(0,Q.jsx)(ce,{className:`size-4`}),i.title]}),(0,Q.jsx)(S,{className:`mt-1 text-xs text-fg-muted`,children:i.description})]}),(0,Q.jsx)(C,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,className:`rounded-md p-1.5 text-fg-muted hover:bg-surface-hover`,"aria-label":i.close,children:(0,Q.jsx)(p,{className:`size-4`})})})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:[(0,Q.jsxs)(`section`,{className:`rounded-lg border border-edge bg-surface-inset p-4`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-semibold text-fg`,children:n.title||i.untitled}),(0,Q.jsx)(`p`,{className:`mt-2 line-clamp-4 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,children:n.markdown||i.empty}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-fg-subtle`,children:i.privateExcluded})]}),ue.length>0?(0,Q.jsxs)(`section`,{className:`mt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.attachments}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:ue.map(e=>(0,Q.jsxs)(`label`,{className:`flex items-center gap-3 rounded-lg border border-edge-subtle px-3 py-2 text-sm text-fg-muted`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:_.has(e.id),onChange:()=>y(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),className:`accent-accent`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:Et(e.size)})]},e.id))})]}):null,(0,Q.jsxs)(`section`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.delivery,(0,Q.jsxs)(c,{value:R,onChange:e=>z(e.target.value),children:[(0,Q.jsx)(l,{value:`hosted`,children:i.deliveryHosted}),(0,Q.jsx)(l,{value:`local`,children:i.deliveryLocal})]})]}),R===`hosted`&&u.data===!1?(0,Q.jsx)(`div`,{className:`sm:col-span-2`,children:(0,Q.jsx)(F,{providerId:`xopc-share`,displayName:`XOPC Hosted Share`,connected:!1,onConnected:()=>void u.mutate(!0,{revalidate:!1})})}):null,R===`hosted`&&f&&m.data&&!h?(0,Q.jsx)(`p`,{className:`rounded-lg border border-warning/30 bg-warning-soft px-3 py-2 text-xs text-warning sm:col-span-2`,children:i.hostedDisabled}):null,(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.expires,(0,Q.jsx)(c,{value:b,onChange:e=>j(e.target.value),children:St.map(e=>(0,Q.jsx)(l,{value:e.value,children:r?e.zh:e.en},e.value))})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[i.maxViews,(0,Q.jsx)(`input`,{type:`number`,min:1,max:1e3,value:N,onChange:e=>P(e.target.value),placeholder:i.unlimited,className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted sm:col-span-2`,children:[i.publicDescription,(0,Q.jsx)(`input`,{value:L,onChange:e=>ee(e.target.value),className:`h-9 rounded-md border border-edge bg-surface-panel px-3 text-sm text-fg outline-none focus:border-accent`})]})]}),ie?(0,Q.jsx)(`div`,{className:`mt-5 rounded-lg border border-success/25 bg-success-soft p-3`,children:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(`input`,{readOnly:!0,value:ie,className:`min-w-0 flex-1 bg-transparent text-xs text-fg outline-none`}),(0,Q.jsxs)(A,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void pe(ie),children:[oe?(0,Q.jsx)(s,{className:`size-4`}):(0,Q.jsx)(d,{className:`size-4`}),oe?i.copied:i.copy]}),(0,Q.jsxs)(A,{type:`button`,className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>window.open(ie,`_blank`,`noopener,noreferrer`),children:[(0,Q.jsx)(I,{className:`size-4`}),i.open]})]})}):null,H?(0,Q.jsx)(`p`,{className:`mt-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,children:H}):null,(a?.items.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.activeLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:a.items.map(e=>(0,Q.jsx)(Tt,{share:e,busy:re===e.id,t:i,onCopy:pe,onAction:fe},e.id))})]}):null,(g.data?.length??0)>0?(0,Q.jsxs)(`section`,{className:`mt-6 border-t border-edge pt-5`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:i.hostedLinks}),(0,Q.jsx)(`div`,{className:`mt-2 grid gap-2`,children:g.data.map(e=>(0,Q.jsx)(wt,{publication:e,stale:e.source?.version!==String(n.updatedAt),busy:re===e.id,publishingAllowed:h,t:i,onCopy:pe,onAction:W},e.id))})]}):null]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-edge px-5 py-3`,children:[(0,Q.jsx)(C,{asChild:!0,children:(0,Q.jsx)(A,{type:`button`,variant:`ghost`,children:i.close})}),(0,Q.jsxs)(A,{type:`button`,onClick:()=>void de(),disabled:te||R===`hosted`&&(!f||!h),children:[te?(0,Q.jsx)(K,{className:`size-4 animate-spin`}):(0,Q.jsx)(ce,{className:`size-4`}),te?i.creating:i.create]})]})]})]})})}function wt(e){let t=(0,X.c)(64),{publication:n,stale:r,busy:i,publishingAllowed:a,t:o,onCopy:s,onAction:c}=e,l=n.revoked||n.expired,u=l&&`opacity-60`,f;t[0]===u?f=t[1]:(f=m(`rounded-lg border border-edge-subtle p-3`,u),t[0]=u,t[1]=f);let p=r&&!l?o.stale:l?o.inactive:o.active,h;t[2]===p?h=t[3]:(h=(0,Q.jsx)(`span`,{children:p}),t[2]=p,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(`span`,{children:`·`}),t[4]=g):g=t[4];let _=n.maxViews===null?``:` / ${n.maxViews}`,v;t[5]!==n.viewCount||t[6]!==o.views||t[7]!==_?(v=(0,Q.jsxs)(`span`,{children:[o.views,` `,n.viewCount,_]}),t[5]=n.viewCount,t[6]=o.views,t[7]=_,t[8]=v):v=t[8];let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(`span`,{children:`·`}),t[9]=y):y=t[9];let b;t[10]!==n.revision||t[11]!==o.revision?(b=(0,Q.jsxs)(`span`,{children:[o.revision,` `,n.revision]}),t[10]=n.revision,t[11]=o.revision,t[12]=b):b=t[12];let x;t[13]!==h||t[14]!==v||t[15]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[h,g,v,y,b]}),t[13]=h,t[14]=v,t[15]=b,t[16]=x):x=t[16];let S;t[17]===n.shareUrl?S=t[18]:(S=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[17]=n.shareUrl,t[18]=S);let C;t[19]!==x||t[20]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[x,S]}),t[19]=x,t[20]=S,t[21]=C):C=t[21];let w;t[22]===i?w=t[23]:(w=i?(0,Q.jsx)(K,{className:`size-4 animate-spin text-fg-muted`}):null,t[22]=i,t[23]=w);let T;t[24]!==C||t[25]!==w?(T=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[C,w]}),t[24]=C,t[25]=w,t[26]=T):T=t[26];let E=!a,D;t[27]!==s||t[28]!==n.shareUrl?(D=()=>void s(n.shareUrl),t[27]=s,t[28]=n.shareUrl,t[29]=D):D=t[29];let O;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Q.jsx)(d,{className:`size-3.5`}),t[30]=O):O=t[30];let k;t[31]!==o.copy||t[32]!==E||t[33]!==D?(k=(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:E,onClick:D,children:[O,o.copy]}),t[31]=o.copy,t[32]=E,t[33]=D,t[34]=k):k=t[34];let j=!a,M;t[35]===n.shareUrl?M=t[36]:(M=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=M);let N;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(I,{className:`size-3.5`}),t[37]=N):N=t[37];let P;t[38]!==o.open||t[39]!==j||t[40]!==M?(P=(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:j,onClick:M,children:[N,o.open]}),t[38]=o.open,t[39]=j,t[40]=M,t[41]=P):P=t[41];let F;t[42]!==i||t[43]!==l||t[44]!==c||t[45]!==n||t[46]!==a||t[47]!==r||t[48]!==o.refresh?(F=r&&!l?(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i||!a,onClick:()=>void c(n,`refresh`),children:[(0,Q.jsx)(J,{className:`size-3.5`}),o.refresh]}):null,t[42]=i,t[43]=l,t[44]=c,t[45]=n,t[46]=a,t[47]=r,t[48]=o.refresh,t[49]=F):F=t[49];let L;t[50]!==i||t[51]!==c||t[52]!==n||t[53]!==o.revoke?(L=n.revoked?null:(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:i,onClick:()=>void c(n,`revoke`),children:[(0,Q.jsx)(te,{className:`size-3.5`}),o.revoke]}),t[50]=i,t[51]=c,t[52]=n,t[53]=o.revoke,t[54]=L):L=t[54];let ee;t[55]!==k||t[56]!==P||t[57]!==F||t[58]!==L?(ee=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[k,P,F,L]}),t[55]=k,t[56]=P,t[57]=F,t[58]=L,t[59]=ee):ee=t[59];let R;return t[60]!==T||t[61]!==f||t[62]!==ee?(R=(0,Q.jsxs)(`div`,{className:f,children:[T,ee]}),t[60]=T,t[61]=f,t[62]=ee,t[63]=R):R=t[63],R}function Tt(e){let t=(0,X.c)(68),{share:n,busy:r,t:i,onCopy:a,onAction:o}=e,s=n.revoked||n.expired,c=s&&`opacity-60`,l;t[0]===c?l=t[1]:(l=m(`rounded-lg border border-edge-subtle p-3`,c),t[0]=c,t[1]=l);let u=n.stale&&!s?i.stale:s?i.inactive:i.active,f;t[2]===u?f=t[3]:(f=(0,Q.jsx)(`span`,{children:u}),t[2]=u,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Q.jsx)(`span`,{children:`·`}),t[4]=p):p=t[4];let h=n.maxViews===null?``:` / ${n.maxViews}`,g;t[5]!==n.viewCount||t[6]!==i.views||t[7]!==h?(g=(0,Q.jsxs)(`span`,{children:[i.views,` `,n.viewCount,h]}),t[5]=n.viewCount,t[6]=i.views,t[7]=h,t[8]=g):g=t[8];let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(`span`,{children:`·`}),t[9]=_):_=t[9];let v;t[10]===n.expiresAt?v=t[11]:(v=new Date(n.expiresAt).toLocaleDateString(),t[10]=n.expiresAt,t[11]=v);let y;t[12]===v?y=t[13]:(y=(0,Q.jsx)(`span`,{children:v}),t[12]=v,t[13]=y);let b;t[14]!==y||t[15]!==f||t[16]!==g?(b=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-muted`,children:[f,p,g,_,y]}),t[14]=y,t[15]=f,t[16]=g,t[17]=b):b=t[17];let x;t[18]===n.shareUrl?x=t[19]:(x=(0,Q.jsx)(`div`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.shareUrl}),t[18]=n.shareUrl,t[19]=x);let S;t[20]!==b||t[21]!==x?(S=(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[b,x]}),t[20]=b,t[21]=x,t[22]=S):S=t[22];let C;t[23]===r?C=t[24]:(C=r?(0,Q.jsx)(K,{className:`size-4 animate-spin text-fg-muted`}):null,t[23]=r,t[24]=C);let w;t[25]!==S||t[26]!==C?(w=(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[S,C]}),t[25]=S,t[26]=C,t[27]=w):w=t[27];let T;t[28]!==a||t[29]!==n.shareUrl?(T=()=>void a(n.shareUrl),t[28]=a,t[29]=n.shareUrl,t[30]=T):T=t[30];let E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(d,{className:`size-3.5`}),t[31]=E):E=t[31];let D;t[32]!==i.copy||t[33]!==T?(D=(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:T,children:[E,i.copy]}),t[32]=i.copy,t[33]=T,t[34]=D):D=t[34];let O;t[35]===n.shareUrl?O=t[36]:(O=()=>window.open(n.shareUrl,`_blank`,`noopener,noreferrer`),t[35]=n.shareUrl,t[36]=O);let k;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(I,{className:`size-3.5`}),t[37]=k):k=t[37];let j;t[38]!==i.open||t[39]!==O?(j=(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:O,children:[k,i.open]}),t[38]=i.open,t[39]=O,t[40]=j):j=t[40];let M;t[41]!==r||t[42]!==s||t[43]!==o||t[44]!==n||t[45]!==i.refresh?(M=n.stale&&!s?(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`refresh`),children:[(0,Q.jsx)(J,{className:`size-3.5`}),i.refresh]}):null,t[41]=r,t[42]=s,t[43]=o,t[44]=n,t[45]=i.refresh,t[46]=M):M=t[46];let N;t[47]!==r||t[48]!==s||t[49]!==o||t[50]!==n||t[51]!==i.extend?(N=s?null:(0,Q.jsx)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`extend`),children:i.extend}),t[47]=r,t[48]=s,t[49]=o,t[50]=n,t[51]=i.extend,t[52]=N):N=t[52];let P;t[53]!==r||t[54]!==o||t[55]!==n||t[56]!==i.revoke?(P=n.revoked?null:(0,Q.jsxs)(A,{className:`px-2 py-1 text-xs`,variant:`ghost`,disabled:r,onClick:()=>void o(n,`revoke`),children:[(0,Q.jsx)(te,{className:`size-3.5`}),i.revoke]}),t[53]=r,t[54]=o,t[55]=n,t[56]=i.revoke,t[57]=P):P=t[57];let F;t[58]!==D||t[59]!==j||t[60]!==M||t[61]!==N||t[62]!==P?(F=(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[D,j,M,N,P]}),t[58]=D,t[59]=j,t[60]=M,t[61]=N,t[62]=P,t[63]=F):F=t[63];let L;return t[64]!==w||t[65]!==l||t[66]!==F?(L=(0,Q.jsxs)(`div`,{className:l,children:[w,F]}),t[64]=w,t[65]=l,t[66]=F,t[67]=L):L=t[67],L}function Et(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}var Dt={title:`分享笔记`,description:`创建一个无需登录即可查看的只读快照。`,close:`关闭`,untitled:`无标题笔记`,empty:`空笔记`,privateExcluded:`不会分享标签、AI 元数据、项目、讨论、历史版本或未引用附件。`,attachments:`包含的附件`,expires:`有效期`,maxViews:`最多查看次数`,unlimited:`不限`,publicDescription:`公开说明(可选)`,create:`创建分享链接`,creating:`创建中…`,copy:`复制`,copied:`已复制`,open:`打开`,activeLinks:`这条笔记的分享`,copyFailed:`无法复制到剪贴板,请手动选择链接并复制。`,delivery:`发布方式`,deliveryHosted:`平台托管(外网稳定访问)`,deliveryLocal:`本机直连(需要隧道或公网部署)`,hostedLinks:`平台托管发布`,revision:`版本`,hostedDisabled:`管理员已暂停你的公网分享能力。已有托管链接当前不可访问,但仍可撤销。`,stale:`旧版本`,inactive:`已失效`,active:`有效`,views:`查看`,refresh:`更新快照`,extend:`延长 24 小时`,revoke:`撤销`},Ot={title:`Share Note`,description:`Create a read-only snapshot that opens without sign-in.`,close:`Close`,untitled:`Untitled Note`,empty:`Empty Note`,privateExcluded:`Tags, AI metadata, projects, discussions, history, and unreferenced attachments are excluded.`,attachments:`Included attachments`,expires:`Expires`,maxViews:`Maximum views`,unlimited:`Unlimited`,publicDescription:`Public description (optional)`,create:`Create share link`,creating:`Creating…`,copy:`Copy`,copied:`Copied`,open:`Open`,activeLinks:`Shares for this Note`,copyFailed:`Could not copy to the clipboard. Select the link and copy it manually.`,delivery:`Publishing method`,deliveryHosted:`Hosted platform (stable public access)`,deliveryLocal:`Direct from this device (requires public access)`,hostedLinks:`Hosted publications`,revision:`Revision`,hostedDisabled:`An administrator has paused public sharing for your account. Existing hosted links are unavailable, but can still be revoked.`,stale:`Older version`,inactive:`Inactive`,active:`Active`,views:`Views`,refresh:`Update snapshot`,extend:`Extend 24 hours`,revoke:`Revoke`};function kt(e){let t=(0,X.c)(18),{input:n,labels:r,showLabel:i}=e,a=i===void 0?!0:i,o;t[0]===n?o=t[1]:(o=n(),t[0]=n,t[1]=o);let s=o.source.id,c;t[2]===s?c=t[3]:(c=e=>e.source?.type===`note`&&e.source.id===s&&e.status!==`idle`,t[2]=s,t[3]=c);let l=Fe(c),u;t[4]===s?u=t[5]:(u=e=>e.source?.type===`note`&&e.source.id===s&&e.status===`preparing`,t[4]=s,t[5]=u);let d=Fe(u),f=Fe(At),p;t[6]!==n||t[7]!==r||t[8]!==d||t[9]!==a?(p=(0,Q.jsx)(fe,{input:n,labels:r,disabled:d,showLabel:a}),t[6]=n,t[7]=r,t[8]=d,t[9]=a,t[10]=p):p=t[10];let m;t[11]!==l||t[12]!==r||t[13]!==f?(m=l?(0,Q.jsx)(`button`,{type:`button`,onClick:f,title:r.stop,"aria-label":r.stop,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(ae,{className:`size-3.5`,"aria-hidden":!0})}):null,t[11]=l,t[12]=r,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function At(e){return e.stop}function jt(e,t){let n=P(t.replace(/^\s*(`{3,}|~{3,})[^\n]*$/gm,``).replace(/xopc-attachment:\/\/[^\s)]+/g,``).replace(/^(\s*[-*+]\s+)\[[ xX]\]\s*/gm,`$1`)),r=P(e);return!r||n.split(`
|
|
3
|
-
`)[0]===r?n:[r,n].filter(Boolean).join(`
|
|
4
|
-
|
|
5
|
-
`)}var Mt=()=>i(()=>import(`./block-editor-bclvgove.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49])),Nt=()=>i(()=>import(`./markdown-editor-BhBJANcx.js`),__vite__mapDeps([50,1,47,5,51,52,3])),Pt=(0,Z.lazy)(()=>Mt().then(e=>({default:e.BlockEditor}))),Ft=(0,Z.lazy)(()=>Nt().then(e=>({default:e.MarkdownEditor})));function It(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col px-6 py-4`,"aria-busy":!0,children:[(0,Q.jsx)(`div`,{className:`h-8 w-56 max-w-full animate-pulse rounded-md bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-6 h-4 w-11/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-9/12 animate-pulse rounded bg-surface-hover`}),(0,Q.jsx)(`div`,{className:`mt-3 h-4 w-10/12 animate-pulse rounded bg-surface-hover`})]}),e[0]=t):t=e[0],t}function Lt(e){let t=(0,X.c)(29),{mode:n,onModeChange:r,labels:i}=e,a;t[0]===i.edit?a=t[1]:(a={id:`wysiwyg`,label:i.edit,Icon:Ze},t[0]=i.edit,t[1]=a);let o;t[2]===i.source?o=t[3]:(o={id:`source`,label:i.source,Icon:R},t[2]=i.source,t[3]=o);let c;t[4]===i.preview?c=t[5]:(c={id:`preview`,label:i.preview,Icon:Ie},t[4]=i.preview,t[5]=c);let l;t[6]!==a||t[7]!==o||t[8]!==c?(l=[a,o,c],t[6]=a,t[7]=o,t[8]=c,t[9]=l):l=t[9];let u=l,d;t[10]!==n||t[11]!==u?(d=u.find(e=>e.id===n)??u[0],t[10]=n,t[11]=u,t[12]=d):d=t[12];let f=d,p=f.Icon,m=Rt,h;t[13]===p?h=t[14]:(h=(0,Q.jsx)(p,{className:`size-3.5`,"aria-hidden":!0}),t[13]=p,t[14]=h);let g;t[15]===f.label?g=t[16]:(g=(0,Q.jsx)(`span`,{children:f.label}),t[15]=f.label,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(Ae,{className:`size-3 text-fg-subtle`,"aria-hidden":!0}),t[17]=_):_=t[17];let v;t[18]!==f.label||t[19]!==h||t[20]!==g?(v=(0,Q.jsx)($e,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"aria-label":f.label,className:`inline-flex h-8 items-center gap-1.5 rounded-lg border border-edge px-2.5 text-xs font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g,_]})}),t[18]=f.label,t[19]=h,t[20]=g,t[21]=v):v=t[21];let y;t[22]!==n||t[23]!==u||t[24]!==r?(y=(0,Q.jsx)(oe,{children:(0,Q.jsx)(pe,{align:`end`,sideOffset:6,className:`z-50 min-w-36 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:u.map(e=>{let{id:t,label:i,Icon:a}=e;return(0,Q.jsxs)(ne,{onSelect:()=>r(t),onPointerMove:()=>m(t),onFocus:()=>m(t),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(a,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:i}),n===t?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]},t)})})}),t[22]=n,t[23]=u,t[24]=r,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==v?(b=(0,Q.jsxs)(ue,{modal:!1,children:[v,y]}),t[26]=y,t[27]=v,t[28]=b):b=t[28],b}function Rt(e){e===`wysiwyg`&&Mt(),e===`source`&&Nt()}function zt(e){let t=(0,X.c)(16),{noteId:n,onBack:r,onSaved:i,showBackButton:a,backButtonClassName:o,clearHeaderOnCleanup:s,onOpenSearch:c,autoFocus:l,initialMode:u,onAutoFocusConsumed:d}=e,f=a===void 0?!0:a,p=s===void 0?!0:s,m=l===void 0?!1:l,h=v(Bt),g;t[0]===h?g=t[1]:(g=b(h),t[0]=h,t[1]=g);let _=g.notes.lightboxClose,y;t[2]!==m||t[3]!==o||t[4]!==p||t[5]!==u||t[6]!==n||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==i||t[11]!==f?(y=(0,Q.jsx)(Vt,{noteId:n,onBack:r,onSaved:i,showBackButton:f,backButtonClassName:o,clearHeaderOnCleanup:p,onOpenSearch:c,autoFocus:m,initialMode:u,onAutoFocusConsumed:d}),t[2]=m,t[3]=o,t[4]=p,t[5]=u,t[6]=n,t[7]=d,t[8]=r,t[9]=c,t[10]=i,t[11]=f,t[12]=y):y=t[12];let x;return t[13]!==_||t[14]!==y?(x=(0,Q.jsx)(rt,{closeLabel:_,children:y}),t[13]=_,t[14]=y,t[15]=x):x=t[15],x}function Bt(e){return e.language}function Vt({noteId:e,onBack:t,onSaved:n,showBackButton:r=!0,backButtonClassName:i,clearHeaderOnCleanup:o=!0,onOpenSearch:c,autoFocus:l=!1,initialMode:u=`wysiwyg`,onAutoFocusConsumed:d}){let f=v(e=>e.language),p=b(f).notes,h=b(f).chat.pageContext,_=b(f).automations.suggestions,{data:y}=k([`note-discussion-document`,e],()=>Re(e)),[x,S]=(0,Z.useState)(!0),C=a(),w=B(e=>e.resolved)===`dark`,{openImage:T}=tt(),[E,D]=(0,Z.useState)(u),[O,A]=(0,Z.useState)(null),[j,M]=(0,Z.useState)(null),[P,F]=(0,Z.useState)(!1),[I,R]=(0,Z.useState)(``),[z,ae]=(0,Z.useState)(360),[se,le]=(0,Z.useState)(!1),[H,W]=(0,Z.useState)(!1),[fe,K]=(0,Z.useState)(!1),he=(0,Z.useRef)(0);(0,Z.useEffect)(()=>()=>{he.current+=1},[e]);let[ge,q]=(0,Z.useState)(null),[ve,ye]=(0,Z.useState)(!1),[xe,Ce]=(0,Z.useState)(null),[Te,Ee]=(0,Z.useState)(!1),[Oe,Ae]=(0,Z.useState)(!1),je=(0,Z.useRef)(!1),Ie=(0,Z.useRef)(!1),Le=(0,Z.useRef)(null),Ve=(0,Z.useRef)(null),J=(0,Z.useRef)(null),He=(0,Z.useRef)(null),Ue=(0,Z.useRef)(null),We=(0,Z.useRef)(null),Ge=(0,Z.useRef)(null),qe=(0,Z.useRef)(null),Je=(0,Z.useRef)(null),Ye=V(e=>e.setPageHeader),Xe=V(e=>e.clearPageHeader),{data:Y,mutate:X,error:et}=k(e?[`note-detail`,e]:null,()=>re(e)),{data:nt=[],mutate:rt}=k(e?[`note-threads`,e]:null,()=>G(e),{revalidateOnFocus:!1}),it=j!==null,at=(0,Z.useCallback)(e=>{q(`${p.refreshFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)},[p.quickCaptureFailedHint,p.refreshFailed]);(0,Z.useEffect)(()=>{if(!e)return;let t=t=>{t.detail?.noteId===e&&X().catch(at)};return window.addEventListener(`note-updated`,t),()=>window.removeEventListener(`note-updated`,t)},[X,e,at]),(0,Z.useEffect)(()=>{je.current=!1,R(``),M(null),A(null),Ie.current=!1,Je.current=null},[e]),(0,Z.useEffect)(()=>{!Y||je.current||(R(Y.title??``),je.current=!0)},[Y]),(0,Z.useEffect)(()=>{if(!l||!Y||it||Je.current===e)return;let t=window.requestAnimationFrame(()=>{qe.current?.focus(),d?.()});return Je.current=e,()=>window.cancelAnimationFrame(t)},[l,it,Y,e,d]);let ot=Y?new Date(Y.createdAt).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):``,st=(0,Z.useMemo)(()=>r?(0,Q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":p.back,className:m(`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,N,i),children:(0,Q.jsx)(Qe,{className:`size-4`,"aria-hidden":!0})}):null,[i,p.back,t,r]),$=(0,Z.useCallback)(()=>{let t=Fe.getState();t.source?.type===`note`&&t.source.id===e&&t.stop()},[e]),ct=(0,Z.useCallback)(e=>{e!==`preview`&&$(),D(e)},[$]),lt=(0,Z.useCallback)(t=>{$(),R(t),e&&(He.current=t,Ve.current&&clearTimeout(Ve.current),Ve.current=setTimeout(async()=>{let t=He.current;if(He.current=null,t!==null){F(!0);try{await ze(e,{title:t}),await X(),n?.()}catch{}finally{F(!1)}}},600))},[$,e,X,n]),dt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-2`,N),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-fg`,title:I||ot||void 0,children:I||ot}),P?(0,Q.jsx)(`span`,{className:`shrink-0 text-xs text-fg-muted opacity-60`,children:p.saving}):null]}),[p.saving,P,ot,I]),ft=(0,Z.useCallback)(async(t=!1)=>{K(!0),q(null);try{let n=await ke(e,{forceNew:t});await X(),await rt(),C(`/chat/${encodeURIComponent(n.conversationId)}`)}catch(e){q(`${p.chatOpenFailedTitle}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{K(!1)}},[X,rt,C,e,p.chatOpenFailedMessage,p.chatOpenFailedTitle]),pt=(0,Z.useCallback)(async()=>{W(!0),q(null);try{await ee(e),await X()}catch(e){q(`${p.catalysisFailed}: ${e instanceof Error?e.message:p.chatOpenFailedMessage}`)}finally{W(!1)}},[X,e]),mt=(0,Z.useCallback)(()=>{A(O===`breakdown`?null:`breakdown`),!Y?.aiDeep?.catalysis?.report&&!H&&pt()},[O,H,pt,Y?.aiDeep?.catalysis?.report]),ht=(0,Z.useCallback)(()=>{let t=j?j.markdown??``:J.current??Y?.markdown??``,n=j?j.title??``:I,r=jt(n,t);return{source:{type:`note`,id:e,title:n||p.titlePlaceholder},text:r,language:Ne(r,f)}},[f,p.titlePlaceholder,Y?.markdown,e,j,I]),gt=(0,Z.useCallback)(async()=>{Le.current&&clearTimeout(Le.current),Ve.current&&clearTimeout(Ve.current),Le.current=null,Ve.current=null;let t=J.current,r=He.current;J.current=null,He.current=null;let i={};if(t!==null&&(i.markdown=t),r!==null&&(i.title=r),Object.keys(i).length===0)return Y??null;F(!0);try{let t=await ze(e,i);return await X(t,{revalidate:!1}),n?.(),t}catch(e){return J.current===null&&(J.current=t),He.current===null&&(He.current=r),q(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`),null}finally{F(!1)}},[X,p.saveFailed,p.saveFailedHint,Y,e,n]),vt=(0,Z.useCallback)(async()=>{if(!Y||fe||P)return;K(!0),q(null);let e=g.getState(),t=++he.current,n=()=>he.current===t&&g.getState().baseUrl===e.baseUrl&&g.getState().conversationId===e.conversationId;try{let t=window.getSelection(),r=t?.anchorNode&&t.focusNode&&Ue.current?.contains(t.anchorNode)&&Ue.current.contains(t.focusNode)?t.toString():``,i=await gt();if(!i||!n())return;if(J.current!==null||He.current!==null)throw Error(h.unavailable);let a=U.capture({title:i.title||i.id,text:i.markdown,resourceRefs:[{kind:`note`,id:i.id,revision:String(i.remoteVersion??1)}],selection:r?{text:r,draft:!1}:void 0}),o=await new Me().createSession();if(!n())return;if(J.current!==null||He.current!==null)throw Error(h.unavailable);let s=ie(e.baseUrl,e.conversationId,o.key);if(!U.put(s,a))throw Error(h.unavailable);C(`/chat/${encodeURIComponent(o.key)}`)}catch{n()&&q(h.unavailable)}finally{he.current===t&&K(!1)}},[Y,fe,P,gt,C,h.unavailable]),yt=(0,Z.useCallback)(async()=>{q(null);let e=await gt();e&&(Ce(e),ye(!0))},[gt]),St=(0,Z.useCallback)(async()=>{if(!(Oe||P)){Ee(!1),Ae(!0),q(null),$(),Le.current&&clearTimeout(Le.current),Ve.current&&clearTimeout(Ve.current),Le.current=null,Ve.current=null,J.current=null,He.current=null;try{await _e(e),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e}})),n?.(),t()}catch(e){q(`${p.deleteFailed}: ${e instanceof Error?e.message:p.quickCaptureFailedHint}`)}finally{Ae(!1)}}},[Oe,p.deleteFailed,p.quickCaptureFailedHint,e,t,n,P,$]),wt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:m(`flex min-w-0 items-center gap-1 sm:gap-2`,N),children:[c?(0,Q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":p.searchDialogTitle,className:`rounded-lg p-1.5 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(be,{className:`size-4`,"aria-hidden":!0})}):null,(0,Q.jsx)(kt,{input:ht,showLabel:!1,labels:{read:p.readAloud,preparing:p.readAloudPreparing,pause:p.readAloudPause,resume:p.readAloudResume,retry:p.readAloudRetry,stop:p.readAloudStop}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:mt,disabled:H,"aria-label":p.catalysisSectionTitle,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50`,O===`breakdown`?`bg-accent/10 text-accent`:`bg-accent/10 text-fg hover:bg-accent/15`),children:[(0,Q.jsx)(L,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:H?p.catalyzing:p.catalyzeButton})]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>ft(!1),"aria-label":p.openChatButton,disabled:fe,className:m(`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-medium transition-colors`,`border border-edge text-fg-muted hover:bg-surface-hover hover:text-fg disabled:cursor-not-allowed disabled:opacity-50`),children:[(0,Q.jsx)(de,{className:`size-3.5`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:fe?p.openingChat:p.openChatButton})]}),(0,Q.jsx)(Lt,{mode:E,onModeChange:ct,labels:{edit:p.modeEdit,source:p.modeSource,preview:p.modePreview}}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>void vt(),disabled:fe||P||!Y||!!j,className:`inline-flex items-center gap-1.5 rounded-lg border border-edge px-2.5 py-1.5 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:opacity-50`,children:[(0,Q.jsx)(Ze,{className:`size-3.5`,"aria-hidden":!0}),h.capture]}),(0,Q.jsxs)(ue,{modal:!1,children:[(0,Q.jsx)($e,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-label":p.noteActions,title:p.noteActions,className:`inline-flex size-8 items-center justify-center rounded-lg text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:(0,Q.jsx)(Pe,{className:`size-4`,"aria-hidden":!0})})}),(0,Q.jsx)(oe,{children:(0,Q.jsxs)(pe,{align:`end`,sideOffset:6,className:`z-50 min-w-40 rounded-xl border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,Q.jsxs)(ne,{onSelect:()=>void yt(),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(ce,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),f===`zh`?`分享`:`Share`]}),(0,Q.jsxs)(ne,{onSelect:()=>A(O===`history`?null:`history`),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,children:[(0,Q.jsx)(Be,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`flex-1`,children:p.history}),O===`history`?(0,Q.jsx)(s,{className:`size-4 text-accent`,"aria-hidden":!0}):null]}),(0,Q.jsx)(me,{className:`my-1 h-px bg-edge-subtle`}),(0,Q.jsxs)(ne,{disabled:Oe||P,onSelect:()=>Ee(!0),className:`flex cursor-pointer items-center gap-2 rounded-lg px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50`,children:[(0,Q.jsx)(te,{className:`size-4`,"aria-hidden":!0}),p.delete]})]})})]})]}),[H,mt,ft,vt,h.capture,Y,j,E,p.history,p.modeEdit,p.modePreview,p.modeSource,fe,O,c,p.searchDialogTitle,p.readAloud,p.readAloudPause,p.readAloudPreparing,p.readAloudResume,p.readAloudRetry,p.readAloudStop,ct,ht,yt,Oe,P,f,p.delete,Ee]);(0,Z.useLayoutEffect)(()=>(Ye({startExtra:st,main:Y?dt:null,end:Y?wt:null}),()=>{o&&Xe()}),[o,Xe,wt,dt,st,Y,Ye]);let Tt=(0,Z.useCallback)(t=>{e&&($(),J.current=t,Le.current&&clearTimeout(Le.current),Le.current=setTimeout(async()=>{let t=J.current;if(J.current=null,t!==null){F(!0),q(null);try{await ze(e,{markdown:t}),await X(),n?.()}catch(e){q(`${p.saveFailed}: ${e instanceof Error?e.message:p.saveFailedHint}`)}finally{F(!1)}}},600))},[$,e,X,p.saveFailed,p.saveFailedHint,n]),Et=(0,Z.useCallback)(t=>{Ke(e,t.timestamp).then(e=>{e&&($(),M(e))})},[e,$]),Dt=(0,Z.useCallback)(()=>{$(),A(null),M(null)},[$]),Ot=(0,Z.useCallback)(()=>{$(),A(null),M(null),X().catch(at),n?.()},[X,n,at,$]);if((0,Z.useEffect)(()=>()=>{Le.current&&clearTimeout(Le.current),Ve.current&&clearTimeout(Ve.current);let t=J.current,n=He.current;J.current=null,He.current=null;let r={};t!==null&&(r.markdown=t),n!==null&&(r.title=n),Object.keys(r).length>0&&ze(e,r).catch(()=>void 0)},[e]),Y===void 0)return et?(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 p-6 text-center`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:p.home.loadFailed}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>void X().catch(at),className:`rounded-lg border border-edge px-3 py-2 text-sm text-fg hover:bg-surface-hover`,children:p.home.retry}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm text-fg-muted hover:text-fg`,children:p.back})]}):(0,Q.jsx)(It,{});if(Y===null)return(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-center`,children:[(0,Q.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:p.notFoundTitle}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:p.notFoundDescription}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-lg border border-edge px-3 py-1.5 text-sm font-medium text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg`,children:p.back})]});let At=it?j.title??``:I,Mt=it?j.markdown??``:J.current??Y.markdown??``,Nt=new Date(Y.createdAt).getTime(),Rt=Number.isFinite(Nt)&&Date.now()-Nt<3600*1e3?(0,Q.jsx)(ut,{title:_.noteCreatedTitle,description:_.noteCreatedDescription,prompt:_.noteCreatedPrompt,coverage:{eventType:`note.created`,source:`notes`,eventPayload:{noteId:e}},variant:`titleAction`,className:`ml-3 hidden max-w-[18rem] shrink-0 md:flex`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 gap-3 p-4 sm:px-5`,children:[(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-0 min-w-0 w-full max-w-[60rem] flex-1 flex-col`,children:[ge?(0,Q.jsx)(`p`,{className:`mb-3 shrink-0 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:ge}):null,(0,Q.jsx)(Se,{eventType:`note.created`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),(0,Q.jsx)(Se,{eventType:`note.updated`,source:`notes`,payloadKey:`noteId`,payloadValue:e,className:`mb-3 shrink-0`}),y?(0,Q.jsxs)(`div`,{className:`mb-2 flex shrink-0 gap-4 text-sm`,children:[(0,Q.jsx)(`button`,{className:x?`text-accent-fg`:`text-fg-muted`,onClick:()=>S(!0),children:f===`zh`?`会议`:`Meeting`}),(0,Q.jsx)(`button`,{className:x?`text-fg-muted`:`text-accent-fg`,onClick:()=>S(!1),children:f===`zh`?`我的笔记`:`My notes`})]}):null,(0,Q.jsxs)(`div`,{ref:Ue,className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel xl:flex-row`,children:[y&&x?(0,Q.jsx)(_t,{noteId:e}):null,(0,Q.jsx)(`div`,{className:y&&x?`hidden`:`min-h-0 min-w-0 flex-1`,children:it?(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,children:[At&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg/70`,children:At}),Mt?(0,Q.jsx)(De,{noteId:e,content:Mt,className:`opacity-80`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]}):(0,Q.jsxs)(Q.Fragment,{children:[E===`wysiwyg`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:qe,type:`text`,value:I,onChange:e=>lt(e.target.value),onCompositionStart:()=>{Ie.current=!0},onCompositionEnd:()=>{Ie.current=!1},onKeyDown:e=>{let t=e.nativeEvent;e.key===`Enter`&&!Ie.current&&!t.isComposing&&(e.preventDefault(),(Ue.current?.querySelector(`.ProseMirror`))?.focus())},placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Rt]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(It,{}),children:(0,Q.jsx)(Pt,{initialContent:Y.markdown??``,onChange:Tt,noteId:e},`wysiwyg-${e}`)})})]}),E===`source`&&(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start px-6 pt-4`,children:[(0,Q.jsx)(`input`,{ref:qe,type:`text`,value:I,onChange:e=>lt(e.target.value),placeholder:p.titlePlaceholder,className:`min-w-0 flex-1 border-none bg-transparent text-2xl font-bold text-fg placeholder:text-fg-muted/40 focus:outline-none`}),Rt]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(It,{}),children:(0,Q.jsx)(Ft,{initialContent:Y.markdown??``,onChange:Tt,isDark:w},`source-${e}`)})})]}),E===`preview`&&(0,Q.jsxs)(`div`,{className:`h-full overflow-y-auto px-4 py-4 sm:px-6`,onClick:e=>{let t=e.target;t instanceof HTMLImageElement&&T(t.currentSrc||t.src,t.alt)},children:[I&&!Y.markdown.trimStart().startsWith(`# ${I.trim()}\n`)&&Y.markdown.trim()!==`# ${I.trim()}`&&(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold text-fg`,children:I}),Y.markdown?(0,Q.jsx)(De,{noteId:e,content:Y.markdown,className:`[&_img]:cursor-zoom-in`}):(0,Q.jsx)(`p`,{className:`italic text-fg-muted`,children:p.emptyPreview})]})]})})]})]}),(0,Q.jsx)(`div`,{ref:We,className:m(`relative flex min-h-0 shrink-0 flex-col overflow-hidden`,!se&&`transition-[width] duration-300 ease-in-out`),style:{width:O?z:0},children:(0,Q.jsxs)(`div`,{ref:Ge,className:`flex min-h-0 flex-1 flex-col`,style:{width:z},children:[(0,Q.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),le(!0);let n=e.clientX,r=z,i=e.pointerId,a=0,o=z,s=z,c=()=>{a=0,s=o,O&&We.current?.style.setProperty(`width`,`${s}px`),Ge.current?.style.setProperty(`width`,`${s}px`)},l=e=>{let t=r-(e.clientX-n);o=Math.max(280,Math.min(600,Math.round(t))),a===0&&(a=window.requestAnimationFrame(c))},u=()=>{a!==0&&(window.cancelAnimationFrame(a),c());try{t.releasePointerCapture(i)}catch{}le(!1),ae(s),window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,u)};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,u)},className:m(`absolute left-0 top-0 z-10 h-full w-2 -translate-x-1/2 cursor-col-resize`,`before:content-[''] before:pointer-events-none before:absolute before:left-1/2 before:top-0 before:h-full before:w-px before:-translate-x-1/2`,`before:bg-transparent before:transition-[background-color] before:duration-150`,`hover:before:bg-edge/65 dark:hover:before:bg-edge/75`,se&&`before:!bg-edge/80 dark:before:!bg-edge/85`,`touch-none select-none`)}),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:O===`history`?(0,Q.jsx)(bt,{noteId:e,activeTimestamp:j?.timestamp??null,onSelect:Et,onClose:Dt,onRestored:Ot}):O===`breakdown`?(0,Q.jsx)(xt,{noteId:e,note:Y??null,catalyzing:H,onCatalyze:pt,onClose:()=>A(null),noteThreads:nt,openingChat:fe,onOpenChat:()=>ft(!1),onOpenNewChat:()=>ft(!0)}):null})]})})]}),xe?(0,Q.jsx)(Ct,{open:ve,onOpenChange:ye,note:xe}):null,(0,Q.jsx)(we,{open:Te,title:p.deleteConfirmTitle,description:p.deleteConfirmDescription.replace(`{{title}}`,Y.title||p.titlePlaceholder),confirmLabel:p.deleteConfirmLabel,cancelLabel:p.deleteCancelLabel,destructive:!0,onConfirm:()=>void St(),onCancel:()=>Ee(!1)})]})}export{tt as a,$ as i,lt as n,ct as r,zt as t};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,m as o,u as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as c}from"./popover-select-B-GDnZO9.js";import{f as l}from"./markdown-view-Ck_5MADq.js";import{t as u}from"./plus-Q2yW6OE7.js";import{t as d}from"./x-B_N4OPjy.js";import{t as f}from"./cn-JdwAhgNB.js";import{c as p,f as m,n as h}from"./locale-store-BIkcRr3t.js";import{t as g}from"./messages-7VAhscYe.js";import{i as _}from"./vendor-swr-BIWyz7Rc.js";import{t as v}from"./skeleton-BwbyijEw.js";import{$n as y,$o as ee,Bc as te,Cd as b,Ec as x,Fc as S,Fn as ne,Hn as C,In as w,Io as T,Ln as re,Pn as E,Po as ie,Qc as D,Rl as ae,Sc as O,Sl as oe,Wn as se,Xn as ce,Zc as le,_d as ue,_l as k,_u as de,ad as A,an as j,ba as fe,bd as pe,cn as M,er as N,fd as me,in as he,iu as ge,ju as _e,kl as P,lr as ve,nn as F,on as ye,pr as be,qa as xe,rn as Se,sn as I,ur as L,vd as Ce,wu as we,xd as Te,zn as Ee}from"./index--3c0awkr.js";import{i as De,t as Oe}from"./note-detail-panel-j6sioeL1.js";var R=n(),z=e(t(),1),B=r();function V({projectId:e}){let t=h(e=>e.language)===`zh`,n=i(),r=(0,z.useRef)(null),a=(0,z.useRef)(null),[o,s]=(0,z.useState)(null),[c,l]=(0,z.useState)(null),[u,d]=(0,z.useState)(null);async function f(){let t=a.current;if(!(!t||o!==null)){s(0),l(null);try{let r=await M();if(r.consentAcknowledgedAt==null){d(r.consentPolicyVersion);return}let i=await F(t.file,t.requestId),o=await I({clientRequestId:t.requestId,contextProjectId:e,source:`web`,consentPolicyVersion:r.consentPolicyVersion});t.discussionId=o.discussion.id,await j({...i,serverDiscussionId:o.discussion.id,projectId:e}),o.discussion.audioAttachmentId||await Se(i,o.discussion.id,s),await he(t.requestId),a.current=null,n(`/notes/${encodeURIComponent(o.note.id)}`)}catch(e){l(e instanceof Error?e.message:String(e))}finally{s(null)}}}return(0,B.jsxs)(`div`,{className:`inline-flex flex-wrap items-center gap-2 text-xs`,children:[(0,B.jsx)(`input`,{ref:r,hidden:!0,type:`file`,accept:`audio/*,.m4a,.wav,.mp3,.webm,.ogg`,onChange:e=>{let n=e.target.files?.[0];if(e.target.value=``,n){if(!n.size||n.size>1073741824){l(t?`音频须为 1 字节至 1 GiB`:`Audio must be between 1 byte and 1 GiB`);return}a.current={file:n,requestId:crypto.randomUUID()},f()}}}),(0,B.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-md p-2 hover:bg-surface-hover`,disabled:o!==null,onClick:()=>c&&a.current?void f():r.current?.click(),children:[(0,B.jsx)(O,{className:`size-3.5`}),o===null?c&&a.current?t?`重试导入`:`Retry import`:t?`导入录音`:`Import recording`:`${o}%`]}),u===null?null:(0,B.jsxs)(`span`,{children:[t?`请确认你有权上传此录音,并允许配置的语音服务处理。`:`Confirm permission to upload this recording and process it with your configured speech service.`,(0,B.jsx)(`button`,{type:`button`,className:`p-2 text-accent`,onClick:()=>void ye(u).then(()=>(d(null),f())).catch(e=>l(String(e))),children:t?`确认导入`:`Confirm import`})]}),c?(0,B.jsx)(`span`,{role:`alert`,className:`text-danger`,children:c}):null]})}async function H(e){e.note??=await C({title:e.title,markdown:e.markdown,projectId:e.projectId,channel:`web`},e.requestId);let t=e.note.id;for(let n=e.attachments.length;n<e.files.length;n++)e.attachments.push(await L(t,e.files[n],`${e.requestId}:file:${n}`));if(e.attachments.length){let n=e.attachments.map(e=>`[${e.fileName.replace(/[\\[\]]/g,`\\$&`).replace(/[\r\n]/g,` `)}](${be(t,e.id)})`);e.note=await ve(t,{markdown:`${e.markdown}\n\n## ${e.materialHeading}\n\n${n.join(`
|
|
2
|
-
|
|
3
|
-
`)}`})}return{noteId:t,conversationId:(await N(t,{projectId:e.projectId})).conversationId}}function U(e,t,n){let r=new URLSearchParams({draft:n.replace(`{{id}}`,t),autoSend:`1`});return`/chat/${encodeURIComponent(e)}?${r}`}var W={meeting:ue,requirements:we,research:D,weekly:A};function ke({projects:e,projectId:t,onProjectChange:n,onCreated:r,labels:a,projectsLoading:o,projectsError:s}){let l=a.home,u=i(),[p,m]=(0,z.useState)(``),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)([]),[y,ee]=(0,z.useState)(!1),[b,x]=(0,z.useState)(null),[S,ne]=(0,z.useState)(``),C=(0,z.useRef)(null),w=(0,z.useRef)(!1),T=(0,z.useRef)(null),re=(0,z.useRef)(null),E=y||!!C.current,D=h?l.templateOptions[h]:null,O=!!(p.trim()||_.length);async function oe(){if(!(w.current||!O&&!C.current)){w.current=!0,ee(!0),x(null),C.current??={requestId:crypto.randomUUID(),title:p.trim().split(`
|
|
4
|
-
`)[0]?.slice(0,80)||D?.label||a.titlePlaceholder,markdown:`## ${l.requestHeading}\n\n${D?`${D.prompt}\n`:``}${p.trim()}`,projectId:t||void 0,files:[..._],attachments:[],materialHeading:l.materialsHeading};try{let e=await H(C.current);r(),u(U(e.conversationId,e.noteId,l.agentPrompt))}catch(e){C.current.note&&r(),x(e instanceof Error?e.message:a.quickCaptureFailedHint)}finally{w.current=!1,ee(!1)}}}function se(){C.current=null,x(null),m(``),v([]),g(null),re.current?.focus()}return(0,B.jsxs)(`section`,{"aria-label":l.askLabel,children:[(0,B.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),oe()},className:`relative rounded-xl border border-edge bg-surface-panel p-4 focus-within:border-accent/60 sm:p-5`,children:[(0,B.jsxs)(`fieldset`,{disabled:E,className:`min-w-0`,children:[(0,B.jsxs)(`label`,{htmlFor:`notes-home-prompt`,className:`flex items-center gap-2 text-xs font-medium text-accent-fg`,children:[(0,B.jsx)(te,{className:`size-4`,"aria-hidden":!0}),l.askLabel]}),D?(0,B.jsxs)(`div`,{className:`mt-3 flex items-start gap-2 rounded-lg bg-accent-soft px-3 py-2 text-xs leading-5 text-accent-fg`,children:[(0,B.jsxs)(`p`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`font-medium`,children:[D.label,` · `]}),D.prompt.split(`
|
|
5
|
-
|
|
6
|
-
`)[0]]}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>g(null),"aria-label":a.searchClear,className:`shrink-0 rounded p-1 hover:bg-surface-hover`,children:(0,B.jsx)(d,{className:`size-3.5`})})]}):null,(0,B.jsx)(`textarea`,{ref:re,id:`notes-home-prompt`,value:p,onChange:e=>m(e.target.value),placeholder:D?D.prompt.split(`
|
|
7
|
-
|
|
8
|
-
`).at(-1):l.askPlaceholder,rows:2,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),oe())},className:`mt-2 min-h-16 w-full resize-y bg-transparent py-2 text-base leading-6 text-fg outline-none placeholder:text-fg-muted sm:text-sm`}),_.length?(0,B.jsx)(`ul`,{className:`mb-3 flex flex-wrap gap-2`,children:_.map((e,t)=>(0,B.jsxs)(`li`,{className:`flex max-w-full items-center gap-2 rounded-md border border-edge px-2 py-1 text-xs text-fg-muted`,children:[(0,B.jsx)(k,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name}),(0,B.jsx)(`button`,{type:`button`,"aria-label":`${l.removeMaterial}: ${e.name}`,onClick:()=>v(e=>e.filter((e,n)=>n!==t)),className:`rounded p-1 hover:bg-surface-hover`,children:(0,B.jsx)(d,{className:`size-3`})})]},`${e.name}-${t}`))}):null,(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 sm:pr-40`,children:[(0,B.jsx)(`div`,{className:`w-44 max-w-full`,children:(0,B.jsx)(c,{value:t,options:e.filter(e=>e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({value:e.id,label:e.name})),selectedLabel:t?e.find(e=>e.id===t)?.name:l.unassigned,placeholder:l.unassigned,emptyLabel:l.unassigned,ariaLabel:l.assignProject,triggerIcon:(0,B.jsx)(de,{className:`size-4 shrink-0`,"aria-hidden":!0}),triggerClassName:`h-8 border-transparent bg-transparent px-2 text-xs text-fg-muted hover:bg-surface-hover`,onChange:n,disabled:E,loading:o,statusMessage:s?l.projectsLoadFailed:void 0,searchPlaceholder:l.projectSearch,searchValue:S,onSearchChange:ne})}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>T.current?.click(),className:`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-fg-muted hover:bg-surface-hover`,children:[(0,B.jsx)(k,{className:`size-4`,"aria-hidden":!0}),l.addMaterials]}),(0,B.jsx)(`input`,{ref:T,type:`file`,multiple:!0,className:`hidden`,"aria-label":l.addMaterials,onChange:e=>{let t=Array.from(e.target.files??[]);v(e=>[...e,...t]),e.target.value=``}})]})]}),(0,B.jsx)(`div`,{className:`mt-2 flex justify-end sm:absolute sm:bottom-5 sm:right-5 sm:mt-0`,children:(0,B.jsxs)(`button`,{type:`submit`,disabled:y||!C.current&&!O,className:`inline-flex h-9 items-center gap-2 rounded-lg bg-accent px-4 text-sm font-medium text-on-accent hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,children:[y?(0,B.jsx)(ae,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,B.jsx)(Ce,{className:`size-4`,"aria-hidden":!0}),y?l.creating:b?l.retry:l.agentCreate]})})]}),b?(0,B.jsxs)(`div`,{className:`mt-3 rounded-lg border border-danger/25 bg-danger-soft px-3 py-3 text-xs text-danger`,role:`alert`,children:[(0,B.jsx)(`p`,{children:b}),C.current?.note?(0,B.jsx)(`p`,{className:`mt-1`,children:l.partialFailure}):null,(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3`,children:[C.current?.note?(0,B.jsx)(`button`,{type:`button`,onClick:()=>u(`/notes/${encodeURIComponent(C.current.note.id)}?edit=1`),className:`underline`,children:l.openSavedDraft}):null,(0,B.jsx)(`button`,{type:`button`,onClick:se,className:`underline`,children:l.newRequest})]})]}):null,(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-1 gap-y-1 text-xs text-fg-muted`,children:[(0,B.jsx)(`span`,{className:`mr-1 py-2`,children:l.templates}),Object.keys(W).map(e=>{let t=W[e];return(0,B.jsxs)(`button`,{type:`button`,disabled:E,"aria-pressed":h===e,onClick:()=>{g(h===e?null:e),re.current?.focus()},className:f(`inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover disabled:opacity-50`,h===e&&`bg-accent-soft text-accent-fg`),children:[(0,B.jsx)(t,{className:`size-3.5`,"aria-hidden":!0}),l.templateOptions[e].label]},e)}),(0,B.jsx)(V,{}),(0,B.jsxs)(`button`,{type:`button`,disabled:y,onClick:()=>ie(),className:`ml-auto inline-flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-surface-hover`,children:[(0,B.jsx)(P,{className:`size-3.5`,"aria-hidden":!0}),l.recordDiscussion]})]})]})}function Ae(e,t){let n=Number(e.get(`page`)??0),r=Number.isSafeInteger(n)&&n>=0?n:0,i=e.get(`view`);return{projectId:e.get(`projectId`)||void 0,unassigned:e.get(`unassigned`)===`true`||i===`unassigned`||void 0,pinned:i===`favorites`?!0:void 0,agentEdited:i===`agent`||void 0,status:i===`archived`?`archived`:void 0,search:t.trim()||void 0,sortBy:`updatedAt`,sortOrder:`desc`,limit:12,offset:r*12}}function je(e){let t=e.snippet?.trim()??``,n=e.title?.trim();return n&&t.startsWith(n)?t.slice(n.length).replace(/^[\s::·—-]+/,``):t}var G=`touch-target inline-flex min-h-9 items-center justify-center gap-2 rounded-lg px-3 text-sm text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:cursor-not-allowed disabled:opacity-50`;function K(){let e=h(e=>e.language),t=g(e).notes,n=t.home,r=p(e=>e.conversationId),o=T(e=>e.setPageHeader),l=T(e=>e.clearPageHeader),d=i(),{pathname:ie,search:D}=s(),[O,k]=a(),A=O.get(`projectId`)||``,j=O.get(`view`)||`all`,M=O.get(`unassigned`)===`true`||j===`unassigned`,N=O.get(`search`)||``,[he]=xe(N,250),[P,F]=(0,z.useState)(A),[ye,be]=(0,z.useState)(``),[Se,I]=(0,z.useState)(null),[L,Ce]=(0,z.useState)(!1),[Oe,R]=(0,z.useState)(new Set),[V,H]=(0,z.useState)(null),[U,W]=(0,z.useState)(null),K=(0,z.useRef)(new Set),q=(0,z.useRef)(null),Me=(0,z.useRef)(!1),Ne=(0,z.useRef)(null),Pe=Ae(O,he),J=(Pe.offset??0)/12,{data:Fe,error:Ie,isLoading:Le,mutate:Re}=_(r?[`notes-home`,r,Pe]:null,()=>y(Pe)),{data:ze,error:Be,isLoading:Y,mutate:Ve}=_(r?[`notes-home-projects`,r]:null,ce),X=ze?.items??[],He=X.find(e=>e.id===A)?.name??n.projectNotes,Ue=Fe?.items??[],Z=Fe?.total??0,We=Le||N!==he,Ge=(0,z.useMemo)(()=>({justNow:t.justNow,minutesAgo:t.minutesAgo,today:t.today,yesterday:t.yesterday,daysAgo:t.daysAgo,locale:m(e)}),[e,t.justNow,t.minutesAgo,t.today,t.yesterday,t.daysAgo]),[Ke,qe]=(0,z.useState)(()=>Date.now());(0,z.useEffect)(()=>{F(A)},[A]),(0,z.useEffect)(()=>{let e=window.setInterval(()=>qe(Date.now()),6e4);return()=>window.clearInterval(e)},[]);let Q=(0,z.useCallback)(()=>{Re().catch(()=>void 0),Ve().catch(()=>void 0)},[Re,Ve]);(0,z.useEffect)(()=>{let e=[`note-updated`,`note-created`,`note-deleted`,`project-updated`,`project-created`,`project-deleted`];return e.forEach(e=>window.addEventListener(e,Q)),()=>e.forEach(e=>window.removeEventListener(e,Q))},[Q]);let Je=(0,z.useCallback)((e,t=!1)=>{let n=`${ie}${D}`,r=new URLSearchParams({returnTo:n});t&&r.set(`edit`,`1`),d(`/notes/${encodeURIComponent(e)}?${r}`)},[ie,D,d]),Ye=(0,z.useCallback)(async()=>{if(!(Me.current||!r)){Me.current=!0,Ce(!0),I(null),q.current??={key:crypto.randomUUID(),projectId:P||void 0};try{let e=await C({markdown:``,kind:`thought`,projectId:q.current.projectId},q.current.key);q.current=null,Q(),Je(e.id,!0)}catch(e){I(`${t.createBlankFailed}: ${e instanceof Error?e.message:t.createBlankFailedHint}`)}finally{Me.current=!1,Ce(!1)}}},[P,t.createBlankFailed,t.createBlankFailedHint,Je,Q,r]),Xe=(0,z.useCallback)(e=>{k(t=>{let n=new URLSearchParams(t);return e?n.set(`search`,e):n.delete(`search`),n.delete(`page`),n},{replace:!0})},[k]);function $(e,t=`all`){let n=new URLSearchParams;e&&n.set(`projectId`,e),t===`unassigned`?n.set(`unassigned`,`true`):t!==`all`&&n.set(`view`,t),F(e),k(n)}function Ze(e){k(t=>{let n=new URLSearchParams(t);return M&&n.set(`unassigned`,`true`),e===`all`?n.delete(`view`):n.set(`view`,e),n.delete(`page`),n})}async function Qe(e,n){if(!K.current.has(e)){K.current.add(e),R(new Set(K.current)),I(null);try{await ve(e,{pinned:n}),Q()}catch(e){I(`${t.actionFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{K.current.delete(e),R(new Set(K.current))}}}async function $e(){let e=V;if(!(!e||U)){H(null),W(e.id),I(null);try{await se(e.id),window.dispatchEvent(new CustomEvent(`note-deleted`,{detail:{noteId:e.id}})),Q()}catch(e){I(`${t.deleteFailed}: ${e instanceof Error?e.message:t.quickCaptureFailedHint}`)}finally{W(null)}}}if((0,z.useLayoutEffect)(()=>{if(!r){l();return}return o({startExtra:null,main:(0,B.jsx)(`h1`,{className:`truncate text-base font-semibold text-fg`,children:t.title}),end:(0,B.jsxs)(`div`,{className:f(`flex min-w-0 items-center gap-2`,ee),children:[(0,B.jsxs)(`label`,{className:`flex h-9 w-32 min-w-0 items-center gap-2 rounded-lg border border-edge bg-surface-panel px-2 sm:w-48`,children:[(0,B.jsx)(le,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,B.jsx)(`input`,{ref:Ne,type:`search`,value:N,onChange:e=>Xe(e.target.value),"aria-label":t.searchDialogTitle,placeholder:t.searchPlaceholder,className:`min-w-0 flex-1 bg-transparent text-sm text-fg outline-none placeholder:text-fg-muted`})]}),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>void Ye(),disabled:L,"aria-label":n.blankNote,className:f(G,`border border-edge bg-surface-panel text-fg`),children:[L?(0,B.jsx)(ae,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,B.jsx)(u,{className:`size-4`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`hidden sm:inline`,children:n.blankNote})]})]})}),()=>l()},[l,Ye,L,n.blankNote,t.searchDialogTitle,t.searchPlaceholder,t.title,N,o,Xe,r]),(0,z.useEffect)(()=>{let e=e=>{!(e.metaKey||e.ctrlKey)||e.altKey||e.isComposing||e.target?.closest(`input, textarea, [contenteditable="true"], [role="dialog"]`)||(e.key.toLowerCase()===`n`&&(e.preventDefault(),Ye()),e.key.toLowerCase()===`f`&&(e.preventDefault(),Ne.current?.focus()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Ye]),!r)return(0,B.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-fg-muted`,children:t.needToken});let et=[{id:`all`,label:n.homeNav,Icon:oe},{id:`favorites`,label:n.favorites,Icon:S},{id:`unassigned`,label:n.unassigned,Icon:ge},{id:`archived`,label:t.filterArchived,Icon:b}],tt=A?`project:${A}`:M?`unassigned`:`all`;return(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-1 overflow-hidden bg-surface-panel`,children:[(0,B.jsxs)(`aside`,{className:`hidden w-44 shrink-0 flex-col gap-1 overflow-y-auto px-3 py-6 xl:flex`,"aria-label":n.homeNav,children:[et.map(({id:e,label:t,Icon:n})=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>$(``,e),"aria-current":!A&&(e===`unassigned`?M:!M&&j===e)?`page`:void 0,className:f(G,`justify-start px-2 text-left text-xs`,!A&&(e===`unassigned`?M:!M&&j===e)&&`bg-surface-hover font-medium text-fg`),children:[(0,B.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),t]},e)),(0,B.jsx)(`span`,{className:`mb-1 mt-7 px-2 text-xs text-fg-muted`,children:n.projects}),Y?[0,1,2].map(e=>(0,B.jsx)(v,{className:`mb-2 h-8 w-full`},e)):X.slice(0,8).map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>$(e.id),"aria-current":A===e.id?`page`:void 0,className:f(G,`justify-start px-2 text-left text-xs`,A===e.id&&`bg-surface-hover font-medium text-fg`),children:[(0,B.jsx)(de,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)),(0,B.jsxs)(`button`,{type:`button`,onClick:()=>d(`/projects`),className:f(G,`mt-2 justify-start px-2 text-xs`),children:[n.allProjects,(0,B.jsx)(pe,{className:`ml-auto size-3`,"aria-hidden":!0})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain`,children:(0,B.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col px-4 py-4 sm:py-7 sm:px-8 lg:px-10 lg:py-9`,children:[(0,B.jsxs)(`div`,{className:`mb-6 flex flex-wrap items-start justify-between gap-4`,children:[(0,B.jsx)(`h2`,{className:`min-w-0 break-words text-2xl font-semibold tracking-tight text-fg`,children:A?He:M?n.unassigned:n.homeTitle}),A?(0,B.jsxs)(`button`,{type:`button`,onClick:()=>d(`/projects/${encodeURIComponent(A)}`),className:f(G,`text-xs`),children:[n.openProject,(0,B.jsx)(pe,{className:`size-3.5`,"aria-hidden":!0})]}):null]}),Se?(0,B.jsx)(`p`,{className:`mb-4 rounded-lg border border-danger/25 bg-danger-soft px-3 py-2 text-sm text-danger`,role:`alert`,children:Se}):null,(0,B.jsx)(`div`,{className:`order-3 mt-6 sm:order-none sm:mt-0`,children:(0,B.jsx)(ke,{projects:X,projectId:P,onProjectChange:F,onCreated:Q,labels:t,projectsLoading:Y,projectsError:!!Be})}),Be?(0,B.jsxs)(`div`,{role:`alert`,className:`mt-4 flex items-center gap-3 text-xs text-danger`,children:[(0,B.jsx)(`span`,{children:n.projectsLoadFailed}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void Ve().catch(()=>void 0),className:`underline`,children:n.retry})]}):null,!A&&!M&&(Y||X.length>0)?(0,B.jsxs)(`section`,{className:`order-4 mt-8 sm:order-none`,"aria-label":n.continueProjects,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.continueProjects}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>d(`/projects`),className:`text-xs text-fg-muted hover:text-fg`,children:n.allProjects})]}),(0,B.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:Y?[0,1,2].map(e=>(0,B.jsx)(v,{className:`h-28 w-full`},e)):X.slice(0,3).map(e=>(0,B.jsxs)(`button`,{type:`button`,onClick:()=>$(e.id),className:`min-w-0 rounded-lg border border-edge bg-surface-panel p-3 text-left transition-colors sm:p-4 hover:bg-surface-base focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2 text-sm font-medium text-fg`,children:[(0,B.jsx)(de,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`truncate`,children:e.name})]}),e.description?(0,B.jsx)(`p`,{className:`mt-2 hidden line-clamp-1 text-xs text-fg-muted sm:block`,children:e.description}):null,(0,B.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center justify-between gap-1 text-xs text-fg-muted sm:mt-3`,children:[(0,B.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(e.noteCount))}),(0,B.jsx)(`span`,{children:e.updatedAt?De(e.updatedAt,Ke,Ge):n.emptyProject})]})]},e.id))})]}):null,(0,B.jsxs)(`section`,{className:`order-2 mt-2 pb-6 sm:order-none sm:mt-8`,"aria-label":n.recentNotes,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:A?n.projectNotes:n.recentNotes}),(0,B.jsx)(`div`,{className:`w-48 max-w-full`,children:(0,B.jsx)(c,{value:tt,allowEmpty:!1,ariaLabel:n.projects,placeholder:n.allNotes,options:[{value:`all`,label:n.allNotes},{value:`unassigned`,label:n.unassigned},...X.filter(e=>e.name.toLowerCase().includes(ye.toLowerCase())).map(e=>({value:`project:${e.id}`,label:e.name}))],selectedLabel:A?He:M?n.unassigned:n.allNotes,triggerClassName:`h-8 bg-surface-panel text-xs`,loading:Y,searchPlaceholder:n.projectSearch,searchValue:ye,onSearchChange:be,onChange:e=>$(e.startsWith(`project:`)?e.slice(8):``,e===`unassigned`?e:`all`)})})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 border-b border-edge`,"aria-label":t.libraryTitle,children:[[{id:`all`,label:t.filterAll},{id:`agent`,label:n.agentEdited},{id:`favorites`,label:n.favorites},{id:`archived`,label:t.filterArchived}].map(({id:e,label:t})=>(0,B.jsx)(`button`,{type:`button`,"aria-pressed":j===e||e===`all`&&j===`unassigned`,onClick:()=>Ze(e),className:f(`touch-target border-b-2 border-transparent py-3 text-xs text-fg-muted hover:text-fg`,(j===e||e===`all`&&j===`unassigned`)&&`border-fg font-medium text-fg`),children:t},e)),(0,B.jsx)(`span`,{className:`ml-auto py-3 text-xs text-fg-muted`,children:n.sortUpdated})]}),Ie?(0,B.jsxs)(`div`,{className:`py-10 text-center`,role:`alert`,children:[(0,B.jsx)(`p`,{className:`text-sm text-danger`,children:n.loadFailed}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void Re().catch(()=>void 0),className:f(G,`mt-2`),children:n.retry})]}):We?(0,B.jsx)(`div`,{"aria-busy":`true`,className:`divide-y divide-edge`,children:[0,1,2,3].map(e=>(0,B.jsxs)(`div`,{className:`flex items-center gap-3 py-4`,children:[(0,B.jsx)(v,{className:`h-10 w-8 shrink-0`}),(0,B.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,B.jsx)(v,{className:`h-4 w-2/3`}),(0,B.jsx)(v,{className:`h-3 w-1/2`})]})]},e))}):Ue.length===0?(0,B.jsxs)(`div`,{className:`flex flex-col items-center px-4 py-12 text-center`,children:[(0,B.jsx)(oe,{className:`mb-4 size-8 text-fg-muted`,strokeWidth:1.3,"aria-hidden":!0}),(0,B.jsx)(`h4`,{className:`text-sm font-medium text-fg`,children:N||j!==`all`&&j!==`unassigned`?n.noMatches:A?n.projectEmpty:n.emptyTitle}),(0,B.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-fg-muted`,children:N||j!==`all`&&j!==`unassigned`?n.noMatchesHint:A?n.projectEmptyHint:n.emptyDescription})]}):(0,B.jsx)(`ul`,{className:`divide-y divide-edge`,children:Ue.map(e=>{let r=e.voiceAttachmentId||e.kind===`voice`?ue:e.kind===`bookmark`?me:we,i=je(e)||(e.coverAttachmentId?t.imageNote:t.noText);return(0,B.jsxs)(`li`,{className:`group flex min-w-0 items-center gap-3 py-4`,children:[(0,B.jsxs)(`button`,{type:`button`,onClick:()=>Je(e.id),className:`touch-target flex min-w-0 flex-1 items-center gap-3 rounded-md text-left focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,B.jsx)(`span`,{className:`flex h-10 w-8 shrink-0 items-center justify-center rounded-md border border-edge text-fg-muted`,children:(0,B.jsx)(r,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-base font-medium text-fg sm:text-sm group-hover:text-accent-fg`,children:e.title||i.slice(0,48)||t.titlePlaceholder}),(0,B.jsxs)(`span`,{className:`mt-1 flex min-w-0 items-center gap-1.5 text-xs text-fg-muted`,children:[e.lastEditTrigger===`ai_edit`?(0,B.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-accent-fg`,children:[(0,B.jsx)(te,{className:`size-3`,"aria-hidden":!0}),n.agentEditLabel,(0,B.jsx)(`span`,{"aria-hidden":!0,children:`·`})]}):null,(0,B.jsx)(`span`,{className:`truncate`,children:i})]}),(0,B.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`mt-1.5 block text-xs text-fg-muted sm:hidden`,children:De(e.updatedAt,Ke,Ge)})]})]}),(0,B.jsx)(`span`,{className:`hidden max-w-32 truncate text-xs text-fg-muted md:block`,title:e.projects?.map(e=>e.name).join(` · `),children:e.projects?.map(e=>e.name).join(` · `)||n.unassigned}),(0,B.jsx)(`time`,{dateTime:new Date(e.updatedAt).toISOString(),className:`hidden w-24 shrink-0 text-right text-xs text-fg-muted sm:block`,children:De(e.updatedAt,Ke,Ge)}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>void Qe(e.id,!e.pinned),disabled:Oe.has(e.id),"aria-label":`${e.pinned?n.unfavorite:n.favorite}: ${e.title||t.titlePlaceholder}`,"aria-pressed":!!e.pinned,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:(0,B.jsx)(S,{className:f(`size-4`,e.pinned&&`fill-current text-fg`),"aria-hidden":!0})}),(0,B.jsxs)(re,{children:[(0,B.jsx)(Ee,{asChild:!0,children:(0,B.jsx)(`button`,{type:`button`,disabled:U===e.id,"aria-label":`${t.noteActions}: ${e.title||t.titlePlaceholder}`,className:`touch-target inline-flex size-9 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-accent`,children:U===e.id?(0,B.jsx)(ae,{className:`size-4 animate-spin`,"aria-hidden":!0}):(0,B.jsx)(_e,{className:`size-4`,"aria-hidden":!0})})}),(0,B.jsx)(w,{children:(0,B.jsx)(E,{align:`end`,sideOffset:4,className:`z-50 min-w-36 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:(0,B.jsxs)(ne,{className:`touch-target flex cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-danger-soft focus:bg-danger-soft`,onSelect:()=>H(e),children:[(0,B.jsx)(x,{className:`size-4`,"aria-hidden":!0}),t.delete]})})})]})]},e.id)})}),!We&&!Ie&&Z>0?(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-fg-muted`,"aria-live":`polite`,children:[(0,B.jsx)(`span`,{children:t.noteCount.replace(`{{count}}`,String(Z))}),Z>12||J>0?(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`button`,{type:`button`,"aria-label":n.previousPage,disabled:J===0,className:G,onClick:()=>k(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(J-1)),t}),children:(0,B.jsx)(Te,{className:`size-4`,"aria-hidden":!0})}),(0,B.jsxs)(`span`,{children:[J+1,` / `,Math.max(1,Math.ceil(Z/12))]}),(0,B.jsx)(`button`,{type:`button`,"aria-label":n.nextPage,disabled:(J+1)*12>=Z,className:G,onClick:()=>k(e=>{let t=new URLSearchParams(e);return t.set(`page`,String(J+1)),t}),children:(0,B.jsx)(pe,{className:`size-4`,"aria-hidden":!0})})]}):null]}):null]})]})}),(0,B.jsx)(fe,{open:V!==null,title:t.deleteConfirmTitle,description:t.deleteConfirmDescription.replace(`{{title}}`,V?.title||t.titlePlaceholder),confirmLabel:t.deleteConfirmLabel,cancelLabel:t.deleteCancelLabel,destructive:!0,onConfirm:()=>void $e(),onCancel:()=>H(null)})]})}function q(){let e=(0,R.c)(12),{noteId:t}=o(),n=i(),[r]=a(),s;e[0]===r?s=e[1]:(s=l(r.get(`returnTo`),`/notes`,[`/chat`,`/projects`,`/notes`,`/tasks`]),e[0]=r,e[1]=s);let c=s,u;e[2]!==n||e[3]!==c?(u=()=>{n(c)},e[2]=n,e[3]=c,e[4]=u):u=e[4];let d=u;if(!t)return null;let f=r.get(`edit`)===`1`?`wysiwyg`:`preview`,p;e[5]===r?p=e[6]:(p=r.get(`edit`),e[5]=r,e[6]=p);let m=p===`1`,h;return e[7]!==d||e[8]!==t||e[9]!==f||e[10]!==m?(h=(0,B.jsx)(`div`,{className:`mx-auto flex h-full min-h-0 w-full max-w-6xl flex-1 flex-col`,children:(0,B.jsx)(Oe,{noteId:t,onBack:d,initialMode:f,autoFocus:m},t)}),e[7]=d,e[8]=t,e[9]=f,e[10]=m,e[11]=h):h=e[11],h}function Me(){let e=(0,R.c)(2),{noteId:t}=o(),n;return e[0]===t?n=e[1]:(n=t?(0,B.jsx)(q,{}):(0,B.jsx)(K,{}),e[0]=t,e[1]=n),n}export{Me as NotesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-aKtaBQYM.js";import{a as n,n as r,t as i}from"./vendor-react-BOUWij0V.js";import{t as a}from"./createLucideIcon-DPHK1VkS.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./cn-JdwAhgNB.js";import{a as c,f as l,g as u,h as d,i as f,n as p,o as m,p as h,r as g,s as _,t as v,u as y}from"./es2015-DBLcMg5B.js";import{i as b,n as x}from"./dist-CxGUk8J-.js";import{a as S,i as C,n as w,r as T,t as E}from"./dist-CI_fqRk-.js";import{t as D}from"./skeleton-BwbyijEw.js";import{a as O,s as k,t as A}from"./settings-shell-dialog-layer-BU3UuiJr.js";import{n as ee,r as j}from"./settings-shell-layer-context-BTQUDoJ2.js";var M=a(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),N=r(),P=t({Anchor:()=>me,Arrow:()=>_e,Close:()=>ge,Content:()=>he,Popover:()=>V,PopoverAnchor:()=>H,PopoverArrow:()=>Y,PopoverClose:()=>J,PopoverContent:()=>q,PopoverPortal:()=>G,PopoverTrigger:()=>U,Portal:()=>Q,Root:()=>X,Trigger:()=>Z,createPopoverScope:()=>te}),F=e(n(),1),I=i(),L=`Popover`,[R,te]=d(L,[S]),z=S(),[ne,B]=R(L),V=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=z(t),c=F.useRef(null),[u,d]=F.useState(!1),[f,p]=l({prop:r,defaultProp:i??!1,onChange:a,caller:L});return(0,I.jsx)(C,{...s,children:(0,I.jsx)(ne,{scope:t,contentId:h(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:F.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:F.useCallback(()=>d(!0),[]),onCustomAnchorRemove:F.useCallback(()=>d(!1),[]),modal:o,children:n})})};V.displayName=L;var re=`PopoverAnchor`,H=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B(re,n),a=z(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return F.useEffect(()=>(o(),()=>s()),[o,s]),(0,I.jsx)(E,{...a,...r,ref:t})});H.displayName=re;var ie=`PopoverTrigger`,U=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B(ie,n),a=z(n),o=b(t,i.triggerRef),s=(0,I.jsx)(y.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":pe(i.open),...r,ref:o,onClick:u(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(E,{asChild:!0,...a,children:s})});U.displayName=ie;var W=`PopoverPortal`,[ae,oe]=R(W,{forceMount:void 0}),G=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=B(W,t);return(0,I.jsx)(ae,{scope:t,forceMount:n,children:(0,I.jsx)(f,{present:n||a.open,children:(0,I.jsx)(c,{asChild:!0,container:i,children:r})})})};G.displayName=W;var K=`PopoverContent`,q=F.forwardRef((e,t)=>{let n=oe(K,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=B(K,e.__scopePopover);return(0,I.jsx)(f,{present:r||a.open,children:a.modal?(0,I.jsx)(ce,{...i,ref:t}):(0,I.jsx)(le,{...i,ref:t})})});q.displayName=K;var se=x(`PopoverContent.RemoveScroll`),ce=F.forwardRef((e,t)=>{let n=B(K,e.__scopePopover),r=F.useRef(null),i=b(t,r),a=F.useRef(!1);return F.useEffect(()=>{let e=r.current;if(e)return v(e)},[]),(0,I.jsx)(p,{as:se,allowPinchZoom:!0,children:(0,I.jsx)(ue,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:u(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:u(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:u(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),le=F.forwardRef((e,t)=>{let n=B(K,e.__scopePopover),r=F.useRef(!1),i=F.useRef(!1);return(0,I.jsx)(ue,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),ue=F.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=B(K,n),p=z(n);return g(),(0,I.jsx)(m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(_,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,I.jsx)(T,{"data-state":pe(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),de=`PopoverClose`,J=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=B(de,n);return(0,I.jsx)(y.button,{type:`button`,...r,ref:t,onClick:u(e.onClick,()=>i.onOpenChange(!1))})});J.displayName=de;var fe=`PopoverArrow`,Y=F.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=z(n);return(0,I.jsx)(w,{...i,...r,ref:t})});Y.displayName=fe;function pe(e){return e?`open`:`closed`}var X=V,me=H,Z=U,Q=G,he=q,ge=J,_e=Y;function ve(e,t=!1){if(!t)return A;switch(e){case`modal`:return O;case`page`:return k;default:return`z-50`}}function ye(e){let t=(0,N.c)(14),{options:n,values:r,multiple:i,onChange:a,ariaLabel:o}=e,c=i===void 0?!1:i,l=(0,F.useId)(),u;if(t[0]!==c||t[1]!==l||t[2]!==a||t[3]!==n||t[4]!==r){let e;t[6]!==c||t[7]!==l||t[8]!==a||t[9]!==r?(e=e=>(0,I.jsxs)(`label`,{className:s(`touch-target flex min-h-10 min-w-0 items-center gap-3 rounded-md px-2 py-2 text-sm text-fg has-focus-visible:ring-2 has-focus-visible:ring-accent`,e.disabled?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-surface-hover`),children:[(0,I.jsx)(`input`,{type:c?`checkbox`:`radio`,name:l,value:e.value,checked:r.includes(e.value),disabled:e.disabled,className:`shrink-0 accent-accent`,onChange:t=>a(c?t.target.checked?[...r,e.value]:r.filter(t=>t!==e.value):[e.value])}),e.icon,(0,I.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.label})]},e.value),t[6]=c,t[7]=l,t[8]=a,t[9]=r,t[10]=e):e=t[10],u=n.map(e),t[0]=c,t[1]=l,t[2]=a,t[3]=n,t[4]=r,t[5]=u}else u=t[5];let d;return t[11]!==o||t[12]!==u?(d=(0,I.jsx)(`fieldset`,{"aria-label":o,className:`min-w-0 space-y-0.5`,children:u}),t[11]=o,t[12]=u,t[13]=d):d=t[13],d}var be=`flex max-h-[min(20rem,var(--radix-popover-content-available-height))] flex-col overflow-hidden`,xe=`min-h-0 flex-1 overflow-y-auto overscroll-y-contain touch-pan-y [scrollbar-gutter:stable]`;function Se({value:e,options:t,placeholder:n,allowEmpty:r=!0,emptyLabel:i=n,emptyDisabled:a=!1,disabledValues:c,disabled:l,id:u,ariaLabel:d,ariaLabelledBy:f,title:p,triggerClassName:m,triggerIcon:h,contentClassName:g,side:_=`bottom`,align:v=`start`,onChange:y,searchPlaceholder:b,searchValue:x,onSearchChange:S,loading:C=!1,statusMessage:w,selectedLabel:T}){let[E,O]=(0,F.useState)(!1),[k,A]=(0,F.useState)(null),N=j(),P=ee(k),L=ve(N,P!==null),R=t.find(t=>t.value===e),te=T??R?.label??(e?`${e} · unavailable`:n),z;return(0,I.jsxs)(X,{open:E,onOpenChange:O,children:[(0,I.jsx)(Z,{asChild:!0,children:(0,I.jsxs)(`button`,{ref:A,id:u,type:`button`,"aria-label":d,"aria-labelledby":f,title:p,disabled:l,className:s(`touch-target box-border flex h-10 w-full min-w-0 items-center justify-between gap-2 rounded-lg border border-edge bg-surface-inset px-3 text-left text-sm font-normal text-fg`,`hover:border-edge-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,l&&`cursor-not-allowed opacity-50 hover:border-edge`,m),children:[h,(0,I.jsx)(`span`,{className:s(`min-w-0 truncate`,!e&&`text-fg-subtle`),children:te}),(0,I.jsx)(M,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})}),(0,I.jsx)(Q,{container:P??void 0,children:(0,I.jsxs)(he,{side:_,align:v,sideOffset:4,collisionPadding:8,className:s(L,be,`w-[var(--radix-popover-trigger-width)] min-w-[16rem] rounded-lg border border-edge bg-surface-overlay p-1 shadow-popover outline-none`,g),children:[b?(0,I.jsx)(`input`,{type:`search`,"aria-label":b,placeholder:b,value:x,onChange:e=>S?.(e.target.value),className:`mb-1 w-full shrink-0 rounded-md bg-surface-base px-3 py-2 text-base text-fg placeholder:text-fg-subtle sm:text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}):null,(0,I.jsxs)(`div`,{"data-select-scroll-region":!0,className:s(xe,`max-h-64`),children:[r?(0,I.jsxs)(`button`,{type:`button`,disabled:a,className:s(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,e===``&&`bg-surface-active font-medium`,a&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{a||(y(``),O(!1))},children:[(0,I.jsx)(o,{className:s(`size-4 shrink-0`,e!==``&&`invisible`),"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-fg-subtle`,children:i})]}):null,C?(0,I.jsx)(`div`,{className:`space-y-2 p-2`,"aria-busy":`true`,children:[0,1,2].map(e=>(0,I.jsx)(D,{className:`h-8 w-full`},e))}):null,w&&!C?(0,I.jsx)(`p`,{role:`status`,className:`px-3 py-2 text-xs text-fg-muted`,children:w}):null,(C?[]:t).map(t=>{let n=t.disabled===!0||c?.has(t.value)===!0&&t.value!==e,r=t.group&&t.group!==z;return z=t.group,(0,I.jsxs)(F.Fragment,{children:[r?(0,I.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-fg-subtle`,children:t.group}):null,(0,I.jsxs)(`button`,{type:`button`,disabled:n,className:s(`touch-target flex h-9 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-fg hover:bg-surface-hover`,t.value===e&&`bg-surface-active font-medium`,n&&`cursor-not-allowed opacity-45 hover:bg-transparent`),onClick:()=>{n||(y(t.value),O(!1))},children:[t.icon??(0,I.jsx)(o,{className:s(`size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label}),t.icon?(0,I.jsx)(o,{className:s(`ml-auto size-4 shrink-0`,t.value!==e&&`invisible`),"aria-hidden":!0}):null]})]},`${t.group??``}:${t.value}`)})]})]})})]})}function $(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map($).join(``):(0,F.isValidElement)(e)?$(e.props.children):``}function Ce(e,t){let n=[];return F.Children.forEach(e,e=>{if(!(0,F.isValidElement)(e))return;if(e.type===F.Fragment){n.push(...Ce(e.props.children,t));return}if(e.type===Te){let t=e.props;n.push(...Ce(t.children,$(t.label)));return}if(e.type!==we)return;let r=e.props,i=$(r.children).trim(),a=r.value==null?i:String(r.value);n.push({value:a,label:i,disabled:r.disabled,group:t})}),n}function we(e){return null}function Te(e){return null}function Ee(e){if(!e)return;let t=e.split(/\s+/).filter(Boolean).filter(e=>{let t=e.includes(`:`)?e.slice(e.lastIndexOf(`:`)+1):e;return t===`block`||t===`inline-block`||t===`inline-flex`||t===`flex`||t===`flex-1`||t===`flex-auto`||t===`flex-initial`||t===`flex-none`||t===`grow`||t===`shrink`||t===`min-w-0`||t===`min-h-0`||t.startsWith(`w-`)||t.startsWith(`min-w-`)||t.startsWith(`max-w-`)||t.startsWith(`basis-`)||t.startsWith(`grow-`)||t.startsWith(`shrink-`)||t.startsWith(`self-`)||t.startsWith(`order-`)||t.startsWith(`col-`)||t.startsWith(`row-`)});return t.length===0?void 0:t.join(` `)}function De(e){let t=(0,N.c)(66),n,r,i,a,o,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12]):({align:n,children:r,className:i,contentClassName:a,disabled:o,id:c,onChange:l,placeholder:u,side:f,triggerClassName:p,value:m,...d}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m);let h=(0,F.useId)(),g=m==null?``:String(m),_,v,y,b,x,S,C,w,T,E;if(t[13]!==r||t[14]!==i||t[15]!==o||t[16]!==h||t[17]!==c||t[18]!==u||t[19]!==d.name||t[20]!==g){let e=Ce(r);b=e.find(ke),v=b!==void 0,y=b?.label||u||``,w=o||void 0,t[31]===i?T=t[32]:(T=Ee(i),t[31]=i,t[32]=T),E=d.name,_=Se,x=c??h,S=g,C=e.filter(Oe),t[13]=r,t[14]=i,t[15]=o,t[16]=h,t[17]=c,t[18]=u,t[19]=d.name,t[20]=g,t[21]=_,t[22]=v,t[23]=y,t[24]=b,t[25]=x,t[26]=S,t[27]=C,t[28]=w,t[29]=T,t[30]=E}else _=t[21],v=t[22],y=t[23],b=t[24],x=t[25],S=t[26],C=t[27],w=t[28],T=t[29],E=t[30];let D=u??y,O=b?.disabled===!0,k=d[`aria-label`],A=d[`aria-labelledby`],ee=d.title,j;t[33]!==i||t[34]!==p?(j=s(i,p),t[33]=i,t[34]=p,t[35]=j):j=t[35];let M;t[36]===l?M=t[37]:(M=e=>l?.({target:{value:e},currentTarget:{value:e}}),t[36]=l,t[37]=M);let P;t[38]!==_||t[39]!==n||t[40]!==v||t[41]!==a||t[42]!==o||t[43]!==y||t[44]!==d.title||t[45]!==f||t[46]!==x||t[47]!==A||t[48]!==j||t[49]!==M||t[50]!==S||t[51]!==C||t[52]!==D||t[53]!==O||t[54]!==k?(P=(0,I.jsx)(_,{id:x,value:S,options:C,placeholder:D,allowEmpty:v,emptyLabel:y,emptyDisabled:O,disabled:o,ariaLabel:k,ariaLabelledBy:A,title:ee,side:f,align:n,triggerClassName:j,contentClassName:a,onChange:M}),t[38]=_,t[39]=n,t[40]=v,t[41]=a,t[42]=o,t[43]=y,t[44]=d.title,t[45]=f,t[46]=x,t[47]=A,t[48]=j,t[49]=M,t[50]=S,t[51]=C,t[52]=D,t[53]=O,t[54]=k,t[55]=P):P=t[55];let L;t[56]!==o||t[57]!==d.name||t[58]!==g?(L=(0,I.jsx)(`input`,{name:d.name,value:g,readOnly:!0,hidden:!0,disabled:o}),t[56]=o,t[57]=d.name,t[58]=g,t[59]=L):L=t[59];let R;return t[60]!==P||t[61]!==L||t[62]!==w||t[63]!==T||t[64]!==E?(R=(0,I.jsxs)(`div`,{"aria-disabled":w,className:T,"data-select-name":E,children:[P,L]}),t[60]=P,t[61]=L,t[62]=w,t[63]=T,t[64]=E,t[65]=R):R=t[65],R}function Oe(e){return e.value!==``}function ke(e){return e.value===``}export{be as a,_e as c,Q as d,X as f,M as h,ye as i,ge as l,P as m,De as n,xe as o,Z as p,we as r,ve as s,Se as t,he as u};
|